change the input method for X window

im-switch -c

以下是生成名为Apply Leave和Leave Detail的两个折叠框的完整PHP代码。请注意,该代码使用了Bootstrap框架和jQuery库。 ```php <!DOCTYPE html> <html> <head> <title>Apply Leave</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <script> $(document).ready(function(){ $("#leave-type").change(function(){ if($(this).val() == "Annual Leave" || $(this).val() == "No Pay Leave" || $(this).val() == "Compensation Leave"){ $("#leave-start, #leave-end").prop("required", true).show(); } else { $("#leave-start, #leave-end").prop("required", false).hide(); } }); $("#leave-start, #leave-end").change(function(){ var start = new Date($("#leave-start").val()); var end = new Date($("#leave-end").val()); var days = Math.round((end - start) / (1000 * 60 * 60 * 24)) + 1; $("#leave-days").val(days); }); $(window).resize(function(){ if($(window).width() < 768){ $(".panel-heading").removeClass("text-center").addClass("text-left"); $(".panel-body").removeClass("text-center").addClass("text-left"); $(".panel-body table").removeClass("table-responsive"); } else { $(".panel-heading").removeClass("text-left").addClass("text-center"); $(".panel-body").removeClass("text-left").addClass("text-center"); $(".panel-body table").addClass("table-responsive"); } }).trigger("resize"); }); </script> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-6"> <div class="panel panel-default"> <div class="panel-heading text-center"> Apply Leave </div> <div class="panel-body text-center"> <form method="post"> <div class="form-group"> <label for="leave-type">Leave Type:</label> <select class="form-control" id="leave-type" name="leave-type" required> <option value="">Select Leave Type</option> <option value="Annual Leave">Annual Leave</option> <option value="No Pay Leave">No Pay Leave</option> <option value="Compensation Leave">Compensation Leave</option> <option value="Other">Other</option> </select> </div> <div class="form-group"> <label for="leave-start">Leave Start:</label> <input type="date" class="form-control" id="leave-start" name="leave-start" required> </div> <div class="form-group"> <label for="leave-end">Leave End:</label> <input type="date" class="form-control" id="leave-end" name="leave-end" required> </div> <div class="form-group"> <label for="leave-days">Leave Days:</label> <input type="number" class="form-control" id="leave-days" name="leave-days" readonly> </div> <button type="submit" class="btn btn-primary">Apply</button> </form> </div> </div> </div> <div class="col-sm-6"> <div class="panel panel-default"> <div class="panel-heading text-center"> Leave Detail </div> <div class="panel-body"> <table class="table table-striped table-bordered table-responsive"> <thead> <tr> <th>Date</th> <th>Leave Type</th> <th>Leave Days</th> </tr> </thead> <tbody> <tr> <td>2021-01-01</td> <td>Annual Leave</td> <td>1</td> </tr> <tr> <td>2021-02-15</td> <td>No Pay Leave</td> <td>3</td> </tr> <tr> <td>2021-05-01</td> <td>Compensation Leave</td> <td>1</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> </body> </html> ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值