mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Update to change the client tag to singular as it references one record the table name should remain plural
This commit is contained in:
10
post.php
10
post.php
@@ -674,7 +674,7 @@ if(isset($_GET['delete_company'])){
|
||||
$sql = mysqli_query($mysqli,"SELECT client_id FROM clients WHERE company_id = $company_id");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$client_id = $row['client_id'];
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tags_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tag_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM shared_items WHERE item_client_id = $client_id");
|
||||
}
|
||||
mysqli_query($mysqli,"DELETE FROM clients WHERE company_id = $company_id");
|
||||
@@ -1835,7 +1835,7 @@ if(isset($_POST['add_client'])){
|
||||
if(isset($_POST['tags'])){
|
||||
foreach($_POST['tags'] as $tag){
|
||||
$tag = intval($tag);
|
||||
mysqli_query($mysqli,"INSERT INTO client_tags SET client_tags_client_id = $client_id, client_tags_tag_id = $tag");
|
||||
mysqli_query($mysqli,"INSERT INTO client_tags SET client_tag_client_id = $client_id, client_tag_tag_id = $tag");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1897,12 +1897,12 @@ if(isset($_POST['edit_client'])){
|
||||
|
||||
//Tags
|
||||
//Delete existing tags
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tags_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tag_client_id = $client_id");
|
||||
|
||||
//Add new tags
|
||||
foreach($_POST['tags'] as $tag){
|
||||
$tag = intval($tag);
|
||||
mysqli_query($mysqli,"INSERT INTO client_tags SET client_tags_client_id = $client_id, client_tags_tag_id = $tag");
|
||||
mysqli_query($mysqli,"INSERT INTO client_tags SET client_tag_client_id = $client_id, client_tag_tag_id = $tag");
|
||||
}
|
||||
|
||||
//Logging
|
||||
@@ -1972,7 +1972,7 @@ if(isset($_GET['delete_client'])){
|
||||
mysqli_query($mysqli,"DELETE FROM api_keys WHERE api_key_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM assets WHERE asset_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM certificates WHERE certificate_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tags_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_tag_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM contacts WHERE contact_client_id = $client_id");
|
||||
mysqli_query($mysqli,"DELETE FROM documents WHERE document_client_id = $client_id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user