-
Notifications
You must be signed in to change notification settings - Fork 1
/
delete_listing.php
159 lines (139 loc) · 4.75 KB
/
delete_listing.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
<?php @session_start();?>
<?php
if (isset($_GET['id']) && isset($_GET['lid'])) {
$id = $_GET['id'];
$lid = $_GET['lid'];
} else if (isset($_SESSION['auth_id']) && isset($_GET['lid'])) {
$id = $_SESSION['auth_id'];
$lid = $_GET['lid'];
} else {
include_once "deny_access.php";
exit();
}
?>
<?php
require_once('includes/init.php');
?>
<?php
$email = "";
$fname = "";
$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM lbs_user WHERE user_id= '$id' ");
// Make sure this person a visitor is trying to view actually exists
$existCount = mysql_num_rows($sql);
if ($existCount < 1)
{
$page_topic = "Unrecognized User!";
$msgToUser = "The user you are trying to access does not exist.";
require_once('msg_to_user.php');
exit();
}
while($row = mysql_fetch_array($sql)){
$email = $row["email"];
$fname = $row["first_name"];
$check_pic = "members/$logOptions_id/image01.jpg";
$default_pic = "members/default.png";
if (file_exists($check_pic))
{
$profile_img = "<img src='$check_pic' width='100px' height= '100px' />";
} else
{
$profile_img = "<img src='$default_pic' width='100px' height= '100px' />";
}
}
global $gbizObj;
?>
<?php
if(isset($_POST['btnDel']))
{
$msg = "";
global $gbizObj;
$gbizObj->setListingId($lid);
for($i=1;$i<=8;$i++)
{
$gbizObj->delete($i);
}
//delete listing directory and all its contents
$dirPath = "biz/$lid";
recursiveRemoveDirectory($dirPath);
header("Location: view_listings.php?id=$id");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title><?php print DOMAIN_NAME. " :: "."$logOptions_username"?>'s listings</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Le styles -->
<link href="public/css/bootstrap.css" rel="stylesheet">
<link href="public/css/bootstrap.min.css" rel="stylesheet">
<link href="public/css/960_24_col.css" rel="stylesheet">
<link href="public/css/reset.css" rel="stylesheet">
<link href="public/css/style.css" rel="stylesheet">
<link href="public/css/profile.css" rel="stylesheet" type="text/css">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="public/js/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="public/icons/favicon.ico">
<script src="public/js/jquery.js"></script>
<script src="public/js/bpopup-0.6.0.min.js"></script>
<script src="public/js/functions.js"></script>
<script type="text/javascript">
function showLizDel()
{
//status = document.getElementById('lizDel').style.visibility;
$(document).ready(function()
{
var isHidden;
if ($('#lizDel').css('visibility') == 'hidden')
{
$('#lizDel').css('visibility', 'visible');
$('#del_listing').css('visibility', 'hidden');
}
});
}
</script>
<?php require_once('includes/ga_property_id.php');?>
</head>
<body>
<?php require_once('includes/geo_location_all.php');?>
<div class="container_24" id="container">
<?php require_once('templates/top-nav-bar.php');?>
<?php require_once('templates/header.php');?>
<?php require_once('templates/linkbar.html');?>
<?php require('templates/profile_left_column.php');?>
<div id="profile_body" class="grid_12">
<h1 id="profile_page_topic">Delete Listing - <?php echo $gbizObj->getTitle($lid);?> </h1>
<div id="del_listing" class="grid_12"> You are going to delete this listing. Please consider that this can not be undone. Once you delete a listing, it can not be recovered. The search engines will not track this listing.<br>
<br>
Click Back button to cancel listing deletion and go to previous page. <br>
Click Proceed button to go ahead with listing deletion.
<div id="controls">
<input name="" type="button" class="btn-primary" value="Go Back" style="margin-right:100px;" onClick="history.go(-1)">
<input name="" type="button" class="btn-danger" value="Proceed" onClick="showLizDel()">
</div>
<div id="lizDel" align="center"> Click Delete button to remove <?php echo "<b>".$gbizObj->getTitle($lid)."</b>";?> with all its information. <br>
<br>
<form method="post" action="">
<input type="submit" class="btn-danger" value="Delete" name="btnDel" onClick="hidelizDel()">
</form>
</div>
<div id="response"><?php echo $msg;?></div>
</div>
</div>
<div class="grid_6">
<?php require_once('templates/right_column.php');?>
</div>
<div class="clear"></div>
<?php require_once('templates/footer.php');?>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="public/js/uservoice_feedback.js"></script>
</body>
</html>