Example #1
0
     $nt = Notification::getInstance();
     $user = User::getInstance();
     if ($_POST['sendtousers'] == 'all') {
         $sendto = $user->GetButch();
     } elseif (is_numeric($_POST['sendtousers'])) {
         $sendto = $user->GetButch('', "`id` = '" . $_POST['sendtousers'] . "'");
     } else {
         throw new Exception("Target users is not specified or in wrong format");
     }
     try {
         $nt->Send($sendto, false, false, $_POST['subject'], $_POST['message']);
     } catch (Exception $e) {
         Page::$messages[] = array('type' => 'attention', 'message' => nl2br("Fatal error catched: " . $e));
         Page::message();
     }
     Page::SendMessage();
     break;
 case 'updatecustomer':
     $user = User::getInstance();
     if (isset($_POST['password'])) {
         $_POST['password'] = md5($_POST['password']);
     }
     try {
         $user->BatchUpdate($_POST, $_POST['userid']);
     } catch (Exception $e) {
         Page::$messages[] = array('type' => 'attention', nl2br("Fatal error catched: " . $e));
         Page::message();
     }
     Page::EditCustomer($_POST['userid']);
     break;
 case 'delpres':