当前位置: 首页>>代码示例>>PHP>>正文


PHP Orders::createOrder方法代码示例

本文整理汇总了PHP中Orders::createOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Orders::createOrder方法的具体用法?PHP Orders::createOrder怎么用?PHP Orders::createOrder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Orders的用法示例。


在下文中一共展示了Orders::createOrder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enrollKid


//.........这里部分代码省略.........
                 				//$dateTime->modify('next monday');
                 					
                 				// Output the new date.
                 				//echo $dateTime->format('Y-m-d')."<br>";
                 					
                 					
                 				$paymentReminderInput['customerId']    = $inputs['customerId'];
                 				$paymentReminderInput['studentId']     = $inputs['studentId'];
                        $paymentDuesInput['seasonId']             =$inputs['SeasonsCbx'];
                 				$paymentReminderInput['classId']       = $inputs['eligibleClassesCbx'];
                 				$paymentReminderInput['batchId']       = $inputs['batchCbx'];
                        $paymentReminderInput['seasonId']       =$inputs['SeasonsCbx'];
                        $paymentDuesInput['seasonId']          = $inputs['SeasonsCbx'];
                 				$paymentReminderInput['reminder_date'] = $dateTime->format('Y-m-d');
                 					
                 				PaymentReminders::addReminderDates($paymentReminderInput);
                 					
                 					
                 					
                 			}
                 * 
                 */
                 //payment reminders for followups.
                 if ($i == 1) {
                     $order['payment_mode'] = $inputs['paymentTypeRadio'];
                     $order['card_last_digit'] = $inputs['card4digits'];
                     $order['cardType'] = $inputs['card_type'];
                     $order['bank_name'] = $inputs['cardBankName'];
                     $order['receipt_number'] = $inputs['cardRecieptNumber'];
                 }
             }
         }
     }
     $orderCreated = Orders::createOrder($order);
     if ($inputs['CustomerType'] == 'OldCustomer' && $inputs['OrderDate2'] != '' && $inputs['paymentOptionsRadio'] == 'bipay') {
         $payment_due = new PaymentDues();
         $payment_due = PaymentDues::find($paydue_id2);
         $payment_due->payment_status = 'paid';
         $payment_due->save();
         $order['created_at'] = $paymentDuesInput['created_at'];
         $order['amount'] = $paymentDuesResult->payment_due_amount - $paymentDuesResult->discount_amount;
         $order['payment_dues_id'] = $paydue_id2;
         if ($inputs['paymentTypeRadioOldCustomer2'] == 'cash') {
             $order['payment_mode'] = 'cash';
             $orderCreated = Orders::createOrder($order);
         } elseif ($inputs['paymentTypeRadioOldCustomer2'] == 'cheque') {
             $order['payment_mode'] = 'cheque';
             $order['bank_name'] = $inputs['bankName2'];
             $order['cheque_number'] = $inputs['chequeNumber2'];
             $orderCreated = Orders::createOrder($order);
         } elseif ($inputs['paymentTypeRadioOldCustomer2'] == 'card') {
             $order['payment_mode'] = 'card';
             $order['card_type'] = $inputs['cardType2'];
             $order['card_last_digit'] = $inputs['card4digits2'];
             $order['bank_name'] = $inputs['cardBankName2'];
             $order['receipt_number'] = $inputs['cardRecieptNumber2'];
             $orderCreated = Orders::createOrder($order);
         }
     }
     if ($inputs['CustomerType'] == 'OldCustomer' && $inputs['OrderDate2'] != '' && $inputs['paymentOptionsRadio'] == 'multipay') {
         $paydue_data = PaymentDues::where('id', '=', $paydue_id[1])->get();
         $paydue_data = $paydue_data[0];
         $neworder = new Orders();
         $neworder['customer_id'] = $paydue_data['customer_id'];
         $neworder['student_id'] = $paydue_data['student_id'];
         $neworder['season_id'] = $paydue_data['season_id'];
开发者ID:Headrun-php,项目名称:TLG,代码行数:67,代码来源:StudentsController.php

示例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']);
//.........这里部分代码省略.........
开发者ID:Headrun-php,项目名称:TLG,代码行数:101,代码来源:CustomersController.php


注:本文中的Orders::createOrder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。