-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
120 lines (108 loc) · 6.34 KB
/
init.php
File metadata and controls
120 lines (108 loc) · 6.34 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
include 'config.php';
$Table_users = "CREATE TABLE IF NOT EXISTS {$config->Table_users} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_users_unique_id varchar(255) NOT NULL PRIMARY KEY,
$config->COL_users_first_name varchar(255) NOT NULL,
$config->COL_users_last_name varchar(255) NOT NULL,
$config->COL_users_gender boolean NOT NULL,
$config->COL_users_verify_status INT(1) NOT NULL DEFAULT 0,
$config->COL_users_address1 TEXT NULL,
$config->COL_users_address2 TEXT NULL,
$config->COL_users_address3 TEXT NULL,
$config->COL_users_city varchar(255) NOT NULL,
$config->COL_users_state varchar(255) NOT NULL,
$config->COL_users_country_residence varchar(255) NOT NULL,
$config->COL_users_zip INT NOT NULL,
$config->COL_users_mobile_number varchar(50) NOT NULL,
$config->COL_users_date_of_birth DATE,
$config->COL_users_id_type varchar(255) NOT NULL,
$config->COL_users_id_number INT NOT NULL,
$config->COL_users_id_issue_date DATE,
$config->COL_users_id_valid_date DATE,
$config->COL_users_userRegistration_unique_id varchar(255) NOT NULL,
$config->COL_users_account_type int(1) default 0,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT $config->COL_users_userRegistration_unique_id FOREIGN KEY ($config->COL_users_userRegistration_unique_id)
REFERENCES $config->Table_userRegistration ($config->COL_userRegistration_unique_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$Table_company = "CREATE TABLE IF NOT EXISTS {$config->Table_company} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_company_unique_id varchar(255) NOT NULL PRIMARY KEY,
$config->COL_company_name varchar(255) NOT NULL,
$config->COL_company_phone_number INT NOT NULL,
$config->COL_company_url varchar(255) NOT NULL,
$config->COL_company_bussiness_nature varchar(255) NOT NULL,
$config->COL_company_customer_type_q TEXT NULL,
$config->COL_company_customer_info_q TEXT NULL,
$config->COL_company_user_url_q varchar(255) NOT NULL,
$config->COL_company_expt_avgorder_q varchar(255) NOT NULL,
$config->COL_company_activity_nature_q varchar(255) NOT NULL,
$config->COL_company_bankdetails_q TEXT NULL,
$config->COL_users_userRegistration_unique_id varchar(255) NOT NULL,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$Table_usersImage = "CREATE TABLE IF NOT EXISTS usersImage (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
usersImage_unique_id varchar(255) NOT NULL PRIMARY KEY,
usersImage_userRegistration_unique_id VARCHAR (255) NOT NULL,
usersImage_image VARCHAR (255) NOT NULL, created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT usersImage_userRegistration_unique_id FOREIGN KEY (usersImage_userRegistration_unique_id)
REFERENCES userRegistration (userRegistration_uniqueId) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8";
$Table_userRegistration = "CREATE TABLE IF NOT EXISTS {$config->Table_userRegistration} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_userRegistration_unique_id varchar(255) NOT NULL PRIMARY KEY,
$config->COL_userRegistration_username varchar(255) NOT NULL,
$config->COL_userRegistration_email varchar(255) NOT NULL,
$config->COL_userRegistration_password varchar(255) NOT NULL,
$config->COL_userRegistration_status int(1) default 0,
$config->COL_userRegistration_email_verify_status int(1) default 0,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$Table_forgotPassword = "CREATE TABLE IF NOT EXISTS {$config->Table_forgotPassword} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_forgotPassword_token varchar(255) NOT NULL PRIMARY KEY,
$config->COL_forgotPassword_uniqueId VARCHAR (255) NOT NULL,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT $config->COL_forgotPassword_uniqueId FOREIGN KEY ($config->COL_forgotPassword_uniqueId)
REFERENCES $config->Table_userRegistration ($config->COL_userRegistration_unique_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$Table_emailVerification = "CREATE TABLE IF NOT EXISTS {$config->Table_emailVerification} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_emailVerification_token varchar(255) NOT NULL PRIMARY KEY,
$config->COL_emailVerification_uniqueId VARCHAR (255) NOT NULL,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT $config->COL_emailVerification_uniqueId FOREIGN KEY ($config->COL_emailVerification_uniqueId)
REFERENCES $config->Table_userRegistration ($config->COL_userRegistration_unique_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
$Table_order = "CREATE TABLE IF NOT EXISTS {$config->Table_order} (
id INT NOT NULL AUTO_INCREMENT UNIQUE KEY,
$config->COL_order_uniqueId varchar(255) NOT NULL PRIMARY KEY,
$config->COL_order_user_uniqueId varchar(255) NOT NULL,
$config->COL_order_name varchar(255) NOT NULL,
$config->COL_order_message TEXT NULL,
$config->COL_order_country varchar(255) NOT NULL,
$config->COL_order_email varchar(255) NOT NULL,
$config->COL_order_phone varchar(20) NOT NULL,
$config->COL_order_amount FLOAT NOT NULL,
$config->COL_order_type varchar(255) NOT NULL,
$config->COL_order_status int(1) DEFAULT 0 NOT NULL,
created_date timestamp DEFAULT CURRENT_TIMESTAMP,
modified_date timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
CONSTRAINT $config->COL_order_user_uniqueId FOREIGN KEY ($config->COL_order_user_uniqueId)
REFERENCES $config->Table_userRegistration ($config->COL_userRegistration_unique_id) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
var_dump($db->executeQuery($Table_users));
var_dump($db->executeQuery($Table_company));
var_dump($db->executeQuery($Table_userRegistration));
var_dump($db->executeQuery($Table_usersImage));
var_dump($db->executeQuery($Table_forgotPassword));
var_dump($db->executeQuery($Table_emailVerification));
var_dump($db->executeQuery($Table_order));