SHARE
TWEET

Untitled

a guest Nov 9th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (isset($_POST['projecttoevoegen'])){
  2.     $deadline = $connectie->real_escape_string($_POST['deadline']);
  3.     $start = $connectie->real_escape_string($_POST['startdate']);
  4.     if($deadline >= date("Y-m-d",time()) && $deadline >= $start){
  5.         $naam = $connectie->real_escape_string($_POST['projectname']);
  6.         $mainid= $connectie->real_escape_string($_POST['mainid']);
  7.         $project_eigenaarsql= $connectie->query("SELECT * FROM userproject WHERE projectid = $mainid AND roleid= 1");
  8.         $project_deelnemersql = $connectie->query("SELECT * FROM userproject WHERE projectid = $mainid AND roleid= 2");
  9.         $sqlproject= "INSERT INTO projects (mainprojectid,name,startdate,enddate) VALUES ($mainid,'".$naam."','$start', '$deadline')";
  10.         if ($connectie->query($sqlproject) === TRUE) {
  11.             $new_project_id = $connectie->insert_id;
  12.             while ($project_eigenaar = $project_eigenaarsql->fetch_assoc()) {
  13.                 $project_eigenaar_id = $project_eigenaar['userid'];
  14.                 $eigenaar_sql ="INSERT INTO userproject (userid, projectid, roleid) VALUES ($project_eigenaar_id,$new_project_id,1)";
  15.                 $connectie->query($eigenaar_sql);
  16.             }
  17.             while ($project_deelnemer = $project_deelnemersql->fetch_assoc()) {
  18.                 $project_deelnemer_id = $project_deelnemer['userid'];
  19.                 $deelnemer_sql ="INSERT INTO userproject (userid, projectid, roleid) VALUES ($project_deelnemer_id,$new_project_id,2)";
  20.                 $connectie->query($deelnemer_sql);
  21.             }
  22.         }
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top