Only load datepicker for 2 pages
--- a/common-template.inc.php
+++ b/common-template.inc.php
@@ -1,27 +1,26 @@
<?php
-function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false)
+function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false)
{
echo '
<!DOCTYPE html>
<html>
<head>
<title>' . $pageTitle . '</title>';
- echo '<link rel="stylesheet" href="css/jquery.ui.datepicker.mobile.css" />';
+ if ($datepicker) echo '<link rel="stylesheet" href="css/jquery.ui.datepicker.mobile.css" />';
if (isDebugServer()) echo '<link rel="stylesheet" href="css/jquery-mobile-1.0a3.css" />
<script type="text/javascript" src="js/jquery-1.5.js"></script>
<script type="text/javascript" src="js/jquery-mobile-1.0a3.js"></script>';
else echo '<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>';
- echo '<script>
+ if ($datepicker) echo '<script>
//reset type=date inputs to text
$( document ).bind( "mobileinit", function(){
$.mobile.page.prototype.options.degradeInputs.date = true;
});
</script>
- <script src="js/jQuery.ui.datepicker.js"></script>
- <script src="js/jquery.ui.datepicker.mobile.js"></script>
- <style type="text/css">
+ <script src="js/jQuery.ui.datepicker.js"></script>';
+echo '<style type="text/css">
.ui-navbar {
width: 100%;
}
--- a/mywaybalance.php
+++ b/mywaybalance.php
@@ -1,6 +1,6 @@
<?php
include ('common.inc.php');
-include_header("MyWay Balance", "mywayBalance");
+include_header("MyWay Balance", "mywayBalance", true, false, true);
$return = Array();
function printBalance($cardNumber, $date, $pwrd)
{
@@ -61,3 +61,4 @@
}
include_footer();
?>
+
--- a/tripPlanner.php
+++ b/tripPlanner.php
@@ -1,6 +1,6 @@
<?php
include ('common.inc.php');
-include_header("Trip Planner", "tripPlanner", true, true);
+include_header("Trip Planner", "tripPlanner", true, true, true);
$from = (isset($_REQUEST['from']) ? filter_var($_REQUEST['from'], FILTER_SANITIZE_STRING) : "Brigalow");
$to = (isset($_REQUEST['to']) ? filter_var($_REQUEST['to'], FILTER_SANITIZE_STRING) : "Barry");
$date = (isset($_REQUEST['date']) ? filter_var($_REQUEST['date'], FILTER_SANITIZE_STRING) : date("m/d/Y"));