/** * 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; }
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)); }
static function deleteBatchScheduleById($batchId) { return BatchSchedule::where('batch_id', '=', $batchId)->delete(); }
public function deleteBatchById() { $inputs['batch_id'] = Input::get('batch_id'); // deleting from batch_schedule table $batchSchedule_delete = BatchSchedule::deleteBatchScheduleById($inputs['batch_id']); if ($batchSchedule_delete) { // deleting from batch table $batch_delete = Batches::deleteBatchById($inputs['batch_id']); if ($batch_delete) { return Response::json(array('status' => 'success')); } else { return Response::json(array('status' => 'failure')); } } return Response::json(array('status' => 'failure')); }
/** * Display a listing of the resource. * * @return Response */ public function index() { if (Auth::check()) { $currentPage = ""; $mainMenu = "DASHBOARD"; //customers or Inquiries $todaysCustomerReg = Customers::getCustomertodaysRegCount(); $customerCount = Customers::getCustomerCount(); //Members or Family Members $todaysMemberReg = CustomerMembership::getMembertodaysRegCount(); $membersCount = CustomerMembership::getMemberCount(); //Non Members or prospects $todaysNonmemberReg = CustomerMembership::getNonMembertodaysRegCount(); $NonmembersCount = CustomerMembership::getNonMemberCount(); //Enrolled customers(kids) $todaysEnrolledCustomers = StudentClasses::getTodaysEnrolledCustomers(); $enrolledCustomers = StudentClasses::getEnrolledCustomers(); //for followups $reminderCount = Comments::getReminderCountByFranchiseeId(); //Introvisit $totalIntrovisitCount = IntroVisit::getIntrovistCount(); $introVisitCount = IntroVisit::getIntrovisitBytoday(); $allIntrovisits = IntroVisit::getAllActiveIntrovisit(); for ($i = 0; $i < count($allIntrovisits); $i++) { $data = Comments::where('introvisit_id', '=', $allIntrovisits[$i]['id'])->orderBy('id', 'DESC')->first(); if (isset($data)) { $allIntrovisits[$i]['followup_status'] = $data['followup_status']; } } //for courses $totalParentchildCourse = Classes::getallParentchildCourseCount(); $totalPrekgKindergarten = Classes::getallPrekgKindergartenCount(); $totalGradeschool = Classes::getallGradeschoolCount(); $totalCourses = $totalParentchildCourse + $totalPrekgKindergarten + $totalGradeschool; //for birthdayparty $totalbpartyCount = BirthdayParties::getBpartyCount(); $todaysbpartycount = BirthdayParties::getBpartyCountBytoday(); $todaysFollowup = Comments::getAllFollowup(); $todaysIntrovisit = BatchSchedule::getTodaysIntroVisits(); $activeRemindersCount = Comments::getAllFollowupActive(); //get birthday dates $startdate = new carbon(); $startdate->startOfYear(); $endofyear = new carbon(); $endofyear = $endofyear->endOfYear(); $student_id = array(); $birthday_celebration_data = BirthdayParties::where('created_at', '>=', $startdate->toDateString())->where('created_at', '<=', $endofyear->toDateString())->select('student_id')->get(); //var_dump($birthday_celebration_data); die(); for ($i = 0; $i < count($birthday_celebration_data); $i++) { $student_id[$i] = $birthday_celebration_data[$i]['student_id']; } $dat = new carbon(); $month = $dat->month; $presentdate = $dat->day; // for rest of the days of month $birthday_data = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '>', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); // echo $month; die(); for ($i = 0; $i < count($birthday_data); $i++) { $customer_data = Customers::where('id', '=', $birthday_data[$i]['customer_id'])->get(); $birthday_data[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthday_data[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_data[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data[$i]['customer_id'])->count(); } $m = $month; $m++; while ($m <= 12) { $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); $m++; } // for starting months $m = 1; while ($m < $month) { $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); $m++; } for ($i = 0; $i < count($birthday_data_month); $i++) { for ($j = 0; $j < count($birthday_data_month[$i]); $j++) { $customer_data = Customers::where('id', '=', $birthday_data_month[$i][$j]['customer_id'])->get(); $birthday_data_month[$i][$j]['customer_name'] = $customer_data[0]['customer_name']; $birthday_data_month[$i][$j]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_data_month[$i][$j]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data_month[$i][$j]['customer_id'])->count(); } } // var_dump($birthday_data_month);exit(); //for starting days of present month $birthday_month_startdays = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '<', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get(); for ($i = 0; $i < count($birthday_month_startdays); $i++) { $customer_data = Customers::where('id', '=', $birthday_month_startdays[$i]['customer_id'])->get(); $birthday_month_startdays[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthday_month_startdays[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthday_month_startdays[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_month_startdays[$i]['customer_id'])->count(); } //for birthday celebration this week $presentdate = new carbon(); $weeekdate = new carbon(); $weeekdate->addDays(7); $birthdayPresentWeek = BirthdayParties::where('birthday_party_date', '>=', $presentdate->toDateString())->where('birthday_party_date', '<=', $weeekdate->toDateString())->get(); for ($i = 0; $i < count($birthdayPresentWeek); $i++) { $customer_data = Customers::where('id', '=', $birthdayPresentWeek[$i]['customer_id'])->get(); $birthdayPresentWeek[$i]['customer_name'] = $customer_data[0]['customer_name']; $birthdayPresentWeek[$i]['mobile_no'] = $customer_data[0]['mobile_no']; $birthdayPresentWeek[$i]['franchisee_id'] = $customer_data[0]['franchisee_id']; $student_data = Students::where('id', '=', $birthdayPresentWeek[$i]['student_id'])->get(); $birthdayPresentWeek[$i]['student_name'] = $student_data[0]['student_name']; } $f_id = Session::get('franchiseId'); $viewData = array('currentPage', 'mainMenu', 'f_id', 'birthday_data', 'birthday_data_month', 'birthday_month_startdays', 'birthdayPresentWeek', 'todaysMemberReg', 'membersCount', 'todaysNonmemberReg', 'NonmembersCount', 'customerCount', "reminderCount", 'totalbpartyCount', 'todaysbpartycount', 'totalParentchildCourse', 'totalPrekgKindergarten', 'totalGradeschool', 'totalCourses', 'todaysCustomerReg', 'todaysEnrolledCustomers', 'enrolledCustomers', 'totalIntrovisitCount', 'introVisitCount', 'allIntrovisits', 'todaysFollowup', 'todaysIntrovisit', 'activeRemindersCount'); return View::make('pages.dashboard.upcoming', compact($viewData)); } else { return Redirect::to("/"); } }
public function checkSlotAvailableForIntrovisit() { $inputs = Input::all(); $scheduleDate = date('Y-m-d', strtotime($inputs['scheduleDate'])); $batchId = $inputs['batchId']; $batchSchedule = BatchSchedule::checkIntroslotAvailable($scheduleDate, $batchId); if (isset($batchSchedule['0'])) { return Response::json(array("status" => "exists")); } return Response::json(array("status" => "clear")); }