Esempio n. 1
1
    public function dologin()
    {
        $rules = array('username' => 'required', 'password' => 'required');
        $message = array('required' => 'Data :attribute harus diisi', 'min' => 'Data :attribute minimal diisi :min karakter');
        $validator = Validator::make(Input::all(), $rules, $message);
        if ($validator->fails()) {
            return Redirect::to('/')->withErrors($validator)->withInput(Input::except('password'));
        } else {
            $data = array('username' => Input::get('username'), 'password' => Input::get('password'));
            if (Auth::attempt($data)) {
                $data = DB::table('user')->select('user_id', 'level_user', 'username')->where('username', '=', Input::get('username'))->first();
                //print_r($data);
                //echo $data->id_users;
                Session::put('user_id', $data->user_id);
                Session::put('level', $data->level_user);
                Session::put('username', $data->username);
                //print_r(Session::all());
                return Redirect::to("/admin/beranda");
            } else {
                Session::flash('messages', '
					<div class="alert alert-danger alert-dismissable" >
                    		<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    		<strong>Peringatan...</strong><br>
                    			Username dan password belum terdaftar pada sistem !
                    		</div>
				');
                return Redirect::to('/')->withInput(Input::except('password'));
            }
        }
    }
Esempio n. 2
1
 public function mostrarPost($page = 1)
 {
     // traemos la cantidad de registros para el paginador
     $registros = DB::table('post')->join('temas', 'post_tema', '=', 'temas.tema_id')->where('post_tipo', 'ENTRADA')->orderBy('post_fec', 'desc')->get();
     $totalRegistros = count($registros);
     //die("totalRegistros ".$totalRegistros); //16
     $paginador = 15;
     // Parametrizarlo desde DB
     $cantPagina = $totalRegistros / $paginador;
     //die("cantPagina ".$cantPagina); //1.066
     $cantPagina = ceil($cantPagina);
     //die("cantidad de paginas ".$cantPagina); //2
     if ($page != 1) {
         $comienzo = $page * $paginador - $paginador + 1;
         // ((2*15)-15+1);
         // (30)-14
         // comenzara en la 16, pagina 2 y asi sucesivamente..
     } else {
         $comienzo = 1;
     }
     $final = $page * $paginador;
     $post = DB::table('post')->join('temas', 'post_tema', '=', 'temas.tema_id')->where('post_tipo', 'ENTRADA')->orderBy('post_fec', 'desc')->skip($comienzo - 1)->take($final)->get();
     //
     if (count($post) < 1) {
         $error = "No hay más resultados para mostrar.";
     } else {
         $error = "";
     }
     $tema = DB::table('post as p')->select('tm.tema_txt', 'tm.tema_img')->distinct()->join('usuarios as u', 'p.post_usu', '=', 'u.usuarios_id')->join('temas as tm', 'p.post_tema', '=', 'tm.tema_id')->orderBy('tm.tema_txt', 'asc')->get();
     // Retornamos todos los datos
     $entradas = DB::table('post as p')->select('p.*', 'u.usuarios_name', 'tm.tema_txt')->join('usuarios as u', 'p.post_usu', '=', 'u.usuarios_id')->join('temas as tm', 'p.post_tema', '=', 'tm.tema_id')->orderBy('p.post_fec', 'desc')->get();
     return View::make('index', array('post' => $post, 'temas' => $tema, 'cantidadPag' => $cantPagina, 'errores' => $error, 'entradas' => $entradas));
 }
 public function getLoggedinDashboard()
 {
     $role = Auth::user()->role;
     if ($role == 'hotel-staff') {
         $branch_code = $this->getStaffBranch();
         $data_room_booked_details = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->where('branch.branch_code', '=', $branch_code)->where('hotel_rooms.status', '=', 'booked')->count();
         $data_room_details = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->where('branch.branch_code', '=', $branch_code)->where('hotel_rooms.status', '=', 'available')->count();
         $data_total_sales = DB::table('sales')->where('branch_code', '=', $branch_code)->sum('sale_value');
         $total_client = DB::table('customer')->join('accommodation', 'customer.customer_id', '=', 'accommodation.customer_id')->select('customer.customer_id', 'accommodation.branch_code')->where('accommodation.branch_code', '=', $branch_code)->count();
         $data_room = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->select('hotel_rooms.room_code', 'hotel_rooms.branch_code', 'hotel_rooms.price_per_night', 'hotel_rooms.description', 'hotel_rooms.status', 'hotel_rooms.image', 'branch.branch_name', 'branch.address', 'branch.email', 'branch.city')->where('branch.branch_code', '=', $branch_code)->where('hotel_rooms.status', '=', 'available')->take(5)->get();
         $data_room_booked = DB::table('accommodation')->join('customer', 'accommodation.customer_id', '=', 'customer.customer_id')->select('customer.fullname', 'accommodation.branch_code', 'accommodation.room_code', 'accommodation.checkin_time', 'accommodation.checkout_time')->where('accommodation.branch_code', '=', $branch_code)->orderBy('checkout_time')->take(5)->get();
         $cancelled = DB::table('refund')->where('date', '=', date('y-m-d'))->where('branch_id', '=', $branch_code)->count('refund_id');
     } else {
         DB::setFetchMode(PDO::FETCH_ASSOC);
         $company_id_logged_user = Auth::user()->comp_id;
         $data_room_details = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->where('branch.company_id', '=', $company_id_logged_user)->where('hotel_rooms.status', '=', 'available')->count();
         $data_room_booked_details = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->where('branch.company_id', '=', $company_id_logged_user)->where('hotel_rooms.status', '=', 'booked')->count();
         $data_total_sales = DB::table('sales')->where('company_id', '=', Auth::user()->comp_id)->sum('sale_value');
         $total_client = DB::table('customer')->select('customer_id')->where('company_id', '=', Auth::user()->comp_id)->count();
         $company_id_logged_user = Auth::user()->comp_id;
         $data_room = DB::table('hotel_rooms')->join('branch', 'hotel_rooms.branch_code', '=', 'branch.branch_code')->select('hotel_rooms.room_code', 'hotel_rooms.branch_code', 'hotel_rooms.price_per_night', 'hotel_rooms.description', 'hotel_rooms.status', 'hotel_rooms.image', 'branch.branch_name', 'branch.address', 'branch.email', 'branch.city')->where('branch.company_id', '=', $company_id_logged_user)->where('hotel_rooms.status', '=', 'available')->take(5)->get();
         $data_room_booked = DB::table('accommodation')->join('customer', 'accommodation.customer_id', '=', 'customer.customer_id')->select('customer.fullname', 'accommodation.branch_code', 'accommodation.room_code', 'accommodation.checkin_time', 'accommodation.checkout_time')->where('accommodation.comp_id', '=', Auth::user()->comp_id)->orderBy('checkout_time')->take(5)->get();
         $cancelled = DB::table('refund')->join('branch', 'refund.branch_id', '=', 'branch.branch_code')->where('branch.company_id', '=', Auth::user()->comp_id)->count('refund_id');
     }
     return View::make('dashboard', array('data' => $data_room_details, 'booked' => $data_room_booked_details, 'sales' => $data_total_sales, 'clients' => $total_client, 'room_details' => $data_room, 'room_booked' => $data_room_booked, 'cancelled' => $cancelled));
 }
Esempio n. 4
0
 /**
  * Removes given title from given list of user.
  *
  * @param  array $input 
  * @return  String/Redirect
  */
 public function remove(array $input)
 {
     if ($user = Sentry::getUser()) {
         $this->db->table('users_titles')->where('title_id', $input['title_id'])->where('user_id', $user->id)->where($input['list_name'], 1)->delete();
         //fire eloquent deleted event so cache is flushed
         Event::fire('eloquent.deleted: *', new Title());
     }
 }
Esempio n. 5
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Amarillo']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Cascade']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Centennial']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Chinook']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Citra']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Columbus']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Chrystal']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Saaz']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Fuggles']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Golding']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Hallertauer']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Liberty']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Magnum']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Mosaic']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Mt. Hood']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Nor. Brewer']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Nugget']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Perle']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Simcoe']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Sorachi Ace']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Sterling']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Tettnanger']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Warrior']);
     DB::table('hops')->insert(['created_at' => Carbon\Carbon::now()->toDateTimeString(), 'updated_at' => Carbon\Carbon::now()->toDateTimeString(), 'hops' => 'Willamette']);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     DB::table('subproduto')->insert(['id' => 1, 'conjunto' => 1, 'nome' => 'Pedestre Elétrico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 2, 'conjunto' => 1, 'nome' => 'Pedestre Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 3, 'conjunto' => 1, 'nome' => 'Pivotante Duplo Elétrico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 4, 'conjunto' => 1, 'nome' => 'Pivotante Duplo Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 5, 'conjunto' => 1, 'nome' => 'Deslizante Elétrico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 6, 'conjunto' => 1, 'nome' => 'Deslizante com Motor', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 7, 'conjunto' => 1, 'nome' => 'Deslizante Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 8, 'conjunto' => 1, 'nome' => 'Montante Móvel', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 9, 'conjunto' => 2, 'nome' => 'Deslizante Comum', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 10, 'conjunto' => 2, 'nome' => 'Deslizante Semi Industrial', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 11, 'conjunto' => 2, 'nome' => 'Deslizante Industrial', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 12, 'conjunto' => 2, 'nome' => 'Deslizante Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 13, 'conjunto' => 3, 'nome' => 'Pivotante Simples com Motor', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 14, 'conjunto' => 3, 'nome' => 'Pivotante Simples Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 15, 'conjunto' => 3, 'nome' => 'Pivotante Duplo com Motor', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 16, 'conjunto' => 3, 'nome' => 'Pivotante Duplo Mecânico', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 17, 'conjunto' => 3, 'nome' => 'Pivo Robô', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 18, 'conjunto' => 4, 'nome' => 'Basculante Horizontal', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 19, 'conjunto' => 4, 'nome' => 'Basculante Vertical', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 20, 'conjunto' => 5, 'nome' => 'Trilho Inferior', 'ativo' => 1]);
     DB::table('subproduto')->insert(['id' => 21, 'conjunto' => 5, 'nome' => 'Travessão Removível', 'ativo' => 1]);
 }
Esempio n. 7
0
 public function run()
 {
     $dataInsert = array(array('name' => 'Automotive', 'path' => '1_'), array('name' => 'Electronic', 'path' => '2_'), array('name' => 'Entertainment', 'path' => '3_'), array('name' => 'Event & Festival', 'path' => '4_'), array('name' => 'Fashion / Clothing', 'path' => '5_'), array('name' => 'Finance', 'path' => '6_'), array('name' => 'Food & Beverage', 'path' => '7_'), array('name' => 'Health & Beauty', 'path' => '8_'), array('name' => 'Institution / Organization', 'path' => '9_'), array('name' => 'Leisure', 'path' => '10_'), array('name' => 'Oil & Gas', 'path' => '11_'), array('name' => 'Other', 'path' => '12_'), array('name' => 'Portal', 'path' => '13_'), array('name' => 'Real Estate', 'path' => '14_'), array('name' => 'Retail', 'path' => '15_'), array('name' => 'Service', 'path' => '16_'), array('name' => 'Travel & Tourism', 'path' => '17_'), array('name' => 'Car Accessories', 'parent_id' => 1, 'path' => '1_18_'), array('name' => 'Vehicle', 'parent_id' => 1, 'path' => '1_19_'), array('name' => 'Digital, Gadget & Mobile device', 'parent_id' => 2, 'path' => '2_20_'), array('name' => 'Household Appliances', 'parent_id' => 2, 'path' => '2_21_'), array('name' => 'Broadcast & Airtime Management', 'parent_id' => 3, 'path' => '3_22_'), array('name' => 'Movie', 'parent_id' => 3, 'path' => '3_23_'), array('name' => 'Banking & Insurance', 'parent_id' => 6, 'path' => '6_24_'), array('name' => 'Debit, Credit & Royalty Card', 'parent_id' => 6, 'path' => '6_25_'), array('name' => 'Alcohol', 'parent_id' => 7, 'path' => '7_26_'), array('name' => 'Non-alcohol', 'parent_id' => 7, 'path' => '7_27_'), array('name' => 'Restaurant & Cafe', 'parent_id' => 7, 'path' => '7_28_'), array('name' => 'Cosmetic', 'parent_id' => 8, 'path' => '8_29_'), array('name' => 'Fitness Center', 'parent_id' => 8, 'path' => '8_30_'), array('name' => 'Therapy', 'parent_id' => 8, 'path' => '8_31_'), array('name' => 'Charity / Non Profit', 'parent_id' => 9, 'path' => '9_32_'), array('name' => 'Corporate', 'parent_id' => 9, 'path' => '9_33_'), array('name' => 'Education', 'parent_id' => 9, 'path' => '9_34_'), array('name' => 'Government', 'parent_id' => 9, 'path' => '9_35_'), array('name' => 'Gambling', 'parent_id' => 10, 'path' => '10_36_'), array('name' => 'Games', 'parent_id' => 10, 'path' => '10_37_'), array('name' => 'Pet', 'parent_id' => 10, 'path' => '10_38_'), array('name' => 'Publication', 'parent_id' => 10, 'path' => '10_39_'), array('name' => 'PSA (Public Service Announcement)', 'parent_id' => 12, 'path' => '12_40_'), array('name' => 'Publisher in-House Serving', 'parent_id' => 12, 'path' => '12_41_'), array('name' => 'Testing', 'parent_id' => 12, 'path' => '12_42_'), array('name' => 'HR / Recruitment', 'parent_id' => 13, 'path' => '13_43_'), array('name' => 'Online Approach', 'parent_id' => 13, 'path' => '13_44_'), array('name' => 'FMCG', 'parent_id' => 15, 'path' => '15_45_'), array('name' => 'Home Furnishing & Lifestyle', 'parent_id' => 15, 'path' => '15_46_'), array('name' => 'Hypermarket', 'parent_id' => 15, 'path' => '15_47_'), array('name' => 'Optical, Timepiece & Jewelry', 'parent_id' => 15, 'path' => '15_48_'), array('name' => 'Internet & Technology', 'parent_id' => 16, 'path' => '16_49_'), array('name' => 'Logistic & Transport', 'parent_id' => 16, 'path' => '16_50_'), array('name' => 'Public Utilities', 'parent_id' => 16, 'path' => '16_51_'), array('name' => 'Telco', 'parent_id' => 16, 'path' => '16_52_'), array('name' => 'Accomodation', 'parent_id' => 17, 'path' => '17_53_'), array('name' => 'Airlines', 'parent_id' => 17, 'path' => '17_54_'), array('name' => 'Place', 'parent_id' => 17, 'path' => '17_55_'));
     foreach ($dataInsert as $data) {
         DB::table('category')->insert($data);
     }
 }
Esempio n. 8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     foreach (range(1, 200) as $index) {
         DB::table('parts')->insert(['description' => $faker->realText(100), 'cost' => $faker->randomFloat(2, 1, 1000)]);
     }
 }
Esempio n. 9
0
 public function setUserEntityTheme($file, $dataarr)
 {
     $getpersonalcount = DB::table('tbl_bankaccounts')->leftjoin('tbl_bankbranches', 'bankaccount_branch', '=', 'branch_id')->leftjoin('tbl_banks', 'branch_bankid', '=', 'bank_id')->where('bank_isproduct', '0')->where('bankaccount_userentity', 'Personal')->where('bankaccount_createdby', Auth::user()->id)->count();
     $getbusinesscount = DB::table('tbl_bankaccounts')->leftjoin('tbl_bankbranches', 'bankaccount_branch', '=', 'branch_id')->leftjoin('tbl_banks', 'branch_bankid', '=', 'bank_id')->where('bank_isproduct', '0')->where('bankaccount_userentity', 'Business')->where('bankaccount_createdby', Auth::user()->id)->count();
     $resultbViewAcctype = DB::table('tbl_bankaccounttypes')->get();
     $resultbViewAcctypearr = array();
     foreach ($resultbViewAcctype as $data) {
         $resultbViewAcctypearr[$data->accounttype_id] = $data->accounttype_name;
     }
     $resultbViewBanks = DB::table('tbl_banks')->where('bank_isproduct', 0)->where('bank_status', '1')->orderBy('bank_name', 'ASC')->get();
     $resultbViewBanksarr = array();
     foreach ($resultbViewBanks as $data) {
         $resultbViewBanksarr[$data->bank_id] = $data->bank_name;
     }
     $resultbViewBankbranchs = DB::table('tbl_bankbranches')->where("branch_bankid", key($resultbViewBanksarr))->where("branch_status", "1")->get();
     $resultbViewBankBrancharr = array();
     foreach ($resultbViewBankbranchs as $data) {
         $resultbViewBankBrancharr[$data->branch_id] = $data->branch_name;
     }
     if ($getpersonalcount <= 0 and $getbusinesscount <= 0) {
         $data = array('bankaccttype' => $resultbViewAcctypearr, 'bankname' => $resultbViewBanksarr, 'bankbranch' => $resultbViewBankBrancharr);
         $MyTheme = Theme::uses('fonebayad')->layout('ezibills_9_0');
         return $MyTheme->of('registration.firstloginaddbankacct', $data)->render();
     } else {
         //            $MyTheme = Theme::uses('fonebayad')->layout('ezibills_9_0');
         $MyTheme = Theme::uses('fonebayad')->layout('newDefault_myBills');
         return $MyTheme->of($file, $dataarr)->render();
     }
 }
Esempio n. 10
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $tags = array(['name' => 'environment', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')], ['name' => 'government', 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')]);
     // Uncomment the below to run the seeder
     DB::table('tags')->insert($tags);
     factory(App\Models\Tag::class, 10)->create();
 }
Esempio n. 11
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS = 0');
     DB::table('cijfer')->truncate();
     $toetsen = Toets::all();
     //$cijfers = factory(Cijfer::class, count($toetsen)*count($leerlingen))->create();
     for ($i = 0; $i < count($toetsen); ++$i) {
         //dd($toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->leerlingen()->first());
         $klas = $toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->code;
         if (substr($klas, 0, 1) != '5') {
             continue;
         }
         $leerlingen = $toetsen[$i]->toetsenlijst()->first()->lesopdracht()->first()->klas()->first()->leerlingen()->get();
         for ($j = 0; $j < count($leerlingen); ++$j) {
             $cijfer = factory(Cijfer::class, 1)->create();
             $cijfer["waarde"] = rand(0, 10);
             $cijfer["toets_id"] = $toetsen[$i]["id"];
             $cijfer["leerling_id"] = $leerlingen[$j]["id"];
             $cijfer->save();
         }
     }
     DB::statement('SET FOREIGN_KEY_CHECKS = 1');
     Model::reguard();
 }
Esempio n. 12
0
 public function run()
 {
     DB::table('news')->delete();
     $introduction = "Cras egestas non arcu quis facilisis. Etiam scelerisque felis a ante \n\t\tvehicula dignissim. Nunc nulla erat, placerat in ipsum efficitur, efficitur volutpat enim. \n\t\tIn nec lobortis sapien. Maecenas quis nunc molestie, ultrices magna nec, cursus risus. \n\t\tFusce viverra urna at blandit dignissim. Duis id porta augue, vel tempor enim. Ut eu orci dolor. ";
     $introduction1 = "Duis posuere cursus arcu, consectetur tincidunt turpis vulputate eu. \n\t\tInteger venenatis consequat turpis sit amet bibendum. Nulla nibh ex, semper nec sem sed, consectetur \n\t\ttincidunt metus. Aliquam mollis condimentum magna id tincidunt. Suspendisse pellentesque placerat \n\t\taccumsan. Sed a turpis lacus. Donec luctus lorem a turpis scelerisque tincidunt. Etiam at tellus \n\t\tsed erat elementum dictum. In sit amet nulla mattis, placerat erat non, vehicula metus. Morbi nulla \n\t\tsapien, sollicitudin non vulputate et, sodales in nisi. Donec sapien dolor, tincidunt sed ultricies \n\t\tin, ultrices sit amet ante. ";
     $content = "Quisque congue sed mauris sit amet fringilla. Pellentesque a justo mollis, \n\t\tlaoreet felis vehicula, elementum urna. Proin a nisl nec lorem mollis malesuada. Suspendisse sollicitudin \n\t\tvolutpat elementum. Mauris luctus egestas justo, nec tincidunt est luctus a. Aenean a convallis sem. \n\t\tAenean quis lorem efficitur, rutrum libero eu, efficitur nunc. Praesent eu metus pellentesque, mollis \n\t\tdui eget, interdum elit. Nulla tempus tristique eros, ut mattis leo sagittis at. Curabitur rutrum tellus \n\t\teu ex egestas, et dapibus lacus sodales. Maecenas facilisis tortor vitae neque vehicula, feugiat commodo \n\t\tnulla pulvinar. Maecenas porttitor mauris enim, sed condimentum enim varius vel. Nulla dapibus velit a \n\t\tluctus malesuada. Nam eleifend felis et porta semper. Proin blandit sem augue, in venenatis augue ultricies \n\t\tvitae. Nulla eu purus tellus.\n\rCras tempus mauris sed arcu euismod, eget ultrices nisi lobortis. Etiam \n\t\ttincidunt erat nunc, ut pretium turpis mollis et. Fusce feugiat, lectus id imperdiet rutrum, justo urna \n\t\tfinibus libero, eget dignissim erat lorem sed neque. Curabitur non nisl facilisis, venenatis risus vel, \n\t\tcommodo augue. Cras eget nisl dictum, sodales turpis eu, blandit lectus. Duis mattis est ac mi pretium \n\t\ttristique vitae non magna. Aenean dictum quis neque a volutpat. Integer convallis purus in enim tempor \n\t\tpretium. Sed sit amet diam et purus porta luctus. Sed pretium, lorem ut sodales maximus, nisl arcu \n\t\ttristique odio, nec posuere mauris metus ac justo. Pellentesque ut volutpat purus. Nulla vel ornare libero. \n\t\tSed metus massa, blandit eu lorem eu, finibus ornare arcu. Proin sagittis eu turpis sit amet scelerisque. \n\t\tPhasellus nec libero eu ipsum congue consectetur. Quisque id mattis nisl, ac porta sapien. Nulla lobortis,\n\t\tturpis at scelerisque finibus, augue neque laoreet diam, in facilisis lacus purus at libero. Ut libero \n\t\tsapien, laoreet nec lorem suscipit, efficitur tincidunt elit. Quisque mi libero, volutpat eu convallis nec, \n\t\tsemper at nulla. Sed hendrerit rhoncus nulla sit amet vestibulum. Vestibulum ante ipsum primis in faucibus \n\t\torci luctus et ultrices posuere cubilia Curae; Suspendisse diam neque, dignissim non metus maximus, \n\t\tsuscipit faucibus magna. Aenean sodales elit enim, eu laoreet dui vulputate ac. Donec sagittis dignissim \n\t\ttortor, vitae dignissim dolor ultricies eu. Vivamus rutrum vestibulum auctor. Aliquam eu orci ligula. \n\t\tQuisque at ligula ex. Suspendisse in ante eget turpis sollicitudin lobortis tincidunt sed nibh. Phasellus \n\t\telementum nibh vitae rutrum porta. Pellentesque vitae vestibulum purus. Curabitur placerat mattis tempor.";
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Cras egestas non arcu quis facilisis";
     $news->introduction = $introduction;
     $news->content = $content;
     $news->save();
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Fusce vel turpis ultricies";
     $news->introduction = $introduction1;
     $news->content = $content;
     $news->save();
     $news = new News();
     $news->language_id = 1;
     $news->user_id = 1;
     $news->newscategory_id = 1;
     $news->title = "Donec ligula sem, facilisis ac tristique et, imperdiet nec nisi";
     $news->introduction = $introduction;
     $news->content = $content;
     $news->save();
 }
Esempio n. 13
0
 function getsetting()
 {
     global $_G;
     $settings = array('fids' => array('title' => 'couplebanner_fids', 'type' => 'mselect', 'value' => array()), 'groups' => array('title' => 'couplebanner_groups', 'type' => 'mselect', 'value' => array()), 'position' => array('title' => 'couplebanner_position', 'type' => 'mradio', 'value' => array(array(1, 'couplebanner_position_left'), array(2, 'couplebanner_position_right')), 'default' => 1), 'coupleadid' => array('title' => 'couplebanner_coupleadid', 'type' => 'select', 'value' => array()));
     loadcache(array('forums', 'grouptype'));
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
     $settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'couplebanner_index');
     if (empty($_G['cache']['forums'])) {
         $_G['cache']['forums'] = array();
     }
     foreach ($_G['cache']['forums'] as $fid => $forum) {
         $settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')) . $forum['name']);
     }
     foreach ($_G['cache']['grouptype']['first'] as $gid => $group) {
         $settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4) . $group['name']);
         if ($group['secondlist']) {
             foreach ($group['secondlist'] as $sgid) {
                 $settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8) . $_G['cache']['grouptype']['second'][$sgid]['name']);
             }
         }
     }
     $query = DB::query('SELECT * FROM ' . DB::table('common_advertisement') . " WHERE type='couplebanner'");
     while ($couple = DB::fetch($query)) {
         $settings['coupleadid']['value'][] = array($couple['advid'], $couple['title']);
     }
     return $settings;
 }
Esempio n. 14
0
 static function getCountries()
 {
     $countries = DB::table('countries')->lists('name', 'code');
     //$provinces   = DB::table('provinces')->lists('name','code','ID')->where('country','=','IN')->get();
     //$provinces   = Provinces::where('country','=',$countryCode)->lists('name','ID as id');
     return $countries;
 }
 public function run()
 {
     // DELETING TABLE ENTRIES
     DB::table($this->_table)->delete();
     // CONFERENCE PARTNERS
     DB::table($this->_table)->insert([['company' => 'TAGITM', 'slug' => 'tagitm', 'website' => 'http://www.tagitm.org', 'slogan' => '', 'tags' => '2015/austin', 'photo' => '/images/partners/tagitm.png', 'published' => Carbon::create(2015, 00, 28, 15, 05, 29)]]);
 }
Esempio n. 16
0
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 50; $i++) {
         \DB::table('states')->insert(array('state' => $faker->unique()->state, 'code' => $faker->postcode));
     }
 }
Esempio n. 17
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('tbl_users')->truncate();
     $faker = \Faker\Factory::create();
     for ($i = 0; $i < 10; $i++) {
         switch (mt_rand(1, 4)) {
             case 1:
                 $insertion = 'van';
                 break;
             case 2:
                 $insertion = 'de';
                 break;
             case 3:
                 $insertion = 'van der';
                 break;
             default:
                 $insertion = '';
         }
         $city2 = "";
         $street2 = "";
         $house_nr2 = "";
         $postalcode2 = "";
         if (mt_rand(1, 2) == 1) {
             $street2 = $faker->streetName;
             $house_nr2 = $faker->numberBetween(0, 2000);
             $postalcode2 = $faker->postcode;
             $city2 = $faker->city;
         }
         \App\User::create(['username' => $faker->userName, 'password' => password_hash('password', PASSWORD_DEFAULT), 'email' => $faker->email, 'firstname' => $faker->firstName, 'lastname' => $faker->lastName, 'insertion' => $insertion, 'phone_nr' => $faker->phoneNumber, 'birthdate' => $faker->date($format = 'Y-m-d', $max = 'now') . " " . $faker->time($format = 'H:i:s', $max = 'now'), 'city' => $faker->city, 'street' => $faker->streetName, 'house_nr' => $faker->numberBetween(0, 2000), 'postalcode' => $faker->postcode, 'city2' => $city2, 'street2' => $street2, 'house_nr2' => $house_nr2, 'postalcode2' => $postalcode2]);
     }
 }
Esempio n. 18
0
 public function run()
 {
     DB::table('roles')->delete();
     $role = new Role();
     $role->name = 'edit_site';
     $role->description = 'Editar Sitio';
     $role->save();
     $role = new Role();
     $role->name = 'crud_user';
     $role->description = 'Manejo Usuarios';
     $role->save();
     $role = new Role();
     $role->name = 'crud_organization';
     $role->description = 'Crear Muestras';
     $role->save();
     $role = new Role();
     $userRole = new UserRole();
     $userRole->user_id = 1;
     $userRole->role_id = 1;
     $userRole->save();
     $userRole = new UserRole();
     $userRole->user_id = 1;
     $userRole->role_id = 2;
     $userRole->save();
     $userRole = new UserRole();
     $userRole->user_id = 2;
     $userRole->role_id = 3;
     $userRole->save();
     $userRole = new UserRole();
     $userRole->user_id = 2;
     $userRole->role_id = 2;
     $userRole->save();
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $activities = ['technology', 'service', 'agribusiness', 'industry', 'tourism', 'hobby', 'association', 'institution'];
     foreach ($activities as $activity) {
         DB::table('activities')->insert(['name' => $activity]);
     }
 }
Esempio n. 20
0
 /**
  * Auto generated seed file
  *
  * @return void
  */
 public function run()
 {
     $monday = Date('Y-m-d', strtotime('-2 days'));
     $tuesday = Date('Y-m-d', strtotime('-1 days'));
     \DB::table('shifts')->delete();
     \DB::table('shifts')->insert(array(0 => array('id' => '1', 'eid' => '1', 'clockIn' => "{$monday} 08:00:00", 'clockOut' => "{$monday} 13:00:00", 'created_at' => '2015-05-26 08:04:58', 'updated_at' => '2015-05-26 12:51:33'), 1 => array('id' => '2', 'eid' => '1', 'clockIn' => "{$tuesday} 08:05:37", 'clockOut' => "{$tuesday} 17:02:57", 'created_at' => '2015-05-26 08:10:37', 'updated_at' => '2015-05-26 17:02:57'), 2 => array('id' => '3', 'eid' => '2', 'clockIn' => "{$tuesday} 08:22:32", 'clockOut' => "{$tuesday} 14:06:51", 'created_at' => '2015-05-26 08:22:32', 'updated_at' => '2015-05-26 14:06:51'), 3 => array('id' => '4', 'eid' => '2', 'clockIn' => "{$monday} 09:30:00", 'clockOut' => "{$monday} 16:18:27", 'created_at' => '2015-05-26 11:21:09', 'updated_at' => '2015-05-26 16:18:27'), 4 => array('id' => '5', 'eid' => '3', 'clockIn' => "{$monday} 11:38:57", 'clockOut' => "{$monday} 15:28:26", 'created_at' => '2015-05-26 11:38:57', 'updated_at' => '2015-05-26 15:28:26')));
 }
Esempio n. 21
0
 public function run()
 {
     DB::table('home_page')->delete();
     $success = File::cleanDirectory($this->getImagesPath());
     File::put($this->getImagesPath() . '.gitignore', File::get(public_path() . '/../app/storage/cache/.gitignore'));
     HomePage::create(['headline' => "Industrial Legacy", 'text' => 'RUSTIC DETAILS. MODERN EDGE. REFINED LIVING IN COURT SQUARE. <br> 1 - 4 BEDROOM HOMES FROM $615K. PENTHOUSES PRICED UPON REQUEST.', 'subtext' => 'CHILDREN\'S PLAYROOM, LOUNGE, LIBRARY, GYM, TERRACE AND PARKING', 'image' => $this->copyImage(public_path() . '/backup_images/building/building.jpg')]);
 }
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     DB::table('photos')->truncate();
     for ($photos = 0; $photos < 100; $photos++) {
         DB::table('photos')->insert([['path' => 'image' . $photos . '.jpg', 'imageable_id' => rand(1, 50), 'imageable_type' => $photos % 2 == 0 ? 'App\\Staff' : 'App\\Product']]);
     }
 }
 public function run()
 {
     DB::table('playlists')->delete();
     \App\Playlist::create(['id' => 1, 'name' => 'test']);
     \App\Playlist::create(['id' => 2, 'name' => 'test2']);
     \App\Playlist::create(['id' => 3, 'name' => 'test3']);
 }
Esempio n. 24
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     $faker = Faker::create();
     for ($i = 0; $i < 20; $i++) {
         DB::table('stores')->insert([['brand_id' => rand(1, 10), 'payment_type' => rand(1, 3), 'store_name' => $faker->company . ' Store', 'address' => $faker->address, 'latitude' => $faker->latitude, 'longitude' => $faker->longitude, 'opening_time' => 10 + rand(1, 3), 'closing_time' => 20 + rand(1, 3), 'highlights' => 'Ready made', 'price_range' => 1000 + rand(100, 600) . '-' . (10000 + rand(1500, 1900)), 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]]);
     }
 }
Esempio n. 25
0
 function usesubmit()
 {
     global $_G;
     if (empty($_G['gp_tid'])) {
         showmessage(lang('magic/sofa', 'sofa_info_nonexistence'));
     }
     $thread = getpostinfo($_G['gp_tid'], 'tid', array('fid', 'authorid', 'dateline', 'subject'));
     $this->_check($thread);
     $firstsofa = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_threadmod') . " WHERE magicid='" . $this->magic['magicid'] . "' AND tid='{$_G['gp_tid']}'");
     if ($firstsofa >= 1) {
         showmessage(lang('magic/sofa', 'sofa_info_sofaexistence'), '', array(), array('login' => 1));
     }
     $sofamessage = lang('magic/sofa', 'sofa_text', array('actor' => $_G['member']['username'], 'time' => dgmdate(TIMESTAMP), 'magicname' => $this->magic['name']));
     $dateline = $thread['dateline'] + 1;
     insertpost(array('fid' => $thread['fid'], 'tid' => $_G['gp_tid'], 'first' => '0', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'dateline' => $dateline, 'message' => $sofamessage, 'useip' => $_G['clientip'], 'usesig' => '1'));
     DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies+1, moderated='1' WHERE tid='{$_G['tid']}'", 'UNBUFFERED');
     DB::query("UPDATE " . DB::table('forum_forum') . " SET posts=posts+1, todayposts=todayposts+1 WHERE fid='{$post['fid']}'", 'UNBUFFERED');
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['gp_tid']);
     updatemagicthreadlog($_G['gp_tid'], $this->magic['magicid']);
     if ($thread['authorid'] != $_G['uid']) {
         notification_add($thread['authorid'], 'magic', lang('magic/sofa', 'sofa_notification'), array('tid' => $_G['gp_tid'], 'subject' => $thread['subject'], 'magicname' => $this->magic['name']));
     }
     showmessage(lang('magic/sofa', 'sofa_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1));
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     // 学校区分マスターデータ
     Schema::create('school_types', function (Blueprint $table) {
         $table->increments('id');
         $table->string('code', 5)->unique()->index();
         $table->string('name', 255);
     });
     $school_types = array(array('code' => 101, 'name' => '大学院'), array('code' => 201, 'name' => '大学'), array('code' => 301, 'name' => '短期大学'), array('code' => 401, 'name' => '専修・各種学校'), array('code' => 501, 'name' => '高等専門学校'), array('code' => 601, 'name' => '高等学校'), array('code' => 701, 'name' => '中学校'), array('code' => 801, 'name' => '小学校'), array('code' => 901, 'name' => 'その他'));
     DB::table('school_types')->insert($school_types);
     // 学業区分マスターデータ
     Schema::create('study_types', function (Blueprint $table) {
         $table->increments('id');
         $table->string('code', 5)->unique()->index();
         $table->string('name', 255);
     });
     $study_types = array(array('code' => 101, 'name' => '文系'), array('code' => 201, 'name' => '理系'), array('code' => 901, 'name' => 'その他'));
     DB::table('study_types')->insert($study_types);
     //        // 国マスターデータ
     //        Schema::create('countries', function (Blueprint $table) {
     //            $table->increments('id');
     //            $table->string('contory_code', 5)->unique()->index();
     //            $table->string('abbreviation_name', 5)->unique()->index();
     //            $table->string('full_name', 255);
     //        });
     //
     //        $countries = array(
     //            array( 'contory_code'  => 101, 'abbreviation_name' => '文系' ,  'full_name' => 'アメリカ'),
     //            array( 'contory_code'  => 201, 'abbreviation_name' => '理系' , 'full_name' => 'アメリカ'),
     //            array( 'contory_code'  => 901, 'abbreviation_name' => 'その他' , 'full_name' => 'アメリカ' ),
     //        );
     //        DB::table('study_types')->insert($countries);
 }
 public function run()
 {
     DB::table('unidadAdministrativa')->delete();
     UnidadAdministrativa::create(array('nombre' => 'AUXILIAR DE COORDINACION'));
     UnidadAdministrativa::create(array('nombre' => 'Comisionado'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE AUTORREGULACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE TECNOLOGÍAS DE LA INFORMACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE VERIFICACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE ANÁLISIS NORMATIVO Y EVALUACIÓN DE LA INFORMACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'SECRETARÍA DE ACCESO A LA INFORMACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE ASUNTOS INTERNACIONALES'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE COORDINACIÓN Y VIGILANCIA DE LA ADMINISTRACIÓN PÚBLICA FEDERAL'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE GESTION DE LA INFORMACIÓN Y ESTUDIOS'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE CAPACITACIÓN  PROMOCIÓN Y RELACIONES INSTITUCIONALES'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE ADMINISTRACIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE NORMATIVIDAD CONSULTA Y ATENCIÓN REGIONAL'));
     UnidadAdministrativa::create(array('nombre' => 'SECRETARÍA DE PROTECCIÓN DE DATOS PERSONALES'));
     UnidadAdministrativa::create(array('nombre' => 'PLENO'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE COORDINACIÓN DE POLÍTICAS DE ACCESO'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE SUSTANCIACIÓN Y SANCIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'SECRETARÍA GENERAL'));
     UnidadAdministrativa::create(array('nombre' => 'SECRETARÍA TÉCNICA DEL PLENO'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE COMUNICACIÓN SOCIAL Y DIFUSIÓN'));
     UnidadAdministrativa::create(array('nombre' => 'DIRECCIÓN GENERAL DE ASUNTOS JURÍDICOS'));
 }
 public function run()
 {
     // Kommentera denna för att inte radera all data i tabellen
     DB::table('orders')->delete();
     $orders = array(['id' => 1, 'roomid' => 2, 'arrives' => '2015-08-03', 'departures' => '2015-08-10', 'name' => 'Förnamn Efternamn', 'phone' => '0000000000', 'created_at' => new DateTime(), 'updated_at' => new DateTime()], ['id' => 2, 'roomid' => 1, 'arrives' => '2015-08-08', 'departures' => '2015-08-12', 'name' => 'Förnamn Efternamn', 'phone' => '0000000000', 'created_at' => new DateTime(), 'updated_at' => new DateTime()]);
     DB::table('orders')->insert($orders);
 }
Esempio n. 29
0
 /**
  * Seed the specialties table.
  *
  * @return void
  * @author PJ
  */
 private function seedTable($data)
 {
     foreach ($data as $lineIndex => $row) {
         $aliases = AggregateReporter::getAliases($row[17]);
         DB::table('physicians')->insert(['aoa_mem_id' => $row[0], 'full_name' => $row[1], 'prefix' => $row[2], 'first_name' => $row[3], 'middle_name' => $row[4], 'last_name' => $row[5], 'suffix' => $row[6], 'designation' => $row[7], 'SortColumn' => $row[8], 'MemberStatus' => $row[9], 'City' => $row[10], 'State_Province' => $row[11], 'Zip' => $row[12], 'Country' => $row[13], 'COLLEGE_CODE' => $row[14], 'YearOfGraduation' => $row[15], 'fellows' => $row[16], 'PrimaryPracticeFocusCode' => $row[17], 'PrimaryPracticeFocusArea' => $row[18], 'SecondaryPracticeFocusCode' => $row[19], 'SecondaryPracticeFocusArea' => $row[20], 'website' => $row[21], 'AOABoardCertified' => $row[22] == 'YES' ? 1 : 0, 'address_1' => $row[23], 'address_2' => $row[24], 'Phone' => $row[25], 'Email' => $row[26], 'ABMS' => $row[27] == 'YES' ? 1 : 0, 'Gender' => $row[28], 'CERT1' => $row[29], 'CERT2' => $row[30], 'CERT3' => $row[31], 'CERT4' => $row[32], 'CERT5' => $row[33], 'lat' => $row[34], 'lon' => $row[35], 'geo_confidence' => $row[36], 'geo_city' => $row[37], 'geo_state' => $row[38], 'geo_matches' => $row[39] == 'True' ? 1 : 0, 'alias_1' => empty($aliases[0]) ? null : $aliases[0]->id, 'alias_2' => empty($aliases[1]) ? null : $aliases[1]->id, 'alias_3' => empty($aliases[2]) ? null : $aliases[2]->id]);
     }
 }
 public function run()
 {
     DB::table('users')->truncate();
     factory('CodeCommerce\\User')->create(['name' => "Houston", 'email' => '*****@*****.**', 'password' => Hash::make('123456'), 'is_admin' => true, 'endereco' => 'R. Canadá', 'numero' => 73, 'bairro' => 'Jardim Naltilus', 'cidade' => 'Cabo Frio', 'uf' => 'RJ', 'cep' => '28909-170']);
     //usuario  padrao
     factory('CodeCommerce\\User', 9)->create();
 }