public function get_detail($id = false, $id_group = false) { if (!$id || !$id_group) { return false; } $group = Schedulegroup::find($id_group); $interval = Schedulemaster::find($group->schedule_master_id); $dayofmonth = array(); $optionsmonth = array(); $optionsyears = array(); for ($i = 1; $i <= $interval->bravo_interval + 1; $i++) { $dayofmonth[$i] = $i; } for ($month = 1; $month <= 12; $month++) { $optionsmonth[$month] = Myfungsi::bulan($month); } for ($year = date('Y'); $year < date('Y') + 3; $year++) { $optionsyears[$year] = $year; } $this->data['fleets'] = Schedulefleetgroup::where('schedule_group_id', '=', $id_group)->get(); $this->data['group'] = Schedulegroup::find($id_group); $this->data['dayofmonth'] = $dayofmonth; $this->data['months'] = $optionsmonth; $this->data['years'] = $optionsyears; $this->data['shifts'] = Koki::to_dropdown(Shift::all(), 'id', 'shift'); $this->data['fleetinfo'] = Fleet::join('ksos', 'fleets.id', '=', 'ksos.fleet_id')->where('ksos.fleet_id', '=', $id)->where('ksos.actived', '=', 1)->where('fleets.pool_id', '=', Auth::user()->pool_id)->first(); //->get(array('fleets.*','ksos.bravo_driver_id', 'ksos.charlie_driver_id')); return View::make('themes.modul.' . $this->views . '.setholiday', $this->data); }
<?php // loop schedulemaster foreach (Schedulemaster::all() as $sm) { echo '<div class="block"> <div class="block-heading"> <a href="#widgetGroup' . $sm->id . '" data-toggle="collapse"> Formasi Kepang ' . $sm->name . '</a> </div> '; echo '<div class="block-body collapse in" id="widgetGroup' . $sm->id . '">'; //Formasi ' . $sm->name . '<br>'; // loop group foreach (Schedulegroup::where_schedule_master_id($sm->id)->where_pool_id(Auth::user()->pool_id)->order_by('group')->get() as $grp) { echo 'Groups #'; echo $grp->group; echo '<br>'; echo '<table class="table table-bordered table-striped table-condensed">'; echo '<thead> <tr><th>Body</th> <th>Driver</th>'; for ($i = 1; $i <= $countmonth; $i++) { echo '<th>' . $i . '</th>'; } echo '</tr> </thead>'; $driver_ar = array(); // loop fleet group foreach (Schedulefleetgroup::where_schedule_group_id($grp->id)->get() as $scf) { //echo 'fleet id'; echo $scf->fleet_id; echo '<br>'; // loop schedule $scdul = Schedule::where('fleet_id', '=', $scf->fleet_id)->where('pool_id', '=', Auth::user()->pool_id)->where('month', '=', date('n', $timestamp))->where('year', '=', date('Y', $timestamp))->get(); foreach ($scdul as $as) {