require('setup_header.php');
change_status::change("labours","clients_labour_status");
?>
common_main_header::get_header();
$user_id = $_SESSION['user']['id'];
$id = $_GET['id'];
$lid = $_POST['lid'];
$context = array(
"method" => $_GET['method'],
"order" => $_GET['order'],
"status" => $status,
"avail_edit" => common_ref_status::check_edit("clients_labour_status",$status,"labour_edit"),
"avail_status" => acl::permission("labour_edit"),
"link_view" => "labour_details",
"link_edit" => "labour_edit",
"staff_id" => $user_id,
"id" =>$id
);
///bug::bug_array("context",$context);
$frm = new form_setup_labour($context);
if($_POST['Submit'] == "Save" && $lid != ""){
$result = $frm->edit_submit();
if($result) $frm->form_reset();
}elseif($_POST['Submit'] == "Save"){
$result = $frm->new_submit();
}
//$frm->form_menu();
$frm->set();
//$frm->hide_form();
$frm->form();
if(isset($id)){
$obj = new list_labour($context);
// $obj->get_data();
// bug::bug_array("obj",$obj);
$obj->get_data()->show();
}
?>