CasperSecurity
<?php
session_start();
include '../../connection/connection.php';
$arqid = $_REQUEST['arqid'];
$aitlo = $_REQUEST['aitlo'];
$oldloc = $_REQUEST['oldloc'];
$oldasunt = $_REQUEST['oldasunt'];
$oldemp = $_REQUEST['oldemp'];
$newasset_unit_name = $_REQUEST['asset_unit_name'];
$newlocation = $_REQUEST['location'];
$newemployee = $_REQUEST['employee'];
$tdate = $_REQUEST['tdate'];
$asset_item_id = $_REQUEST['asset_item_id'];
$newlocat='';
$oldlocat='';
$db_handle = new DBController();
$newupd = $db_handle->runMyUpdate("UPDATE asset_request SET allot_status='transfered'
WHERE asset_maintenance_request_id='$arqid'");
$db_handle = new DBController();
$newupdd = $db_handle->runMyUpdate("UPDATE asset_item_location SET is_active='no' ,transferred_date= '$tdate'
WHERE asset_item_location_id='$aitlo'");
$db_handle = new DBController();
$newInsert = $db_handle->tableinsert("INSERT INTO asset_tranfer (asset_item_id,transfer_date,old_located_at,old_asset_unit_id,old_location_id,old_employee_id,new_located_at,new_asset_unit_id,new_location_id,new_employee_id,is_active)
VALUES ('$asset_item_id','$tdate','$oldlocat','$oldasunt','$oldloc','$oldemp','$newlocat','$newasset_unit_name','$newlocation','$newemployee','yes')");
$db_handle = new DBController();
$newInsertt = $db_handle->tableinsert("INSERT INTO asset_item_location (asset_item_id,allot_installetion_date,located_at,asset_unit_id,location_id,employee_id,is_active)
VALUES ('$asset_item_id','$tdate','$newlocat','$newasset_unit_name','$newlocation','$newemployee','yes')");
if($newInsertt == TRUE){
$_SESSION['ERROR_MSG'] = "Success";
$_SESSION['MSG_ALRT'] = "TRUE";
header('location:../../../web/home/modules/Installation/Assettransferred/assetstobetransferredgrid.php');
}else{
$_SESSION['ERROR_MSG'] = "Unsuccess";
$_SESSION['MSG_ALRT'] = "FALSE";
header('location:../../../web/home/modules/Installation/Assettransferred/assetstobetransferredgrid.php');
}
?>