简体   繁体   English

Enable Disable specific date from input type=date 当日期存储在数据库中时

[英]Enable Disable specific date from input type=date when date stored in DB

I have a form to assign my employee work by date.我有一个表格可以按日期分配我的员工工作。

 <?php //for db connection
   include '../../database/dbconnect.php';
 ?>


 <form method="post" action="">
    <select name="fname">
        <option></option>
        <option>Masud</option>
        <option>Sharmin</option>
        <option>Ahsan</option>
        <option>Nobel</option>
    </select>
    <input type="date" name="assign_date">
    <input type="submit" name="submit" value="ASSIGN">
  </form>

all fname option is stored in assign_roster table and has column ros_day which has specific date like 2018-11-10.所有 fname 选项都存储在 assign_roster 表中,并且具有 ros_day 列,该列具有特定日期,例如 2018-11-10。

Now if i select Masud then date 2018-11-10 should be disable from input date, coz i dont want to assign same person in same day.现在,如果我选择 Masud,那么日期 2018-11-10 应该从输入日期禁用,因为我不想在同一天分配同一个人。

How can i do this ?我怎样才能做到这一点 ? Please Help :-)请帮忙 :-)

if you're using database so you can add two columns in your users table first one name it 'check' for example values will be 0 or 1 , so when option is selected 'check' will be =1 and add the date in the添加了第二列,因此当您下次列出您的选项时,您将只有可用日期和用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM