-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-feedback.php
231 lines (213 loc) · 7.83 KB
/
post-feedback.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?
require_once('config/config.php');
validation_check($_SESSION['user_id'], 'login.php');
if($_REQUEST['u']=='' && $_REQUEST['add_id'])
{
header('location:mylistings.php');
}
function makeRandomWord($size) {
$salt = "ABCHEFGHJKMNPQRSTUVWXYZ0123456789abchefghjkmnpqrstuvwxyz";
srand((double)microtime()*1000000);
$word = '';
$i = 0;
while (strlen($word)<$size) {
$num = rand() % 59;
$tmp = substr($salt, $num, 1);
$word = $word . $tmp;
$i++;
}
return $word;
}
$checkCode = makeRandomWord(5);
$random=rand().$_SESSION['checkCode'];
$feed_arr=Select_Qry("*",ADVERTISE,"add_id='".$_REQUEST['add_id']."'","","","","");
if(isset($_REQUEST['btnSubmit']))
{
if($_REQUEST['capture_value']==$_REQUEST['captcha_code'])
{
$where="user_id='".$feed_arr['user_id']."' AND posted_by='".$_SESSION['user_id']."' AND add_id='".$_REQUEST['add_id']."'";
$chk=Select_Qry("*",USER_FEEDBACK,$where,"","","","");
if($chk!='')
{
$msg=successfulMessage("You have already posted feedback for this Listing.");
}
else
{
$set="user_id='".base64_decode($_REQUEST['u'])."',
posted_by='".$_SESSION['user_id']."',
add_id='".$_REQUEST['add_id']."',
subject='".escapeQuotes(stripslashes(trim($_REQUEST['subject'])))."',
comment='".escapeQuotes(stripslashes(trim($_REQUEST['comment'])))."',
rate='".$_REQUEST['rate']."'";
Insert_Qry(USER_FEEDBACK,$set);
$msg=successfulMessage("Your feedback has been posted.");
}
}
else
{
$msg=errorMessage("Invalid Code!");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=TITLE?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="<?=META_KEYWORDS?>"/>
<meta name="description" content="<?=META_CONTENT?>"/>
<link href="css/fresh-auction.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/tiny_mce/tiny_mce.js"></script>
<script language="javascript" src="ajax_imgcode.js"></script>
<script type="text/javascript">
function goChk()
{
if(document.frm.subject.value=="")
{
alert("Please enter subject");
document.frm.subject.focus();
return false;
}
/*else if(document.frm.comment.value=="")
{
alert("Please enter subject");
document.frm.comment.focus();
return false;
}*/
else if(document.frm.captcha_code.value=="")
{
alert("Please enter The Code shown above.");
document.frm.captcha_code.focus();
return false;
}
else
{
return true;
}
}
/*tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,|,insertdate,inserttime,|,forecolor,backcolor",
//theme_advanced_buttons2 : "bullist,numlist,|,insertdate,inserttime,|,forecolor,backcolor",
// theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
// theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
content_css : "css/style2.css",
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});*/
</script>
</head>
<body>
<? include_once("toppage1.php");?>
<div id="container" >
<? include_once("left-menu.php");?>
<div id="content" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/lbd_24.jpg" width="742" height="10" /></td>
</tr>
<tr>
<td>
<div class="header_top">
<? include_once("cart-info.php");?>
</div>
<div class="clear"></div>
<!--div class="menu_top">
<? include_once("top-menu.php")?>
</div-->
<p><span class="header_text_h">Post Feedback</span>
</p>
<p align="center">
<form name="frm" method="post" action="">
<table width="100%" border="0" cellspacing="3" cellpadding="4" align="center">
<tr>
<td align="left" valign="top" colspan="2">
<?
/*$where="user_id='".$feed_arr['user_id']."' AND posted_by='".$_SESSION['user_id']."' AND add_id='".$_REQUEST['add_id']."'";
$chk=Select_Qry("*",USER_FEEDBACK,$where,"","","","");
if($chk!='')
{
echo successfulMessage("You had already posted feedback against this Listing. Click to go <a href='Javascript:history.back();'>back</a>");
}
else{*/
if($msg!=''){
echo $msg;
}else{
?>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="border">
<tr>
<td colspan="2" align="left" valign="top"></td>
</tr>
<tr>
<td width="21%" align="left" valign="top" class="txtLabel">User</td>
<td width="79%" align="left" valign="top"><strong><?=USERNAME(base64_decode($_REQUEST['u']))?></strong></td>
</tr>
<tr>
<td width="21%" align="left" valign="top" class="txtLabel">Subject</td>
<td width="79%" align="left" valign="top"><input type="text" name="subject" value="" size="30" /></td>
</tr>
<tr>
<td align="left" valign="top" class="txtLabel">Comment</td>
<td align="left" valign="top"><textarea name="comment" cols="40" rows="10"></textarea></td>
</tr>
<tr>
<td width="21%" align="left" valign="top" class="txtLabel">Rate Your Feedback</td>
<td width="79%" align="left" valign="top"><input type="radio" name="rate" value="1" />
Positive (1)
<input type="radio" name="rate" value="0" checked="checked" />
Neutral (0)
<input type="radio" name="rate" value="2" />
Negetive (-1)</td>
</tr>
<tr>
<td align="left" valign="top" class="txtLabel">Image Verification</td>
<td align="left" valign="top" id="imgco"><img src="image_code.php?txt=<?=$checkCode?>" align="absmiddle" /><a href="javascript: void(0)" onClick="imgcode()"><img src="images/refresh.png" alt="Click To refresh the image" width="16" height="16" border="0" align="absmiddle" /></a>
<input type="text" name="captcha_code" size="10" class="inputTextBox" onFocus="showdiv('captcha')" /><input type="hidden" name="capture_value" value="<?=$checkCode?>"> <span id="capt"></span></td>
</tr>
<?php /*?><tr>
<td align="left" valign="top" class="txtLabel">Security Code</td>
<td align="left" valign="top"><input type="text" name="security_code" id="security_code" class="smalltextField" value="" /></td>
</tr><?php */?>
<tr>
<td align="left" valign="top" class="txtLabel"> </td>
<td align="left" valign="top"><input type="submit" name="btnSubmit" value="Post Feedback" onclick="return goChk()"/> <input type="button" name="cancel" value="Cancel" onclick="window.location.href='./<?=remspace($_REQUEST['add_id'])?>'" /></td>
</tr>
</table>
<? }?>
</td>
</tr>
<tr>
<td align="left" valign="top" colspan="2"> </td>
</tr>
</table>
</form>
</p>
<div class="sidebar_sep"></div>
</td>
</tr>
<tr>
<td><img src="images/lbd_24a.jpg" width="742" height="10" /></td>
</tr>
</table>
</div></div></div>
<? require_once("upper-footer.php"); ?>
<? require_once("footer.php");?>
</body>
</html>