コード例 #1
0
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->site = Site::all()->first();
     View::share('site', $this->site);
     /*$this->middleware('guest');*/
     $this->middleware('auth');
 }
コード例 #2
0
ファイル: FillMissed.php プロジェクト: botlax/ttcattendance
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     //check if have entry for today
     //check if locked
     //if good kaliwali
     //else populate with zeroes
     //then lock
     if (Attendance::latest('att_date')->first()->att_date != Carbon::today()) {
         $currentDate = new Attendance();
         $currentDate->att_date = Carbon::today();
         $holiday = 0;
         if (Carbon::today()->format('l') == 'Friday' || Holiday::where('holidate', Carbon::today())->first() != null) {
             $holiday = 1;
         }
         $currentDate->holiday = $holiday;
         $currentDate->save();
     }
     foreach (Site::all() as $site) {
         foreach ($site->labor as $labor) {
             if ($labor->attendance()->where('att_date', Carbon::today()->format('Y-m-d G:i:s'))->first() != null) {
                 $labor->attendance()->where('att_date', Carbon::today()->format('Y-m-d G:i:s'))->first()->pivot->update(['locked' => 'true']);
             } else {
                 Attendance::latest('att_date')->first()->labor()->attach($labor->id);
                 $att = $labor->attendance()->where('att_date', Carbon::today()->format('Y-m-d G:i:s'))->first();
                 $att->pivot->locked = 'true';
                 $att->pivot->attended = $att->holiday == 1 ? 1 : 0;
                 $att->pivot->ot = 0;
                 $att->pivot->bot = 0;
                 $att->pivot->site = $labor->site->code;
                 $att->pivot->save();
             }
         }
     }
 }
コード例 #3
0
ファイル: SiteController.php プロジェクト: AshishXhrestha/goe
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $sites = Site::all();
     $data = json_encode(array('sites' => $sites));
     return $data;
 }
コード例 #4
0
 /**
  * Create a new password controller instance.
  *
  * @param  \Illuminate\Contracts\Auth\Guard  $auth
  * @param  \Illuminate\Contracts\Auth\PasswordBroker  $passwords
  * @return void
  */
 public function __construct(Guard $auth, PasswordBroker $passwords)
 {
     $this->auth = $auth;
     $this->passwords = $passwords;
     View::share(array('site' => Site::all()->first()));
     $this->middleware('guest');
 }
コード例 #5
0
ファイル: PagesController.php プロジェクト: chalatz/eduapp2
 public function statitics()
 {
     $sites = Site::all();
     $cats = Category::all();
     $districts = District::all();
     $cats_total = 0;
     foreach ($cats as $cat_id => $cat_name) {
         $cats_total += Site::where('cat_id', '=', $cat_id)->count();
     }
     return view('pages.statitics', compact(['sites', 'cats', 'districts', 'cats_total']));
 }
コード例 #6
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     try {
         $statusCode = 200;
         $response = ['sites' => Site::all()->toArray()];
     } catch (Exception $e) {
         $statusCode = 400;
         $response = [];
コード例 #7
0
ファイル: CrawlProcess.php プロジェクト: SimZal/laracrawl
 public function pageToCrawl()
 {
     $webpage = Webpage::orderBy('crawlcount', 'ASC')->limit(1)->first();
     if ($webpage) {
         $url = $webpage->url;
         $siteId = $webpage->site_id;
     } else {
         $site = Site::all()->random();
         $url = $site->url;
         $siteId = $site->id;
     }
     return compact('url', 'siteId');
 }
コード例 #8
0
 public static function getAllSites()
 {
     if (Cache::has('site-list')) {
         return Cache::get('site-list');
     }
     $site_list = Site::all(['url']);
     $site_array = [];
     // Make sure we're only returning the hostname
     foreach ($site_list as $site) {
         $site_array[] = $site->url;
     }
     Cache::put('site-list', $site_array, 15);
     return $site_array;
 }
コード例 #9
0
ファイル: SiteController.php プロジェクト: 7keys/qtools
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sites = Site::all();
     return View('home.site.index', ['bread' => '我的站点', 'sites' => $sites]);
 }
コード例 #10
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $labor = Labor::where('employee_no', '=', $id)->first();
     $trades = Trade::all()->lists('name', 'id')->toArray();
     $sites = Site::all()->lists('code', 'id')->toArray();
     //dd($trades);
     return view('pages.edit_labor', compact('labor', 'sites', 'trades'));
 }
コード例 #11
0
ファイル: SiteController.php プロジェクト: SimZal/laracrawl
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $sites = Site::all();
     return view('site.index', compact('sites'));
 }
コード例 #12
0
 /**
  * Create a new controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     $this->site = Site::all()->first();
     View::share('site', $this->site);
 }
コード例 #13
0
 public function getList()
 {
     $sites = Site::all();
     $universites = Universite::all();
     return view('backoffice.sites', compact("sites", "universites"));
 }
コード例 #14
0
ファイル: UserController.php プロジェクト: jasonb8293/fox-api
 protected function syncUserSites(User $user)
 {
     if ($this->adLDAP->user()->inGroup($user->username, 'Fox_Staff')) {
         $role = 1;
     }
     if ($this->adLDAP->user()->inGroup($user->username, 'Fox_Student')) {
         $role = 2;
     }
     if ($role) {
         $sites = $user->sites()->get()->lists('id')->all();
         $adSites = [];
         foreach (\App\Site::all() as $uSite) {
             if ($this->adLDAP->user()->inGroup($user->username, 'Fox_' . strtoupper($uSite->slug))) {
                 array_push($adSites, $uSite->id);
             }
         }
         foreach ($adSites as $adSite) {
             if (!in_array($adSite, $sites)) {
                 $this->addSiteUser($user->id, $adSite, $role);
             }
         }
         foreach ($sites as $uSite) {
             if (!in_array($uSite, $adSites)) {
                 $this->removeSiteUser($user->id, $adSite, $role);
             }
         }
     }
 }
コード例 #15
0
ファイル: DataController.php プロジェクト: bluemath/waterapp
 public function sites()
 {
     $sites = Site::all();
     return view('data.sites', compact('sites'));
 }
コード例 #16
0
 public function getSelectOptions()
 {
     $field = \Input::get('field');
     if ($field == 'site') {
         $response = Site::all()->lists('code', 'code')->toArray();
     } else {
         $response = [1 => "YES", 0 => "NO"];
     }
     echo json_encode($response);
 }
コード例 #17
0
 public function handleEditSiteinfo()
 {
     $rules = array('title' => 'required', 'logo' => 'mimes:jpeg,bmp,png', 'terms_conditions' => 'required');
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return Redirect::action('CommonController@editSiteinfo')->withErrors($validator)->withInput();
     } else {
         $site = Site::all()->first();
         if ($site == null) {
             $site = new Site();
         }
         $site->title = Input::get('title');
         $logo_val = Input::file('logo');
         if (!empty($logo_val)) {
             $extension = Input::file('logo')->getClientOriginalExtension();
             $imageName = 'logo.' . $extension;
             Input::file('logo')->move(base_path() . '/public/uploads/site/', $imageName);
             $site->logo = $imageName;
         }
         $site->terms_conditions = html_entity_decode(Input::get('terms_conditions'));
         $site->save();
         return Redirect::action('CommonController@admincontrol');
     }
 }
コード例 #18
0
ファイル: SitesController.php プロジェクト: Dimimo/Booklet
 /**
  * Search all businesses
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function search()
 {
     $sites = Site::all()->sortBy(['name']);
     $categories = SiteCategory::all()->sortBy(['name']);
     return view('sites.search', compact('sites', 'categories'));
 }
コード例 #19
0
ファイル: routes.php プロジェクト: subhadip-sahoo/laravel
    if (Auth::check()) {
        return view('createappointment');
    } else {
        return view('auth/login');
    }
});
Route::get('visitors/', function () {
    View::share(array('site' => Site::all()->first(), 'captcha' => (new Captcha())->html()));
    if (Auth::check()) {
        return view('visitors');
    } else {
        return view('auth/login');
    }
});
Route::get('all-admin/', function () {
    View::share(array('site' => Site::all()->first(), 'captcha' => (new Captcha())->html()));
    if (Auth::check()) {
        return view('alladmin');
    } else {
        return view('auth/login');
    }
});
// API ROUTES ==================================
Route::group(array('prefix' => 'api'), function () {
    Route::resource('welcome', 'CommonController@index');
    Route::resource('settings', 'CommonController@settings');
    Route::post('settings/update/{userdate}', 'CommonController@updateuser');
    Route::post('locations/create', 'LocationController@create');
    Route::post('locations/update/{location}', 'LocationController@update');
    Route::resource('locations', 'LocationController');
    Route::post('visitortypes/create', 'VisitortypeController@create');