CasperSecurity

Current Path : /var/www/acasv2.uiet.co.in/v.2.0/api/request/Finance/direct_purchase_invoice/
Upload File :
Current File : /var/www/acasv2.uiet.co.in/v.2.0/api/request/Finance/direct_purchase_invoice/add_vendor_invoice.php

<?php

	session_start();

	include '../../../../web/connection/connection.php';
	
	//vendor invoice variables
	$vendor_invoice_no = $_REQUEST['vendor_invoice_no'];
	$vendor_invoice_date = $_REQUEST['vendor_invoice_date'];
	$purchase_order_id = $_REQUEST['purchase_order_id'];
	$creditor_ledger_head_id = $_REQUEST['creditor_ledger_head_id'];
	$expense_ledger_head_id = $_REQUEST['expense_ledger_head_id'];
	$gst_ledger_head_id = $_REQUEST['gst_ledger_head_id'];
	$invoice_copy = $_REQUEST['invoice_copy'];
	$created_on = date("Y-m-d");
	$created_by = $_SESSION['USER_ID'];
	$is_active = 'yes';
	
	//vendor invoice item variables
	$item_id = $_REQUEST['item_id'];
	$brand_id = $_REQUEST['brand_id'];
	$item_name = $_REQUEST['item_name'];
	$quantity = $_REQUEST['quantity'];
	$rate = $_REQUEST['rate'];
	$discount_amount = $_REQUEST['discount_amount'];
	$gst_rate = $_REQUEST['gst_rate'];
	
	//vendor item variables
	$vendor_id = $_REQUEST['vendor_id'];
	$item_rate = $_REQUEST['item_rate'];
	
	//vendor type variables
	$vendor_type_name = $_REQUEST['vendor_type_name'];
	
	//inserting data into vendor invoice table
	$db_handle = new DBController();
	
	$newInsert = $db_handle->tableinsert("INSERT INTO vendor_invoice(vendor_invoice_no,vendor_invoice_date,purchase_order_id,creditor_ledger_head_id,
	                                     expense_ledger_head_id,gst_ledger_head_id,invoice_copy,created_on,created_by,is_active) 
		VALUES ('$vendor_invoice_no','$vendor_invoice_date','$purchase_order_id''$creditor_ledger_head_id','$expense_ledger_head_id','$gst_ledger_head_id',
		        '$invoice_copy','$created_on','$created_by','$is_active')");
	
	
	 if($newInsert == TRUE){
	  
	  echo 'Data Inserted  in table 1 Successfully';
	  
	  //if insertion is successful in vendor invoice table then fetch a particular primary key needed
	  $db_handle = new DBController();
	  $select = $db_handle->runQuery("SELECT vendor_invoice_id FROM vendor_invoice  WHERE vendor_invoice_no = '$vendor_invoice_no' ");
	  foreach ($select as $v){
			$vendor_invoice_id = $v['vendor_invoice_id']; // unique primary key needed as a data for the nested table
		}
		
		 //inserting data into vendor invoice item table
		$db_handle = new DBController();
	
		$newInsert2 = $db_handle->tableinsert("INSERT INTO vendor_invoice_item(vendor_invoice_id,item_id,brand_id,item_name,quantity,rate,discount_amount,gst_rate)
			VALUES ('$vendor_invoice_id','$item_id','$brand_id','$item_name','$quantity','$rate','$discount_amount','$gst_rate')");
				
		if($newInsert2 == TRUE){
			
		 echo 'Data Inserted in table 2 Successfully';
		 
		 //if insertion is successful in vendor invoice item table then fetch a particular primary key needed
	  $db_handle = new DBController();
	  $select = $db_handle->runQuery("SELECT item_id FROM vendor_invoice_item  WHERE item_name = '$item_name' ");
	  foreach ($select as $v){
			$item_id = $v['item_id']; // unique primary key needed as a data for the nested table
		}
		
		 //inserting data into vendor item table
		$db_handle = new DBController();
	
		$newInsert3 = $db_handle->tableinsert("INSERT INTO vendor_item(vendor_id,item_id,item_rate)
			VALUES ('$vendor_id','$item_id','$item_rate')");
				
		if($newInsert3 == TRUE){
			
		 echo 'Data Inserted in table 3 Successfully';
		  
		}else{
		  
		 echo 'Not Inserted 3' ;
		  
		}
		  
		}else{
		  
		 echo 'Not Inserted 2' ;
		  
		}
	  
	}else{
	  
	  echo 'Not Inserted 1' ;
	  
	}
	//inserting data into vendor type table
	$db_handle = new DBController();
	
	$newInsert4 = $db_handle->tableinsert("INSERT INTO vendor_type(vendor_type_name) 
		VALUES ('$vendor_type_name')");
	
	
	 if($newInsert4 == TRUE){
	  
	  echo 'Data Inserted in table 4 Successfully';
	  
	}else{
	  
	  echo 'Not Inserted 4' ;
	  
	}
?>
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