Example #1
0
             }
         } else {
             if (empty($_GET['submitType'])) {
                 $_SESSION['ERROR']['type'] = 'Error';
                 $_SESSION['ERROR']['reason'] = "Admin has Blocked this action.Please contact the admin";
             } else {
                 $errorAjax['type'] = 'Error';
                 $errorAjax['reason'] = "Admin has Blocked this action.Please contact the admin";
                 echo json_encode($errorAjax);
             }
         }
     }
 }
 // Edit Question
 if ($_GET['subaction'] == 'editqstn' && !empty($_GET['qid'])) {
     if (empty($_POST['quiz_category']) || empty($_POST['quiz_sub_category']) || empty($_POST['pq_qstn']) || empty($_POST['opt_count']) || empty($_POST['opt_ans']) || checkOpt($_POST['opt_count'])) {
         $_SESSION['ERROR']['type'] = 'Error';
         $_SESSION['ERROR']['reason'] = "Please check One of the Fields is left empty";
     } else {
         if ($pq->pqEditQuestion($db, $_POST, $_SESSION['UA_DETAILS'], $_GET['type'], $_GET['qid'])) {
             $_SESSION['ERROR']['type'] = 'Done';
             $_SESSION['ERROR']['reason'] = "Question #" . $_GET['qid'] . " Edited sucessfully";
         } else {
             $_SESSION['ERROR']['type'] = 'Error';
             $_SESSION['ERROR']['reason'] = "Some Error Occured . Please Try Again.";
         }
     }
 }
 // Delete Question
 if ($_GET['subaction'] == 'delqstn' && !empty($_GET['qid'])) {
     $sql = "DELETE FROM " . QUIZTABLE . " WHERE `qid` = '" . $_GET['qid'] . "'";
Example #2
0
function main($i_argc, $a_argv)
{
    $a_opt = getopt("of:p:m:s", array());
    $a_trade = array();
    if (checkParam($i_argc, $a_argv) === false) {
        return;
    }
    if (checkOpt($a_opt) === false) {
        return;
    }
    if (checkFile($a_opt['f']) === false) {
        return;
    }
    init($a_trade, $a_opt);
    trade($a_trade, $a_opt);
    tradeInfo($a_trade, $a_opt);
}