Exemplo n.º 1
0
 public function index()
 {
     if (CNF_FRONT == 'false' && Request::segment(1) == '') {
         return Redirect::to('dashboard');
     }
     if (is_null(Input::get('p'))) {
         $page = Request::segment(1);
     } else {
         $page = Input::get('p');
     }
     if ($page != '') {
         $content = Pages::where('alias', '=', $page)->where('status', '=', 'enable');
         if ($content->count() >= 1) {
             $content = $content->get();
             $row = $content[0];
             $this->data['pageTitle'] = $row->title;
             $this->data['pageNote'] = $row->note;
             $this->data['breadcrumb'] = 'active';
             if ($row->access != '') {
                 $access = json_decode($row->access, true);
             } else {
                 $access = array();
             }
             // If guest not allowed
             if ($row->allow_guest != 1) {
                 $group_id = Session::get('gid');
                 $isValid = isset($access[$group_id]) && $access[$group_id] == 1 ? 1 : 0;
                 if ($isValid == 0) {
                     return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
                 }
             }
             if ($row->template == 'backend') {
                 $this->layout = View::make("layouts.main");
             }
             $filename = public_path() . "protected/app/views/pages/template/" . $row->filename . ".blade.php";
             if (file_exists($filename)) {
                 $page = 'pages.template.' . $row->filename;
             } else {
                 return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_noexists')));
             }
         } else {
             return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_noexists')));
         }
     } else {
         $this->data['pageTitle'] = 'Home';
         $this->data['pageNote'] = 'Welcome To Our Site';
         $this->data['breadcrumb'] = 'inactive';
         $page = 'pages.template.home';
     }
     $page = SiteHelpers::renderHtml($page);
     $this->layout->nest('content', $page, $this->data)->with('menus', $this->menus)->with('page', $this->data);
 }
	<div class="col-md-9">
	 @foreach ($rowData as $row)
		<div class="blog-post">
			<div class="post-item">
				<div class="title"><h3><a href="{{ URL::to('blog/read/'.$row->slug)}}"> {{ $row->title }} </a></h3></div>
				<div class="blog-info-small">
					<i class="fa fa-folder icon-muted"></i> <span>  <a href="{{ URL::to('blog/category/'.$row->alias)}}">{{ $row->name}}</a>  </span> 
					<i class="fa fa-user icon-muted"></i> <span> {{ $row->username }} </span>  
					<i class="fa fa-calendar"></i> <span> {{ date("M j, Y " , strtotime($row->created)) }} </span> 
					<i class="fa fa-comments"></i> <span> <a href="{{ URL::to('blog/read/'.$row->slug.'#comments')}}"> {{ $row->comments }} comments</a> </span> 
				</div>	
				<div class="summary">
				
				<?php 
$content = explode("<hr />", $row->content);
echo SiteHelpers::renderHtml($content[0]);
?>
					<a href="{{ URL::to('blog/read/'.$row->slug)}}" class="btn btn-success btn-sm"> Read More <i class="fa fa-angle-right"></i></a>
				</div>
			</div>	
			
		</div>	
	 @endforeach
	 
	   <div class="col-sm-3">
		<p class="text-center" style="line-height:30px;">
		{{ Lang::get('core.grid_displaying') }} :  <b>{{ $pagination->getFrom() }}</b> 
		{{ Lang::get('core.grid_to') }} <b>{{ $pagination->getTo() }}</b> 
		{{ Lang::get('core.grid_of') }} <b>{{ $pagination->getTotal() }}</b>
		</p>
	   </div>
 public function contactus()
 {
     $input = array("name" => '', "phone" => '', "email" => '', "content" => '', "subject" => '');
     if (Session::has('input_rd')) {
         $input = Session::get('input_rd');
     }
     $data['input'] = $input;
     $page = 'pages.template.contactus';
     $this->data['pageTitle'] = 'Contact US';
     $this->data['pageNote'] = 'Welcome To Our Site';
     $page = SiteHelpers::renderHtml($page);
     $this->layout->nest('content', $page, $data)->with('page', $this->data);
 }