errors = ""; } function getNullTime() { $minusDate = 360; $tyesterday = mktime(0,0,0,date('m'),date('d')-$minusDate,date('Y')); $startDate = date("Y-m-d H:i:s", $tyesterday); return $startDate; } function getNowTime() { return date( 'Y-m-d H:i:s', time()); } function getTomorrowTime() { $plusDate = 1; $ttomorrow = mktime(0,0,0,date('m'),date('d')+$plusDate,date('Y')); $startDate = date("Y-m-d H:i:s", $ttomorrow); return $startDate; } function getTomorrow($string_date) { $plusDate = 1; $ttomorrow = mktime(0,0,0,date('m'),date('d')+$plusDate,date('Y')); $startDate = date("Y-m-d H:i:s", $ttomorrow); return $startDate; } function getTodayBegin() { //$minusDate = 1; $tyesterday = mktime(0,0,0,date('m'),date('d'),date('Y')); $startDate = date("Y-m-d H:i:s", $tyesterday); return $startDate; } function getYesterdayTime() { $minusDate = 1; $tyesterday = mktime(0,0,0,date('m'),date('d')+$minusDate,date('Y')); $startDate = date("Y-m-d H:i:s", $tyesterday); return $startDate; } function isSameDate($date1, $date2) { $ret = false; $tmp1 = explode(" ",$date1); $tmp2 = explode(" ",$date2); $part1 = explode("-",$tmp1[0]); $part2 = explode("-",$tmp2[0]); if ($part1[0] == $part2[0] && $part1[1] == $part2[1] && $part1[2] == $part2[2]) { $ret = true; } return $ret; } function getChannelQuery($channel_id, $channel_child) { $newChannelCond = "a.channel_id IN ("; $newC =''; if( count($channel_child) > 0 ){ for($i=0; $i < count($channel_child) ; $i++) { $newC .= ''.$channel_child[$i]['channel_id']; if($i+1 < count($channel_child)) { $newC .=','; } } $newC .= ','.$channel_id; }else { $newC .= $channel_id; } $newChannelCond .= $newC .") "; return $newChannelCond; //echo "
$newChannelCond :
".$newChannelCond."
"; } } ?>