function getCounterOfLastWeek($time,$start = 0)
{
$start = $start?$start:$this->startDate;
$time = $time?$time:$this->curTime;
$date = date("w",$time);
$startDate = $date - $start + 7;
$endDate = (6 + $start) - $date - 7;
$startDay = date("Y-m-d",$time - $startDate*3600*24);
$endDay = date("Y-m-d",$time + $endDate*3600*24);;
$where = "WHERE date>='".$startDay."' AND date<='".$endDay."'";
$query = "SELECT SUM(sum) AS total FROM #__countertkwd_days ".$where;
$db =& JFactory::getDBO();
$db->setQuery($query);
$item = $db->loadObject();
return $item->total?$item->total:0;
}
[hr]
function getCounterOfWeek($time,$start = 0)
{
$start = $start?$start:$this->startDate;
$time = $time?$time:$this->curTime;
$date = date("w",$time);
$startDate = $date - $start;
$endDate = (6 + $start) - $date;
$startDay = date("Y-m-d",$time - $startDate*3600*24);
$endDay = date("Y-m-d",$time + $endDate*3600*24);;
$where = "WHERE date>='".$startDay."' AND date<='".$endDay."'";
$query = "SELECT SUM(sum) AS total FROM #__countertkwd_days ".$where;
$db =& JFactory::getDBO();
$db->setQuery($query);
$item = $db->loadObject();
return $item->total;
}
علاقه مندی ها (Bookmarks)