-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.php
More file actions
63 lines (55 loc) · 1.66 KB
/
Copy pathsetup.php
File metadata and controls
63 lines (55 loc) · 1.66 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
<?php
/*
* Name: Payments
* Directory: payments
* Version: 0.1
* Class: user
* UI Name: Payments
* UI Icon: monkeychat-48.png
*/
// MODULE CONFIGURATION DEFINITION
$config = array();
$config['mod_name'] = 'Payments';
$config['mod_version'] = '0.1';
$config['mod_directory'] = 'payments';
$config['mod_setup_class'] = 'CSetupPayments';
$config['mod_type'] = 'user';
$config['mod_ui_name'] = 'Payments';
$config['mod_ui_icon'] = 'applet3-48.png';
$config['mod_description'] = 'A module for payments';
if (@$a == 'setup') {
echo dPshowModuleConfig( $config );
}
class CSetupPayments {
function install() {
$sql = "CREATE TABLE payments (" .
"payment_id int(11) NOT NULL auto_increment," .
"payment_company int(11) NOT NULL default '0'," .
"payment_authcode int(11) NOT NULL default '0'," .
"payment_amount float(5,2) NOT NULL default '0.00'," .
"payment_type int(11) NOT NULL default '0'," .
"payment_date datetime NOT NULL default '0000-00-00 00:00:00'," .
"payment_owner int(11) NOT NULL default '0'," .
"PRIMARY KEY (payment_id)" .
") TYPE=MyISAM";
db_exec( $sql );
$sql2 = "CREATE TABLE invoice_payment (" .
"payment_id int(11) NOT NULL default '0'," .
"invoice_id int(11) NOT NULL default '0'," .
"KEY invoice_id (invoice_id)," .
"KEY payment_id (payment_id)" .
") TYPE=MyISAM";
db_exec( $sql2 );
return null;
}
function remove() {
db_exec( "DROP TABLE payments" );
db_exec( "DROP TABLE invoice_payment" );
db_exec( "delete from permissions where permission_grant_on like 'payments'");
return null;
}
function upgrade() {
return null;
}
}
?>