├── AlgorithmResolutions
└── LeetCode
│ └── MiddleOfTheLinkedList.php
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING
├── Mini-Php-Projects
├── README.md
└── admin_panel
│ ├── DB
│ └── swiss_collection.sql
│ ├── adminHeader.php
│ ├── adminView
│ ├── editItemForm.php
│ ├── editVariationForm.php
│ ├── viewAllOrders.php
│ ├── viewAllProducts.php
│ ├── viewCategories.php
│ ├── viewCustomers.php
│ ├── viewEachOrder.php
│ ├── viewProductSizes.php
│ └── viewSizes.php
│ ├── assets
│ ├── css
│ │ └── style.css
│ ├── images
│ │ ├── Dresses.jpg
│ │ ├── accept.png
│ │ ├── contact.jpg
│ │ ├── logo.png
│ │ ├── profile-pic.svg
│ │ └── work-1.jpg
│ └── js
│ │ ├── ajaxWork.js
│ │ └── script.js
│ ├── config
│ └── dbconnect.php
│ ├── controller
│ ├── addCatController.php
│ ├── addItemController.php
│ ├── addSizeController.php
│ ├── addVariationController.php
│ ├── catDeleteController.php
│ ├── deleteItemController.php
│ ├── deleteSizeController.php
│ ├── deleteVariationController.php
│ ├── updateItemController.php
│ ├── updateOrderStatus.php
│ ├── updatePayStatus.php
│ └── updateVariationController.php
│ ├── index.php
│ ├── sidebar.php
│ └── uploads
│ ├── check-strappy-dress.jpg
│ ├── croptop.jpg
│ ├── dress.jpg
│ ├── offshoulder.jpg
│ ├── shirtdress.jpg
│ ├── tops.jpg
│ └── v-neck.jpg
├── Petugas.php
├── README.md
├── autorun.sh
├── calculator.php
├── cont.md
├── dashboard.php
├── getyourip.php
├── index.php
├── input-petugas.php
├── login.php
├── logout.php
├── palindrome.php
├── primeNumberChecker.php
└── upload_asesmen.php
/AlgorithmResolutions/LeetCode/MiddleOfTheLinkedList.php:
--------------------------------------------------------------------------------
1 | val = $val;
10 | * $this->next = $next;
11 | * }
12 | * }
13 | */
14 | class Solution {
15 | /**
16 | * @param ListNode $head
17 | * @return ListNode
18 | */
19 | function middleNode($head) {
20 | $list = $head;
21 | $endList = $list;
22 | $listValues = [];
23 |
24 | if ($list == null) {
25 | return $list;
26 | }
27 |
28 | while($endList != null) {
29 | $listValues[] = $endList->val;
30 | $endList = $endList->next;
31 | }
32 |
33 | $listSize = count($listValues);
34 | $middleList = floor($listSize / 2);
35 |
36 |
37 |
38 | $listValues = array_slice($listValues, $middleList);
39 |
40 | $list2 = new ListNode();
41 | $endList2 = $list2;
42 |
43 | for ($i = 0; $i < count($listValues); $i++) {
44 | $endList2->val = $listValues[$i];
45 |
46 | if ($i < count($listValues) - 1) {
47 | $endList2->next = new ListNode();
48 | $endList2 = $endList2->next;
49 | }
50 | }
51 |
52 | return $list2;
53 | }
54 | }
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 |
4 | ## Our Pledge
5 |
6 | We as members, contributors, and leaders pledge to make participation in our
7 | community a harassment-free experience for everyone, regardless of age, body
8 | size, visible or invisible disability, ethnicity, sex characteristics, gender
9 | identity and expression, level of experience, education, socio-economic status,
10 | nationality, personal appearance, race, religion, or sexual identity
11 | and orientation.
12 |
13 | We pledge to act and interact in ways that contribute to an open, welcoming,
14 | diverse, inclusive, and healthy community.
15 |
16 | ## Our Standards
17 |
18 | Examples of behavior that contributes to a positive environment for our
19 | community include:
20 |
21 | - Demonstrating empathy and kindness toward other people
22 | - Being respectful of differing opinions, viewpoints, and experiences
23 | - Giving and gracefully accepting constructive feedback
24 | - Accepting responsibility and apologizing to those affected by our mistakes,
25 | and learning from the experience
26 | - Focusing on what is best not just for us as individuals, but for the
27 | overall community
28 |
29 | Examples of unacceptable behavior include:
30 |
31 | - The use of sexualized language or imagery, and sexual attention or
32 | advances of any kind
33 | - Trolling, insulting or derogatory comments, and personal or political attacks
34 | - Public or private harassment
35 | - Publishing others' private information, such as a physical or email
36 | address, without their explicit permission
37 | - Other conduct which could reasonably be considered inappropriate in a
38 | professional setting
39 |
40 | ## Enforcement Responsibilities
41 |
42 | Community leaders are responsible for clarifying and enforcing our standards of
43 | acceptable behavior and will take appropriate and fair corrective action in
44 | response to any behavior that they deem inappropriate, threatening, offensive,
45 | or harmful.
46 |
47 | Community leaders have the right and responsibility to remove, edit, or reject
48 | comments, commits, code, wiki edits, issues, and other contributions that are
49 | not aligned to this Code of Conduct, and will communicate reasons for moderation
50 | decisions when appropriate.
51 |
52 | ## Scope
53 |
54 | This Code of Conduct applies within all community spaces, and also applies when
55 | an individual is officially representing the community in public spaces.
56 | Examples of representing our community include using an official e-mail address,
57 | posting via an official social media account, or acting as an appointed
58 | representative at an online or offline event.
59 |
60 | ## Enforcement
61 |
62 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
63 | reported to the community leaders responsible for enforcement at
64 | .
65 | All complaints will be reviewed and investigated promptly and fairly.
66 |
67 | All community leaders are obligated to respect the privacy and security of the
68 | reporter of any incident.
69 |
70 | ## Enforcement Guidelines
71 |
72 | Community leaders will follow these Community Impact Guidelines in determining
73 | the consequences for any action they deem in violation of this Code of Conduct:
74 |
75 | ### 1. Correction
76 |
77 | **Community Impact**: Use of inappropriate language or other behavior deemed
78 | unprofessional or unwelcome in the community.
79 |
80 | **Consequence**: A private, written warning from community leaders, providing
81 | clarity around the nature of the violation and an explanation of why the
82 | behavior was inappropriate. A public apology may be requested.
83 |
84 | ### 2. Warning
85 |
86 | **Community Impact**: A violation through a single incident or series
87 | of actions.
88 |
89 | **Consequence**: A warning with consequences for continued behavior. No
90 | interaction with the people involved, including unsolicited interaction with
91 | those enforcing the Code of Conduct, for a specified period of time. This
92 | includes avoiding interactions in community spaces as well as external channels
93 | like social media. Violating these terms may lead to a temporary or
94 | permanent ban.
95 |
96 | ### 3. Temporary Ban
97 |
98 | **Community Impact**: A serious violation of community standards, including
99 | sustained inappropriate behavior.
100 |
101 | **Consequence**: A temporary ban from any sort of interaction or public
102 | communication with the community for a specified period of time. No public or
103 | private interaction with the people involved, including unsolicited interaction
104 | with those enforcing the Code of Conduct, is allowed during this period.
105 | Violating these terms may lead to a permanent ban.
106 |
107 | ### 4. Permanent Ban
108 |
109 | **Community Impact**: Demonstrating a pattern of violation of community
110 | standards, including sustained inappropriate behavior, harassment of an
111 | individual, or aggression toward or disparagement of classes of individuals.
112 |
113 | **Consequence**: A permanent ban from any sort of public interaction within
114 | the community.
115 |
116 | ## Attribution
117 |
118 | This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119 | version 2.0, available at
120 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
121 |
122 | Community Impact Guidelines were inspired by [Mozilla's code of conduct
123 | enforcement ladder](https://github.com/mozilla/diversity).
124 |
125 | [homepage]: https://www.contributor-covenant.org
126 |
127 | For answers to common questions about this code of conduct, see the FAQ at
128 | https://www.contributor-covenant.org/faq. Translations are available at
129 | https://www.contributor-covenant.org/translations.
130 |
--------------------------------------------------------------------------------
/CONTRIBUTING:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | When contributing to this repository, please first discuss the change you wish to make via issue,
4 | email, or any other method with the owners of this repository before making a change.
5 |
6 | Please note we have a code of conduct, please follow it in all your interactions with the project.
7 |
8 | ## Pull Request Process
9 |
10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11 | build.
12 | 2. Update the README.md with details of changes to the interface, this includes new environment
13 | variables, exposed ports, useful file locations and container parameters.
14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this
15 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17 | do not have permission to do that, you may request the second reviewer to merge it for you.
18 |
19 | ## Code of Conduct
20 |
21 | ### Our Pledge
22 |
23 | In the interest of fostering an open and welcoming environment, we as
24 | contributors and maintainers pledge to making participation in our project and
25 | our community a harassment-free experience for everyone, regardless of age, body
26 | size, disability, ethnicity, gender identity and expression, level of experience,
27 | nationality, personal appearance, race, religion, or sexual identity and
28 | orientation.
29 |
30 | ### Our Standards
31 |
32 | Examples of behavior that contributes to creating a positive environment
33 | include:
34 |
35 | - Using welcoming and inclusive language
36 | - Being respectful of differing viewpoints and experiences
37 | - Gracefully accepting constructive criticism
38 | - Focusing on what is best for the community
39 | - Showing empathy towards other community members
40 |
41 | Examples of unacceptable behavior by participants include:
42 |
43 | - The use of sexualized language or imagery and unwelcome sexual attention or
44 | advances
45 | - Trolling, insulting/derogatory comments, and personal or political attacks
46 | - Public or private harassment
47 | - Publishing others' private information, such as a physical or electronic
48 | address, without explicit permission
49 | - Other conduct which could reasonably be considered inappropriate in a
50 | professional setting
51 |
52 | ### Our Responsibilities
53 |
54 | Project maintainers are responsible for clarifying the standards of acceptable
55 | behavior and are expected to take appropriate and fair corrective action in
56 | response to any instances of unacceptable behavior.
57 |
58 | Project maintainers have the right and responsibility to remove, edit, or
59 | reject comments, commits, code, wiki edits, issues, and other contributions
60 | that are not aligned to this Code of Conduct, or to ban temporarily or
61 | permanently any contributor for other behaviors that they deem inappropriate,
62 | threatening, offensive, or harmful.
63 |
64 | ### Scope
65 |
66 | This Code of Conduct applies both within project spaces and in public spaces
67 | when an individual is representing the project or its community. Examples of
68 | representing a project or community include using an official project e-mail
69 | address, posting via an official social media account, or acting as an appointed
70 | representative at an online or offline event. Representation of a project may be
71 | further defined and clarified by project maintainers.
72 |
73 | ### Enforcement
74 |
75 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
76 | reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
77 | complaints will be reviewed and investigated and will result in a response that
78 | is deemed necessary and appropriate to the circumstances. The project team is
79 | obligated to maintain confidentiality with regard to the reporter of an incident.
80 | Further details of specific enforcement policies may be posted separately.
81 |
82 | Project maintainers who do not follow or enforce the Code of Conduct in good
83 | faith may face temporary or permanent repercussions as determined by other
84 | members of the project's leadership.
85 |
86 | ### Attribution
87 |
88 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89 | available at [http://contributor-covenant.org/version/1/4][version]
90 |
91 | [homepage]: http://contributor-covenant.org
92 | [version]: http://contributor-covenant.org/version/1/4/
93 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/README.md:
--------------------------------------------------------------------------------
1 | # Admin Panal
2 |
3 | The Simple Admin Panel In PHP is a simple mini project of Crud operation using PDO and Bootstrap. It performs the Create, Read, Update and Delete operation on the MySQL database.
4 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/DB/swiss_collection.sql:
--------------------------------------------------------------------------------
1 | -- phpMyAdmin SQL Dump
2 | -- version 5.0.2
3 | -- https://www.phpmyadmin.net/
4 | --
5 | -- Host: 127.0.0.1
6 | -- Generation Time: Apr 18, 2022 at 07:56 PM
7 | -- Server version: 10.4.14-MariaDB
8 | -- PHP Version: 7.2.33
9 |
10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11 | START TRANSACTION;
12 | SET time_zone = "+00:00";
13 |
14 |
15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
18 | /*!40101 SET NAMES utf8mb4 */;
19 |
20 | --
21 | -- Database: `swiss_collection`
22 | --
23 |
24 | -- --------------------------------------------------------
25 |
26 | --
27 | -- Table structure for table `cart`
28 | --
29 |
30 | CREATE TABLE `cart` (
31 | `cart_id` int(11) NOT NULL,
32 | `user_id` int(11) NOT NULL,
33 | `variation_id` int(11) NOT NULL,
34 | `quantity` int(11) NOT NULL,
35 | `price` int(11) NOT NULL
36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
37 |
38 | -- --------------------------------------------------------
39 |
40 | --
41 | -- Table structure for table `category`
42 | --
43 |
44 | CREATE TABLE `category` (
45 | `category_id` int(11) NOT NULL,
46 | `category_name` varchar(150) NOT NULL
47 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
48 |
49 | --
50 | -- Dumping data for table `category`
51 | --
52 |
53 | INSERT INTO `category` (`category_id`, `category_name`) VALUES
54 | (1, 'Tops'),
55 | (2, 'Dresses'),
56 | (3, 'Pants');
57 |
58 | -- --------------------------------------------------------
59 |
60 | --
61 | -- Table structure for table `orders`
62 | --
63 |
64 | CREATE TABLE `orders` (
65 | `order_id` int(11) NOT NULL,
66 | `user_id` int(11) NOT NULL,
67 | `delivered_to` varchar(150) NOT NULL,
68 | `phone_no` varchar(10) NOT NULL,
69 | `deliver_address` varchar(255) NOT NULL,
70 | `pay_method` varchar(50) NOT NULL,
71 | `pay_status` int(11) NOT NULL,
72 | `order_status` int(11) NOT NULL DEFAULT 0,
73 | `order_date` date NOT NULL DEFAULT current_timestamp()
74 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
75 |
76 | --
77 | -- Dumping data for table `orders`
78 | --
79 |
80 | INSERT INTO `orders` (`order_id`, `user_id`, `delivered_to`, `phone_no`, `deliver_address`, `pay_method`, `pay_status`, `order_status`, `order_date`) VALUES
81 | (1, 2, 'Self', '9802234675', 'Matepani-12', 'Cash', 0, 0, '2022-04-10'),
82 | (3, 2, 'Test Firstuser', '980098322', 'matepani-12', 'Khalti', 1, 0, '2022-04-18');
83 |
84 | -- --------------------------------------------------------
85 |
86 | --
87 | -- Table structure for table `order_details`
88 | --
89 |
90 | CREATE TABLE `order_details` (
91 | `detail_id` int(11) NOT NULL,
92 | `order_id` int(11) NOT NULL,
93 | `variation_id` int(11) NOT NULL,
94 | `quantity` int(11) NOT NULL,
95 | `price` int(11) NOT NULL
96 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
97 |
98 | --
99 | -- Dumping data for table `order_details`
100 | --
101 |
102 | INSERT INTO `order_details` (`detail_id`, `order_id`, `variation_id`, `quantity`, `price`) VALUES
103 | (1, 1, 1, 1, 500),
104 | (3, 3, 3, 1, 890);
105 |
106 | -- --------------------------------------------------------
107 |
108 | --
109 | -- Table structure for table `product`
110 | --
111 |
112 | CREATE TABLE `product` (
113 | `product_id` int(11) NOT NULL,
114 | `product_name` varchar(200) NOT NULL,
115 | `product_desc` text NOT NULL,
116 | `product_image` varchar(255) NOT NULL,
117 | `price` int(11) NOT NULL,
118 | `category_id` int(11) NOT NULL,
119 | `uploaded_date` date NOT NULL DEFAULT current_timestamp()
120 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
121 |
122 | --
123 | -- Dumping data for table `product`
124 | --
125 |
126 | INSERT INTO `product` (`product_id`, `product_name`, `product_desc`, `product_image`, `price`, `category_id`, `uploaded_date`) VALUES
127 | (1, 'V Neck Crop Top', 'V neckline and Drawstring style make you more sexy Match well with your skinny leggings, pants or jeans for a fashion look Suitable for casual, home.', './uploads/v-neck.jpg', 500, 1, '2022-03-28'),
128 | (2, 'Off Shoulder Crop Top', 'Crop Tops for Women Basic Off Shoulder Sexy Print V Neck Slim Shirt Vest with Button at Swiss Collecttion.', './uploads/offshoulder.jpg', 890, 1, '2022-04-04'),
129 | (3, 'Off Shoulder Tops', 'Tops for Women Basic Off Shoulder V Neck Slim Shirt Vest with Button at Swiss Collecttion.', './uploads/tops.jpg', 600, 1, '2022-04-04'),
130 | (4, 'Printed Crop Top', 'Cute Crop Tops for Women Basic Off Shoulder Sexy Print V Neck Slim Shirt Vest with Button at Swiss Collecttion.', './uploads/croptop.jpg', 700, 1, '2022-04-04'),
131 | (5, 'Shirtdress', 'Shirt Dresses for Women Basic dresses with Button at Swiss Collecttion.', './uploads/shirtdress.jpg', 1850, 2, '2022-04-04'),
132 | (6, 'Check Strappy Dress', 'Check Strappy Dresses for Women Basic dresses with Button at Swiss Collecttion.', './uploads/check-strappy-dress.jpg', 1250, 2, '2022-03-24'),
133 | (7, 'Floral Dress', 'Floral Dresses for Women Basic dresses with Button at Swiss Collecttion.', './uploads/dress.jpg', 1500, 2, '2022-04-04');
134 |
135 | -- --------------------------------------------------------
136 |
137 | --
138 | -- Table structure for table `product_size_variation`
139 | --
140 |
141 | CREATE TABLE `product_size_variation` (
142 | `variation_id` int(11) NOT NULL,
143 | `product_id` int(11) NOT NULL,
144 | `size_id` int(11) NOT NULL,
145 | `quantity_in_stock` int(11) NOT NULL
146 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
147 |
148 | --
149 | -- Dumping data for table `product_size_variation`
150 | --
151 |
152 | INSERT INTO `product_size_variation` (`variation_id`, `product_id`, `size_id`, `quantity_in_stock`) VALUES
153 | (1, 1, 4, 5),
154 | (2, 2, 3, 9),
155 | (3, 2, 2, 3),
156 | (6, 3, 3, 6),
157 | (7, 4, 2, 8),
158 | (8, 5, 4, 8),
159 | (9, 6, 2, 10),
160 | (10, 7, 2, 10);
161 |
162 | -- --------------------------------------------------------
163 |
164 | --
165 | -- Table structure for table `review`
166 | --
167 |
168 | CREATE TABLE `review` (
169 | `review_id` int(11) NOT NULL,
170 | `user_id` int(11) NOT NULL,
171 | `product_id` int(11) NOT NULL,
172 | `review_desc` text NOT NULL
173 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
174 |
175 | --
176 | -- Dumping data for table `review`
177 | --
178 |
179 | INSERT INTO `review` (`review_id`, `user_id`, `product_id`, `review_desc`) VALUES
180 | (1, 2, 2, 'Comfortable and stylish. I loved it.'),
181 | (2, 2, 5, 'Perfect dress for summer.');
182 |
183 | -- --------------------------------------------------------
184 |
185 | --
186 | -- Table structure for table `sizes`
187 | --
188 |
189 | CREATE TABLE `sizes` (
190 | `size_id` int(11) NOT NULL,
191 | `size_name` varchar(100) NOT NULL
192 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
193 |
194 | --
195 | -- Dumping data for table `sizes`
196 | --
197 |
198 | INSERT INTO `sizes` (`size_id`, `size_name`) VALUES
199 | (1, 'S'),
200 | (2, 'L'),
201 | (3, 'M'),
202 | (4, 'Free');
203 |
204 | -- --------------------------------------------------------
205 |
206 | --
207 | -- Table structure for table `users`
208 | --
209 |
210 | CREATE TABLE `users` (
211 | `user_id` int(11) NOT NULL,
212 | `first_name` varchar(200) NOT NULL,
213 | `last_name` varchar(255) NOT NULL,
214 | `email` varchar(255) NOT NULL,
215 | `password` varchar(150) NOT NULL,
216 | `contact_no` varchar(10) NOT NULL,
217 | `registered_at` date NOT NULL DEFAULT current_timestamp(),
218 | `isAdmin` int(11) NOT NULL DEFAULT 0,
219 | `user_address` varchar(255) NOT NULL
220 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
221 |
222 | --
223 | -- Dumping data for table `users`
224 | --
225 |
226 | INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `email`, `password`, `contact_no`, `registered_at`, `isAdmin`, `user_address`) VALUES
227 | (1, 'Admin', 'Admin', 'admin@gmail.com', '$2y$10$j9OXXIYS0CG5AYuks62YMeDvuIpo2hZEN4CqfJfujt1yPMnoUq5C6', '9810283472', '2022-04-10', 1, 'newroad'),
228 | (2, 'Test ', 'Firstuser', 'test@gmail.com', '$2y$10$DJOdhZy1InHTKQO6whfyJexVTZCDTlmIYGCXQiPTv7l82AdC9bWHO', '980098322', '2022-04-10', 0, 'matepani-12');
229 |
230 | -- --------------------------------------------------------
231 |
232 | --
233 | -- Table structure for table `wishlist`
234 | --
235 |
236 | CREATE TABLE `wishlist` (
237 | `wish_id` int(11) NOT NULL,
238 | `user_id` int(11) NOT NULL,
239 | `product_id` int(11) NOT NULL
240 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
241 |
242 | --
243 | -- Indexes for dumped tables
244 | --
245 |
246 | --
247 | -- Indexes for table `cart`
248 | --
249 | ALTER TABLE `cart`
250 | ADD PRIMARY KEY (`cart_id`),
251 | ADD UNIQUE KEY `uc_cart` (`user_id`,`variation_id`),
252 | ADD KEY `variation_id` (`variation_id`);
253 |
254 | --
255 | -- Indexes for table `category`
256 | --
257 | ALTER TABLE `category`
258 | ADD PRIMARY KEY (`category_id`);
259 |
260 | --
261 | -- Indexes for table `orders`
262 | --
263 | ALTER TABLE `orders`
264 | ADD PRIMARY KEY (`order_id`),
265 | ADD KEY `user_id` (`user_id`);
266 |
267 | --
268 | -- Indexes for table `order_details`
269 | --
270 | ALTER TABLE `order_details`
271 | ADD PRIMARY KEY (`detail_id`),
272 | ADD KEY `order_id` (`order_id`),
273 | ADD KEY `variation_id` (`variation_id`);
274 |
275 | --
276 | -- Indexes for table `product`
277 | --
278 | ALTER TABLE `product`
279 | ADD PRIMARY KEY (`product_id`),
280 | ADD KEY `category_id` (`category_id`);
281 |
282 | --
283 | -- Indexes for table `product_size_variation`
284 | --
285 | ALTER TABLE `product_size_variation`
286 | ADD PRIMARY KEY (`variation_id`),
287 | ADD UNIQUE KEY `uc_ps` (`product_id`,`size_id`);
288 |
289 | --
290 | -- Indexes for table `review`
291 | --
292 | ALTER TABLE `review`
293 | ADD PRIMARY KEY (`review_id`),
294 | ADD KEY `user_id` (`user_id`),
295 | ADD KEY `product_id` (`product_id`);
296 |
297 | --
298 | -- Indexes for table `sizes`
299 | --
300 | ALTER TABLE `sizes`
301 | ADD PRIMARY KEY (`size_id`);
302 |
303 | --
304 | -- Indexes for table `users`
305 | --
306 | ALTER TABLE `users`
307 | ADD PRIMARY KEY (`user_id`);
308 |
309 | --
310 | -- Indexes for table `wishlist`
311 | --
312 | ALTER TABLE `wishlist`
313 | ADD PRIMARY KEY (`wish_id`),
314 | ADD UNIQUE KEY `uc_wish` (`user_id`,`product_id`),
315 | ADD KEY `product_id` (`product_id`);
316 |
317 | --
318 | -- AUTO_INCREMENT for dumped tables
319 | --
320 |
321 | --
322 | -- AUTO_INCREMENT for table `cart`
323 | --
324 | ALTER TABLE `cart`
325 | MODIFY `cart_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
326 |
327 | --
328 | -- AUTO_INCREMENT for table `category`
329 | --
330 | ALTER TABLE `category`
331 | MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
332 |
333 | --
334 | -- AUTO_INCREMENT for table `orders`
335 | --
336 | ALTER TABLE `orders`
337 | MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
338 |
339 | --
340 | -- AUTO_INCREMENT for table `order_details`
341 | --
342 | ALTER TABLE `order_details`
343 | MODIFY `detail_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
344 |
345 | --
346 | -- AUTO_INCREMENT for table `product`
347 | --
348 | ALTER TABLE `product`
349 | MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
350 |
351 | --
352 | -- AUTO_INCREMENT for table `product_size_variation`
353 | --
354 | ALTER TABLE `product_size_variation`
355 | MODIFY `variation_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
356 |
357 | --
358 | -- AUTO_INCREMENT for table `review`
359 | --
360 | ALTER TABLE `review`
361 | MODIFY `review_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
362 |
363 | --
364 | -- AUTO_INCREMENT for table `sizes`
365 | --
366 | ALTER TABLE `sizes`
367 | MODIFY `size_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
368 |
369 | --
370 | -- AUTO_INCREMENT for table `users`
371 | --
372 | ALTER TABLE `users`
373 | MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
374 |
375 | --
376 | -- AUTO_INCREMENT for table `wishlist`
377 | --
378 | ALTER TABLE `wishlist`
379 | MODIFY `wish_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
380 |
381 | --
382 | -- Constraints for dumped tables
383 | --
384 |
385 | --
386 | -- Constraints for table `cart`
387 | --
388 | ALTER TABLE `cart`
389 | ADD CONSTRAINT `cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`),
390 | ADD CONSTRAINT `cart_ibfk_2` FOREIGN KEY (`variation_id`) REFERENCES `product_size_variation` (`variation_id`);
391 |
392 | --
393 | -- Constraints for table `orders`
394 | --
395 | ALTER TABLE `orders`
396 | ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`);
397 |
398 | --
399 | -- Constraints for table `order_details`
400 | --
401 | ALTER TABLE `order_details`
402 | ADD CONSTRAINT `order_details_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`order_id`),
403 | ADD CONSTRAINT `order_details_ibfk_2` FOREIGN KEY (`variation_id`) REFERENCES `product_size_variation` (`variation_id`);
404 |
405 | --
406 | -- Constraints for table `product`
407 | --
408 | ALTER TABLE `product`
409 | ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`);
410 |
411 | --
412 | -- Constraints for table `review`
413 | --
414 | ALTER TABLE `review`
415 | ADD CONSTRAINT `review_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`),
416 | ADD CONSTRAINT `review_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`);
417 |
418 | --
419 | -- Constraints for table `wishlist`
420 | --
421 | ALTER TABLE `wishlist`
422 | ADD CONSTRAINT `wishlist_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`),
423 | ADD CONSTRAINT `wishlist_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`);
424 | COMMIT;
425 |
426 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
427 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
428 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
429 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminHeader.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
33 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/editItemForm.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Edit Product Detail
5 | 0){
11 | while($row1=mysqli_fetch_array($qry)){
12 | $catID=$row1["category_id"];
13 | ?>
14 |
69 |
70 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/editVariationForm.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Edit Variation Detail
4 | 0){
10 | while($row1=mysqli_fetch_array($qry)){
11 | $pID=$row1["product_id"];
12 | $sID=$row1["size_id"]
13 | ?>
14 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewAllOrders.php:
--------------------------------------------------------------------------------
1 |
2 |
Order Details
3 |
4 |
5 |
6 | O.N. |
7 | Customer |
8 | Contact |
9 | OrderDate |
10 | Payment Method |
11 | Order Status |
12 | Payment Status |
13 | More Details |
14 |
15 |
16 | query($sql);
20 |
21 | if ($result-> num_rows > 0){
22 | while ($row=$result-> fetch_assoc()) {
23 | ?>
24 |
25 | =$row["order_id"]?> |
26 | =$row["delivered_to"]?> |
27 | =$row["phone_no"]?> |
28 | =$row["order_date"]?> |
29 | =$row["pay_method"]?> |
30 |
34 | |
35 |
39 | |
40 |
41 |
45 | |
46 |
50 | |
51 |
54 |
55 | |
56 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
82 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewAllProducts.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Product Items
4 |
5 |
6 |
7 | S.N. |
8 | Product Image |
9 | Product Name |
10 | Product Description |
11 | Category Name |
12 | Unit Price |
13 | Action |
14 |
15 |
16 | query($sql);
20 | $count=1;
21 | if ($result-> num_rows > 0){
22 | while ($row=$result-> fetch_assoc()) {
23 | ?>
24 |
25 | =$count?> |
26 |  |
27 | =$row["product_name"]?> |
28 | =$row["product_desc"]?> |
29 | =$row["category_name"]?> |
30 | =$row["price"]?> |
31 | |
32 | |
33 |
34 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewCategories.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Category Items
4 |
5 |
6 |
7 | S.N. |
8 | Category Name |
9 | Action |
10 |
11 |
12 | query($sql);
16 | $count=1;
17 | if ($result-> num_rows > 0){
18 | while ($row=$result-> fetch_assoc()) {
19 | ?>
20 |
21 | =$count?> |
22 | =$row["category_name"]?> |
23 |
24 | |
25 |
26 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewCustomers.php:
--------------------------------------------------------------------------------
1 |
2 |
All Customers
3 |
4 |
5 |
6 | S.N. |
7 | Username |
8 | Email |
9 | Contact Number |
10 | Joining Date |
11 |
12 |
13 | query($sql);
17 | $count=1;
18 | if ($result-> num_rows > 0){
19 | while ($row=$result-> fetch_assoc()) {
20 |
21 | ?>
22 |
23 | =$count?> |
24 | =$row["first_name"]?> =$row["last_name"]?> |
25 | =$row["email"]?> |
26 | =$row["contact_no"]?> |
27 | =$row["registered_at"]?> |
28 |
29 |
35 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewEachOrder.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | S.N. |
6 | Product Image |
7 | Product Name |
8 | Size |
9 | Quantity |
10 | Unit Price |
11 |
12 |
13 | query($sql);
21 | $count=1;
22 | if ($result-> num_rows > 0){
23 | while ($row=$result-> fetch_assoc()) {
24 | $v_id=$row['variation_id'];
25 | ?>
26 |
27 | =$count?> |
28 | query($subqry);
32 | if($row2 = $res-> fetch_assoc()){
33 | ?>
34 | "> |
35 | =$row2["product_name"] ?> |
36 |
37 | query($subqry2);
43 | if($row3 = $res2-> fetch_assoc()){
44 | ?>
45 | =$row3["size_name"] ?> |
46 |
49 | =$row["quantity"]?> |
50 | =$row["price"]?> |
51 |
52 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewProductSizes.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Product Sizes Item
4 |
5 |
6 |
7 | S.N. |
8 | Product Name |
9 | Size |
10 | Stock Quantity |
11 | Action |
12 |
13 |
14 | query($sql);
18 | $count=1;
19 | if ($result-> num_rows > 0){
20 | while ($row=$result-> fetch_assoc()) {
21 | ?>
22 |
23 | =$count?> |
24 | =$row["product_name"]?> |
25 | =$row["size_name"]?> |
26 | =$row["quantity_in_stock"]?> |
27 | |
28 | |
29 |
30 |
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/adminView/viewSizes.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Available Sizes
4 |
5 |
6 |
7 | S.N. |
8 | Size |
9 | Action |
10 |
11 |
12 | query($sql);
16 | $count=1;
17 | if ($result-> num_rows > 0){
18 | while ($row=$result-> fetch_assoc()) {
19 | ?>
20 |
21 | =$count?> |
22 | =$row["size_name"]?> |
23 |
24 | |
25 |
26 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/css/style.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css?family=Work+Sans:400,500,600,700&display=swap');
2 | * {
3 | margin: 0;
4 | padding: 0;
5 | font-family: 'Work Sans', sans-serif;
6 | font-size: 18px;
7 | }
8 |
9 | .user-cart span{
10 | background-color:red;
11 | padding-right:3px;
12 | padding-left:3px;
13 | border-radius:10px;
14 | font-size:18px;
15 | margin-left:-1.2rem;
16 | }
17 |
18 | /*********** admin dashboard styling **********/
19 | .card{
20 | background-color: #3B3131;
21 | padding:20px;
22 | margin: 10px;
23 | border-radius: 10px;
24 | box-shadow: 8px 5px 5px #3B3131;
25 | }
26 |
27 | /************************** for sidebar ***********************************/
28 |
29 | /* The sidebar menu */
30 | .sidebar {
31 | height: 100%; /* 100% Full-height */
32 | width: 0; /* 0 width - change this with JavaScript */
33 | position: fixed; /* Stay in place */
34 | z-index: 1; /* Stay on top */
35 | top: 0;
36 | left: 0;
37 | background-color: #3B3131; /* Black*/
38 | overflow-x: hidden; /* Disable horizontal scroll */
39 | padding-top: 60px; /* Place content 60px from the top */
40 | transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
41 | }
42 |
43 | /* The sidebar links */
44 | .sidebar a {
45 | padding: 8px 8px 8px 32px;
46 | text-decoration: none;
47 | font-size: 22px;
48 | color: #fff;
49 | display: block;
50 | transition: 0.3s;
51 | }
52 |
53 | .sidebar .side-header{
54 | margin-left: 30px;
55 | margin-bottom: 8px;
56 | color: #fff;
57 | }
58 |
59 | /* When you mouse over the navigation links, change their color */
60 | .sidebar a:hover {
61 | background-color: #584e46;
62 | }
63 |
64 | /* Position and style the close button (top right corner) */
65 | .sidebar .closebtn {
66 | position: absolute;
67 | top: 0;
68 | right: 2px;
69 | font-size: 34px;
70 | margin-left: 50px;
71 | }
72 |
73 | /* The button used to open the sidebar */
74 | .openbtn {
75 | font-size: 20px;
76 | cursor: pointer;
77 | padding: 10px 15px;
78 | border: none;
79 | color: #fff;
80 | background-color:#584e46;
81 | }
82 |
83 | .openbtn:hover {
84 | color: #ECDAC9;
85 | }
86 |
87 | /* Style page content - use this if you want to push the page content to the right when you open the side navigation */
88 | #main {
89 | transition: margin-left .5s; /* If you want a transition effect */
90 | padding: 20px;
91 | }
92 |
93 | /* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
94 | @media screen and (max-height: 450px) {
95 | .sidebar {padding-top: 15px;}
96 | .sidebar a {font-size: 18px;}
97 | }
98 |
99 | /************************** product table styling *********************************/
100 |
101 | table {
102 | width: 100%;
103 | border-collapse: collapse;
104 | border-spacing: 0;
105 | box-shadow: 0 2px 15px rgba(64, 64, 64, .7);
106 | border-radius: 12px 12px 0 0;
107 | margin-bottom: 50px;
108 | }
109 |
110 | td,
111 | th {
112 | padding: 10px 16px;
113 | text-align: center;
114 | }
115 |
116 | th {
117 | background-color: #584e46;
118 | color: #fafafa;
119 | font-family: 'Open Sans', Sans-serif;
120 | font-weight: bold;
121 | }
122 |
123 | tr {
124 | width: 100%;
125 | background-color: #fafafa;
126 | font-family: 'Montserrat', sans-serif;
127 | }
128 |
129 | tr:nth-child(even) {
130 | background-color: #eeeeee;
131 | }
132 |
133 |
134 | /************************ login and sign up styling ******************************/
135 |
136 | .card-container.card-account {
137 | max-width: 500px;
138 | padding: 30px 30px;
139 | }
140 |
141 | .btn {
142 | font-weight: 700;
143 | height: 36px;
144 | -moz-user-select: none;
145 | -webkit-user-select: none;
146 | user-select: none;
147 | cursor: default;
148 | }
149 |
150 | /*
151 | * Card component
152 | */
153 | .card-account{
154 | background-color: #ECDAC9;
155 | /* just in case there no content*/
156 | padding: 20px 25px 30px;
157 | margin: 0 auto 25px;
158 | margin-top: 40px;
159 | /* shadows and rounded borders */
160 | -moz-border-radius: 2px;
161 | -webkit-border-radius: 2px;
162 | border-radius: 2px;
163 | -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
164 | -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
165 | box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
166 | }
167 |
168 | .profile-img-card {
169 | width: 96px;
170 | height: 96px;
171 | margin: 0 auto 10px;
172 | display: block;
173 | -moz-border-radius: 50%;
174 | -webkit-border-radius: 50%;
175 | border-radius: 50%;
176 | }
177 |
178 | /*
179 | * Form styles
180 | */
181 | .profile-name-card {
182 | font-size: 16px;
183 | font-weight: bold;
184 | text-align: center;
185 | margin: 10px 0 0;
186 | min-height: 1em;
187 | }
188 |
189 | .reauth-email {
190 | display: block;
191 | color: #404040;
192 | line-height: 2;
193 | margin-bottom: 10px;
194 | font-size: 14px;
195 | text-align: center;
196 | overflow: hidden;
197 | text-overflow: ellipsis;
198 | white-space: nowrap;
199 | -moz-box-sizing: border-box;
200 | -webkit-box-sizing: border-box;
201 | box-sizing: border-box;
202 | }
203 |
204 | .form-signin #inputEmail,
205 | .form-signin #inputPassword {
206 | direction: ltr;
207 | height: 44px;
208 | font-size: 16px;
209 | }
210 |
211 | .form-signin input[type=email],
212 | .form-signin input[type=password],
213 | .form-signin input[type=text],
214 | .form-signin button {
215 | width: 100%;
216 | display: block;
217 | margin-bottom: 10px;
218 | z-index: 1;
219 | position: relative;
220 | -moz-box-sizing: border-box;
221 | -webkit-box-sizing: border-box;
222 | box-sizing: border-box;
223 | }
224 |
225 | .form-signin .form-control:focus {
226 | border-color: #ab9787;
227 | outline: 0;
228 | -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #8a7a6d;
229 | box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px #8a7a6d;
230 | }
231 |
232 | .btn.btn-signin {
233 |
234 | background-color: #584e46;
235 | padding: 2px;
236 | font-weight: 700;
237 | font-size: 16px;
238 | height: 36px;
239 | -moz-border-radius: 3px;
240 | -webkit-border-radius: 3px;
241 | border-radius: 3px;
242 | border: none;
243 | -o-transition: all 0.218s;
244 | -moz-transition: all 0.218s;
245 | -webkit-transition: all 0.218s;
246 | transition: all 0.218s;
247 | }
248 |
249 | .btn.btn-signin:hover,
250 | .btn.btn-signin:active,
251 | .btn.btn-signin:focus {
252 | background-color: #a56a39;
253 | }
254 |
255 |
256 | .box {
257 | position: relative;
258 | background-color: #000;
259 | }
260 |
261 | .image {
262 | opacity: 1;
263 | display: block;
264 | max-width: 100%;
265 | height: auto;
266 | transition: .5s ease;
267 | backface-visibility: hidden;
268 | object-fit: contain;
269 | }
270 |
271 | .middle {
272 | transition: .5s ease;
273 | opacity: 0;
274 | position: absolute;
275 | top: 50%;
276 | left: 50%;
277 | transform: translate(-50%, -50%);
278 | -ms-transform: translate(-50%, -50%);
279 | text-align: center;
280 | }
281 |
282 | .box:hover .image {
283 | opacity: 0.3;
284 | }
285 |
286 | .box:hover .middle {
287 | opacity: 1;
288 | }
289 |
290 | .text {
291 | background-color: #584e46;
292 | color: #fff;
293 | font-size: 16px;
294 | padding: 6px;
295 | border-radius: 5px;
296 | }
297 |
298 | /* ******************* cart to login icon styling ********************* */
299 | .cart-login-btn{
300 | margin:5px;
301 | border-style: outset;
302 | }
303 | .cart-login-btn a i{
304 | padding: 10px;
305 | font-size:30px;
306 | color:#584e46;
307 | }
308 | .cart-login-btn a i:hover{
309 | color: grey;
310 | }
311 |
312 |
313 | /* **************************** footer *************************** */
314 | .footer-hover{
315 | color: #000;
316 | }
317 |
318 | .footer-hover:hover{
319 | color: #ECDAC9;
320 | text-decoration: none;
321 | }
322 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/Dresses.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/assets/images/Dresses.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/accept.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/assets/images/accept.png
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/contact.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/assets/images/contact.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/assets/images/logo.png
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/profile-pic.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/images/work-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/assets/images/work-1.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/js/ajaxWork.js:
--------------------------------------------------------------------------------
1 |
2 |
3 | function showProductItems(){
4 | $.ajax({
5 | url:"./adminView/viewAllProducts.php",
6 | method:"post",
7 | data:{record:1},
8 | success:function(data){
9 | $('.allContent-section').html(data);
10 | }
11 | });
12 | }
13 | function showCategory(){
14 | $.ajax({
15 | url:"./adminView/viewCategories.php",
16 | method:"post",
17 | data:{record:1},
18 | success:function(data){
19 | $('.allContent-section').html(data);
20 | }
21 | });
22 | }
23 | function showSizes(){
24 | $.ajax({
25 | url:"./adminView/viewSizes.php",
26 | method:"post",
27 | data:{record:1},
28 | success:function(data){
29 | $('.allContent-section').html(data);
30 | }
31 | });
32 | }
33 | function showProductSizes(){
34 | $.ajax({
35 | url:"./adminView/viewProductSizes.php",
36 | method:"post",
37 | data:{record:1},
38 | success:function(data){
39 | $('.allContent-section').html(data);
40 | }
41 | });
42 | }
43 |
44 | function showCustomers(){
45 | $.ajax({
46 | url:"./adminView/viewCustomers.php",
47 | method:"post",
48 | data:{record:1},
49 | success:function(data){
50 | $('.allContent-section').html(data);
51 | }
52 | });
53 | }
54 |
55 | function showOrders(){
56 | $.ajax({
57 | url:"./adminView/viewAllOrders.php",
58 | method:"post",
59 | data:{record:1},
60 | success:function(data){
61 | $('.allContent-section').html(data);
62 | }
63 | });
64 | }
65 |
66 | function ChangeOrderStatus(id){
67 | $.ajax({
68 | url:"./controller/updateOrderStatus.php",
69 | method:"post",
70 | data:{record:id},
71 | success:function(data){
72 | alert('Order Status updated successfully');
73 | $('form').trigger('reset');
74 | showOrders();
75 | }
76 | });
77 | }
78 |
79 | function ChangePay(id){
80 | $.ajax({
81 | url:"./controller/updatePayStatus.php",
82 | method:"post",
83 | data:{record:id},
84 | success:function(data){
85 | alert('Payment Status updated successfully');
86 | $('form').trigger('reset');
87 | showOrders();
88 | }
89 | });
90 | }
91 |
92 |
93 | //add product data
94 | function addItems(){
95 | var p_name=$('#p_name').val();
96 | var p_desc=$('#p_desc').val();
97 | var p_price=$('#p_price').val();
98 | var category=$('#category').val();
99 | var upload=$('#upload').val();
100 | var file=$('#file')[0].files[0];
101 |
102 | var fd = new FormData();
103 | fd.append('p_name', p_name);
104 | fd.append('p_desc', p_desc);
105 | fd.append('p_price', p_price);
106 | fd.append('category', category);
107 | fd.append('file', file);
108 | fd.append('upload', upload);
109 | $.ajax({
110 | url:"./controller/addItemController.php",
111 | method:"post",
112 | data:fd,
113 | processData: false,
114 | contentType: false,
115 | success: function(data){
116 | alert('Product Added successfully.');
117 | $('form').trigger('reset');
118 | showProductItems();
119 | }
120 | });
121 | }
122 |
123 | //edit product data
124 | function itemEditForm(id){
125 | $.ajax({
126 | url:"./adminView/editItemForm.php",
127 | method:"post",
128 | data:{record:id},
129 | success:function(data){
130 | $('.allContent-section').html(data);
131 | }
132 | });
133 | }
134 |
135 | //update product after submit
136 | function updateItems(){
137 | var product_id = $('#product_id').val();
138 | var p_name = $('#p_name').val();
139 | var p_desc = $('#p_desc').val();
140 | var p_price = $('#p_price').val();
141 | var category = $('#category').val();
142 | var existingImage = $('#existingImage').val();
143 | var newImage = $('#newImage')[0].files[0];
144 | var fd = new FormData();
145 | fd.append('product_id', product_id);
146 | fd.append('p_name', p_name);
147 | fd.append('p_desc', p_desc);
148 | fd.append('p_price', p_price);
149 | fd.append('category', category);
150 | fd.append('existingImage', existingImage);
151 | fd.append('newImage', newImage);
152 |
153 | $.ajax({
154 | url:'./controller/updateItemController.php',
155 | method:'post',
156 | data:fd,
157 | processData: false,
158 | contentType: false,
159 | success: function(data){
160 | alert('Data Update Success.');
161 | $('form').trigger('reset');
162 | showProductItems();
163 | }
164 | });
165 | }
166 |
167 | //delete product data
168 | function itemDelete(id){
169 | $.ajax({
170 | url:"./controller/deleteItemController.php",
171 | method:"post",
172 | data:{record:id},
173 | success:function(data){
174 | alert('Items Successfully deleted');
175 | $('form').trigger('reset');
176 | showProductItems();
177 | }
178 | });
179 | }
180 |
181 |
182 | //delete cart data
183 | function cartDelete(id){
184 | $.ajax({
185 | url:"./controller/deleteCartController.php",
186 | method:"post",
187 | data:{record:id},
188 | success:function(data){
189 | alert('Cart Item Successfully deleted');
190 | $('form').trigger('reset');
191 | showMyCart();
192 | }
193 | });
194 | }
195 |
196 | function eachDetailsForm(id){
197 | $.ajax({
198 | url:"./view/viewEachDetails.php",
199 | method:"post",
200 | data:{record:id},
201 | success:function(data){
202 | $('.allContent-section').html(data);
203 | }
204 | });
205 | }
206 |
207 |
208 |
209 | //delete category data
210 | function categoryDelete(id){
211 | $.ajax({
212 | url:"./controller/catDeleteController.php",
213 | method:"post",
214 | data:{record:id},
215 | success:function(data){
216 | alert('Category Successfully deleted');
217 | $('form').trigger('reset');
218 | showCategory();
219 | }
220 | });
221 | }
222 |
223 | //delete size data
224 | function sizeDelete(id){
225 | $.ajax({
226 | url:"./controller/deleteSizeController.php",
227 | method:"post",
228 | data:{record:id},
229 | success:function(data){
230 | alert('Size Successfully deleted');
231 | $('form').trigger('reset');
232 | showSizes();
233 | }
234 | });
235 | }
236 |
237 |
238 | //delete variation data
239 | function variationDelete(id){
240 | $.ajax({
241 | url:"./controller/deleteVariationController.php",
242 | method:"post",
243 | data:{record:id},
244 | success:function(data){
245 | alert('Successfully deleted');
246 | $('form').trigger('reset');
247 | showProductSizes();
248 | }
249 | });
250 | }
251 |
252 | //edit variation data
253 | function variationEditForm(id){
254 | $.ajax({
255 | url:"./adminView/editVariationForm.php",
256 | method:"post",
257 | data:{record:id},
258 | success:function(data){
259 | $('.allContent-section').html(data);
260 | }
261 | });
262 | }
263 |
264 |
265 | //update variation after submit
266 | function updateVariations(){
267 | var v_id = $('#v_id').val();
268 | var product = $('#product').val();
269 | var size = $('#size').val();
270 | var qty = $('#qty').val();
271 | var fd = new FormData();
272 | fd.append('v_id', v_id);
273 | fd.append('product', product);
274 | fd.append('size', size);
275 | fd.append('qty', qty);
276 |
277 | $.ajax({
278 | url:'./controller/updateVariationController.php',
279 | method:'post',
280 | data:fd,
281 | processData: false,
282 | contentType: false,
283 | success: function(data){
284 | alert('Update Success.');
285 | $('form').trigger('reset');
286 | showProductSizes();
287 | }
288 | });
289 | }
290 | function search(id){
291 | $.ajax({
292 | url:"./controller/searchController.php",
293 | method:"post",
294 | data:{record:id},
295 | success:function(data){
296 | $('.eachCategoryProducts').html(data);
297 | }
298 | });
299 | }
300 |
301 |
302 | function quantityPlus(id){
303 | $.ajax({
304 | url:"./controller/addQuantityController.php",
305 | method:"post",
306 | data:{record:id},
307 | success:function(data){
308 | $('form').trigger('reset');
309 | showMyCart();
310 | }
311 | });
312 | }
313 | function quantityMinus(id){
314 | $.ajax({
315 | url:"./controller/subQuantityController.php",
316 | method:"post",
317 | data:{record:id},
318 | success:function(data){
319 | $('form').trigger('reset');
320 | showMyCart();
321 | }
322 | });
323 | }
324 |
325 | function checkout(){
326 | $.ajax({
327 | url:"./view/viewCheckout.php",
328 | method:"post",
329 | data:{record:1},
330 | success:function(data){
331 | $('.allContent-section').html(data);
332 | }
333 | });
334 | }
335 |
336 |
337 | function removeFromWish(id){
338 | $.ajax({
339 | url:"./controller/removeFromWishlist.php",
340 | method:"post",
341 | data:{record:id},
342 | success:function(data){
343 | alert('Removed from wishlist');
344 | }
345 | });
346 | }
347 |
348 |
349 | function addToWish(id){
350 | $.ajax({
351 | url:"./controller/addToWishlist.php",
352 | method:"post",
353 | data:{record:id},
354 | success:function(data){
355 | alert('Added to wishlist');
356 | }
357 | });
358 | }
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/assets/js/script.js:
--------------------------------------------------------------------------------
1 |
2 | function openNav() {
3 | document.getElementById("mySidebar").style.width = "250px";
4 | document.getElementById("main").style.marginLeft = "250px";
5 | document.getElementById("main-content").style.marginLeft = "250px";
6 | document.getElementById("main").style.display="none";
7 | }
8 |
9 | function closeNav() {
10 | document.getElementById("mySidebar").style.width = "0";
11 | document.getElementById("main").style.marginLeft= "0";
12 | document.getElementById("main").style.display="block";
13 | }
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/config/dbconnect.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/addCatController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/addItemController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/addSizeController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/addVariationController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/catDeleteController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/deleteItemController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/deleteSizeController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/deleteVariationController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/updateItemController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/updateOrderStatus.php:
--------------------------------------------------------------------------------
1 | query($sql);
9 | // echo $result;
10 |
11 | $row=$result-> fetch_assoc();
12 |
13 | // echo $row["pay_status"];
14 |
15 | if($row["order_status"]==0){
16 | $update = mysqli_query($conn,"UPDATE orders SET order_status=1 where order_id='$order_id'");
17 | }
18 | else if($row["order_status"]==1){
19 | $update = mysqli_query($conn,"UPDATE orders SET order_status=0 where order_id='$order_id'");
20 | }
21 |
22 |
23 |
24 | // if($update){
25 | // echo"success";
26 | // }
27 | // else{
28 | // echo"error";
29 | // }
30 |
31 | ?>
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/updatePayStatus.php:
--------------------------------------------------------------------------------
1 | query($sql);
8 | // echo $result;
9 |
10 | $row=$result-> fetch_assoc();
11 |
12 | // echo $row["pay_status"];
13 |
14 | if($row["pay_status"]==0){
15 | $update = mysqli_query($conn,"UPDATE orders SET pay_status=1 where order_id='$order_id'");
16 | }
17 | else if($row["pay_status"]==1){
18 | $update = mysqli_query($conn,"UPDATE orders SET pay_status=0 where order_id='$order_id'");
19 | }
20 |
21 |
22 | // if($update){
23 | // echo"success";
24 | // }
25 | // else{
26 | // echo"error";
27 | // }
28 |
29 | ?>
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/controller/updateVariationController.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Admin
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
Total Users
27 |
28 | query($sql);
31 | $count=0;
32 | if ($result-> num_rows > 0){
33 | while ($row=$result-> fetch_assoc()) {
34 |
35 | $count=$count+1;
36 | }
37 | }
38 | echo $count;
39 | ?>
40 |
41 |
42 |
43 |
44 |
45 |
Total Categories
46 |
47 | query($sql);
51 | $count=0;
52 | if ($result-> num_rows > 0){
53 | while ($row=$result-> fetch_assoc()) {
54 |
55 | $count=$count+1;
56 | }
57 | }
58 | echo $count;
59 | ?>
60 |
61 |
62 |
63 |
64 |
65 |
66 |
Total Products
67 |
68 | query($sql);
72 | $count=0;
73 | if ($result-> num_rows > 0){
74 | while ($row=$result-> fetch_assoc()) {
75 |
76 | $count=$count+1;
77 | }
78 | }
79 | echo $count;
80 | ?>
81 |
82 |
83 |
84 |
85 |
86 |
87 |
Total orders
88 |
89 | query($sql);
93 | $count=0;
94 | if ($result-> num_rows > 0){
95 | while ($row=$result-> fetch_assoc()) {
96 |
97 | $count=$count+1;
98 | }
99 | }
100 | echo $count;
101 | ?>
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | alert("Category Successfully Added")';
113 | }else if (isset($_GET['category']) && $_GET['category'] == "error") {
114 | echo '';
115 | }
116 | if (isset($_GET['size']) && $_GET['size'] == "success") {
117 | echo '';
118 | }else if (isset($_GET['size']) && $_GET['size'] == "error") {
119 | echo '';
120 | }
121 | if (isset($_GET['variation']) && $_GET['variation'] == "success") {
122 | echo '';
123 | }else if (isset($_GET['variation']) && $_GET['variation'] == "error") {
124 | echo '';
125 | }
126 | ?>
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/sidebar.php:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/check-strappy-dress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/check-strappy-dress.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/croptop.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/croptop.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/dress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/dress.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/offshoulder.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/offshoulder.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/shirtdress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/shirtdress.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/tops.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/tops.jpg
--------------------------------------------------------------------------------
/Mini-Php-Projects/admin_panel/uploads/v-neck.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zapellass123/PHP-Project/6a015ada891f3eef25d11ffc64a40462b4549d48/Mini-Php-Projects/admin_panel/uploads/v-neck.jpg
--------------------------------------------------------------------------------
/Petugas.php:
--------------------------------------------------------------------------------
1 | load->model('petugas_model');
10 | }
11 |
12 | public function index()
13 | {
14 | $data['title'] = 'Petugas Ukur';
15 | $data['petugas'] = $this->petugas_model->get_data('petugas_ukur')->result();
16 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
17 |
18 |
19 | $this->load->view('templates/header', $data);
20 | $this->load->view('templates/sidebar', $data);
21 | $this->load->view('templates/topbar', $data);
22 | $this->load->view('petugas/index', $data);
23 | $this->load->view('templates/footer');
24 | }
25 |
26 | public function surat_tugas()
27 | {
28 | $data['title'] = 'Surat Tugas';
29 | $data['petugas'] = $this->petugas_model->get_data('petugas_ukur')->result();
30 | $data['surat_tugas'] = $this->petugas_model->get_data('surat_tugas')->result();
31 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
32 | $data['laporan'] = $this->petugas_model->getdatawithstatus('surat_tugas')->result();
33 |
34 | $this->load->view('templates/header', $data);
35 | $this->load->view('templates/sidebar', $data);
36 | $this->load->view('templates/topbar', $data);
37 | $this->load->view('petugas/surat_tugas', $data);
38 | $this->load->view('templates/footer');
39 | }
40 |
41 | public function laporan()
42 | {
43 | $data['title'] = 'Laporan Ukur';
44 | $data['petugas'] = $this->petugas_model->get_data('petugas_ukur')->result();
45 | $data['surat_tugas'] = $this->petugas_model->get_data('surat_tugas')->result();
46 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
47 | $data['laporan'] = $this->petugas_model->getdatawithstatus('pengukuran')->result();
48 |
49 | $this->load->view('templates/header', $data);
50 | $this->load->view('templates/sidebar', $data);
51 | $this->load->view('templates/topbar', $data);
52 | $this->load->view('petugas/laporan', $data);
53 | $this->load->view('templates/footer');
54 | }
55 |
56 | public function penugasan()
57 | { {
58 | $data['title'] = 'Petugas Ukur';
59 | $data['petugas'] = $this->petugas_model->get_data('petugas_ukur')->result();
60 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
61 |
62 |
63 | $this->load->view('templates/header', $data);
64 | $this->load->view('templates/sidebar', $data);
65 | $this->load->view('templates/topbar', $data);
66 | $this->load->view('petugas/penugasan', $data);
67 | $this->load->view('templates/footer');
68 | }
69 | }
70 | public function tambah()
71 | {
72 | $data['title'] = 'Tambah Petugas';
73 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
74 | $this->load->view('templates/header', $data);
75 | $this->load->view('templates/sidebar', $data);
76 | $this->load->view('templates/topbar', $data);
77 | $this->load->view('petugas/tambah');
78 | $this->load->view('templates/footer');
79 | }
80 |
81 | public function input_laporan()
82 | {
83 | $data['title'] = 'Input Laporan';
84 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
85 |
86 | $this->load->view('templates/header', $data);
87 | $this->load->view('templates/sidebar', $data);
88 | $this->load->view('templates/topbar', $data);
89 | $this->load->view('petugas/input_laporan', $data);
90 | $this->load->view('templates/footer');
91 | }
92 |
93 | public function edit_laporan()
94 | {
95 | $data['title'] = 'Edit Laporan';
96 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
97 |
98 | $this->load->view('templates/header', $data);
99 | $this->load->view('templates/sidebar', $data);
100 | $this->load->view('templates/topbar', $data);
101 | $this->load->view('petugas/edit_laporan', $data);
102 | $this->load->view('templates/footer');
103 | }
104 |
105 | public function edit_data($id)
106 | {
107 | $data['title'] = 'Edit Data Petugas';
108 | $data['user'] = $this->db->get_where('user', ['username' => $this->session->userdata('username')])->row_array();
109 | $data['petugas'] = $this->petugas_model->ambil_id($id)->result()[0];
110 | // var_dump($data['petugas']);
111 |
112 | $this->load->view('templates/header', $data);
113 | $this->load->view('templates/sidebar', $data);
114 | $this->load->view('templates/topbar', $data);
115 | $this->load->view('petugas/edit_data', $data);
116 | $this->load->view('templates/footer');
117 | }
118 |
119 | public function tambah_aksi()
120 | {
121 | $this->_rules();
122 | if ($this->form_validation->run() == false) {
123 | $this->tambah();
124 | } else {
125 | $data = array(
126 | 'nama_petugas' => $this->input->post('nama_petugas'),
127 | 'no_telp' => $this->input->post('no_telp'),
128 | 'alamat' => $this->input->post('alamat'),
129 | 'id_berkas' => $this->input->post('id_berkas'),
130 | 'nip_petugas' => $this->input->post('nip_petugas'),
131 | 'jabatan' => $this->input->post('jabatan'),
132 |
133 |
134 | );
135 |
136 | $this->petugas_model->insert_data($data, 'petugas_ukur');
137 | $this->session->set_flashdata('pesan', '
138 | Data Berhasil Ditambahkan!
');
139 | redirect('petugas');
140 | }
141 | }
142 |
143 | public function tambah_laporan()
144 | {
145 | $config['upload_path'] = './assets/img/';
146 | $config['allowed_types'] = 'gif|jpg|png|PNG';
147 | $config['max_size'] = 2048;
148 | $config['max_width'] = 1980;
149 | $config['max_height'] = 1080;
150 |
151 | $this->load->library('upload', $config);
152 |
153 | if (!$this->upload->do_upload('userfile')) {
154 | $gambar = $this->upload->data();
155 | $gambar = $gambar['file_name'];
156 | $tanggal = date('Y-m-d');
157 | $no_surat = $this->input->post('no_surat', TRUE);
158 | $nip = $this->input->post('nip_petugas', TRUE);
159 | $no_berkas = $this->input->post('no_berkas', TRUE);
160 | $volume_awal = $this->input->post('volume_awal', TRUE);
161 | $volume_akhir = $this->input->post('volume_akhir', TRUE);
162 | $status = $this->input->post('status', TRUE);
163 |
164 | $data = array(
165 | 'tgl_pengerjaan' => $tanggal,
166 | 'no_surat' => $no_surat,
167 | 'nip_petugas' => $nip,
168 | 'no_berkas' => $no_berkas,
169 | 'volume_awal' => $volume_awal,
170 | 'volume_akhir' => $volume_akhir,
171 | 'status' => $status,
172 |
173 | );
174 | $this->db->insert('pengukuran', $data);
175 | $this->session->set_flashdata('pesan', '
176 | Data Berhasil Diupload!
');
177 | redirect('petugas/surat_tugas');
178 | } else {
179 | $gambar = $this->upload->data();
180 | $gambar = $gambar['file_name'];
181 | $tanggal = $this->input->post('tgl_pengerjaan', TRUE);
182 | $no_surat = $this->input->post('no_surat', TRUE);
183 | $nip = $this->input->post('nip_petugas', TRUE);
184 | $no_berkas = $this->input->post('no_berkas', TRUE);
185 | $volume_awal = $this->input->post('volume_awal', TRUE);
186 | $volume_akhir = $this->input->post('volume_akhir', TRUE);
187 | $status = $this->input->post('status', TRUE);
188 |
189 | $data = array(
190 | 'tgl_pengerjaan' => $tanggal,
191 | 'no_surat' => $no_surat,
192 | 'nip_petugas' => $nip,
193 | 'no_berkas' => $no_berkas,
194 | 'volume_awal' => $volume_awal,
195 | 'volume_akhir' => $volume_akhir,
196 | 'status' => $status,
197 |
198 | );
199 | $this->db->insert('pengukuran', $data);
200 | $this->session->set_flashdata('pesan', '
201 | Data Berhasil Ditambahkan!
');
202 | redirect('petugas/laporan');
203 | }
204 | }
205 |
206 | // public function edit($id_petugas)
207 | // {
208 | // $this->_rules();
209 | // if ($this->form_validation->run() == false) {
210 | // $this->index();
211 | // } else {
212 | // $data = array(
213 | // 'nama_petugas' => $this->input->post('nama_petugas'),
214 | // 'no_telp' => $this->input->post('no_telp'),
215 | // 'alamat' => $this->input->post('alamat'),
216 | // 'id_berkas' => $this->input->post('id_berkas'),
217 | // 'nip_petugas' => $this->input->post('nip_petugas'),
218 | // 'jabatan' => $this->input->post('jabatan'),
219 |
220 | // );
221 |
222 | // $this->petugas_model->update_data($data, 'petugas_ukur');
223 | // $this->session->set_flashdata('pesan', '
224 | // Data Berhasil Ditambah!
');
225 | // redirect('petugas');
226 | // }
227 | // }
228 |
229 | public function _rules()
230 | {
231 | $this->form_validation->set_rules('nama_petugas', 'Nama Petugas', 'required', array(
232 | 'required' => '%s harus diisi !!'
233 | ));
234 | $this->form_validation->set_rules('no_telp', 'Nomor Telepon', 'required', array(
235 | 'required' => '%s harus diisi !!'
236 | ));
237 | $this->form_validation->set_rules('alamat', 'Alamat', 'required', array(
238 | 'required' => '%s harus diisi !!'
239 | ));
240 | $this->form_validation->set_rules('id_berkas', 'Nomor Berkas', 'required', array(
241 | 'required' => '%s harus diisi !!'
242 | ));
243 | $this->form_validation->set_rules('nip_petugas', 'NIP Petugas', 'required', array(
244 | 'required' => '%s harus diisi !!'
245 | ));
246 | $this->form_validation->set_rules('jabatan', 'Jabatan', 'required', array(
247 | 'required' => '%s harus diisi !!'
248 | ));
249 | }
250 |
251 | public function delete($id)
252 | {
253 | $where = array('id_petugas' => $id);
254 |
255 | $this->petugas_model->delete($where, 'petugas_ukur');
256 | $this->session->set_flashdata('pesan', '
257 | Data Berhasil Dihapus!
');
258 | redirect('petugas');
259 | }
260 | }
261 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # PHP-Project
2 |
3 | Feel free to upload your files to this repositories :)
4 |
5 | - [Harry](https://github.com/harryrdn1)
6 | - [Saputra](https://github.com/Svz1404)
7 | - [Anugerah](https://github.com/syncos77)
8 | - [Salman](https://github.com/salfar17)
9 | - [rizal](https://github.com/rizalriyad3)
10 | - [Rawi](https://github.com/Rawiraihan82)
11 | - [Risyad](https://github.com/Risyadreza162)
12 | - [Raid](https://github.com/raidriyan1)
13 | - [Rafan Radi](https://github.com/rafanradi8)
14 | - [Raindra](https://github.com/raindra98)
15 | - [Rafidan](https://github.com/rafifrafidan)
16 | - [Bronkx](https://github.com/fajrildiajarinfaisalazure)
17 | - [Ghalib Akbar](https://github.com/Alibyze)
18 | - [Riski](https://github.com/Riskiy890)
19 | - [Rafausman](https://github.com/rafausman60)
20 | - [Nazril](https://github.com/nazrilnazim6)
21 | - [Nazannaurel](https://github.com/nazannaurel)
22 | - [Indra](https://github.com/BEASTzINDRA)
23 | - [Nazra](https://github.com/nazrannazri726)
24 | - [Nasir](https://github.com/nasirnasih375)
25 | - [Andre](https://github.com/Arrafll)
26 | - [Budi](https://github.com/Budilanfers)
27 | - [Fathur](https://github.com/nrathome)
28 | - [Andre S.](https://github.com/andrepgsilva)
29 | - [Gbaa5](https://github.com/gabutteam5)
30 | - [Farna](https://github.com/farnahatafar)
31 | - [Verrnando](https://github.com/gabutteam3b)
32 | - [Leviie](https://github.com/leviakeer212)
33 | - [Hydeshy](https://github.com/ganutteam1)
34 | - [Cinta Lakie](https://github.com/ganutteam2)
35 | - [Qioku Lahdan](https://github.com/ganutteam3)
36 | - [Pratika Hastari](https://github.com/ganutteam4)
37 | - [Roy](https://github.com/ehroy)
38 | - [Najwan](https://github.com/najwannajmi330)
39 | - [Nafisna](https://github.com/nafisnafi776)
40 | - [Nadim](https://github.com/nadimnadif0)
41 | - [Nabil](https://github.com/nabilnadir963)
42 | - [Ozi](https://github.com/kiifaz)
43 | - [Fajar Muh Sahreza](https://github.com/fajarmuhsahreza)
44 | - [Mhd Arif Budiman](https://github.com/guebanget0)
45 | - [Hamim](https://github.com/hamimhariri228)
46 | - [Nafina](https://github.com/nafinaqib06)
47 | - [Nasih](https://github.com/Nasihnajwan3)
48 | - [Najmi](https://github.com/Najmimumtas3)
49 | - [Manna](https://github.com/Mannanmaula)
50 | - [Ansori](https://github.com/Ansorimarwan2)
51 | - [Muntasir](https://github.com/Mmuntasir512)
52 | - [Mihar](https://github.com/Miharmuhsin)
53 | - [Mustofa](https://github.com/Mustofamuslih6)
54 | - [Tompest](https://github.com/tompest)
55 | - [Mursid](https://github.com/Mursidmuhsin)
56 | - [Tara](https://github.com/Tyudhani)
57 | - [Dito](https://github.com/lilditf)
58 | - [Bintang](https://github.com/BintangFajarNH)
59 | - [Juvi](https://github.com/juvianandra)
60 | - [Gnone](https://github.com/groupwan)
61 | - [Azrt](https://github.com/azurediajarinfaisal)
62 | - [gabutteam](https://github.com/gabutteam0)
63 | - [Felix](https://github.com/ganutteam17)
64 | - [Kevin](https://github.com/rivaldo15)
65 | - [Fajarhal](https://github.com/fatrahaluis)
66 | - [Majid](https://github.com/majidaji1)
67 | - [Andaru](https://github.com/XNdruu)
68 | - [Usra](https://github.com/xsrazy)
69 | - [Fikri Khairul Shaleh](https://github.com/fikriks)
70 | - [Kelvin](https://github.com/mumuvera)
71 | - [Andy](https://github.com/therealandy0074)
72 | - [Raaihan](https://github.com/raaihan)
73 | - [HDJ](https://github.com/Hadeje)
74 | - [Alex](https://github.com/jokowhoiam)
75 | - [Faezal](https://github.com/Blazes05)
76 | - [Taufik](https://github.com/Taufikrhrp)
77 | - [vinz15](https://github.com/vinz15)
78 | - [Vania](https://github.com/fckvania)
79 | - [Ruhin](https://github.com/me-ruhin)
80 | - [Vitor Pereira](https://github.com/vitoropereira)
81 | - [Kunal](https://github.com/kunaldhongade)
82 | - [wahyuhjr](https://github.com/wahyuhjr)
83 | - [rhemzypm](https://github.com/rhemzypm)
84 |
--------------------------------------------------------------------------------
/autorun.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | while :
3 | do
4 | node index.js
5 | sleep 1
6 |
7 | done
8 |
--------------------------------------------------------------------------------
/calculator.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Calculator
4 |
5 |
6 |
7 |
Calculator
8 |
26 |
27 |
28 |