Пример #1
0
/**
 * Find all yyyy-mm-yy date in input string and replace it with new date format given by format parameter
 * @param type $string
 * @param type $format
 */
function reformat_date_string($string, $format = '', $timeFormat = 24)
{
    if ($format == '' && $timeFormat == 24) {
        return $string;
    }
    $dateArray = preg_match_all("/(\\d{4}-\\d{2}-\\d{2})/", $string, $match);
    if (is_array($match)) {
        $match = $match[0];
    }
    foreach ($match as $d) {
        $string = str_replace($d, date(date_format_php($format), strtotime($d)), $string);
    }
    if ($timeFormat != 24) {
        $timeArray = preg_match_all("/(\\d{2}:\\d{2}:\\d{2})/", $string, $match);
        if (is_array($match)) {
            $match = $match[0];
        }
        foreach ($match as $d) {
            $string = str_replace($d, carrental_time_format(substr($d, 0, 5), $timeFormat), $string);
        }
    }
    $disable_time = get_option('carrental_disable_time');
    if ($disable_time == 'yes') {
        $timeArray = preg_match_all("/(\\d{2}:\\d{2}:\\d{2})/", $string, $match);
        if (is_array($match)) {
            $match = $match[0];
        }
        foreach ($match as $d) {
            $string = str_replace($d, '', $string);
        }
    }
    return $string;
}
Пример #2
0
        ?>
><?php 
        echo carrental_time_format(str_pad($x, 2, '0', STR_PAD_LEFT) . ':00', isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
        ?>
</option>
													<option value="<?php 
        echo str_pad($x, 2, '0', STR_PAD_LEFT);
        ?>
:30" <?php 
        if (isset($_GET['th']) && $_GET['th'] == str_pad($x, 2, '0', STR_PAD_LEFT) . ':30') {
            ?>
selected<?php 
        }
        ?>
><?php 
        echo carrental_time_format(str_pad($x, 2, '0', STR_PAD_LEFT) . ':30', isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
        ?>
</option>
												<?php 
    }
    ?>
											</select>
											<span class="control-addon-item display-none" style="right:-8px;">
												<span class="sprite-time"></span>
											</span>
										</span>
									</div>
								</div>
							</div>
							<?php 
} else {
Пример #3
0
                echo carrental_time_format(substr($vD->hours_from, 0, 5), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                ?>
 - <?php 
                echo carrental_time_format(substr($vD->hours_to, 0, 5), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                ?>
												<?php 
                if (isset($vD->hours_from_2) && $vD->hours_from_2 != '' && $vD->hours_from_2 != '00:00:00') {
                    ?>
													<?php 
                    if (isset($vD->hours_to_2) && $vD->hours_to_2 != '' && $vD->hours_to_2 != '00:00:00') {
                        ?>
													 | <?php 
                        echo carrental_time_format(substr($vD->hours_from_2, 0, 5), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                        ?>
 - <?php 
                        echo carrental_time_format(substr($vD->hours_to_2, 0, 5), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                        ?>
													<?php 
                    }
                    ?>
												<?php 
                }
                ?>
												</dd>
											</dl>
										<?php 
            }
            ?>
									<?php 
        }
        ?>
Пример #4
0
                ?>
][<?php 
                echo $vD->day;
                ?>
]['from_2'] = '<?php 
                echo carrental_time_format($vD->hours_from_2, isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                ?>
';
						branch_hours[<?php 
                echo $val->id_branch;
                ?>
][<?php 
                echo $vD->day;
                ?>
]['to_2'] = '<?php 
                echo carrental_time_format($vD->hours_to_2, isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
                ?>
';
			<?php 
            }
            ?>
		<?php 
        }
        ?>
	<?php 
    }
}
?>
	
		var car_availability = {};
		var ajax_loading = {};
Пример #5
0
    }
    ?>
													</p>

													<div class="icon-text highlight">
														<span class="sprite-calendar"></span> <?php 
    echo Date(date_format_php(isset($theme_options['date_format']) ? $theme_options['date_format'] : ''), strtotime($_GET['td']));
    ?>
            
													</div>
													<?php 
    if (!$disable_time) {
        ?>
													<div class="icon-text highlight">
														<span class="sprite-time"></span> <?php 
        echo carrental_time_format(Date('H:i', strtotime($_GET['th'])), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
        ?>
													</div>
													<?php 
    }
    ?>
													
													<?php 
    if (isset($_GET['search']) && !empty($_GET['search'])) {
        ?>
														<script type="text/javascript">
															jQuery(document).ready(function() {
																jQuery('.highlight').effect( 'highlight', {}, 2000);
															});
														</script>
													<?php 
Пример #6
0
													<p class="point-location"><?php 
    echo $summary['info']->return_loc;
    ?>
</p>

													<div class="icon-text">
														<span class="sprite-calendar"></span><?php 
    echo Date(date_format_php(isset($theme_options['date_format']) ? $theme_options['date_format'] : ''), strtotime($summary['info']->return_date));
    ?>
													</div>
													<?php 
    if (!$disable_time) {
        ?>
													<div class="icon-text">
														<span class="sprite-time"></span><?php 
        echo carrental_time_format(Date('H:i', strtotime($summary['info']->return_date)), isset($theme_options) && isset($theme_options['time_format']) ? $theme_options['time_format'] : 24);
        ?>
													</div>
													<?php 
    }
    ?>

												</div>
											</div>

											<div class="columns-2">
												<div class="column">

													<h5><?php 
    echo CarRental::t('Car Type');
    ?>