Ejemplo n.º 1
0
Archivo: user.php Proyecto: pshreez/PHP
 function userlist()
 {
     if (!F3::get('SESSION.asid')) {
         F3:
         reroute('/admin');
     }
     $user = new Axon('tbl_user');
     $users = array();
     $user_list = $user->find();
     if ($user_list != NULL) {
         foreach ($user_list as $ul) {
             $users[] = array($ul->email, $ul->username, '<img src="' . $ul->image . '" width="20px" height="20px" /> ' . $ul->fullname, $ul->active == 'y' ? 'Yes' : 'No', '<center><a href="#" class="blockLink" data-id="' . $ul->id . '">' . ($ul->active == 'y' ? 'Block' : 'Unblock') . '</a><br/><a href="#" class="deleteLink" data-id="' . $ul->id . '">Delete</a></center>');
         }
         $i = 0;
         foreach ($user_list as $user) {
             $user_id[] = $user_list[$i]->id;
             $i++;
         }
     } else {
         $users = 0;
         $user_id = 0;
     }
     $this->set('identity', $user_id);
     $this->set('userList', $users);
     $this->set('title', 'User');
     if (Snippets::_isAjax()) {
         echo Template::serve("template/admin/user.htm");
     } else {
         $this->set('template', 'user');
         echo Template::serve("template/admin/layout.htm");
     }
 }
Ejemplo n.º 2
0
 function logout()
 {
     if (!F3::get('SESSION.asid')) {
         F3:
         reroute('/admin');
     }
     if (F3::get('SESSION.asid')) {
         $this->clear('SESSION.asid');
         $this->clear('SESSION.admin');
         F3::reroute('/admin');
     }
 }
Ejemplo n.º 3
0
 function viewRegistration()
 {
     if (!F3::get('SESSION.asid')) {
         F3::reroute("/admin");
     }
     $id = new Form_elements();
     $fuel = $id->fuel();
     $manufacturer = $id->manufacture_company();
     $use_purpose = $id->use_purpose();
     $vehicle_type = $id->vehicle_type();
     $custom_office = $id->custom_office();
     $vehicle_color = $id->vehicle_color();
     $type_symbol = $id->type_symbol();
     $owner_type = $id->owner_type();
     $zone_code = $id->zone_code();
     $district_code = $id->district_code();
     $date = DATE('Y-m-d');
     $vehicle = F3::get("PARAMS.id");
     $data = new Axon("vehicle");
     $owner = new Axon("owner");
     $owner_photo = new Axon("owner_photo");
     if ($data->found(array('id=:id', array(':id' => $vehicle))) && $owner->found(array('vehicleid =:id', array(':id' => $vehicle))) && $owner_photo->found(array('vehicle_id=:pic', array(':pic' => $vehicle)))) {
         $data->load(array('id=:id', array(':id' => $vehicle)));
         $owner->load(array('vehicleid =:id', array(':id' => $vehicle)));
         $owner_photo->load(array('vehicle_id=:pic', array(':pic' => $vehicle)));
         $owner->copyTo("POST");
         $data->copyTo("POST");
         $data->copyTo("POST");
         $owner->copyTo("POST");
         $owner_photo->copyTo("POST");
         F3::set('date', $date);
         F3::set('nav', 'navigation');
         F3::set('title', 'Admin - approve Registrations');
         F3::set('templateAdmin', 'viewRegistration');
         echo Template::serve("template/layout.html");
     } else {
         F3:
         reroute("/");
     }
 }