This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
maintenance.contact.php
75 lines (60 loc) · 1.79 KB
/
maintenance.contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
require_once 'functions.php';
require_once 'functions.omat.php';
$section = 6;
$load_menu = 2;
$sub_page = 3;
$id = (int)$_GET['id'];
$project = (int)$_GET['project'];
$info = $db->record("SELECT * FROM mfa_contacts_types WHERE id = $id");
if ($id) {
if ($info->dataset != $project) {
die("No access");
}
}
if ($_POST) {
$post = array(
'name' => html($_POST['name']),
'dataset' => $project,
);
if ($id) {
$db->update("mfa_contacts_types",$post,"id = $id");
} else {
$db->insert("mfa_contacts_types",$post);
$id = $db->lastInsertId();
}
header("Location: " . URL . "omat/$project/maintenance-contacts/saved");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php echo $header ?>
<title>Contacts | <?php echo $info->name ?> | OMAT | <?php echo SITENAME ?></title>
</head>
<body>
<?php require_once 'include.header.php'; ?>
<h1>Types of Contacts</h1>
<?php if ($print) { echo "<div class=\"alert alert-success\">$print</div>"; } ?>
<ol class="breadcrumb">
<li><a href="omat/<?php echo $project ?>/dashboard">Dashboard</a></li>
<li><a href="omat/<?php echo $project ?>/maintenance-contacts">Types of Contacts</a></li>
<li class="active"><?php echo $id ? "Edit" : "Add" ?> Type of Contact</li>
</ol>
<form method="post" class="form form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="name" value="<?php echo $info->name ?>" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Save</button>
</div>
</div>
</form>
<?php require_once 'include.footer.php'; ?>
</body>
</html>