* Created by IntelliJ IDEA.
 * User: adarshs
 * Date: 30/12/14
 * Time: 1:36 PM
 * To change this template use File | Settings | File Templates.
 */
include_once "conn.php";
$queryAppend = '';
if (isset($_REQUEST['p']) && $_REQUEST['p'] != '') {
    $queryAppend = " AND cp = '" . $_REQUEST['p'] . "'";
}
if (isset($_REQUEST['res']) && $_REQUEST['res'] != '') {
    $res = $_REQUEST['res'];
}
if ($res == 'INPROCESS') {
    echo in_process($_Link, $queryAppend);
} elseif ($res == 'COMPLETED') {
    echo completed($_Link, $queryAppend);
} elseif ($res == 'FAILURE') {
    echo failure($_Link, $queryAppend);
} elseif ($res == "CLEAR") {
    failureClear($_Link, $_REQUEST['p'], $_REQUEST['id']);
}
function failureClear($_Link, $p, $id)
{
    if ($id > 0 && !empty($id)) {
        $updateQuery = "UPDATE jobs SET job_status = 999 WHERE job_id = " . $id;
        $res = mysqli_query($_Link, $updateQuery);
        $queryAppend = '';
        if (isset($p) && $p != '') {
            $queryAppend = " AND cp = '" . $p . "'";
示例#2
0
 static function updateCPBlockAjax($stage = '')
 {
     $stage_get = JRequest::getVar('stage');
     if ($stage_get) {
         $stage = $stage_get;
     }
     $db = JFactory::getDbo();
     if (in_process($stage)) {
         $content = $db->quote(file_get_contents(dirname(__FILE__) . '/module-content-in-process.html'));
     } else {
         $content = $db->quote(file_get_contents(dirname(__FILE__) . '/module-content.html'));
     }
     $q = $db->getQuery(true)->update('#__modules')->set(array('content = ' . $content))->where("module = 'mod_jino_spectrum_transfer'");
     $db->setQuery($q);
     method_exists($db, 'execute') ? $db->execute() : $db->query();
     return True;
 }