-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.php
More file actions
76 lines (67 loc) · 1.62 KB
/
Copy pathsetup.php
File metadata and controls
76 lines (67 loc) · 1.62 KB
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
<?php
/* Hosting module -> $Id: $ */
$config = array(
'mod_name' => 'Hosting',
'mod_version' => '0.1',
'mod_directory' => 'hosting',
'mod_setup_class' => 'SHosting',
'mod_type' => 'user',
'mod_ui_name' => 'Hosting',
'mod_ui_icon' => 'helpdesk.png',
'mod_description' => 'Hosting status and domain names connected to companies',
'mod_config' => false
);
if (@$a == 'setup') {
echo dPshowModuleConfig($config);
}
class SHosting {
function install() {
$ok = true;
$q = new DBQuery;
$sql = "(
`domain_id` int(11) unsigned NOT NULL auto_increment,
`company_id` int(11) NOT NULL,
`domain_name` varchar(150) NOT NULL,
`domain_expiry_date` date NOT NULL,
`domain_registrar` varchar(150) NOT NULL,
`domain_status` varchar(150) NOT NULL,
`domain_notes` text NOT NULL,
PRIMARY KEY (`domain_id`)
)";
$q->createTable('domains');
$q->createDefinition($sql);
$ok = $ok && $q->exec();
$q->clear();
$sql = "(
`hosting_id` int(11) unsigned NOT NULL auto_increment,
`domain_id` int(11) NOT NULL,
`hosting_package_name` varchar(150) NOT NULL,
`hosting_expiry_date` date NOT NULL,
`hosting_status` varchar(150) NOT NULL,
`hosting_notes` text NOT NULL,
PRIMARY KEY (`hosting_id`)
)";
$q->createTable('hosting');
$q->createDefinition($sql);
$ok = $ok && $q->exec();
$q->clear();
if (!$ok)
return false;
return null;
}
function remove() {
$q = new DBQuery;
$q->dropTable('domains');
$q->exec();
$q->clear();
$q->dropTable('hosting');
$q->exec();
$q->clear();
return null;
}
function upgrade($old_version) {
//No newer versions yet!
}
}
?>
?>