CasperSecurity

Current Path : /var/www/acasv2.uiet.co.in/v.2.0/api/request/stores___purchase/vendor/
Upload File :
Current File : /var/www/acasv2.uiet.co.in/v.2.0/api/request/stores___purchase/vendor/add_vendor.php

<?php

	session_start();
	
	include '../../../../web/connection/connection.php';
	
	// add new vendor variables
	$vendor_id = $_REQUEST['vendor_id'];
	$organisation_unit_id = $_REQUEST['organisation_unit_id'];
	$vendor_type = $_REQUEST['vendor_type'];
	$vendor_code = $_REQUEST['vendor_code'];
	$vendor_name = $_REQUEST['vendor_name'];
	$vendor_logo = $_REQUEST['vendor_logo'];
	$vendor_address = $_REQUEST['vendor_address'];
	$vendor_tele_phone = $_REQUEST['vendor_tele_phone'];
	$vendor_fax = $_REQUEST['vendor_fax'];
	$vendor_mail = $_REQUEST['vendor_mail'];
	$vendor_contact_person = $_REQUEST['vendor_contact_person'];
	$vendor_contact_person_telephone = $_REQUEST['vendor_contact_person_telephone'];
	$vendor_contact_person_mobile = $_REQUEST['vendor_contact_person_mobile'];
	$vendor_contact_person_mail = $_REQUEST['vendor_contact_person_mail'];
	$inter_state = $_REQUEST['inter_state'];
	$created_on = date('Y-m-d');
	$created_by = $_SESSION['USER_ID'];
	$is_active = 'yes';
	
	// add new vendor type variables
	$vendor_type_id = $_REQUEST['vendor_type_id'];
	$vendor_type_name = $_REQUEST['vendor_type_name'];
	
	// inserting values to vendor table
        $db_handle = new DBController();
		
		$newInsert = $db_handle->tableinsert("INSERT INTO vendor(vendor_id,organisation_unit_id,vendor_type,vendor_code,vendor_name,vendor_logo,vendor_address,vendor_tele_phone,
		vendor_fax,vendor_mail,vendor_contact_person,vendor_contact_person_telephone,vendor_contact_person_mobile,vendor_contact_person_mail,inter_state,created_on,created_by,is_active)
		VALUES('$vendor_id','$organisation_unit_id','$vendor_type','$vendor_code','$vendor_name','$vendor_logo','$vendor_address','$vendor_tele_phone','$vendor_fax','$vendor_mail',
		'$vendor_contact_person','$vendor_contact_person_telephone','$vendor_contact_person_mobile','$vendor_contact_person_mail','$inter_state','$created_on','$created_by','$is_active')");
				
	if($newInsert == TRUE){
		  
		echo 'Data Inserted Successfully in table 1';
		  
		//if insertion is successful in vendor table then fetch a particular primary key needed
		$db_handle = new DBController();
		$select = $db_handle->runQuery("SELECT vendor_id FROM vendor  WHERE vendor_name = '$vendor_name' ");
		foreach ($select as $v){
			$vendor_id = $v['vendor_id']; // unique primary key needed as a data for the nested table
		}
		
		// inserting data into vendor type table
        $db_handle = new DBController();
		
		$newInsert2 = $db_handle->tableinsert("INSERT INTO vendor_type(vendor_type_id,vendor_type_name)
		VALUES('$vendor_type_id','$vendor_type_name')");
				
		if($newInsert2 == TRUE){
		  
		  echo 'Data Inserted Successfully in table 2';
		  
		}else{
		  
		  echo 'Not Inserted in 2' ;
		  
		}
		
	}else{
		  
		echo 'Not Inserted in 1' ;
		  
	}
?>
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