fixed typo
This commit is contained in:
parent
1fcd20fea3
commit
0819419b3b
1 changed files with 43 additions and 47 deletions
|
@ -1630,15 +1630,11 @@ class Application_Model_Show
|
||||||
WHERE last_show IS NULL
|
WHERE last_show IS NULL
|
||||||
OR first_show < :endTimeString AND last_show > :startTimeString");
|
OR first_show < :endTimeString AND last_show > :startTimeString");
|
||||||
|
|
||||||
//$stmt->execute(array(
|
|
||||||
//':endTimeString' => $endTimeString,
|
|
||||||
//':startTimeString' => $startTimeString
|
|
||||||
//));
|
|
||||||
$stmt->bindParam(':endTimeString', $endTimeString);
|
$stmt->bindParam(':endTimeString', $endTimeString);
|
||||||
$stmt->bindParam(':startTimeString', $startTimeString);
|
$stmt->bindParam(':startTimeString', $startTimeString);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
$res = $stmt->fetchAll();
|
||||||
$res = $stmt->execute()->fetchAll();
|
|
||||||
foreach ($res as $row) {
|
foreach ($res as $row) {
|
||||||
Application_Model_Show::populateShow($row, $p_endTimestamp);
|
Application_Model_Show::populateShow($row, $p_endTimestamp);
|
||||||
}
|
}
|
||||||
|
@ -1894,8 +1890,8 @@ SQL;
|
||||||
$numberOfRows = count($rows);
|
$numberOfRows = count($rows);
|
||||||
|
|
||||||
$results['previousShow'] = array();
|
$results['previousShow'] = array();
|
||||||
$results['currentShow'] = array();
|
$results['currentShow'] = array();
|
||||||
$results['nextShow'] = array();
|
$results['nextShow'] = array();
|
||||||
|
|
||||||
$timeNowAsMillis = strtotime($p_timeNow);
|
$timeNowAsMillis = strtotime($p_timeNow);
|
||||||
|
|
||||||
|
@ -1905,32 +1901,32 @@ SQL;
|
||||||
&& (strtotime($rows[$i]['ends']) > $timeNowAsMillis)) {
|
&& (strtotime($rows[$i]['ends']) > $timeNowAsMillis)) {
|
||||||
if ($i-1 >= 0) {
|
if ($i-1 >= 0) {
|
||||||
$results['previousShow'][0] = array(
|
$results['previousShow'][0] = array(
|
||||||
"id"=>$rows[$i-1]['id'],
|
"id" => $rows[$i-1]['id'],
|
||||||
"instance_id"=>$rows[$i-1]['instance_id'],
|
"instance_id" => $rows[$i-1]['instance_id'],
|
||||||
"name"=>$rows[$i-1]['name'],
|
"name" => $rows[$i-1]['name'],
|
||||||
"url"=>$rows[$i-1]['url'],
|
"url" => $rows[$i-1]['url'],
|
||||||
"start_timestamp"=>$rows[$i-1]['start_timestamp'],
|
"start_timestamp" => $rows[$i-1]['start_timestamp'],
|
||||||
"end_timestamp"=>$rows[$i-1]['end_timestamp'],
|
"end_timestamp" => $rows[$i-1]['end_timestamp'],
|
||||||
"starts"=>$rows[$i-1]['starts'],
|
"starts" => $rows[$i-1]['starts'],
|
||||||
"ends"=>$rows[$i-1]['ends'],
|
"ends" => $rows[$i-1]['ends'],
|
||||||
"record"=>$rows[$i-1]['record'],
|
"record" => $rows[$i-1]['record'],
|
||||||
"type"=>"show");
|
"type" => "show");
|
||||||
}
|
}
|
||||||
|
|
||||||
$results['currentShow'][0] = $rows[$i];
|
$results['currentShow'][0] = $rows[$i];
|
||||||
|
|
||||||
if (isset($rows[$i+1])) {
|
if (isset($rows[$i+1])) {
|
||||||
$results['nextShow'][0] = array(
|
$results['nextShow'][0] = array(
|
||||||
"id"=>$rows[$i+1]['id'],
|
"id" => $rows[$i+1]['id'],
|
||||||
"instance_id"=>$rows[$i+1]['instance_id'],
|
"instance_id" => $rows[$i+1]['instance_id'],
|
||||||
"name"=>$rows[$i+1]['name'],
|
"name" => $rows[$i+1]['name'],
|
||||||
"url"=>$rows[$i+1]['url'],
|
"url" => $rows[$i+1]['url'],
|
||||||
"start_timestamp"=>$rows[$i+1]['start_timestamp'],
|
"start_timestamp" => $rows[$i+1]['start_timestamp'],
|
||||||
"end_timestamp"=>$rows[$i+1]['end_timestamp'],
|
"end_timestamp" => $rows[$i+1]['end_timestamp'],
|
||||||
"starts"=>$rows[$i+1]['starts'],
|
"starts" => $rows[$i+1]['starts'],
|
||||||
"ends"=>$rows[$i+1]['ends'],
|
"ends" => $rows[$i+1]['ends'],
|
||||||
"record"=>$rows[$i+1]['record'],
|
"record" => $rows[$i+1]['record'],
|
||||||
"type"=>"show");
|
"type" => "show");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1941,16 +1937,16 @@ SQL;
|
||||||
//if we hit this we know we've gone to far and can stop looping.
|
//if we hit this we know we've gone to far and can stop looping.
|
||||||
if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) {
|
if (strtotime($rows[$i]['starts']) > $timeNowAsMillis) {
|
||||||
$results['nextShow'][0] = array(
|
$results['nextShow'][0] = array(
|
||||||
"id"=>$rows[$i]['id'],
|
"id" => $rows[$i]['id'],
|
||||||
"instance_id"=>$rows[$i]['instance_id'],
|
"instance_id" => $rows[$i]['instance_id'],
|
||||||
"name"=>$rows[$i]['name'],
|
"name" => $rows[$i]['name'],
|
||||||
"url"=>$rows[$i]['url'],
|
"url" => $rows[$i]['url'],
|
||||||
"start_timestamp"=>$rows[$i]['start_timestamp'],
|
"start_timestamp" => $rows[$i]['start_timestamp'],
|
||||||
"end_timestamp"=>$rows[$i]['end_timestamp'],
|
"end_timestamp" => $rows[$i]['end_timestamp'],
|
||||||
"starts"=>$rows[$i]['starts'],
|
"starts" => $rows[$i]['starts'],
|
||||||
"ends"=>$rows[$i]['ends'],
|
"ends" => $rows[$i]['ends'],
|
||||||
"record"=>$rows[$i]['record'],
|
"record" => $rows[$i]['record'],
|
||||||
"type"=>"show");
|
"type" => "show");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1958,15 +1954,15 @@ SQL;
|
||||||
//found a previous show so use it.
|
//found a previous show so use it.
|
||||||
if (count($results['previousShow']) == 0 && isset($previousShowIndex)) {
|
if (count($results['previousShow']) == 0 && isset($previousShowIndex)) {
|
||||||
$results['previousShow'][0] = array(
|
$results['previousShow'][0] = array(
|
||||||
"id"=>$rows[$previousShowIndex]['id'],
|
"id" => $rows[$previousShowIndex]['id'],
|
||||||
"instance_id"=>$rows[$previousShowIndex]['instance_id'],
|
"instance_id" => $rows[$previousShowIndex]['instance_id'],
|
||||||
"name"=>$rows[$previousShowIndex]['name'],
|
"name" => $rows[$previousShowIndex]['name'],
|
||||||
"start_timestamp"=>$rows[$previousShowIndex]['start_timestamp'],
|
"start_timestamp" => $rows[$previousShowIndex]['start_timestamp'],
|
||||||
"end_timestamp"=>$rows[$previousShowIndex]['end_timestamp'],
|
"end_timestamp" => $rows[$previousShowIndex]['end_timestamp'],
|
||||||
"starts"=>$rows[$previousShowIndex]['starts'],
|
"starts" => $rows[$previousShowIndex]['starts'],
|
||||||
"ends"=>$rows[$previousShowIndex]['ends'],
|
"ends" => $rows[$previousShowIndex]['ends'],
|
||||||
"record"=>$rows[$previousShowIndex]['record'],
|
"record" => $rows[$previousShowIndex]['record'],
|
||||||
"type"=>"show");
|
"type" => "show");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue