Пример #1
0
 function getCommonBatches()
 {
     $conn = getConnection();
     $list = array();
     $query = "SELECT * FROM report WHERE type = 1 AND indentifier = '" . $this->getIndentifier() . "' ORDER BY ID ASC";
     //echo $query;
     $result = mysql_query($query);
     while ($member = mysql_fetch_array($result)) {
         $temp = getBatch($member['batchID']);
         array_push($list, $temp);
     }
     if (count($list) != 0) {
         return $list;
     }
     return NULL;
 }
Пример #2
0
$conn = mysql_connect("localhost", $DBuser, $DBpassword);
mysql_select_db($DBname, $conn);
$action = mysql_real_escape_string($_GET['action']);
if (!isset($_SESSION['user'])) {
    echo "No access";
    return false;
}
switch ($action) {
    case "getUser":
        getUser();
        break;
    case "logout":
        logout();
        break;
    case "getBatch":
        getBatch();
        break;
    case "getBatchAll":
        getBatchAll();
        break;
    case "assignBatch":
        assignBatch();
        break;
    case "releaseBatch":
        releaseBatch();
        break;
    case "saveBatch":
        saveBatch();
        break;
    case "closeBatch":
        closeBatch();
Пример #3
0
function updateBatch($batchID, $name, $activeflag, $id)
{
    $conn = getConnection();
    $Obj = getBatch($batchID);
    $Obj->setName($name);
    $Obj->setActiveFlag($activeflag);
    $Obj->setCreatedBy($id);
    $result = $Obj->update();
    if ($result) {
        $message = "Batch Updated Successfully :" . $name;
    } else {
        $message = "Batch Updation Failed : " . $name;
    }
    return $message;
}
Пример #4
0
$count = getCustomSmsCount($smsID);
$custominput = array();
for ($i = 0; $i < $count; $i++) {
    $input = mysql_real_escape_string(trim($_POST[$smsID . 'c' . $i]));
    array_push($custominput, $input);
}
//print_r($custominput);
$temparray = array();
for ($i = 0; $i < 3; $i++) {
    if (isset($_POST['to' . $i]) && $_POST['to' . $i] == 1) {
        array_push($temparray, $i);
    }
}
$smssent = 0;
$list = array();
$batchObj = getBatch($batchID);
$list = getAllStudentsByBatch($batchObj, 3);
$sms = getSmsTemplate($smsID);
//echo count($list)."<br />";
for ($i = 0; $i < count($list); $i++) {
    if (isset($_POST['id' . $list[$i]->getID()]) && $_POST['id' . $list[$i]->getID()] == 1) {
        //$ID = $list[$i][0]->getID();
        //$tempStudent=getStudent($ID,0);
        $number = getStudentSmsNumber($list[$i], $temparray);
        //increaseSmsCounter($temparray);
        $test = prepMessageSms($sms, $custominput, $list[$i]);
        //echo $test."<br />";
        $request = getSmsSendInfo($number, $test);
        echo $request . " " . $list[$i]->getID() . "<br />";
        $sent = count($temparray);
        if ($sent == 0) {
Пример #5
0
 function read()
 {
     $conn = getConnection();
     $query = "SELECT * FROM report WHERE ID='" . $this->ID . "'";
     $result = mysql_query($query);
     if (!$result) {
         return;
     } else {
         $member = mysql_fetch_array($result);
         $this->setName(trim($member['name']));
         $this->setDateCreated(trim($member['datecreated']));
         $this->setActiveFlag(trim($member['activeflag']));
         $this->setCreatedBy(trim($member['createdby']));
         $this->setLastUpdated(trim($member['lastupdated']));
         $this->BatchObj = getBatch(trim($member['batchID']));
         $this->TestObjs = getTestObjsForReport(trim($member['testID']));
         $this->setDateReport(trim($member['datereport']));
         $this->setTestids(trim($member['testID']));
     }
 }
Пример #6
0
 function getBatchObj()
 {
     return getBatch($this->batchID);
 }