public function ProsesJadwal($id)
 {
     $data = DB::table('prestasi_kerja_rekap_penilaian')->join('lpp_kemenpan_siasik.daf_unit_staf', 'prestasi_kerja_rekap_penilaian.id_jabatan', '=', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id')->join('lpp_kemenpan_siasik.master_pegawai', 'prestasi_kerja_rekap_penilaian.nip', '=', 'lpp_kemenpan_siasik.master_pegawai.nip')->join('lpp_kemenpan_siasik.daf_gol', 'lpp_kemenpan_siasik.daf_unit_staf.eselon_id', '=', 'lpp_kemenpan_siasik.daf_gol.gol_id')->select('prestasi_kerja_rekap_penilaian.nip', 'prestasi_kerja_rekap_penilaian.id_jabatan', 'lpp_kemenpan_siasik.daf_unit_staf.nama_lengkap', 'lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', 'lpp_kemenpan_siasik.master_pegawai.nama', 'lpp_kemenpan_siasik.daf_gol.pangkat', 'lpp_kemenpan_siasik.daf_gol.golongan')->where('lpp_kemenpan_siasik.daf_unit_staf.unit_staf_id', '=', $id)->first();
     $breadcrumbs = array(array("Assessment Internal" => "javascript:void(0)"), array("Pengaturan" => ""), array("Tambah Kandidat Promosi" => ""));
     $this->layout->breadcrumbs = View::make('layouts.breadcrumb', compact('breadcrumbs'));
     $this->layout->content = View::make('career::jadwal/jadwalasessment', compact('data'));
 }
Ejemplo n.º 2
0
 public function run()
 {
     DB::table('master_type_bank')->delete();
     $data = array(array('name' => 'TABUNGAN', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1), array('name' => 'GIRO', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1), array('name' => 'DEPOSITO', 'info' => '', 'uuid' => uniqid(), 'created_at' => new \DateTime(), 'updated_at' => new \DateTime(), 'createby_id' => 1, 'lastupdateby_id' => 1));
     DB::table('master_type_bank')->insert($data);
     $this->command->info('Done [' . __CLASS__ . ']');
 }
 public function materiaMaestroEnpalme()
 {
     $maestroId = Materia::join('maestro_materia', 'materias.id', '=', 'maestro_materia.materia_id')->where('materia_id', '=', Input::get('materia_id'))->select('materia', 'materia_id', 'maestro_id')->first();
     $maestroMateria = DB::table('horarios')->join('materias', 'materias.id', '=', 'horarios.materia_id')->join('maestro_materia', 'maestro_materia.materia_id', '=', 'materias.id')->join('maestros', 'maestros.id', '=', 'maestro_materia.maestro_id')->where('hora_id', Input::get('hora_id'))->where('horarios.ciclo_id', Input::get('ciclo_id'))->where('dia_id', Input::get('dia_id'))->where('maestro_id', $maestroId->maestro_id)->get();
     //dd($maestroMateria);
     return $maestroMateria;
 }
Ejemplo n.º 4
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('roles')->truncate();
     //insert some dummy records
     Role::create(['name' => 'Admin', 'status' => 'active']);
     /*Role::create([
             'name' => 'Project Manager',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Team Lead',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Developer',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Designer',
             'status' => 'active',
             ]);
     
             Role::create([
             'name' => 'Tester',
             'status' => 'active',
             ]);*/
     DB::table('roles_users')->insert(['user_id' => 1, 'role_id' => 1, 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
 }
Ejemplo n.º 5
0
 public function run()
 {
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     }
     if (env('DB_DRIVER') == 'mysql') {
         DB::table(config('access.assigned_roles_table'))->truncate();
     } elseif (env('DB_DRIVER') == 'sqlite') {
         DB::statement("DELETE FROM " . config('access.assigned_roles_table'));
     } else {
         //For PostgreSQL or anything else
         DB::statement("TRUNCATE TABLE " . config('access.assigned_roles_table') . " CASCADE");
     }
     //Attach admin role to admin user
     $user_model = config('auth.model');
     $user_model = new $user_model();
     $user_model::first()->attachRole(1);
     //Attach user role to general user
     $user_model = config('auth.model');
     $user_model = new $user_model();
     $user_model::find(2)->attachRole(2);
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     }
 }
Ejemplo n.º 6
0
 /**
  * 重置密钥
  * @param $key
  */
 public static function reset($key)
 {
     $phptime = date("Y-m-d H:i:s.u");
     $k = substr(str_shuffle(md5(microtime())), rand(1, 5), 18);
     DB::table('passports')->where('key', $key)->update(['secret' => $k, 'updated_at' => $phptime]);
     return 1;
 }
Ejemplo n.º 7
0
 public function run()
 {
     for ($i = 0; $i < 100; $i++) {
         DB::table('posts_has_tags')->insert(['post_id' => $i + 1, 'tag_id' => rand(1, 2)]);
         DB::table('posts_has_tags')->insert(['post_id' => $i + 1, 'tag_id' => rand(3, 4)]);
     }
 }
Ejemplo n.º 8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('uf')->insert(['idUf' => 11, 'uf' => 'RO']);
     DB::table('uf')->insert(['idUf' => 12, 'uf' => 'AC']);
     DB::table('uf')->insert(['idUf' => 13, 'uf' => 'AM']);
     DB::table('uf')->insert(['idUf' => 14, 'uf' => 'RR']);
     DB::table('uf')->insert(['idUf' => 15, 'uf' => 'PA']);
     DB::table('uf')->insert(['idUf' => 16, 'uf' => 'AP']);
     DB::table('uf')->insert(['idUf' => 17, 'uf' => 'TO']);
     DB::table('uf')->insert(['idUf' => 21, 'uf' => 'MA']);
     DB::table('uf')->insert(['idUf' => 22, 'uf' => 'PI']);
     DB::table('uf')->insert(['idUf' => 23, 'uf' => 'CE']);
     DB::table('uf')->insert(['idUf' => 24, 'uf' => 'RN']);
     DB::table('uf')->insert(['idUf' => 25, 'uf' => 'PB']);
     DB::table('uf')->insert(['idUf' => 26, 'uf' => 'PE']);
     DB::table('uf')->insert(['idUf' => 27, 'uf' => 'AL']);
     DB::table('uf')->insert(['idUf' => 28, 'uf' => 'SE']);
     DB::table('uf')->insert(['idUf' => 29, 'uf' => 'BA']);
     DB::table('uf')->insert(['idUf' => 31, 'uf' => 'MG']);
     DB::table('uf')->insert(['idUf' => 32, 'uf' => 'ES']);
     DB::table('uf')->insert(['idUf' => 33, 'uf' => 'RJ']);
     DB::table('uf')->insert(['idUf' => 35, 'uf' => 'SP']);
     DB::table('uf')->insert(['idUf' => 41, 'uf' => 'PR']);
     DB::table('uf')->insert(['idUf' => 42, 'uf' => 'SC']);
     DB::table('uf')->insert(['idUf' => 43, 'uf' => 'RS']);
     DB::table('uf')->insert(['idUf' => 50, 'uf' => 'MS']);
     DB::table('uf')->insert(['idUf' => 51, 'uf' => 'MT']);
     DB::table('uf')->insert(['idUf' => 52, 'uf' => 'GO']);
     DB::table('uf')->insert(['idUf' => 53, 'uf' => 'DF']);
 }
Ejemplo n.º 9
0
 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 5; $i++) {
         DB::table('tags')->insert(['name' => $faker->unique()->word]);
     }
 }
Ejemplo n.º 10
0
 public function run()
 {
     DB::table('roles')->delete();
     Role::create(['abr' => 'PRL', 'role' => 'President of Lending', 'description' => "Responsible for ARM Loan Locations. This primarily includes making sure that (1) Existing ARM Loan Locations adhere to the Location Growth Profiles for loan commitments and EBT, (2) Adding new ARM Loan Locations in accordance with our Growth Strategy, (3) Marketing of ARM Loan Locations, and (4) Personnel growth within each ARM Loan Locations", 'matrix' => 1]);
     Role::create(['abr' => 'COO', 'role' => 'Chief Operating Officer', 'description' => "Responsible for (1) the day-to-day running of the critical departments of ARM, (2) establishing procedures and processes to ensure their smooth functioning, and (3) providing timely operational information and assistance to the CEO", 'matrix' => 1]);
     Role::create(['abr' => 'CEO', 'role' => 'Chief Executive Officer', 'description' => "Top executive responsible for ARM’s overall operations and performance. Serves as the main link between the board of directors (the board) and the ARM's various parts or levels, and is held responsible for ARM’s success or failure. Insures that IT and accounting meets corporate goals. Maintains and implements corporate policy, as established by the board.", 'matrix' => 1]);
     Role::create(['abr' => 'CFO', 'role' => 'Chief Financial Officer', 'matrix' => 1]);
     Role::create(['abr' => 'ABM', 'role' => 'Area Business Manager', 'description' => "For a particular ARM Loan Location(s), the ABM is responsible for (1) meeting the growth objectives of the Location Growth Profile, (2) adherence to ARM policies and procedures, (3) front line for collection of past dues, (3) development of employees, and (4) communication of objectives and opportunities.", 'matrix' => 1]);
     Role::create(['abr' => 'COM', 'role' => 'Corporate Office Manager', 'matrix' => 1]);
     Role::create(['abr' => 'OM', 'role' => 'Office Manager', 'description' => "Responsible for ARM Loan Location operations including: loan closings, loan filings, loan disbursements, office operations, and management of Office Assistant roles and responsibilities.", 'matrix' => 1]);
     Role::create(['abr' => 'OA', 'role' => 'Office Assistant', 'description' => "Responsible for specific ARM Loan Location office operations as they pertain to loan operations and other crop insurance processing.", 'matrix' => 1]);
     Role::create(['abr' => 'LBM', 'role' => 'Loan Business Manager', 'description' => "Responsible for ensuring that ARM Loan Officers and Loan Analysts are (1) trained properly and (2) perform loan analysis and loan management steps consistently. The LBM supports the growth of ARM Loan Locations.", 'matrix' => 1]);
     Role::create(['abr' => 'LO', 'role' => 'Loan Officer', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done, (5) selling crop insurance, and (6) using loan experience to develop Loan Analysts", 'matrix' => 1]);
     Role::create(['abr' => 'LA', 'role' => 'Loan Analyst', 'description' => "Responsible for (1) structuring agriculture loan deals that serve the customers needs, (2) adhering to ARM policies and procedures, (3) supporting ARM’s Loan Location growth objectives as defined in the Location Growth Profile, (4) Interfacing with office staff to get the job done.", 'matrix' => 1]);
     Role::create(['abr' => 'LCA', 'role' => 'Loan Compliance Auditor', 'description' => ": Responsible for the quality and consistency of ARM Loans across ARM locations. The LCA serves as the corporate interface with ARM Loan Location ABM’s for loan reviews and loan past due collection.", 'matrix' => 1]);
     Role::create(['abr' => 'HRM', 'role' => 'Human Resources Manager', 'description' => "The human resource manager is directly responsible for the overall administration, coordination and evaluation of the human resource function.", 'matrix' => 1]);
     Role::create(['abr' => 'IBM', 'role' => 'Insurance Business Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IAN', 'role' => 'Insurance Analyst', 'matrix' => 1]);
     Role::create(['abr' => 'CIM', 'role' => 'Corporate Insurance Manager', 'matrix' => 1]);
     Role::create(['abr' => 'IA', 'role' => 'Crop Insurance Agents', 'description' => "Responsible for marketing of crop insurance policies to the customer, adhering to ARM insurance standards, maintenance of customer APH databases, and the obtaining of applications, production reports, acreage reports, and notice of loss claims", 'matrix' => 1]);
     Role::create(['abr' => 'ITT', 'role' => 'IT Technician']);
     Role::create(['abr' => 'SUP', 'role' => 'Other Support']);
     Role::create(['abr' => 'SYS', 'role' => 'System']);
     Role::create(['abr' => 'PRI', 'role' => 'President of Insurance', 'description' => "Responsible for (1) ARM agency growth strategy, (2) insurance agency acquisitions, (3) insurance policy, and (4) ARM umbrella value to agencies.", 'matrix' => 1]);
     Role::create(['abr' => 'CRO', 'role' => 'Chief Risk Officer', 'description' => "The corporate executive tasked with assessing and mitigating significant loan risk, regulatory risk, and technological risks across ARM", 'matrix' => 1]);
     Role::create(['abr' => 'CTR', 'role' => 'Corporate Controller', 'description' => "Top managerial and financial accountant. The controller supervises the accounting department and assists management in interpreting and utilizing managerial accounting information.", 'matrix' => 1]);
     Role::create(['abr' => 'PA', 'role' => 'Principal Agent', 'description' => "Serves as the leader of an ARM Loan or Agency location’s crop insurance business; which includes (1) making sure that policies are represented and processed correctly, (2) development of ARM agents, (3) growth of policy revenue, (4) marketing of additional ARM lines of revenue, and (5) supervision of Insurance Processors and Agents", 'matrix' => 1]);
     Role::create(['abr' => 'IP', 'role' => 'Insurance Processor', 'description' => "Responsible for the support of Principal Agent, Crop Insurance Agents, and all crop insurance operations including: processing of customer insurance applications, production reports, acreage reports, filing notice of loss claims", 'matrix' => 1]);
     Role::create(['id' => 999, 'abr' => 'OPT', 'role' => 'Optional', 'description' => "Committee member", 'matrix' => 0]);
 }
Ejemplo n.º 11
0
 public function update($QuestionID)
 {
     if (!AuthController::checkPermission()) {
         return redirect('/');
     }
     $data = Request::capture();
     $count = $data['numAnswer'];
     // delete all old spaces with corresponding answers
     $oldSpaces = Spaces::where('QuestionID', '=', $QuestionID)->get()->toArray();
     foreach ($oldSpaces as $value) {
         SpacesController::destroy($value['id']);
     }
     for ($i = 0; $i < $count; $i++) {
         $rawAnswer = trim(AnswersController::c2s_convert($data['answer' . ($i + 1)]));
         preg_match_all('/([^;]+);/', $rawAnswer, $matches, PREG_PATTERN_ORDER);
         $arrayOfAnswer = $matches[1];
         $SpaceID = DB::table('spaces')->insertGetId(['QuestionID' => $QuestionID, 'created_at' => new \DateTime(), 'updated_at' => new \DateTime()]);
         $true = true;
         foreach ($arrayOfAnswer as $value) {
             $a = new Answers();
             $a->Logical = $true;
             $a->SpaceID = $SpaceID;
             $a->Detail = trim($value);
             $a->save();
             $true = false;
         }
     }
     return redirect(route('user.viewquestion', $QuestionID));
 }
 /**
  * @param $token
  * @return mixed
  * @throws GeneralException
  */
 public function getEmailForPasswordToken($token)
 {
     if ($row = DB::table('password_resets')->where('token', $token)->first()) {
         return $row->email;
     }
     throw new GeneralException(trans('auth.unknown'));
 }
Ejemplo n.º 13
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     // Clear account table
     DB::table('account')->truncate();
     $this->call('AccountTableSeeder');
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tasks')->insert(['name' => 'Study Vagrant', 'created_at' => new DateTime("28.11.2015 15:00")]);
     DB::table('tasks')->insert(['name' => 'Study Puppet', 'created_at' => new DateTime("28.11.2015 16:00")]);
     DB::table('tasks')->insert(['name' => 'Combine them together', 'created_at' => new DateTime("28.11.2015 17:00")]);
     DB::table('tasks')->insert(['name' => 'Use it', 'created_at' => new DateTime("28.11.2015 17:30")]);
 }
Ejemplo n.º 15
0
 /**
  * Remove unused avatar files from disk.
  *
  * @return void
  */
 private function purgeOldAvatars()
 {
     // Build up a list of all avatar images
     $avatars = glob(public_path() . '/upload/*/*.*');
     // Remove the public_path() from the path so that they match values in the DB
     array_walk($avatars, function (&$avatar) {
         $avatar = str_replace(public_path(), '', $avatar);
     });
     $all_avatars = collect($avatars);
     // Get all avatars currently assigned
     $current_avatars = DB::table('users')->whereNotNull('avatar')->lists('avatar');
     // Compare the 2 collections get a list of avatars which are no longer assigned
     $orphan_avatars = $all_avatars->diff($current_avatars);
     $this->info('Found ' . $orphan_avatars->count() . ' orphaned avatars');
     // Now loop through the avatars and delete them from storage
     foreach ($orphan_avatars as $avatar) {
         $avatarPath = public_path() . $avatar;
         // Don't delete recently created files as they could be temp files from the uploader
         if (filemtime($avatarPath) > strtotime('-15 minutes')) {
             $this->info('Skipping ' . $avatar);
             continue;
         }
         if (!unlink($avatarPath)) {
             $this->error('Failed to delete ' . $avatar);
         } else {
             $this->info('Deleted ' . $avatar);
         }
     }
 }
Ejemplo n.º 16
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $track = Track::find($id);
     $trip = null;
     $startStop = null;
     $endStop = null;
     if ($track->processed) {
         $trip = Trip::find($track->trip_id);
         $startStop = Stop::find($track->start_stop_id);
         $endStop = Stop::find($track->end_stop_id);
     }
     $coordinates = $track->coordinates()->orderBy('time', 'asc')->get();
     $coordinatesFiltered = DB::table('coordinates')->select('lat', 'lon')->where('track_id', $track->id)->orderBy('time', 'asc')->get();
     $index = 0;
     if (count($coordinatesFiltered) > 0) {
         $coords_array = [];
         foreach ($coordinatesFiltered as $coord) {
             array_push($coords_array, $coord);
         }
         if (count($coords_array) % 2 === 0) {
             $index = (count($coords_array) - 1) / 2;
         } else {
             $index = count($coords_array) / 2;
         }
         $mapCoordinatesJsonRaw = json_encode($coords_array);
         $mapCoordinatesJson = preg_replace('/"([^"]+)"\\s*:\\s*/', '$1:', $mapCoordinatesJsonRaw);
         return view('view-track')->with('track', $track)->with('trip', $trip)->with('startStop', $startStop)->with('endStop', $endStop)->with('coordinates', $coordinates)->with('map_coordinates', $mapCoordinatesJson)->with('map_center', $coords_array[$index]);
     } else {
         return view('view-track')->with('track', $track)->with('trip', $trip)->with('startStop', $startStop)->with('endStop', $endStop);
     }
 }
Ejemplo n.º 17
0
 public function unlink(Module $module, Request $request, FileRepository $fileRepository, Imagy $imagy)
 {
     DB::table('media__imageables')->whereFileId($request->get('fileId'))->delete();
     $file = $fileRepository->find($request->get('fileId'));
     $imagy->deleteAllFor($file);
     $fileRepository->destroy($file);
 }
Ejemplo n.º 18
0
 /**
  * Run the Update
  *
  * @return mixed|void
  */
 public function call()
 {
     $pheal = $this->setScope('char')->getPheal();
     // Links need to be processed for every planet on
     // every character for the provided API key. We
     // will loop over the planets for the character
     // updating the information as well as clean up
     // the routes that are no longer applicable.
     foreach ($this->api_info->characters as $character) {
         // Query the database for known planets from
         // the planetary colonies table that this
         // character owns.
         $colonies = DB::table('character_planetary_colonies')->where('ownerID', $character->characterID)->lists('planetID');
         foreach ($colonies as $planet_id) {
             $result = $pheal->PlanetaryLinks(['characterID' => $character->characterID, 'planetID' => $planet_id]);
             // There isnt a concept such as a unique
             // linkID, so for now we will just delete
             // all of the link we have for this planet.
             PlanetaryLink::where('ownerID', $character->characterID)->where('planetID', $planet_id)->delete();
             // Create the Links
             foreach ($result->links as $link) {
                 PlanetaryLink::create(['ownerID' => $character->characterID, 'planetID' => $planet_id, 'sourcePinID' => $link->sourcePinID, 'destinationPinID' => $link->destinationPinID, 'linkLevel' => $link->linkLevel]);
             }
             // Foreach Links
         }
         // Foreach Planet
         // Cleanup links for planets that do not exist
         // for this character anymore. It could be that
         // the entire colony was deleted.
         PlanetaryLink::where('ownerID', $character->characterID)->whereNotIn('planetID', $colonies)->delete();
     }
     // Foreach Character
     return;
 }
Ejemplo n.º 19
0
 /**
  * @return mixed
  */
 public function showNews()
 {
     $slug = Request::segment(2);
     $news_title = "Not active";
     $news_text = "Either this news item is not active, or it does not exist";
     $active = 1;
     $news_id = 0;
     $results = DB::table('news')->where('slug', '=', $slug)->get();
     foreach ($results as $result) {
         $active = $result->active;
         if ($active > 0 || Auth::check() && Auth::user()->hasRole('news')) {
             if (Session::get('lang') == null || Session::get('lang') == "en") {
                 $news_title = $result->title;
                 $news_text = $result->news_text;
                 $news_id = $result->id;
             } else {
                 $news_title = $result->title_fr;
                 $news_text = $result->news_text_fr;
                 $news_id = $result->id;
             }
             $news_image = $result->image;
             $news_date = $result->news_date;
         }
     }
     return View::make('public.news')->with('news_title', $news_title)->with('news_text', $news_text)->with('page_content', $news_text)->with('active', $active)->with('news_id', $news_id)->with('news_date', $news_date)->with('news_image', $news_image)->with('menu', $this->menu)->with('page_category_id', 0)->with('page_title', $news_title);
 }
Ejemplo n.º 20
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $firstnames = ['John', 'Alexander', 'Arthur', 'David', 'Steve', 'Jim'];
     $lastnames = ['McArthur', 'James', 'Don', 'Schmidt', 'Dazon', 'Brunt'];
     for ($recruteur = 1; $recruteur <= 6; $recruteur++) {
         DB::table('recruiters')->insert(['identity' => "Jury {$recruteur}", 'title' => 'RH', 'rh' => true]);
     }
     for ($recruteur = 1; $recruteur <= 5; $recruteur++) {
         DB::table('recruiters')->insert(['identity' => "Coach {$recruteur}", 'title' => '', 'coaching' => true]);
     }
     DB::table('recruiters')->insert(['identity' => 'M. Cadou (DG 714)', 'title' => 'Admission Master management des entreprises', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'M. Wecxsteen (DG 713)', 'title' => 'Admission Master management des banques et des institutions financières', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'M. Pic (DG 712)', 'title' => 'Admission Master finance d\'entreprise et des marché', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'Mme. Flambard (DG 710)', 'title' => 'Admission Master international management', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'Mme. Bourel (DG 713)', 'title' => 'Admission Master écologie opérationnelle', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'M. Guilbert (DG 714)', 'title' => 'Admission Master Digital commerce', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'M. Guilbert (DG 714)', 'title' => 'Admission Master informatique', 'admissions' => true]);
     DB::table('recruiters')->insert(['identity' => 'Mme. Gadaud (DG 716)', 'title' => 'Admission Master CCA', 'admissions' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Coralie Talma', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Arnaud Ratte', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Marie Lelieur', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Stéphanie Carnoy', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Laurence Fauvarque', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Alexia Toulemonde', 'title' => 'Coach', 'coaching' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Mme. Bediez', 'title' => 'CV Français', 'career_center' => true]);
     //        DB::table('recruiters')->insert(['identity' => '', 'title' => 'CV Anglais', 'career_center' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'M. Simon', 'title' => 'Lettre de motivation', 'career_center' => true]);
     //        DB::table('recruiters')->insert(['identity' => 'Mme. Carissimo', 'title' => 'Devenir étudiant créateur', 'career_center' => true]);
 }
Ejemplo n.º 21
0
 public function run()
 {
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     }
     if (env('DB_DRIVER') == 'mysql') {
         DB::table(config('access.roles_table'))->truncate();
     } else {
         //For PostgreSQL or anything else
         DB::statement("TRUNCATE TABLE " . config('access.roles_table') . " CASCADE");
     }
     //Create admin role, id of 1
     $role_model = config('access.role');
     $admin = new $role_model();
     $admin->name = 'Administrator';
     $admin->all = true;
     $admin->sort = 1;
     $admin->created_at = Carbon::now();
     $admin->updated_at = Carbon::now();
     $admin->save();
     //id = 2
     $role_model = config('access.role');
     $user = new $role_model();
     $user->name = 'User';
     $user->sort = 2;
     $user->created_at = Carbon::now();
     $user->updated_at = Carbon::now();
     $user->save();
     if (env('DB_DRIVER') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     }
 }
Ejemplo n.º 22
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validator = Validator::make($request->all(), ['file' => 'mimes:pdf', 'name' => 'max:100']);
     if ($validator->fails()) {
         return redirect()->back()->withErrors(['file' => 'ไฟล์จะต้องเป็น .pdf เท่านั้น'])->withInput();
     }
     if (Input::file('file')->isValid()) {
         $filePath = date('Ymd_His') . '.pdf';
         if (Input::file('file')->move(base_path() . '/public/uploads/Announces/Announce-' . $request->get('year'), $filePath)) {
             //example of delete exist file
             $announceList = Announce::all();
             if (sizeof($announceList) != 0) {
                 $lastAnnounce = $announceList[sizeof($announceList) - 1];
                 $filename = base_path() . '/public/uploads/Announces/Announce-/' . $request->get('year') . '/' . $lastAnnounce->file_path;
                 if (File::exists($filename)) {
                     File::delete($filename);
                 }
                 //                    $oldAnnounce = Announce::findOrNew($lastAnnounce->id);
                 $lastAnnounce = DB::table('announces')->where('year', $request->get('year'))->first();
                 //                    dd($lastAnnounce);die;
                 if ($lastAnnounce != null) {
                     Announce::destroy($lastAnnounce->id);
                 }
             }
             $announce = new Announce();
             $announce->file_path = $filePath;
             $announce->year = $request->get('year');
             $announce->save();
             return redirect('/announces');
         } else {
             return redirect()->back()->withErrors(['error_message' => 'ไฟล์อัพโหลดมีปัญหากรุณาลองใหม่อีกครั้ง']);
         }
     }
 }
Ejemplo n.º 23
0
 public function save()
 {
     if (!$this->product_id) {
         return Category::find($this->category)->product()->create($this->fields());
     }
     return DB::table('products')->where('id', $this->product_id)->update(['category_id' => $this->category, 'name' => $this->name, 'type' => $this->type, 'length' => $this->length, 'thickness' => $this->thickness, 'width' => $this->width, 'description' => $this->description, 'hidden' => $this->hidden]);
 }
Ejemplo n.º 24
0
 public function refresh($town)
 {
     $town_id = DB::table('towns')->where('town', $town)->first();
     $town_id = $town_id->id;
     //получить id города
     $response = json_decode(file_get_contents('http://api.openweathermap.org/data/2.5/forecast?q=' . $town . '&mode=json&appid=f84ba1064b0ae65792326548686f361c'), true);
     //  print_r($response);
     $id = $response['city']['id'];
     $date_today = date("Y-m-d", strtotime("+0 day"));
     DB::table('weather')->where('kuupaev', '>=', $date_today)->where('town_id', $town_id)->delete();
     for ($i = 0; $i < sizeof($response['list']); $i++) {
         $date = date("Y-m-d H:i:s", $response['list'][$i]['dt']);
         $temp_min = $response['list'][$i]['main']['temp_min'];
         $temp_max = $response['list'][$i]['main']['temp_max'];
         $temp_min = round($temp_min - 273.15);
         $temp_max = round($temp_max - 273.15);
         $weather = new Weather();
         $weather->town_id = $id;
         $weather->temp_min = $temp_min;
         $weather->temp_max = $temp_max;
         $weather->kuupaev = $date;
         $weather->save();
     }
     return redirect('weather/' . $town);
 }
Ejemplo n.º 25
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tags')->insert(['title' => "camiseta"]);
     DB::table('tags')->insert(['title' => "preta"]);
     DB::table('tags')->insert(['title' => "branca"]);
     DB::table('tags')->insert(['title' => "amarela"]);
 }
Ejemplo n.º 26
0
 public function run()
 {
     DB::table('partners')->delete();
     Partner::create(['applicant_id' => 1, 'partner' => 'Pepper Potts', 'title' => 'CFO', 'location' => 'Monroe, LA', 'email' => '*****@*****.**', 'phone' => '5125551020']);
     Partner::create(['applicant_id' => 1, 'partner' => 'James Rhodes', 'title' => 'Colonel', 'location' => 'Norfolk, VA', 'email' => '*****@*****.**', 'phone' => '5125559999']);
     Partner::create(['applicant_id' => 4, 'partner' => 'Sam Wilson', 'title' => 'Falcon', 'location' => 'Washington, D.C.', 'email' => '*****@*****.**', 'phone' => '5125995599']);
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     DB::table('favorites')->whereNotNull('deleted_at')->delete();
     Schema::table('favorites', function (Blueprint $table) {
         $table->dropColumn('deleted_at');
     });
 }
 /**
  * Run the migrations.
  */
 public function up()
 {
     Schema::table('deployments', function (Blueprint $table) {
         $table->boolean('is_webhook')->default(false);
     });
     DB::table('deployments')->whereRaw('user_id IS NULL')->update(['is_webhook' => true]);
 }
Ejemplo n.º 29
0
 /**
  * Run the Update
  *
  * @return mixed|void
  */
 public function call()
 {
     $pheal = $this->setScope('char')->getPheal();
     foreach ($this->api_info->characters as $character) {
         // Get a list of messageIDs that we do not have mail
         // bodies for. These ID's will be used to try and
         // pull the bodies using this api key
         $message_ids = DB::table('character_mail_messages')->where('characterID', $character->characterID)->whereNotIn('messageID', function ($query) {
             $query->select('messageID')->from('character_mail_message_bodies');
         })->lists('messageID');
         // It is possible to provide a comma seperated list
         // of messageIDs to the MailBodies endpoint. Pheal
         // caches XML's on disk by file name. To prevent file
         // names from becoming too long, we will chunk the
         // ids we want to update.
         foreach (array_chunk($message_ids, 10) as $message_id_chunk) {
             $result = $pheal->MailBodies(['characterID' => $character->characterID, 'ids' => implode(',', $message_id_chunk)]);
             foreach ($result->messages as $body) {
                 MailMessageBody::create(['messageID' => $body->messageID, 'body' => $body->__toString()]);
             }
         }
         // Foreach messageID chunk
     }
     return;
 }
Ejemplo n.º 30
0
 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 10; $i++) {
         DB::table('userdetails')->insert(['job_id' => rand(1, 5), 'right_id' => rand(1, 5), 'user_id' => rand(1, 10), 'ip' => $faker->ipv4, 'training_id' => rand(1, 5), 'firstname' => $faker->firstName, 'lastname' => $faker->lastName, 'address' => $faker->address, 'city' => $faker->city, 'country' => $faker->country, 'birthday' => $faker->date($format = 'd-m-Y', $max = '31-12-2010'), 'avatar' => $faker->word, 'visibility' => rand(0, 1), 'bio' => $faker->paragraph($nbSentences = 3, $variableNbSentences = true), 'asso' => rand(0, 1), 'created_at' => $faker->dateTime($max = 'now'), 'website' => $faker->url]);
     }
 }