PageRenderTime 58ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/application/views/pages/admin/cats.php

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