/
referees.php
96 lines (83 loc) · 1.95 KB
/
referees.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
require_once("crud.php");
class RefereeCrud extends Crud {
public function postUpdateEvent($id) {
$fullname = $_POST['firstname'] . " " . $_POST['lastname'];
$qry = "UPDATE {$_SESSION['DB_PREFIX']}referee SET
name = '$fullname'
WHERE id = $id";
$result = mysql_query($qry);
if (! $result) {
logError($qry . " - " . mysql_error());
}
}
public function postInsertEvent() {
$id = mysql_insert_id();
$fullname = $_POST['firstname'] . " " . $_POST['lastname'];
$qry = "UPDATE {$_SESSION['DB_PREFIX']}referee SET
name = '$fullname'
WHERE id = $id";
$result = mysql_query($qry);
if (! $result) {
logError($qry . " - " . mysql_error());
}
}
/* Post script event. */
public function postScriptEvent() {
?>
<?php
}
}
$crud = new RefereeCrud();
$crud->dialogwidth = 750;
$crud->title = "Referees";
$crud->table = "{$_SESSION['DB_PREFIX']}referee";
$crud->sql = "SELECT A.*
FROM {$_SESSION['DB_PREFIX']}referee A
ORDER BY A.firstname, A.lastname";
$crud->columns = array(
array(
'name' => 'id',
'viewname' => 'uniqueid',
'length' => 6,
'showInView' => false,
'filter' => false,
'bind' => false,
'editable' => false,
'pk' => true,
'label' => 'ID'
),
array(
'name' => 'firstname',
'length' => 30,
'label' => 'First Name'
),
array(
'name' => 'lastname',
'length' => 30,
'label' => 'Last Name'
),
array(
'name' => 'address',
'type' => 'BASICTEXTAREA',
'showInView' => false,
'label' => 'Address 1'
),
array(
'name' => 'email',
'length' => 40,
'label' => 'Email'
),
array(
'name' => 'telephone',
'length' => 16,
'label' => 'Home Telephone'
),
array(
'name' => 'mobile',
'length' => 12,
'label' => 'Mobile'
)
);
$crud->run();
?>