/** * @param LoginRequest $request * @return \Illuminate\Http\RedirectResponse */ public function postLogin(LoginRequest $request) { \Session::pull('user_organization'); // If the class is using the ThrottlesLogins trait, we can automatically throttle // the login attempts for this application. We'll key this by the username and // the IP address of the client making these requests into this application. $throttles = $this->isUsingThrottlesLoginsTrait(); if ($throttles && $this->hasTooManyLoginAttempts($request)) { return $this->sendLockoutResponse($request); } //Don't know why the exception handler is not catching this try { $this->auth->login($request); if ($throttles) { $this->clearLoginAttempts($request); } return redirect()->intended('/dashboard'); } catch (GeneralException $e) { // If the login attempt was unsuccessful we will increment the number of attempts // to login and redirect the user back to the login form. Of course, when this // user surpasses their maximum number of attempts they will get locked out. if ($throttles) { $this->incrementLoginAttempts($request); } return redirect()->back()->withInput()->withFlashDanger($e->getMessage()); } }
/** * Display a listing of Tests. Factors in filter parameters * The search string may match: patient_number, patient name, test type name, specimen ID or visit ID * * @return Response */ public function index() { $fromRedirect = Session::pull('fromRedirect'); if ($fromRedirect) { $input = Session::get('TESTS_FILTER_INPUT'); } else { $input = Input::except('_token'); } $searchString = isset($input['search']) ? $input['search'] : ''; $testStatusId = isset($input['test_status']) ? $input['test_status'] : ''; $dateFrom = isset($input['date_from']) ? $input['date_from'] : ''; $dateTo = isset($input['date_to']) ? $input['date_to'] : ''; // Search Conditions if ($searchString || $testStatusId || $dateFrom || $dateTo) { $tests = Test::search($searchString, $testStatusId, $dateFrom, $dateTo); if (count($tests) == 0) { Session::flash('message', trans('messages.empty-search')); } } else { // List all the active tests $tests = Test::orderBy('time_created', 'DESC'); } // Create Test Statuses array. Include a first entry for ALL $statuses = array('all') + TestStatus::all()->lists('name', 'id'); foreach ($statuses as $key => $value) { $statuses[$key] = trans("messages.{$value}"); } // Pagination $tests = $tests->paginate(Config::get('kblis.page-items'))->appends($input); // Load the view and pass it the tests return View::make('test.index')->with('testSet', $tests)->with('testStatus', $statuses)->withInput($input); }
public function createContract($loan_id) { // Find the profile of the person who's id matches the id of the person currently logged in. Find it in DB. $profile = UserProfile::where('id', '=', Auth::user()->id)->first(); try { $loan = LoanApp::findOrFail($loan_id); } catch (Exception $e) { return Redirect::route('mytransaction')->with('message', "Could not load loan: " . $e->getMessage()); } $lenders = $this->getLenders($loan_id); if (empty($lenders)) { return Redirect::route('mytransaction')->with('message', 'Could not find lenders for this loan request'); } $contract = Contract::firstOrCreate(array('offer_id' => Input::get('offer_id', $loan_id))); if ($contract->getAttribute('status') === 'complete') { return Redirect::to('previewContract/' . $loan_id); } // todo: set these using the form $contract->setAttribute('start_date', date('d/m/Y')); $contract->setAttribute('end_date', date('d/m/Y')); if (Request::isMethod('post')) { // Check if actually posting data. $save = $contract->fill(Input::all())->save(); $errors = Session::pull('messages', array()); if ($save === false && empty($errors)) { $errors[] = 'Failed to save contract'; } if (empty($errors)) { return Redirect::to('previewContract/' . $loan_id); } } $prepayment_rules = array("There are no penalties for paying off the loan early.", "Borrower must pay 5% of the original loan amount.", "Borrower must pay the complete interest of the loan.", "Borrower must pay \$100"); return View::make('createContract', compact('loan', 'lenders', 'profile', 'errors', 'contract', 'prepayment_rules')); }
public function getVerificar($id = NULL) { if ($id == NULL) { return Redirect::action('ErrorController@getWrongUrl'); } return View::make('verificar', array('action' => array('Empresa_EmpresaController@postVerificar', $id), 'message_ok' => Session::pull('message_ok'))); }
public function getMessages($message_key) { if (Session::has($message_key)) { return Session::pull($message_key); } return array(); }
public static function bodyScript() { if (\Config::get('mixpanel.token')) { echo '<script type="text/javascript">'; echo \Session::pull('mixpanel_body_script'); echo '</script>'; } }
private function registerSocialUser($input) { $username = (string) $input['username']; $email = (string) $input['email']; $password = (string) $input['password']; // Fetch user social data and destroy it at the same time $socialData = Session::pull('socialData', 'default'); // Save new user to DB $this->createNewUser($username, $email, $password, $socialData['provider'], $socialData['id'], $socialData['gender']); // Sign user if they signed up with a social network Auth::attempt(array('username' => $username, 'password' => $password)); // Create welcome message Session::flash('welcomeMessage', 'Welcome message/Tour message: Something here...'); return true; }
/** * 編集画面アクセスしたときのアクション * */ public function edit($id) { $data; if ($id == 0) { $data = ['id' => '', 'no' => '', 'hall' => '', 'legal' => '', 'machine' => '', 'app' => 1, 'new' => '', 'unit' => '', 'deli_oneday' => date('Y-m-d'), 'open_oneday' => date('Y-m-d'), 'collect_oneday' => date('Y-m-d'), 'bill_money' => '', 'user' => '', 'method' => 1, 'collect' => '', 'collect_day' => '', 'note' => '']; } else { $data = TblOlddirect::whereId($id)->first(); $data['note'] = $this->selectEscape($data['note']); $data['deli_oneday'] = $data['deli_oneday'] == "0000-00-00" ? '' : $data['deli_oneday']; $data['open_oneday'] = $data['open_oneday'] == "0000-00-00" ? '' : $data['open_oneday']; $data['collect_oneday'] = $data['collect_oneday'] == "0000-00-00" ? '' : $data['collect_oneday']; $data['collect_day'] = $data['collect_day'] == "0000-00-00" ? '' : $data['collect_day']; } Log::debug(print_r($data, true)); return View::make('main.edit.olddirect', compact('data'))->with('message', Session::pull('message', false)); }
function bs_footer($page_identification = "") { $scripts = [assets('js/app.min.js'), assets('lang/' . session('locale', config('app.locale')) . '/locale.js'), assets('js/general.js')]; if ($page_identification !== "") { $scripts[] = assets("js/{$page_identification}.js"); } foreach ($scripts as $script) { echo "<script type=\"text/javascript\" src=\"{$script}\"></script>"; } if (Session::has('msg')) { echo "<script>toastr.info('" . Session::pull('msg') . "');</script>"; } echo '<script>' . Option::get("custom_js") . '</script>'; $extra_contents = []; Event::fire(new App\Events\RenderingFooter($extra_contents)); echo implode(PHP_EOL, $extra_contents); }
/** * 編集画面アクセスしたときのアクション * */ public function edit($id) { $data; if ($id == 0) { $data = ['id' => '', 'c_s' => '1', 'class' => '1', 'no' => '---', 'day' => date('Y-m-d'), 'storage_day' => date('Y-m-d'), 'user' => '', 'bill_no' => '', 'serial_slot' => '', 'serial_case' => '', 'serial_basea' => '', 'machine' => '', 'note' => '', 'buy_legal' => '', 'buy_hall' => '', 'buy_money' => '', 'deli_money' => '', 'pay_day' => date('Y-m-d'), 'settle' => '', 'sell_legal' => '', 'sell_money' => '', 'deli_oneday' => date('Y-m-d'), 'deli_day' => '', 'delivery' => '0']; } else { $data = TblOldmanager::whereId($id)->first(); $data['note'] = $this->selectEscape($data['note']); $data['day'] = $data['day'] == "0000-00-00" ? '' : $data['day']; $data['storage_day'] = $data['storage_day'] == "0000-00-00" ? '' : $data['storage_day']; $data['pay_day'] = $data['pay_day'] == "0000-00-00" ? '' : $data['pay_day']; $data['deli_oneday'] = $data['deli_oneday'] == "0000-00-00" ? '' : $data['deli_oneday']; $data['deli_day'] = $data['deli_day'] == "0000-00-00" ? '' : $data['deli_day']; } Log::debug(print_r($data, true)); return View::make('main.edit.oldmanager', compact('data'))->with('message', Session::pull('message', false)); }
public function downloadTable($id, $year, $month) { $contents = "DATA ABSENSI BINA BAKTI\n\n"; $department = Department::find($id); $contents .= "Unit: ," . $department->name . "\n"; $months = MyDate::get_month_names(); $contents .= "Bulan: ," . $months[$month - 1] . "\n"; $contents .= "Tahun: ," . $year . "\n\n"; $contents .= "KODE,NAMA,NORMAL,,PULANG AWAL,,,TERLAMBAT,LUPA,TUGAS LUAR,,OTHER,TIDAK MASUK,,,JUMLAH HARI MASUK,,JUMLAH HARI TIDAK MASUK,NOMINAL UANG KONSUMSI\n"; $contents .= ",,WEEKDAY,WEEKEND,WEEKDAY < 12,WEEKDAY >= 12,WEEKEND,,,WEEKDAY,WEEKEND,,SAKIT,IZIN,ALPHA,WEEKDAY,WEEKEND,,WEEKDAY,WEEKEND,PULANG AWAL,TOTAL\n"; $employees = Employee::where('department_id', '=', $id)->orderBy('name')->get(); $total = 0; foreach ($employees as $employee) { $contents .= $employee->ssn . ","; $contents .= $employee->name . ","; $data = Session::pull($employee->id, 'default'); $total += $data['konsumsi_total']; $contents .= $data['normal_weekday'] . ","; $contents .= $data['normal_weekend'] . ","; $contents .= $data['pulang_awal_weekday_before_12'] . ","; $contents .= $data['pulang_awal_weekday'] . ","; $contents .= $data['pulang_awal_weekend'] . ","; $contents .= $data['terlambat'] . ","; $contents .= $data['lupa'] . ","; $contents .= $data['tugas_luar_weekday'] . ","; $contents .= $data['tugas_luar_weekend'] . ","; $contents .= $data['other'] . ","; $contents .= $data['sakit'] . ","; $contents .= $data['izin'] . ","; $contents .= $data['alpha'] . ","; $contents .= $data['masuk_weekday'] . ","; $contents .= $data['masuk_weekend'] . ","; $contents .= $data['tidak_masuk'] . ","; $contents .= $data['konsumsi_weekday'] . ","; $contents .= $data['konsumsi_weekend'] . ","; $contents .= $data['konsumsi_pulang_awal'] . ","; $contents .= $data['konsumsi_total'] . ","; $contents .= "\n"; } $contents .= ",,,,,,,,,,,,,,,,,,,,," . $total; // $file_name = "allowance.csv"; $file = public_path() . "/download/allowance.csv"; File::put($file, $contents); return Response::download($file, "allowance-" . strtolower($department->name) . "-" . $month . "-" . $year . ".csv", array('Content-Type' => 'text/csv', 'Content-Disposition' => 'attachment;')); }
public function onUserLogout($user) { if (\Session::has('kandyLiveChatUserInfo')) { \Session::pull('kandyLiveChatUserInfo'); } $kandyUser = KandyUsers::where('main_user_id', $user->id)->first(); //if login user is a chat agent if ($kandyUser) { $userLogin = KandyUserLogin::where('kandy_user_id', $kandyUser->user_id)->first(); if (!empty($userLogin) && $user->can('admin') == false) { $userLogin->status = Kandylaravel::USER_STATUS_OFFLINE; $userLogin->save(); } if (\Session::has('userAccessToken.' . $kandyUser->user_id)) { \Session::pull('userAccessToken.' . $kandyUser->user_id); } $kandyLaravel = new Kandylaravel(); $full_user_id = $kandyUser->main_user_id . '@' . $kandyUser->domain_name; $kandyLaravel->getLastSeen([$full_user_id]); } }
/** * Build a notification alert */ private static function prv_buildNotificationAlert($_type) { $strAlerts = ''; $alertClass = $_type == 'error' ? 'danger' : $_type; $alertIcon = self::$mNotificationIcons[$_type]; $messages = \Session::pull(self::$mSessionPrefix . '.' . $_type, array()); if (empty($messages)) { return ''; } else { if (count($messages) == 1) { $strAlerts = '<span class="title"><i class="fa fa-fw ' . $alertIcon . '"></i>' . trans('notifications.' . $_type) . '</span><p>' . $messages[0] . '</p>'; } else { $strAlerts = '<span class="title"><i class="fa fa-fw ' . $alertIcon . '"></i>' . trans('notifications.many_notifications') . '</span><p><ul>'; foreach ($messages as $message) { $strAlerts .= '<li>' . $message . '</li>'; } $strAlerts .= '</ul></p>'; } } return str_replace(array(':message', ':type'), array($strAlerts, $alertClass), self::$mNotificationFormat); }
public function postPartOfForm() { $inputs = Input::all(); $rulesset = array(); if (!array_key_exists('formularArt', $inputs) || !array_key_exists('step', $inputs)) { $errors = new \Illuminate\Support\MessageBag(['missingFields' => 'missing fields "formArt" and/or "step"']); Session::forget('formart'); return Response::json(['success' => false, 'errors' => $errors]); } $stepData = $inputs; unset($stepData['formularArt']); unset($stepData['step']); unset($stepData['undefined']); $step = str_replace('-', '', $inputs['step']); Session::put('formart', $inputs['formularArt']); try { $formular = Formular::find(DB::table('formulare')->where('name', $inputs['formularArt'])->first()->id)->firstOrfail(); } catch (Exception $e) { return Response::json(['success' => false, 'errors' => array($e->getMessage())]); } foreach (Formular::find(DB::table('formulare')->where('name', $inputs['formularArt'])->first()->id)->inputrules as $inputrule) { if (array_key_exists($inputrule->name, $inputs)) { $rules = []; foreach ($inputrule->rules as $rule) { $rules[] = $rule->rule; } $rulesset[$inputrule->name] = $rules; } } $v = Validator::make($inputs, $rulesset); if ($v->fails()) { return Response::json(['success' => false, 'errors' => $v->errors()->toArray()]); } $thisSession = Session::pull('sessionForm'); $thisSession[$step] = $stepData; Session::put('sessionForm', $thisSession); return Response::json(['success' => true]); }
/** * Store a newly created voucher in storage. * * @return Response */ public function store($booking_id) { $bookings = Session::pull('rate_box_details'); $vouchers = Voucher::arrangeHotelBookingsVoucherwise($bookings, $booking_id); foreach ($vouchers as $voucher) { $create_voucher = Voucher::create($voucher); for ($c = 0; $c < count($voucher) - 6; $c++) { $voucher[$c]['voucher_id'] = $create_voucher->id; $voucher[$c]['amount'] = $voucher[$c]['room_cost']; RoomBooking::create($voucher[$c]); } } Session::forget('add_new_voucher'); // Booking::where('id', $booking_id)->update('user_id', Auth::user()->id); // $validator = Validator::make($data = Input::all(), Voucher::$rules); // // if ($validator->fails()) // { // return Redirect::back()->withErrors($validator)->withInput(); // } // // Voucher::create($data); return Redirect::route('bookings.show', [$booking_id]); }
public static function init() { if (\Session::has('message') && \Session::get('message') != '') { $message = \Session::pull('message'); $onLoad = "new PNotify({"; if (!empty($message['title'])) { $onLoad .= "title:'" . $message['title'] . "',"; } if (!empty($message['message'])) { $onLoad .= "text:'" . $message['message'] . "',"; } if (!empty($message['type'])) { $onLoad .= "type:'" . $message['type'] . "',"; } if (!empty($message['icon'])) { $onLoad .= "icon:'" . $message['icon'] . "',"; } if (!empty($message['class'])) { $onLoad .= "addclass:'" . $message['class'] . "'"; } $onLoad .= "});"; view()->share("onLoad", $onLoad); } }
</div> <?php } ?> <form action="/feedback" method="POST"> <input type="hidden" name="_token" value="<?php echo csrf_token(); ?> "> <p>Напишите отзыв: </p> <div class="form-group"> <textarea required name="feedback_text" placeholder="Write something here" rows="10" cols="50"><?php if (Session::has('feedback_text')) { echo Session::pull('feedback_text'); } ?> </textarea> </div> <div class="form-group"> <a href="javascript:void(0)" onclick="captcha_reload()"><img src="<?php echo captcha_src(); ?> " name="captcha_img" alt="captcha"> </a> <input type="text" name="captcha"> </div> <input type="submit" name="auth" value="Отправить" class="btn btn-default"/> </form>
<?php Session::put('page', Request::url() . "?page=" . Input::get('page')); if (Session::has("page2")) { Session::pull("page2"); } $keyword = empty($keyword) ? "" : $keyword; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title> Network {{ $asset_name }} | Vault</title> @include('Includes.css_tb') @if(Session::get("user_type")=="Root") <script type="text/javascript"> function checkedAnId(){ var checkedAny = false; <?php foreach ($assets as $a) { ?> if(document.getElementById("<?php echo $a->id; ?> ").checked){ checkedAny=true; } <?php } ?>
/** * display message * @return string return the message inside div */ public static function message($sessionName = 'success') { $msg = Session::pull($sessionName); if (!empty($msg)) { return "<div class='alert alert-success alert-dismissable'>\n <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\n <h4><i class='fa fa-check'></i> " . $msg . "</h4>\n </div>"; } }
}); }); </script> @stop @section('module') <?php $status = Session::pull('status'); ?> <?php $tab = Session::pull('tab'); ?> <?php $registro = Session::pull('registro'); ?> <div class="row"> <ul id="myTab" class="nav nav-tabs"> <li class= @if($tab == 'tab1' or $tab == '') "active" @else "" @endif><a href="#empresa" data-toggle="tab"><h4><strong><i class="fa fa-home"></i> Empresa</strong></h4></a></li> <li class= @if($tab == 'tab2' or $registro=='edit_tab2') "active" @else "" @endif><a href="#plan" data-toggle="tab"><h4><strong><i class="fa fa-money"></i> Planes de pago</strong></h4></a></li> <li class= @if($tab == 'tab3' or $registro=='edit_tab3') "active" @else "" @endif><a href="#cupon" data-toggle="tab"><h4><strong><i class="fa fa-ticket"></i> Notas de Crédito</strong></h4></a></li> <li class= @if($tab == 'tab4' or $registro=='edit_tab4') "active" @else "" @endif><a href="#productos" data-toggle="tab"><h4><strong><i class="fa fa-cart-arrow-down"></i> Productos</strong></h4></a></li> </ul> <div id="myTabContent" class="tab-content"> <!-- ************contenido pestaña empresa *************** --> @include('sistemas.tabs.tab_empresa') <!-- ************contenido pestaña plan de pago ***********-->
.success(function(data){ $('#cliente').typeahead({ source: data, display: 'nombre', val: 'id', itemSelected: function(item){ $('#cliente').val(item); } }); }); </script> @stop @section('module') <?php $status = Session::pull('status'); ?> <div class="row"> <!-- widget plan pago --> <div class="col-md-6"> @if($status=='cupon_baja') <div class="alert alert-danger alert-dismissible" role="alert" align="center"> <strong><h4> Nota de crédito desactivada </h4></strong> </div> @endif @if($status=='cupon_alta') <div class="alert alert-warning alert-dismissible" role="alert" align="center"> <strong><h4> Nota de crédito activada </h4></strong>
public function storeAllData() { $data = Session::pull('MyBookingData'); if (Session::has('rate_box_details') || Session::has('transport_cart_box') || Session::has('predefined_transport') || Session::has('excursion_cart_details')) { if ($booking = Booking::create($data)) { $ehi_users = User::getEhiUsers(); if (Auth::check()) { //DB::table('booking_user')->insert(array('booking_id' => $booking->id, 'user_id' => $user->id)); if (Session::has('client-list')) { $clients = Session::pull('client-list'); foreach ($clients as $client) { $client['booking_id'] = $booking->id; $client['gender'] === 'male' ? $client['gender'] = 1 : ($client['gender'] = 0); Client::create($client); } } $flight_data = []; $flight_data['booking_id'] = $booking->id; $flight_data['date'] = $data['date_arrival']; $flight_data['time'] = $data['arrival_time']; $flight_data['flight'] = $data['arrival_flight']; $flight_data['flight_type'] = 1; FlightDetail::create($flight_data); //departure flight data $flight_data['date'] = $data['date_departure']; $flight_data['time'] = $data['departure_time']; $flight_data['flight'] = $data['departure_flight']; $flight_data['flight_type'] = 0; FlightDetail::create($flight_data); } /** * transport - custom trips */ $a = 0; if (Session::has('transport_cart_box')) { $custom_trips = Session::pull('transport_cart_box'); $a++; $x = 1; foreach ($custom_trips as $custom_trip) { $custom_trip['from'] = date('Y-m-d H:i', strtotime($custom_trip['pick_up_date'] . ' ' . $custom_trip['pick_up_time_hour'] . ':' . $custom_trip['pick_up_time_minutes'])); $custom_trip['to'] = date('Y-m-d H:i', strtotime($custom_trip['drop_off_date'] . ' ' . $custom_trip['drop_off_time_hour'] . ':' . $custom_trip['drop_off_time_minutes'])); $custom_trip['reference_number'] = 'TR' . ($booking->reference_number * 1000 + $x++); $custom_trip['booking_id'] = $booking->id; $custom_trip['locations'] = $custom_trip['destination_1'] . ',' . $custom_trip['destination_2'] or '' . ',' . $custom_trip['destination_3']; $custom_trip['amount'] = rand(100, 200); CustomTrip::create($custom_trip); } } /** * predefined package bookings */ if (Session::has('predefined_transport')) { $a++; $predefined_packages = Session::pull('predefined_transport'); foreach ($predefined_packages as $predefined_package) { $package = []; $package['transport_package_id'] = $predefined_package['predefine_id']; $package['booking_id'] = $booking->id; $package['pick_up_date_time'] = $predefined_package['check_in_date']; $package['amount'] = TransportPackage::find($predefined_package['predefine_id'])->rate; PredefinedTrip::create($package); } } /** * Send Transportation Email to All EHI users */ $pdf = PDF::loadView('emails/transport', array('booking' => $booking)); $pdf->save('public/temp-files/transport' . $booking->id . '.pdf'); // if ($a > 0) { // Mail::send('emails/transport-mail', array( // 'booking' => Booking::find($booking->id) // ), function ($message) use ($booking, $ehi_users) { // $message->attach('public/temp-files/transport.pdf') // ->subject('New Transfer : ' . $booking->reference_number) // ->from('*****@*****.**', 'SriLankaHotels.Travel') // ->bcc('*****@*****.**'); // if (!empty($ehi_users)) // foreach ($ehi_users as $ehi_user) { // $message->to($ehi_user->email, $ehi_user->first_name); // } // }); // } /** * Excursions */ if (Session::has('excursion_cart_details')) { $excursions = Session::pull('excursion_cart_details'); $x = 1; foreach ($excursions as $excursion) { $excursionBooking = ExcursionRate::with(array('city', 'excursion', 'excursionTransportType'))->where('city_id', $excursion['city_id'])->where('excursion_transport_type_id', $excursion['excursion_transport_type'])->where('excursion_id', $excursion['excursion'])->first(); $excursionBookingData = array('booking_id' => $booking->id, 'city_id' => $excursionBooking->city_id, 'excursion_transport_type_id' => $excursionBooking->excursion_transport_type_id, 'excursion_id' => $excursionBooking->excursion_id, 'unit_price' => $excursionBooking->rate, 'pax' => $excursion['excursion_pax'], 'date' => $excursion['excursion_date'], 'reference_number' => 'EX' . ($booking->reference_number * 1000 + $x++)); ExcursionBooking::create($excursionBookingData); } $pdf = PDF::loadView('emails/excursion', array('booking' => $booking)); $pdf->save('public/temp-files/excursions.pdf'); // Mail::send('emails/excursion-mail', array( // 'booking' => $booking // ), function ($message) use ($booking, $ehi_users) { // $message->attach('public/temp-files/excursions.pdf') // ->subject('New Excursions : ' . $booking->reference_number) // ->from('*****@*****.**', 'SriLankaHotels.Travel'); // // $message->to('*****@*****.**', 'Excursions'); // $message->bcc('*****@*****.**', 'Admin'); // if (!empty($ehi_users)) // foreach ($ehi_users as $ehi_user) { // $message->to($ehi_user->email, $ehi_user->first_name); // } // }); } /** * hotel bookings */ if (Session::has('rate_box_details')) { $bookings = Session::pull('rate_box_details'); $vouchers = Voucher::arrangeHotelBookingsVoucherwise($bookings, $booking->id); foreach ($vouchers as $voucher) { $created_voucher = Voucher::create($voucher); for ($c = 0; $c < count($voucher) - 6; $c++) { $voucher[$c]['voucher_id'] = $created_voucher->id; $RoomBooking = RoomBooking::create($voucher[$c]); } // voucher $pdf = PDF::loadView('emails/voucher', array('voucher' => $created_voucher)); $pdf->save('public/temp-files/voucher' . $created_voucher->id . '.pdf'); // $hotel_users = DB::table('users')->leftJoin('hotel_user', 'users.id', '=', 'hotel_user.user_id') // ->where('hotel_user.hotel_id', $created_voucher->hotel_id) // ->get(); // // Mail::send('emails/voucher-mail', array( // 'voucher' => Voucher::find($created_voucher->id) // ), function ($message) use ($booking, $hotel_users,$created_voucher) { // $message->attach('public/temp-files/voucher'.$created_voucher->id.'.pdf') // ->subject('Booking Voucher : ' . $booking->reference_number) // ->from('*****@*****.**', 'SriLankaHotels.Travel') // ->bcc('*****@*****.**', 'SriLankaHotels.Travel'); // if (!empty($hotel_users)) // foreach ($hotel_users as $hotel_user) { // $message->to($hotel_user->email, $hotel_user->first_name); // } // }); } } //Booking details // $pdf = PDF::loadView('emails/booking', array('booking' => $booking)); // $pdf->save('public/temp-files/booking'.$booking->id.'.pdf'); // $ehi_users = User::getEhiUsers(); // $emails = array('*****@*****.**', '*****@*****.**', '*****@*****.**'); // // Mail::send('emails/booking-mail', array( // 'booking' => Booking::getBookingData($booking->id) // ), function ($message) use ($booking, $emails, $ehi_users) { // $message->attach('public/temp-files/booking'.$booking->id.'.pdf') // ->subject('New Booking: ' . $booking->reference_number) // ->from('*****@*****.**', 'SriLankaHotels.Travel') // ->bcc('*****@*****.**', 'Admin'); // foreach ($emails as $emailaddress) { // $message->to($emailaddress, 'Admin'); // } // // if (!empty($ehi_users)) { // foreach ($ehi_users as $ehi_user) { // $message->to($ehi_user->email, $ehi_user->first_name); // } // } // }); Invoice::create(array('booking_id' => $booking->id, 'amount' => Booking::getTotalBookingAmount($booking), 'count' => 1)); //Invoice $pdf = PDF::loadView('emails/invoice', array('booking' => $booking)); $pdf->save('public/temp-files/invoice' . $booking->id . '.pdf'); $pdf = PDF::loadView('emails/service-voucher', array('booking' => $booking)); $pdf->save('public/temp-files/service-voucher.pdf'); // if ($user = $booking->user) { // Mail::send('emails/invoice-mail', array( // 'booking' => Booking::getBookingData($booking->id) // ), function ($message) use ($user, $booking, $emails) { // $message->subject('Booking Invoice : ' . $booking->reference_number) // ->attach('public/temp-files/invoice'.$booking->id.'.pdf'); // $message->to($user->email, $user->first_name . ' ' . $user->last_name); // $message->to('*****@*****.**', 'Accounts'); // if (!empty($ehi_users)) { // foreach ($ehi_users as $ehi_user) { // $message->to($ehi_user->email, $ehi_user->first_name); // } // } // // }); // // } else { // // Mail::send('emails/invoice-mail', array( // 'booking' => Booking::getBookingData($booking->id) // ), function ($message) use ($booking, $emails) { // $message->to($booking->email, $booking->name) // ->subject('Booking Created : ' . $booking->reference_number) // ->attach('public/temp-files/invoice'.$booking->id.'.pdf'); // $message->to('*****@*****.**', 'Accounts'); // if (!empty($ehi_users)) { // foreach ($ehi_users as $ehi_user) { // $message->to($ehi_user->email, $ehi_user->first_name); // } // } // }); // } if (!Auth::check()) { Session::flash('global', 'Emails have been sent to the Respective parties'); return View::make('pages.message'); } } return $booking; } else { return Redirect::back(); } return Redirect::route('bookings.index'); }
public function logout() { Session::pull("dropbox-token"); Session::pull("dropbox-name"); return Redirect::to("dropbox"); }
public function getRecuperaventa($folio) { $dataModule["status"] = 'add'; $dataModule["venta_error"] = Session::pull('venta_error'); $dataModule["inventarios"] = VistaInventarioRecubrimiento::where('activo', 1)->orderBy('material_color', 'desc')->get(); $dataModule["piezas"] = PiezaMarmoleria::where('activo', 1)->get(); $dataModule["material_error"] = Session::pull('material_error'); $dataModule["ventas"] = VentaMaterial::all(); $dataModule["venta_r"] = VentaMaterial::where('folio', '=', $folio)->firstorfail(); $dataModule["ventas_detalle"] = VistaDetalleVentaMaterial::all(); $dataModule["reposiciones"] = VistaReposiciones::all(); $dataModule["stocks"] = VistaStock::all(); $dataModule["hoy"] = Carbon::now(); return View::make($this->department . ".main", $this->data)->nest('child', 'recubrimientos.material_baja', $dataModule); }
| Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ use App\Ticket; Route::get('/', 'HelpDeskController@index'); //user stuff Route::post('search/search', 'HelpDeskController@searchTickets')->middleware('auth'); Route::get('ticket/submit/', 'HelpDeskController@getTicket')->middleware('auth'); Route::post('ticket/submit/', 'HelpDeskController@postTicket')->middleware('auth'); Route::get('ticket/{id}', 'HelpDeskController@showTicket')->middleware('auth'); Route::post('ticket/message/{ticketId}', 'HelpDeskController@postMessage')->middleware('auth'); Route::get('user/me', 'HelpDeskController@showUser')->middleware('auth'); Route::get('user/{id}', 'HelpDeskController@showUser'); //tech Route::get('tickets', 'HelpDeskController@showTickets'); //admin Route::post('/user/editRoles/{userId}', 'HelpDeskController@editRoles')->middleware('auth'); //signup & authentication routes Route::get('auth/login', 'Auth\\AuthController@getLogin'); Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('/loggedIn', function () { return Redirect::to(Session::pull('redirectTo', '/')); }); Route::get('auth/signup', 'Auth\\AuthController@getRegister'); Route::post('auth/signup', 'Auth\\AuthController@postRegister')->middleware('firstLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout');
public function getNuevo() { $dataModule['status'] = Session::pull('status', 'nuevo'); $dataModule['usuarios'] = Usuario::all(); $dataModule['user'] = Usuario::find(Auth::user()->id); $dataModule['departamentos'] = Departamento::all(); $dataModule['rol'] = Session::pull('rol', 'sistemas'); return View::make($this->department . ".main", $this->data)->nest('child', 'sistemas.perfil_usuario', $dataModule); }
public function getLogin() { $msg_ok = Session::pull('msg_ok'); $msg_wr = Session::pull('msg_wr'); $array_param = array('action' => array('Usuario_UsuarioController@postLogin')); if ($msg_ok != NULL) { $array_param['msg_ok'] = $msg_ok; } if ($msg_wr != NULL) { $array_param['msg_wr'] = $msg_wr; } $array_param['title'] = 'Usuarios'; return View::make('login')->with($array_param); }
public function postAgregarProducto() { $producto = Producto::find(Input::get('producto_id')); $cantidad = Input::get('cantidad'); $precio = precio::where('producto_id', $producto->id)->where('activo', 1)->first(); $productos = Session::pull('productos', array()); array_push($productos, array('producto_id' => $producto->id, 'precio' => $precio->monto, 'subtotal' => $cantidad * $precio->monto, 'descripcion' => $producto->nombre, 'cantidad' => $cantidad, 'porcentaje_comision' => $producto->porcentaje_comision)); Session::put('productos', $productos); return Response::json($productos); }
public function storeRepresentative($id) { $input = Input::all(); $rules = ['first_name' => 'required', 'last_name' => 'required', 'company_position' => 'required', 'contactInfo.email' => 'required|email']; $validator = Validator::make($input, $rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $contact = array_pull($input, 'contactInfo'); $numbers = array_pull($contact, 'number'); $numberTypes = array_pull($contact, 'number_type'); $representative = CustomerRepresentative::create($input); $customer = Customer::find($id); foreach ($numbers as $index => $number) { $contactNumbers[] = new ContactNumber(['number' => $number, 'type' => $numberTypes[$index]]); } $newContactInfo = ContactInfo::create($contact); $newContactInfo->contactNumbers()->saveMany($contactNumbers); $representative->contactInfo()->save($newContactInfo); $customer->representatives()->save($representative); if (Session::get('redirect_to_rfq_after_create')) { Session::pull('redirect_to_rfq_after_create'); return Redirect::route('quotations.create', ['customerId' => $customer->id]); } if (Session::get('redirect_to_rfq')) { $url = Session::pull('redirect_to_rfq'); return Redirect::to($url)->with('message', 'Successfully added representative')->with('alert-class', 'success'); } return Redirect::route('customers.edit', ['id' => $id])->with('message', 'Successfully added representative')->with('alert-class', 'success'); }
"> <span class="input-group-btn"> <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button> </span> </div> </form> </div> </div> </nav> <div id="page" class="container"> <?php if (Session::has('alert')) { ?> <div class="alert alert-danger"><?php echo e(Session::pull('alert')); ?> </div> <?php } ?> @yield('content') <div class="footer row"> <div class="col-md-8 about"> <p class="version"> <?php echo date('Y'); ?> © DestinyStatus v<?php