TransMékong
Mekong-delta.com

The welcoming rice bowl of Vietnam

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


en:0_bassac:2_availability [2023/10/19 11:18] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +/*                  WARNING !                             */
  
 +/*     TEAM :       IF YOU EDIT THIS PAGE,                */
 +
 +/*                  DO NOT APPROVE IT: IT WILL BREAK. ​    */
 +
 +/*                  instead, contact Ben                  */
 +
 +~~NOCACHE~~
 +
 +[[.:0_bassac|{{:en:0_bassac:bassac_logo.png?180 |Logo Bassac}}]]
 +<html><div style="height: 0.1rem"></div></html>
 +
 +{{section>:admin:commercial:site notice#en bassac&noheader}}
 +
 +====== Availability ======
 +
 +<html><div style='float: left; font-family: "Cormorant Upright", serif; font-size: 1.2rem; line-height: 1.4; margin: 1.5rem 2rem 1.5rem 0; border: none; background: #e2d1c4; padding: .4rem 1rem .3rem 1.5rem; box-shadow: 3px 3px 12px -6px rgba(0,0,0,1);'></html>
 +
 +
 +<php>
 +/* Parameter: $calendar_blackout
 + * Number of days in the future to NOT offer availability.
 + */
 +$calendar_blackout = 0;     # 0 when last minute promotions do not apply
 +
 +
 +echo '<h4>Today and tomorrow</h4>';
 +/*
 +  Last minute availabilities
 + */
 +_tpl_load_live('https://transmekong.com/dispo.php?lang=en');
 +
 +echo "</div>";
 +
 +/*
 +  Production of the short date form for availabilities
 + */
 +$monthsfrom = ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12", "janv.", "févr.", "mars", "avr.", "mai", "juin", "juil.", "août", "sept.", "oct.", "nov.", "déc."];
 +$monthsto = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
 +
 +$params = explode('&', substr($_SERVER['QUERY_STRING'], strpos($_SERVER['QUERY_STRING'], '?')));
 +foreach($params as $param){
 +    $equa = explode('=', $param);
 +    if ($equa[0] === 'date'){
 +        $dateorg = str_replace($monthsfrom, $monthsto, urldecode($equa[1]));
 +        $date = date('d M Y', strtotime($dateorg));
 +    }
 +}
 +if (empty($date)){
 +    $date = date('d M Y');
 +}
 +
 +echo "<h4 style='clear: left;'>Availability around your date</h4>";
 +
 +echo "<p>These are the availability to <i>join in on a scheduled departure</i>. Please see <a href='1.0_charter'>the itineraries</a> if you like to charter a Bassac.</p>\n";
 +
 +echo "<form method='get' action='${_SERVER['SCRIPT_URI']}'><input name='date' type='text' size='15' value='${date}' id='datepicker' /><input type='submit' value='Send'></form>\n\n";
 +
 +echo "<div style='clear: both'></div>";
 +
 +$datetxt = date ('l F j, Y', strtotime($date));   # Tune format for language
 +
 +/*
 +  Collection and display of the availability for these dates
 + */
 +
 +$dateurl = urlencode($date);
 +
 +_tpl_load_live("https://transmekong.com/dispo_table.php?lang=en&date=${dateurl}&wiki=1");
 +
 +$fromdate = date('Y-m-d', strtotime("today") + $calendar_blackout * 86400);
 +
 +echo <<<JQUI_CALENDAR
 +<script type="text/javascript">/*<![CDATA[*/
 +var timestamp = Date.parse("${fromdate}");
 +var fromDate = new Date(timestamp);
 +
 +jQuery( function() {
 +  jQuery( "#datepicker" ).datepicker({
 +    dateFormat: "dd M yy",
 +    minDate: fromDate,
 +    hideIfNoPrevNext: true,
 +    monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
 +  });
 +} );
 +/*!]]>*/</script>
 +
 +JQUI_CALENDAR;
 +
 +</php>
 +
 +For any date inaccessible through the calendar, please [[mailto:sales@mekong-delta.com|contact us]] for availabilities.
 +
 +----
 +
 +====== ======
 +{{page>:en:terms:partners:bassac}}