CasperSecurity

Current Path : /var/www/atraket.uiet.co.in/v1.0/api/request/asset_request/
Upload File :
Current File : /var/www/atraket.uiet.co.in/v1.0/api/request/asset_request/asset_request_api.php

<?php
   
session_start();


include '../../connection/connection.php';
include '../../connection/con.php';

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$date = date("Y-m-d");
$assett = $_REQUEST['asset_name'];
$secownerr = $_REQUEST['secowner'];
$quantityy = $_REQUEST['quantity'];
$locidd = $_REQUEST['locid'];
$astuidd = $_REQUEST['astuid'];
 $empp = $_REQUEST['emp'];
$request_type = $_REQUEST['request_type'];
//$user_id = $_SESSION['USER_ID'];
//$user_id = '1';
$user_id = (int)$_SESSION['USER_ID'];
$datee = date("Y-m-d");
$is_active = 'yes';

if(empty($empp)){
	$emp = 0;
}else{
	$emp = $empp;
}

if(empty($assett)){
	$asset = 0;
}else{
	$asset = $assett;
}

if(empty($secownerr)){
	$secowner = 0;
}else{
	$secowner = $secownerr;
}

if(empty($quantityy)){
	$quantity = 0;
}else{
	$quantity = $quantityy;
}

if(empty($locidd)){
	$locid = 0;
}else{
	$locid = $locidd;
}

if(empty($astuidd)){
	$astuid = 0;
}else{
	$astuid = $astuidd;
}
 
  //echo $astuid;
 
if(!empty($date)){
	
$db_handle = new DBController();
$selecttr="SELECT asset_maintenance_request_id FROM asset_request ORDER BY asset_maintenance_request_id DESC";
$queu = mysqli_query($cont, $selecttr);
$nume =mysqli_num_rows($queu);
$v=mysqli_fetch_assoc($queu);
						


 $asset_maintenance_request_idd = $v['asset_maintenance_request_id'];
 $asset_maintenance_request_id = $asset_maintenance_request_idd + 1;
						
$year = date("Y");
//$request_no = ARQ .'/'.$year.'/'. $asset_maintenance_request_id;
$request_no = 'ARQ/'.$year.'/'.$asset_maintenance_request_id;
			

/*
$db_handle = new DBController();
$newInsert = $db_handle->numRows("SELECT * FROM  asset_request WHERE request_date = '$date' ");


if($newInsert >= '1'){
	$_SESSION['ERROR_MSG'] = "Already Exist";
		  $_SESSION['MSG_ALRT'] = "FALSE";
		  header('location:../../../web/home/modules/Installation/Assetrequest/assetrequestadd.php');
	}else{*/

	
		$db_handle = new DBController();
	
		$newInsert = $db_handle->tableinsert("INSERT INTO  asset_request (request_no,request_date,asset_id,quantity,allot_status,request_type,
location_id,asset_unit_id,employee_id,secondary_owner,created_on,created_by,is_active) VALUES ('$request_no','$date','$asset','$quantity',
'New','$request_type','$locid','$astuid','$emp','$secowner','$datee','$user_id','$is_active')");

		if($newInsert == TRUE){ 
			
			$_SESSION['ERROR_MSG'] = "Success & Your Request No. is ".$request_no; 
		  $_SESSION['MSG_ALRT'] = "TRUE";
		  header('location:../../../web/home/modules/Installation/Assetrequest/assetrequestadd.php');
		}else{
			 $_SESSION['ERROR_MSG'] = "Unsuccess";
		  $_SESSION['MSG_ALRT'] = "FALSE";
		  header('location:../../../web/home/modules/Installation/Assetrequest/assetrequestadd.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