I'm a beginner in PHP, this is my code
<h3 class="green">Generate Report</h3>
<p>Please select the date range of the report you wish to print.</p>
<form id="generate-pdf" action="print.php" method="post">
<table class="activate-res">
<tr>
<td><p class="form-type-left">Course Activity:</p>
<select id="" name="courseActivity" class="dropdown" >
<option value="">--Unspecified--</option>
<option value="all">All time</option>
<option value="7">Last 7 days</option>
<option value="30">Last 30 days</option>
</select>
</td>
</tr>
</table>
<?php if (isset($_SESSION["site_admin"]) && (int) $_SESSION["site_admin"]) { ?>
<h3 class="green">Select site(s)</h3>
<p>Please select which sites to include in the report.</p>
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
$('#select-all').on('change', function() {
$('.listSite input[type="checkbox"]').prop('checked', this.checked);
});
$('.listSite input[type="checkbox"]').on('change', function () {
var allChecked = $('.listSite input:checked').length === $('.listSite input').length;
$('#select-all').prop('checked', allChecked);
});
});//]]>
</script>
<table class="err_highlight activate-res" style="border:1px solid #fff">
<tr>
<td><input type="checkbox" value="All Sites" id="select-all" name="selectSite"></td>
<td>All Sites</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Chilterns"></td>
<td>Chilterns</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Fakenham"></td>
<td>Fakenham</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Grimsby"></td>
<td>Grimsby</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Head Office"></td>
<td>Head Office</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Headcorn"></td>
<td>Headcorn</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Histon"></td>
<td>Histon</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Killingbeck"></td>
<td>Killingbeck</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Luton"></td>
<td>Luton</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Waterside Park"></td>
<td>Waterside Park</td>
</tr>
<tr>
<td class="listSite"><input name="selectSite" type="checkbox" value="Westwood"></td>
<td>Westwood</td>
</tr>
</table>
<?php } ?>
<!-- onClick="document.location.href='template.php'" -->
<table class="activate-res">
<tr>
<td><input name="submit" type="submit" value="Generate Report" class="log-button" /></td>
<td><input name="cancel" type="button" value="Cancel" class="log-button" onClick="document.location.href='admin-serials.php'" /></td>
</tr>
</table>
</form>
</div><!-- content -->
</div><!-- wrapper -->
<?php include('footer.php') ?>
This is my data generate code but this static i want to dynamic output how can b possible to change? if i select all then they get and display all site data from to database or if i select 7 or 30 day then they get and display to 7 or 30 days data, and the following 10 site show in static but they also change in dynamic if i check the checkbox all or i choose selected then click to generate data. It means i m select Westwood then they get data only westwood or i m select all then they get all data display.
Aucun commentaire:
Enregistrer un commentaire