</option> <?php } ?> </select> </select> <label for="harvestYear">Year: </label> <select name="harvestYear" id="harvestYear"></select> </select> <label for="viewMonth">Month: </label> <select name="viewMonth" id="viewMonth"> <option value="">Select month</option> <?php foreach (listMonths() as $row) { ?> <option value="<?php echo $row; ?> "><?php echo $row; ?> </option> <?php } ?> </select> <hr /> <!-- Modal --> <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
function get_month($mnth) { $ctr = 0; $list = listMonths(); foreach ($list as $item) { $ctr++; $index = $item === $mnth ? $ctr : 0; } return $index; }