PageRenderTime 60ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 1ms

/application/views/pages/admin/cats2.php

https://bitbucket.org/chadsaun/ifrogz-panel
PHP | 914 lines | 892 code | 11 blank | 11 comment | 45 complexity | 286a9205a307a547590cd45f5ea058a4 MD5 | raw file
  1. <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/scriptaculous-js/1.5.1/prototype.js"></script>
  2. <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/jquery/1.4.2/jquery.min.js" charset="utf-8"></script>
  3. <script type="text/javascript">
  4. $.noConflict();
  5. </script>
  6. <script language="JavaScript" type="text/javascript" src="http://assets.ifrogz.com/lib/packages/jquery-ui/1.8/jquery-ui.custom.min.js" charset="utf-8"></script>
  7. <link rel="stylesheet" href="http://assets.ifrogz.com/lib/packages/jquery-ui/1.8/ui-lightness/jquery-ui.custom.css" type="text/css" media="screen" title="no title" charset="utf-8">
  8. <?php
  9. //This code is copyright (c) Internet Business Solutions SL, all rights reserved.
  10. //The contents of this file are protect under law as the intellectual property of Internet
  11. //Business Solutions SL. Any use, reproduction, disclosure or copying of any kind
  12. //without the express and written permission of Internet Business Solutions SL is forbidden.
  13. //Author: Vince Reid, vince@virtualred.net
  14. //showarray($_POST);
  15. if(@$storesessionvalue=="") $storesessionvalue="virtualstore".time();
  16. if($_SESSION["loggedon"] != $storesessionvalue || @$disallowlogin==TRUE) exit();
  17. $success=TRUE;
  18. $maxcatsperpage = 100;
  19. $maxfilters = 20;
  20. if(@$maxloginlevels=="") $maxloginlevels=5;
  21. $sSQL = "";
  22. $alldata = "";
  23. $alreadygotadmin = getadminsettings();
  24. if(@$_POST["act"]=="changepos"){
  25. $currentorder = (int)@$_POST["selectedq"];
  26. $neworder = (int)@$_POST["newval"];
  27. $sectionTag=$_POST['sectionTag'];
  28. $sSQL = "SELECT sectionID, sectionTag FROM sf_sections ORDER BY sectionOrder";
  29. $result = mysql_query($sSQL) or print(mysql_error());
  30. $rowcounter=1;
  31. while($rs = mysql_fetch_assoc($result)){
  32. $theorder = $rowcounter;
  33. $theTag = $rs['sectionTag'];
  34. if($currentorder == $theorder){
  35. $theorder = $neworder;
  36. $theTag = $sectionTag;
  37. }elseif(($currentorder > $theorder) && ($neworder <= $theorder))
  38. $theorder++;
  39. elseif(($currentorder < $theorder) && ($neworder >= $theorder))
  40. $theorder--;
  41. $sSQL="UPDATE sf_sections SET sectionOrder=" . $theorder . ",sectionTag='".$theTag."' WHERE sectionID=" . $rs["sectionID"];
  42. mysql_query($sSQL) or print(mysql_error());
  43. $rowcounter++;
  44. }
  45. print '<meta http-equiv="refresh" content="1; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  46. }elseif(@$_POST["posted"]=="1"){
  47. if(@$_POST["act"]=="delete"){
  48. $sSQL = "DELETE FROM cpnassign WHERE cpaType=1 AND cpaAssignment='" . @$_POST["id"] . "'";
  49. mysql_query($sSQL) or print(mysql_error());
  50. $sSQL = "DELETE FROM sf_sections WHERE sectionID=" . @$_POST["id"];
  51. mysql_query($sSQL) or print(mysql_error());
  52. $sSQL = "DELETE FROM multisections WHERE pSection=" . @$_POST["id"];
  53. mysql_query($sSQL) or print(mysql_error());
  54. print '<meta http-equiv="refresh" content="2; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  55. }elseif(@$_POST["act"]=="domodify"){
  56. $sSQL = "UPDATE sf_sections
  57. SET sectionName='" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secname"]))) . "',sectionDescription='" . mysql_real_escape_string(unstripslashes(@$_POST["secdesc"])) . "',sectionImage='" . mysql_real_escape_string(unstripslashes(@$_POST["secimage"])) . "',sectionSideImage='" . mysql_real_escape_string(unstripslashes(@$_POST["secsideimage"])) . "',sectionBannerImage='" . mysql_real_escape_string(unstripslashes(@$_POST["secbannerimage"])) . "',flash_movie='" . mysql_real_escape_string(unstripslashes(@$_POST["secflash"])) . "',prod_body_format='" . mysql_real_escape_string(unstripslashes(@$_POST["secformat"])) . "',sectionDetailURL='" . @$_POST["secDetailURL"] . "',prod_body_desc='" . @$_POST["prod_body_desc"] . "',topSection=" . @$_POST["tsTopSection"] . ",sectionDisplay='".@$_POST["sectionDisplay"]."',rootSection=" . @$_POST["catfunction"].", sectionImagesOther = '".$_POST['otherImages']."'";//custom code
  58. $workname = mysql_real_escape_string(unstripslashes(trim(@$_POST["secworkname"])));
  59. if($workname != "")
  60. $sSQL .= ",sectionWorkingName='" . $workname . "'";
  61. else
  62. $sSQL .= ",sectionWorkingName='" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secname"]))) . "'";
  63. for($index=2; $index <= $adminlanguages+1; $index++){
  64. if(($adminlangsettings & 256)==256) $sSQL .= ",sectionName" . $index . "='" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secname" . $index]))) . "'";
  65. if(($adminlangsettings & 512)==512) $sSQL .= ",sectionDescription" . $index . "='" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secdesc" . $index]))) . "'";
  66. }
  67. $sSQL .= ",sectionDisabled=" . trim(@$_POST["sectionDisabled"]);
  68. $sSQL .= ",sectionurl='" . mysql_real_escape_string(unstripslashes(trim(@$_POST["sectionurl"]))) . "'";
  69. $sSQL .= " WHERE sectionID=" . @$_POST["id"];
  70. mysql_query($sSQL) or print(mysql_error());
  71. print '<meta http-equiv="refresh" content="2; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  72. }elseif(@$_POST["act"]=="doaddnew"){
  73. $sSQL = "SELECT MAX(sectionOrder) AS mxOrder FROM sf_sections";
  74. $result = mysql_query($sSQL) or print(mysql_error());
  75. $rs = mysql_fetch_assoc($result);
  76. $mxOrder = $rs["mxOrder"];
  77. if(is_null($mxOrder) || $mxOrder=="") $mxOrder=1; else $mxOrder++;
  78. mysql_free_result($result);
  79. $sSQL = "INSERT INTO sf_sections (sectionName,sectionDescription,sectionImage,sectionDisplay,sectionSideImage,sectionBannerImage,flash_movie,prod_body_format,prod_body_desc,sectionOrder,topSection,rootSection,sectionWorkingName";//custom code
  80. for($index=2; $index <= $adminlanguages+1; $index++){
  81. if(($adminlangsettings & 256)==256) $sSQL .= ",sectionName" . $index;
  82. if(($adminlangsettings & 512)==512) $sSQL .= ",sectionDescription" . $index;
  83. }
  84. $sSQL .= ",sectionDisabled,sectionurl,sectionDetailURL, sectionImagesOther) VALUES ('" . mysql_real_escape_string(unstripslashes(@$_POST["secname"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secdesc"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secimage"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["sectionDisplay"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secsideimage"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secbannerimage"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secflash"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["secformat"])) . "','" . mysql_real_escape_string(unstripslashes(@$_POST["prod_body_desc"])) . "'," . $mxOrder . "," . @$_POST["tsTopSection"] . "," . @$_POST["catfunction"];
  85. $workname = mysql_real_escape_string(unstripslashes(trim(@$_POST["secworkname"])));
  86. if($workname != "")
  87. $sSQL .= ",'" . $workname . "'";
  88. else
  89. $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secname"]))) . "'";
  90. for($index=2; $index <= $adminlanguages+1; $index++){
  91. if(($adminlangsettings & 256)==256) $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secname" . $index]))) . "'";
  92. if(($adminlangsettings & 512)==512) $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["secdesc" . $index]))) . "'";
  93. }
  94. $sSQL .= "," . trim(@$_POST["sectionDisabled"]);
  95. $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["sectionurl"]))) . "'";
  96. $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["sectionDetailURL"]))) . "'";
  97. $sSQL .= ",'" . mysql_real_escape_string(unstripslashes(trim(@$_POST["otherImages"]))) . "')";//custom code
  98. //echo $sSQL; exit();
  99. mysql_query($sSQL) or print(mysql_error());
  100. $inserted_cat=mysql_insert_id();
  101. print '<meta http-equiv="refresh" content="2; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  102. }elseif(@$_POST["act"]=="dodiscounts"){
  103. $sSQL = "INSERT INTO cpnassign (cpaCpnID,cpaType,cpaAssignment) VALUES (" . @$_POST["assdisc"] . ",1,'" . @$_POST["id"] . "')";
  104. mysql_query($sSQL) or print(mysql_error());
  105. print '<meta http-equiv="refresh" content="2; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  106. }elseif(@$_POST["act"]=="deletedisc"){
  107. $sSQL = "DELETE FROM cpnassign WHERE cpaID=" . @$_POST["id"];
  108. mysql_query($sSQL) or print(mysql_error());
  109. print '<meta http-equiv="refresh" content="2; url=/admin/cats2.php?pg=' . @$_POST["pg"] . '">';
  110. }
  111. }
  112. ?>
  113. <script language="JavaScript" type="text/javascript">
  114. <!--
  115. function formvalidator(theForm)
  116. {
  117. if (theForm.secname.value == "")
  118. {
  119. alert("<?php print $yyPlsEntr?> \"<?php print $yyCatNam?>\".");
  120. theForm.secname.focus();
  121. return (false);
  122. }
  123. if (theForm.tsTopSection[theForm.tsTopSection.selectedIndex].value == "")
  124. {
  125. alert("<?php print $yyPlsSel?> \"<?php print $yyCatSub?>\".");
  126. theForm.tsTopSection.focus();
  127. return (false);
  128. }
  129. return (true);
  130. }
  131. //-->
  132. </script>
  133. <script type="text/javascript">
  134. jQuery(document).ready(function() {
  135. if (jQuery('#sortable')) {
  136. jQuery("#sortable").sortable({
  137. cursor: 'move',
  138. update: function (event, ui) {
  139. var list_order = jQuery(this).sortable('toArray');
  140. var section_id = jQuery('#id').val();
  141. console.log(list_order);
  142. jQuery.post('/admin/sortcategory.php', { data: list_order, section_id: section_id }, function(data){
  143. }, 'json');
  144. }
  145. });
  146. jQuery("#sortable").disableSelection();
  147. }
  148. });
  149. </script>
  150. <style type="text/css" media="screen">
  151. #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
  152. #sortable li { margin: 0 3px 3px 3px; padding: 4px; padding-left: 15px; font-size: 14px; height: 18px; cursor: move; }
  153. #sortable li span { position: absolute; margin-left: -15px; }
  154. </style>
  155. <table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
  156. <?php
  157. if(@$_POST["posted"]=="1" && (@$_POST["act"]=="modify" || @$_POST["act"]=="addnew")){
  158. $ntopsections=0;
  159. $sSQL = "SELECT sectionID, sectionWorkingName FROM sf_sections WHERE rootSection=0 ORDER BY sectionWorkingName";
  160. $result = mysql_query($sSQL) or print(mysql_error());
  161. while($rs = mysql_fetch_assoc($result))
  162. $alltopsections[$ntopsections++] = $rs;
  163. mysql_free_result($result);
  164. if(@$_POST["act"]=="modify"){
  165. $sSQL = "SELECT sectionID,sectionName,sectionName2,sectionDisplay,sectionName3,sectionDescription,sectionDescription2,sectionDescription3,sectionImage,sectionSideImage,sectionBannerImage,sectionWorkingName,topSection,sectionDisabled,rootSection,sectionurl,flash_movie,prod_body_format,prod_body_desc,sectionDetailURL, sectionImagesOther FROM sf_sections WHERE sectionID=" . @$_POST["id"];//custom code
  166. $result = mysql_query($sSQL) or print(mysql_error());
  167. $rs = mysql_fetch_assoc($result);
  168. $sectionID = $rs["sectionID"];
  169. $sectionName = $rs["sectionName"];
  170. $sectionDescription = $rs["sectionDescription"];
  171. for($index=2; $index <= $adminlanguages+1; $index++){
  172. $sectionNames[$index] = $rs["sectionName" . $index];
  173. $sectionDescriptions[$index] = $rs["sectionDescription" . $index];
  174. }
  175. $sectionImage = $rs["sectionImage"];
  176. $sectionSideImage = $rs["sectionSideImage"];
  177. $sectionBannerImage = $rs["sectionBannerImage"];
  178. $sectionFlash = $rs["flash_movie"];// custom code
  179. $sectionFormat = $rs["prod_body_format"];// custom code
  180. $sectionDisplay = $rs["sectionDisplay"];// custom code
  181. $sectionDetailURL = $rs["sectionDetailURL"];
  182. $prod_body_desc = $rs["prod_body_desc"];// custom code
  183. $sectionWorkingName = $rs["sectionWorkingName"];
  184. $topSection = $rs["topSection"];
  185. $sectionDisabled = $rs["sectionDisabled"];
  186. $rootSection = $rs["rootSection"];
  187. $sectionurl = $rs["sectionurl"];
  188. $otherImages = $rs["sectionImagesOther"];// custom code
  189. mysql_free_result($result);
  190. }else{
  191. $sectionID = "";
  192. $sectionName = "";
  193. $sectionDescription = "";
  194. for($index=2; $index <= $adminlanguages+1; $index++){
  195. $sectionNames[$index] = "";
  196. $sectionDescriptions[$index] = "";
  197. }
  198. $sectionImage = "";
  199. $sectionSideImage = "";
  200. $sectionBannerImage = "";
  201. $sectionFlash = "";// custom code
  202. $sectionFormat ="";// custom code
  203. $prod_body_desc ="";// custom code
  204. $sectionWorkingName = "";
  205. $topSection = 0;
  206. $sectionDisabled = 0;
  207. $rootSection = 1;
  208. $sectionurl = "";
  209. $sectionDetailURL = "";
  210. $sectionDisplay = "";
  211. $otherImages = "";// custom code
  212. }
  213. ?>
  214. <tr>
  215. <td width="100%">
  216. <form name="mainform" method="post" action="/admin/cats2.php" onsubmit="return formvalidator(this)">
  217. <input type="hidden" name="posted" value="1" />
  218. <?php if(@$_POST["act"]=="modify"){ ?>
  219. <input type="hidden" name="act" value="domodify" />
  220. <?php }else{ ?>
  221. <input type="hidden" name="act" value="doaddnew" />
  222. <?php } ?>
  223. <input type="hidden" name="id" value="<?php print @$_POST["id"]?>" />
  224. <input type="hidden" name="pg" value="<?php print @$_POST["pg"]?>" />
  225. <table border="0" cellspacing="0" cellpadding="2" bgcolor="">
  226. <tr>
  227. <td colspan="2" align="center"><strong><?php print $yyCatAdm?></strong><br />&nbsp;</td>
  228. </tr>
  229. <tr>
  230. <td align="center" valign="top"><strong><?php print $yyCatNam?></strong><br /><input type="text" name="secname" size="30" value="<?php print str_replace("\"","&quot;",$sectionName)?>" />
  231. <br />
  232. <?php for($index=2; $index <= $adminlanguages+1; $index++){
  233. if(($adminlangsettings & 256)==256){ ?>
  234. <strong><?php print $yyCatNam . " " . $index ?></strong><br />
  235. <input type="text" name="secname<?php print $index?>" size="30" value="<?php print str_replace('"','&quot;',$sectionNames[$index])?>" /><br />
  236. <?php }
  237. } ?> </td>
  238. <td rowspan="19" align="center" valign="top"><strong><?php print $yyCatDes?></strong> <a href="#info">?</a><br /><textarea name="secdesc" cols="38" rows="8" wrap=virtual><?php print $sectionDescription?></textarea><br />
  239. <?php for($index=2; $index <= $adminlanguages+1; $index++){
  240. if(($adminlangsettings & 512)==512){ ?>
  241. <strong><?php print $yyCatDes . " " . $index ?></strong> <a href="#info">?</a><br />
  242. <textarea name="secdesc<?php print $index?>" cols="38" rows="8" wrap=virtual><?php print $sectionDescriptions[$index]?></textarea><br />
  243. <?php }
  244. } ?>
  245. &nbsp;<br /><select name="sectionDisabled" size="1">
  246. <option value="0"><?php print $yyNoRes?></option>
  247. <?php for($index=1; $index<= $maxloginlevels; $index++){
  248. print '<option value="' . $index . '"';
  249. if($sectionDisabled==$index) print ' selected';
  250. print '>' . $yyLiLev . ' ' . $index . '</option>';
  251. } ?>
  252. <option value="127"<?php if($sectionDisabled==127) print ' selected'?>><?php print $yyDisCat?></option>
  253. </select>
  254. Do not display:
  255. <input type="checkbox" name="sectionDisplay" value="1" <?= $sectionDisplay==1 ? 'checked="checked"' : '' ?> />
  256. <a href="#info">?</a><br />
  257. &nbsp;<br /><strong>Category URL (Optional)</strong><br />
  258. <input type="text" name="sectionurl" size="40" value="<?php print str_replace('"','&quot;',$sectionurl)?>" /> <a href="#info">?</a> </td>
  259. </tr>
  260. <tr>
  261. <td align="center" valign="top"><strong><?php print $yyCatWrNa?></strong></td>
  262. </tr>
  263. <tr>
  264. <td align="center" valign="top"><input type="text" name="secworkname" size="30" value="<?php print str_replace("\"","&quot;",$sectionWorkingName)?>" /></td>
  265. </tr>
  266. <tr>
  267. <td align="center" valign="top"><strong><?php print $yyCatSub?> </strong> <a href="#info">?</a></td>
  268. </tr>
  269. <tr>
  270. <td align="center" valign="top"><select name="tsTopSection" size="1"><option value="0"><?php print $yyCatHom?></option>
  271. <?php $foundcat=($topSection==0);
  272. for($index=0;$index<$ntopsections; $index++){
  273. if($alltopsections[$index]["sectionID"] != $sectionID){
  274. print '<option value="' . $alltopsections[$index]["sectionID"] . '"';
  275. if($topSection==$alltopsections[$index]["sectionID"]){
  276. print " selected";
  277. $foundcat=TRUE;
  278. }
  279. print ">" . $alltopsections[$index]["sectionWorkingName"] . "</option>\n";
  280. }
  281. }
  282. if(! $foundcat) print '<option value="" selected>**undefined**</option>';
  283. ?></select> <a href="#info"></a></td>
  284. </tr>
  285. <tr>
  286. <td align="center" valign="top"><strong><?php print $yyCatFn?></strong> <a href="#info">?</a> </td>
  287. </tr>
  288. <tr>
  289. <td align="center" valign="top"><select name="catfunction" size="1">
  290. <option value="1"><?php print $yyCatPrd?></option>
  291. <option value="0" <?php if($rootSection==0) print "selected"?>><?php print $yyCatCat?></option>
  292. </select> </td>
  293. </tr>
  294. <tr>
  295. <td align="center" valign="top"><strong><?php print $yyCatImg?> </strong> <a href="#info">?</a></td>
  296. </tr>
  297. <tr>
  298. <td align="center" valign="top"><input type="text" name="secimage" size="30" value="<?php print str_replace("\"","&quot;",$sectionImage)?>" />
  299. </td>
  300. </tr>
  301. <tr>
  302. <td align="center" valign="top"><strong>Category Side Image</strong> <a href="#info">?</a></td>
  303. </tr>
  304. <tr>
  305. <td align="center" valign="top"><input type="text" name="secsideimage" size="30" value="<?php print $sectionSideImage?>" />
  306. </td>
  307. </tr>
  308. <tr>
  309. <td align="center" valign="top"><strong>Category Banner Image</strong> <a href="#info">?</a></td>
  310. </tr>
  311. <tr>
  312. <td align="center" valign="top"><input type="text" name="secbannerimage" size="30" value="<?php print $sectionBannerImage?>" /></td>
  313. </tr>
  314. <tr>
  315. <td align="center" valign="top">&nbsp;</td>
  316. </tr>
  317. <tr>
  318. <td align="center" valign="top">
  319. <fieldset style="width:300px; "><legend><strong>Use Only For Custom Ordering Pages</strong></legend>
  320. <strong><?php print $yyFlaMov?></strong> <a href="#info">?</a><br />
  321. <input type="text" name="secflash" id="secflash" size="30" value="<?php print $sectionFlash?>" />
  322. <br />
  323. <strong><?php print $yyFormat?></strong> <a href="#info">?</a><br />
  324. <input name="secformat" type="text" id="secformat" value="<?php print $sectionFormat?>" size="4" />
  325. <br />
  326. <strong>Details URL</strong> <a href="#info">?</a><br />
  327. <input name="secDetailURL" type="text" id="secDetailURL" value="<?php print $sectionDetailURL?>" />
  328. <br />
  329. <strong>Custom Cat Description</strong> <a href="#info">?</a>
  330. <textarea name="prod_body_desc" cols="38" rows="8"><?=$prod_body_desc?></textarea>
  331. <br />
  332. <strong>Other Images</strong>&nbsp;<a href="#info">?</a>
  333. <textarea name="otherImages" id="otherImages" cols="38" rows="8"><?=$otherImages?></textarea>
  334. </fieldset>
  335. </td>
  336. </tr>
  337. <tr>
  338. <td colspan="2" align="center"><br /><input type="submit" value="<?php print $yySubmit?>" /></td>
  339. </tr>
  340. <tr>
  341. <td colspan="2"><br /><ul>
  342. <li><a name="info" id="info"></a><?php print $yyCatEx1?></li>
  343. <li><?php print $yyCatEx2?></li>
  344. <li><strong>Category Image:</strong> the url of the image you want to display for this category.</li>
  345. <li><strong>Category Side Image:</strong> sets the side image you want to use for this category instead of just a random image.</li>
  346. <li><strong>Category Banner Image:</strong> sets the banner image for this category.</li>
  347. <li><strong>Category Flash Movie:</strong> the url to the flash movie that will display for this product. (ex. preloader.swf?loadProduct=nameofmovie.swf)
  348. <li><strong>Body Format:</strong> set the display format of the product pages. 4 is for the custom flash page, only put 4 if you have a flash movie otherwise leave blank.</li>
  349. <li><strong>Details Link:</strong> url of a details page for this category. This button will appear on the flash page linking to this url. <img src="/lib/images/design/product_details.gif" /> </li>
  350. <li><strong>Custom Cat Description:</strong> is intended to display filler content/text on the custom page after the Wrapz, Bandz and Screenz sections.</li>
  351. <li><strong>Category Description:</strong> description of the category that shows up on the category page. Does not show up on any products page.</li>
  352. <li><strong>Restrictions/Login Level:</strong> No restrictions will display category. Login level 1 will only show category if they have an account set to login level 1. 5 Levels.</li>
  353. <li><strong>Do not display:</strong> will not show category no matter what the Restriction/Login Level is set at.</li>
  354. <li><strong>Category URL:</strong> url of the category if you have created a different page than the default category.php page. Mostly used to improve SEO rankings.</li>
  355. <li><strong>Other Images:</strong> A comma seperated list of image paths. These images are displayed as thumbnails in the empty area under wrapz and uses Lightbox to display the full image.</li>
  356. </ul> </td>
  357. </tr>
  358. <tr>
  359. <td colspan="2" align="center"><br />
  360. <a href="/admin/index.php"><strong><?php print $yyAdmHom?></strong></a><br />
  361. &nbsp;</td>
  362. </tr>
  363. </table>
  364. </form>
  365. </td>
  366. </tr>
  367. <?php
  368. }elseif(@$_POST["act"]=="discounts"){
  369. $sSQL = "SELECT sectionName FROM sf_sections WHERE sectionID=" . @$_POST["id"];
  370. $result = mysql_query($sSQL) or print(mysql_error());
  371. $rs = mysql_fetch_assoc($result);
  372. $thisname=$rs["sectionName"];
  373. mysql_free_result($result);
  374. $numassigns=0;
  375. $sSQL = "SELECT cpaID,cpaCpnID,cpnWorkingName,cpnSitewide,cpnEndDate,cpnType,cpnBeginDate FROM cpnassign LEFT JOIN coupons ON cpnassign.cpaCpnID=coupons.cpnID WHERE cpaType=1 AND cpaAssignment='" . @$_POST["id"] . "'";
  376. $result = mysql_query($sSQL) or print(mysql_error());
  377. while($rs=mysql_fetch_assoc($result))
  378. $alldata[$numassigns++]=$rs;
  379. mysql_free_result($result);
  380. $numcoupons=0;
  381. $sSQL = "SELECT cpnID,cpnWorkingName,cpnSitewide FROM coupons WHERE (cpnSitewide=0 OR cpnSitewide=3) AND cpnEndDate >='" . date("Y-m-d H:i:s",time()) ."'";
  382. $result = mysql_query($sSQL) or print(mysql_error());
  383. while($rs=mysql_fetch_assoc($result))
  384. $alldata2[$numcoupons++]=$rs;
  385. mysql_free_result($result);
  386. ?>
  387. <script language="JavaScript" type="text/javascript">
  388. <!--
  389. function delrec(id) {
  390. cmsg = "<?php print $yyConAss?>\n"
  391. if (confirm(cmsg)) {
  392. document.mainform.id.value = id;
  393. document.mainform.act.value = "deletedisc";
  394. document.mainform.submit();
  395. }
  396. }
  397. // -->
  398. </script>
  399. <tr>
  400. <form name="mainform" method="post" action="/admin/cats2.php">
  401. <td width="100%">
  402. <input type="hidden" name="posted" value="1" />
  403. <input type="hidden" name="act" value="dodiscounts" />
  404. <input type="hidden" name="id" value="<?php print @$_POST["id"]?>" />
  405. <input type="hidden" name="pg" value="<?php print @$_POST["pg"]?>" />
  406. <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="">
  407. <tr>
  408. <td width="100%" colspan="4" align="center"><strong><?php print $yyAssDis?> &quot;<?php print $thisname?>&quot;.</strong><br />&nbsp;</td>
  409. </tr>
  410. <?php
  411. $gotone=FALSE;
  412. if($numcoupons>0){
  413. $thestr = '<tr><td colspan="4" align="center">' . $yyAsDsCp . ': <select name="assdisc" size="1">';
  414. for($index=0;$index < $numcoupons;$index++){
  415. $alreadyassign=FALSE;
  416. if($numassigns>0){
  417. for($index2=0;$index2<$numassigns;$index2++){
  418. if($alldata2[$index]["cpnID"]==$alldata[$index2]["cpaCpnID"]) $alreadyassign=TRUE;
  419. }
  420. }
  421. if(! $alreadyassign){
  422. $thestr .= "<option value='" . $alldata2[$index]["cpnID"] . "'>" . $alldata2[$index]["cpnWorkingName"] . "</option>\n";
  423. $gotone=TRUE;
  424. }
  425. }
  426. $thestr .= "</select> <input type='submit' value='Go' /></td></tr>";
  427. }
  428. if($gotone){
  429. print $thestr;
  430. }else{
  431. ?>
  432. <tr>
  433. <td width="100%" colspan="4" align="center"><br /><strong><?php print $yyNoDis?></td>
  434. </tr>
  435. <?php
  436. }
  437. if($numassigns>0){
  438. ?>
  439. <tr>
  440. <td width="100%" colspan="4" align="center"><br /><strong><?php print $yyCurDis?> &quot;<?php print $thisname?>&quot;.</strong><br />&nbsp;</td>
  441. </tr>
  442. <tr>
  443. <td><strong><?php print $yyWrkNam?></strong></td>
  444. <td><strong><?php print $yyDisTyp?></strong></td>
  445. <td><strong><?php print $yyBegin?></strong></td>
  446. <td><strong><?php print $yyExpire?></strong></td>
  447. <td align="center"><strong><?php print $yyDelete?></strong></td>
  448. </tr>
  449. <?php
  450. for($index=0;$index<$numassigns;$index++){
  451. $prefont = "";
  452. $postfont = "";
  453. if((int)$alldata[$index]["cpnSitewide"]==1 || ($alldata[$index]["cpnEndDate"] != '3000-01-01 00:00:00' && strtotime($alldata[$index]["cpnEndDate"])-time() < 0)){
  454. $prefont = '<font color="#FF0000">';
  455. $postfont = "</font>";
  456. }
  457. ?>
  458. <tr>
  459. <td><?php print $prefont . $alldata[$index]["cpnWorkingName"] . $postfont ?></td>
  460. <td><?php if($alldata[$index]["cpnType"]==0)
  461. print $prefont . $yyFrSShp . $postfont;
  462. elseif($alldata[$index]["cpnType"]==1)
  463. print $prefont . $yyFlatDs . $postfont;
  464. elseif($alldata[$index]["cpnType"]==2)
  465. print $prefont . $yyPerDis . $postfont; ?></td>
  466. <td><?php
  467. if ($alldata[$index]["cpnBeginDate"] != '0000-00-00 00:00:00') {
  468. echo $prefont . $alldata[$index]["cpnBeginDate"] . $postfont;
  469. } else {
  470. echo $prefont . "&nbsp;" . $postfont;
  471. }
  472. ?></td>
  473. <td><?php print $prefont;
  474. if($alldata[$index]["cpnEndDate"] == '3000-01-01 00:00:00')
  475. print $yyNever;
  476. elseif(strtotime($alldata[$index]["cpnEndDate"])-time() < 0)
  477. print $yyExpird;
  478. else
  479. print date("Y-m-d H:i:s",strtotime($alldata[$index]["cpnEndDate"]));
  480. print $postfont; ?></td>
  481. <td align="center"><input type="button" name="discount" value="Delete Assignment" onclick="delrec('<?php print $alldata[$index]["cpaID"]?>')" /></td>
  482. </tr>
  483. <?php
  484. }
  485. }else{
  486. ?>
  487. <tr>
  488. <td width="100%" colspan="4" align="center"><br /><strong><?php print $yyNoAss?></td>
  489. </tr>
  490. <?php
  491. }
  492. ?>
  493. <tr>
  494. <td width="100%" colspan="4" align="center"><br />&nbsp;</td>
  495. </tr>
  496. <tr>
  497. <td width="100%" colspan="4" align="center"><br />
  498. <a href="/admin/index.php"><strong><?php print $yyAdmHom?></strong></a><br />
  499. &nbsp;</td>
  500. </tr>
  501. </table></td>
  502. </form>
  503. </tr>
  504. <?php
  505. }elseif(@$_POST["act"]=="changepos"){ ?>
  506. <tr>
  507. <td width="100%" align="center">
  508. <p>&nbsp;</p>
  509. <p>&nbsp;</p>
  510. <p>&nbsp;</p>
  511. <p><strong><?php print $yyUpdat?> . . . . . . . </strong></font></p>
  512. <p>&nbsp;</p>
  513. <p><?php print $yyNoFor?> <a href="/admin/cats2.php"><?php print $yyClkHer?></a>.</p>
  514. <p>&nbsp;</p>
  515. <p>&nbsp;</p>
  516. </td>
  517. </tr>
  518. <?php
  519. } else if ($_POST['act'] == 'sort') {
  520. // Get the current section name
  521. $sql = "SELECT * FROM sections WHERE sectionID = {$_POST['id']}";
  522. $res = mysql_query($sql) or print(mysql_error());
  523. $section = mysql_fetch_assoc($res);
  524. // Get all child categories and products
  525. $list = array();
  526. $sql = "SELECT *
  527. FROM sf_sections
  528. WHERE topSection = {$_POST['id']}
  529. AND sectionDisabled = 0
  530. AND sectionDisplay = 1
  531. ORDER BY sectionOrder";
  532. $res = mysql_query($sql) or print(mysql_error());
  533. while ($row = mysql_fetch_assoc($res)) {
  534. $list[] = $row;
  535. }
  536. $sql = "SELECT * FROM sf_products WHERE pSection = {$_POST['id']} AND pDisplay = 1 ORDER BY pOrder";
  537. $res = mysql_query($sql) or print(mysql_error());
  538. while ($row = mysql_fetch_assoc($res)) {
  539. $list[] = $row;
  540. }
  541. // Get the sort order
  542. $sort = array();
  543. $sql = "SELECT * FROM RFCategoryOrder WHERE Section_IDParent = {$_POST['id']} ORDER BY Sequence";
  544. $res = mysql_query($sql) or print(mysql_error());
  545. while ($row = mysql_fetch_assoc($res)) {
  546. if ($row['section_ID'] > 0) {
  547. $sort['section_' . $row['Section_ID']] = $row;
  548. } else {
  549. $sort['product_' . $row['Product_ID']] = $row;
  550. }
  551. }
  552. /*
  553. echo '<pre>';
  554. print_r($sort);
  555. echo '</pre>';
  556. */
  557. // Now re-index the list
  558. $new_list = array();
  559. $last = 999;
  560. for ($i=0; $i < count($list); $i++) {
  561. if ($list[$i]['ID']) { // It's a product
  562. $key = 'product_' . $list[$i]['ID'];
  563. if (array_key_exists($key, $sort)) {
  564. $new_list[$sort[$key]['Sequence']] = $list[$i];
  565. } else {
  566. $new_list[$last++] = $list[$i];
  567. }
  568. } else { // It's a section
  569. $key = 'section_' . $list[$i]['sectionID'];
  570. if (array_key_exists($key, $sort)) {
  571. $new_list[$sort[$key]['Sequence']] = $list[$i];
  572. } else {
  573. $new_list[$last++] = $list[$i];
  574. }
  575. }
  576. }
  577. /*
  578. echo '<pre>';
  579. print_r(array_keys($new_list));
  580. echo '</pre>';
  581. */
  582. // Sort the list
  583. uksort($new_list, function($a, $b){
  584. if ($a == $b) {
  585. return 0;
  586. }
  587. return ($a < $b) ? -1 : 1;
  588. });
  589. /*
  590. echo '<pre>';
  591. print_r(array_keys($new_list));
  592. echo '</pre>';
  593. */
  594. ?>
  595. <tr>
  596. <td height="50"><span style="margin-left: 20px; font-size: 24px; font-weight: bold;"><?php echo $section['sectionName'] ?></span></td>
  597. </tr>
  598. <tr>
  599. <td>
  600. <form name="mainform" method="post" action="/admin/cats2.php">
  601. <input type="hidden" id="id" name="id" value="<?php print @$_POST["id"]?>" />
  602. <ul id="sortable">
  603. <?php
  604. $i = 0;
  605. foreach ($new_list as $key => $value) {
  606. $text = '';
  607. if ($value['sectionID']) {
  608. $text = $value['sectionName'];
  609. $id = 'section_' . $value['sectionID'];
  610. } else {
  611. $text = $value['pName'];
  612. $id = 'product_' . $value['ID'];
  613. }
  614. ?>
  615. <li class="ui-state-default" id="<?php echo $id ?>"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span><?php echo $text ?></li>
  616. <?php
  617. }
  618. ?>
  619. </ul>
  620. </form>
  621. </td>
  622. </tr>
  623. <?php
  624. }elseif(@$_POST["posted"]=="1" && $success){ ?>
  625. <tr>
  626. <td width="100%">
  627. <table width="100%" border="0" cellspacing="0" cellpadding="3" bgcolor="">
  628. <tr>
  629. <td width="100%" colspan="2" align="center"><br /><strong><?php print $yyUpdSuc?></strong><br /><br /><?php print $yyNowFrd?><br /><br />
  630. <?php print $yyNoAuto?> <A href="/admin/cats2.php?pg=<?=$_POST['pg']?>"><strong><?php print $yyClkHer?></strong></a>.<br />
  631. <br />
  632. <img src="/lib/images/misc/clearpixel.gif" width="300" height="3" alt="" />
  633. </td>
  634. </tr>
  635. </table></td>
  636. </tr>
  637. <?php
  638. }elseif(@$_POST["posted"]=="1"){ ?>
  639. <tr>
  640. <td width="100%">
  641. <table width="100%" border="0" cellspacing="0" cellpadding="2" bgcolor="">
  642. <tr>
  643. <td width="100%" colspan="2" align="center"><br /><font color="#FF0000"><strong><?php print $yyOpFai?></strong></font><br /><br /><?php print $errmsg?><br /><br />
  644. <a href="javascript:history.go(-1)"><strong><?php print $yyClkBac?></strong></a></td>
  645. </tr>
  646. </table></td>
  647. </tr>
  648. <?php
  649. }else{
  650. function writeposition($currpos,$maxpos){
  651. $reqtext="<select name='newpos" . $currpos . "' onChange='chi(" . $currpos . ");'>";
  652. for($i = 1; $i <= $maxpos; $i++){
  653. $reqtext .= '<option'; // value='" . $i . "'";
  654. if($currpos==$i) $reqtext .= " selected";
  655. $reqtext .= ">" . $i; // . "</option>";
  656. if($i >= 10 && $i < ($maxpos-15) && abs($currpos-$i) > 40) $i += 9;
  657. }
  658. return($reqtext . "</select>");
  659. }
  660. $allcoupon="";
  661. $numcoupons=0;
  662. $sSQL = "SELECT DISTINCT cpaAssignment FROM cpnassign WHERE cpaType=1";
  663. $result = mysql_query($sSQL) or print(mysql_error());
  664. while($rs=mysql_fetch_array($result))
  665. $allcoupon[$numcoupons++]=$rs;
  666. mysql_free_result($result);
  667. ?>
  668. <script language="JavaScript" type="text/javascript">
  669. <!--
  670. function chi(currindex){
  671. var i = eval("document.mainform.newpos"+currindex+".selectedIndex");
  672. document.mainform.newval.value = eval("document.mainform.newpos"+currindex+".options[i].text");
  673. document.mainform.selectedq.value = currindex;
  674. document.mainform.sectionTag.value = eval("document.mainform.sectionTag"+currindex+".value");
  675. document.mainform.act.value = "changepos";
  676. document.mainform.submit();
  677. }
  678. function mrk(id) {
  679. document.mainform.id.value = id;
  680. document.mainform.act.value = "modify";
  681. document.mainform.submit();
  682. }
  683. function srk(id) {
  684. document.mainform.id.value = id;
  685. document.mainform.act.value = "sort";
  686. document.mainform.submit();
  687. }
  688. function newrec(id) {
  689. document.mainform.id.value = id;
  690. document.mainform.act.value = "addnew";
  691. document.mainform.submit();
  692. }
  693. function dsk(id) {
  694. document.mainform.id.value = id;
  695. document.mainform.act.value = "discounts";
  696. document.mainform.submit();
  697. }
  698. function drk(id) {
  699. cmsg = "<?php print $yyConDel?>\n"
  700. if (confirm(cmsg)) {
  701. document.mainform.id.value = id;
  702. document.mainform.act.value = "delete";
  703. document.mainform.submit();
  704. }
  705. }
  706. // -->
  707. </script>
  708. <style type="text/css">
  709. <!--
  710. tr.data:hover {background-color: #FFFFCC; color: #000;}
  711. -->
  712. </style>
  713. <tr>
  714. <form name="mainform" method="post" action="/admin/cats2.php">
  715. <td width="100%">
  716. <input type="hidden" name="posted" value="1" />
  717. <input type="hidden" name="act" value="xxxxx" />
  718. <input type="hidden" name="id" value="xxxxx" />
  719. <input type="hidden" name="pg" value="<?php print @$_GET["pg"]?>" />
  720. <input type="hidden" name="selectedq" value="1" />
  721. <input type="hidden" name="newval" value="1" />
  722. <input type="hidden" name="sectionTag" value="1" />
  723. <table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="">
  724. <tr>
  725. <td width="100%" colspan="7" align="center"><strong><?php print $yyCatAdm?></strong><br />&nbsp;</td>
  726. </tr>
  727. <tr>
  728. <td width="100%" colspan="7" align="center"><input type="button" value="<?php print $yyNewCat?>" onclick="newrec()" /></td>
  729. </tr>
  730. <?php
  731. function writepagebar($CurPage, $iNumPages){
  732. $sLink = "<a href='/admin/cats2.php?pg=";
  733. $startPage = max(1,round(floor((double)$CurPage/10.0)*10));
  734. $endPage = min($iNumPages,round(floor((double)$CurPage/10.0)*10)+10);
  735. if($CurPage > 1)
  736. $sStr = $sLink . "1" . "'><strong><font face='Verdana'>&laquo;</font></strong></a> " . $sLink . ($CurPage-1) . "'>Previous</a> | ";
  737. else
  738. $sStr = "<strong><font face='Verdana'>&laquo;</font></strong> Previous | ";
  739. for($i=$startPage;$i <= $endPage; $i++){
  740. if($i==$CurPage)
  741. $sStr .= $i . " | ";
  742. else{
  743. $sStr .= $sLink . $i . "'>";
  744. if($i==$startPage && $i > 1) $sStr .= "...";
  745. $sStr .= $i;
  746. if($i==$endPage && $i < $iNumPages) $sStr .= "...";
  747. $sStr .= "</a> | ";
  748. }
  749. }
  750. if($CurPage < $iNumPages)
  751. return $sStr . $sLink . ($CurPage+1) . "'>Next</a> " . $sLink . $iNumPages . "'><strong><font face='Verdana'>&raquo;</font></strong></a>";
  752. else
  753. return $sStr . " Next <strong><font face='Verdana'>&raquo;</font></strong>";
  754. }
  755. if(! is_numeric(@$_GET["pg"]))
  756. $CurPage = 1;
  757. else
  758. $CurPage = (int)(@$_GET["pg"]);
  759. $sSQL = "SELECT COUNT(*) AS bar FROM sf_sections";
  760. $result = mysql_query($sSQL) or print(mysql_error());
  761. $numids = mysql_result($result,0,"bar");
  762. $iNumOfPages = ceil($numids/$maxcatsperpage);
  763. mysql_free_result($result);
  764. $sSQL = "SELECT sectionID,sectionWorkingName,sectionDescription,topSection,rootSection,sectionDisabled,sectionTag FROM sf_sections ORDER BY sectionOrder LIMIT " . ($maxcatsperpage*($CurPage-1)) . ", $maxcatsperpage";
  765. $result = mysql_query($sSQL) or print(mysql_error());
  766. if($numids > 0){
  767. $islooping=FALSE;
  768. $noproducts=FALSE;
  769. $hascatinprodsection=FALSE;
  770. $rowcounter=0;
  771. $bgcolor="";
  772. if($iNumOfPages > 1) print '<tr><td align="center" colspan="7">' . writepagebar($CurPage, $iNumOfPages) . '<br /><br /></td></tr>';
  773. ?>
  774. <tr>
  775. <td width="5%"><strong><?php print $yyOrder?></strong></td>
  776. <td align="left"><strong><?php print $yyCatPat?></strong></td>
  777. <td align="left"><strong><?php print $yyCatNam?></strong></td>
  778. <td width="210" align="center"><strong>Category Tag</strong></td>
  779. <td width="5%" align="center"><font size="1"><strong><?php print $yyDiscnt?></strong></font></td>
  780. <td width="5%" align="center"><font size="1"><strong><?php print $yyModify?></strong></font></td>
  781. <td width="5%" align="center"><font size="1"><strong><?php print $yyDelete?></strong></font></td>
  782. <td width="5%" align="center"><font size="1"><strong>Sort</strong></font></td>
  783. </tr>
  784. <?php
  785. while($rs = mysql_fetch_assoc($result)){
  786. if($bgcolor=="#E7EAEF") $bgcolor="#FFFFFF"; else $bgcolor="#E7EAEF"; ?>
  787. <tr class="data" bgcolor="<?php print $bgcolor?>">
  788. <td><?php
  789. $current_counter=($maxcatsperpage*($CurPage-1))+$rowcounter+1;
  790. print writeposition(($maxcatsperpage*($CurPage-1))+$rowcounter+1,$numids);?></td>
  791. <td><?php
  792. $tslist = "";
  793. $thetopts = $rs["topSection"];
  794. for($index=0; $index <= 10; $index++){
  795. if($thetopts==0){
  796. $tslist = $yyHome . $tslist;
  797. break;
  798. }elseif($index==10){
  799. $tslist = '<strong><font color="#FF0000">' . $yyLoop . '</font></strong>' . $tslist;
  800. $islooping=TRUE;
  801. }else{
  802. $sSQL = "SELECT sectionID,topSection,sectionWorkingName,rootSection FROM sf_sections WHERE sectionID=" . $thetopts;
  803. $result2 = mysql_query($sSQL) or print(mysql_error());
  804. if(mysql_num_rows($result2) > 0){
  805. $rs2 = mysql_fetch_assoc($result2);
  806. $errstart = "";
  807. $errend = "";
  808. if($rs2["rootSection"]==1){
  809. $errstart = "<strong><font color='#FF0000'>";
  810. $errend = "</font></strong>";
  811. $hascatinprodsection=TRUE;
  812. }
  813. $tslist = " &raquo; " . $errstart . $rs2["sectionWorkingName"] . $errend . $tslist;
  814. $thetopts = $rs2["topSection"];
  815. }else{
  816. $tslist = '<strong><font color="#FF0000">' . $yyTopDel . '</font></strong>' . $tslist;
  817. break;
  818. }
  819. mysql_free_result($result2);
  820. }
  821. }
  822. print '<font size="1">' . $tslist . '</font></td><td>';
  823. if($rs["rootSection"]==1) print "<strong>";
  824. if($rs["sectionDisabled"]==127) print '<strike><font color="#FF0000">';
  825. print $rs["sectionWorkingName"] . " (" . $rs["sectionID"] . ")";
  826. if($rs["sectionDisabled"]==127) print '</font></strike>';
  827. if($rs["rootSection"]==1) print "</strong>";
  828. print '</td><td align="center">';
  829. ?>
  830. <div id="tag_update<?=$current_counter?>" style="display:none;" ><input id="tag_box<?=$current_counter?>" type="text" name="sectionTag<?=$current_counter?>" value="<?=$rs["sectionTag"]?>" /><input type="button" value="go" name="btn_tag" onclick="chi(<?=$current_counter?>)" /> <a href="javascript:void(0);" onclick="Element.hide('tag_update<?=$current_counter?>'),Element.show('tag<?=$current_counter?>');">cancel</a></div>
  831. <div id="tag<?=$current_counter?>" onclick="Element.show('tag_update<?=$current_counter?>'),$('tag_box<?=$current_counter?>').focus(),Element.hide('tag<?=$current_counter?>');"><?=$rs["sectionTag"]?>&nbsp;</div>
  832. <?
  833. print '</td><td><input';
  834. for($index=0;$index<$numcoupons;$index++){
  835. if((int)$allcoupon[$index][0]==$rs["sectionID"]){
  836. print ' style="color: #FF0000" ';
  837. break;
  838. }
  839. }
  840. ?> type="button" value="<?php print $yyAssign?>" onclick="dsk('<?php print $rs["sectionID"]?>')"></td>
  841. <td><input type="button" value="<?php print $yyModify?>" onclick="mrk('<?php print $rs["sectionID"]?>')" /></td>
  842. <td><input type="button" value="<?php print $yyDelete?>" onclick="drk('<?php print $rs["sectionID"]?>')" /></td>
  843. <td><input type="button" value="Sort" onclick="srk('<?php print $rs["sectionID"]?>')" /></td>
  844. </tr><?php $rowcounter++;
  845. }
  846. if($iNumOfPages > 1) print '<tr><td align="center" colspan="6"><br />' . writepagebar($CurPage, $iNumOfPages) . '</td></tr>';
  847. if($islooping){
  848. ?>
  849. <tr><td width="100%" colspan="8"><br /><strong><font color='#FF0000'>** </font></strong><?php print $yyCatEx3?></td></tr>
  850. <?php
  851. }
  852. if($hascatinprodsection){
  853. ?>
  854. <tr><td width="100%" colspan="8"><br /><ul><li><?php print $yyCPErr?></li></ul></td></tr>
  855. <?php
  856. }
  857. ?>
  858. <tr><td width="100%" colspan="8"><br /><ul><li><?php print $yyCatEx4?></li></ul></td></tr>
  859. <?php
  860. }else{
  861. ?>
  862. <tr><td width="100%" colspan="8" align="center"><br /><strong><?php print $yyCatEx5?><br />&nbsp;</td></tr>
  863. <?php
  864. }
  865. ?>
  866. <tr>
  867. <td width="100%" colspan="8" align="center"><br /><strong><?php print $yyCatNew?></strong>&nbsp;&nbsp;<input type="button" value="<?php print $yyNewCat?>" onclick="newrec()" /><br />&nbsp;</td>
  868. </tr>
  869. <tr>
  870. <td width="100%" colspan="8" align="center"><br />
  871. <a href="/admin/index.php"><strong><?php print $yyAdmHom?></strong></a><br />
  872. <img src="/lib/images/misc/clearpixel.gif" width="300" height="3" alt="" /></td>
  873. </tr>
  874. </table></td>
  875. </form>
  876. </tr>
  877. <?php
  878. }
  879. ?>
  880. </table>