home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / dotproject / modules / departments / do_dept_aed.php < prev    next >
Encoding:
PHP Script  |  2003-04-04  |  741 b   |  27 lines

  1. <?php /* DEPARTMENTS $Id: do_dept_aed.php,v 1.2 2003/04/04 05:02:05 eddieajau Exp $ */
  2. $del = isset($_POST['del']) ? $_POST['del'] : 0;
  3.  
  4. $dept = new CDepartment();
  5. if (($msg = $dept->bind( $_POST ))) {
  6.     $AppUI->setMsg( $msg, UI_MSG_ERROR );
  7.     $AppUI->redirect();
  8. }
  9.  
  10. // prepare (and translate) the module name ready for the suffix
  11. $AppUI->setMsg( 'Department' );
  12. if ($del) {
  13.     if (($msg = $dept->delete())) {
  14.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  15.     } else {
  16.         $AppUI->setMsg( "deleted", UI_MSG_ALERT, true );
  17.     }
  18. } else {
  19.     if (($msg = $dept->store())) {
  20.         $AppUI->setMsg( $msg, UI_MSG_ERROR );
  21.     } else {
  22.         $isNotNew = @$_POST['department_id'];
  23.         $AppUI->setMsg( $isNotNew ? 'updated' : 'inserted', UI_MSG_OK, true );
  24.     }
  25. }
  26. $AppUI->redirect();
  27. ?>