-
Notifications
You must be signed in to change notification settings - Fork 1
/
addwishlist.php
42 lines (41 loc) · 1.08 KB
/
addwishlist.php
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
<?php
session_start();
require "config.php";
require "models/db.php";
require "models/product.php";
require "models/manufacture.php";
require "models/protype.php";
require "models/cart.php";
require "models/user.php";
require "models/bill.php";
require "models/order_detail.php";
require "models/wish.php";
$product = new Product();
$manu = new Manufacture();
$type = new Protype();
$cart = new Cart();
$user = new User();
$bill = new Bill();
$order = new Order_Detail();
$wish = new Wishlist();
if (isset($_SESSION['user'])) {
# code...
if (isset($_GET['id'])) {
$id = $_GET['id'];
$check = $user->check($_SESSION['user']);
foreach ($check as $values) {
if ($wish->getProduct($_SESSION['user'], $id)) {
# code...
echo "k tc";
header("location:index.php");
} else {
# code...
$wish->addWish($values['user_id'], $id);
header("location:index.php");
}
}
}
} else {
# code...
header("location:./login/index.php");
}