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

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
$title	  ="::: Show Asset History :::";
$smarty->assign('title',$title);
//echo "bunti";
$date     = date("Y-m-d");
$status   = $_SESSION['status'];
$user_id  = $_SESSION['user_id'];
$smarty->assign('user_id',$user_id);
$row      = $database->get_from_database("select * from asset_users where user_id='$user_id'");
$name     = $row['full_name'];
$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);

$smarty->assign('name',$name );
// 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);
// Done
if(isset($_REQUEST['sdfh__gi468_k___coe856']))
{
	
	$action						= $_REQUEST['act'];
	$asset_tag					= $_REQUEST['sdfh__gi468_k___coe856'] ;
	$b_id						= $_REQUEST['bbb_id'];
	

	$b_nm							= $database->get_from_database("SELECT * FROM asset_books WHERE book_id='$b_id'");

	$book_name					= $b_nm['book_name'];
	$author						= $b_nm['author'];
	$publisher					= $b_nm['publisher'];
	$isbn_no					= $b_nm['isbn_no'];
	$price						= $b_nm['price'];

	$result         = $database->Execute("select * from asset_book_history where asset_tag='$asset_tag' and book_id='$b_id'");
	$count			= mysql_num_rows($result);

	while($rwrw = mysql_fetch_array($result))
	{
		$book_hist_id[]		= $rwrw['book_hist_id'];
		$assigned_userid	= $rwrw['assigned_userid'];

		if($assigned_userid > 0)
		{
			$u_nm							= $database->get_from_database("SELECT * FROM asset_users WHERE user_id='$assigned_userid'");
			$user_nm[]					= $u_nm['full_name'];
		}
		else
		{
			$user_nm[]					= "Not Assigned !";
		}
		$issued_on[]		= $rwrw['issued_on'];
		$return_date[]		= $rwrw['return_date'];
		$change_date[]		= $rwrw['change_date'];
	}

	$smarty->assign('asset_tag',$asset_tag);
	$smarty->assign('book_name',$book_name);
	$smarty->assign('author',$author);
	$smarty->assign('publisher',$publisher);
	$smarty->assign('isbn_no',$isbn_no);
	$smarty->assign('price',$price);
	$smarty->assign('change_date',$change_date);
	$smarty->assign('user_nm',$user_nm);
	$smarty->assign('return_date',$return_date);
	$smarty->assign('issued_on',$issued_on);
	$smarty->assign('book_hist_id',$book_hist_id);
}

$smarty->assign('status',$status);
$smarty->assign('rows',$rows);
$j = 1;
$smarty->assign('j',$j);
$smarty->display('vw_ast_dtl.tpl');
?>
Return current item: CoreAsset