コード例 #1
0
ファイル: cities.php プロジェクト: alcounit/franchAdmin
 public function __construct()
 {
     $this->_model = new \models\admin\cities();
     $session = \helpers\session::id();
     if (!$this->_model->get_session($session)) {
         url::redirect('admin/login');
     }
     $this->_acl = new \helpers\acl();
     $this->_rights = $this->_acl->is_allow();
     if (json_decode($this->_rights[0]->pages)->{'cities'}->acl_level == 0) {
         url::redirect('admin/login');
     }
     \helpers\session::pull('url');
 }
コード例 #2
0
ファイル: permissions.php プロジェクト: alcounit/franchAdmin
 public function index()
 {
     $data['pages'] = json_decode($this->_rights[0]->pages);
     $data['title'] = 'Настройки доступа';
     $data['breadcrumbs'] = array();
     $data['breadcrumb'][] = array('text' => 'Главная', 'href' => '/admin/');
     $data['permission'] = $this->_model->get_permissions();
     $data['url'] = '/admin/permissions/add';
     $data['url_title'] = 'Новые правила доступа';
     \helpers\session::pull('url');
     view::rendertemplate('header', $data);
     view::rendertemplate('admin_menu', $data);
     view::render('admin/permissions', $data, $error);
     view::rendertemplate('footer');
 }
コード例 #3
0
ファイル: search.php プロジェクト: alcounit/franchAdmin
 public function index()
 {
     $data['title'] = 'Поиск';
     $data['breadcrumbs'] = array();
     $data['breadcrumb'][] = array('text' => 'Заказы', 'href' => '/');
     if (isset($_GET['keyword'])) {
         //$keyword = preg_replace('/\D+/', '', trim(stripslashes(strip_tags(urldecode($_GET['keyword'])))));
         $keyword = str_replace('-', '', trim(stripslashes(strip_tags(urldecode($_GET['keyword'])))));
         $data['search'] = $this->_model->search($keyword, $this->user_id);
         if (!empty($_GET['keyword'])) {
             \helpers\session::set('url', substr($_SERVER['REQUEST_URI'], 1));
         } else {
             \helpers\session::pull('url');
         }
     }
     view::rendertemplate('header', $data);
     view::rendertemplate('user_menu', $data);
     view::render('search', $data, $error);
     view::rendertemplate('footer');
 }
コード例 #4
0
ファイル: users.php プロジェクト: fabioassuncao/build-a-blog
<ul class="breadcrumb">
	<li><a href='<?php 
echo DIR;
?>
admin'>Admin</a> <span class="divider">></span></li>
	<li>Manage Users</li>
</ul>	

<h1>Users</h1>

<?php 
echo \helpers\session::pull('message');
?>

<p><a href='<?php 
echo DIR;
?>
admin/users/add' class='btn btn-info'>Add User</a></p>

<table class='table table-striped table-hover table-bordered responsive'>
<tr>
	<th>Username</th>
	<th>Email</th>
	<th>Action</th>
</tr>
<?php 
if ($data['users']) {
    foreach ($data['users'] as $row) {
        echo "<tr>";
        echo "<td>{$row->username}</td>";
        echo "<td>{$row->email}</td>";
コード例 #5
0
ファイル: orders.php プロジェクト: alcounit/franchAdmin
    public function index()
    {
        $data['title'] = 'Заказы';
        $data['breadcrumbs'] = array();
        $data['count'] = $this->_model->get_orders_count($this->user_id);
        $items = 50;
        $data['total'] = ceil($data['count'][0]->total / $items);
        if (!empty($_POST)) {
            if (preg_match("/^\\d{1,}\$/", $_POST['p'])) {
                $position = $_POST['p'] * $items;
                $data['orders'] = $this->_model->get_orders($this->user_id, $position, $items);
                if ($data['orders']) {
                    foreach ($data['orders'] as $value) {
                        ?>
        
                            <tr <?php 
                        echo $value->status_id == 3 ? date("Y-m-d") >= date('Y-m-d', strtotime($value->performed_date . "+2 day")) ? 'class="danger"' : '' : '';
                        ?>
>
                                <td><strong><?php 
                        echo $value->id;
                        ?>
</strong></td>
                                <td>
                                    <?php 
                        if ($value->hidden == 1) {
                            echo "<span class=\"glyphicon glyphicon-eye-close\" aria-hidden=\"true\"></span><br>";
                        }
                        ?>
                                    <span class="label <?php 
                        echo $value->color;
                        ?>
">
                                        <?php 
                        echo $value->status;
                        ?>
                                    </span>
                                </td>            
                                <td>
                                    <?php 
                        echo $value->status_id <= 2 && date("Y-m-d") <= date('Y-m-d', strtotime($value->certain_date)) ? $value->certain_date != '0000-00-00 00:00:00' ? '<span class="label label-default">Заказ на: ' . date('d.m.Y', strtotime($value->certain_date)) . '</span> ' : '' : '';
                        ?>
<a href="/view/<?php 
                        echo $value->id;
                        ?>
"><?php 
                        echo $value->status_id == 5 || $value->status_id == 2 ? "<strike>" . $value->description . "...</strike>" : $value->description . "...";
                        ?>
</a>
                                    <?php 
                        /* <p><strong><?php echo $value->name; ?> / <?php echo $value->city; ?></strong></p>  */
                        ?>
                                </td>
                                <td><?php 
                        echo date('d.m.Y', strtotime($value->creation_date));
                        ?>
г</td>
                                <td>
                                    <?php 
                        if ($value->payed_date != "0000-00-00 00:00:00") {
                            echo date('d.m.Y', strtotime($value->payed_date)) . "г";
                        } else {
                            echo 'нет данных';
                        }
                        ?>
                                </td>
                                <td>
                                    <strong <?php 
                        echo $value->status_id == 3 || $value->status_id == 4 || $value->status_id == 5 ? 'class="money"' : '';
                        ?>
><?php 
                        echo $value->profit;
                        ?>
</strong>
                                </td>
                                <td>
                                    <div class="btn-group">
                                        <button class="btn btn-default btn-xs dropdown-toggle btn-primary" type="button" data-toggle="dropdown" aria-expanded="false">
                                            <span class="glyphicon glyphicon-cog">&nbsp;</span><span class="caret"></span>
                                        </button>
                                        <ul class="dropdown-menu dropdown-menu-right" role="menu" style="font-size: 16px;">
                                            <li><a href="/edit/<?php 
                        echo $value->id;
                        ?>
">Редактировать</a></li>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                <?php 
                    }
                }
            }
        } else {
            $position = 0;
            $data['orders'] = $this->_model->get_orders($this->user_id, $position, $items);
            $data['statuses'] = $this->_model->show_statuses();
            $data['profit'] = $this->_model->sum_profit($this->user_id);
            \helpers\session::pull('url');
            view::rendertemplate('header', $data);
            view::rendertemplate('user_menu', $data);
            view::render('orders', $data, $error);
            view::rendertemplate('footer');
        }
    }
コード例 #6
0
ファイル: auth.php プロジェクト: alcounit/franchAdmin
 public function __construct()
 {
     $this->_model = new \models\admin\auth();
     \helpers\session::pull('url');
 }
コード例 #7
0
ファイル: categoria_1.php プロジェクト: lacripta/easyapp
<ol class="breadcrumb">
    <li><a href="<?php 
echo DIR;
?>
admin/">Inicio</a></li>
    <li><a href="<?php 
echo DIR;
?>
admin/categoria">Categorias</a></li>
</ol>
<legend><h3><?php 
echo $data["title"];
?>
</h3></legend>
<?php 
echo "<h3 class='text-danger'>" . \helpers\session::pull("estado") . "</h3>";
?>
<a href="<?php 
echo DIR;
?>
admin/categoria/add" class="btn btn-info">Crear Nuevo</a>
<p><br></p>
<table class="table table-striped table-hover table-bordered responsive">
    <tr>
        <th>ID</th>
        <th>Nombre</th>
        <th>Orden</th>
        <th>Visible</th>
        <th>Grupo</th>
        <th>Propietario</th>
        <th>Acción</th>
コード例 #8
0
ファイル: orders.php プロジェクト: alcounit/franchAdmin
    public function index()
    {
        $data['pages'] = json_decode($this->_rights[0]->pages);
        $data['rights'] = json_decode($this->_rights[0]->rights);
        $data['acl'] = $this->_rights[0]->acl;
        $data['title'] = 'Заказы';
        $data['breadcrumbs'] = array();
        $data['breadcrumb'][] = array('text' => 'Главная', 'href' => '/admin/');
        $data['count'] = $this->_model->get_orders_count();
        $items = 50;
        $data['total'] = ceil($data['count'][0]->total / $items);
        $data['orders_stat'] = $this->_model->orders_stat();
        if (!empty($_POST)) {
            if (preg_match("/^\\d{1,}\$/", $_POST['p'])) {
                $position = $_POST['p'] * $items;
                $data['orders'] = $this->_model->get_orders($position, $items);
                if ($data['orders']) {
                    foreach ($data['orders'] as $value) {
                        ?>
        
                        <tr id="order-<?php 
                        echo $value->id;
                        ?>
" <?php 
                        echo $value->problem_viewed == 1 ? $data['acl'] == 1 ? 'class="info"' : "" : ($value->status_id == 3 ? date("Y-m-d") >= date('Y-m-d', strtotime($value->performed_date . "+2 day")) ? 'class="danger"' : '' : ($value->check_order == 1 ? 'class="warning"' : ''));
                        ?>
>
                        <td><strong><?php 
                        echo $value->id;
                        ?>
</strong></td>
                        <td>
                            <?php 
                        if ($value->hidden == 1) {
                            echo "<span class=\"glyphicon glyphicon-eye-close\" aria-hidden=\"true\"></span><br>";
                        }
                        ?>
                            <span class="label <?php 
                        echo $value->color;
                        ?>
">
                                <?php 
                        echo $value->status;
                        ?>
                            </span>

                        </td>
                        <td>
                            <?php 
                        /*<a href="/admin/orders/view/<?php echo $value->id; ?>"><?php echo $value->description; ?>...</a>*/
                        ?>
                            <?php 
                        echo $value->status_id <= 2 && date("Y-m-d") <= date('Y-m-d', strtotime($value->certain_date)) ? $value->certain_date != '0000-00-00 00:00:00' ? '<span class="label label-default">Заказ на: ' . date('d.m.Y', strtotime($value->certain_date)) . '</span> ' : '' : '';
                        ?>
<a href="/admin/orders/view/<?php 
                        echo $value->id;
                        ?>
"><?php 
                        echo $value->status_id == 5 || $value->status_id == 2 ? "<strike>" . $value->description . "...</strike>" : $value->description . "...";
                        ?>
</a>
                            <p><strong><?php 
                        echo $value->name;
                        ?>
 / <?php 
                        echo $value->city;
                        ?>
</strong></p> 
                        </td>
                        <td>
                            <?php 
                        echo $value->advert == 1 ? "Яндекс" : "";
                        ?>
                            <?php 
                        echo $value->advert == 2 ? "Google" : "";
                        ?>
                        </td>
                        <td><?php 
                        echo date('d.m.Y', strtotime($value->creation_date));
                        ?>
г</td>
                        <td>
                            <?php 
                        if ($value->payed_date != "0000-00-00 00:00:00") {
                            echo date('d.m.Y', strtotime($value->payed_date)) . "г";
                        } else {
                            echo 'нет данных';
                        }
                        ?>
                        </td>
                        <td>
                            <strong <?php 
                        echo $value->status_id == 3 || $value->status_id == 4 || $value->status_id == 5 ? 'class="money"' : '';
                        ?>
><?php 
                        echo $value->profit;
                        ?>
</strong>
                        </td>
                        <td>
                            <?php 
                        if ($data['pages']->{'orders'}->acl_level > 1) {
                            ?>
                            <div class="btn-group">
                                <button class="btn btn-default btn-xs dropdown-toggle btn-primary" type="button" data-toggle="dropdown" aria-expanded="false">
                                    <span class="glyphicon glyphicon-cog">&nbsp;</span><span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu dropdown-menu-right" role="menu" style="font-size: 16px;">
                                    <li><a href="/admin/orders/edit/<?php 
                            echo $value->id;
                            ?>
">Редактировать</a></li>
                                    <?php 
                            if ($data['pages']->{'orders'}->acl_level == 3) {
                                ?>
                                    <li><a class="pointer" onClick="Hide('<?php 
                                echo $value->id;
                                ?>
')">Скрыть</a></li>
                                    <li><a class="pointer" onClick="Delete('<?php 
                                echo $value->id;
                                ?>
')">Удалить</a></li>
                                    <?php 
                            }
                            ?>
                                </ul>
                            </div>
                            <?php 
                        }
                        ?>
                        </td>
                    </tr>
                <?php 
                    }
                }
            }
        } else {
            $position = 0;
            $data['orders'] = $this->_model->get_orders($position, $items);
            $data['cities'] = $this->_model->show_cities();
            $data['workers'] = $this->_model->show_workers();
            $data['statuses'] = $this->_model->show_statuses();
            $data['profit'] = $this->_model->sum_profit();
            //$data['status_log'] = $this->_model->get_status_log();
            if (json_decode($this->_rights[0]->pages)->{'orders'}->acl_level == 3) {
                $data['url'] = '/admin/orders/add';
                $data['url_title'] = 'Новый заказ';
            }
            \helpers\session::pull('url');
            view::rendertemplate('header', $data);
            view::rendertemplate('admin_menu', $data);
            view::render('admin/orders', $data, $error);
            view::rendertemplate('footer');
        }
    }