本文整理汇总了PHP中Students::getStudentById方法的典型用法代码示例。如果您正苦于以下问题:PHP Students::getStudentById方法的具体用法?PHP Students::getStudentById怎么用?PHP Students::getStudentById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Students
的用法示例。
在下文中一共展示了Students::getStudentById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: view
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function view($id)
{
if (Auth::check()) {
$currentPage = "STUDENTS_LIST";
$mainMenu = "STUDENTS_MAIN";
$student = Students::getStudentById($id);
$franchiseeCourses = Courses::getFranchiseCoursesList(Session::get('franchiseId'));
$studentEnrollments = StudentClasses::getStudentEnrollments($id);
$paymentDues = PaymentDues::getAllPaymentDuesByStudent($id);
$customermembership = CustomerMembership::getCustomerMembership($student['0']->customer_id);
$scheduledIntroVisits = IntroVisit::getIntrovisitByStudentId($id);
$discountEligibility = StudentClasses::discount($id, $student['0']->customer_id);
//$paidDue= PaymentDues::getAllPaymentsMade($id);
//$Due=PaymentDues::getAllDue($id);
//for paid payment
/* on hold for changing enrollment
$paidAmountdata= PaymentDues::getAllPaymentsMade($id);
for($i=0;$i<count($paidAmountdata);$i++){
$studentclasssectiondata= Classes::getstudentclasses($paidAmountdata[$i]['class_id']);
$paidAmountdata[$i]['class_name']=$studentclasssectiondata[0]['class_name'];
$user_Data=User::getUsersByUserId($paidAmountdata[$i]['created_by']);
$paidAmountdata[$i]['receivedname']=$user_Data[0]['first_name'].$user_Data[0]['last_name'];
$order_data= Orders::getOrderDetailsbyPaydueId($paidAmountdata[$i]['id']);
$paidAmountdata[$i]['printurl']= url().'/orders/print/'.Crypt::encrypt($order_data[0]['id']);
}
*/
/*
$paidAmountdata= Orders::getAllPaymentsMade($id);
for($i=0;$i<count($paidAmountdata);$i++){
$studentClassdata=StudentClasses::getStudentClassbyId($paidAmountdata[$i]['student_classes_id']);
$paidAmountdata[$i]['enrollment_start_date']=$studentClassdata[0]['enrollment_start_date'];
$paidAmountdata[$i]['enrollment_end_date']=$studentClassdata[0]['enrollment_end_date'];
$paidAmountdata[$i]['selected_sessions']=$studentClassdata[0]['selected_sessions'];
$studentclasssectiondata= Classes::getstudentclasses($studentClassdata[0]['class_id']);
$paidAmountdata[$i]['class_name']=$studentclasssectiondata[0]['class_name'];
$user_Data=User::getUsersByUserId($paidAmountdata[$i]['created_by']);
$paidAmountdata[$i]['receivedname']=$user_Data[0]['first_name'].$user_Data[0]['last_name'];
$paidAmountdata[$i]['printurl']= url().'/orders/print/'.Crypt::encrypt($paidAmountdata[0]['id']);
}
*
*/
//for dues
// $order_due_data=Orders::getpendingPaymentsid($id);
$order_due_data = PaymentDues::getAllDuebyStudentId($id);
// $dueAmountdata=PaymentDues::getAllDue($id);
for ($i = 0; $i < count($order_due_data); $i++) {
$studentclasssectiondata = Classes::getstudentclasses($order_due_data[0]['class_id']);
$order_due_data[$i]['class_name'] = $studentclasssectiondata[0]['class_name'];
$user_Data = User::getUsersByUserId($order_due_data[$i]['created_by']);
$order_due_data[$i]['receivedname'] = $user_Data[0]['first_name'] . $user_Data[0]['last_name'];
}
//getting values for present Discount for enrollment
$discount_second_child = 0;
$discount_second_class = 0;
$discount_second_child_elligible = 0;
$discount_second_class_elligible = 0;
$count = 0;
$DiscountApprove = Discounts::where('franchisee_id', '=', Session::get('franchiseId'))->first();
if ($DiscountApprove['discount_second_child_approve'] == 1) {
$discount_second_child_elligible = 1;
$discount_second_child = $DiscountApprove['discount_second_child'];
}
if ($DiscountApprove['discount_second_class_approve'] == 1) {
$discount_second_class_elligible = 1;
$discount_second_class = $DiscountApprove['discount_second_class'];
}
if ($discount_second_class_elligible) {
$classes_count = StudentClasses::where('student_id', '=', $student[0]['id'])->where('status', '=', 'enrolled')->count();
if ($classes_count > 1) {
$discount_second_class_elligible = 1;
} else {
$discount_second_class_elligible = 0;
}
}
if ($discount_second_child_elligible) {
$student_ids = Students::where('customer_id', '=', $student[0]['customer_id'])->select('id')->get()->toArray();
for ($i = 0; $i < count($student_ids); $i++) {
if (StudentClasses::where('student_id', '=', $student_ids[$i]['id'])->where('status', '=', 'enrolled')->exists()) {
$count++;
}
}
//$discount_second_class_elligible=($count>1)?1:0;
if ($count > 1) {
$discount_second_class_elligible = 1;
} else {
$discount_second_class_elligible = 0;
}
}
$discountEnrollmentData = Discounts::getEnrollmentDiscontByFranchiseId();
$dataToView = array("student", 'currentPage', 'mainMenu', 'franchiseeCourses', 'discountEnrollmentData', 'discount_second_class_elligible', 'discount_second_child_elligible', 'discount_second_child', 'discount_second_class', 'studentEnrollments', 'customermembership', 'paymentDues', 'scheduledIntroVisits', 'introvisit', 'discountEligibility', 'paidAmountdata', 'order_due_data');
return View::make('pages.students.details', compact($dataToView));
//.........这里部分代码省略.........
示例2: details
public function details($id)
{
if (Auth::check()) {
$currentPage = "CUSTOMERS_LIST";
$mainMenu = "CUSTOMERS_MAIN";
$inputs = Input::all();
if (isset($inputs['customerName'])) {
if (Customers::addCustomers($inputs)) {
Session::flash('msg', "Customer added successfully.");
} else {
Session::flash('warning', "Customer, Course Could not be added at the moment.");
}
}
$customer = Customers::getCustomersById($id);
$students = Students::getStudentByCustomer($id);
$comments = Comments::getCommentByCustomerId($id);
$provinces = Provinces::getProvinces("IN");
$kidsSelect = Students::getStudentsForSelectBox($id);
$membershipTypes = MembershipTypes::getMembershipTypesForSelectBox();
$birthdays = BirthdayParties::getBirthdaysByCustomer($id);
//return $customer;
//Membership
if (isset($inputs['membershipTypesMembersDiv'])) {
/* echo '<pre>';
print_r($inputs);
echo '</pre>';
exit(); */
if ($inputs['membershipTypesMembersDiv'] != "") {
$membershipInput['customer_id'] = $id;
$membershipInput['membership_type_id'] = $inputs['membershipTypesMembersDiv'];
CustomerMembership::addMembership($membershipInput);
$order['customer_id'] = $id;
$order['payment_for'] = "membership";
$order['payment_dues_id'] = '';
$order['payment_mode'] = $inputs['paymentTypeRadio'];
$order['card_last_digit'] = $inputs['card4digits'];
$order['card_type'] = $inputs['cardType'];
$order['bank_name'] = $inputs['bankName'];
$order['cheque_number'] = $inputs['chequeNumber'];
$order['amount'] = $inputs['membershipPrice'];
$order['order_status'] = "completed";
Orders::createOrder($order);
}
}
//$customerMembership = "";
/* echo '<pre>';
print_r($customer);
echo '</pre>';
exit(); */
$presentDate = Carbon::now();
$membershipStartDate = Carbon::now();
$membershipEndDate = Carbon::now();
$customerMembershipId = '';
if (isset($customer->CustomerMembership['0'])) {
$select = count($customer->CustomerMembership) - 1;
$membershipStartDate = $membershipStartDate->createFromFormat('Y-m-d', $customer->CustomerMembership[$select]->membership_start_date);
$membershipEndDate = $membershipEndDate->createFromFormat('Y-m-d', $customer->CustomerMembership[$select]->membership_end_date);
if ($membershipStartDate->lte($presentDate) && $membershipEndDate->gte($presentDate)) {
$customerMembershipId = $customer->CustomerMembership[$select]->membership_type_id;
}
}
if (isset($customerMembershipId)) {
$customerMembership = MembershipTypes::getMembershipTypeByID($customerMembershipId);
}
$membershipTypesAll = MembershipTypes::getMembershipTypes();
$birthdaypaiddata = Orders::getBirthdayfulldata($id);
for ($i = 0; $i < count($birthdaypaiddata); $i++) {
$studentData = Students::getStudentById($birthdaypaiddata[$i]['student_id']);
$birthdaypaiddata[$i]['student_name'] = $studentData[0]['student_name'];
$birthdaypaiddata[$i]['student_date_of_birth'] = $studentData[0]['student_date_of_birth'];
$birthdayData = BirthdayParties::getBirthdaybyId($birthdaypaiddata[$i]['birthday_id']);
$birthdaypaiddata[$i]['birthday_party_date'] = $birthdayData[0]['birthday_party_date'];
$birthdaypaiddata[$i]['tax_amount'] = $birthdaypaiddata[0]['tax_amount'];
$user_data = User::getUsersByUserId($birthdaypaiddata[$i]['created_by']);
$birthdaypaiddata[$i]['name'] = $user_data[0]['first_name'] . $user_data[0]['last_name'];
$birthdaypaiddata[$i]['encrypted_id'] = Crypt::encrypt($birthdaypaiddata[$i]['id']);
}
$birthdayDuedata = PaymentDues::getPaymentpendingfulldata($id);
for ($i = 0; $i < count($birthdayDuedata); $i++) {
$studentData = Students::getStudentById($birthdayDuedata[$i]['student_id']);
$birthdayDuedata[$i]['student_name'] = $studentData[0]['student_name'];
$user_data = User::getUsersByUserId($birthdayDuedata[$i]['created_by']);
$birthdayDuedata[$i]['name'] = $user_data[0]['first_name'] . $user_data[0]['last_name'];
$birthdayData = BirthdayParties::getBirthdaybyId($birthdayDuedata[$i]['birthday_id']);
$birthdayDuedata[$i]['birthday_party_date'] = $birthdayData[0]['birthday_party_date'];
}
//followup_data
$iv_data = IntroVisit::where('customer_id', '=', $id)->get();
for ($i = 0; $i < count($iv_data); $i++) {
$comments_data = Comments::where('introvisit_id', '=', $iv_data[$i]['id'])->orderBy('id', 'DESC')->first();
$iv_data[$i]['comment_data'] = $comments_data;
$student = Students::find($iv_data[$i]['student_id']);
$iv_data[$i]['student_name'] = $student['student_name'];
$iv_data[$i]['iv_date'] = date("Y-m-d", strtotime($iv_data[$i]['iv_date']));
}
$birthday_data = BirthdayParties::where('customer_id', '=', $id)->get();
for ($i = 0; $i < count($birthday_data); $i++) {
$birthday_comments = Comments::where('birthday_id', '=', $birthday_data[$i]['id'])->orderBy('id', 'DESC')->first();
$birthday_data[$i]['comment_data'] = $birthday_comments;
$student_data = Students::find($birthday_data[$i]['student_id']);
//.........这里部分代码省略.........