public function run() { $faker = Faker::create(); $userIds = User::lists('id'); $psnUserIds = PsnUser::lists('id'); foreach (range(1, 50) as $index) { DB::table('psn_user_user')->insert(['user_id' => $faker->randomElement($userIds), 'psn_user_id' => $faker->randomElement($psnUserIds)]); } }
public function facturasPorResidencia() { if (Request::isMethod("post")) { $i = 0; $residencia_id = Input::get('residencia_id', null); $monto = Input::get("monto"); $id = Input::get('id'); foreach (Input::get('nombre') as $key => $value) { $elemento = Facturas::find($id[$i]); $array = array('mes' => Input::get("mes"), 'año' => Input::get("año"), 'concepto' => $value, 'monto' => $monto[$i], 'residencia_id' => $residencia_id[$i]); if ($elemento === null) { Facturas::create($array); } else { Facturas::where("id", "=", $id[$i])->update($array); } $i++; } return Redirect::to(URL::previous()); } // definimos un tiempo predeterminado $time = new Carbon(); $array = Facturas::where("mes", "=", Input::get('mes', $time->month))->where("año", "=", Input::get('año', $time->year))->where(function ($query) { if (Input::get('residencia_id') != '') { $query->wherein("residencia_id", Input::get('residencia_id')); } })->whereNotNull('residencia_id')->get(); $personas_opt = User::lists('nombre', 'id'); return View::make('admin.generadordefacturasporresidencia')->withArray($array)->withPersonas($personas_opt)->with('año', Input::get('año', $time->year))->withMes(Input::get('mes', $time->month))->withResidencia_id(Input::get('residencia_id', null)); }
/** * Show the form for editing the specified project. * * @param int $id * @return Response */ public function edit($id) { $project = $this->project->with('users')->find($id); $users = User::lists('first_name', 'id'); //echo '<pre>'; print_r($project->toArray());exit; $this->layout->content = View::make('projects.edit', compact('project', 'users')); }
public function run() { $faker = Faker::create(); $userIds = User::lists('id'); foreach (range(1, 1000) as $index) { Status::create(['user_id' => $faker->randomElement($userIds), 'body' => $faker->sentence(), 'created_at' => $faker->dateTimeBetween($startDate = '-9 months', $endDate = 'now')]); } }
public function run() { $faker = Faker::create(); $usersIds = User::lists('id'); $stars = array(1, 2, 3, 4, 5); foreach (range(1, 10) as $index) { Feedback::create(['user_id' => $faker->randomElement($usersIds, $count = 1), 'rating' => $faker->randomElement($stars), 'content' => $faker->text($maxNbChars = 150), 'created_at' => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')]); } }
public function run() { $faker = Faker::create(); $users = User::lists('id'); $posts = Post::lists('id'); foreach (range(1, 100) as $index) { Comment::create(['body' => $faker->sentence(), 'user_id' => $faker->randomElement($users), 'post_id' => $faker->randomElement($posts)]); } }
public function run() { $faker = Faker::create(); $users = User::lists('id'); $categories = Category::lists('id'); foreach (range(1, 100) as $index) { Post::create(['title' => $faker->sentence(), 'slug' => $faker->slug() . $index, 'body' => $faker->text(), 'body_original' => $faker->text(), 'user_id' => $faker->randomElement($users), 'category_id' => $faker->randomElement($categories), 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]); } }
public function run() { Conference::truncate(); $faker = Faker::create(); $user_ids = collect(User::lists('id')); $conference_names = collect(['MegaAwesomeCon', 'SuperPHP', 'ActiveRecordCon', 'ConCon', 'GoodJobFest', 'TightenFest', 'UltraMegaCon', 'ArbysCon']); foreach (range(1, 30) as $i) { $starts_at = $faker->dateTimeBetween('now', '3 years'); $cfp_starts_at = $faker->dateTimeBetween('now', $starts_at); Factory::create('conference', ['author_id' => $user_ids->random(), 'title' => $conference_names->random() . " {$starts_at->format('Y')}", 'description' => $faker->sentence, 'starts_at' => $starts_at, 'ends_at' => Carbon::instance($starts_at)->addDays(2), 'cfp_starts_at' => $cfp_starts_at, 'cfp_ends_at' => Carbon::instance($cfp_starts_at)->addDays(rand(15, 30))]); } }
public function run() { $faker = Faker::create(); $users = User::lists('id'); $topics = Topic::lists('id'); foreach (range(1, 500) as $index) { Reply::create(['user_id' => $faker->randomElement($users), 'topic_id' => $faker->randomElement($topics), 'body' => $faker->sentence()]); } foreach (range(1, 60) as $index) { Reply::create(['user_id' => 1, 'topic_id' => $faker->randomElement($topics), 'body' => $faker->sentence()]); } }
public function run() { $tableIds = Table::whereAvailable(1)->lists('id'); $userIds = User::lists('id'); $faker = Faker::create(); $tablesUsed = []; foreach ($tableIds as $tableId) { $start = Carbon::now()->startOfDay(); $reservationStart = $start->addHours(rand(0, 720)); //$active = ($reservationStart->isToday()) ? 1 : 0; Reservation::create(['user_id' => $faker->randomElement($userIds), 'table_id' => $tableId, 'reservation_start' => $reservationStart, 'reservation_end' => $start->addHours(3), 'seats' => $faker->randomElement([2, 4, 8]), 'active' => 1]); } }
public function __construct(Ticket $tickets) { $this->tickets = $tickets; $this->beforeFilter('staff'); // Store attributes array to be used in the functions below. $this->attributes = ['staff_users_list' => User::lists('users_username', 'users_id'), 'support_users_list' => User::lists('users_username', 'users_id'), 'categories_list' => Category::lists('categories_name', 'categories_id'), 'priorities_list' => Priority::lists('priorities_name', 'priorities_id'), 'statuses_list' => Status::lists('statuses_name', 'statuses_id')]; // Add in an 'unassigned' item with an index of 0 to the support users list. // This is so we can display this in the view without having to have a database entry for 'unassigned'; $this->attributes['support_users_list'][0] = 'unassigned'; // Get current logged in user's auth level. $this->user_auth_level = Auth::user()->get_userlevel(); // Check if current logged in user is Support or Admin user. $this->support_check = Auth::user()->isSupport(); }
/** * Display a listing of the resource. * GET /reports * * @return Response */ public function index() { // return Carbon\Carbon::createFromDate(2015,21,22)->addYears(9); $sales_per_month = $this->sale->salesPerMonth(); // return $sales_per_month; $items = $this->sale->topThreebestSellersName(); $amounts = $this->sale->topThreebestSellersAmount(); $items_by_sales = $this->sale->getItemsBySales(); $data = $this->sale->bestSellersThisWeek(); //get all the cashiers $cashiers = User::lists('username', 'username'); $ingredients = Ingredient::lists('name', 'id'); // return $data; return View::make('reports.reports')->with('title', 'Reports Module')->with('sales', $sales_per_month)->with('items', $items)->with('amounts', $amounts)->with('sales_items', $items_by_sales)->with('cashiers', $cashiers)->with('ingredients', $ingredients); // ->with('amount',$amount); // ->with('value',$amount); }
public function run() { $faker = Faker::create(); $users = User::lists('id'); $nodes = Node::lists('id'); foreach (range(1, 50) as $index) { Topic::create(['user_id' => $faker->randomElement($users), 'node_id' => $faker->randomElement($nodes), 'title' => $faker->sentence(), 'body' => $faker->text(), 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]); } foreach (range(1, 50) as $index) { Topic::create(['user_id' => $faker->randomElement($users), 'node_id' => $faker->randomElement($nodes), 'title' => $faker->sentence(), 'body' => $faker->text(), 'is_excellent' => true, 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]); } foreach (range(1, 30) as $index) { Topic::create(['user_id' => $faker->randomElement($users), 'node_id' => $faker->randomElement($nodes), 'title' => $faker->sentence(), 'body' => $faker->text(), 'is_wiki' => true, 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]); } foreach (range(1, 100) as $index) { Topic::create(['user_id' => 1, 'node_id' => $faker->randomElement($nodes), 'title' => $faker->sentence(), 'body' => $faker->text(), 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]); } }
public function more_verify($san) { if (StudentSource::where('san', '=', $san)->orderBy('id', 'desc')->first()->source == 2) { $agents_laps = ApplicationLap::lists('name', 'id'); } elseif (StudentSource::where('san', '=', $san)->orderBy('id', 'desc')->first()->source == 1) { $agents_laps = ApplicationAgent::lists('name', 'id'); } else { $agents_laps = ApplicationLap::lists('name', 'id'); } return View::make('students.more_verify')->with('information_sources', ApplicationSource::lists('name', 'id'))->with('admission_managers', ApplicationAdmissionManager::lists('name', 'id'))->with('application_agents', ApplicationAgent::lists('name', 'id'))->with('application_laps', ApplicationLap::lists('name', 'id'))->with('nationalities', StaticNationality::lists('name', 'id'))->with('countries', StaticCountry::lists('name', 'id'))->with('course_names', ApplicationCourse::lists('name', 'id'))->with('awarding_bodies', ApplicationAwardingBody::lists('name', 'id'))->with('education_qualifications', ApplicationEducationalQualification::lists('name', 'id'))->with('method_of_payment', ApplicationPaymentInfoMethodsOfPayment::lists('name', 'id'))->with('application_status', ApplicationStatus::lists('name', 'id'))->with('intake_year', StaticYear::lists('name', 'id'))->with('intake_month', StaticMonth::lists('name', 'id'))->with('intake', ApplicationIntake::lists('name', 'id'))->with('supervisors', User::lists('first_name', 'id'))->with('student', Student::where('san', '=', $san)->orderBy('id', 'desc')->first())->with('studentSource', StudentSource::where('san', '=', $san)->orderBy('id', 'desc')->first())->with('ttStudentContactInformation', DB::table('student_contact_informations')->where('student_contact_information_type', '=', 1)->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('studentContactInformation', DB::table('student_contact_informations')->where('student_contact_information_type', '=', 2)->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('studentContactInformationOnline', DB::table('student_contact_information_onlines')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_contact_information_kin_detailes', DB::table('student_contact_information_kin_detailes')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_course_enrolments', DB::table('student_course_enrolments')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_educational_qualifications', DB::table('student_educational_qualifications')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_english_lang_levels', DB::table('student_english_lang_levels')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('studentWorkExperience', DB::table('student_work_experiences')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_payment_info_metadata', DB::table('student_payment_info_metadatas')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('studentPaymentInfo', DB::table('student_payment_infos')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('student_bqu_data', DB::table('student_bqu_data')->where('san', '=', $san)->orderBy('id', 'desc')->first())->with('information_sources', ApplicationSource::lists('name', 'id'))->with('admission_managers', ApplicationAdmissionManager::lists('name', 'id'))->with('agents_laps', $agents_laps); }
public function get_report() { //report anak asuh per bapak asuh $this->data['bapak_asuh'] = User::lists('first_name', 'id'); return View::make('themes.modul.' . $this->report . '.report', $this->data); }
/** * undocumented function * * @return void * @author **/ public static function optionsUser() { return User::lists('firstname', 'id'); }
//Rutas de examen Route::group(array('prefix' => 'exam'), function () { //Rutas para subir examen Route::get('upload', function () { return View::make('exam.uploader'); }); Route::post('upload-exam', 'ExamController@upload'); //Rutas para calificar evaluaciones Route::get('calificacion', 'ExamController@calificacion'); //Accion que retorna vista de calificacion Route::post('calificar/{idevaluacion}', 'ExamController@calificar'); //Accion via post para calificar evaluacion //Rutas para evaluaciones Route::get('evaluaciones', 'ExamController@evaluaciones'); Route::get('takexam/{idexamen}', 'ExamController@crearExamen'); //Preguntas Route::get('preguntas/{idexamen}', 'ExamController@preguntas'); Route::get('preguntas/crear-pregunta/{idexamen}', 'ExamController@crearPregunta'); Route::post('preguntas/guardar-pregunta/{idexamen}', 'ExamController@guardarPregunta'); //Accion via post para calificar evaluacion }); Route::resource('exam', 'ExamController'); Route::group(array('prefix' => 'course'), function () { //Rutas cursos Route::get('asignacion', function () { $cursos = Curso::lists('nombre', 'id'); $usuarios = User::lists('nombre', 'id'); return View::make('course.asignacion', array('cursos' => $cursos, 'usuarios' => $usuarios)); }); Route::post('asignar', 'CourseController@asignar'); });
public function emailPorUsuario() { $correos = User::lists('email', 'nombre'); return View::make('admin.email')->withCorreos($correos)->withActivo('emailPorUsuario'); }
public function checkActivity() { $users = User::lists('last_activity', 'id'); return $users; }
/** * Get the summary user statistics * * @return db resultset */ public static function getSummaryUserStatistics($from, $to, $userID = 0) { $params = array($from, $to, $from, $to, $from, $to, $from, $to, $from, $to); $users = array(); $data = array(); if ($userID == 0) { $users = User::lists('id'); } else { $users[] = $userID; } foreach ($users as $user) { $userData = DB::select("SELECT u.name, u.designation, \n\t\t\t\t\t\tcount(DISTINCT IF(u.id=t.created_by AND (t.time_created BETWEEN ? AND ?),t.id,NULL)) AS created, \n\t\t\t\t\t\tcount(DISTINCT IF(u.id=t.tested_by AND (t.time_completed BETWEEN ? AND ?),t.id,NULL)) AS tested, \n\t\t\t\t\t\tcount(DISTINCT IF(u.id=t.verified_by AND (t.time_verified BETWEEN ? AND ?),t.id,NULL)) AS verified, \n\t\t\t\t\t\tcount(DISTINCT IF(u.id=s.accepted_by AND (s.time_accepted BETWEEN ? AND ?),t.id,NULL)) AS specimen_registered, \n\t\t\t\t\t\tcount(DISTINCT IF(u.id=s.rejected_by AND (s.time_rejected BETWEEN ? AND ?),t.id,NULL)) AS specimen_rejected \n\t\t\t\t\tFROM tests AS t \n\t\t\t\t\t\tLEFT JOIN specimens AS s ON t.specimen_id = s.id \n\t\t\t\t\t\tLEFT JOIN visits AS v ON t.visit_id = v.id \n\t\t\t\t\t\tINNER JOIN patients AS p ON v.patient_id = p.id \n\t\t\t\t\t\tCROSS JOIN users AS u \n\t\t\t\t\t\tWHERE u.id = {$user}\n\t\t\t\t\t\tGROUP BY u.id\n\t\t\t\t\t\tORDER BY u.name", $params); $data = array_merge($data, $userData); } return $data; }