本文整理汇总了PHP中UserInfo::where方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::where方法的具体用法?PHP UserInfo::where怎么用?PHP UserInfo::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::where方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAddEdit
public function getAddEdit($id_document = 0)
{
$id_document = (int) $id_document;
$Document = Document::findOrNew($id_document);
$defaultUser = UserInfo::where('is_default', 1)->where('type_user_info', UserInfo::SELLER)->first();
$countries = Country::lists('title_ru', 'country_id');
$countries = ['0' => 'Not Defined'] + $countries;
return View::make('backend.document.parts.add', compact('countries', 'Document', 'defaultUser'));
}
示例2: filterTransaction
public function filterTransaction()
{
$rType = Input::get('rType');
$sType = Input::get('sType');
$response = array();
if (empty($sType) && !empty($rType)) {
$transactions = CottageReservation::where('reservation_type', '=', $rType)->get();
} elseif (!empty($sType) && !empty($rType)) {
$transactions = CottageReservation::where('reservation_type', '=', $rType)->where('status', '=', $sType)->get();
} else {
$transactions = CottageReservation::where('status', '=', $sType)->get();
}
foreach ($transactions as $transaction) {
$roomname = Room::where('rnid', '=', $transaction['room_id'])->first();
$userInfo = UserInfo::where('user_id', '=', $transaction['user_id'])->first();
$reservation_type = ReservationType::find($transaction['reservation_type'])->first();
if ($transaction['reservation_type'] == "1") {
if ($transaction['day_type'] == 1) {
$time = "Morning";
} else {
$time = "Overnight";
}
} else {
$time = date("g:i a", strtotime($transaction['check_in_datetime']));
}
//cottage list
/*
$cottagelists = explode(",", $transaction['cottagelist_id']);
foreach($cottagelists as $list)
{
$cottagename = CottageList::where('cottagelist_id','=',$list)->first();
if(!in_array($cottagename['cottagename'], $cottagelists))
{
$a[count($cottagelists)] = $cottagename['cottagename'];
}
}*/
$all = CottageList::all();
$cottagelists = explode(",", $transaction['cottagelist_id']);
$cottagelists2 = array();
foreach ($all as $cottagename) {
if (in_array($cottagename['cottagelist_id'], $cottagelists)) {
$cottagelists2[count($cottagelists2)] = $cottagename['cottagename'] . "<br>";
}
}
$a = $cottagelists2;
$response[] = array("id" => $transaction['id'], "fname" => $userInfo['firstname'], "lname" => $userInfo['lastname'], "rtpe" => $reservation_type['name'], "rdate" => $transaction['reservation_date'], "status" => $transaction['status'], "room_name" => !empty($roomname) ? $roomname['roomname'] : "", "cottage_name" => $a, "ttime" => $time);
}
return $response;
}
示例3:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<?php
$reserve_info = UserInfo::where('user_id', '=', $reserve_id)->first();
?>
<h3>{{$reserve_info['firstname']}},{{$reserve_info['lastname']}}</h3>
<div class="container">
</div>
</body>
<script type="text/javascript">
</script>
</html>
示例4:
{{Form::token()}}
</form>
</div>
@endif
<div class="editprofile_info">
<div class="bggreen notification_header">
Testimonials
</div>
<div class="friendrequest_list">
<?php
$testimonials = Testimonials::orderBy('id', 'DESC')->get();
?>
@if(count($testimonials) != 0)
@foreach($testimonials as $testimonial)
<?php
$userInfo = UserInfo::where('user_id', '=', $testimonial['user_id'])->first();
?>
<div class="friendrequest_row">
<div class="notification_content">
<span>{{$userInfo['firstname']}},{{$userInfo['lastname']}}</span>
<p>{{$testimonial['testimonials']}}</p>
<span>created at: {{$testimonial['created_at']}}</span>
</div>
@if(Auth::User()['isAdmin'] == 1 || $userInfo['user_id'] == Auth::User()['id'])
<a class="notification_action" href="javascript:void(0);" data-id="{{$testimonial['id']}}">
<i class="demo-icon icon-remove-user"></i>
</a>
@endif
</div>
@endforeach
@else
示例5: setUidAttr
protected function setUidAttr()
{
$uid = UserInfo::where('email|mobile', $this->accounts)->where('pwd', $this->pwd)->value('uid');
return $uid;
}
示例6: postEditProfile
public function postEditProfile()
{
if (!Auth::check()) {
return Redirect::intended('/');
}
$user = Auth::user();
$user_info = UserInfo::where('user_id', $user->id)->first();
$this->setProfileOptions($user->username);
$title = 'Edit Profile - ' . $this->site_name;
$input = Input::only('email', 'real_name', 'location', 'website', 'twitter', 'github', 'about_me', 'hide_email', 'hide_mods_modpacks');
$messages = ['url' => 'The :attribute field is not a valid URL.', 'email' => 'You must provide a valid email address.', 'twitter.max' => 'Your Twitter username can not be longer then 15 characters.'];
$validator = Validator::make($input, ['email' => 'required|max:255|email', 'real_name' => 'max:255', 'location' => 'max:255', 'website' => 'url', 'twitter' => 'max:15', 'github' => 'max:39'], $messages);
if ($validator->fails()) {
return Redirect::action('UserController@getEditProfile')->withErrors($validator)->withInput();
}
$user->email = $input['email'];
$user_info->real_name = $input['real_name'];
$user_info->location = $input['location'];
$user_info->website = $input['website'];
$user_info->twitter = $input['twitter'];
$user_info->github = $input['github'];
$user_info->about_me = $input['about_me'];
if ($input['hide_email'] == 1) {
$user->hide_email = 1;
} else {
$user->hide_email = 0;
}
if ($input['hide_mods_modpacks'] == 1) {
$user->hide_mods_modpacks = 1;
} else {
$user->hide_mods_modpacks = 0;
}
$user_info->last_ip = Request::getClientIp();
$user->save();
$success = $user_info->save();
$user_info->email = $user->email;
$user_info->hide_email = $user->hide_email;
if ($success) {
return View::make('user.edit', ['title' => $title, 'success' => true, 'user' => $user, 'user_info' => $user_info]);
}
return Redirect::action('UserController@getEditProfile')->withErrors(['message' => 'Unable to edit profile.'])->withInput();
}
示例7: postReservation
public function postReservation()
{
$rType = Input::get('rType');
$cType = Input::get('cType');
$checkCottage = Input::get('checkCottage');
$chosenCottages = explode(",", $checkCottage);
$kid = Input::get('kid');
$adult = Input::get('adult');
$email = Input::get('email');
$date = date('Y-m-d', strtotime(Input::get('date')));
$time = date('H:i', strtotime(Input::get('time')));
$chosenDay = Input::get('chosenDay');
$package = Input::get('roomPackage');
$room = Input::get('room');
if ($rType == 1) {
if (empty($cType) || empty($checkCottage) || empty($adult)) {
return View::make('index')->with('mt', "HOME")->with('alert', 'fail')->with('msg', 'failed to reserve cottage please fill all the required fields. Please choose cottage type, cottage and atleast 1 adult.');
}
}
if ($rType == 2) {
if (empty($room) || empty($package) || empty($time)) {
return View::make('index')->with('mt', "HOME")->with('alert', 'fail')->with('msg', 'failed to reserve room fill all the required fields. Please choose time, room and room package ');
}
}
if (empty($email)) {
$email = Input::get('emailRes');
$userInfo = UserInfo::where('email', '=', str_replace(' ', '', $email))->first();
} else {
$userInfo = UserInfo::where('user_id', '=', Auth::User()['id'])->first();
}
$season = Input::get('seasoncode');
// 1: regular 2:week and holidays 3: summer (mar,apr,may)
$addPerson = Input::get('addPerson');
$addBed = Input::get('addBed');
$addLinen = Input::get('addLinen');
$addTowel = Input::get('addTowel');
$addPillow = Input::get('addPillow');
$totalAdd = 0;
if (!empty($addPerson)) {
$totalAdd = $totalAdd + $addPerson * (int) AdditionalPrice::where('additional', '=', 'AdditionalPerson')->first()['price'];
}
if (!empty($addBed)) {
$totalAdd = $totalAdd + $addBed * (int) AdditionalPrice::where('additional', '=', 'ExtraBed')->first()['price'];
}
if (!empty($addLinen)) {
$totalAdd = $totalAdd + $addLinen * (int) AdditionalPrice::where('additional', '=', 'ExtraLinen')->first()['price'];
}
if (!empty($addTowel)) {
$totalAdd = $totalAdd + $addTowel * (int) AdditionalPrice::where('additional', '=', 'ExtraTowel')->first()['price'];
}
if (!empty($addPillow)) {
$totalAdd = $totalAdd + $addPillow * (int) AdditionalPrice::where('additional', '=', 'ExtraPillow')->first()['price'];
}
$getcountcheck = count(explode(",", $checkCottage)) - 1;
$cottageType = CottageType::where('Cottage_ID', '=', $cType)->first();
$price = (int) $cottageType['price'];
if ($chosenDay == "1") {
if ($season == "1") {
$priceAdult = PricingSwimming::where('day', '=', 'Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Morning')->where('desc_a', '=', 'Kids')->first();
} elseif ($season == "2") {
$priceAdult = PricingSwimming::where('day', '=', 'Weekend And Holiday Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Weekend And Holiday Morning')->where('desc_a', '=', 'Kids')->first();
} else {
$priceAdult = PricingSwimming::where('day', '=', 'Summer Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Summer Morning')->where('desc_a', '=', 'Kids')->first();
}
} else {
if ($season == "1") {
$priceAdult = PricingSwimming::where('day', '=', 'Overnight')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Overnight')->where('desc_a', '=', 'Kids')->first();
} elseif ($season == "2") {
$priceAdult = PricingSwimming::where('day', '=', 'Weekend And Holiday Overnight')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Weekend And Holiday Overnight')->where('desc_a', '=', 'Kids')->first();
} else {
$priceAdult = PricingSwimming::where('day', '=', 'Summer Overnight')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Summer Overnight')->where('desc_a', '=', 'Kids')->first();
}
}
if (!empty($priceAdult) && !empty($priceKid)) {
$cottageprice = $getcountcheck * $price;
$kidprice = $kid * (int) $priceKid['price'];
$adultprice = $adult * (int) $priceAdult['price'];
$total = $cottageprice + $kidprice + $adultprice;
}
if (!empty($package)) {
$total = (int) RoomPackage::where('packid', '=', $package)->first()['Price'] + $totalAdd;
}
$getReservation = new CottageReservation();
$getReservation['user_id'] = $userInfo['user_id'];
$getReservation['reservation_type'] = $rType;
$getReservation['cottage_type'] = $cType;
$getReservation['cottagelist_id'] = $checkCottage;
$getReservation['day_type'] = $chosenDay;
$getReservation['reservation_date'] = $date;
$getReservation['room_id'] = $room;
$getReservation['package_id'] = $package;
$getReservation['check_in_datetime'] = $time;
$getReservation['check_out_datetime'] = "";
$getReservation['num_adult'] = $adult;
//.........这里部分代码省略.........
示例8: count
});
$('#time').timepicker({
timeFormat: 'hh:mm tt'
});
});
</script>
@stop
@section('content')
<?php
$id = Auth::User()['id'];
$userInfo = UserInfo::find($id);
$reservation = CottageReservation::find($reserve_id);
$getcountcheck = count(explode(",", $reservation['cottagelist_id'])) - 1;
$countRoom = empty($reservation['room_id']) ? 0 : 1;
$userInfo = UserInfo::where('user_id', '=', $reservation['user_id'])->first();
$package = RoomPackage::where('packid', '=', $reservation['package_id'])->first();
$cottageType = CottageType::where('Cottage_ID', '=', $reservation['cottage_type'])->first();
$price = (int) $cottageType['price'];
$day = $reservation['day_type'];
$season = $reservation['season'];
if ($day == "1") {
if ($season == "1") {
$priceAdult = PricingSwimming::where('day', '=', 'Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Morning')->where('desc_a', '=', 'Kids')->first();
} elseif ($season == "2") {
$priceAdult = PricingSwimming::where('day', '=', 'Weekend And Holiday Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Weekend And Holiday Morning')->where('desc_a', '=', 'Kids')->first();
} else {
$priceAdult = PricingSwimming::where('day', '=', 'Summer Morning')->where('desc_a', '=', 'Adult')->first();
$priceKid = PricingSwimming::where('day', '=', 'Summer Morning')->where('desc_a', '=', 'Kids')->first();
示例9: forgotPassword
public function forgotPassword()
{
$emailChecker = User::where('email', '=', Input::get('email'))->first();
if (empty($emailChecker)) {
return 1;
} else {
$rCode = str_random(120);
$emailChecker['reset_pass_token'] = $rCode;
if ($emailChecker->save()) {
$userInfo = UserInfo::where('user_id', '=', $emailChecker['id'])->first();
$emailcontent = array('fname' => $userInfo->firstname, 'lname' => $userInfo->lastname, 'link' => URL::route('passwordreset', [$rCode, $userInfo->user_id]));
Mail::send('emails.confirmation.pass_reset', $emailcontent, function ($message) {
$message->to(Input::get('email'), 'Kalugdan Garden Resort')->subject('Kalugdan Garden Resort Confirmation Email');
});
return 2;
} else {
return 3;
}
}
}