CasperSecurity

Current Path : /var/www/acasv2.uiet.co.in/v.2.0/api/request/stock_adjustment_api/
Upload File :
Current File : /var/www/acasv2.uiet.co.in/v.2.0/api/request/stock_adjustment_api/stock_adjustment_insert_api.php

  <?php
session_start();
include '../../../web/connection/connectionv2.php';
include '../../../web/connection/con.php';	
include '../../../web/connection/encryption.php';

$purchase_invoice_no = $_REQUEST['purchase_invoice_no'];
$adjustment_date = $_REQUEST['adjustment_date'];
$date = date("Y-m-d");
$active = 'yes';
$userId   = $_SESSION['USER_ID'];

 



if(!empty($adjustment_date)){
$jj = $_SESSION['LAST_NO'];

	for($ii=1;$ii<$jj;$ii++){ 
		
		$purchase_item_id = $_REQUEST['purchase_item_id_'.$ii];
		
		$adjust_quantity = $_REQUEST['adjust_quantity_'.$ii];
		$adjust_type = $_REQUEST['adjust_type_'.$ii];
		$reason_of_adjustment = $_REQUEST['reason_of_adjustment_'.$ii];
		
	  
           $selectdamag ="SELECT * FROM damagestock ORDER BY damagestock_id DESC";
			 $querydamag=mysqli_query($con,$selectdamag);
			 $resultdamag=mysqli_fetch_assoc($querydamag);
			 $damagestock_id = $resultdamag['damagestock_id']+1;
			 $zero = 0;
			 $qut = 'ADJ';
			 $year = date("Y");
			  $adj_noyy = $qut.'-'.$year.'-'.$zero.''.$zero.''.$zero.''.$zero.''.$damagestock_id;
			if(($damagestock_id >= '10') && ($damagestock_id < '100')){
			$adj_no = $qut.'-'.$year.'-'.$zero.''.$zero.''.$zero.''.$damagestock_id;
			}elseif(($damagestock_id >= '100')&&($damagestock_id < '1000')){
			   $adj_no = $qut.'-'.$year.'-'.$zero.''.$zero.''.$damagestock_id;	
			}elseif($damagestock_id >= '1000'){
				$adj_no = $damagestock_id;
			}else{
				 $adj_no = $adj_noyy;
			}
			
			$db_handle = new DBController();
            $newUpdate = $db_handle->runMyUpdate("UPDATE canteen_purchase_item SET adjust_quantity = '$adjust_quantity' WHERE purchase_item_id = '$purchase_item_id'");

	  
   $db_handle = new DBController();
   $newinsertz = $db_handle->tableinsert("INSERT INTO damagestock(damagestock_date,adj_no,purchase_item_id,adj_type,damage_qty,remark,created_on,created_by,is_active) VALUES ('$adjustment_date','$adj_no','$purchase_item_id','$adjust_type','$adjust_quantity','$reason_of_adjustment','$date','$userId','$active')");
	
	}


	if($newinsertz == TRUE){ 
		 $_SESSION['ERROR_MSG'] = "Success";
		 $_SESSION['MSG_ALRT'] = "TRUE";
		header('location:../../../web/home/modules/university/Canteen/stock_adjustment/stock_adjustment_grid.php');
	  }else{
		 $_SESSION['ERROR_MSG'] = "Unsuccess";
		 $_SESSION['MSG_ALRT'] = "FALSE";
		header('location:../../../web/home/modules/university/Canteen/stock_adjustment/stock_adjustment_grid.php');
	 }		  
	  
		  
}	  
		  



		

Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY