Exemple #1
0
     $smarty->assign('form', 'newdepartment');
     $smarty->display('home.tpl');
 } else {
     $Admin = new vMailAdmin();
     $Info = array();
     $Info['department'] = $_REQUEST['new_department'];
     $duplicates = $Admin->checkDupDepartments($Info);
     if ($duplicates) {
         $errors = array();
         $errors[] = "A Duplicate Department Already Exists.";
         $smarty->assign('new_department', $Info['department']);
         $smarty->assign('errors', $errors);
         $smarty->assign('form', 'newdepartment');
         $smarty->display('home.tpl');
     } else {
         if (!$Admin->addDepartment($Info)) {
             $errors = array();
             $errors[] = "The Specified Department Could not be added to the database. Please ensure that all daa has been entered correctly and that the Department Does not exist in the Database.";
             $smarty->assign('new_department', $Info['department']);
             $smarty->assign('errors', $errors);
             $smarty->assign('form', 'newdepartment');
             $smarty->display('home.tpl');
         } else {
             $smarty->assign('status', 'new_dept_success');
             $MySQL = new iacMySQL();
             $Stats = new HomePageStats($MySQL);
             $smarty->assign('HomePageStats', $Stats->GiveAllStats());
             $smarty->display('home.tpl');
         }
     }
 }