Example #1
0
 public function getUserList()
 {
     //ๅช่Žทๅ–ๆ™ฎ้€š็”จๆˆท็ป„
     $users = $this->user->orderBy('created_at', 'DESC')->paginate(3);
     if (empty($users)) {
         return "่Žทๅ–็”จๆˆทๅคฑ่ดฅใ€€";
     }
     return View::make('fiji/user/index', compact('users'));
 }
Example #2
0
 function getUsers($y, $m, $d, $i)
 {
     $u = User::cacheGet("sitemap:user:{$y}:{$m}:{$d}:{$i}");
     if ($u === false) {
         $user = new User();
         $begindt = sprintf('%04d-%02d-%02d 00:00:00', $y, $m, $d);
         // XXX: estimates 1d == 24h, which screws up days
         // with leap seconds (1d == 24h + 1s). Thankfully they're
         // few and far between.
         $theend = strtotime($begindt) + 24 * 60 * 60;
         $enddt = common_sql_date($theend);
         $user->selectAdd();
         $user->selectAdd('nickname');
         $user->whereAdd("created >= '{$begindt}'");
         $user->whereAdd("created <  '{$enddt}'");
         $user->orderBy('created');
         $offset = ($i - 1) * SitemapPlugin::USERS_PER_MAP;
         $limit = SitemapPlugin::USERS_PER_MAP;
         $user->limit($offset, $limit);
         $user->find();
         while ($user->fetch()) {
             $u[] = $user->nickname;
         }
         $c = Cache::instance();
         if (!empty($c)) {
             $c->set(Cache::key("sitemap:user:{$y}:{$m}:{$d}:{$i}"), $u, Cache::COMPRESSED, time() > $theend ? time() + 90 * 24 * 60 * 60 : time() + 5 * 60);
         }
     }
     return $u;
 }
Example #3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $settings = DB::table('settings')->get();
     $suspects = DB::table('suspects')->get();
     $users = User::orderBy('username')->paginate(self::$per_page);
     return View::make('settings.index', ['settings' => $settings, 'users' => $users, 'suspects' => $suspects]);
 }
 /**
  * Display a listing of the users.
  *
  * @return Response
  */
 public function index()
 {
     // List all the active users
     $users = User::orderBy('name', 'ASC')->get();
     // Load the view and pass the users
     return View::make('user.index')->with('users', $users);
 }
 /**
  * Display a listing of the searched resource.
  *
  * @return Response
  */
 public function search()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["search_nombre"] = Input::get('search_nombre');
             $data["search_categoria"] = Input::get('search_categoria');
             $data["search_servicio_clinico"] = Input::get('search_servicio_clinico');
             $data["search_departamento"] = Input::get('search_departamento');
             $data["search_responsable"] = Input::get('search_responsable');
             $data["search_fecha_ini"] = Input::get('search_fecha_ini');
             $data["search_fecha_fin"] = Input::get('search_fecha_fin');
             $data["categorias"] = ProyectoCategoria::all()->lists('nombre', 'id');
             $data["servicios"] = Servicio::all()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::all()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["reportes_data"] = Proyecto::searchReporte($data['search_nombre'], $data['search_categoria'], $data['search_servicio_clinico'], $data['search_departamento'], $data['search_responsable'], $data["search_fecha_ini"], $data["search_fecha_fin"]);
             $data["proyectos_data"] = $data["reportes_data"]->paginate(10);
             return View::make('investigacion.proyecto.documentacion.index', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 /**
  * Display a listing of the searched resource.
  *
  * @return Response
  */
 public function search()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 7 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
             $data["search_nombre_capacitacion"] = Input::get('search_nombre_capacitacion');
             $data["search_responsable_capacitacion"] = Input::get('search_responsable_capacitacion');
             $data["search_departamento_capacitacion"] = Input::get('search_departamento_capacitacion');
             $data["search_servicio_capacitacion"] = Input::get('search_servicio_capacitacion');
             $data["fecha_ini_capacitacion"] = Input::get('fecha_ini_capacitacion');
             $data["fecha_fin_capacitacion"] = Input::get('fecha_fin_capacitacion');
             $data["row_number"] = Input::get('row_number');
             $data["departamentos"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["capacitaciones"] = Capacitacion::searchReporte($data['search_nombre_capacitacion'], $data['search_responsable_capacitacion'], $data['search_departamento_capacitacion'], $data['search_servicio_capacitacion'], $data["fecha_ini_capacitacion"], $data["fecha_fin_capacitacion"]);
             $data["capacitaciones"] = $data["capacitaciones"]->paginate($data["row_number"]);
             return View::make('rrhh.certificaciones_capacitaciones.index', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function getIndex()
 {
     $data['pageTitle'] = "Quizzler | Users";
     //$data['urlAddBack'] = "backends/users/add";
     $data['urlAddBack'] = "#";
     $data['btnAddBack'] = '<i class="icon-plus"></i><span>Add<span>';
     $data['labelPage'] = "The Quizzler";
     if (isset($_GET['keyword'])) {
         $userRoleId = $_GET['keyword'];
         if ($_GET['keyword'] != '') {
             $data['users'] = User::where('user_role_id', $userRoleId)->orderBy('created_at', 'asc')->paginate(10);
         } else {
             $data['users'] = User::orderBy('created_at', 'asc')->paginate(10);
         }
     } else {
         $userRoleId = 1;
         $data['users'] = User::where('user_role_id', $userRoleId)->orderBy('created_at', 'asc')->paginate(10);
     }
     $data['userType'] = $userRoleId;
     $userRole = Userrole::orderBy('name', 'asc')->get();
     $userRoleArr = ['' => '-- All users --'];
     foreach ($userRole as $role) {
         $userRoleArr[$role->id] = $role->name;
     }
     $data['userRole'] = $userRoleArr;
     $result = Results::all();
     $resultArr = [];
     foreach ($result as $rs) {
         $resultArr[$rs->user_id] = $rs->user_id;
     }
     $data['resultArr'] = $resultArr;
     $data['formOrigin'] = "users";
     $data['activeU'] = 'active';
     return View::make('backends.users.users', $data);
 }
Example #8
0
 public function show()
 {
     //้กฏ็คบ็•™่จ€
     $users = User::orderBy('id', 'DESC')->paginate(10);
     $reply = Reply::all();
     $this->layout->content = View::make('users_main', array('users' => $users, 'replys' => $reply));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $usersList = User::orderBy(Config::get('constants.USER.ATTRS.USER_ID'), 'desc')->get();
     if (!$usersList->count()) {
         return null;
     }
     return $this->respondWithCollection($usersList, new UserTransformer());
 }
Example #10
0
 public function getUsers()
 {
     $this->layout->title = 'Users';
     $users = User::orderBy('id', 'asc');
     $userCount = $users->count();
     $paginate = $users->paginate(100);
     $this->layout->nest('content', 'users', ['users' => $paginate, 'count' => $userCount]);
 }
Example #11
0
 public function getUsers()
 {
     $this->layout->title = "User List";
     $this->layout->description = "";
     $this->layout->keywords = "";
     $this->layout->top_active = 6;
     $users = User::orderBy('id', 'DESC')->get();
     $this->layout->main = View::make('admin.users', ["users" => $users, "main_tab" => 1, "sub_tab" => 2, "cat" => "corper"]);
 }
 public function run()
 {
     $faker = Faker\Factory::create();
     Post::truncate();
     foreach (range(1, 30) as $index) {
         $userId = User::orderBy(DB::raw('RAND()'))->first()->id;
         Post::create(['user_id' => $userId, 'title' => $faker->sentence(5), 'body' => $faker->paragraph(3)]);
     }
 }
Example #13
0
 public static function users_array()
 {
     $users = User::orderBy('nombre', 'ASC')->get();
     $users_array = array();
     foreach ($users as $user) {
         $users_array[$user->id] = $user->nombre;
     }
     return $users_array;
 }
 public function run()
 {
     $faker = Faker\Factory::create();
     DB::table('favorites')->truncate();
     foreach (range(1, 30) as $index) {
         $post = Post::orderBy(DB::raw('RAND()'))->first();
         User::orderBy(DB::raw('RAND()'))->first()->favorites()->attach($post->id);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $filter = array_fill_keys($this->user->getAllColumnsNames(), "");
     $stop_fields = array('filter');
     $input = Input::all();
     if (isset($input['filter']) && $input['filter'] == 'apply') {
         $filter = array_merge($filter, $input);
         Session::put("USER_FILTER", $filter);
     }
     if (isset($input['filter']) && $input['filter'] == 'reset') {
         Session::forget('USER_FILTER');
     }
     if (isset($input['sort_value'])) {
         $sort = $input['sort_value'];
         $sort_dir = $input['sort_dir'];
         Session::put("USER_SORT", array('value' => $sort, 'dir' => $sort_dir));
     }
     $sort = Session::get('USER_SORT');
     if (isset($input['filter']) && $input['filter'] == 'reset') {
         Session::forget('USER_FILTER');
     }
     if (Session::has('USER_FILTER')) {
         $filter = Session::get('USER_FILTER');
         $users = $this->user->where('id', '>', '0');
         foreach ($filter as $k => $v) {
             if (!in_array($k, $stop_fields) && $v != '') {
                 $users = $users->where($k, 'like', '%' . $v . '%');
             }
         }
         if (Session::has('USER_SORT')) {
             $users = $users->orderBy($sort['value'], $sort['dir'] == '1' ? 'desc' : '');
         }
         $users = $users->paginate(Settings::getValue('TABLE_ELEMENTS'));
     } else {
         if (Session::has('USER_SORT') && $sort['value'] != '') {
             $users = $this->user->orderBy($sort['value'], $sort['dir'] == '1' ? 'desc' : 'asc');
         } else {
             $users = $this->user;
         }
         $users = $users->paginate(Settings::getValue('TABLE_ELEMENTS'));
     }
     $sort_options = User::getSortOptions();
     return View::make('backend.users.index', compact('users', 'filter', 'sort_options', 'sort'));
 }
Example #16
0
 public function __construct()
 {
     parent::__construct();
     $users = User::orderBy('username')->paginate(self::$per_page);
     $this->features = ['entries', 'logbooks', 'tasks', 'attachments', 'evidences', 'exports', 'cipher'];
     View::share('users', $users);
     View::share('settings', Setting::all());
     View::share('suspects', Suspect::all());
     View::share('features', $this->features);
 }
 public function display()
 {
     $products = Product::all();
     $products = Product::orderBy('p_id', 'desc')->paginate(3);
     $users = User::all();
     $users = User::orderBy('id', 'desc')->paginate(3);
     $suppliers = Product::lists('supplier', 'supplier');
     $metals = Product::lists('metal', 'metal');
     return View::make('products.list')->with('products', $products)->with('suppliers', $suppliers)->with('metals', $metals)->with('users', $users);
 }
Example #18
0
 public function index()
 {
     //orders the users by position then by name, getting all users
     $users = User::orderBy('position_id')->orderBy('fullname')->get();
     $userNumber = 0;
     foreach ($users as $user) {
         $user->userNum = $userNumber;
         $userNumber += 1;
     }
     return $users->toJson();
 }
Example #19
0
 function listAllData($page = 1)
 {
     $toReturn = array();
     $users = User::orderBy('id', 'ASC')->take('20')->skip(20 * ($page - 1))->get()->toArray();
     $toReturn['users'] = array();
     while (list(, $user) = each($users)) {
         $toReturn['users'][] = array('id' => $user['id'], "fullName" => $user['fullName'], "username" => $user['username'], "email" => $user['email'], "role" => $user['role']);
     }
     $toReturn['userRole'] = $this->data['users']->role;
     return $toReturn;
 }
Example #20
0
 /**
  * Page d'accueil
  *
  * @access public
  * @return View home.home
  */
 public function home()
 {
     // Fetch latest articles
     $articles = Article::orderBy('created_at', 'DESC')->paginate(5);
     // Fetch latest torrents
     $torrents = Torrent::orderBy('created_at', 'DESC')->take(5)->get();
     // Fetch latest topics
     $topics = Topic::orderBy('created_at', 'DESC')->take(5)->get();
     // Fetch latest registered users
     $users = User::orderBy('created_at', 'DESC')->take(5)->get();
     return View::make('home.home', array('articles' => $articles, 'torrents' => $torrents, 'topics' => $topics, 'users' => $users));
 }
 public function run()
 {
     DB::table('comments')->truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 1; $i++) {
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $event = EventModel::orderBy(DB::raw('RAND()'))->first()->id;
         // $post = Event::orderBy(DB::raw('RAND()'))->first()->id;
         $comments = array(['user_id' => $user, 'commentable_id' => $faker->randomElement([$event]), 'commentable_type' => $faker->randomElement(['EventModel']), 'content' => $faker->sentence(30), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
         DB::table('comments')->insert($comments);
     }
 }
 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('favorites')->truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 30; $i++) {
         $event = EventModel::orderBy(DB::raw('RAND()'))->first()->id;
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $favorites = array(['user_id' => $user, 'event_id' => $event, 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
         DB::table('favorites')->insert($favorites);
     }
     // Uncomment the below to run the seeder
 }
 public function run()
 {
     DB::table('packages')->truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 1; $i++) {
         $sentence = $faker->sentence(5);
         $slug = Str::slug($sentence);
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $category = Category::orderBy(DB::raw('RAND()'))->first()->id;
         $posts = array(['title_en' => $sentence, 'title_ar' => $sentence, 'description_en' => $sentence, 'description_ar' => $sentence, 'price' => '30', 'free' => 0, 'created_at' => $faker->DateTime(), 'updated_at' => $faker->DateTime()]);
         DB::table('packages')->insert($posts);
     }
 }
 public function __construct()
 {
     parent::__construct();
     $users = User::orderBy('username')->paginate(self::$per_page);
     $legals = Legal::orderBy('id')->paginate(self::$per_page);
     $this->features = ['entries', 'logbooks', 'tasks', 'attachments', 'evidences', 'exports', 'tools'];
     $this->export_features = ['ex_title', 'ex_customer', 'ex_date', 'ex_version', 'ex_disclaimer', 'ex_pdf_sh_evidences', 'ex_pdf_sh_coc', 'ex_pdf_sh_attachments', 'ex_pdf_sh_suspects', 'ex_pdf_sh_legals', 'ex_html_sh_evidences', 'ex_html_sh_coc', 'ex_html_sh_attachments', 'ex_html_sh_suspects', 'ex_html_sh_legals'];
     View::share('users', $users);
     View::share('settings', Setting::all());
     View::share('suspects', Suspect::all());
     View::share('features', $this->features);
     View::share('legals', $legals);
 }
 public function run()
 {
     DB::table('posts')->truncate();
     $dt = Carbon::now();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 1; $i++) {
         $sentence = $faker->sentence(5);
         $slug = Str::slug($sentence);
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $category = Category::orderBy(DB::raw('RAND()'))->first()->id;
         $posts = array(['user_id' => $user, 'category_id' => $category, 'title_ar' => $sentence, 'title_en' => $sentence, 'description_ar' => $faker->sentence(200), 'description_en' => $faker->sentence(200), 'created_at' => $dt, 'updated_at' => $dt]);
         DB::table('posts')->insert($posts);
     }
 }
 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('subscriptions')->truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 2; $i++) {
         $event = EventModel::orderBy(DB::raw('RAND()'))->first()->id;
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $subscriptions = array(['user_id' => $user, 'subscribable_id' => $event, 'subscribable_type' => $faker->randomElement(['Event', 'Package']), 'status' => '', 'registration_type' => $faker->randomElement(['VIP', 'ONLINE']), 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
         DB::table('subscriptions')->insert($subscriptions);
     }
     // Uncomment the below to run the seeder
     //        $this->updateEventsTable();
 }
 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('settings')->truncate();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 1; $i++) {
         $event = EventModel::orderBy(DB::raw('RAND()'))->first()->id;
         $user = User::orderBy(DB::raw('RAND()'))->first()->id;
         $subscriptions = array(['approval_type' => 'DIRECT', 'registration_types' => 'VIP,ONLINE', 'vip_total_seats' => '200', 'online_total_seats' => '100', 'online_available_seats' => '100', 'vip_available_seats' => '200', 'settingable_id' => $event, 'settingable_type' => 'EventModel', 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
         DB::table('settings')->insert($subscriptions);
     }
     // Uncomment the below to run the seeder
     //        $this->updateEventsTable();
 }
Example #28
0
 public static function generateId()
 {
     $user = User::orderBy('userID', 'DESC')->get()->first();
     $userId = $user->userID;
     $userId = substr($userId, 4);
     $newId = (int) $userId;
     $newId++;
     $newIdString = (string) $newId;
     $newIdString = "000" . $newIdString;
     if (strlen($newIdString) > 3) {
         $newIdString = substr($newIdString, strlen($newIdString) - 3);
     }
     $newIdString = "user" . $newIdString;
     return $newIdString;
 }
 public function run()
 {
     // Uncomment the below to wipe the table clean before populating
     DB::table('followers')->truncate();
     $dt = Carbon::now();
     $dateNow = $dt->toDateTimeString();
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 40; $i++) {
         $this->setEvent(EventModel::orderBy(DB::raw('RAND()'))->first()->id);
         $this->setUser(User::orderBy(DB::raw('RAND()'))->first()->id);
         //            $this->checkUnique();
         $followers = array(['user_id' => $this->getUser(), 'event_id' => $this->getEvent(), 'created_at' => $dateNow, 'updated_at' => $dateNow]);
         DB::table('followers')->insert($followers);
     }
     // Uncomment the below to run the seeder
 }
Example #30
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     if (Session::get('user_level') < Config::get('cms.viewUsers')) {
         return Redirect::to(_l(URL::action('AdminHomeController@getIndex')))->with('message', Lang::get('admin.notPermitted'))->with('notif', 'warning');
     }
     $this->setLayout();
     if (Input::get('q')) {
         $users = User::where('username', 'LIKE', '%' . Input::get('q') . '%')->orWhere(function ($query) {
             $query->where('first_name', 'LIKE', '%' . Input::get('q') . '%')->orwhere('last_name', 'LIKE', '%' . Input::get('q') . '%');
         })->orderBy('created_at', 'desc')->paginate(20);
     } else {
         $users = User::orderBy('created_at', 'desc')->paginate(20);
     }
     View::share('title', Lang::get('admin.allUsers'));
     View::share('users', $users);
     $this->layout->content = View::make('backend.users.index');
 }