fix variable issue, possible null date.

This commit is contained in:
Naomi 2011-03-31 18:54:26 -04:00
parent 3615bfbf59
commit 1503d01b00
1 changed files with 6 additions and 1 deletions

View File

@ -462,6 +462,11 @@ class Show {
global $CC_DBC;
if (is_null($p_date)) {
$p_date = Application_Model_Preference::GetShowsPopulatedUntil();
if ($p_date == "") {
$today_timestamp = date("Y-m-d");
Application_Model_Preference::SetShowsPopulatedUntil($today_timestamp);
}
}
$sql = "SELECT * FROM cc_show_days WHERE show_id = {$p_showId}";
@ -485,7 +490,7 @@ class Show {
{
global $CC_DBC;
if ($pop_timestamp != "") {
if ($p_startTimestamp != "") {
$sql = "SELECT * FROM cc_show_days
WHERE last_show IS NULL
OR first_show < '{$p_endTimestamp}' AND last_show > '{$p_startTimestamp}'";