IMPROVEMENT: drop down hours
-
Right now the user has to scroll from 12:00am to their starting point of their opening hour. Since MOST people don’t start doing business at 12:00am, may I suggest including the following improvement by replacing the following function with my code:
classes/bookingultra.service.php
//returns the business hours drop down public function get_business_hours_drop_down_for_staff($day, $cbox_id, $select_start_to_class, $staff_id) { global $bookingultrapro; $hours = 24; //amount of hours working in day $min_minutes = $bookingultrapro->get_option('bup_time_slot_length'); if($min_minutes ==''){$min_minutes=15;} $hours = (60/$min_minutes) *$hours; $min_minutes=$min_minutes*60; $html .= '<select id="'.$cbox_id.'" name="'.$cbox_id.'" class="'.$select_start_to_class.'">'; //get default value for this week's day if($select_start_to_class=='bup_select_start') { $from_to_value = 'from'; }else{ $from_to_value = 'to'; } //if($from_to_value == 'from') //{ // ben $html .= '<option '.$selected.' value="">'.__('OFF','bookingup').'</option>'; //} //check selected value $selected_value = $this->get_business_hour_option($day, $from_to_value, $staff_id); for($i = 0; $i <= $hours ; $i++) { $minutes_to_add = $min_minutes * $i; // add 30 - 60 - 90 etc. $timeslot = date('H:i:s', strtotime(0)+$minutes_to_add); $selected = ''; if($selected_value==date('H:i', strtotime($timeslot))) { $selected = 'selected="selected"'; }elseif($selected_value=='24:00' && date('H:i', strtotime($timeslot)) =='00:00'){ $selected = 'selected="selected"'; } if($from_to_value == 'to' && $i == 48) { $sel_value ='24:00'; }else{ $sel_value =date('H:i', strtotime($timeslot)); } //echo "hours:" . $hours; $html .= '<option value="'.$sel_value.'" '.$selected.' >'.date('h:i A', strtotime($timeslot)).'</option>'; } if(!$selected) $selected_OFF = 'selected="selected"'; // ben $html = str_replace('<option value="08:00" >', '<option value="" '.$selected_OFF.'>'.__("OFF",'bookingup').'</option><option value="08:00">', $html); // ben $html .='</select>'; return $html; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘IMPROVEMENT: drop down hours’ is closed to new replies.