-
Notifications
You must be signed in to change notification settings - Fork 0
/
details.php
600 lines (567 loc) · 22.9 KB
/
details.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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
<?php
require_once('config/config.php');
$add = $_GET['add_id'];
$result = mysql_query("SELECT * FROM tbl_add WHERE add_id = " . $add);
$main_record = mysql_fetch_array($result);
$record = $main_record;
if(isset($_REQUEST['btnUpload'])){
$set="user_id='".$_SESSION['user_id']."',
add_id='".$record['add_id']."',
file_describe='".escapeQuotes(stripslashes(trim($_REQUEST['file_describe'])))."'";
if($_FILES['attach_file']['name']!="")
{
$wdir="attachment/";
$file_type = $_FILES['attach_file']['type'];
$file_name = $_FILES['attach_file']['name'];
$file_size = $_FILES['attach_file']['size'];
$file_tmp = $_FILES['attach_file']['tmp_name'];
$ext=getext($_FILES['attach_file']['name']);
$imagname=rand()."_".date("m_d_Y").$ext;
$uploadfile =$wdir.$imagname;
image_resize($wdir."large_",600,$file_type,$file_name,$file_size,$file_tmp,$imagname);
image_resize($wdir."thumb_",150,$file_type,$file_name,$file_size,$file_tmp,$imagname);
//move_uploaded_file($_FILES['attach_file']['tmp_name'], $uploadfile);
$set.=",attach_file ='".$imagname."'";
}
Insert_Qry(ATTACHMENTS,$set);
}
if(isset($_REQUEST['btncomment']))
{
$set="sender_id='".$_SESSION['user_id']."',
receiver_id='".$record['user_id']."',
add_id='".$record['add_id']."',
msgtxt='".escapeQuotes(stripslashes($_REQUEST['msg']))."'";
Insert_Qry(QUESTION,$set);
################## MAIL TO SUBSCRIBED USERS ##################
$sql=mysql_query("SELECT * FROM ".USERNEWSLETTER." WHERE add_id= '".$record['add_id']."'");
if(mysql_num_rows($sql)>0){
while($objuser=mysql_fetch_array($sql)){
$mail_To = $objuser['email'];
$mail_From = ADMIN_EMAIL;
$mail_subject = "".$_SESSION['username']." has posted a new question for ".ADDTITLE($record['add_id'])." at ".WEB_ADDRESS;
$name = $_SESSION['username'];
$mail_Body='<html><head><title></title><style type="text/css">
.font{FONT-FAMILY:tahoma, helvetica, sans-serif;
FONT-SIZE:10pt;FONT-WEIGHT:normal;COLOR:black;}
</style></head><body>
<table border="0" cellpadding="0" cellspacing="0" width="80%" class="font">
<tr><td width="100%"> </td></tr>
<tr><td>Dear Subscriber,</td></tr>
<tr><td> </td></tr>
<tr><td>User '.$name.' has been posted a new question for '.ADDTITLE($record['add_id']).'</td></tr>
<tr><td align="left" valign="top"> </td></tr>
<tr><td width="100%" align="left" valign="top"><strong>Question</strong></td></tr>
<tr><td width="100%" align="left" valign="top">'.$_REQUEST['msg'].'</td></tr>
<tr><td> </td></tr>
<tr><td width="100%">Click here to see the listing details:
<a href="http://'.WEB_ADDRESS.'/'.remspace($record['add_id']).'">'.ADDTITLE($record['add_id']).'</a></td></tr>
<tr><td width="100%"> </td></tr>
<tr><td width="100%">Best Regards,</td></tr>
<tr><td width="100%"> </td></tr>
<tr><td width="100%">'.WEB_ADDRESS.'</td></tr>
</table></body></html>';
Send_HTML_Mail($mail_To, $mail_From, '', $mail_subject, $mail_Body);
}
}
##############################################################
$mail_To2= USEREMAIL($record['user_id']);
$mail_From2 = ADMIN_EMAIL;
$mail_subject2 = "".$_SESSION['username']." has posted a new question for ".ADDTITLE($record['add_id'])." at ".WEB_ADDRESS;
$name = $_SESSION['username'];
$mail_Body2='<html>
<head><title></title><style type="text/css">.font{
FONT-FAMILY:tahoma, helvetica, sans-serif;
FONT-SIZE:10pt;FONT-WEIGHT:normal;COLOR:black;}</style></head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="80%" class="font">
<tr><td width="100%"> </td></tr>
<tr><td width="100%">User '.$name.' has been posted a new question for '.ADDTITLE($record['add_id']).'</td></tr>
<tr><td width="100%" align="left" valign="top"><strong>Question</strong></td></tr>
<tr><td width="100%" align="left" valign="top">'.$_REQUEST['msg'].'</td></tr>
<tr><td width="100%">Click here to see the listing details:
<a href="http://'.WEB_ADDRESS.'/'.remspace($record['add_id']).'">'.ADDTITLE($record['add_id']).'</a></td></tr>
<tr><td width="100%"> </td></tr>
<tr><td width="100%">Best Regards,</td></tr>
<tr><td width="100%"> </td></tr>
<tr><td width="100%">'.WEB_ADDRESS.'</td></tr>
</table>
</body>
</html>';
Send_HTML_Mail($mail_To2, $mail_From2, '', $mail_subject2, $mail_Body2);
#$msg=successfulMessage("Comment Posted successfully");
}
if($_REQUEST['mode']=='del')
{
Delete_Qry(QUESTION,"WHERE id='".$_REQUEST['id']."'"); /// delete msg
}
#######################SUBSCRIBE#######################
if(isset($_REQUEST['btnSubscribe']))
{
$letterchk=Select_Qry("*",USERNEWSLETTER,"add_id='".$record['add_id']."' AND email='".USEREMAIL($_SESSION['user_id'])."'","","","","");
if($letterchk=="")
{
$setN="add_id='".$record['add_id']."',
email='".USEREMAIL($_SESSION['user_id'])."'";
Insert_Qry(USERNEWSLETTER,$setN);
}
else
{
Delete_Qry(USERNEWSLETTER,"WHERE id='".$letterchk['id']."'");
}
}
########################## SHORTLIST #################
if(isset($_REQUEST['btnShortlist']))
{
$Shortchk=Select_Qry("*",SHORTLIST,"add_id='".$record['add_id']."' AND user_id='".$_SESSION['user_id']."'","","","","");
if($Shortchk=="")
{
$setSho="add_id='".$record['add_id']."',
user_id='".$_SESSION['user_id']."'";
Insert_Qry(SHORTLIST,$setSho);
$msg="You have successfully added this listing to your shortlist";
}
else
{
Delete_Qry(SHORTLIST,"WHERE id='".$Shortchk['id']."'");
$msg=$_REQUEST['tit']. "has been removed from your shortlist";
}
}
$Shortchk2=Select_Qry("*",SHORTLIST,"add_id='".$record['add_id']."' AND user_id='".$_SESSION['user_id']."'","","","","");
###########################END########################
?>
<!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" />
<link rel="stylesheet" href="lightbox/css/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="lightbox/js/prototype.js"></script>
<script type="text/javascript" src="lightbox/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="lightbox/js/lightbox.js"></script>
<script type="text/javascript">
function chk()
{
if(document.frm.msg.value=="")
{
alert("Please Enter Your Question.");
document.frm.msg.focus();
return false;
}
return true;
}
function doAttach()
{
if(document.frm.attach_file.value=="")
{
alert("Please upload Attachment File.");
document.frm.attach_file.focus();
return false;
}
return true;
}
</script>
</head>
<body>
<? include_once("toppage1.php");?>
<div id="container" >
<!--LEFT PANEL-->
<div id="sidebar">
<div style="vertical-align:top">
<table width="216" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/lbd_22.jpg" width="216" height="13" alt="" /></td>
</tr>
<tr>
<td class="left_menu_bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<? if($_SESSION['user_id']==$record['user_id']){?>
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="3" style="background-color:#FBFEE7">
<tr>
<td><a href="listing-upgrades.php?add_id=<?=$record['add_id']?>" class="user">Upgrade This Listing</a></td>
</tr>
<tr>
<td><a href="editlisting.php?add_id=<?=$record['add_id']?>" class="user">Edit Listing Details</a></td>
</tr>
<? if($record['status']==0){?>
<tr>
<td><a href="relist.php?add_id=<?=$record['add_id']?>" class="user">Relist This Listing</a></td>
</tr>
<? }?>
</table></td></tr>
<tr><td style="height:5px;"></td></tr>
<? }?>
<tr><td>
<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td><h2> Owner Profile </h2></td>
</tr>
<tr>
<td align="left" valign="middle"><img src="avatar/<?=AVATAR($record['user_id'])!=""?'thumb_'.AVATAR($record['user_id']):"noimage.jpeg"?>" border="0" align="absmiddle" class="img_border"></td>
</tr>
<tr>
<td align="center"><p><a href="<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:'user-profile.php?add_id='.$record['add_id']?>&user_id=<?=$record['user_id']?>" class="user">
<?=USERNAME($record['user_id'])?>
</a></p>
<p><a href="<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:'user-profile.php?add_id='.$record['add_id']?>&user_id=<?=$record['user_id']?>" class="user">Feedback Score (
<?=feedback($record['user_id'])?>%)</a>
<? if($_SESSION['user_id']!=$record['user_id']){?>
<a href="<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:'compose-message.php?add_id='.$record['add_id']?>" class="user">Send a Message</a>
<? }?>
</p></td>
</tr>
<?php /*?><? if($_SESSION['user_id']!=$record['user_id']){?>
<tr>
<td><a href="post-feedback.php?add_id=<?=$record['add_id']?>" class="user">Post Feedback</a></td>
</tr>
<? }?><?php */?>
<? if($_SESSION['user_id']!=$record['user_id']){?>
<tr>
<td><a href="report.php?add_id=<?=$record['add_id']?>" class="user">Report a Violation</a></td>
</tr>
<? }?>
</table>
</td></tr></table>
</td>
</tr>
<tr>
<td><img src="images/lbd_30.jpg" width="216" height="13" alt="" /></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</div>
</div>
<!--LEFT PANEL-->
<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="menu_top">
<? include_once("top-menu.php")?>
</div-->
<form name="frm" method="post" action="<?=$_SERVER['PHP_SELF']?>?<?=$_SERVER['QUERY_STRING']?>" enctype="multipart/form-data">
<div style="vertical-align:top;">
<table width="710" border="0" align="center" cellpadding="0" cellspacing="0">
<? if(isset($_SESSION['user_id'])){?>
<tr><td colspan="3" align="left" width="100%" valign="top" class="border">
<table width="710" border="0" cellspacing="0" cellpadding="4" >
<tr>
<td width="45%" valign="top"><a href="index.php">Auction</a> >><?=$record['title']?></td>
<td align="left" valign="top" style="border-left:1px solid #EBEBEB;background-color:#F8F8F8;">
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="13%" align="left" valign="top"><img src="avatar/<?=AVATAR($_SESSION['user_id'])!=""?'thumb_'.AVATAR($_SESSION['user_id']):"noimage.jpeg"?>" border="0" align="absmiddle" class="img_border"></td>
<td width="87%" align="left" valign="middle"><?=USERNAME($_SESSION['user_id'])?>(<a href="my-message.php?mode=inbox" class="user_menu">Messages</a>)<br />
You have <?=CREDIT($_SESSION['user_id'])?> credits.</td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
<tr><td colspan="3" align="right" width="100%" valign="top" style="height:5px;"></td></tr>
<tr><td colspan="3" align="right" width="100%" valign="top" class="border" >
<table width="710" border="0" cellspacing="0" cellpadding="4" >
<tr>
<td style="border-right:1px solid #EBEBEB;"><a href="short-list.php" class="user_menu">My Shortlist</a></td>
<td style="border-right:1px solid #EBEBEB;"><a href="subscription-list.php?add_id=<?=$record['add_id']?>" class="user_menu">My Subscriptions</a></td>
<td style="border-right:1px solid #EBEBEB;"><a href="mylistings.php" class="user_menu">My Activity</a></td>
<td style="border-right:1px solid #EBEBEB;"><a href="my-account.php" class="user_menu">My Account</a></td>
<td style="border-right:1px solid #EBEBEB;"><a href="my-message.php?mode=inbox" class="user_menu">My Messages</a></td>
<td><a href="logout.php" class="user_menu">Logout</a></td>
</tr>
</table>
</td></tr>
<tr><td colspan="3" align="right" width="100%" valign="top" style="height:5px;"></td></tr>
<? }?>
<tr>
<td width="78%" align="left" valign="top"class="border" >
<table width="100%" border="0" cellspacing="0" cellpadding="8" style="background-color:#eef8fb;">
<tr>
<td colspan="2" align="left" valign="top" style="border-bottom:1px solid #EBEBEB;"><span class="title"><?=$record['title']?></span><br /><span class="txtLabel"><?=$record['subtitle']?></span></td>
</tr>
<? if((CATEGORY_ADD($record['cat_id'])!='1') && ($record['site_img']!='')){?>
<tr>
<td align="left"><img src="websiteImage/thumb<?=$record['site_img']?>" border="0" class="img_border" /></td>
<td align="left"><table width="150" border="0" cellspacing="0" cellpadding="0" align="right">
<?
$bidcou=Select_Qry("COUNT(id) as addID",PROPOSAL,"add_id='".$record['add_id']."'","","","","");
$pending=Select_Qry("COUNT(id) as PEND",PROPOSAL,"add_id='".$record['add_id']."' AND accept='0'","","","","");
$reject=Select_Qry("COUNT(id) as REJ",PROPOSAL,"add_id='".$record['add_id']."' AND accept='1'","","","","");
?>
<?
if($record['winner_id']=="0") {
?>
<?
}else{
?>
<tr>
<td align="center" class="redbold">Sold</td>
</tr>
<? }?>
</table></td>
</tr>
<? }?>
<tr>
<td colspan="2" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="26%" align="left" valign="top"><span class="greenfont"><strong>Bid Price:</strong></span> $<strong>
<?=$record['price']?>
</strong></td>
<td width="74%" align="left" valign="top"><?
if($record['status']!=2 && ($_SESSION['user_id']!=$record['user_id']))
{
?>
<input type="button" name="btnPlace2" value="Place a Bid" onclick="window.location.href='<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:'post-offer.php?add_id='.$record['add_id']?>'" />
<?
}
?></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="left"><table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="26%" align="left" valign="top"><span class="greenfont"><strong>BIN Price:</strong></span> <span class="error">$<strong>
<?=$record['buyer_price']?>
</strong></span></td>
<td width="74%" align="left" valign="top"><?
if($record['status']!=2 && ($_SESSION['user_id']!=$record['user_id']))
{
?>
<input type="button" name="btnBuy2" value="Buy It Now" onclick="window.location.href='<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:'buy.php?add_id='.$record['add_id']?>'" />
<?
}
?></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Company Name:</strong></span> <?=$record['company_name']?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Website:</strong></span> <a href= "<?php echo $record['website'] ;?>" ><?=$record['website']?></a></td>
</tr>
<?
if($record['aboutus']==1){
?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>About Us:</strong></span> <a href="<?=$record['aboutus']?>"><?=$record['aboutus']?></a></td>
</tr>
<? }
if($record['product_page']==1){
?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Products Page:</strong></span> <a href="<?=$record['product_page']?>"><?=$record['product_page']?></a></td>
</tr>
<? }
if($record['faq']==1){
?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Faq:</strong></span> <a href="<?=$record['faq']?>"><?=$record['faq']?></a></td>
</tr>
<? }
if($record['contact_us']==1){
?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Contact Us:</strong></span> <a href="<?=$record['contact_us']?>"><?=$record['contact_us']?></a></td>
</tr>
<? }if($record['contact_email']==1){?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Contact Email:</strong></span> <?=$record['contact_email']?></td>
</tr>
<? }?>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Listed:</strong></span> <?=dateprint($record['posted_on'])?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Visitors:</strong></span> <?=$record['visitor']?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Page Views:</strong></span> <? echo $record['traffic_pages']." Daily"; ?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Income:</strong></span> <? echo $record['income_month']." US$ Per Month"; ?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Cost to run site:</strong></span> <? echo $record['run_cost']." US$ Per Month" ?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Disk Space used:</strong></span> <? echo $record['disk_space']." MB";?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Bandwidth used:</strong></span> <? echo $record['bandwidth']." MB per month"; ?></td>
</tr>
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>Members:</strong></span> <?=$record['site_members']?></td>
</tr>
<? /*
<tr>
<td colspan="2" align="left"><span class="greenfont"><strong>:</strong></span> <?=$record['']?></td>
</tr>
*/ ?>
<?
if(CATEGORY_ADD($record['cat_id'])!='1'){
?>
<? }?>
<?
if(CATEGORY_ADD($record['cat_id'])!='1'){
?>
<? }?>
<tr>
<td colspan="2" class="des">Listing Description</td>
</tr>
<tr>
<td colspan="2" align="justify" valign="top">
<?=$record['description']?>
</td>
</tr>
<?
if(isset($_SESSION['user_id'])){
?>
<tr>
<td colspan="2"><input type="submit" name="btnSubscribe" value="<?=$letterchk==""?"Subscribe":"Unsubscribe"?> For Email Updates" /> <input type="submit" name="btnShortlist" value="<?=$Shortchk2==""?"Add To":"Remove From"?> My Shortlist" /></td>
</tr>
<? }?>
</table>
</td>
<td width="1%"> </td>
<td width="21%" align="left" valign="top"class="border">
<table width="100%" border="0" cellspacing="0" cellpadding="3" >
<tr>
<td class="rowhead">Attachments</td>
</tr>
<?
$attachRecord=Listing_Qry("*",ATTACHMENTS,"WHERE add_id='".$record['add_id']."' AND status='1' order by id DESC","");
if($attachRecord!=''){
foreach($attachRecord as $attch){
?>
<tr style="padding-bottom:4px;">
<td align="left"><a href="attachment/large_<?=$attch["attach_file"]?>" rel="lightbox[roadtrip]"><img src="attachment/thumb_<?=$attch['attach_file']?>" border="0" class="img_border" /></a></td>
</tr>
<? }
}else{
?>
<tr>
<td class="text-small">No Attachments</td>
</tr>
<? }?>
<?
if($_SESSION['user_id']==$record['user_id']){
?>
<tr>
<td>Add an attachment </td>
</tr>
<tr>
<td class="text-small">Choose a file:<br />
<input type="file" name="attach_file" class="smalltextField" size="10" /></td>
</tr>
<tr>
<td class="text-small">Describe your file <br /><input type="text" name="file_describe" value="" class="smalltextField" /></td>
</tr>
<tr>
<td><input type="submit" name="btnUpload" value="Upload" onclick="return doAttach()" /></td>
</tr>
<? }?>
</table>
</td>
</tr>
</table>
</div>
<div style="vertical-align:top; padding-top:5px;">
<table width="710" border="0" cellspacing="0" cellpadding="0" class="border">
<tr>
<td colspan="2" class="rowhead" style="height:30px; padding-left:5px;">Public Questions</td>
</tr>
<tr>
<td align="center" valign="middle"> </td>
<td align="left" style="height:15px;"> </td>
</tr>
<?
$QuesList =Listing_Qry("*",QUESTION,"WHERE add_id='".$record['add_id']."' ORDER BY id DESC",'');
if($QuesList){
foreach($QuesList as $Ques)
{
?>
<tr>
<td width="8%" align="center" valign="top" style="padding-left:2px;"><img src="avatar/<?=AVATAR($Ques['sender_id'])!=""?'thumb_'.AVATAR($Ques['sender_id']):"noimage.jpeg"?>" border="0" align="absmiddle" class="img_border"><br /><? if($Ques['sender_id']!=$_SESSION['user_id']){?>
<a href="user-profile.php?add_id=<?=$Ques['add_id']?>&user_id=<?=$Ques['sender_id']?>">
<?=USERNAME($Ques['sender_id'])?>
</a>
<? }else{ echo USERNAME($Ques['sender_id']); }?><?php /*?><a href="user.php?uid=<?=$Ques['sender_id']?>"><?=USERNAME($Ques['sender_id'])? ></a><?php */?></td>
<td width="92%" align="left" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="76%" align="left" valign="top" class="small_text"><?=$Ques['msgtxt']?></td>
<td width="24%" align="right" valign="top"><span class="text-bold">Posted On:</span> <span class="small_text"><?=dateprint($Ques['posted_on'])?></span> <? if($_SESSION['user_id'] == $Ques['sender_id']){?>| <a href="<?=$_SERVER['PHP_SELF']?>?<?=$_SERVER['QUERY_STRING']?>&mode=del&id=<?=$Ques['id']?>" onClick="return confirm('Are you sure want to delete this message?')">Delete</a><? }?></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="left" style="border-top:1px dashed #CCCCCC;"> </td>
</tr>
<? } }else{?>
<tr>
<td colspan="2" align="left" style="padding-left:5px;" class="txtLabel">No questions posted.</td>
</tr>
<? }?>
<tr>
<td align="center" valign="middle"> </td>
<td align="left" style="height:15px;"> </td>
</tr>
</table>
</div>
<?
#if($_SESSION['user_id']!=$record['user_id']){
?>
<div style="vertical-align:top; padding-top:5px; ">
<table width="710" border="0" cellspacing="0" cellpadding="0" class="border">
<tr>
<td colspan="2" class="rowhead" style="height:30px; padding-left:5px;">Questions/Comments</td>
</tr>
<tr>
<td align="center" valign="middle"> </td>
<td align="left" style="height:15px;"> </td>
</tr>
<?
if($_SESSION['user_id']==''){?>
<tr>
<td colspan="2" align="left" valign="middle" class="txtLabel">To post a comment on this listing, <a href="<?=$_SESSION['user_id']==''?'login.php?add_id='.$record['add_id']:''?>" class="user">login</a></td>
</tr>
<? }else{?>
<tr>
<td colspan="2" align="left" valign="middle" style="height:20px;padding-left:5px;" class="txtfont">Logged in as <?=UserName($_SESSION['user_id'])?> (<a href="logout.php">logout</a>) </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top" style="padding-left:5px;"><textarea name="msg" cols="84" rows="10" id="msg"></textarea></td>
</tr>
<tr>
<td align="left" style="height:10px;" colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top" style="padding-left:5px;"><input type="submit" class="button" name="btncomment" value="Post Question" onClick="return chk()"></td>
</tr>
<? }?>
</table>
</div>
<? # }?>
</form>
<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>