Remove some old files, updated guest urls to work with the new multi company features, and some other multi company update

This commit is contained in:
johnny@pittpc.com
2019-08-15 18:29:28 -04:00
parent 01f820b394
commit 5ca8d201b0
25 changed files with 554 additions and 1483 deletions

View File

@@ -297,6 +297,41 @@ if(isset($_POST['edit_user'])){
}
if(isset($_POST['add_company'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$name', company_created_at = NOW()");
$_SESSION['alert_message'] = "Company added";
header("Location: companies.php");
}
if(isset($_POST['edit_company'])){
$company_id = intval($_POST['company_id']);
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
mysqli_query($mysqli,"UPDATE companies SET company_name = '$name', company_updated_at = NOW() WHERE company_id = $company_id");
$_SESSION['alert_message'] = "Company modified";
header("Location: companies.php");
}
if(isset($_GET['delete_company'])){
$company_id = intval($_GET['delete_company']);
mysqli_query($mysqli,"DELETE FROM companies WHERE company_id = $company_id");
$_SESSION['alert_message'] = "Company deleted";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['add_client'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));