来自datepicker的简单PHP过滤器

时间:2017-10-11 07:22:01

标签: php html mysql

我有一些问题需要制作我的第一个PHP过滤器,我想通过从datepicker中选择日期来选择我的SQL表中的所有值。

这是我的php页面:

    <!DOCTYPE html>
    <html lang="en">

    <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <title></title>
    </head>
    <body>

    <!--formden.js communicates with FormDen server to validate fields and 
    submit via AJAX -->
    <script type="text/javascript" 
    src="https://formden.com/static/cdn/formden.js"></script>

    <!-- Special version of Bootstrap that is isolated to content wrapped in 
    .bootstrap-iso -->
    <link rel="stylesheet" href="https://formden.com/static/cdn/bootstrap-
    iso.css" />

    <!--Font Awesome (added because you use icons in your prepend/append)-->
    <link rel="stylesheet" href="https://formden.com/static/cdn/font-
    awesome/4.4.0/css/font-awesome.min.css" />

    <!-- Inline CSS based on choices in "Settings" tab -->
    <style>.bootstrap-iso .formden_header h2, .bootstrap-iso .formden_header p, 
    .bootstrap-iso form{font-family: Arial, Helvetica, sans-serif; color: 
    black}.bootstrap-iso form button, .bootstrap-iso form button:hover{color: 
    white !important;} .asteriskField{color: red;}</style>

    <!-- HTML Form (wrapped in a .bootstrap-iso div) -->
    <div class="bootstrap-iso">
    <div class="container-fluid">
    <div class="row">
    <div class="col-md-6 col-sm-6 col-xs-12">
    <form action="risultati.php" class="form-horizontal" method="post">
     <div class="form-group ">
      <label class="control-label col-sm-2 requiredField" for="date">
       Date
       <span class="asteriskField">
        *
       </span>
      </label>
      <div class="col-sm-10">
       <div class="input-group">
        <div class="input-group-addon">
         <i class="fa fa-calendar">
         </i>
        </div>
        <input class="form-control" id="date" name="date" 
        placeholder="DD/MM/YYYY" type="text"/>
         </div>
        </div>
       </div>
       <div class="form-group">
      <div class="col-sm-10 col-sm-offset-2">
       <input name="data_sel" style="display:none" type="text"/>
       <button class="btn btn-primary " name="submit" type="submit">
        Submit
       </button>
      </div>
     </div>
    </form>
   </div>
  </div>
 </div>
</div>

<br><br><br><br>
<div>
    <table style="width:100%">
        <tr>

        <td style="width:16,6%; text-align:center">1</td>
        <td style="width:16,6%; text-align:center">1</td>
        <td style="width:16,6%; text-align:center">1</td>
        <td style="width:16,6%; text-align:center">1</td>
        <td style="width:16,6%; text-align:center">1</td>
        <td style="width:16,6%; text-align:center">1</td>

        </tr>
    </table>
</div>

<!-- Extra JavaScript/CSS added manually in "Settings" tab -->
<!-- Include jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>

<!-- Include Date Range Picker -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>

<script>
    $(document).ready(function(){
        var date_input=$('input[name="date"]'); //our date input has the name "date"
        var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body";
        date_input.datepicker({
            format: 'dd/mm/yyyy',
            container: container,
            todayHighlight: true,
            autoclose: true,
        })
    })
</script>

</body>

</html>

这是我的表:

ID,ARTICOLAZIONE,NOME1,NOME2,PHONE,INDIRIZZO,CITTA

我知道我必须创建连接到我的数据库的connection.php文件和将结果插入我的HTML表格(在datepicker下)的另一个文件。

0 个答案:

没有答案