Location: PHPKode > projects > CoreAsset > coreasset/mid_add_book.php
<?php
require_once("lib/inc.php");
require_once("lib/security.php");

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
$title	  ="::: Add Purchase :::";
$smarty->assign('title',$title);
$status   = $_SESSION['status'];
// Date & Time to be dispalyed on the header 
$date_time	= date("h:i:s A")." ".date("d-m-Y");
$smarty->assign('date_time',$date_time);
$user_id  = $_SESSION['user_id'];
$smarty->assign('user_id',$user_id);
$rw		  = $database->get_from_database("select * from asset_users where user_id='$_SESSION[user_id]'");
$last_login  = $rw['last_login'];
$last_logout = $rw['last_logout'];
$smarty->assign('last_login',$last_login);
$smarty->assign('last_logout',$last_logout);

// Done
if(isset($_REQUEST['yes']))
{
redirect ("manage_purchase.php");

}
if(isset($_REQUEST['no']))
{
echo $book                   = $_GET['book'];  
echo $author                 = $_GET['author'];
echo $publisher              = $_GET['publisher']; 
echo $c_before               = $_GET['c_before']; echo"<br>";
echo $c_after                = $_GET['c_after']; echo"<br>";
echo $b_ids_after            = $_GET['b_ids_after'];echo"<br>";
echo $b_ids_before           = $_GET['b_ids_before'];echo"<br>";
echo $cat_id                 = $_GET['cat_id'];echo"<br>";
echo $price                  = $_GET['price'];
$database->update("UPDATE asset_assets SET  equipment_id='$b_ids_before' where  category_id ='$cat_id' and equipment_id='$b_ids_after'");
redirect ("manage_purchase.php");
}
$smarty->assign('status',$status);
$smarty->display('mid_add_book.tpl');
?>
Return current item: CoreAsset