示例#1
0
                        <td width="10%" align="right"> 
                        	 <input type=button onclick="javascript:writeForm.submit()" value=Search>
                        </td>
                      </tr>
                    </table>
                  </td>
                </tr>
              </table>
			  </form>
	</td>
</tr>
<?php 
if ($id && $startDate && $endDate) {
    // parse date
    $start = unixtime($startDate);
    $end = unixtime($endDate) + 86399;
    $f = array();
    $sql = "select count(*) time, sum(fusion_0), sum(fusion_1), sum(fusion_2), sum(fusion_3), sum(fusion_4), sum(fusion_5), sum(fusion_6), sum(fusion_7), sum(fusion_8) from ownership o, activity_data a where pulse>0 and o.phone_id=a.phone_id and o.participant_id={$id} and a.date between o.startDate and o.endDate and a.date between from_unixtime({$start}) and from_unixtime({$end})";
    $result = mysql_db_query($database, $sql, $conn);
    if ($row = mysql_fetch_array($result)) {
        $time = round($row[0] / 6) / 10;
        $f[0] = $row[1];
        $f[1] = $row[2];
        $f[2] = $row[3];
        $f[3] = $row[4];
        $f[4] = $row[5];
        $f[5] = $row[6];
        $f[6] = $row[7];
        $f[7] = $row[8];
        $f[8] = $row[9];
    }
示例#2
0
 *
 * This is the default viewing mode, and shows the current program listings.
 *
 * @license     GPL
 *
 * @package     MythWeb
 * @subpackage  TV
 *
 **/
// Were we passed a timestamp?  This is going to be the most common occurrence
if ($_REQUEST['time']) {
    $list_starttime = intVal($_REQUEST['time']);
} elseif (isset($_REQUEST['daytime'])) {
    $list_starttime = unixtime(sprintf('%08d%04d00', $_REQUEST['date'], $_REQUEST['daytime']));
} elseif (isset($_REQUEST['date'])) {
    $list_starttime = unixtime(sprintf('%08d%02d0000', $_REQUEST['date'], $_REQUEST['hour']));
} else {
    $list_starttime = time();
}
// Round *back* to the nearest timeslot size
$list_starttime -= $list_starttime % (timeslot_size * timeslot_blocks);
// Setup the time slots
$list_endtime = $list_starttime;
$Timeslots = array();
for ($i = 0; $i < num_time_slots; $i++) {
    $Timeslots[] = $list_endtime;
    $list_endtime += timeslot_size;
    // skip to the next timeslot
}
// Set a session variable so other sections know how to get back to this particular page
$_SESSION['list_time'] = $list_starttime;
示例#3
0
 * @subpackage  TV
 *
/**/
// Path-based
if ($Path[2]) {
    $_REQUEST['chanid'] = $Path[2];
    if (!$_REQUEST['date']) {
        $_REQUEST['date'] = $Path[3];
    }
}
// Chanid?
$this_channel =& Channel::find($_REQUEST['chanid']);
// New list date?
if ($_REQUEST['date']) {
    if (strlen($_REQUEST['date']) == 8) {
        $_REQUEST['date'] = unixtime(sprintf('%08d000000', $_REQUEST['date']));
    }
    $_SESSION['list_time'] = $_REQUEST['date'];
}
// No channel found
if (!$_REQUEST['chanid'] || !$this_channel->chanid) {
    redirect_browser(root_url . 'tv/list');
}
// Load the programs for today
$programs = load_all_program_data(mktime(0, 0, 0, date('n', $_SESSION['list_time']), date('j', $_SESSION['list_time']), date('Y', $_SESSION['list_time'])), mktime(0, 0, 0, date('n', $_SESSION['list_time']), date('j', $_SESSION['list_time']) + 1, date('Y', $_SESSION['list_time'])), $this_channel->chanid);
// No data?  Assume today.
if (count($programs) < 1) {
    $_SESSION['list_time'] = time();
    $programs = load_all_program_data(mktime(0, 0, 0, date('n', $_SESSION['list_time']), date('j', $_SESSION['list_time']), date('Y', $_SESSION['list_time'])), mktime(0, 0, 0, date('n', $_SESSION['list_time']), date('j', $_SESSION['list_time']) + 1, date('Y', $_SESSION['list_time'])), $this_channel->chanid);
    if (count($programs) < 1) {
        redirect_browser(root_url . 'tv/list');