-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
74 lines (67 loc) · 1.87 KB
/
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
<?php
/**
* contact.php
*
* Displays contact specified in the URL get value
*
* @author Angus Vine <[email protected]>
* @version 1.0
* @since 5.5 (The php version used)
*/
require_once 'core/init.php';
//Check to see if the contact exists
if (Input::exists('get')) {
$contact = new Contact();
if ($contact->exists($_GET['id'])) {
include 'includes/head.inc.php';
?>
<script type="text/javascript">
function confirm_alert(node) {
return confirm("Are you sure you want to DELETE this record?\nIt will be erased from the database...");
}
</script>
<div class="sub-headerContainer">
<div class="sub-header">
<h2><?php echo $contact->data()->first_name . " " . $contact->data()->last_name?></h2>
</div>
<div class="sub-navigation">
<span>
<a href="update.php?id=<?php echo $contact->data()->id; ?>">Update</a> |
<a href="delete.php?id=<?php echo $contact->data()->id; ?>" onclick="return confirm_alert(this);">Delete</a>
</span>
</div>
</div>
<?php
//Creates the form and display the data
$form = array(
'action' => '',
'method' => '',
'band' => $contact->data()->band,
'id' => $contact->data()->id,
'first_name' => $contact->data()->first_name,
'last_name' => $contact->data()->last_name,
'email' => $contact->data()->email,
'phone' => $contact->data()->phone,
'mobile' => $contact->data()->mobile,
'company' => $contact->data()->company,
'add_line_1' => $contact->data()->add_line_1,
'add_line_2' => $contact->data()->add_line_2,
'show_state' => false,
'state' => $contact->data()->state,
'city' => $contact->data()->city,
'post_code' => $contact->data()->post_code,
'show_notes' => true,
'notes' => $contact->data()->notes,
'show_button' => false,
'button' => '',
'read_only' => true
);
include 'includes/contact-form.php';
include 'includes/foot.inc.php';
} else {
header('Location: index.php');
}
} else {
header('Location: index.php');
}
?>