home
/
zktecojo
/
public_html
/
app
/
controllers
➕ New
📤 Upload
✎ Editing:
ContentController.php
← Back
<?php class ContentController extends BaseController { protected $layout = 'layouts.frontend.master'; private $myresult=array(); public function __construct(){ parent::__construct(); } public function index($alias,$subalias=''){ $this->data['currentPageAlias'] = $alias; $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=',$alias) ->where('pages.page_status','=',1) ->first(); $this->data['seo_title']= $this->data['pageContent']->page_meta_title; $this->data['seo_description']= $this->data['pageContent']->page_meta_description; $this->data['seo_keyword']= $this->data['pageContent']->page_meta_keyword; if(empty($this->data['pageContent'])){ return App::make('HomeController')->callAction('errorpage',$this->data); } $id=$this->data['pageContent']->page_id; $this->data['innerContent'] = DB::table('inner_content') ->where('ic_menu_id','=',$id) ->where('ic_status','=',1) ->orderBy('ic_priority','asc') ->get(); if($this->data['pageContent']->page_layout==2){ $parentId=array(); $parray=array(); $parentId=$this->get_all_child_menu($id); $parray[]=$id; if(!empty($parray)){ foreach( $parentId as $pId ){ foreach( $pId as $list ){ $parray[]=$list->page_id; } } $this->data['productlist']=DB::table('products as p') ->leftJoin('product_gallery as pg',function($join) { $join->on('pg.pg_product_id', '=', 'p.product_id') ->where('pg.pg_base_image', '=',1); }) ->whereIn('p.product_cat_id',$parray) ->orderBy('p.product_priority','desc') ->get(); //echo '<pre>';print_r($this->data['productlist']);exit(); }else{ $this->data['productlist']=''; } } if($this->data['pageContent']->show_submenu_in_page==1){ $this->data['clientList'] = DB::table('gallery_images') ->where('gallery_image_type','=',2) ->where('gallery_image_status','=',1) ->get(); } if($this->data['pageContent']->page_layout==3){ $this->data['newsList'] = DB::table('news') ->where('news_status','=',1) ->orderBy('news_priority','desc') ->get(); } if($this->data['pageContent']->page_layout==5){ $this->data['teamList'] = DB::table('team') ->where('team_status','=',1) ->orderBy('team_priority','asc') ->get(); } /*if($this->data['pageContent']->page_layout==4){ $downListArray=array(); $this->data['menuDownloadTree']; $downList= DB::table('product_pdf_download as ppd') ->join('products as p','p.product_id','=','ppd.ppd_product_id') ->where('ppd.ppd_status','=',1) ->get(); foreach($this->data['menuDownloadTree'] as $mlist){ $mpagename = ($this->data['lang']=='ar')? $mlist->page_name_arabic : $mlist->page_name; $mpagename .= "_".$mlist->page_slug ; foreach($downList as $dlist){ if($mlist->page_id ==$dlist->ppd_category_name){ $downListArray[$mpagename][]=$dlist; } } } $this->data['dlistArray']=$downListArray; } */ if($this->data['pageContent']->page_layout==4){ $downListArray=array(); $this->data['menuDownloadTree']; $downList= DB::table('product_pdf_download as ppd') ->join('products as p','p.product_id','=','ppd.ppd_product_id') //->join('download_subcategory as ds','ds.ds_id','=','ppd.ppd_subcategory_id') ->where('ppd.ppd_status','=',1) ->get(); $subcatList= DB::table('download_subcategory') ->where('ds_status','=',1) ->orderBy('ds_category_id','asc') ->get(); // echo '<pre>';print_r($subcatList); exit; foreach($this->data['menuDownloadTree'] as $mlist){ $mpagename = ($this->data['lang']=='ar')? $mlist->page_name_arabic : $mlist->page_name; $mpagename .= "_".$mlist->page_slug ; foreach($downList as $dlist){ $subcat= DB::table('download_subcategory') ->where('ds_id','=',$dlist->ppd_subcategory_id) ->first(); if($mlist->page_id ==$dlist->ppd_category_name){ if(!empty($subcat)){ $subcatName = ($this->data['lang']=='ar')? $subcat->ds_name_ar : $subcat->ds_name; if($dlist->ppd_subcategory_id==$subcat->ds_id){ $downListArray[$mpagename][$subcatName][]=$dlist; }else{ $downListArray[$mpagename]['no'][]=$dlist; } }else{ $downListArray[$mpagename]['no'][]=$dlist; } } } } // echo '<pre>';print_r($downListArray); exit; $this->data['dlistArray']=$downListArray; } if(empty($this->data['pageContent'])){ return App::make('HomeController')->callAction('errorpage',$this->data); } //current menu alias $this->data['sub_current_menu'] = $alias; //Most top level parent details $topParentAlias = $this->get_top_parent($alias); $topParentMenu= $this->get_top_parent_sidebar($alias); $this->data['current_parent_menu'] = $topParentMenu; //nearest parent details for opening up selected submenu $this->data['nearestParent'] = $this->get_nearest_parent($alias); $this->data['subMenuList'] = $this->get_sub_menu($topParentAlias); $this->data['subDivisions'] = $this->get_sub_menu($alias); // dd($this->data['subDivisions']); $this->create_breadcrumbs(); /* echo '<pre>'; print_r($this->data['subMenus']); exit(); */ $this->data['pageTitle'] .= $this->data['pageContent']->page_name; $this->data['pageSubTitle'] = $this->data['pageContent']->page_subtitle; $this->data['homePageNews'] = DB::table('news') ->where('news_status','=',1) ->orderBy('news_publish_date','desc') ->get(); $page = ''; // $this->data['pageContent']->page_layout; switch($this->data['pageContent']->page_layout){ case 1: $page = 'frontend.design_layout.default' ; break; case 2: $page = 'frontend.design_layout.product_layout' ; break; case 3: $page = 'frontend.design_layout.news' ; break; case 4: $page = 'frontend.design_layout.download' ; break; case 5: $page = 'frontend.design_layout.team' ; break; default: $page = 'frontend.design_layout.default' ; break; } switch($alias){ case 'careers': $page="frontend.design_layout.career"; $this->data['careerList']= DB::table('career_med') ->where('cm_status','=',1) ->orderBy('cm_priority','asc') ->get(); break; case 'events': $page="frontend.design_layout.events"; $this->data['eventList']= DB::table('articles') ->where('articles_status','=',1) ->orderBy('articles_priority','desc') ->get(); break; case 'newsletter': $page="frontend.design_layout.news-letter"; $this->data['newsletterList']= DB::table('news_letter') ->where('nl_status','=',1) ->orderBy('nl_priority','desc') ->get(); break; case 'faq': $page="frontend.design_layout.faq"; $this->data['faqList']= DB::table('faq as f') ->where('f.faq_status','=',1) ->get(); $this->data['catList']= DB::table('pdf_category') ->where('pc_cat_flag','=',2) ->get(); $result=array(); foreach($this->data['catList'] as $list){ $pcname = ($this->data['lang']=='ar')? $list->pc_name_arabic : $list->pc_name; foreach($this->data['faqList'] as $clist){ if($list->pc_id ==$clist->faq_category ){ $result[$pcname][]=$clist; } } } //echo '<pre>';print_r($result);exit; $this->data['faqCatList']= $result; break; /* foreach($this->data['menuDownloadTree'] as list){ } */ case 'training': $page="frontend.design_layout.training-video"; $this->data['videoList'] = DB::table('training_video') ->where('vg_status','=',1) ->orderBy('vg_date','desc') ->get(); break; case 'contact-us': $page ="frontend.design_layout.contact"; $this->data['locList'] = DB::table('location') ->where('location_status','=',1) ->orderBy('location_priority','desc') ->get(); break; case 'enquiry': $page ="frontend.design_layout.enquiry"; if(Input::get('submitE')){ //echo "<pre>";print_r($_POST); exit(); // $rules = array('captchacode'=>array('required','captcha')); $validator = Validator::make( array( 'name'=>Input::get('name'), 'email'=>Input::get('email'), 'phone'=>Input::get('phone'), 'companyName'=>Input::get('companyName'), 'message'=>Input::get('fmsg'), ), array( 'name'=>array('required'), 'email'=>array('required','email'), 'phone'=>array('required'), 'companyName'=>array('required'), 'message'=>array('required'), ) ); if($validator->fails()){ // $this->data['errorMessage'] = $validator->messages(); Input::flash(); $messages = $validator->messages(); $this->data['errorMessage'] = ''; foreach($messages->all() as $message){ $this->data['errorMessage'] .= "<span class='errormsg' style='color:red;'>".$message."</span><br/>"; } // $returnData = array('status'=>'fail','registerinfo'=>$errorMessage); }else{ $data = array( 'name' => Input::get('name') ." ".Input::get('lname'), 'email'=> Input::get('email'), 'phone'=> Input::get('phone'), 'companyName'=>Input::get('companyName'), 'usermessage'=> Input::get('fmsg'), ); $settings = array( 'from'=>Input::get('email'), 'to'=>$this->data['websiteSettings']->enquiry_send_email, 'cc'=>['Volta.deng@zkteco.com','Mohd_94@hotmail.com','ray.zeng@zkteco.com'], 'subject'=>'New Contact Request', 'phone'=>Input::get('phone'), 'usermessage'=>Input::get('fmsg') ); $this->send_mail($settings,$data); $this->data['errorMessage'] = '<span class="success green">Message sent successfully. We will contact you back.<span>'; } } break; case 'online-support': $page ="frontend.design_layout.online_support"; if(Input::get('submitO')){ //echo "<pre>";print_r($_POST); exit(); // $rules = array('captchacode'=>array('required','captcha')); $validator = Validator::make( array( 'name'=>Input::get('name'), 'email'=>Input::get('email'), 'phone'=>Input::get('phone'), 'companyName'=>Input::get('companyName'), 'message'=>Input::get('fmsg'), ), array( 'name'=>array('required'), 'email'=>array('required','email'), 'phone'=>array('required'), 'companyName'=>array('required'), 'message'=>array('required'), ) ); if($validator->fails()){ // $this->data['errorMessage'] = $validator->messages(); Input::flash(); $messages = $validator->messages(); $this->data['errorMessage'] = ''; foreach($messages->all() as $message){ $this->data['errorMessage'] .= "<span class='errormsg' style='color:red;'>".$message."</span><br/>"; } // $returnData = array('status'=>'fail','registerinfo'=>$errorMessage); }else{ $data = array( 'name' => Input::get('name') ." ".Input::get('lname'), 'email'=> Input::get('email'), 'phone'=> Input::get('phone'), 'companyName'=>Input::get('companyName'), 'usermessage'=> Input::get('fmsg'), ); $settings = array( 'from'=>Input::get('email'), 'to'=>$this->data['websiteSettings']->enquiry_send_email, 'subject'=>'New Contact Request', 'phone'=>Input::get('phone'), 'usermessage'=>Input::get('fmsg') ); $this->send_mail($settings,$data); $this->data['errorMessage'] = '<span class="success green">Message sent successfully. We will contact you back.<span>'; } } break; default:break; } if(Request::ajax()){ $temp = explode('.',$page); $newTemp= array(); for($i=0,$j=count($temp);$i<$j;$i++){ $newTemp[] = ($i==1)?'ajax_'.$temp[$i]:$temp[$i]; } $page = implode('.',$newTemp); // $this->data['pagename']=$topParentMenu; } return View::make($page,$this->data); } public function get_all_child_menu($parentId=''){ if(!empty($parentId)){ $result=DB::table('pages')->select('page_id') ->where('page_parent_id','=',$parentId) ->get(); //print_r($result);exit; //print_r($result);exit; if(!empty($result)){ $this->myresult[] = $result; foreach($result as $list){ $this->get_all_child_menu($list->page_id); } } return $this->myresult; } } public function category_image_gallery($alias){ $this->data['categoryList'] = DB::table('gallery_images AS GI') ->select(DB::raw('DISTINCT CI.category_name,CI.category_id, CI.category_slug')) ->join('category_master AS CI','CI.category_id','=','GI.gallery_cat_id') ->where('gallery_image_type','=',1) ->orderBy(DB::raw('GI.gallery_cat_id'),'ASC') ->get(); $this->data['currentImageCategory'] = $alias; $this->data['currentImageGallery'] = DB::table('gallery_images AS GI ') -> select(DB::raw('GI.*,CI.category_name')) ->join('category_master AS CI','CI.category_id','=','GI.gallery_cat_id') ->where('gallery_image_type','=',1) ->where('CI.category_slug','=',$alias) ->orderBy(DB::raw('GI.gallery_cat_id'),'DESC') ->get(); return View::make('frontend.image_gallery',$this->data); } public function show_life_details($alias){ $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=','life-at-fng') ->where('pages.page_status','=',1) ->first(); //current menu alias $this->data['sub_current_menu'] = $alias; //Most top level parent details $topParentAlias = $this->get_top_parent($alias); $topParentMenu= $this->get_top_parent_sidebar($alias); $this->data['current_parent_menu'] = $topParentMenu; $this->data['current_parent_menu'] = $topParentAlias; //nearest parent details for opening up selected submenu $this->data['nearestParent'] = $this->get_nearest_parent($alias); // $this->get_sub_menu($topParentAlias); $this->create_breadcrumbs(); $this->data['fngLifeList']= DB::table('news') ->where('news_status','=',1) ->orderBy('news_priority','asc') ->where('news_type','=',2) ->get(); $this->data['currentLife'] = DB::table('news') ->where('news_status','=',1) ->where('news_alias','=',$alias) ->where('news_type','=',2) ->first(); return View::make('frontend.life_at_fng',$this->data); } public function news($alias=''){ //echo $_GET['page']; exit(); $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'News Section'; $this->data['current_parent_menu'] = 'news_section_cc'; $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=','news') ->where('pages.page_status','=',1) ->first(); $this->data['currentNews'] = DB::table('news') ->where('news_status','=',1) ->where('news_type','=',1) ->where('news_alias',$alias) ->first(); $this->data['current_menu'] = null; $sideAlias=$this->data['pageContent']->page_slug; //current menu alias $this->data['sub_current_menu'] = $sideAlias; $this->data['currentPageAlias'] = $sideAlias; //Most top level parent details $topParentAlias = $this->get_top_parent($sideAlias); $topParentMenu= $this->get_top_parent_sidebar($sideAlias); $this->data['current_parent_menu'] = $topParentMenu; //nearest parent details for opening up selected submenu $this->data['nearestParent'] = $this->get_nearest_parent($sideAlias); $this->data['subMenuList'] = $this->get_sub_menu($topParentAlias); $this->data['subDivisions'] = $this->get_sub_menu($sideAlias); if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } return View::make('frontend.news_details',$this->data); } public function events_details($alias=''){ //echo $_GET['page']; exit(); $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'Events Section'; $this->data['current_parent_menu'] = 'events_section_cc'; $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=','events') ->where('pages.page_status','=',1) ->first(); $this->data['currentNews'] = DB::table('articles') ->where('articles_status','=',1) ->where('articles_alias',$alias) ->first(); $this->data['current_menu'] = null; $sideAlias=$this->data['pageContent']->page_slug; //current menu alias $this->data['sub_current_menu'] = $sideAlias; $this->data['currentPageAlias'] = $sideAlias; //Most top level parent details $topParentAlias = $this->get_top_parent($sideAlias); $topParentMenu= $this->get_top_parent_sidebar($sideAlias); $this->data['current_parent_menu'] = $topParentMenu; //nearest parent details for opening up selected submenu $this->data['nearestParent'] = $this->get_nearest_parent($sideAlias); $this->data['subMenuList'] = $this->get_sub_menu($topParentAlias); $this->data['subDivisions'] = $this->get_sub_menu($sideAlias); if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } return View::make('frontend.events_details',$this->data); } public function pdf($alias=''){ $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'pdf Download'; $this->data['current_parent_menu'] = 'pdf Download'; $this->data['pdfList'] = DB::table('pdf_download') ->where('status','=',1) ->orderBy('pdf_priority','asc') ->get(); if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } $this->data['pageTitle'] = 'Download pdf'; return View::make('frontend.download_pdf',$this->data); } public function product_details($pagetitle='',$alias=''){ //echo $_GET['page']; exit(); $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'News Section'; $this->data['current_parent_menu'] = ''; $this->data['productCollection'] = DB::table('pages as pg') ->join('products as p','p.product_cat_id','=','pg.page_id') ->where('p.product_alias','=',$alias) ->first(); if(empty($this->data['productCollection'])){ return App::make('HomeController')->callAction('errorpage',$this->data); } $productId=$this->data['productCollection']->product_id; $this->data['productpack'] = DB::table('product_packages') ->where('pp_product_id','=',$productId) ->get(); $this->data['productGal'] = DB::table('product_gallery') ->where('pg_product_id','=',$productId) ->get(); $this->data['productDownload'] = DB::table('product_pdf_download as PPD') ->join('pages as PG','PG.page_id','=','PPD.ppd_category_name' ) ->where('PPD.ppd_product_id','=',$productId) ->get(); $related = DB::table('product_related as PR') ->where('PR.pr_product_id', '=',$productId) ->get(); if(!empty($related)){ foreach($related as $pId){ $relProducts[]= DB::table('products as p') ->leftJoin('product_gallery as pg',function($join) { $join->on('pg.pg_product_id', '=', 'p.product_id') ->where('pg.pg_base_image', '=',1); }) ->where('product_id', '=',$pId->pr_relate_id) ->first(); } //echo '<pre>';print_r($relProducts);exit; $this->data['relatedProducts']=$relProducts; } /* $this->data['relatedProducts']= DB::table('products as p') ->leftJoin('product_related as PR','PR.pr_product_id','=','p.product_id') ->leftJoin('product_gallery as pg',function($join) { $join->on('pg.pg_product_id', '=', 'p.product_id') ->where('pg.pg_base_image', '=',1); }) ->where('PR.pr_product_id', '=',$productId) ->get(); */ //echo '<pre>';dd(DB::getQueryLog()); $sideAlias=$this->data['productCollection']->page_slug; $this->data['currentPageAlias'] = $sideAlias; //current menu alias $this->data['sub_current_menu'] = $sideAlias; //Most top level parent details $topParentAlias = $this->get_top_parent($sideAlias); $topParentMenu= $this->get_top_parent_sidebar($sideAlias); $this->data['current_parent_menu'] = $topParentMenu; //nearest parent details for opening up selected submenu $this->data['nearestParent'] = $this->get_nearest_parent($sideAlias); $this->data['subMenuList'] = $this->get_sub_menu($topParentAlias); $this->data['subDivisions'] = $this->get_sub_menu($sideAlias); // dd($this->data['subDivisions']); $this->create_breadcrumbs(); $this->data['current_menu'] = null; if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } return View::make('frontend.product_details',$this->data); } public function articles($alias=''){ // echo $_GET['page']; exit(); $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'Article Details'; $this->data['current_parent_menu'] = 'article'; $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=','articles') ->where('pages.page_status','=',1) ->first(); $this->data['currentArticle'] = DB::table('articles') ->where('articles_status','=',1) ->where('articles_alias',$alias) ->first(); if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } $this->data['pageTitle'] = $this->data['currentArticle']->articles_title; return View::make('frontend.articles_details',$this->data); } public function technical_resourse(){ echo 'ssss'; exit(); } public function careers($alias=''){ // echo $_GET['page']; exit(); $this->data['current_menu'] = null; $this->data['pageTitle'] .= 'Career Details'; $this->data['current_parent_menu'] = 'career'; $this->data['pageContent'] = DB::table('pages') // ->join('menus','menus.menu_id','=','pages.page_menu_id') ->where('pages.page_slug','=','careers') ->where('pages.page_status','=',1) ->first(); $this->data['currentCareer'] = DB::table('career_med') ->where('cm_status','=',1) ->where('cm_alias',$alias) ->first(); if(!empty($_GET['page'])){ $this->data['currentPageNum'] = $_GET['page']; } $this->data['pageTitle'] = $this->data['currentCareer']->cm_name; return View::make('frontend.career_details',$this->data); } public function site_search(){ if(Input::get('searchterm')){ $term = Input::get('searchterm'); /**/ $searchPage = DB::table('pages') ->select('page_name AS name', 'page_name_arabic AS name_ar','page_large_desc AS desciption','page_large_desc_arabic AS desciption_ar','page_slug AS slug',DB::raw('"1" as type')) ->where('page_status','=',1) ->where('page_large_desc','like','%'.$term.'%') ->orWhere('page_large_desc_arabic','like','%'.$term.'%'); /* $this->data['searchResults'] = DB::table('products') ->select('product_title AS name', 'product_title_arabic AS name_ar','product_short_content AS desciption','product_short_content_arabic AS desciption_ar','product_alias AS slug',DB::raw('"2" as type')) ->where('product_status','=',1) ->where('product_title','like','%'.$term.'%') ->orWhere('product_short_content','like','%'.$term.'%') ->orWhere('product_overview','like','%'.$term.'%') ->orWhere('product_specification','like','%'.$term.'%') ->union($searchPage) ->get(); */ $search = DB::table('products') ->select('product_title AS name', 'product_title_arabic AS name_ar','product_short_content AS desciption','product_short_content_arabic AS desciption_ar','product_alias AS slug',DB::raw('"2" as type')) ->where('product_status','=',1) ; $termsArr = explode(" ",trim($term)); if(!empty($termsArr)){ foreach( $termsArr as $trms){ $search = $search->where('product_short_content','like','%'.$trms.'%') ->orWhere('product_overview','like','%'.$trms.'%') ->orWhere('product_specification','like','%'.$trms.'%'); } } $search = $search->where('product_short_content','like','%'.$term.'%') ->orWhere('product_overview','like','%'.$term.'%') ->orWhere('product_specification','like','%'.$term.'%'); $this->data['searchResults']=$search->union($searchPage)->get(); $this->data['searchTerm'] = Input::get('searchterm'); } //print_r($this->data['searchTerm']);exit; $this->data['pageTitle'] .= 'Search'; $this->data['pageSubTitle'] = 'Search Results'; return View::make('frontend.search_result',$this->data); } public function company_brochure_request(){ if(!Request::ajax()){ return Redirect::to('/'); } $validator = Validator::make( array( 'name' => Input::get( 'name' ), 'email' => Input::get( 'email' ), 'phone' => Input::get( 'phone' ), 'company_name' => Input::get( 'company_name' ), 'project_name' => Input::get( 'project_name' ), 'no_of_hard_copies' => Input::get( 'no_of_hard_copies' ), ), array( 'name' => array( 'required' ), 'email' => array( 'required','email' ), 'phone' => array( 'required' ), 'project_name' => array( 'required' ), 'no_of_hard_copies' => array( 'required','numeric' ), 'company_name' => array( 'required' ), ) ); $response = array('status'=>false,'message'=>''); if($validator->fails()){ $response['status']= false; $messages = $validator->messages(); $this->data['errorMessage'] = ''; foreach($messages->all() as $message){ $response['message'] .= "<span class='errormsg' style='color:red;'>".$message."</span><br/>"; } }else{ $response['status']= true; $data = array( 'name' => Input::get('name'), 'email'=> Input::get('email'), 'phone'=> Input::get('phone'), 'project_name'=> Input::get('project_name'), 'no_of_hard_copies'=> Input::get('no_of_hard_copies'), 'company_name'=> Input::get('company_name'), 'request_justification'=> Input::get('request_justification'), ); $settings = array( 'from'=>Input::get('email'), 'to'=>$this->data['websiteSettings']->enquiry_send_email, 'subject'=>'Company Brochure Request', // 'phone'=>Input::get('phone'), // 'request_justification'=>Input::get('request_justification') ); $this->send_mail($settings,$data,null,'email_template.brochure_request'); $response['message'] = '<span class="success green">Request sent successfully. We will contact you back soon.<span>'; } return Response::json($response); } /* public function force_download($fileName){ // Session::forget('downloadFormData'); /* switch ($parsed_url['extension']) { case "ics": $ctype="text/calendar"; break; case "pdf": $ctype = "application/pdf"; break; case "exe": $ctype = "application/octet-stream"; break; case "zip": $ctype = "application/zip"; break; case "doc": $ctype = "application/msword"; break; case "xls": $ctype = "application/vnd.ms-excel"; break; case "ppt": $ctype = "application/vnd.ms-powerpoint"; break; case "gif": $ctype = "image/gif"; break; case "png": $ctype = "image/png"; break; case "jpeg": case "jpg": $ctype = "image/jpg"; break; default: $ctype = "application/force-download"; } header("Content-Type: $ctype"); header("Content-Disposition: attachment; filename=\"" . $parsed_url['filename'] . "\";"); header("Content-Transfer-Encoding: binary"); header('Accept-Ranges: bytes'); header("Cache-control: private"); header('Pragma: private'); $fNme=Input::get('pr'); $this->data['details'] = Session::get('downloadFormData'); if(empty($this->data['details'])){ return Redirect::to('/download'); }else{ $this->data['details']['location'] = $fileName; if(!empty($fNme)){ $this->data['details']['fileName'] = $fNme; Mail::send('frontend.emails.contactus',$this->data['details'], function($message){ $message->from(trim($this->data['details']['email']),trim($this->data['details']['name'])) ->to($this->data['websiteSettings']->enquiry_send_email) ->subject('New Download Request'); }); //======== Auto Reply mail ======= Mail::send('frontend.emails.contactusautoreply',$this->data['details'], function($message){ $message->from('info@zkteco.me','zkteco website') ->to(trim($this->data['details']['email']),trim($this->data['details']['name'])) ->subject('Thank You For downloading '); }); } } $nArray=explode('.',$fileName); $fiName=preg_replace('/[^a-zA-Z0-9_ %\[\]\.\(\)%&-]/s', '', $this->data['details']['fileName']); $customName=$fiName.'.'.$nArray[1]; if (File::exists('assets/uploads/products/pdf/'.$fileName)){ return Response::download('assets/uploads/products/pdf/'.$fileName,$customName); }else{ die('no dow'); } }*/ //public function force_download($fileName){ public function force_download($fileID){ if(!empty($fileID)){ $pdfone = DB::table('product_pdf_download') ->where('ppd_id','=',$fileID) ->first(); if(!empty($pdfone)){ $fileName=$pdfone->ppd_pdf_name; $customName=$pdfone->ppd_label; $nArray=explode('.',$fileName); $fiName=preg_replace('/[^a-zA-Z0-9_ %\[\]\.\(\)%&-]/s', '', $customName); $customName=$fiName.'.'.$nArray[1]; if (File::exists('assets/uploads/products/pdf/'.$fileName)){ return Response::download('assets/uploads/products/pdf/'.$fileName,$customName); }else{ die('no downlod request'); } } } } }
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel