Beispiel #1
2
 public function store(LocationRequest $request)
 {
     $location = Location::create($request->all());
     Session::flash('success', true);
     Session::flash('message', 'Aðgerð tókst: Ný staðsetning');
     return Redirect::back();
 }
 public function index(Request $request)
 {
     if (!$request->ajax()) {
         Session::forget('criteria');
     }
     if ($request->criteria == 'priceasc' || Session::get('criteria') == 'priceasc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('price')->paginate(5);
         Session::flash('criteria', 'priceasc');
     } elseif ($request->criteria == 'pricedesc' || Session::get('criteria') == 'pricedesc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('price', 'desc')->paginate(5);
         Session::flash('criteria', 'pricedesc');
     } elseif ($request->criteria == 'popularityasc' || Session::get('criteria') == 'popularityasc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('score')->paginate(5);
         Session::flash('criteria', 'popularityasc');
     } elseif ($request->criteria == 'popularitydesc' || Session::get('criteria') == 'popularitydesc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('score', 'desc')->paginate(5);
         Session::flash('criteria', 'popularitydesc');
     } elseif ($request->criteria == 'dateasc' || Session::get('criteria') == 'dateasc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('published_at')->paginate(5);
         Session::flash('criteria', 'dateasc');
     } elseif ($request->criteria == 'datedesc' || Session::get('criteria') == 'datedesc') {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('published_at', 'desc')->paginate(5);
         Session::flash('criteria', 'datedesc');
     } else {
         $products = Product::with('tags', 'category', 'picture')->online()->orderBy('published_at')->paginate(5);
     }
     $lastPage = $products->lastPage();
     if ($request->ajax()) {
         $resultat = array();
         $resultat[0] = json_encode($lastPage);
         $resultat[1] = json_encode(View::make('front.partials.product', compact('products'))->render());
         return $resultat;
     }
     return view('front.index', compact('products'));
 }
 public function destroy($id)
 {
     $cursadas = AsignaturaCursada::find($id);
     $cursadas->delete();
     Session::flash('message', 'La asignatura cursada ' . $cursos->nombre . ' fue eliminada');
     return redirect()->route('asignaturas.cursadas.index');
 }
Beispiel #4
0
 /**
  * Redirect to the homepage.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     Session::flash('', '');
     // work around laravel bug if there is no session yet
     Session::reflash();
     return Redirect::to($this->path);
 }
 public function destroy($id)
 {
     $asignaturas = Asignatura::find($id);
     $asignaturas->delete();
     Session::flash('message', 'La asignatura ' . $asignaturas->nombre . ' fue eliminada');
     return redirect()->route('Encargado.asignaturas.index');
 }
 public function store(Request $request)
 {
     //dd('jajaja');
     $file = $request->file('file');
     //obtenemos el campo file obtenido por el formulario
     $nombre = $file->getClientOriginalName();
     //indicamos que queremos guardar un nuevo archivo en el disco local
     \Storage::disk('local')->put($nombre, \File::get($file));
     \Excel::load('/storage/public/files/' . $nombre, function ($archivo) use(&$falla) {
         $result = $archivo->get();
         //leer todas las filas del archivo
         foreach ($result as $key => $value) {
             $var = new Periodo();
             $datos = ['bloque' => $value->bloque, 'inicio' => $value->inicio, 'fin' => $value->fin];
             $validator = Validator::make($datos, Periodo::storeRules());
             if ($validator->fails()) {
                 Session::flash('message', 'Los Periodos ya existen o el archivo ingresado no es valido');
                 $falla = true;
             } else {
                 $var->fill($datos);
                 $var->save();
             }
         }
     })->get();
     if ($falla) {
         // Fallo la validacion de algun campus, retornar al index con mensaje
         return redirect()->route('Administrador.periodos.index');
     }
     \Storage::delete($nombre);
     Session::flash('message', 'Los Periodos fueron agregados exitosamente!');
     return redirect()->route('Administrador.periodos.index');
 }
 public function destroy($id)
 {
     $user = User::findOrFail($id);
     $user->delete();
     Session::flash('message', trans('home.messages.delete_user_suceed', ['name' => $user->name]));
     return redirect()->route('admin.users.index');
 }
 public function update($id, ClanakRequest $request)
 {
     $clanak = Article::findOrFail($id);
     $clanak->update($request->all());
     Session::flash('flash_message', 'Uspjesno ste izmjenili clanak');
     return redirect('clanak');
 }
 public function store()
 {
     // getting all of the post data
     $file = array('image' => Input::file('image'));
     $input = Request::all();
     $image = $input['image'];
     // setting up rules
     $rules = array('image' => 'required');
     //mimes:jpeg,bmp,png and for max size max:10000
     // doing the validation, passing post data, rules and the messages
     $validator = Validator::make($image, $rules);
     if ($validator->fails()) {
         // send back to the page with the input data and errors
         return Redirect::to('/')->withInput()->withErrors($validator);
     } else {
         // checking file is valid.
         if (Input::file('image')->isValid()) {
             $destinationPath = '/uploads/images';
             // upload path
             $extension = Input::file('image')->getClientOriginalExtension();
             // getting image extension
             $fileName = rand(11111, 99999) . '.' . $extension;
             // renameing image
             Input::file('image')->move($destinationPath, $fileName);
             // uploading file to given path
             // sending back with message
             Session::flash('success', 'Upload successfully');
             return Redirect::to('upload');
         } else {
             // sending back with error message.
             Session::flash('error', 'uploaded file is not valid');
             return Redirect::to('upload');
         }
     }
 }
Beispiel #10
0
 public function destroy($id)
 {
     $page = Page::findOrFail($id);
     $page->delete();
     Session::flash('delete_page', 'page has been deleted');
     return redirect('panel/pages');
 }
Beispiel #11
0
 public function scopeName($query, $name)
 {
     if (trim($name) != "") {
         $query->where(\DB::raw("CONCAT(name)"), "LIKE", "%{$name}%");
         Session::flash('message', 'Nombre:' . ' ' . $name . '  ' . 'Resultado de la busqueda');
     }
 }
 public function logout()
 {
     Session::flush();
     Auth::logout();
     Session::flash('messages', ["Successfully logged out."]);
     return view('front.index');
 }
Beispiel #13
0
 public function delete($id)
 {
     $user = usersdb::find($id);
     $user->delete();
     Session::flash('success', "L'utilisateur {$user->username} a bien été supprimé.");
     return Redirect::route('users.index');
 }
 public function destroy($id)
 {
     $horarios = Horario::find($id);
     $horarios->delete();
     Session::flash('message', 'El Horario de la fecha ' . $horarios->fecha . ' fue eliminado');
     return redirect()->route('Administrador.horarios.index');
 }
Beispiel #15
0
 public function logout()
 {
     Session::flush();
     Session::flash('message', 'You have successfully logged out of the system.');
     Session::flash('alert-class', 'alert-success');
     return Redirect::to('/');
 }
Beispiel #16
0
 public function update()
 {
     $btnStatus = Input::get('btn_sta');
     $inputs = Input::get('check');
     switch ($btnStatus[0]) {
         case 1:
             foreach ($inputs as $key => $id) {
                 DB::table('users')->where('id', $id)->delete();
             }
             Session::flash('flash_message', "Sukses Menghapus Data !!");
             break;
         case 2:
             foreach ($inputs as $key => $id) {
                 DB::table('users')->where('id', $id)->update(['hak_akses' => "2"]);
             }
             Session::flash('flash_message', "Sukses Memperbaharui Status !!");
             break;
         case 3:
             foreach ($inputs as $key => $id) {
                 DB::table('users')->where('id', $id)->update(['hak_akses' => "3"]);
             }
             Session::flash('flash_message', "Sukses Memperbaharui Status !!");
             break;
         default:
             break;
     }
     return redirect('users');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(AccountRequest $request)
 {
     $account = new Account(['glosa' => $request['glosa'], 'montoDebe' => $request['sumDebe'], 'montoHaber' => $request['sumHaber'], 'transaction_id' => $request['nume']]);
     $account->save();
     Session::flash('message', 'Comprobante creado');
     return redirect()->route('newAccount');
 }
 public function TambahJadwal()
 {
     $rules = array('unit_id' => 'required', 'kategori' => 'required', 'tglstart' => 'required', 'tglases' => 'required', 'tglfinish' => 'required', 'detail' => 'required');
     $messages = array('unit_id.required' => 'Nama Jabatan Harus Terisi', 'kategori.required' => 'Kategori Harus Dipilih', 'tglstart.required' => 'Tanggal Mulai Harus Terisi', 'tglases.required' => 'Tanggal Asessment Harus Terisi', 'tglfinish.required' => 'Tanggal Selesai Harus Terisi', 'detail.required' => 'Detail Harus terisi');
     $validasi = validator::make(Input::all(), $rules, $messages);
     if ($validasi->fails()) {
         return Redirect::back()->withErrors($validasi)->withInput();
     } else {
         $kat = Input::get('kategori');
         if ($kat == 'internal') {
             $aa = "in";
         } else {
             $aa = "ex";
         }
         DB::transaction(function ($aa) use($aa) {
             //asesment promosi
             $jadwal = KandidatPromote::create(['unit_staf_id' => Input::get('unit_id'), 'tgl_awal' => Input::get('tglstart'), 'tgl_asesment' => Input::get('tglases'), 'tgl_selesai' => Input::get('tglfinish'), 'detail' => Input::get('detail')]);
             //rekrutmen rekap header
             $rekap_header = HeaderRekap::create(['id_asesmen' => $jadwal->id, 'kategori' => Input::get('kategori'), 'nama' => Input::get('jabatan'), 'tanggal_awal' => Input::get('tglstart'), 'tanggal_akhir' => Input::get('tglfinish'), 'deksripsi' => Input::get('detail')]);
             //asessment promosi daftar
             $daftar = KandidatPromosiDaftar::create(['asesment_promosi_id' => $jadwal->id, 'nip' => Input::get('nip'), 'detail' => Input::get('detail')]);
             //rekrutment rekap profiling
             $profil = ProfilingRekap::create(['id_rekap' => $rekap_header->id, 'kategori' => $aa, 'nip' => $daftar->nip, 'id_jabatan' => $jadwal->unit_staf_id]);
         });
         Session::flash('message', 'Berhasil Menambahkan Jadwal Asessment');
         return Redirect::to('career/jadwal/lihat/asessment');
     }
 }
Beispiel #19
0
 public function onRender()
 {
     $settings = \Rafie\Contactform\Models\ContactFormSettings::instance();
     $id = $this->property('formID');
     $formTitle = $this->property('formTitle');
     $form = Form::find($id);
     if (!$form) {
         Session::flash('error', true);
         Session::flash('messages', ['Form cannot be found.']);
         return;
     }
     // if
     $formHtml = '';
     foreach ($form->fields as $field) {
         if ($field['objType'] == 'input' || $field['objType'] == 'upload') {
             $formComponent = new FormInput($field);
         } elseif ($field['objType'] == 'checkbox') {
             $formComponent = new FormCheckbox($field);
         } elseif ($field['objType'] == 'options') {
             $formComponent = new FormOptions($field);
         } elseif ($field['objType'] == 'paragraph') {
             $formComponent = new FormParagraph($field);
         } else {
             continue;
         }
         $formHtml .= $formComponent->render();
     }
     // foreach
     $this->page['formTitle'] = isset($formTitle) ? $formTitle : $form->name;
     $this->page['formHtml'] = $formHtml;
     $this->page['form'] = $form;
     $this->page['mailTemplate'] = $this->property('mailTemplate');
     $this->page['gCaptcha'] = isset($settings->google_captcha_disabled) && $settings->google_captcha_disabled === '0' ? false : $settings->google_captcha_key;
     $this->page['useBootstrap'] = $settings->use_bootstrap_css && $settings->use_bootstrap_css !== '0';
 }
Beispiel #20
0
 public function destroy($id, Request $request)
 {
     Dnschecker::destroy($id);
     $message = 'El registro ha sido eliminado con exito';
     Session::flash('message', $message);
     return $message;
 }
 public function patchSave($id, Request $request)
 {
     $widget = Text::findOrFail($id);
     $widget->update($request->all());
     Session::flash('message', 'Text updated!');
     return redirect('/admin/widgets/text/' . $id);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int $id
  * @param StoreBankDetailPostRequest $request
  * @return Response
  */
 public function update(BankDetail $bank, StoreBankDetailPostRequest $request)
 {
     $input = $request->all();
     $bank->fill($input)->save();
     Session::flash('flash_message', 'Bank Details successfully Updated!');
     return redirect()->back();
 }
Beispiel #23
0
 public function scopePhase($query, $phase)
 {
     if (trim($phase) != "") {
         $query->where(\DB::raw("CONCAT(phase)"), "LIKE", "%{$phase}%");
         Session::flash('message', 'Fase:' . ' ' . $phase . '  ' . 'Resultado de la busqueda');
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Requests\CreatePagoRequest $request)
 {
     $pago = Pagos::create($request->all());
     $message = 'Pago efectuado de: ' . $pago->monto . ' al usuario: ' . $pago->user->first_name . ' ' . $pago->user->last_name;
     Session::flash('message', $message);
     return Redirect::route('admin.users.index');
 }
 public function getDelete($id)
 {
     $accountNames = NameOfAccount::find($id);
     $accountNames->delete();
     Session::flash('message', 'Account Name  has been Successfully Deleted.');
     return Redirect::to('accountnames/index');
 }
 /**
  * Handle an authentication attempt.
  *
  * @return Response
  */
 public function store()
 {
     $rules = array('email' => 'required|email', 'password' => 'required');
     $validate = Validator::make(Input::all(), $rules);
     if ($validate->fails()) {
         return Redirect::to('/');
     } else {
         if (Auth::attempt(array('email' => Input::get('email'), 'password' => Input::get('password'), 'status' => 'Activate'))) {
             /*$user = User::where('email','=',$email)->get();
               Session::put('user_type',$user[0]->role);
               $id = $user[0]->id;
               Session::put('created_by',$id);*/
             Session::put('user_id', Auth::user()->id);
             Session::put('user_name', Auth::user()->username);
             Session::put('user_role', Auth::user()->role);
             Session::flash('message', 'User has been Successfully Login.');
             $roles = Auth::user()->role;
             if ($roles = 'admin' || 'manager') {
                 return Redirect::to('dashboard');
             } elseif ($roles = 'user') {
                 return Redirect::to('profile');
             }
         } else {
             Session::flash('message', 'Your username or password incorrect');
             return Redirect::to('/');
         }
     }
 }
Beispiel #27
0
 public function scopeEfficiency($query, $efficiency)
 {
     if (trim($efficiency) != "") {
         $query->where(\DB::raw("CONCAT(efficiency)"), "LIKE", "%{$efficiency}%");
         Session::flash('message', 'Rendimiento:' . ' ' . $efficiency . '  ' . 'Resultado de la busqueda');
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param CreatePersonRequest $request
  * @return Response
  */
 public function postStorepeople(CreatePersonRequest $request)
 {
     $people = new People();
     $people->document = $request->get('document');
     $people->names = $request->get('names');
     $people->surnames = $request->get('surnames');
     $people->date_of_birth = $request->get('date_of_birth');
     $people->landline = $request->get('landline');
     $people->address = $request->get('address');
     $people->date_of_admission = $request->get('date_of_admission');
     $people->cellular = $request->get('cellular');
     $upload_dir = \Storage::disk('photos');
     $img = $request->get('photo');
     $img = str_replace('data:image/png;base64,', '', $img);
     $data = base64_decode($img);
     $name = date('YmdHis') . '.png';
     $upload_dir->put($name, $data);
     $people->photo = $name;
     $people->save();
     $email = $request->get('email');
     $password = $request->get('password');
     $user = new User(['email' => $email, 'password' => $password]);
     $people->user()->save($user);
     Session::flash('message', 'Usuario registro correctamente en el sistema.');
     return redirect('auth/login');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $contact = Contact::findOrFail($id);
     $contact->delete();
     Session::flash('message', 'Successfully Deleted your Data!');
     return redirect()->back();
 }
Beispiel #30
-1
 public function scopeDate($query, $date)
 {
     if (trim($date) != "") {
         $query->where(\DB::raw("CONCAT(date)"), "LIKE", "%{$date}%");
         Session::flash('message', 'Fecha:' . ' ' . $date . '  ' . 'Resultado de la busqueda');
     }
 }