如何消除用户在其先前订单的月份之前订购?

时间:2019-07-18 10:08:35

标签: php mysql

我创建了表“ WaitMonth”表,我希望在工作人员完成用户请求后,将用户信息从“ StationaryCustomersInfo”表中删除,并存储到“ WaitMonth”表中,并在一个月后删除其信息。 每次用户想要再次订购时,系统都会检查他是否存在于“ WaitMonth”中,如果存在,则显示消息“您有24天取消订购的时间”,其中24是计数器,用于计算多少天仍要取消阻止用户。

$query=mysqli_query($link,"SELECT EMP_ID, EMP_Email FROM Employees WHERE EMP_ID=$id");

        //hide backend errors from the users
        error_reporting(0);

     while($row=mysqli_fetch_assoc($query)){

         // make case insinsitive to more accurate validation
         if(strtolower($email)==strtolower($row['EMP_Email'])){

              $query=mysqli_query($link,"SELECT * FROM WaitMonth WHERE C_ID=$id");
             if( strtotime($row['C_RequestedDate']) < date("Y-m-d")){

             /* ------ storing the employee informations temporarily at stationary database ------ */
                 $query=mysqli_query($link, "INSERT INTO StationaryCustomersInfo VALUES('$id', '$email', '$RequestingDate')");
                 $query=mysqli_query($link, "INSERT INTO WaitMonth VALUES('$id', '$RequestingDate')");
         }else{
                 echo "Error";
             }
         }else{
             echo "You should Enter your official email.";
             exit;
         }
     }   

0 个答案:

没有答案