-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsale.php
169 lines (146 loc) · 6.43 KB
/
sale.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
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
<?php
session_start();
include("php/controllers/sale-ctrl.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sale Post</title>
<link rel="stylesheet" href="styles/page-container.css">
<link rel="stylesheet" href="styles/sale-request.css">
<script src="js/sale-request.js"></script>
<?php include_once('php/includes/common-css-js.php'); ?>
</head>
<body>
<?php
include("php/templates/header.php");
?>
<form class='hide' id="save-form">
<input type="text" name="sale_id" value="<?php echo $values['sale_id'] ?>">
<input type="text" name="action" value="save">
</form>
<form class='hide' id="unsave-form">
<input type="text" name="sale_id" value="<?php echo $values['sale_id'] ?>">
<input type="text" name="action" value="unsave">
</form>
<div class="popup-container" id="report-post">
<h2>Report Post</h2>
<form class="simple-form" id="report-form">
<label for="complaint_type">Reason</label>
<select name='complaint_type' id="complaint_type">
<option value="false advertisement">False advertisement</option>
<option value="spam and abuse">Spam and abuse</option>
<option value="false information">False information</option>
<option value="transaction denial">Transaction denial</option>
</select>
<label for="description">Description</label>
<textarea type="text" name='description' id="description" rows="7"></textarea>
<input type="hidden" name='sale_id' value="<?php echo $values['sale_id'] ?>">
</form>
<input class="btn-report" type="button" value="Submit" onclick="submitReport('submit-sale-complaint.php')">
<input class="btn-report" type="button" value="Cancel" id="cancel-report" onclick="hideReportForm()">
</div>
<div class="popup-container" id="report-success">
<h2>Report Successful!</h2>
<h3>Thank you for the support</h3>
<input class="btn-report" type="button" value="Close" id="close-success" onclick="hideReportSuccess()">
</div>
<div class="container" id="container">
<div class="title">
<h1><?php echo $values['title'] ?></h1>
</div>
<div class="images">
<div class="slide-show">
<input class="btn-image btn-left" type="button" id="left" value="❮" onclick=changeImage(-1)>
<input class="btn-image btn-right" type="button" id="left" value="❯" onclick=changeImage(1)>
<img class="image" src="<?php if(empty($values['cover_photo'])) echo "images/sale/default.png"; else echo $values['cover_photo'];?>">
<?php
foreach ($values['images'] as $image)
{
echo "<img class='image hide' src='$image'>";
}
?>
</div>
</div>
<div class="btn-container-ralign">
<input class='btn-simple' type='button' value='Report' onclick='showReportForm()' <?php echo isset($_SESSION['user_id']) ? '' : "disabled title = 'Sign in to report posts'" ?>>
<input class='btn-simple <?php echo !$values['saved'] ?'hide' : '' ?>' type='button' value='Saved' id='btn-unsave' onclick="unsave('save-sale.php')">
<input class='btn-simple <?php echo $values['saved'] ? 'hide' : '' ?>' type='button' value='Save' id='btn-save' onclick="save('save-sale.php')" <?php echo isset($_SESSION['user_id']) ? '' : "disabled title = 'Sign in to save posts'" ?>>
</div>
<div class="info">
<h3>Details</h3>
<div class="field-container">
<div class="info-field">
<p>Land Area</p>
<p><?php echo $values['land_area']?> Perches</p>
</div>
<div class="info-field">
<p>Price</p>
<p><?php echo $values['price'] ? 'Rs. '.$values['price'] : 'Negligible' ?></p>
</div>
<div class="info-field">
<p>City</p>
<p><?php echo $values['city']?></p>
</div>
<div class="info-field">
<p>District</p>
<p><?php echo $values['district']?></p>
</div>
<div class="info-field">
<p>Province</p>
<p><?php echo $values['province']?></p>
</div>
<div class="info-field">
<p>Address</p>
<p><?php echo $values['address']?></p>
</div>
</div>
</div>
<div class="description">
<h3>Description</h3>
<p><?php echo $values['description']?> </p>
</div>
<div class="contacts">
<h3>Contacts</h3>
<div class="field-container">
<?php
foreach ($values['phone'] as $contact)
{
echo "<a href='tel:$contact'><div><p>$contact</p></div></a>";
}
?>
</div>
</div>
<div class="user">
<h3>Seller</h3>
<a href="userview.php?id=<?php echo $values['seller']['user_id'] ?>">
<div class="profile">
<img class="avatar" src="<?php echo $values['seller']['profile_photo'] ?>">
<p> <?php echo $values['seller']['first_name'] . ' ' . $values['seller']['last_name'] ?></p>
</div>
</a>
<div class="field-container">
<div class="info-field">
<p>Contacts</p>
<a href="tel:<?php echo $values['seller']['contact'] ?>">
<p><?php echo $values['seller']['contact'] ?></p>
</a>
</div>
<div class="info-field">
<p>E-mail</p>
<a href="mailto:<?php echo $values['seller']['email'] ?>">
<p><?php echo $values['seller']['email'] ?></p>
</a>
</div>
<div class="info-field">
<p>About</p>
<p><?php echo $values['seller']['about'] ?></p>
</div>
</div>
</div>
</div>
<?php
include("php/templates/footer.php");
?>
</body>
</html>