public function login_now()
 {
     $this->use->use_lib('admin/user_lib_ad');
     $user = new user_lib_ad();
     if ($user->set(tpl_user_site::user_site() . '_' . tpl_user_site::username(), 'post') && $user->set(tpl_user_site::user_site() . '_' . tpl_user_site::password(), 'post')) {
         echo $user->find_users_login();
     } else {
         echo json_encode(array('valid' => false, 'massage' => class_massage::danger('Oops !!', 'Check Input Now ')));
     }
 }
 public function find_users_login()
 {
     $db = new data_base(tpl_user_site::user_site(), array(tpl_user_site::id()), array(tpl_user_site::username() => $this->data[tpl_user_site::user_site() . '_' . tpl_user_site::username()], tpl_user_site::password() => $this->hash_password($this->data[tpl_user_site::user_site() . '_' . tpl_user_site::password()]), tpl_user_site::status() => 1));
     $results = $db->get_where();
     $results = array_shift($results);
     if (!empty($results[tpl_user_site::id()])) {
         $this->session->new_login_admin();
         $this->session->set_id_user($results[tpl_user_site::id()]);
         return json_encode(array('valid' => true));
     } else {
         return json_encode(array('valid' => false, 'title' => 'Oops !!', 'massage' => 'The password you\'ve entered is incorrect'));
     }
 }
"
               data-cache="false" data-height="400" data-show-refresh="true" data-show-toggle="true"
               data-show-columns="true" data-pagination="true" data-page-list="[5, 10, 20, 50, 100, 200]"
               data-search="true" data-flat="true" data-toolbar="#toolbar">
            <thead>
            <tr>
                <th data-field="<?php 
echo tpl_category::id();
?>
" data-halign="center" data-sortable="true"> ID</th>
                <th data-field="<?php 
echo tpl_category::name();
?>
" data-halign="center" data-sortable="true"> Title</th>
                <th data-field="<?php 
echo tpl_category::category() . '_' . tpl_user_site::name();
?>
" data-halign="center"
                    data-sortable="true"> Username
                </th>
                <th data-field="<?php 
echo tpl_category::status();
?>
" data-halign="center" data-sortable="true"
                    data-formatter="operate<?php 
echo tpl_category::status();
?>
"
                    > Status
                </th>
                <th data-field="<?php 
?>
" data-halign="center" data-sortable="true"> ID</th>
                <th data-field="<?php 
echo tpl_country::name();
?>
" data-halign="center" data-sortable="true"> Name</th>
                <th data-field="<?php 
echo tpl_country::short_name();
?>
" data-halign="center" data-sortable="true"> Short</th>
                <th data-field="<?php 
echo tpl_country::description();
?>
" data-halign="center" data-sortable="true"> Description</th>
                <th data-field="<?php 
echo tpl_country::country() . '_' . tpl_user_site::name();
?>
" data-halign="center"
                    data-sortable="true"> Username
                </th>
                <th data-field="<?php 
echo tpl_country::status();
?>
" data-halign="center" data-sortable="true"
                    data-formatter="operate<?php 
echo tpl_country::status();
?>
"
                    > Status
                </th>
                <th data-field="<?php 
?>
" data-halign="center" data-sortable="true"> Short Name</th>
                <th data-field="<?php 
echo tpl_food::description();
?>
" data-halign="center" data-sortable="true">  Description</th>
                <th data-field="<?php 
echo tpl_food::price();
?>
" data-halign="center" data-sortable="true">  Price</th>
                <th data-field="<?php 
echo tpl_food::food() . '_' . tpl_section_food::short_name();
?>
" data-halign="center" data-sortable="true">Section Food</th>
                <th data-field="<?php 
echo tpl_food::food() . '_' . tpl_user_site::name();
?>
" data-halign="center"
                    data-sortable="true"> Username</th>
                <th data-field="<?php 
echo tpl_food::status();
?>
" data-halign="center" data-sortable="true"
                    data-formatter="operate<?php 
echo tpl_food::status();
?>
"> Status
                </th>
                <th data-field="<?php 
echo tpl_food::date_in();
?>
                <th data-field="<?php 
echo tpl_customer::mobile();
?>
" data-halign="center" data-sortable="true"> Mobile</th>
                <th data-field="<?php 
echo tpl_customer::address();
?>
" data-halign="center" data-sortable="true"> Address</th>
                <th data-field="<?php 
echo tpl_customer::full_address();
?>
" data-halign="center" data-sortable="true"> Full
                    Address
                </th>
                <th data-field="<?php 
echo tpl_customer::customer() . '_' . tpl_user_site::name();
?>
" data-halign="center"
                    data-sortable="true"> Username
                </th>
                <th data-field="<?php 
echo tpl_customer::status();
?>
" data-halign="center" data-sortable="true"
                    data-formatter="operate<?php 
echo tpl_customer::status();
?>
"
                    > Status
                </th>