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

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
// Date & Time to be dispalyed on the header 
$date_time	= date("h:i:s A")." ".date("d-m-Y");
$stus = "";
$smarty->assign('date_time',$date_time);
$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
$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'];
$login                = $row['login'];
$password             = base64_decode($row['password']);
$full_name            = $row['full_name'];
$email                = $row['email'];
$mes                  = "";
$title	  ="::: Edit Profile :::";
$smarty->assign('title',$title);

if(isset($_GET['act']))
{
 if($_GET['act']=="edit")
 {
  $login                = $_POST['login'];
  $password             = base64_encode($_POST['password']);
  $full_name            = $_POST['full_name'];
  $email                = $_POST['email'];
  $status               = $_POST['status'];

  if($database->update("update asset_users set login='$login', password='$password', full_name='$full_name', email='$email', updated_by='$user_id', updated_on='$date' where user_id='$user_id'"))
  {
   redirect ("edit_profile.php","Edt");
  }
 }
 if($_GET['act']=="Edt")
 {
  $mes = "Your Profile had been Successfully Updated !";
 }
}

$smarty->assign('userid',$user_id);
$smarty->assign('login',$login);
$smarty->assign('password',$password);
$smarty->assign('full_name',$full_name);
$smarty->assign('email',$email);
$smarty->assign('stus',$stus);

$smarty->assign('name',$name);
$smarty->assign('status',$status);
$smarty->assign('mes',$mes);

$smarty->display('edit_profile.tpl');
?>
Return current item: CoreAsset