-
Notifications
You must be signed in to change notification settings - Fork 131
/
shop.sql
239 lines (205 loc) · 8.84 KB
/
shop.sql
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 03, 2017 at 05:33 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shop`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`ID` int(11) NOT NULL,
`Name` varchar(255) NOT NULL,
`Description` text NOT NULL,
`parent` int(11) NOT NULL,
`Ordering` int(11) DEFAULT NULL,
`Visibility` tinyint(4) NOT NULL DEFAULT '0',
`Allow_Comment` tinyint(4) NOT NULL DEFAULT '0',
`Allow_Ads` tinyint(4) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`ID`, `Name`, `Description`, `parent`, `Ordering`, `Visibility`, `Allow_Comment`, `Allow_Ads`) VALUES
(8, 'Hand Made', 'Hand Made Items', 0, 1, 1, 1, 1),
(9, 'Computers', 'Computers Item', 0, 2, 0, 0, 0),
(10, 'Cell Phones', 'Cell Phones', 0, 3, 0, 0, 0),
(11, 'Clothing', 'Clothing And Fashion', 8, 4, 0, 0, 0),
(12, 'Tools', 'Home Tools', 0, 5, 0, 0, 0),
(14, 'Blackberry', 'Blackberry Phones', 10, 2, 0, 0, 0),
(15, 'Hammers', 'Hammers Desc', 12, 1, 0, 0, 0),
(17, 'Games', 'Hand Made Games ', 12, 3, 0, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`c_id` int(11) NOT NULL,
`comment` text NOT NULL,
`status` tinyint(4) NOT NULL,
`comment_date` date NOT NULL,
`item_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `comments`
--
INSERT INTO `comments` (`c_id`, `comment`, `status`, `comment_date`, `item_id`, `user_id`) VALUES
(1, 'Very Nice', 1, '2016-05-11', 15, 28),
(2, 'Nice Item Thanks so much', 1, '2016-05-11', 18, 28),
(5, 'This Is Very Good Phone', 1, '2016-06-17', 16, 24),
(7, 'Very Cool', 1, '2016-06-17', 18, 25),
(8, 'Very Nice This Is The Second Comment', 1, '2016-06-17', 18, 25),
(9, 'This Is Me Turki', 1, '2016-06-17', 18, 30),
(10, 'Cool', 1, '2016-06-17', 15, 30),
(11, 'Helllo Comment', 1, '2016-06-17', 22, 30);
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE `items` (
`Item_ID` int(11) NOT NULL,
`Name` varchar(255) NOT NULL,
`Description` text NOT NULL,
`Price` varchar(255) NOT NULL,
`Add_Date` date NOT NULL,
`Country_Made` varchar(255) NOT NULL,
`Image` varchar(255) NOT NULL,
`Status` varchar(255) NOT NULL,
`Rating` smallint(6) NOT NULL,
`Approve` tinyint(4) NOT NULL DEFAULT '0',
`Cat_ID` int(11) NOT NULL,
`Member_ID` int(11) NOT NULL,
`tags` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `items`
--
INSERT INTO `items` (`Item_ID`, `Name`, `Description`, `Price`, `Add_Date`, `Country_Made`, `Image`, `Status`, `Rating`, `Approve`, `Cat_ID`, `Member_ID`, `tags`) VALUES
(14, 'Speaker', 'Very Good Speaker', '$10', '2016-05-09', 'China', '', '1', 0, 1, 9, 28, ''),
(15, 'Yeti Blue Mic', 'Very Good Microphone Very Good Microphone', '$108', '2016-05-09', 'USA', '', '1', 0, 1, 9, 28, ''),
(16, 'iPhone 6s', 'Apple iPhone 6s', '$300', '2016-05-09', 'USA', '', '2', 0, 1, 10, 24, ''),
(17, 'Magic Mouse', 'Apple Magic Mouse', '$150', '2016-05-09', 'USA', '', '1', 0, 1, 9, 24, ''),
(18, 'Network Cable', 'Cat 9 Network Cable', '$100', '2016-05-09', 'USA', '', '1', 0, 1, 9, 25, ''),
(19, 'Game', 'Test Game For Item', '120', '2016-06-17', 'USA', '', '2', 0, 1, 9, 30, ''),
(20, 'iPhone 6s', 'iPhone 6s Very Cool Phone', '1500', '2016-06-17', 'USA', '', '2', 0, 1, 10, 30, ''),
(21, 'Hammer', 'A Very Good Iron Hammer', '30', '2016-06-17', 'China', '', '3', 0, 1, 12, 30, ''),
(22, 'Good Box', 'Nice Hand Made Box', '40', '2016-06-17', 'Egypt', '', '1', 0, 1, 8, 30, ''),
(23, 'Test Item', 'This Is Test Item To Test Approve Status', '100', '2016-06-17', 'Japan', '', '3', 0, 1, 8, 30, ''),
(24, 'Testing Item', 'Testing Description Testing Description', '120', '2016-06-17', 'Korea', '', '3', 0, 0, 10, 30, ''),
(25, 'Osama', 'Osama Osama Elzero Elzero', '100', '2016-06-17', 'Egypt', '', '3', 0, 1, 10, 30, ''),
(26, '12121212', '33333333333', '33333', '2016-06-17', '333333', '', '2', 0, 1, 11, 30, ''),
(27, 'My Item', 'My New Description', '12', '2016-06-17', 'Saudi Arabia', '', '1', 0, 1, 10, 30, 'Test, Discount, Elzero'),
(28, 'Wooden Game', 'A Good Wooden game', '100', '2016-07-25', 'Egypt', '', '1', 0, 1, 8, 30, 'Elzero, Hand, Discount, Gurantee'),
(29, 'Diablo III', 'Good Playstation 4 Game', '70', '2016-07-25', 'USA', '', '1', 0, 1, 17, 30, 'RPG, Online, Game'),
(30, 'Ys Oath In Felghana', 'A Good Ps Game', '100', '2016-07-25', 'Japan', '', '1', 0, 1, 17, 30, 'Online, RPG, Game');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`UserID` int(11) NOT NULL COMMENT 'To Identify User',
`Username` varchar(255) NOT NULL COMMENT 'Username To Login',
`Password` varchar(255) NOT NULL COMMENT 'Password To Login',
`Email` varchar(255) NOT NULL,
`FullName` varchar(255) NOT NULL,
`GroupID` int(11) NOT NULL DEFAULT '0' COMMENT 'Identify User Group',
`TrustStatus` int(11) NOT NULL DEFAULT '0' COMMENT 'Seller Rank',
`RegStatus` int(11) NOT NULL DEFAULT '0' COMMENT 'User Approval',
`Date` date NOT NULL,
`avatar` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`UserID`, `Username`, `Password`, `Email`, `FullName`, `GroupID`, `TrustStatus`, `RegStatus`, `Date`, `avatar`) VALUES
(1, 'Osama', 'a8bb4c0a594e6b7288a0d2d040831b27f5cedd0d', '[email protected]', 'Osama Mohamed', 1, 0, 1, '0000-00-00', ''),
(24, 'Ahmed', '601f1889667efaebb33b8c12572835da3f027f78', '[email protected]', 'Ahmed Sameh', 0, 0, 1, '2016-05-06', ''),
(25, 'Gamal', '601f1889667efaebb33b8c12572835da3f027f78', '[email protected]', 'Gamal Ahmed', 0, 0, 1, '2016-05-06', ''),
(26, 'Sameh', '601f1889667efaebb33b8c12572835da3f027f78', '[email protected]', 'Sameh Ahmed', 0, 0, 1, '2016-05-08', ''),
(27, 'Application', '40bd001563085fc35165329ea1ff5c5ecbdbbeef', '[email protected]', 'Application API', 0, 0, 1, '2016-05-11', ''),
(28, 'Khalid', '601f1889667efaebb33b8c12572835da3f027f78', '[email protected]', 'Khalid Ahmed', 0, 0, 1, '2016-05-04', ''),
(30, 'Turki', '601f1889667efaebb33b8c12572835da3f027f78', '[email protected]', '', 0, 0, 0, '2016-06-16', ''),
(31, 'AboGamal', '00ea1da4192a2030f9ae023de3b3143ed647bbab', '[email protected]', 'Abo Gamal', 0, 0, 1, '2017-04-24', '568621957_wordpress-custom-user-avatar.png');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`ID`),
ADD UNIQUE KEY `Name` (`Name`);
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`c_id`),
ADD KEY `items_comment` (`item_id`),
ADD KEY `comment_user` (`user_id`);
--
-- Indexes for table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`Item_ID`),
ADD KEY `member_1` (`Member_ID`),
ADD KEY `cat_1` (`Cat_ID`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`UserID`),
ADD UNIQUE KEY `Username` (`Username`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `c_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
MODIFY `Item_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `UserID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'To Identify User', AUTO_INCREMENT=32;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `comment_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`UserID`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `items_comment` FOREIGN KEY (`item_id`) REFERENCES `items` (`Item_ID`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `items`
--
ALTER TABLE `items`
ADD CONSTRAINT `cat_1` FOREIGN KEY (`Cat_ID`) REFERENCES `categories` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `member_1` FOREIGN KEY (`Member_ID`) REFERENCES `users` (`UserID`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;