Thứ Tư, 22 tháng 8, 2012

RENEW ADS


 function renewContent($contentid,$ad_duration)
{
$ad_duration = 1;
                $this->_db->setQuery( "SELECT expiration_date FROM #__adsmanager_ads WHERE id = ".(int)$contentid);
$expiration_date = $this->_db->loadResult();
$time = strtotime($expiration_date);
if ($time < time())
{
$time = time();
}
$time = $time + ( $ad_duration * 3600 *24);
                $newdate = date("Y-m-d",$time);
                $now=date("Y-m-d H:i:s");
             
$this->_db->setQuery( "UPDATE #__adsmanager_ads SET expiration_date = '$newdate', date_created = '$now',recall_mail_sent=0,published=1 WHERE id=".(int)$contentid);
$this->_db->query();
}


 $table=  JTable::getInstance('Property', 'IpropertyTable');
        $table->created=date("Y-m-d H:i:s");

Không có nhận xét nào:

Đăng nhận xét

Related Posts Plugin for WordPress, Blogger...