Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.144.94.139
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/admin//product-qty-mgmt.php
<?php
ob_start();
session_start();
require_once('session-check.php');

require_once('include/db-config.php');
?>
<?php



$r = "";

$productid = 0;
if(isset($_POST['productid']))
	$productid = $_POST['productid'];


$requestfrom = "";
if(isset($_POST['requestfrom']))
	$requestfrom = $_POST['requestfrom'];

if($requestfrom == "PriceForm")
{
	$UpdatedDate = date("Y-m-d");
	$ProductID = $_POST['PID'];
	$productid = $ProductID;
	$i = 1;
	
	$sql ="delete from product_discount where ProductID = ".$ProductID;
	$result =mysqli_query($conn,$sql);

	while($i <= 10)
	{
		//echo "<br>".$i;
		switch ($i)
		{
			case 1:
				$qtyfrom = $_POST['qtyfrom1'];
				$qtyto = $_POST['qtyto1'];
				$Discount = $_POST['Discount1'];
				break;	
			case 2:
				$qtyfrom = $_POST['qtyfrom2'];
				$qtyto = $_POST['qtyto2'];
				$Discount = $_POST['Discount2'];
				break;
			case 3:
				$qtyfrom = $_POST['qtyfrom3'];
				$qtyto = $_POST['qtyto3'];
				$Discount = $_POST['Discount3'];
				break;
			case 4:
				$qtyfrom = $_POST['qtyfrom4'];
				$qtyto = $_POST['qtyto4'];
				$Discount= $_POST['Discount4'];
				break;
			case 5:
				$qtyfrom = $_POST['qtyfrom5'];
				$qtyto = $_POST['qtyto5'];
				$Discount= $_POST['Discount5'];
				break;
			case 6:
				$qtyfrom = $_POST['qtyfrom6'];
				$qtyto = $_POST['qtyto6'];
				$Discount = $_POST['Discount6'];
				break;
			case 7:
				$qtyfrom = $_POST['qtyfrom7'];
				$qtyto = $_POST['qtyto7'];
				$Discount= $_POST['Discount7'];
				break;
			case 8:
				$qtyfrom = $_POST['qtyfrom8'];
				$qtyto = $_POST['qtyto8'];
				$Discount= $_POST['Discount8'];
				break;
			case 9:
				$qtyfrom = $_POST['qtyfrom9'];
				$qtyto = $_POST['qtyto9'];
				$Discount= $_POST['Discount9'];
				break;
			case 10:
				$qtyfrom = $_POST['qtyfrom10'];
				$qtyto = $_POST['qtyto10'];
				$Discount= $_POST['Discount10'];
				break;
    		default:
				$qtyfrom = "";
				$qtyto = "";
				$Discount= "";
				break;
		}
		//echo "<br>".$qtyfrom. " ".$qtyto." ".$shippingprice;
		
		if($qtyfrom != "" and $qtyto != "" and $Discount!= "")
		{
			$sql = "Insert into product_discount(ProductID, QtyFrom, QtyTo, Discount) values(".$ProductID.", ".$qtyfrom.", ".$qtyto.", ".$Discount." )";
			//echo $sql;
			//exit;
			$result =mysqli_query($conn,$sql);
		}
		$i = $i + 1;
	}
	$r = "1";
}

?>
<!DOCTYPE html> <HTML>
<HEAD>
<TITLE>Joel Levitt, maintenance management, maintenance management consulting, tpms</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link href="css/style.css" type="text/css" rel="stylesheet">
<style type="text/css">
table { color: #FFFFFF; font-family: Arial, Verdana }
.normal { background-color: #323232 }
.normalActive { background-color:#000000;}
</style>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<!-- ImageReady Slices (maintrainer_slice2.jpg) -->
<TABLE WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0 align="center">
	<?php include_once('include/include_header.php'); ?>
	<TR>
		<TD valign="top" height="98%">
        	<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" class="body_bg">
            	<tr><td colspan="3" style="height:9px;"></td></tr>
                <tr>
                
                	<td style="height:40px;" colspan="3" class="content_bg">
						<?php
                        if($r == '1')
                        {	
							echo "<font class='success-text'>You have successfully updated</font>";
                        }
                       ?>
                    </td>
				</tr>
                <tr>
                	<td class="content_bg" style="padding-bottom:10px;">
                    	<form method="post" name="productchange" id="productchange" action="product-qty-mgmt.php" onSubmit="return validateform();"  >
                        <input type="hidden" name="requestfrom" id="requestfrom" value="SelectDropdown">
                    	<table border="0" cellpadding="0" cellspacing="0" style="padding-left:30px;">
                        	<tr>
                            	<td nowrap valign="middle" class="normal_text" style="padding-left::10px;">&nbsp;&nbsp;<b>Select the Product</b>&nbsp;&nbsp;</td>
                                <td valign="middle">
                                	<select name="productid" id="productid" style="min-width:200px;" onChange="javascript: this.form.submit();" >
                                        <option></option>
                                        <?php
                                        
										$sql="select ID,ProductName from productnew where Status=1";
                                        $result =mysqli_query($conn,$sql);
                                        while($row = mysqli_fetch_array($result))
                                        {
                                            $ID = $row['ID'];
                                            $ProductName = $row['ProductName'];
                                           // $ProductCategory = $row['MainCategory'];
											$selected = "";
											if($productid == $ID)
											$selected = "selected";
                                        ?>
                                        <option value="<?php echo $ID; ?>" <?php echo $selected; ?>><?php echo $ProductName; ?></option>
                                        <?php
                                        }
                                        ?>
                                    </select>
                                </td>
                            <td style="width:9px;"></td>
                            </tr>
                        </table>
                        </form>
                    </td>
                </tr>
                <tr>
                
                	<td width="100%" valign="top" align="left" class="content_bg" style="padding-left:30px;">
                    	<form method="post" action="product-qty-mgmt.php" name="pricedetails" id="pricedetails" onSubmit="return validateform();" >
                        <input type="hidden" name="requestfrom" id="requestfrom" value="PriceForm">
                        <input type="hidden" name="PID" id="PID" value="<?php echo $productid;?>">
                        <table border="0" cellpadding="0" cellspacing="0" class="normal_text" align="left" style="padding-left:10px;">
                        	<tr>
                                <td class="tablehead" nowrap><strong>No</strong></td>
                                <td class="tablehead" nowrap><strong>Qty From</strong></td>
                                <td class="tablehead" nowrap><strong>Qty To</strong></td>
                                <td class="tablehead"><strong>Discount</strong></td>
                            </tr>
                            <?php
							$sql = "select ID, ProductID, QtyFrom,QtyTo, Discount from product_discount where ProductID = ".$productid." order by QtyFrom";
							$result =mysqli_query($conn,$sql);
							$i = 0;
							if($productid > 0)
							while($row = mysqli_fetch_array($result))
							{
								$i = $i + 1;
								$ID = $row['ID'];
								$ProductID = $row['ProductID'];
								$QtyFrom = $row['QtyFrom'];
								$QtyTo = $row['QtyTo'];
								$Discount = $row['Discount'];
							?>
                            <tr>
                                <td><?php echo $i; ?></td>
                                <td><input type="text" name="<?php echo "qtyfrom".$i; ?>" id="<?php echo "qtyfrom".$i; ?>" value="<?php echo $QtyFrom; ?>" style="width:120px;"></td>
                                <td><input type="text" name="<?php echo "qtyto".$i; ?>" id="<?php echo "qtyto".$i; ?>" value="<?php echo $QtyTo; ?>" style="width:120px;"></td>
                                <td><input type="text" name="<?php echo "Discount".$i; ?>" id="<?php echo "Discount".$i; ?>" value="<?php echo $Discount; ?>" style="width:120px;"></td>
                            </tr>
							<?php
							}
							?>
                            
                            <?php
							if($i < 10)
							{
								while($i < 10)
								{
									$i = $i + 1;
									$ID = $row['ID'];
									$ProductID = $row['ProductID'];
									$QtyFrom = $row['QtyFrom'];
									$QtyTo = $row['QtyTo'];
									$Discount = $row['Discount']; ?>
                                    <tr>
                                        <td><?php echo $i; ?></td>
                                        <td><input type="text" name="<?php echo "qtyfrom".$i; ?>" id="<?php echo "qtyfrom".$i; ?>" value="<?php echo $QtyFrom; ?>" style="width:120px;"></td>
                                        <td><input type="text" name="<?php echo "qtyto".$i; ?>" id="<?php echo "qtyto".$i; ?>" value="<?php echo $QtyTo; ?>" style="width:120px;"></td>
                                        <td><input type="text" name="<?php echo "Discount".$i; ?>" id="<?php echo "Discount".$i; ?>" value="<?php echo $Discount; ?>" style="width:120px;"></td>
                                    </tr>
								<?php
								}
							}
							?>
                            <tr><td style="height:20px;"></td></tr>
                            <tr>
                            	<td colspan="4" align="center"><input type="submit" id="save" name="save" value="Save" class="bttn" >
                                &nbsp;<input type="button" id="back" name="back" value="Cancel" class="bttn" onClick="javascript:history.back();">
                                </td>
                            <td style="width:9px;"></td>
                            </tr>
                            <TR><TD height="40"></TD></TR>
                        </table>
                        </form>
                    </td>
               
                </tr>
             <tr><td colspan="3" style="height:9px;"></td></tr>
            </table>
        </TD>
	</TR>

    
    <?php include_once('include/include_footer.php'); ?>
</TABLE>
<!-- End ImageReady Slices -->
</BODY>
</HTML>

Anon7 - 2022
AnonSec Team