예제 #1
0
 public function getContent()
 {
     $action = Core_Tools::getInput('_GET', 'action', 'varchar', false);
     $shop = Profile_Shop::getShop(Core_Tools::getInput('_GET', 'id', 'int'));
     $myself = Profile_Member::getMyself();
     if ($action == 'add') {
         return $this->getAddShop();
     } elseif ($action == 'manage' && $shop->isFound() && $myself && $shop->canModerate($myself)) {
         return $this->getShopManagement($shop);
     } elseif ($action == 'moderator' && $shop->isFound() && $myself && $shop->canModerate($myself)) {
         return $this->getModeratorManagement($shop);
     } elseif ($action == 'categories' && $shop->isFound() && $myself && $shop->canModerate($myself)) {
         return $this->getManageCategories($shop);
     } elseif ($shop->isFound()) {
         return $this->getOverview($shop);
     } else {
         return '<p>Invalid input.</p>';
     }
 }
예제 #2
0
 public function getPendingOrders()
 {
     $db = Core_Database::__getInstance();
     $l = $db->getDataFromQuery($db->customQuery("\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\torders o\n\t\t\tLEFT JOIN\n\t\t\t\torder_prods op ON o.o_id = op.o_id\n\t\t\tWHERE\n\t\t\t\top.plid = '" . (int) $this->getId() . "'\n\t\t\t\tAND o.o_isDone = '0'\n\t\t"));
     $o = array();
     foreach ($l as $v) {
         $shop = Profile_Shop::getShop($v['s_id']);
         $company = Profile_Company::getCompany($v['c_id']);
         $o[] = array($shop->getProduct($v['p_id']), $v, $company, $shop);
     }
     return $o;
 }
예제 #3
0
 public function getShops()
 {
     $db = Core_Database::__getInstance();
     $l = $db->select('companies_shop', array('*'), "c_id = '" . $db->escape($this->getId()) . "'");
     $o = array();
     foreach ($l as $v) {
         $o[] = Profile_Shop::getShop($v['s_id']);
     }
     return $o;
 }
예제 #4
0
 public function getGoogleContent()
 {
     $db = Core_Database::__getInstance();
     $shop = Core_Tools::getInput('_GET', 'sid', 'int', false);
     if ($shop > 0) {
         // Show all products of this shop
         $shop = Profile_Shop::getShop($shop);
         if ($shop) {
             $shop_page = new Pages_Shop();
             return $shop_page->getOverview($shop);
         }
     }
     // Show a list of all shops.
     $page = new Core_Template();
     $data = $db->select('shops', array('*'), null, 's_name ASC');
     foreach ($data as $v) {
         $page->addListValue('shops', array('name' => Core_Tools::output_varchar($v['s_name']), 'url' => self::getUrl('page=order&sid=' . $v['s_id']), 'location' => Core_Tools::output_varchar($v['s_gemeente'])));
     }
     return $page->parse('google_shops.phpt');
 }