예제 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     echo "<pre>";
     echo "harsha";
     $enrolledCustomers = StudentClasses::getEnrolledCustomers();
     print_r($enrolledCustomers);
     exit;
     $data = array("customerName" => "Prasath Aru");
     Mail::send('emails.account.customer', $data, function ($msg) {
         $email = '*****@*****.**';
         $msg->from('*****@*****.**', 'The Little Gym');
         $msg->to($email, "Prasath Arumugam")->subject('Test mail');
     });
     exit;
     /* $batchEndDate = Batches::select('end_date')->where("id","=", 2)->get();
     		print_r($batchEndDate['0']->end_date); */
     $batches = BatchSchedule::where('batch_id', '=', '2')->whereBetween('schedule_date', array('2016-1-1', '2016-3-31'))->count();
     //->get();
     echo $batches;
 }
예제 #2
0
 public function checkmultiPayOrderDate()
 {
     $inputs = Input::all();
     $batch_data = Batches::find($inputs['batchid']);
     $eachClassCost = $batch_data->class_amount;
     $startdate = new carbon();
     $enddate = new carbon();
     $startdate = $startdate->createFromFormat('m/d/Y', $inputs['startdate']);
     $enddate = $enddate->createFromFormat('m/d/Y', $inputs['enddate']);
     if (isset($inputs['multipayAmount1'])) {
         $firstPayWeeksNo = $inputs['multipayAmount1'] / $eachClassCost;
     }
     if (isset($inputs['multipayAmount2'])) {
         $secondPayWeeksNo = $inputs['multipayAmount2'] / $eachClassCost;
     }
     if (isset($inputs['multipayAmount3'])) {
         $thirdPayWeeksNo = $inputs['multipayAmount3'] / $eachClassCost;
     }
     if (isset($inputs['multipayAmount4'])) {
         $fourthPayWeeksNo = $inputs['multipayAmount4'] / $eachClassCost;
     }
     //$totalweekNo=$firstPayWeeksNo+$secondPayWeeksNo+$thirdPayWeeksNo+$fourthPayWeeksNo;
     $batch_data = BatchSchedule::where('batch_id', '=', $inputs['batchid'])->where('franchisee_id', '=', Session::get('franchiseId'))->where('season_id', '=', $inputs['seasonid'])->whereBetween('schedule_date', array($startdate->toDateString(), $enddate->toDateString()))->where('holiday', '!=', 1)->orderBy('id')->get();
     $firstPayWeeksNo = $firstPayWeeksNo - 1;
     if (isset($inputs['multipayAmount2'])) {
         $secondPayWeeksNo = $secondPayWeeksNo + $firstPayWeeksNo;
     }
     if (isset($inputs['multipayAmount3'])) {
         $thirdPayWeeksNo = $secondPayWeeksNo + $thirdPayWeeksNo;
     }
     if (isset($inputs['multipayAmount4'])) {
         $fourthPayWeeksNo = $thirdPayWeeksNo + $fourthPayWeeksNo;
     }
     $presentdate = new carbon();
     $presentdate = $presentdate->now();
     $secondPaymentDate = new carbon();
     $thirdPaymentDate = new carbon();
     $fourthPaymentDate = new carbon();
     if (isset($inputs['multipayAmount2'])) {
         $secondPaymentDate = $secondPaymentDate->createFromFormat('Y-m-d', $batch_data[$firstPayWeeksNo]['schedule_date']);
     }
     if (isset($inputs['multipayAmount3'])) {
         $thirdPaymentDate = $thirdPaymentDate->createFromFormat('Y-m-d', $batch_data[$secondPayWeeksNo]['schedule_date']);
     }
     if (isset($inputs['multipayAmount4'])) {
         $fourthPaymentDate = $fourthPaymentDate->createFromFormat('Y-m-d', $batch_data[$thirdPayWeeksNo]['schedule_date']);
     }
     if (isset($inputs['multipayAmount4'])) {
         if ($presentdate->gt($fourthPaymentDate)) {
             return Response::json(array('status' => 'four'));
         }
     }
     if (isset($inputs['multipayAmount3'])) {
         if ($presentdate->gt($thirdPaymentDate)) {
             return Response::json(array('status' => 'three'));
         }
     }
     if (isset($inputs['multipayAmount2'])) {
         if ($presentdate->gt($secondPaymentDate)) {
             return Response::json(array('status' => 'two', 'date' => $secondPaymentDate));
         }
     }
     //return Response::json(array('status'=>$batch_data));
 }
예제 #3
0
 static function deleteBatchScheduleById($batchId)
 {
     return BatchSchedule::where('batch_id', '=', $batchId)->delete();
 }
예제 #4
0
 public function getBatchRemainingClassesByBatchId()
 {
     $inputs = Input::all();
     $batchClassesData = BatchSchedule::where('franchisee_id', '=', Session::get('franchiseId'))->where('batch_id', '=', $inputs['batchId'])->whereDate('schedule_date', '>=', $inputs['preferredStartDate'])->get();
     $batchClassesCount = count($batchClassesData);
     $lastEndDate = $batchClassesData[$batchClassesCount - 1]['schedule_date'];
     $date = Carbon::now();
     $date = $date->createFromFormat('Y-m-d', $lastEndDate);
     $date = $date->next(Carbon::MONDAY);
     //getting the batch cost from batch class
     //$class_data=  ClassBasePrice::where('base_price_no','=',Batches::find($inputs['batchId'])->classes()->base_price_no)->select('base_price')->get();
     //$classAmount=$batch_data->class_amount;
     $base_price_no = Batches::find($inputs['batchId'])->classes()->select('base_price_no')->get();
     $base_price = ClassBasePrice::where('base_price_no', '=', $base_price_no[0]['base_price_no'])->get();
     $base_price = $base_price[0]['base_price'];
     if ($batchClassesCount) {
         return Response::json(array('status' => 'success', 'classCount' => $batchClassesCount, 'lastdate' => $date->toDateString(), 'classAmount' => $base_price, 'enrollment_end_date' => $batchClassesData[count($batchClassesData) - 1]['schedule_date'], 'enrollment_start_date' => $batchClassesData[0]['schedule_date']));
     } else {
         return Response::json(array('status' => 'failure'));
     }
 }