Example #1
0
         Page::message();
     }
     Page::EditPkg($_POST['pkgid']);
     break;
 case 'delpkg':
     $pkg = Package::getInstance();
     $order = Order::getInstance();
     if (!is_numeric($_REQUEST['pkgid'])) {
         throw new Exception("No package ID specified to delete");
     } elseif ($order->Calculate('', $_REQUEST['pkgid']) > 0) {
         Page::$messages[] = array('type' => 'attention', 'message' => 'You cannot remove this package because there are still existing orders for that package');
     } else {
         $pkg->Delete($_REQUEST['pkgid']);
         Page::$messages[] = array('type' => 'success', 'message' => 'Package successfully removed');
     }
     Page::Package();
     break;
 case 'delcustomer':
     if (!is_numeric($_REQUEST['userid']) && !isset($_REQUEST['username'])) {
         Page::$messages[] = array('type' => 'attention', 'message' => 'User ID is not set');
     } else {
         $user = User::getInstance();
         if (!is_numeric($_REQUEST['userid'])) {
             $userid = $user->GetID(trim($_REQUEST['username']), 'username');
         } else {
             $userid = $_REQUEST['userid'];
         }
         $user->Delete($userid);
         Page::ManageCustomers();
     }
     break;