public function reserve() { $programs = $this->getPrograms(); foreach ($programs as $program) { Reserve::simpleReserve($program['program_disc']); } }
public function simpleReservation() { if (!isset($_GET['program_id']) || $_GET['program_id'] == '') { exit('Error: 番組idが指定されていません'); } $result = Reserve::simpleReserve($_GET['program_id']); if ($result === false) { exit('Error: 指定された番組idは存在しません'); } }
} } if (isset($_POST['category_id'])) { if ($_POST['category_id'] != 0) { $category_id = $_POST['category_id']; $options .= " AND category_id = '" . $_POST['category_id'] . "'"; } } if (isset($_POST['station'])) { if ($_POST['station'] != 0) { $station = $_POST['station']; $options .= " AND channel_id = '" . $_POST['station'] . "'"; } } } try { $db = DB::conn(); $channels = $db->rows('SELECT * FROM ' . Channel::TABLE); $smarty = new Smarty(); $smarty->template_dir = dirname(dirname(__FILE__)) . '/templates/'; $smarty->compile_dir = dirname(dirname(__FILE__)) . '/templates_c/'; $smarty->assign('sitetitle', '録画済一覧'); $smarty->assign('records', Reserve::getRecordedItems($options)); $smarty->assign('search', $search); $smarty->assign('channels', $channels); $smarty->assign('categories', Category::getAll()); $smarty->assign('use_thumbs', $settings->use_thumbs); $smarty->display("recordedTable.html"); } catch (exception $e) { throw $e; }
function usershow() { if (getvar('admin', 'session')) { $reserve = new Reserve(); $current = getvar('p', 'get'); $current = empty($current) ? 1 : $current; $data = $reserve->findAll(array($current, '?r=usershow', 10)); global $db; $datas = array(); $datas['reserves'] = $data; $datas['pagination'] = $db->getPage(); template('index.php', $datas); } else { setHint('请先登录'); redirect('login'); } }
/** * function name : del_reserve * edit data c_reserve_cars * get */ public function del_reserve($id) { if (Session::get('level') == '1' || Session::get('level') == '3') { $k = DB::Select(' select together_id from c_reserve_cars where reserve_id=' . $id . ' '); foreach ($k as $d) { $k = $d->together_id; } $result = Reserve::where('reserve_id', $id)->delete(); if ($result) { Together::where('together_id', $k)->delete(); return Redirect::to('reserve')->with('success_message', 'ลบข้อมูลเรียบร้อยแล้ว'); } else { return Redirect::to('reserve')->with('error_message', 'ไม่สามารถลบข้อมูลได้ กรุณาแจ้งผู้ดูแลระบบ'); } } else { $data = DB::table('c_req_cars')->where('godate', '>=', date('Y-m-d'))->orderBy('godate', 'asc')->paginate(10); return View::make('home.index', array('data' => $data)); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $reserve = Reserve::find($id); $reserve->delete(); Session::flash('message', 'Reserva Eliminada Correctamente'); return Redirect::to('reserve'); }
<?php require_once dirname(dirname(__FILE__)) . "/config.php"; try { $smarty = new Smarty(); $smarty->template_dir = dirname(dirname(__FILE__)) . '/templates/'; $smarty->compile_dir = dirname(dirname(__FILE__)) . '/templates_c/'; $smarty->assign('sitetitle', '録画予約一覧'); $smarty->assign('reservations', Reserve::getReservations()); $smarty->display('reservationTable.html'); } catch (Exception $e) { exit($e->getMessage()); }
public function run() { DB::table('reserves')->delete(); Reserve::create(array('date_reserve' => '18-10-2014', 'classroom' => 'A1-401', 'start_time' => '5:00 PM', 'end_time' => '7:00 PM', 'section' => 'Ternera', 'semester' => 'noveno', 'subject' => 'Diseño Web III', 'user_id' => 1, 'hardware_id' => 1)); Reserve::create(array('date_reserve' => '18-10-2014', 'classroom' => 'A1-401', 'start_time' => '5:00 PM', 'end_time' => '7:00 PM', 'section' => 'Ternera', 'semester' => 'noveno', 'subject' => 'Diseño Web III', 'user_id' => 1, 'hardware_id' => 2)); }
$category = Category::get($program['category_disc']); if ($category === false) { $category_name = 'none'; } else { $category_name = $category->name_en; } $programs[$st]['list'][$num]['category_name'] = $category_name; $programs[$st]['list'][$num]['program_disc'] = $program['program_disc']; $programs[$st]['list'][$num]['height'] = $height; $programs[$st]['list'][$num]['title'] = $program['title']; $programs[$st]['list'][$num]['starttime'] = date("H:i", $start) . ""; $programs[$st]['list'][$num]['description'] = $program['description']; $programs[$st]['list'][$num]['prg_start'] = str_replace("-", "/", $program['starttime']); $programs[$st]['list'][$num]['duration'] = "" . (strtotime($program['endtime']) - strtotime($program['starttime'])); $programs[$st]['list'][$num]['channel'] = ($program['type'] == "GR" ? "地上D" : "BS") . ":" . $program['channel'] . "ch"; if (Reserve::get($program['program_disc'])) { $programs[$st]['list'][$num]['rec'] = 1; } else { $programs[$st]['list'][$num]['rec'] = 0; } $num++; } } catch (Exception $e) { throw $e; } // 空きを埋める if ($last_time - $prev_end > 0) { $height = ($last_time - $prev_end) * $settings->height_per_hour / 3600; $programs[$st]['list'][$num]['category_name'] = "none"; $programs[$st]['list'][$num]['height'] = $height; $programs[$st]['list'][$num]['title'] = "";
public function verify() { $logica = false; $hardwares = Hardware::where('name', '=', 'Portatil')->get(); $reserves = Reserve::all(); $arrayRef = array(); foreach ($reserves as $item) { array_push($arrayRef, $item->hardware_id); } if (count($reserves) == 0) { $logica = true; } else { $cant = 1; foreach ($hardwares as $item) { if (!in_array($item->reference, $arrayRef)) { if ($cant == 1) { $logica = true; } } } } return Response::json(array('verify' => $logica)); }