// Ross added code: trying to get the full code not one character. $code = explode(':', $sa); if($code[1]=="N"){ $s_arr=get_the_service($code[0]); if($s_arr['padding_before']!="0") {
} $booked=array(); $the_date=date("Y-m-d", strtotime($_GET['date'])); $resxx=mysql_query("SELECT * FROM `salon_appointment` WHERE `start_date` LIKE '%$the_date%' AND `staff`='staff$_GET[staff]' AND `status`='active'"); while($dataxx= mysql_fetch_array($resxx)){ array_push($booked, array((intval(timetomin(date("H:i", strtotime($dataxx['start _date']))))-intval($_GET['time'])),timetomin(date("H:i", strtotime($dataxx['end_ date']))))); //print intval(timetomin(date("H:i", strtotime($dataxx['start_date']))))-intval( $_GET['time'])."-".timetomin(date("H:i", strtotime($dataxx['end_date'])))."<br>" ; } $e = count($time_arr); for($i=0;$i<$e;$i++){ foreach ($booked as $b){ //print $b[0]."<br>"; $b1 = intval($b[0]); $b2 = intval($b[1]); //echo $time_arr[$i]."Value ".timetomin($time_arr[$i])."- Higher than $b1, lower than $b2<br>"; if((timetomin($time_arr[$i])>intval($b[0]))&&(timetomin($time_arr[$i])<intv al($b[1]))){ $time_arr=array_diff($time_arr, array($time_arr[$i])); } } } $ftarr=array(); foreach($freeslot as $fs){ //print_r($fs); if(intval($_GET['time'])<=$fs[2]){ //array_push($ftarr,$fs[0]); // array_push($time_arr, $fs[0]); for($i= timetomin($fs[0]); $i<=timetomin($fs[1]);$i=$i+$_GET['time']){ if(($i+intval($_GET['time']))<=timetomin($fs[1])){ //echo mintotime($i)." "; array_push($ftarr,mintotime($i)); array_push($time_arr, mintotime($i));
} } } } // if(intval(timetomin(date("H:i", strtotime($dataxx['start_date'])); $the_date=date("Y-m-d", strtotime($_GET['date'])); $resxx=mysql_query("SELECT * FROM `salon_appointment` WHERE `start_date` LIKE '%$the_date%' AND `staff`='staff$_GET[staff]' AND `status`='active'"); while($dataxx= mysql_fetch_array($resxx)){