function moreinfoAction() { $guid = $this->_getParam('guid'); $tblPowerban = new Pandamp_Modules_Misc_Banner_Model_Powerban(); $rowset = $tblPowerban->find($guid)->current(); if ($rowset) { $this->view->rowset = $rowset; } }
function visitAction() { $guid = $this->_getParam('guid'); $tblPowerban = new Pandamp_Modules_Misc_Banner_Model_Powerban(); $rowset = $tblPowerban->find($guid); if (count($rowset)) { $row = $rowset->current(); $row->visits = $row->visits + 1; $gid = $row->save(); if ($gid) { $tblPowerbanVisit = new Pandamp_Modules_Misc_Banner_Statistic_Model_PowerbanStatistik(); $rowPStatistik = $tblPowerbanVisit->fetchNew(); $rowPStatistik->bid = $guid; $rowPStatistik->host = gethostbyname($_SERVER['HTTP_REFERER']); $rowPStatistik->address = Pandamp_Lib_Formater::getRealIpAddr(); $rowPStatistik->agent = $_SERVER['HTTP_USER_AGENT']; $rowPStatistik->datetime = date("Y-m-d h:i:s"); $rowPStatistik->referer = $_SERVER['HTTP_REFERER']; $rowPStatistik->save(); } $this->_redirect($row->url); } }
function delete($guid) { $tblPowerban = new Pandamp_Modules_Misc_Banner_Model_Powerban(); $rowset = $tblPowerban->find($guid); if (count($rowset)) { $row = $rowset->current(); $split = explode("/", $row->src); if (isset($row->fa)) { $sDir = ROOT_DIR . '/iklan/' . $row->fa; if (isset($split) && !empty($split)) { if (file_exists($sDir . "/" . $split[6])) { unlink($sDir . "/" . $split[6]); } } if (isset($row->af) && !empty($row->af)) { // $split2 = explode("/",$row->af); // if (file_exists($sDir."/".$split2[7])) { unlink($sDir."/".$split2[7]); } $attachfile = unserialize($row->af); foreach ($attachfile as $file) { if (file_exists($sDir . "/" . $file)) { unlink($sDir . "/" . $file); } // echo $file.'<br>'; } // die(); } } else { $sDir = ROOT_DIR . '/iklan'; if (isset($split) && !empty($split)) { if (file_exists($sDir . "/" . $split[6])) { unlink($sDir . "/" . $split[6]); } } if (isset($row->af) && !empty($row->af)) { // $split2 = explode("/",$row->af); // if (file_exists($sDir."/".$split2[6])) { unlink($sDir."/".$split2[6]); } $attachfile = unserialize($row->af); foreach ($attachfile as $file) { if (file_exists($sDir . "/" . $file)) { unlink($sDir . "/" . $file); } } } } $cache = Zend_Registry::get('cache'); $cacheKey = "fb_zid_" . $row->zone; $cache->remove($cacheKey); $row->delete(); } }