hjkhghtjhjjhjhjhjhjjhjhjjhrrtrtoirh
bnmbertsurrttrtrtrtrjhjhjjhjhhjhjhjhf'tdfg
/
home
/
u506006416
/
public_html
/
public_html
/
travelsangi
/
app
/
Helper
/
Upload FileeE
HOME
<?php use App\Models\Car; use App\Models\Category; use App\Models\SubCategory; use App\Models\Carbooking; function getCarList($carID){ $carList = Car::where('id',$carID)->first(); if($carList): return $carList->car." ( ".$carList->model." ) "; else: return ""; endif; } function cal_percentage($num_amount, $num_total) { $count = 0; if(($num_total>0) && ($num_total > 0)){ $count1 = $num_amount / $num_total; $count2 = $count1 * 100; $count = number_format($count2, 0); } return $count; } function getCarLists($bookingId){ $bookingList = \DB::table('bookingcars') ->where('bookingid',$bookingId)->get(); $cars = ""; foreach ($bookingList as $key => $value) { $cars .= "<b> ".($key+1)." - ".getCarList($value->carid)."</b><br>"; } return $cars; } function getCarbookingList(){ return Carbooking::where('status','!=',3)->where('onmenu',1)->limit(10)->get(); } function getCountOfCategory(){ return Category::where('status','!=',3) ->whereIn('catType',[1,2])->count(); } function getListedCategory(){ return Category::where('status','!=',3) ->whereIn('catType',[1,2])->limit(10)->get(); } function getSubMenuList($catID){ return SubCategory::where('sub_categories.status',1) ->where('c.id',$catID) ->where('sub_categories.onMenu',1) ->where('c.status','=',1) ->LeftJoin('categories as c','c.id','sub_categories.category') ->select("sub_categories.*",'c.title as cattitle') ->orderBy('sub_categories.id','desc')->get(); } function getprimaryactivityData($allActivity){ return \DB::table('wla_tbl_activities')->whereIn('Activities_Name',explode(',',$allActivity))->get(); } function tourActivityIdeas(){ $activity = \DB::table('wla_tbl_activities') ->where('delete_status',1)->whereIn('Activities_Status',['A']) ->orderBy('Activities_Name','desc')->get(); $ideas = \DB::table('wla_tbl_wild_tour') ->where('delete_status',1)->whereIn('Tour_Status',['A']) ->orderBy('Tour_Name','desc')->get(); return array('activity'=>$activity,'ideas'=>$ideas); } function HotelFacilitiesData($facilities){ return \DB::table('wla_tbl_facility') ->whereIn('Facility_Name',explode(',',$facilities))->get(); } function getTour_NameData($tourName){ return \DB::table('wla_tbl_wild_tour')->whereIn('Tour_Name',explode(',',$tourName))->get(); } function moneyFormatIndia($num) { $explrestunits = "" ; if(strlen($num)>3) { $lastthree = substr($num, strlen($num)-3, strlen($num)); $restunits = substr($num, 0, strlen($num)-3); // extracts the last three digits $restunits = (strlen($restunits)%2 == 1)?"0".$restunits:$restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping. $expunit = str_split($restunits, 2); for($i=0; $i<sizeof($expunit); $i++) { // creates each of the 2's group and adds a comma to the end if($i==0) { $explrestunits .= (int)$expunit[$i].","; // if is first value , convert into integer } else { $explrestunits .= $expunit[$i].","; } } $thecash = $explrestunits.$lastthree; } else { $thecash = $num; } return $thecash; // writes the final format where $currency is the currency symbol. }