Example #1
0
 public function adsallotAction()
 {
     $m = new Psys_AdsModel();
     $addOnelist = $m->GetList(' (find_in_set(5,colid))', 'id DESC', $page, $pagesize, "id,adname");
     $addTwolist = $m->GetList(' (find_in_set(6,colid))', 'id DESC', $page, $pagesize, "id,adname");
     $c = new Psys_AdsRule();
     $citys = $c->getcitys();
     $this->smarty->assign('addOnelist', $addOnelist[allrow]);
     $this->smarty->assign('addTwolist', $addTwolist[allrow]);
     $this->smarty->assign('citys', $citys[allrow]);
     $this->forward = "adsallot";
 }
Example #2
0
 /**
  * 转到广告修改页面
  */
 public function editAction()
 {
     $id = reqnum('id', 0);
     // 获取参数
     if (!$id) {
         echo 'empty id';
         exit;
     }
     $m = new Psys_AdsModel();
     $stationads = $m->getStationadsById($id);
     $adsOne = explode(',', $stationads['adsone']);
     $adsTwo = explode(',', $stationads['adstwo']);
     $this->smarty->assign('appkey', $stationads['appkey']);
     $this->smarty->assign('id', $stationads['id']);
     $this->smarty->assign('station', $stationads['name']);
     $r = new Psys_AdsRule();
     $addOnelist = $r->GetAllAds(array('colid' => 5));
     foreach ($addOnelist as &$var) {
         if (in_array($var['id'], $adsOne)) {
             $var['select'] = 1;
         } else {
             $var['select'] = 0;
         }
     }
     $addTwolist = $r->GetAllAds(array('colid' => 6));
     foreach ($addTwolist as &$var) {
         if (in_array($var['id'], $adsTwo)) {
             $var['select'] = 1;
         } else {
             $var['select'] = 0;
         }
     }
     $this->smarty->assign('onelist', $addOnelist);
     $this->smarty->assign('twolist', $addTwolist);
     $this->forward = "edit";
 }