示例#1
0
 public function Post(\Model\Post\ModelName $post)
 {
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     return view('Front::post.post', ['post' => $post, 'categories' => $categories, 'mainBanner' => $mainBanner]);
 }
示例#2
0
 public function project(\Model\Project\ModelName $project)
 {
     $projectList = \Model\Project\ModelName::get();
     $MediaCategories = \Model\MediaCategory\ModelName::get();
     $mediaAll = \Model\Media\ModelName::get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::media.project', ['project' => $project, 'MediaCategories' => $MediaCategories, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain]);
 }
示例#3
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('madaniyat')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('madaniyat', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     $lc = app()->getlocale();
     if ($lc == 'kg') {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('name', '<>', '')->get();
     } else {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('nameRu', '<>', '')->get();
     }
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('madaniyat', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.madaniyat.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage, 'madaniyatProjects' => $madaniyatProjects]);
 }
示例#4
0
 public function filterResultCategory(Request $request)
 {
     $category_id = $request->category;
     $category = \Model\Category\ModelName::where('id', '=', $category_id)->first();
     $lc = app()->getlocale();
     $df = $request->dateFrom;
     $dt = $request->dateTo;
     $dateFrom = date('Y-m-d', strtotime($df));
     $dateTo = date('Y-m-d', strtotime($dt));
     $perPage = 10;
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     if ($lc == 'kg' and $df != '' and $dt != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datefromkg($df)->datetokg($dt)->orderBy('id', 'desc')->paginate($perPage);
     } elseif ($lc == 'kg' and $df != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datefromkg($df)->orderBy('id', 'desc')->paginate($perPage);
     } elseif ($lc == 'kg' and $dt != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datetokg($dt)->orderBy('id', 'desc')->paginate($perPage);
     } elseif ($lc == 'ru' and $df != '' and $dt != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datefromru($df)->datetoru($dt)->orderBy('id', 'desc')->paginate($perPage);
     } elseif ($lc == 'ru' and $df != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datefromru($df)->orderBy('id', 'desc')->paginate($perPage);
     } elseif ($lc == 'ru' and $dt != '') {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->datetoru($dt)->orderBy('id', 'desc')->paginate($perPage);
     } else {
         $postAllFromTo = \Model\Post\ModelName::published()->where('category_id', '=', $category_id)->orderBy('id', 'desc')->paginate($perPage);
     }
     return view('Front::category.index', ['perPage' => $perPage, 'category' => $category, 'posts' => $postAllFromTo, 'categories' => $categories, 'backgroundMain' => $backgroundMain]);
 }
示例#5
0
 public function Contacts()
 {
     $lc = app()->getlocale();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::pages.contacts', ['lc' => $lc, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Background $background)
 {
     $background->delete();
     return redirect()->route('admin.background.index');
 }
示例#7
0
 public function broadcastsprogramm()
 {
     $channel = \Model\Channel\ModelName::name('birinchi')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.birinchi.broadcastsprogramm', ['channel' => $channel, 'backgroundMain' => $backgroundMain]);
 }
示例#8
0
 public function gallery()
 {
     $channel = \Model\Channel\ModelName::name('minkiyal')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.minkiyal.gallery', ['channel' => $channel, 'backgroundMain' => $backgroundMain]);
 }
示例#9
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('dostuk', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get();
     return view('Front::channel.dostuk.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery, 'dostukProjects' => $dostukProjects]);
 }
示例#10
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('balastan')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('balastan', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('balastan', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.balastan.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage]);
 }
示例#11
0
 public function ReporterAdd(Request $request)
 {
     $lc = app()->getlocale();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $reporter = \Model\PeopleReporter\ModelName::create($request->except('images', 'video', 'q'));
     $images = $request->file('images');
     $rules = array('image' => 'image');
     $result = array();
     if ($request->hasFile('images')) {
         foreach ($images as $key => $image) {
             $target = array('image' => $image);
             $validator = Validator::make($target, $rules);
             if ($validator->fails()) {
                 return redirect()->route('front.reporter');
             } else {
                 $storage = \Storage::disk('public');
                 $destinationPath = 'froala/uploads';
                 $storage->makeDirectory($destinationPath);
                 $filename = time() . $key . '.' . $image->getClientOriginalExtension();
                 Image::make($_FILES['images']['tmp_name'][$key])->heighten(600)->save($destinationPath . '/' . $filename);
                 $files_array = array();
                 $files_array = array_collapse([$files_array, ['id' => $key + 1, 'name' => $filename]]);
                 $result = array_add($result, $key, $files_array);
                 $jsonresult = json_encode($result);
                 $reporter->thumbnail = $jsonresult;
                 $reporter->save();
             }
         }
     }
     $video = $request->file('video');
     $video_rules = array('video' => 'mimes:mimes:m4v,avi,flv,mp4,mov,3gp | max:51200');
     if ($request->hasFile('video')) {
         $targetVideo = array('video' => $video);
         $validator = Validator::make($targetVideo, $video_rules);
         if ($validator->fails()) {
             return redirect()->route('front.reporter');
         } else {
             $storage = \Storage::disk('public');
             $destinationPath = 'froala/videos';
             $storage->makeDirectory($destinationPath);
             $filename = time() . '.' . $video->getClientOriginalExtension();
             $video->move($destinationPath, $filename);
             $reporter->video = $filename;
             $reporter->save();
         }
     }
     return redirect()->route('front.reporter');
 }
示例#12
0
 public function allVideos()
 {
     $projectList = \Model\Project\ModelName::where('extracolumn', '=', '1')->orderBy('id', 'desc')->get();
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $perPage = 15;
     $allVideos = \Model\Media\ModelName::where('published', '=', true)->orderBy('id', 'desc')->paginate($perPage);
     return view('Front::media.all', ['perPage' => $perPage, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain, 'allVideos' => $allVideos, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
示例#13
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function historyPage()
 {
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::pages.history', ['backgroundMain' => $backgroundMain]);
 }
示例#14
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('kyrgyzradio', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.kyrgyzradio.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery]);
 }
示例#15
0
 public function mediaPage(\Model\Media\ModelName $media)
 {
     /*$mediaPost = \Model\Media\ModelName::where('id','=',$media);
       dd($mediaPost);*/
     $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first();
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::media.index', ['mediaPost' => $media, 'mainBanner' => $mainBanner, 'categories' => $categories, 'backgroundMain' => $backgroundMain]);
 }
示例#16
0
 public function Home()
 {
     $channel = \Model\Channel\ModelName::name('madaniyat')->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.madaniyat.index', ['channel' => $channel, 'backgroundMain' => $backgroundMain]);
 }
示例#17
0
 public function teleprogram(Request $request)
 {
     $channel = \Model\Channel\ModelName::where('name', '=', 'muzkanal')->first();
     $lc = app()->getlocale();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     date_default_timezone_set('Asia/Bishkek');
     $now = date("d-m-Y H:i");
     $currentDate = date('d-m-Y');
     $currentTime = date('H:i');
     $weekDay = date('N', strtotime($now));
     if ($channel) {
         $schedules = \Model\Schedule\ModelName::where('channel_id', '=', $channel->id)->orderBy('date', 'desc')->get();
         for ($i = 1; $i <= 7; $i++) {
             if ($i < $weekDay) {
                 $weekDayNew = date('d-m-Y', strtotime('-' . ($weekDay - $i) . ' day'));
                 $week[] = $weekDayNew;
             } elseif ($i > $weekDay) {
                 $weekDayNew = date('d-m-Y', strtotime('+' . ($i - $weekDay) . ' day'));
                 $week[] = $weekDayNew;
             } else {
                 $weekDayNew = date('d-m-Y', strtotime($now));
                 $week[] = $weekDayNew;
             }
         }
         if (!empty($schedules)) {
             $programs = array();
             foreach ($schedules as $schedule) {
                 $scheduleWeek = date('N', strtotime($schedule->date));
                 for ($j = 0; $j < count($week); $j++) {
                     if (strtotime($week[$j]) == strtotime($schedule->date)) {
                         $program = json_decode($schedule->program);
                         $programNew = array_add($program, 'date', $schedule->date);
                         $programs[] = $programNew;
                     }
                 }
             }
             $programs = array_reverse($programs);
         }
     }
     //        dd($programs);
     return view('Front::channel.muzkanal.teleprogram', ['lc' => $lc, 'currentDate' => $currentDate, 'currentTime' => $currentTime, 'backgroundMain' => $backgroundMain, 'schedules' => $schedules, 'programs' => $programs, 'week' => $week]);
 }
示例#18
0
 public function editionkeneshPage()
 {
     $categories = \Model\Category\ModelName::all();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::pages.editionkenesh', ['backgroundMain' => $backgroundMain, 'categories' => $categories]);
 }