/admin/MasterSizeList.php

https://github.com/lwvpaul/Operation-Stonegate · PHP · 257 lines · 239 code · 16 blank · 2 comment · 41 complexity · 8668f0f03209278094cac68b7a03d445 MD5 · raw file

  1. <?php
  2. require_once( "../webassist/framework/library.php" );
  3. require_once( "../webassist/framework/framework.php" );
  4. ?>
  5. <?php require_once('../Connections/GoCreate.php'); ?>
  6. <?php
  7. if (!function_exists("GetSQLValueString")) {
  8. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  9. {
  10. if (PHP_VERSION < 6) {
  11. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  12. }
  13. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  14. switch ($theType) {
  15. case "text":
  16. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  17. break;
  18. case "long":
  19. case "int":
  20. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  21. break;
  22. case "double":
  23. $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  24. break;
  25. case "date":
  26. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  27. break;
  28. case "defined":
  29. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  30. break;
  31. }
  32. return $theValue;
  33. }
  34. }
  35. $colname_rs_SizeFilter = "-1";
  36. if (isset($_GET['SZ_ID'])) {
  37. $colname_rs_SizeFilter = (get_magic_quotes_gpc()) ? $_GET['SZ_ID'] : addslashes($_GET['SZ_ID']);
  38. }
  39. mysql_select_db($database_GoCreate, $GoCreate);
  40. $query_rs_SizeFilter = sprintf("SELECT * FROM admin_media_sizes WHERE F_ID = %s", GetSQLValueString($colname_rs_SizeFilter, "int"));
  41. $rs_SizeFilter = mysql_query($query_rs_SizeFilter, $GoCreate) or die(mysql_error());
  42. $row_rs_SizeFilter = mysql_fetch_assoc($rs_SizeFilter);
  43. $totalRows_rs_SizeFilter = mysql_num_rows($rs_SizeFilter);
  44. if("" == ""){
  45. $WA_main_menu_1300386231410 = new WA_Include("main_menu.php");
  46. require($WA_main_menu_1300386231410->BaseName);
  47. $WA_main_menu_1300386231410->Initialize(true);
  48. }
  49. if("" == ""){
  50. $WA_footer_1300717372941 = new WA_Include("footer.php");
  51. require($WA_footer_1300717372941->BaseName);
  52. $WA_footer_1300717372941->Initialize(true);
  53. }
  54. if("" == ""){
  55. $WA_cnt_loop_1301384715693 = new WA_Include("GSNET_LIB/php/cnt_loop.php?cnt=10");
  56. require($WA_cnt_loop_1301384715693->BaseName);
  57. $WA_cnt_loop_1301384715693->Initialize(true);
  58. }
  59. if("" == ""){
  60. $WA_sitestats_1301303033310 = new WA_Include("sitestats.php");
  61. require($WA_sitestats_1301303033310->BaseName);
  62. $WA_sitestats_1301303033310->Initialize(true);
  63. }
  64. ?>
  65. <?php
  66. // RepeatSelectionCounter_1 Initialization
  67. $RepeatSelectionCounter_1 = 0;
  68. $RepeatSelectionCounterBasedLooping_1 = false;
  69. $RepeatSelectionCounter_1_Iterations = "-1";
  70. ?>
  71. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  72. <html xmlns="http://www.w3.org/1999/xhtml">
  73. <head>
  74. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  75. <title>GoCreate Dashboard</title>
  76. <link href="../includes/CSSLayouts/CSSLayouts.css" rel="stylesheet" type="text/css" />
  77. <script type="text/javascript" src="../includes/CSSLayouts/debug_plus.js"></script>
  78. <link href="../includes/CSSLayouts/GoCreateAdmin1.css" rel="stylesheet" type="text/css" />
  79. <link href="../includes/CSSLayouts/GoCreateAdmin1_user.css" rel="stylesheet" type="text/css" />
  80. <?php echo((isset($WA_main_menu_1300386231410))?$WA_main_menu_1300386231410->Head:"") ?>
  81. <script type="text/javascript">
  82. tday =new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  83. tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  84. function GetClock(){
  85. d = new Date();
  86. nday = d.getDay();
  87. nmonth = d.getMonth();
  88. ndate = d.getDate();
  89. nyear = d.getYear();
  90. nhour = d.getHours();
  91. nmin = d.getMinutes();
  92. nsec = d.getSeconds();
  93. if(nyear<1000) nyear=nyear+1900;
  94. if(nhour == 0) {ap = " AM";nhour = 12;}
  95. else if(nhour <= 11) {ap = " AM";}
  96. else if(nhour == 12) {ap = " PM";}
  97. else if(nhour >= 13) {ap = " PM";nhour -= 12;}
  98. if(nmin <= 9) {nmin = "0" +nmin;}
  99. if(nsec <= 9) {nsec = "0" +nsec;}
  100. document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
  101. setTimeout("GetClock()", 1000);
  102. }
  103. window.onload=GetClock;
  104. function MM_goToURL() { //v3.0
  105. var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  106. for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
  107. }
  108. </script>
  109. <?php echo((isset($WA_footer_1300717372941))?$WA_footer_1300717372941->Head:"") ?><?php echo((isset($WA_sitestats_1301303033310))?$WA_sitestats_1301303033310->Head:"") ?>
  110. <link href="css/page.css" rel="stylesheet" type="text/css" />
  111. <link href="css/forms.css" rel="stylesheet" type="text/css" />
  112. <?php echo((isset($WA_cnt_loop_1301384715693))?$WA_cnt_loop_1301384715693->Head:"") ?><?php echo((isset($WA_cnt_loop_1301385057071))?$WA_cnt_loop_1301385057071->Head:"") ?>
  113. </head>
  114. <body class="GoCreateAdmin1_body_design" >
  115. <div class="GoCreateAdmin1">
  116. <!-- (CSSLayouts Begin) #GoCreateAdmin1 #build_version=1.1.276;pack=User;category=My Page Layouts;layout=;layoutType=page;scheme=;cssSource=file;assets=;halign=center;minwidth=960px;maxwidth=1259px;width=80%;bc=My Page Layouts;bl=GoCreateAdmin-->
  117. <div class='cssLO GoCreateAdmin1_wrapper_layout'>
  118. <div class='wrapper cssLI GoCreateAdmin1_wrapper_design'>
  119. <div class='cssLO GoCreateAdmin1_header_layout'>
  120. <div class='header cssLI GoCreateAdmin1_header_design'>
  121. <div class='cssLO GoCreateAdmin1_row_1_layout'>
  122. <div class='row_1 cssLI GoCreateAdmin1_row_1_design'>
  123. <!-- row_1 Content Starts Here -->
  124. <span style="left: 30px; top: 20px; position: relative; color: #FFF; font-size: 36px; font-family: Verdana, Geneva, sans-serif;">Go Create!</span> <span style="top: 20px; left: 50px; position: relative; color: #FFF; font-style: italic; font-size: 16px; font-family: Verdana, Geneva, sans-serif;">Site Admin</span> <span id="clockbox" style="color: #FFF; top: 15px; left: 575px; position: relative; font-size: 14px; font-family: Verdana, Geneva, sans-serif;"></span>
  125. <!-- row_1 Content Ends Here -->
  126. </div>
  127. </div>
  128. <div class='cssLO GoCreateAdmin1_row_2_layout'>
  129. <div class='row_2 cssLI GoCreateAdmin1_row_2_design'>
  130. <!-- row_2 Content Starts Here -->
  131. <?php echo((isset($WA_main_menu_1300386231410))?$WA_main_menu_1300386231410->Body:"") ?>
  132. <!-- row_2 Content Ends Here -->
  133. </div>
  134. </div>
  135. <div class='cssLClearR'></div>
  136. </div>
  137. </div>
  138. <div class='cssLO GoCreateAdmin1_content_layout'>
  139. <div class='content cssLI GoCreateAdmin1_content_design'>
  140. <div class='cssLO GoCreateAdmin1_leftcolumn_layout'>
  141. <div class='leftcolumn cssLI GoCreateAdmin1_leftcolumn_design'>
  142. <!-- leftcolumn Content Starts Here -->
  143. <?php echo((isset($WA_sitestats_1301303033310))?$WA_sitestats_1301303033310->Body:"") ?>
  144. <!-- leftcolumn Content Ends Here -->
  145. </div>
  146. </div>
  147. <div class='cssLO GoCreateAdmin1_centercolumn_layout'>
  148. <div class='centercolumn cssLI GoCreateAdmin1_centercolumn_design'>
  149. <!-- centercolumn Content Starts Here -->
  150. <div id="HeaderTitle">Master Sizes List for <span class="HighLight"><?php echo $_GET['MT'];?></span></div>
  151. <form action="MasterSizeDelete.php" method="post" name="form1" >
  152. <table border="0" cellpadding="4" cellspacing="4" class="form">
  153. <tr class="form_txt">
  154. <td>No.</td>
  155. <td>&nbsp;&nbsp;Media Size</td>
  156. <td align="center" title="Cost, Quantity & Weight">C.Q.W</td>
  157. <td align="center">Options</td>
  158. </tr>
  159. <?php
  160. // RepeatSelectionCounter_1 Begin Loop
  161. $RepeatSelectionCounter_1_IterationsRemaining = $RepeatSelectionCounter_1_Iterations;
  162. while($RepeatSelectionCounter_1_IterationsRemaining--){
  163. if($RepeatSelectionCounterBasedLooping_1 || $row_rs_SizeFilter){
  164. ?>
  165. <tr class="roweffect">
  166. <td valign="middle" class="form_txt"><input name="LK_MT" type="hidden" id="LK_MT" value="<?php echo $row_rs_SizeFilter['F_ID']; ?>" />
  167. <?php echo $RepeatSelectionCounter_1+1; ?>.
  168. <input name="SZ_ID[]" type="checkbox" id="SZ_ID_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php echo $row_rs_SizeFilter['ID']; ?>" /></td>
  169. <td><input name="textfield" type="text" class="form" id="textfield" value="<?php echo $row_rs_SizeFilter['MEDIA_SIZE']; ?>" /></td>
  170. <td><input name="button" type="submit" class="cust_button" id="button" title="Cost, Quantity & Weight" onclick="MM_goToURL('parent','MasterCQWList.php?<?php echo $_SERVER['QUERY_STRING'];?>&amp;MS=<?php echo $row_rs_SizeFilter['MEDIA_SIZE']; ?>&amp;MS_ID=<?php echo $row_rs_SizeFilter['ID']; ?>');return document.MM_returnValue" value="C.Q.W." alt="Cost, Quantity & Weight"/></td>
  171. <td class="leftborder"><input name="Edit" type="submit" class="cust_button" id="Edit"
  172. onclick="document.getElementById('SZ_ID_<?php echo $RepeatSelectionCounter_1; ?>').checked=true;this.form.action='MasterSizeUpdate.php?<?php echo $_SERVER['QUERY_STRING'];?>';" value="Edit" />
  173. <input name="Delete" type="submit" class="cust_button" id="Delete" value="Delete"
  174. onclick="document.getElementById('SZ_ID_<?php echo $RepeatSelectionCounter_1; ?>').checked=true;this.form.action='MasterSizeDelete.php?<?php echo $_SERVER['QUERY_STRING'];?>';" /></td>
  175. </tr>
  176. <?php
  177. } // RepeatSelectionCounter_1 Begin Alternate Content
  178. else{
  179. ?>
  180. <?php if ($totalRows_rs_SizeFilter == 0) {?>
  181. <tr>
  182. <td colspan="4" align="center" class="form_txt"> There are no Sizes set yet.<br />
  183. Please use the drop down option below to start adding new ones now.</td>
  184. </tr>
  185. <?php } ?>
  186. <?php } // RepeatSelectionCounter_1 End Alternate Content
  187. if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
  188. if(!$row_rs_SizeFilter && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining = 0;}
  189. $row_rs_SizeFilter = mysql_fetch_assoc($rs_SizeFilter);
  190. }
  191. $RepeatSelectionCounter_1++;
  192. } // RepeatSelectionCounter_1 End Loop
  193. ?>
  194. <tr>
  195. <td colspan="4" align="right" class="topborder"><input name="EditSelected" type="submit" class="cust_button" id="EditSelected" value="EditSelected" onclick="this.form.action='MasterSizeUpdate.php?<?php echo $_SERVER['QUERY_STRING'];?>';"/>
  196. &nbsp;&nbsp;
  197. <input name="DeleteSelected" type="submit" class="cust_button" id="DeleteSelected" value="DeleteSelected" onclick="this.form.action='MasterSizeDelete.php?<?php echo $_SERVER['QUERY_STRING'];?>';"/></td>
  198. </tr>
  199. </table>
  200. <table cellpadding="2" cellspacing="0" border="0">
  201. <tr>
  202. <td align="center"><input type="hidden" name="WADbSearch1" value="Submit" /></td>
  203. </tr>
  204. </table>
  205. </form>
  206. <div id="Add" style="top: 15px; position: relative;">
  207. <form id="form2" name="form2" method="post" action="MasterSizeAdd.php?SZ_ID=<?php echo $_GET['SZ_ID'];?>&MT=<?php echo $_GET['MT'];?>">
  208. <table border="0" cellpadding="4" cellspacing="4" class="form">
  209. <tr>
  210. <td class="form_txt">Add&nbsp;&nbsp;<select name="NewAdd" onchange="this.form.submit();">
  211. <?php echo((isset($WA_cnt_loop_1301384715693))?$WA_cnt_loop_1301384715693->Body:"") ?>
  212. </select>&nbsp;&nbsp;<input name="Cancel" type="button" class="cust_button" onclick="MM_goToURL('parent','MasterTyList.php');return document.MM_returnValue" value="Cancel &amp; Go Back" /></td>
  213. </tr>
  214. </table>
  215. </form>
  216. </div>
  217. <!-- centercolumn Content Ends Here -->
  218. </div>
  219. </div>
  220. <div class='cssLClearC'></div>
  221. </div>
  222. </div>
  223. <div class='cssLO GoCreateAdmin1_footer_layout'>
  224. <div class='footer cssLI GoCreateAdmin1_footer_design'>
  225. <!-- footer Content Starts Here -->
  226. <?php echo((isset($WA_footer_1300717372941))?$WA_footer_1300717372941->Body:"") ?>
  227. <!-- footer Content Ends Here -->
  228. </div>
  229. </div>
  230. <div class='cssLClearR'></div>
  231. </div>
  232. </div>
  233. <div class="cssLClearL"></div>
  234. <!-- #GoCreateAdmin1 (CSSLayouts End) -->
  235. </div>
  236. <span style="padding-top: 30px; margin-left: 45%; color: #FFF">Glass Spider Network - Web Solutions</span>
  237. </body>
  238. </html>
  239. <?php
  240. mysql_free_result($rs_SizeFilter);
  241. ?>