require("./global.php");
// echo($_SESSION);
$primaryTableName = "parent_company";
array(
// field_name [type, isrequired, array_select, inner_type] <= "template"
"site_name" => ["input", "", "", "text"],
"phone_number" => ["input", "", "", "text"],
"address" => ["input", "", "", "address"],
"email" => ["input", "", "", "email"],
"contact_name" => ["input", "", "", "text"],
"account_status" => ["input", "", "", "text"],
"internal_notes" => ["input", "", "", "text"],
"file" => ["input", "", "", "file"],
"historic_tickets" => ["input", "", "", "text"],
"security_pin" => ["input", "", "", "text"],
);
if (isset($_POST['create_package'])) {
$actionId = escape(($_POST['actionId']));
$site_name = escape($_POST['site_name']);
$phone_number = escape($_POST['phone_number']);
$address = escape($_POST['address']);
$email = escape($_POST['email']);
// $address = escape($_POST['address']);
$city = escape($_POST['city']);
$zip_code = escape($_POST['zip_code']);
// $contact_name = escape($_POST['contact_name']);
$contact_name = isset($_POST['contact_name']) ? implode(',', $_POST['contact_name']) : '';
$account_status = escape($_POST['account_status']);
$internal_notes = escape($_POST['internal_notes']);
$historic_tickets = escape($_POST['historic_tickets']);
$security_pin = escape($_POST['security_pin']);
if ($actionId == "") {
$id = generateRandomString();
$actionId = $id;
$query = "insert into jeoXillityCrm_parent_company set id='$id' , site_name='$site_name', phone_number='$phone_number', email='$email', address='$address', city='$city', zip_code='$zip_code', contact_name='$contact_name', account_status='$account_status', internal_notes='$internal_notes', historic_tickets='$historic_tickets', security_pin='$security_pin', timeAdded='$timeAdded', userId='$session_userId' ";
} else {
$query = "update jeoXillityCrm_parent_company set id='$actionId' , site_name='$site_name', phone_number='$phone_number', email='$email', address='$address', city='$city', zip_code='$zip_code', contact_name='$contact_name', account_status='$account_status', internal_notes='$internal_notes', historic_tickets='$historic_tickets', security_pin='$security_pin' where id='$actionId'";
}
runQuery($query);
$file = storeFile($_FILES['file']);
if ($file != "") {
$query = "update jeoXillityCrm_parent_company set file='$file' where id='$actionId'";
runQuery($query);
}
header("Location: ?" . generateUrlParams_return(["m" => "Data was saved successfully!", "type" => "success"]));
exit();
}
if (isset($_GET['delete-record'])) {
$id = escape($_GET['delete-record']);
$chk = "select * from jeoXillityCrm_tickets where company_name='$id'";
$chk_run = mysqli_query($con, $chk);
if(mysqli_num_rows($chk_run) > 0){
echo "";
}else{
$query = "delete from jeoXillityCrm_parent_company where id='$id'";
runQuery($query);
}
}
$chk = "select * from jeoXillityCrm_general_info_setting where userId='$session_userId'";
$chk_run = mysqli_query($con, $chk);
$general_info_setting = mysqli_fetch_assoc($chk_run);
?>
include("./includes/views/head2.php"); ?>
include("./includes/views/navbar.php"); ?>
include("./includes/views/rightsidebar.php"); ?>
include("./includes/views/leftmenu.php"); ?>
| Company name |
Phone number |
Location |
Email |
Contact name |
Account status |
Internal notes |
File |
Historic tickets |
Actions |