コード例 #1
0
ファイル: Donate.php プロジェクト: CatLabInteractive/1brood
 protected function getContent()
 {
     $page = new Core_Template();
     $text = Core_Text::__getInstance();
     $text->setFile('about');
     $text->setSection('about');
     return $page->parse('donate.tpl');
 }
コード例 #2
0
ファイル: Error404.php プロジェクト: CatLabInteractive/1brood
 protected function getContent()
 {
     $page = new Core_Template();
     $text = Core_Text::__getInstance();
     $page->set('title', Core_Tools::putIntoText($text->get('title', 'error404', 'main'), array($this->sPage)));
     $page->set('descr', $text->get('descr', 'error404', 'main'));
     return $page->parse('error404.tpl');
 }
コード例 #3
0
ファイル: Home.php プロジェクト: CatLabInteractive/1brood
 protected function getContent()
 {
     $text = Core_Text::__getInstance();
     $text->setFile('about');
     $text->setSection('home');
     $page = new Core_Template();
     $page->set('title', $text->get('title'));
     $page->set('manual', $text->get('manual'));
     $page->set('companies', $text->get('companies'));
     $page->set('login', $text->get('login'));
     $page->set('choose', $text->get('choose'));
     $page->set('order', $text->get('order'));
     $page->set('eat', $text->get('eat'));
     $page->set('toMoreInfo', $text->getClickTo($text->get('toMoreInfo')));
     $page->set('moreInfoLink', self::getUrl('page=about'));
     return $page->parse('home.tpl');
 }
コード例 #4
0
ファイル: Welcome.php プロジェクト: CatLabInteractive/1brood
 protected function getContent()
 {
     $action = Core_Tools::getInput('_POST', 'welcome_selection', 'varchar');
     switch ($action) {
         case 'honger':
             header('Location: ' . $this->getUrl('page=register&nocompany=false'));
             break;
         case 'geld':
             header('Location: ' . $this->getUrl('page=register&nocompany=true&action=shopowner'));
             break;
     }
     $text = Core_Text::__getInstance();
     $text->setFile('about');
     $text->setSection('home');
     $page = new Core_Template();
     $page->set('action', $this->getUrl('page=welcome'));
     return $page->parse('welcome.tpl');
 }
コード例 #5
0
ファイル: About.php プロジェクト: CatLabInteractive/1brood
 protected function getContent()
 {
     $page = new Core_Template();
     $text = Core_Text::__getInstance();
     $text->setFile('about');
     $text->setSection('about');
     $page->set('title', $text->get('title'));
     $page->set('about1', $text->get('about1'));
     $page->set('about2', $text->get('about2'));
     $page->set('forWho', $text->get('forWho'));
     $page->set('forWho1', $text->get('forWho1'));
     $page->set('cost', $text->get('cost'));
     $page->set('cost1', $text->get('cost1'));
     $page->set('examp', $text->get('examp'));
     $page->set('examp1', $text->get('examp1'));
     $page->set('examp2', $text->get('examp2'));
     $page->set('examp3', $text->get('examp3'));
     return $page->parse('about.tpl');
 }
コード例 #6
0
ファイル: Register.php プロジェクト: CatLabInteractive/1brood
 private function getEditProfile()
 {
     $myself = Profile_Member::getMyself();
     if (!$myself) {
         return $this->getRegistrationForm();
     }
     // Process incoming data
     $firstname = Core_Tools::getInput('_POST', 'firstname', 'varchar');
     $name = Core_Tools::getInput('_POST', 'name', 'varchar');
     $nickname = Core_Tools::getInput('_POST', 'nickname', 'username');
     $email = Core_Tools::getInput('_POST', 'email', 'email');
     $page = new Core_Template();
     if ($firstname && $name && $nickname && $email) {
         // Update the database
         $db = Core_Database::__getInstance();
         $db->update('players', array('firstname' => $firstname, 'lastname' => $name, 'realname' => $nickname, 'email' => $email), "plid = {$myself->getId()}");
         $myself->reloadData();
         $page->set('done', true);
     } elseif ($firstname || $name || $nickname || $email) {
         $page->set('done', false);
     }
     $page->set('nickname', Core_Tools::output_form($myself->getUsername()));
     $page->set('firstname', Core_Tools::output_form($myself->getFirstname()));
     $page->set('name', Core_Tools::output_form($myself->getName()));
     $page->set('email', Core_Tools::output_form($myself->getEmail()));
     return $page->parse('account_edit.tpl');
 }
コード例 #7
0
ファイル: Page.php プロジェクト: CatLabInteractive/1brood
 protected function getBasket()
 {
     $myself = Profile_Member::getMyself();
     if ($myself) {
         $orders = $myself->getPendingOrders();
         if (count($orders) > 0) {
             // Process Input
             $remId = Core_Tools::getInput('_GET', 'bRem', 'int');
             if ($remId > 0) {
                 $myself->removeProductFromBasket($remId);
                 // Reload ;-)
                 $orders = $myself->getPendingOrders();
             }
             $text = Core_Text::__getInstance();
             $page = new Core_Template();
             $page->set('remove', addslashes($text->get('remove', 'basket', 'main')));
             $page->set('title', $text->get('title', 'basket', 'main'));
             foreach ($orders as $v) {
                 // Create combination string
                 $comb = $v[1]['op_amount'] . 'x ' . Core_Tools::output_varchar($v[0]['p_name']) . ", ";
                 $comb .= !empty($v[1]['op_message']) ? Core_Tools::output_varchar($v[1]['op_message']) . ", " : null;
                 $comb .= Core_Tools::output_varchar($v[2]->getName()) . ", ";
                 $comb .= Core_Tools::output_varchar($v[3]->getName());
                 $page->addListValue('products', array(Core_Tools::output_varchar($v[0]['p_name']), Core_Tools::output_varchar($v[1]['op_amount']), Core_Tools::output_varchar($v[1]['op_message']), Core_Tools::output_varchar($v[1]['op_price']), Core_Tools::output_varchar($v[2]->getName()), Core_Tools::output_varchar($v[3]->getName()), addslashes($comb), self::getUrl('page=register&bRem=' . $v[1]['op_id'])));
             }
             return $page->parse('blocks/basket.tpl');
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
コード例 #8
0
ファイル: Shop.php プロジェクト: CatLabInteractive/1brood
 public function getShopManagement($objShop)
 {
     $login = Core_Login::__getInstance();
     $db = Core_Database::__getInstance();
     $text = Core_Text::__getInstance();
     $text->setFile('shop');
     $text->setSection('manager');
     // Check for input
     $input = Core_Tools::getInput('_POST', 'submit', 'varchar');
     if ($input == 'saveSettings') {
         $this->processManagementInput($objShop);
     }
     $page = new Core_Template();
     $categories = $objShop->getCategories();
     $colsToShow = $objShop->getMaxPricesPerCategory($categories);
     foreach ($categories as $v) {
         $page->addListValue('categories', array('id' => $v['c_id'], 'name' => Core_Tools::output_varchar($v['c_name'])));
     }
     $page->set('priceColsToShow', $colsToShow);
     $page->set('title', Core_Tools::putIntoText($text->get('title'), array(Core_Tools::output_varchar($objShop->getName()))));
     $page->set('message', $text->get('message'));
     $page->set('message_value', Core_Tools::output_form($objShop->getMessage()));
     $page->set('products', $text->get('products'));
     $page->set('productName', $text->get('productName'));
     $page->set('productText', $text->get('productText'));
     $page->set('productPrice', $text->get('productPrice'));
     $page->set('noRows', $text->get('noRows'));
     $page->set('submit', $text->get('submit'));
     $page->set('formAction', self::getUrl('page=shop&id=' . $objShop->getId() . '&action=manage'));
     // Add row link
     $page->set('toAddRow', $text->getClickTo($text->get('toAddRow')));
     $page->set('addRow', $text->get('addRow'));
     $page->set('editCategory', $text->get('editCategory'));
     $page->set('editCategory_url', self::getUrl('page=shop&id=' . $objShop->getId() . '&action=categories'));
     // Loop products
     $products = $objShop->getProducts();
     foreach ($products as $v) {
         // Fetch the prices
         $page->addListValue('products', array($v['p_id'], Core_Tools::output_form($v['p_name']), Core_Tools::output_form($v['p_info']), $v['prices'], $v['c_id']));
     }
     return $page->parse('shop_manage.tpl');
 }
コード例 #9
0
 private function getChangePassword($id, $key)
 {
     $text = Core_Text::__getInstance();
     $text->setFile('main');
     $text->setSection('lostpass');
     // Check the key
     $db = Core_Database::__getInstance();
     $chk = $db->select('players', array('plid'), "plid = " . intval($id) . " AND seckey = '" . $db->escape($key) . "'");
     if (count($chk) === 1) {
         $password1 = Core_Tools::getInput('_POST', 'pass1', 'varchar');
         $password2 = Core_Tools::getInput('_POST', 'pass2', 'varchar');
         $page = new Core_Template();
         $page->set('title', $text->get('changepass'));
         $page->set('about', $text->get('aboutchange'));
         $page->set('pass1', $text->get('pass1'));
         $page->set('pass2', $text->get('pass2'));
         $page->set('submit', $text->get('submitchange'));
         if ($password1 && $password1 === $password2) {
             $login = Core_Login::__getInstance();
             $login->setPassword($chk[0]['plid'], $password1);
             $page->set('success', $text->get('passchanged'));
         } elseif ($password1 || $password2) {
             $page->set('warning', $text->get('passmismatch'));
         }
         return $page->parse('lostPassword_res.tpl');
     } else {
         return '<p class="false">Security Key Not Found.</p>';
     }
 }
コード例 #10
0
ファイル: Order.php プロジェクト: CatLabInteractive/1brood
 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');
 }
コード例 #11
0
ファイル: Company.php プロジェクト: CatLabInteractive/1brood
 public function getPoefboekLog($objCompany)
 {
     $me = Profile_Member::getMyself();
     $status = $objCompany->getUserStatus($me);
     $bShowLogs = Core_Tools::getInput('_GET', 'details', 'int') == 1;
     if ($status != 'pending') {
         $user = Profile_Member::getMember(Core_Tools::getInput('_GET', 'uid', 'int'));
         if ($user->isFound()) {
             $text = Core_Text::__getInstance();
             $text->setFile('company');
             $text->setSection('poeflog');
             $page = new Core_Template();
             $locname = Core_Tools::output_varchar($user->getUsername()) . ' @ ' . Core_Tools::output_varchar($objCompany->getName());
             $page->set('poeflog', $text->get('poeflog') . ': ' . $locname);
             $page->set('nologs', $text->get('nologs'));
             $page->set('return', $text->get('return'));
             $page->set('return_url', self::getUrl('page=company&id=' . $objCompany->getId()));
             if (!$bShowLogs) {
                 $page->set('show_details_url', self::getUrl('page=company&id=' . $objCompany->getId() . '&action=poeflog&uid=' . $user->getId() . '&details=1'));
             } else {
                 $page->set('hide_details_url', self::getUrl('page=company&id=' . $objCompany->getId() . '&action=poeflog&uid=' . $user->getId() . '&details=0'));
             }
             $page->set('datum', $text->get('datum'));
             $page->set('amount', $text->get('amount'));
             $page->set('balance', $text->get('balance'));
             $page->set('actor', $text->get('actor'));
             foreach ($objCompany->getPoefboekLog($user, $bShowLogs) as $v) {
                 $page->addListValue('logs', array('date' => date(DATETIME, $v['date']), 'amount' => Core_Tools::convert_price($v['amount']), 'newpoef' => Core_Tools::convert_price($v['newpoef']), 'actor_name' => $v['actor_name'], 'actor_url' => $v['actor_url'], 'comment' => Core_Tools::output_varchar($v['comment']), 'details' => $v['details']));
             }
             $page->set('showDetails', $bShowLogs);
             return $page->parse('company_poeflog.tpl');
         } else {
             return '<p>User not found.</p>';
         }
     } else {
         return '<p>No permission to watch logs.</p>';
     }
 }