diff --git a/ajax/ajax_vue_requisitions.php b/ajax/ajax_vue_requisitions.php index bc75e09..77870d8 100644 --- a/ajax/ajax_vue_requisitions.php +++ b/ajax/ajax_vue_requisitions.php @@ -1062,7 +1062,7 @@ if ($request == 'confirm_reqs') { echo "error: "; } if ($confirm == 1) { - $sqlup = "UPDATE user_client_events SET user_id=".$new_who_work." WHERE req_id=".$r['id']." and `type` != 'step' and `type` != 'file'"; + $sqlup = "UPDATE user_client_events SET user_id=".$new_who_work." WHERE req_id=".$r['id']." and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)"; $rez = $pdo->query($sqlup); } else if ($confirm == 0) { $sql_conf = "INSERT INTO `events_clients` (`user_id`, `req_id`, `from_id`, `event`) VALUES (".$user_id.", ".$r['id'].", ".$new_who_work.", 'transmitted')"; @@ -1397,7 +1397,7 @@ if ($request == 'confirm_on_reqs') { $pdo->query($sql); // echo $sql."\n"; - $sql = "UPDATE user_client_events SET user_id=$user_id WHERE req_id=$r[id] and type != 'step' and type != 'file'"; + $sql = "UPDATE user_client_events SET user_id=$user_id WHERE req_id=$r[id] and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)"; $pdo->query($sql); //echo $sql."\n"; $sql = "UPDATE `events_clients` set `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id=$r[id] and from_id = ".$user_id; @@ -1456,7 +1456,7 @@ if ($request == 'confirm_on_clients') { $pdo->query($sql); //echo $sql."\n"; - $sql = "UPDATE user_client_events SET user_id=$user_id WHERE client_id=$r[id] and type != 'step' and type != 'file'"; + $sql = "UPDATE user_client_events SET user_id=$user_id WHERE client_id=$r[id] and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)"; $pdo->query($sql); //echo $sql."\n"; $sql = "UPDATE `events_clients` set `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE client_id=$r[id] and from_id = ".$user_id; @@ -1975,7 +1975,7 @@ if ($request == 'mass_take_from_closed') { $pdo->query($sql); // echo $sql."\n"; - $sql = "UPDATE user_client_events SET user_id=$user_id WHERE req_id=$r[id] and type != 'step' and type != 'file'"; + $sql = "UPDATE user_client_events SET user_id=$user_id WHERE req_id=$r[id] and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)"; $pdo->query($sql); //echo $sql."\n"; $sql = "UPDATE `events_clients` set `read` = 1, date_update='".date('Y-m-d H:i:s')."' WHERE req_id=$r[id] and from_id = ".$user_id; diff --git a/ajax/confirmClient.php b/ajax/confirmClient.php index 34bb6c7..fa93560 100644 --- a/ajax/confirmClient.php +++ b/ajax/confirmClient.php @@ -169,7 +169,7 @@ if($_SESSION['id'] && ($_GET['id'] || $_GET['req_id'])) if($tr != 1){ $sql="UPDATE user_client_events SET user_id=$_GET[who_work] WHERE client_id=$_GET[id] and type != 'step' and type != 'file'"; if($req_id > 0){ - $sql = "UPDATE user_client_events SET user_id=$_GET[who_work] WHERE req_id=$req_id and type != 'step' and type != 'file'"; + $sql = "UPDATE user_client_events SET user_id=$_GET[who_work] WHERE req_id=$req_id and type NOT IN ('step', 'file') AND NOT (type = 'deal' AND deal_id > 0)"; } mysql_query($sql); }