本文整理汇总了PHP中Booking::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Booking::all方法的具体用法?PHP Booking::all怎么用?PHP Booking::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Booking
的用法示例。
在下文中一共展示了Booking::all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
self::authorize_user();
$bookings = Booking::all();
$doctors = User::doctors();
$polyclinics = Polyclinic::all();
$patients = User::patients();
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
$doctor_id = isset($_REQUEST['doctor_id']) ? $_REQUEST['doctor_id'] : null;
$polyclinic_id = isset($_REQUEST['polyclinic_id']) ? $_REQUEST['polyclinic_id'] : null;
$patient_id = isset($_REQUEST['patient_id']) ? $_REQUEST['patient_id'] : null;
// La funcion render esta declarada en la clase padre ApplicationController.
require 'app/views/reports/report.php';
}
示例2: index
/**
* GET /bookings
*/
public function index()
{
self::authorize_user();
if ($this->currentUser()->getType() == User::AdminType) {
$bookings = Booking::all();
} else {
if ($this->currentUser()->getType() == User::DoctorType) {
$bookings = Booking::findByDoctorId($this->currentUser()->getId());
} else {
if ($this->currentUser()->getType() == User::PatientType) {
$bookings = Booking::findByPatientId($this->currentUser()->getId());
} else {
$bookings = array();
}
}
}
// La funcion render esta declarada en la clase padre ApplicationController.
require 'app/views/bookings/index.php';
}
示例3: bookingList
public function bookingList()
{
$arr = [];
$arr = getallheaders();
$b = null;
$count = null;
if (isset($arr['Range'])) {
$response_array = array();
$response_array['Accept-Ranges'] = 'items';
$range = $arr['Range'];
$response_array['Range-Unit'] = 'items';
$arr = explode('-', $arr['Range']);
$items = $arr[1] - $arr[0] + 1;
$skip = $arr[0];
$skip = $skip < 0 ? 0 : $skip;
$c = null;
if (isset($_GET['query'])) {
/*query variables*/
$query = $_GET['query'];
$startdate = $_GET['startdate'];
$enddate = $_GET['enddate'] == '' ? date('Y-m-d') : $_GET['enddate'];
$status_arr = array();
if ($_GET['pending'] == 'true') {
array_push($status_arr, 0);
}
if ($_GET['paid'] == 'true') {
array_push($status_arr, 1);
}
if ($_GET['occupied'] == 'true') {
array_push($status_arr, 2);
}
if ($_GET['ended'] == 'true') {
array_push($status_arr, 3);
}
if ($_GET['preparing'] == 'true') {
array_push($status_arr, 4);
}
if ($_GET['cancelled'] == 'true') {
array_push($status_arr, 5);
}
if ($_GET['overdue'] == 'true') {
array_push($status_arr, 6);
}
$status_arr = count($status_arr) > 0 ? $status_arr : array(0, 1, 2, 3, 4, 5, 6);
/*end of query variables*/
$count = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->where('id', 'LIKE', "%{$query}%")->orWhereRaw("concat_ws(' ',firstname,lastname) LIKE '%{$query}%'")->orWhere('firstname', 'LIKE', "%{$query}%")->orWhere('lastname', 'LIKE', "%{$query}%")->orWhere('code', 'LIKE', "%{$query}%")->get()->count();
if (isset($_GET['orderBy']) && $_GET['orderBy'] != '') {
$orderBy = $_GET['orderBy'];
$count = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->where(function ($query1) use($query) {
$query1->where('id', 'LIKE', "%{$query}%")->orWhereRaw("concat_ws(' ',firstname,lastname) LIKE '%{$query}%'")->orWhere('firstname', 'LIKE', "%{$query}%")->orWhere('lastname', 'LIKE', "%{$query}%")->orWhere('code', 'LIKE', "%{$query}%");
})->where(function ($date) use($startdate, $enddate) {
$date->whereBetween('check_in', array($startdate, $enddate))->orWhereBetween('check_out', array($startdate, $enddate))->orWhereRaw('"' . $startdate . '" between check_in and check_out')->orWhereRaw('"' . $enddate . '" between check_in and check_out');
})->where(function ($status) use($status_arr) {
$status->whereIn('status', $status_arr);
})->get()->count();
$b = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->where(function ($query1) use($query) {
$query1->where('id', 'LIKE', "%{$query}%")->orWhereRaw("concat_ws(' ',firstname,lastname) LIKE '%{$query}%'")->orWhere('firstname', 'LIKE', "%{$query}%")->orWhere('lastname', 'LIKE', "%{$query}%")->orWhere('code', 'LIKE', "%{$query}%");
})->orWhere(function ($date) use($startdate, $enddate) {
$date->whereBetween('check_in', array($startdate, $enddate))->orWhereBetween('check_out', array($startdate, $enddate))->orWhereRaw('"' . $startdate . '" between check_in and check_out')->orWhereRaw('"' . $enddate . '" between check_in and check_out');
})->where(function ($status) use($status_arr) {
$status->whereIn('status', $status_arr);
})->orderBy("{$orderBy}", 'DESC')->skip($skip)->take($items)->get();
} else {
$orderBy = $_GET['orderBy'];
$count = Booking::all()->count();
$b = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->where('id', 'LIKE', "%{$query}%")->orWhereRaw("concat_ws(' ',firstname,lastname) LIKE '%{$query}%'")->orWhere('firstname', 'LIKE', "%{$query}%")->orWhere('lastname', 'LIKE', "%{$query}%")->orWhere('code', 'LIKE', "%{$query}%")->skip($skip)->take($items)->get();
}
$response = Response::make($b, 200);
$response_array['Content-Ranges'] = 'itemss ' . $range . '/' . $count;
$response->header('Content-Range', $response_array['Content-Ranges'])->header('Accept-Ranges', 'items')->header('Range-Unit', 'items')->header('Total-Items', $count)->header('Flash-Message', 'Now showing pages ' . $arr[0] . '-' . $arr[1] . ' out of ' . $count);
return $response;
} else {
$count = Booking::all()->count();
if (isset($_GET['orderBy']) && $_GET['orderBy'] != '') {
$orderBy = $_GET['orderBy'];
$b = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->orderBy("{$orderBy}", 'DESC')->skip($skip)->take($items)->get();
} else {
$b = Booking::with('reservedRoom_grp.room.roomDetails', 'remarksHistory')->skip($skip)->take($items)->get();
}
}
$response = Response::make($b, 200);
$response_array['Content-Ranges'] = 'items ' . $range . '/' . $count;
$response->header('Content-Range', $response_array['Content-Ranges'])->header('Accept-Ranges', 'items')->header('Range-Unit', 'items')->header('Total-Items', $count)->header('Flash-Message', 'Now showing pages ' . $arr[0] . '-' . $arr[1] . ' out of ' . $count);
return $response;
}
$b = Booking::all();
$response = Response::make($b, 200);
$response->header('Content-Ranges', 'test');
return $response;
}
示例4: index
/**
* Display a listing of bookings
*
* @return Response
*/
public function index()
{
$bookings = Booking::all();
return View::make('bookings.index', compact('bookings'));
}
示例5: index
public function index()
{
return Booking::all();
}