public function postCancelar()
 {
     //return Input::all();
     $this->response->Cancelar(Input::get('contratos'), Input::get('penaCapital'), Input::get('penaAccesorios'), Input::get('penaMoratorios'), Input::get('capital'));
     $cliente = DB::table('expediente')->where('id_expediente', Input::get('contratos'))->join('cliente', 'cliente.rfc', '=', 'expediente.fk_rfc')->select('cliente.nombre', 'cliente.ape_mate', 'cliente.ape_pate')->get()[0];
     $terreno = DB::table('expediente')->where('id_expediente', Input::get('contratos'))->join('solicitud', 'solicitud.fk_expediente', '=', 'expediente.id_expediente')->join('lote', 'lote.id_lote', '=', 'solicitud.fk_lote')->join('manzana', 'manzana.id_manzana', '=', 'lote.fk_manzana')->join('desarrollo', 'desarrollo.id_desarrollo', '=', 'manzana.fk_desarrollo')->select('lote.lote', 'manzana.num_letra', 'desarrollo.nombre')->get()[0];
     if (Input::get('capital') - Input::get('penaCapital') > 0) {
         $ImporteLiquido = Input::get('capital') - Input::get('penaCapital');
     } else {
         $ImporteLiquido = 0;
     }
     $PHPWord = new PHPWord();
     $document = $PHPWord->loadTemplate(dirname(__FILE__) . '/PHPWord/recibo_liquidacion.docx');
     $fecha = explode('-', date('Y-m-d'));
     $document->setValue('dia', $fecha[2]);
     $document->setValue('mes', $fecha[1]);
     $document->setValue('anio', $fecha[0]);
     $document->setValue('cantidadDevuelta', '$' . $ImporteLiquido);
     $document->setValue('expediente', Input::get('contratos'));
     $document->setValue('Terreno', $terreno->lote);
     $document->setValue('Manzana', $terreno->num_letra);
     $document->setValue('Fraccionamiento', $terreno->nombre);
     $document->setValue('Penalizacion', Input::get('penalizacionCapital') . '%');
     $document->setValue('PrecioVenta', '$' . Input::get('importeTotal'));
     $document->setValue('CapitalPagado', '$' . Input::get('capital'));
     $document->setValue('cantidadPenal', '$' . Input::get('penaCapital'));
     $document->setValue('ImporteLiquido', '$' . $ImporteLiquido);
     $document->setValue('Cliente', $cliente->nombre . " " . $cliente->ape_pate . " " . $cliente->ape_mate);
     $document->save(Input::get('contratos') . '_cancelacion.docx');
     return View::make('cobranza/mensajeCobranza')->with('datos', array('seccion' => 'SICyA | Cobranza | Cancealr Terreno', 'cabecera' => 'Cancelando Contrato', 'icono' => 'glyphicon glyphicon-file', 'tipo_mensaje' => true, 'mensaje' => "Se ha Cancelado el Contrato."));
 }
 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));
 }
Exemple #3
1
 /**
  *  get_show takes in a username, finds the user's id from the username, gets the information about the user from the 
  *	followers and critts table and outputs it into the others.profile view
  */
 public function action_show($username)
 {
     // we get the user's id that matches the username
     $user_id = User::where('username', '=', $username)->only('id');
     // declare some default values for variables
     $following = null;
     $followers = 0;
     // if the username is not found, display an error
     if ($user_id == null) {
         echo "This username does not exist.";
     } else {
         if (Auth::user()) {
             // if the user tries to go to his/her own profile, redirect to user's profile action.
             if ($user_id == Auth::user()->id) {
                 return Redirect::to_action('user@index');
             }
             // check if the current user is already following $username
             $following = Follower::where('user_id', '=', Auth::user()->id)->where('following_id', '=', $user_id)->get() ? true : false;
         }
         // eager load the critts with user data
         $allcritts = Critt::with('user')->where('user_id', '=', $user_id);
         // order the critts and split them in chunks of 10 per page
         $critts = $allcritts->order_by('created_at', 'desc')->paginate(10);
         // count the critts
         $critts_count = $allcritts->count();
         // count the followers
         $followers = Follower::where('following_id', '=', $user_id)->count();
         // bind data to the view
         return View::make('others.profile')->with('username', $username)->with('user_id', $user_id)->with('following', $following)->with('followers', $followers)->with('count', $critts_count)->with('critts', $critts);
     }
 }
 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 save () {

        $param = Input::all();

        $validator = Validator::make($param, [
            'site_title' => 'required',
            'meta_description' => 'required',
            'meta_keywords' => 'required',
            'email_support' => 'required|email',
            'count_pagination' => 'required'
        ]);

        if ( $validator->fails() ) {

            $output = '';

            $errors = $validator->messages()->toArray();

            foreach ($errors as $error) {
                $output .= $error[0] . '<br>';
            }

            return View::make('admin.elements.error')->with('errors', $output);

        }

        AppSettings::set('site_title', $param['site_title']);
        AppSettings::set('meta_description', $param['meta_description']);
        AppSettings::set('meta_keywords', $param['meta_keywords']);
        AppSettings::set('email_support', $param['email_support']);
        AppSettings::set('count_pagination', $param['count_pagination']);

        return Redirect::to(URL::previous());

    }
Exemple #6
0
 public function getIndex($location = '')
 {
     $loading_arr = Config::get('loading');
     $loading = $loading_arr[array_rand($loading_arr)];
     View::share('location', $location);
     $this->layout->content = View::make('index', compact('loading'));
 }
 public function render()
 {
     $this->loadFiles();
     $args = $this->arguments;
     $seq = $this->seq();
     // set default file upload options
     $fileuploadOptions = ['previewMaxWidth' => 280, 'previewMaxHeight' => 120, 'previewCrop' => false, 'autoUpload' => false, 'acceptFileTypes' => "(\\.|\\/)(.*)\$", 'maxFileSize' => 5000000, 'replaceFileInput' => false, 'disableImageResize' => true, 'imageCrop' => false, 'imageMaxWidth' => 480, 'imageMaxHeight' => 240];
     // set file
     if (isset($args['file'])) {
         $file = File::find($args['file']);
         if ($file === null) {
             unset($args['file']);
         } else {
             $filename = $file->clientname;
             $args['file'] = $filename;
         }
     }
     // resolve arguments
     $fileuploadOptions = array_merge($fileuploadOptions, array_get($args, 'fileuploadOptions', []));
     $args = array_add($args, 'width', 420);
     $args = array_add($args, 'height', 240);
     array_set($fileuploadOptions, 'previewMaxWidth', $args['width']);
     array_set($fileuploadOptions, 'previewMaxHeight', $args['height']);
     $types = array_get($args, 'types');
     if ($types !== null) {
         array_set($fileuploadOptions, 'acceptFileTypes', '(\\.|\\/)(' . implode('|', (array) $types) . ')$');
     }
     array_set($args, 'fileuploadOptions', $fileuploadOptions);
     // render template
     $this->template = \View::make($this->view, ['args' => $args, 'seq' => $seq])->render();
     return parent::render();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($id)
 {
     $site = Site::find($id);
     $users = User::all();
     $data = array('page' => 'sites', 'tab' => 'access', 'site' => $site, 'users' => $users);
     return View::make('site_user.index', $data);
 }
 public function getReset($token = null)
 {
     if (is_null($token)) {
         App::abort(404);
     }
     return View::make('password.reset')->with('token', $token);
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     //
     $newId = User::generateId();
     return View::make('user.new', ['id' => $newId]);
 }
 /**
  * Display a listing of products on the wishlist.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $wishlist = $this->wishlist;
     $items = $this->wishlist->items();
     $total = $this->wishlist->total();
     return View::make('cart.wishlist', compact('wishlist', 'items', 'total'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $receipt = Receipt::find($id);
     $suppliers = Supplier::all()->lists('name', 'id');
     $commodities = Commodity::all()->lists('name', 'id');
     return View::make('receipt.edit')->with('receipt', $receipt)->with('commodities', $commodities)->with('suppliers', $suppliers);
 }
 public function imprimeRenta($datos)
 {
     $vista = \View::make('pdf.renta', compact('datos'))->render();
     $pdf = \App::make('dompdf.wrapper');
     $pdf->loadHTML($vista);
     return $pdf->download('renta.pdf');
 }
 public function show($name)
 {
     if (\Auth::check() && \Auth::user()->permission->name == 'admin') {
         if (is_numeric($name)) {
             $dl = Downloads::where('id', '=', $name)->where('trash', '=', '0')->first();
             if (is_null($dl)) {
                 return \Redirect::to('404');
             }
             return \View::make('downloads.show')->with('entry', $dl);
         } else {
             $dl = Downloads::where('name', '=', $name)->where('trash', '=', '0')->first();
             if (is_null($dl)) {
                 return \Redirect::to('404');
             }
             return \View::make('downloads.show')->with('entry', $dl);
         }
     } else {
         if (is_numeric($name)) {
             $dl = Downloads::where('id', '=', $name)->where('trash', '=', '0')->where('state', '=', '1')->first();
             if (is_null($dl)) {
                 return \Redirect::to('404');
             }
             return \View::make('downloads.show')->with('entry', $dl);
         } else {
             $dl = Downloads::where('name', '=', $name)->where('trash', '=', '0')->where('state', '=', '1')->first();
             if (is_null($dl)) {
                 return \Redirect::to('404');
             }
             return \View::make('downloads.show')->with('entry', $dl);
         }
     }
 }
 public function getTaskListHtml($filter_str, $done_num)
 {
     $recent_done_num = $done_num;
     $tasks = $this->getTasks($filter_str, $done_num);
     $layout = Session::get('layout', 'default');
     return View::make('tasks.layouts.' . $layout, compact('tasks', 'recent_done_num'))->render();
 }
 public function getProfile($id)
 {
     DB::setFetchMode(PDO::FETCH_ASSOC);
     $member = DB::table('members')->where('members.id', '=', $id)->leftjoin('region', 'members.region_id', '=', 'region.id')->leftjoin('city', 'members.city_id', '=', 'city.id')->select(DB::raw('members.id, members.user_id, members.avatar_url, members.avatar_url_big, members.name, members.surname,members.rep, city.name as city_name, region.name as region_name, city.id as city_id, region.id as region_id'))->get();
     //echo "<pre>";
     //var_dump($regions);
     //echo "</pre>";
     //die();
     if (!empty($member)) {
         $member = $member[0];
         $member['ajax_url'] = action('ProfileController@postCities');
         $member['all_regions'] = DB::table('region')->get();
         $member['regions_cities'] = DB::table('city')->where('region_id', '=', $member['region_id'])->get();
         if (Auth::check()) {
             if ($member['user_id'] === Auth::user()->id) {
                 if (Auth::user()->vk_id != 0) {
                     $member['is_vk'] = true;
                 } else {
                     $member['is_vk'] = false;
                 }
                 return View::make('profile-edit', $member);
             }
         } else {
             return View::make('profile', $member);
         }
     }
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (!Auth::guest()) {
         return redirect()->to('account/' . \Auth::id());
     }
     return \View::make('session.create');
 }
Exemple #18
0
 /**
  * Display the tab
  *
  * @param array $data The data to inject in the view
  *
  * @return string The generated HTML
  */
 public static function make($data)
 {
     if (is_array($data['page']) && isset($data['page']['content'])) {
         $data['page'] = $data['page']['content'];
     }
     return parent::make(Theme::getSelected()->getView('tabs-layout/tabs-no-sidebar.tpl'), $data);
 }
Exemple #19
0
 public function getIndex()
 {
     $title = 'Search';
     $company_results = Company::select('companies.*', 'c.name as country', 'a.city as city')->join('adresses as a', 'companies.address_id', '=', 'a.id')->join('countries as c', 'a.country_id', '=', 'c.id')->orderBy('companies.id', 'DESC')->take(5)->get();
     $company_data = [];
     foreach ($company_results as $curr_company) {
         $curr_company = (object) ['DT_RowId' => $curr_company->id, 'name' => $curr_company->name, 'references' => $curr_company->references, 'country' => $curr_company->country, 'city' => $curr_company->city];
         $curr_entry = (object) $curr_company;
         $company_data[] = $curr_entry;
     }
     $company_init = json_encode(['data' => $company_data]);
     $venue_results = Venue::select('venues.*', 'c.name as country', 'a.city as city')->join('adresses as a', 'venues.address_id', '=', 'a.id')->join('countries as c', 'a.country_id', '=', 'c.id')->orderBy('venues.id', 'DESC')->take(5)->get();
     $venue_data = [];
     foreach ($venue_results as $curr_venue) {
         $curr_venue = (object) ['DT_RowId' => $curr_venue->id, 'name' => $curr_venue->name, 'capacity' => $curr_venue->capacity, 'rigging_capacity' => $curr_venue->rigging_capacity, 'country' => $curr_venue->country, 'city' => $curr_venue->city];
         $curr_entry = (object) $curr_venue;
         $venue_data[] = $curr_entry;
     }
     $venue_init = json_encode(['data' => $venue_data]);
     $contact_results = Contact::select('contacts.*', 'c.name as country')->join('adresses as a', 'contacts.address_id', '=', 'a.id')->join('countries as c', 'a.country_id', '=', 'c.id')->orderBy('contacts.id', 'DESC')->take(5)->get();
     $contact_data = [];
     foreach ($contact_results as $curr_contact) {
         $curr_contact = (object) ['DT_RowId' => $curr_contact->id, 'first_name' => $curr_contact->first_name, 'last_name' => $curr_contact->last_name, 'country' => $curr_contact->country, 'function' => $curr_contact->function];
         $curr_entry = (object) $curr_contact;
         $contact_data[] = $curr_entry;
     }
     $contact_init = json_encode(['data' => $contact_data]);
     return View::make('site/' . $this->name . '/index', compact('title', 'company_init', 'venue_init', 'contact_init'));
 }
 public function showParent()
 {
     $data = array();
     $loginid = Session::get('user')->id;
     $collegeid = Session::get('user')->collegeid;
     $flag = Session::get('user')->flag;
     $tb = "";
     if ($flag == 1) {
         $tb = "Admin";
     } else {
         if ($flag == 2) {
             $tb = "Teacher";
         } else {
             if ($flag == 3) {
                 $tb = "Student";
             } else {
                 $tb = "Staff";
             }
         }
     }
     $dt = $tb::where('loginid', '=', $loginid)->first();
     $data['name'] = $dt->name;
     $data['pic'] = $dt->profilepic;
     $data['id'] = $loginid;
     $colid = Session::get('user')->collegeid;
     //$colid = "bt123";
     $classes = Classes::where('collegeid', '=', $colid)->get();
     $data['class'] = [];
     $i = 0;
     for ($i = 0; $i < sizeof($classes); $i++) {
         $data['class'][$i]['id'] = $classes[$i]->id;
         $data['class'][$i]['name'] = $classes[$i]->classname;
     }
     return View::make('pages.parent', array('data' => $data, 'flag' => $flag));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::check()) {
         return Redirect::to('admin/panelAdmin');
     }
     return View::make('admin/login');
 }
 public function getComplete()
 {
     $comp = Orders::where('status', '=', 'sent')->orderBy('orderNum', 'DESC')->get();
     $num = Orders::where('status', '=', 'sent')->groupBy('orderNum')->orderBy('orderNum', 'DESC')->get();
     //$page = Paginator::make($num, count($num), 1);
     return View::make('Supplier.complete')->with('orders', $comp)->with('nums', $num);
 }
Exemple #23
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $user = $this->userService->getCurrentUser();
     $stocks = $this->stockRepo->getStockList($user->id);
     $templates = $this->templateRepo->getAll();
     return \View::make('stocks.index', compact('stocks', 'templates'));
 }
 public function show()
 {
     //TODO: Not yet implemented
     /* Check if the Welcome one is not deleted */
     //$userId = Auth::user()->id;
     //$welcomeNote = Note::with(
     //    array(
     /*'users' => function($query) {
           $query->where('id', '=', Auth::user()->id);
       },*/
     /*        'version' => function($query) {
                         $query->whereNull('previous_id');
                     }
                 )
             )->join('note_user', function($join) use(&$userId) {
                 $join->on('notes.id', '=', 'note_user.note_id')->where('note_user.user_id', '=', $userId);
             })
             ->orderBy('notes.created_at')
             ->whereNull('notes.deleted_at')
             ->first();
                 
             if(is_null($welcomeNote)) {
                 $welcomeNoteArray = array('welcomeNoteSaved' => 0);
             }else{
                 if($welcomeNote->version->title === Lang::get('notebooks.welcome_note_title')) {
                     $welcomeNoteArray = array('welcomeNoteSaved' => 1);
                 }else{
                     $welcomeNoteArray = array('welcomeNoteSaved' => 0);
                 }
             }*/
     return View::make('main');
     //return View::make('main', $welcomeNoteArray);
 }
 public function create()
 {
     $academicdegrees = Academicdegree::all();
     $localizationController = new LocalizationController();
     $localizations_depts = $localizationController->getDepartments();
     return View::make('registro', compact('academicdegrees', 'localizations_depts'));
 }
 public function showContact()
 {
     //Create the view
     $this->layout->content = View::make('contact.content');
     $headerData = array('title' => isset($this->metaData['contact_title']) ? $this->metaData['contact_title'] : null, 'description' => isset($this->metaData['contact_desc']) ? $this->metaData['contact_desc'] : null);
     $this->layout->header = View::make('includes.header', $headerData);
 }
 public function show($hashId)
 {
     $id = \Jamesy\Miscellaneous::decryptId($hashId);
     if ($email = Email::find($id)) {
     }
     return View::make('backend.emails.send_templates.main', ['email_body' => $email->email_body]);
 }
 public function showForm()
 {
     if ($blog = Input::get('blog')) {
         return Redirect::to('/' . $blog);
     }
     $this->layout->content = View::make('main');
 }
 public function index()
 {
     $arrType = [];
     $arrMenu = Menu::getCache(['active' => 0]);
     if (!empty($arrMenu)) {
         foreach ($arrMenu as $type => $html) {
             if (strpos($type, '-') !== false) {
                 unset($arrMenu[$type]);
                 list($type, $subType) = explode('-', $type);
                 $arrMenu[$type][$subType] = '<ol class="dd-list">' . $html . '</ol>';
                 $arrType[] = $subType;
             } else {
                 $arrMenu[$type] = '<ol class="dd-list">' . $html . '</ol>';
                 $arrType[] = $type;
             }
         }
         arsort($arrMenu);
     } else {
         $arrMenu = [];
     }
     $arrParent = Menu::getCache(['parent' => true]);
     $admin = Auth::admin()->get();
     $permission = new Permission();
     $arrPermission = ['frontend' => ['view' => $permission->can($admin, 'menusfrontend_view_all'), 'create' => $permission->can($admin, 'menusfrontend_create_all'), 'edit' => $permission->can($admin, 'menusfrontend_edit_all'), 'delete' => $permission->can($admin, 'menusfrontend_delete_all')], 'backend' => ['view' => $permission->can($admin, 'menusbackend_view_all'), 'create' => $permission->can($admin, 'menusbackend_create_all'), 'edit' => $permission->can($admin, 'menusbackend_edit_all'), 'delete' => $permission->can($admin, 'menusbackend_delete_all')]];
     $this->layout->title = 'Menu';
     $this->layout->content = View::make('admin.menus-all')->with(['arrMenu' => $arrMenu, 'arrParent' => $arrParent, 'arrType' => $arrType, 'arrPermission' => $arrPermission]);
 }
 public function fim()
 {
     $nomeColecao = Session::get('nome-colecao');
     Colecao::setNomeColecaoAtual($nomeColecao);
     $data = IndiceInvertido::parametros('fim');
     return View::make('template.empty', $data);
 }