-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvoice.php
More file actions
72 lines (62 loc) · 2.59 KB
/
Copy pathinvoice.php
File metadata and controls
72 lines (62 loc) · 2.59 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
<?php session_start();
include 'header.php';
include 'Classes.php';
?>
<body>
<?php
/**
* User: OMAR BARA
* Date: 01/01/2018
* Time: 12:54 PM
*/
include "functions.php";
if (!empty($_SESSION)) {
if (isset($_GET['qty']) && !empty($_GET['qty']) && ($_GET['qty'] > 0) AND
isset($_GET['aldd']) && !empty($_GET['aldd']) ) {
$qty = 0;
$qty = $_GET['qty'];
$allData = $_GET['aldd'];
///error
if ($qty < $allData[5]) {
//create invoice
$price = $allData[1];
//$color = $allData[0];
//chek if there is a Sale or not
$sale = $allData[2];
$name = $allData[3];
$imagePath = $allData[4];
$amount = $allData[5];
if ($sale == 'sale') {
$price = 0.3 * $price;
} else $sale = 0;
$id = $allData[6];
$filePath = $allData[7];
$allData[8] = $qty;
$counter = $_SESSION["counter"];
echo '<br><p>You have: ' . ++$counter . " Items In your Cart</p><br>";
$_SESSION['invoice'][$_SESSION["counter"]] = $allData;
$order = new order();
$order->invoice_display($_SESSION['invoice']);
$_SESSION["counter"]++;
echo '<div class="row"><div class="col-6"> <a href="address.php" class="btn btn-primary btn-block "
role="button" ><h4>Approve invoice order</h4></a></div></div><br>' . ' ' . '<br>';
} else {
echo '<div class="container"><div class="well text-center"><p style="color:red"><strong>
There is : '. $allData[5] .' left in stock </strong></p></div></div><div class="row"> <div class="col-6">ss</div>';
}
}else if (!empty($_SESSION['invoice'])) {
invoice_display($_SESSION['invoice']);
echo '<p style="text-align:center;font-size: 150%;">Approve invoice order
<a href="address.php" style="border: 3px solid cadetblue;background: darkslategrey">Continue</a></p>';
} else echo '<div class="container"><div class="well text-center"><p style="color:red"><strong> Empty Cart</strong></p></div></div>';
// Error Warning session expired
} else {
echo '<div class="container"><div class="well text-center"><p style="color:red"><strong>
"Warning" Your Session is over </strong></p></div></div><div class="row"> <div class="col-6">ss</div>';
echo '</div> <div class="alert alert-danger text-center">
<strong>Error!</strong> Your setion is expired plesse return to <a href="index.php">Here</a> .
</div></div>';
}
?>
</body>
<?php include 'footer.php';?>