コード例 #1
0
ファイル: clubs.php プロジェクト: uakfdotb/oneapp
 $club_data = clubInfo($_POST['club_id']);
 $club_name = $club_data[0];
 if (isset($_POST['sub'])) {
     if ($_POST['sub'] == "on") {
         $out = removeSubscription($_SESSION['user_id'], $_POST['club_id']);
         $inform["success"] = "Unsubscribed from {$club_name}! You will <b>NOT</b> recieve messages from {$club_name}";
     } else {
         if ($_POST['sub'] == "off") {
             $out = addSubscription($_SESSION['user_id'], $_POST['club_id']);
             $inform["success"] = "Subscribed to {$club_name}! You will now recieve messages from {$club_name}";
         }
     }
 } else {
     if (isset($_POST['app'])) {
         if ($_POST['app'] == "on") {
             $out = deleteApplication($_SESSION['user_id'], $_POST['club_id']);
             if ($out == 0) {
                 $inform["success"] = "Deleted application for {$club_name}!";
             } else {
                 if ($out == -1) {
                     $inform["warn"] = "You have not started the application for {$club_name}";
                 } else {
                     if ($out == -2) {
                         $inform["error"] = "This club does not exist!";
                     }
                 }
             }
         } else {
             if ($_POST['app'] == "off") {
                 $out = startApplication($_SESSION['user_id'], $_POST['club_id']);
                 if ($out == 0) {
コード例 #2
0
         printResult($response, "CONNECTING APPLICATION TO CVS DB FAILED", " Application {$appId} has been connected to the database {$dbName}." . PHP_EOL . " ---- CONNECTING APPLICATION TO CVS DB SUCCESSFULLY COMPLETED ----");
     } else {
         echo $response->getMessage();
     }
     break;
 case "deleteApplication":
     $msg = "Deleting Application ..." . PHP_EOL;
     echo PHP_EOL . "{$msg}";
     $email = getEMail();
     $password = getPassword();
     $dbName = getDbName();
     $appId = getAppId();
     if (is_numeric($appId)) {
         $response = deleteChannel($email, $password, $dbName, $appId);
     } else {
         $response = deleteApplication($email, $password, $dbName, $appId);
     }
     if (isOK($response)) {
         printResult($response, "DELETING APPLICATION FROM CVS FAILED", " Application {$appId} has been deleted from the database {$dbName}." . PHP_EOL . " ---- DELETING APPLICATION FROM CVS SUCCESSFULLY COMPLETED ----");
     } else {
         echo $response->getMessage();
     }
     break;
 case "addItem":
     echo "Adding item..." . PHP_EOL;
     $email = getEMail();
     $password = getPassword();
     $dbName = getDbName();
     $filePath = getItemPath();
     $identifier = getIdentifier();
     $metadata = getMetadata();