PageRenderTime 43ms CodeModel.GetById 39ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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