case 'add_project': $DId = $_POST['DId']; $Name = $_POST['Name']; $Info = $_POST['Info']; add_project($DId, $Name, $Info); include 'view/project.php'; break; case 'delete_project': $PId = $_POST['PId']; delete_project($PId); include 'view/project.php'; break; case 'show_employee': include 'view/list.php'; break; case 'delete_employee': $EId = $_POST['EId']; delete_employee($EId); include 'view/list.php'; break; case 'show_chamcong': include '/view/chamcong.php'; break; default: include 'view/dashboard.php'; break; } ?>
if (strlen(trim($_POST['email'])) == 0) { display_error(_("Email cannot be empty.")); set_focus('email'); return false; } if (isset($_POST['empl_id'])) { $empl_id = update_employee($_POST['empl_id'], $_POST['empl_name'], $_POST['pre_address'], $_POST['per_address'], $_POST['date_of_birth'], $_POST['age'], $_POST['mobile_phone'], $_POST['email'], $_POST['grade'], $_POST['department'], $_POST['designation'], $_POST['gross_salary'], $_POST['basic_salary'], $_POST['date_of_join']); meta_forward($_SERVER['PHP_SELF'], "Updated=yes&selected_id={$empl_id}"); } else { $empl_id = add_employee($_POST['empl_name'], $_POST['pre_address'], $_POST['per_address'], $_POST['date_of_birth'], $_POST['age'], $_POST['mobile_phone'], $_POST['email'], $_POST['grade'], $_POST['department'], $_POST['designation'], $_POST['gross_salary'], $_POST['basic_salary'], $_POST['date_of_join']); meta_forward($_SERVER['PHP_SELF'], "Added=yes&selected_id={$empl_id}"); } } if (isset($_POST['delete']) && strlen($_POST['delete']) > 1) { $selected_id = $_POST['empl_id']; delete_employee($selected_id); display_notification(_("Selected Employee has been deleted.")); $_POST['selected_id'] = ''; clear_data(); $Ajax->activate('_page_body'); } if (isset($selected_id) && $selected_id != '') { // first item display $_POST['empl_id'] = $_POST['selected_id']; $myrow = get_employee($_POST['empl_id']); $_POST['empl_id'] = $myrow["empl_id"]; $_POST['empl_name'] = $myrow["empl_name"]; $_POST['pre_address'] = $myrow["pre_address"]; $_POST['per_address'] = $myrow["per_address"]; $_POST['date_of_birth'] = sql2date($myrow["date_of_birth"]); $_POST['age'] = $myrow["age"];
function deleter($redisql) { delete_employee($redisql); delete_customer($redisql); delete_division($redisql); }
<?php require_once '../../../util/main.php'; require_once '../../../model/database.php'; require_once '../../../model/employee_db.php'; $success_notification = ''; $error_notification = ''; if (isset($_POST['id'])) { $ids = $_POST['id']; try { for ($count = 0; $count < count($ids); $count++) { $employeeID = $ids[$count]; delete_employee($employeeID); } } catch (Exception $e) { $error_notification = $e->getMessage(); } $success_notification = 'Successfully deleted'; require_once '../../../util/notification.php'; }