public function countStats()
 {
     if ($this->isAllowCountStats()) {
         $globalDAO = new GlobalDAO(DataSource::getInstance());
         $globalDAO->incStats();
     }
 }
Example #2
0
 private function handle($col)
 {
     $globalDAO = new GlobalDAO(DataSource::getInstance());
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $content = trim(remove_slashes($_POST['content']));
         if ($globalDAO->update($col, $content)) {
             $message = array('type' => 'info', 'value' => 'Lưu thành công.');
         } else {
             $message = array('type' => 'error', 'value' => 'Có lỗi xảy ra!');
         }
         $this->registry->template->message = $message;
         $this->registry->template->content = $content;
         $tmp = $globalDAO->select($col);
         $this->registry->template->content_backup = $tmp;
     } else {
         if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             $tmp = $globalDAO->select($col);
             $this->registry->template->content = $tmp;
             $this->registry->template->content_backup = $tmp;
         }
     }
     if ($col == 'about') {
         $s = '“Giới thiệu”';
     } else {
         if ($col == 'contact') {
             $s = '“Liên hệ”';
         }
     }
     $this->registry->template->tile_title = 'Soạn thảo trang ' . $s;
     $this->registry->template->tile_content = 'admin/compose.php';
     $this->registry->template->show('admin/layout/admin.php');
 }
Example #3
0
 public function index()
 {
     $globalDAO = new GlobalDAO(DataSource::getInstance());
     $this->registry->template->count_stats = $globalDAO->getStats();
     $this->registry->template->tile_title = 'Trang quản trị';
     $this->registry->template->tile_content = 'admin/dashboard.php';
     $this->registry->template->show('admin/layout/admin.php');
 }
Example #4
0
 public function index()
 {
     $categoryDAO = new CatDAO(DataSource::getInstance());
     $globalDAO = new GlobalDAO(DataSource::getInstance());
     $categories_list = $categoryDAO->findByAll_Navigation();
     $content = $globalDAO->select('help');
     $cart = getCart();
     $this->registry->template->categories_list = $categories_list;
     $this->registry->template->content = $content;
     $this->registry->template->cart = $cart;
     $this->registry->template->is_help_active = TRUE;
     $this->registry->template->tile_title = 'Trợ Giúp';
     $this->registry->template->tile_content = 'help.php';
     $this->registry->template->tile_footer = 'footer.php';
     $this->registry->template->show('layout/user.php');
 }
Example #5
0
 public function index()
 {
     $categoryDAO = new CatDAO(DataSource::getInstance());
     $globalDAO = new GlobalDAO(DataSource::getInstance());
     $categories_list = $categoryDAO->findByAll_Navigation();
     $content = $globalDAO->select('contact');
     $promoDAO = new PromoDAO(DataSource::getInstance());
     $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl();
     $cart = getCart();
     $this->registry->template->categories_list = $categories_list;
     $this->registry->template->content = $content;
     $this->registry->template->cart = $cart;
     $this->registry->template->is_contact_active = TRUE;
     $this->registry->template->facebook_description = 'Ms. Phương Thanh - 0987918796 - pttran87@gmail.com | Ms. Thùy Linh - 0983871412 - ptlinh1412@yahoo.com.vn';
     $this->registry->template->tile_title = 'Liên Hệ';
     $this->registry->template->tile_content = 'contact.php';
     $this->registry->template->tile_footer = 'footer.php';
     $this->registry->template->show('layout/user.php');
 }
Example #6
0
 public function index()
 {
     $categoryDAO = new CatDAO(DataSource::getInstance());
     $globalDAO = new GlobalDAO(DataSource::getInstance());
     $categories_list = $categoryDAO->findByAll_Navigation();
     $content = $globalDAO->select('about');
     $promoDAO = new PromoDAO(DataSource::getInstance());
     $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl();
     $cart = getCart();
     $this->registry->template->categories_list = $categories_list;
     $this->registry->template->content = $content;
     $this->registry->template->cart = $cart;
     $this->registry->template->is_about_active = TRUE;
     $this->registry->template->tile_title = 'Giới Thiệu';
     $this->registry->template->body_class = 'page-template';
     $this->registry->template->tile_content = 'about.php';
     $this->registry->template->tile_footer = 'footer.php';
     $this->registry->template->show('layout/user.php');
 }
Example #7
0
<?php

if (isset($_POST["continuar"])) {
    require_once "../../../public/lib/inclusion.php";
    require_once_model('Global');
    $nick = $_POST['nick'];
    $pass = $_POST['pass'];
    $connection = new GlobalDAO();
    if ($connection->getAdminExists($nick, md5($pass))) {
        session_start();
        $_SESSION['nick'] = $nick;
        $_SESSION['language'] = 'spanish';
        $_SESSION['admin'] = true;
        header("Location: ../../controllers/global/globalController.php");
    }
}
require "../../views/index/indexView.php";
Example #8
0
require_once "../../../public/lib/inclusion.php";
require '../../../public/config/sector.cfg.php';
require_once_model('Global');
function soMuchWin($success)
{
    if ($success) {
        echo "<img src='../../../public/img/buttons/done.gif'><br/>";
    } else {
        echo "<img src='../../../public/img/buttons/delete.png' style='width:20px; height: 20px; margin-left:10px;'><br/>Abortado.";
        die;
    }
}
//error_reporting (E_STRICT);
define('MODEL_ROUTE', '../../../public/models/');
require_once_model('Player', MODEL_ROUTE);
$globalConn = new GlobalDAO();
$playerConn = new PlayerDAO();
echo "Vaciando tablas";
soMuchWin($globalConn->truncateNonStaticData());
echo "Creando mapa";
$MAP_INCREMENTX = 10;
$MAP_INCREMENTY = 5;
require '../../controllers/global/seed_map_generator.php';
echo "<img src='../../../public/img/buttons/done.gif'><br/>";
$MAP_INCREMENTX = 2;
$MAP_INCREMENTY = 1;
echo "Reiniciando datos de Jugadores";
soMuchWin($globalConn->restartPlayerData());
echo "Asignando sectores iniciales";
$playerIdsArr = $globalConn->getAllPlayerIds();
$success = true;