本文整理汇总了PHP中Courses::getFranchiseCoursesList方法的典型用法代码示例。如果您正苦于以下问题:PHP Courses::getFranchiseCoursesList方法的具体用法?PHP Courses::getFranchiseCoursesList怎么用?PHP Courses::getFranchiseCoursesList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Courses
的用法示例。
在下文中一共展示了Courses::getFranchiseCoursesList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
//
$currentPage = "COURSES";
$mainMenu = "COURSES_MAIN";
$inputs = Input::all();
if (isset($inputs['className']) && isset($inputs['franchiseeCourse'])) {
/* echo '<pre>';
print_r($inputs);
exit(); */
$classadd = Classes::addClasses($inputs);
if ($classadd == "exists") {
Session::flash('error', "Sorry, Class you are trying to add already exists");
} elseif (!$classadd) {
Session::flash('error', "Sorry, Class Could not be added at the moment.");
} else {
Session::flash('msg', "Class added successfully.");
}
}
$courseList = CoursesMaster::getCoursesList();
//$classesMaster = ClassesMaster::getClassesMasterForDropDown();
$franchiseeCourses = Courses::getFranchiseCoursesList(Session::get('franchiseId'));
$classes = Classes::getAllClasses(1);
return View::make('pages.classes.classes', compact('classesMaster', 'classes', 'courseList', 'franchiseeCourses', 'currentPage', 'mainMenu'));
}
示例2: 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));
//.........这里部分代码省略.........
示例3: index
//.........这里部分代码省略.........
$timeString = date('Y-m-d', strtotime($inputs['startDate'])) . $inputs['startTime'];
$timestamp = strtotime($timeString);
$startTime24Hours = date('H:i:s', $timestamp);
$timeString = $endDateYear . '-3-5 ' . $inputs['endTime'];
$timestamp = strtotime($timeString);
$endTime24Hours = date('H:i:s', $timestamp);
$batchSlug = Courses::getBatchID($courseId, $classId, $startDate, null, $inputs['selectSeason']);
$inputBatch['batchName'] = $batchSlug;
$inputBatch['classId'] = $classId;
$inputBatch['courseId'] = $courseId;
$inputBatch['startDate'] = $startDate->toDateString();
$inputBatch['endDate'] = $endDate->toDateString();
$inputBatch['season_id'] = $inputs['selectSeason'];
$inputBatch['preferredTime'] = $startTime24Hours;
$inputBatch['preferredEndTime'] = $endTime24Hours;
$inputBatch['leadInstructor'] = $leadInstructor;
$inputBatch['alternateInstructor'] = $alternateInstructor;
$inputBatch['location_id'] = $inputs['seasonLocation'];
//$inputBatch['classAmount']=$inputs['eachClassAmount'];
$newBatch = Batches::addBatches($inputBatch);
/*
$days = 1;
foreach($daysFound as $monthdays){
foreach($monthdays as $dayFound){
if($days <= 40){
$batchScheduleInput['batchId'] = $newBatch->id;
$batchScheduleInput['seasonId'] = $inputs['selectSeason'];
$batchScheduleInput['scheduleDate'] = $dayFound;
$batchScheduleInput['startTime'] = $startTime24Hours;
$batchScheduleInput['endTime'] = $endTime24Hours;
$batchScheduleInput['scheduleType']= 'class';
BatchSchedule::addSchedule($batchScheduleInput);
}
$days++;
}
}
*/
//calculating dates and adding all the dates to batchschedule for new batch
$batch_schedule = new BatchSchedule();
do {
$batchScheduleInput['batchId'] = $newBatch->id;
$batchScheduleInput['seasonId'] = $inputs['selectSeason'];
$batchScheduleInput['scheduleDate'] = $startDate->toDateString();
$batchScheduleInput['startTime'] = $startTime24Hours;
$batchScheduleInput['endTime'] = $endTime24Hours;
$batchScheduleInput['scheduleType'] = 'class';
BatchSchedule::addSchedule($batchScheduleInput);
$startDate->addDays(7);
} while ($startDate->eq($endDate) == FALSE);
//for last date
$batchScheduleInput['batchId'] = $newBatch->id;
$batchScheduleInput['seasonId'] = $inputs['selectSeason'];
$batchScheduleInput['scheduleDate'] = $startDate->toDateString();
$batchScheduleInput['startTime'] = $startTime24Hours;
$batchScheduleInput['endTime'] = $endTime24Hours;
$batchScheduleInput['scheduleType'] = 'class';
BatchSchedule::addSchedule($batchScheduleInput);
//check for holidays if exists make
if (Holidays::where('season_id', '=', $inputs['selectSeason'])->count() > 0) {
$holiday_data = Holidays::where('season_id', '=', $inputs['selectSeason'])->select('startdate', 'enddate')->get();
for ($i = 0; $i < count($holiday_data); $i++) {
DB::table('batch_schedule')->where('batch_id', '=', $newBatch->id)->whereBetween('schedule_date', array($holiday_data[$i]['startdate'], $holiday_data[$i]['enddate']))->update(array('holiday' => 1));
}
}
Session::flash('msg', "Batch added successfully.");
return Redirect::to('batches');
}
$franchiseeId = Session::get('franchiseId');
$season_display_data = Seasons::where('franchisee_id', '=', Session::get('franchiseId'))->orderBy('id', 'DESC')->get();
if (isset($season_display_data[0])) {
$s_id = $season_display_data[0]['id'];
$batches = Batches::getAllBatchesDatabySeasonId($franchiseeId, $s_id);
for ($i = 0; $i < count($batches); $i++) {
$batches[$i]['preferred_time'] = date("H:i", strtotime($batches[$i]['preferred_time']));
$batches[$i]['preferred_end_time'] = date("H:i", strtotime($batches[$i]['preferred_end_time']));
$location_data = Location::where('id', '=', $batches[$i]['location_id'])->get();
$batches[$i]['location_name'] = $location_data[0]['location_name'];
$batches[$i]['created'] = date("Y-m-d", strtotime($batches[$i]['created_at']));
$batches[$i]['day'] = date('l', strtotime($batches[$i]['start_date']));
if ($batches[$i]['lead_instructor'] != '') {
$user_data = User::find($batches[$i]['lead_instructor']);
$batches[$i]['instructor_name'] = $user_data['first_name'] . '' . $user_data['last_name'];
} else {
$batches[$i]['instructor_name'] = '';
}
$batches[$i]['count'] = StudentClasses::where('batch_id', '=', $batches[$i]['id'])->count();
}
}
$courseList = Courses::getFranchiseCoursesList($franchiseeId);
$franchiseeCourses = Courses::getFranchiseCoursesList(Session::get('franchiseId'));
$Instructors = User::getInstructors();
$dataToView = array('batches', 'courseList', 'currentPage', 'mainMenu', 'franchiseeCourses', 'mondays', 'Instructors');
return View::make('pages.batches.batchesfinal', compact($dataToView));
} else {
return Redirect::to("/");
}
}