<?php
// session_start();
// ob_start();
// $father = $_SESSION["user_id"];
include "../actions/dbPDO.php";

$sql = $db->prepare("SELECT material_in.mat_invoice_date , items_line.line_id
  from material_in , items_line
  where material_in.mat_in_id = items_line.mat_in_id
 AND items_line.line_id in(SELECT line_in FROM item_line_out WHERE date_out > '2018-3-31')");
$sql->execute();
if($sql->rowCount()>0)
{
   $up1=$db->prepare("UPDATE item_line_out set date_out = ?  where line_in = ?");
 while($row = $sql->fetch())
 { $line_id = $row["line_id"];
   $mat_invoice_date = $row["mat_invoice_date"];
     $up1->bindParam(1,$mat_invoice_date);
     $up1->bindParam(2,$line_id);
     $up1->execute();
 }
}

?>
