jeudi 21 septembre 2017

how to use which mysql query to get dynamic data to fetch into the database

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') ?>

first off all i m convert this html to dynamic to use of mysql query and this database table name is "site"...which query use in this html and how to get selected checkbox data value display in print.php page...this all html related to generate data to selected checkbox vale...and all checkbox site value store in mysql database......i m try to just dispaly to all value




Aucun commentaire:

Enregistrer un commentaire