예제 #1
0
 $schedule->autouserjob3 = $_POST['autouserjob3'] ? 1 : 0;
 $schedule->autouserjob4 = $_POST['autouserjob4'] ? 1 : 0;
 $schedule->autometadata = $_POST['autometadata'] ? 1 : 0;
 $schedule->inactive = $_POST['inactive'] ? 1 : 0;
 $schedule->maxnewest = $_POST['maxnewest'] ? 1 : 0;
 $schedule->dupin = _or($_POST['dupin'] + $_POST['dupin2'], dupsin_all);
 $schedule->dupmethod = _or($_POST['dupmethod'], 6);
 $schedule->recpriority = intval($_POST['recpriority']);
 $schedule->maxepisodes = intval($_POST['maxepisodes']);
 $schedule->startoffset = intval($_POST['startoffset']);
 $schedule->endoffset = intval($_POST['endoffset']);
 $schedule->prefinput = $_POST['prefinput'];
 $schedule->inetref = $_POST['inetref'];
 $schedule->season = intval($_POST['season']);
 $schedule->episode = intval($_POST['episode']);
 $schedule->filter = generateFilter();
 // Some settings specific to manual recordings (since we have no program to match against)
 $schedule->chanid = $_POST['channel'];
 $schedule->station = Channel::find($schedule->chanid)->callsign;
 $schedule->starttime = time();
 $schedule->endtime = time() + 1;
 $schedule->category = 'Custom recording';
 $schedule->search = $_POST['searchtype'];
 $schedule->findday = $_POST['findday'];
 $schedule->autotranscode = $_POST['autotranscode'] ? 1 : 0;
 $schedule->transcoder = $_POST['transcoder'];
 // Parse the findtime
 $schedule->findtime = trim($_POST['findtime']);
 if ($schedule->findtime) {
     if (!preg_match('/^\\d{1,2}:\\d{2}:\\d{2}$/', $schedule->findtime)) {
         add_error(t('Find Time must be of the format:  HH:MM:SS'));
예제 #2
0
                }
            }
        }
    }
    // ADDING THE JOINED TABLES
    $queryFilter = "";
    $queryTableSing = substr($queryTable, 0, -1);
    if (property_exists($filter, $qTable)) {
        if (property_exists($filter->{$qTable}, 'join')) {
            $f = $filter->{$qTable}->join;
            $c = 0;
            foreach ($f as $value) {
                $joinTableNameSing = substr($value, 0, -1);
                // subtitles -> subtitle used for model.json
                $queryWhere = "WHERE " . $queryTableSing . "_id = " . $r['id'];
                $queryFilter = generateFilter($joinTableNameSing);
                $q = generateQuery($queryFilter, $value, $queryWhere, "", "");
                $c = $db->query($q);
                if ($c) {
                    $r[$value] = array();
                    while ($t = $c->fetch(PDO::FETCH_ASSOC)) {
                        array_push($r[$value], $t);
                    }
                }
            }
        }
    }
    array_push($return[$qTable], $r);
    $return['success'] = true;
}
if ($return['count'] == 0) {