<?php
include_once 'includes/processes.php';
$Process = new Login_Process;
$Process->check_status($_SERVER['SCRIPT_NAME']);
$pageLink = basename($_SERVER['REQUEST_URI']);
$Process->check_status($pageLink);

$dbLink = $Process->connect_db();
$time = time();
$openDate = date('Y-m-d',$time);
$query = $Process->RunQuery("insert into apl_case_log values(default,'','','','','','','Empty','".$_SESSION['dept_id']."','".$_SESSION['userid']."','0','$time','$openDate','0','$openDate')",$dbLink);
$caseID = $dbLink->lastInsertId();
$query = $Process->RunQuery("insert into apl_case_assignment values(default,'$caseID','".$_SESSION['dept_id']."','".$_SESSION['userid']."','".$_SESSION['userid']."','$time')",$dbLink);
header("location:open-case-log.php?lid=$caseID");
?>
