<div class="container well"> <span id="res_msg"> <?php $_FileName = '../store/' . $_SESSION['users'] . '-Schedule.xml'; if (file_exists($_FileName)) { $xml = simplexml_load_file($_FileName); $D = 1; $DD = $xml['Start']; function nextDate($FirstDate) { $FDate = date('m/d/Y', strtotime($FirstDate . "+1 days")); return $FDate; } foreach ($xml as $items) { echo '<div class="col-md-6"><div class="tag-box tag-box-v4"><h5><strong>Day ' . $D . ' schedule</strong>:' . $DD . '</h5>'; $DD = nextDate($DD); $P = 1; foreach ($items as $item) { echo '<span class="label label-success">' . $P . '</span>' . $item . '<br/>'; $P++; } $D++; echo '</div></div>'; } } ?> </span> </div> <div class="container well"> <div id="col-md-12"> <div class="dragger" style="max-height:400px;overflow:scroll;"> </div>
function getDates($arrival_date, $departure_date) { $arr = array(); $tempDate = $arrival_date; while (strtotime($tempDate) <= strtotime($departure_date)) { $arr[] = $tempDate; $tempDate = nextDate($tempDate); } return $arr; }