-
Notifications
You must be signed in to change notification settings - Fork 1
/
user-items.php
813 lines (723 loc) · 42.4 KB
/
user-items.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
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
<?php
/*
* Osclass – software for creating and publishing online classified
* advertising platforms
*
* Copyright (C) 2013 OSCLASS
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// meta tag robots
osc_add_hook('header','bender_nofollow_construct');
bender_add_body_class('user user-items');
osc_add_hook('before-main','sidebar');
function sidebar(){
osc_current_web_theme_path('user-sidebar.php');
}
osc_current_web_theme_path('header.php') ;
osc_add_filter('meta_title_filter','custom_meta_title');
function custom_meta_title($data){
return __('Alerts', 'isha');;
}
$osc_user = osc_user();
if(osc_is_web_user_logged_in() ) {
$pm_id = Params::getParam('message');
switch(Params::getParam('box')) {
case 'inbox':
$pm = ModelPM::newInstance()->getRecipientMessage(osc_logged_user_id(), 1, 0, $pm_id );
//echo "danish"; print_r($pm); die;
if($pm['recipNew'] == 1) {
ModelPM::newInstance()->updateMessageAsRead($pm['pm_id']);
}
break;
case 'outbox':
$pm = ModelPM::newInstance()->getSenderMessage(osc_logged_user_id(), 1, $pm_id );
break;
}
$words[] = array('[quote]','[/quote]', '[quoteAuthor]','[/quoteAuthor]');
$words[] = array('<div class="messQuote">','</div>', '<div class="quoteAuthor">','</div>');
/* $message = osc_mailBeauty($pm['pm_message'], $words) ;*/
/*if($pm['sender_id'] != 0){
$user = User::newInstance()->findByPrimaryKey($pm['sender_id']);
} else { */$user['s_name'] = pmAdmin(); /*} */
}
$i_userId = osc_logged_user_id();
?>
<script>
(function($){
})(jQuery)
</script>
<?php osc_run_hook('search_ads_listing_top'); ?>
<section class="wrapper result_outer account_outer">
<section class="account_box">
<h1 class="result"><?php _e('My Account', 'isha') ; ?></h1>
<ul class="resuult_ul">
<li>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/listing_icon.png')?>">
<h2><?php _e('Listings', 'isha') ; ?><span><?php _e('Your Selected Listings', 'isha') ; ?></span></h2>
<div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist" style="display: none;">
<h1><?php _e('My Listings', 'isha') ; ?></h1>
<?php if(osc_count_items() == 0) { ?>
<p><?php _e('No listings have been added yet', 'isha') ; ?></p>
<?php } else {
$inc=1;
while(osc_has_items()) {
$search_number = bender_search_number();
// print_r($search_number);
echo '<br>';
printf(__('%1$d из <span> %2$d </span>', 'isha'), $inc, $search_number['of']);
// echo '';
$inc++;
?>
<article class="list_result">
<figure class="list_figure">
<?php if( osc_images_enabled_at_items() ) { ?>
<?php if(osc_count_item_resources()) { ?>
<a class="fir_title_img" href="<?php echo osc_item_url() ; ?>" title="<?php echo osc_item_title() ; ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="" alt="<?php echo osc_item_title() ; ?>" width="50" height="50"></a>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="<?php echo osc_item_title() ; ?>" width="50" height="50">
<?php } ?>
<?php } ?>
</figure>
<div class="list_textbox list_text11">
<div class="obiava_text">
<h1><?php echo osc_item_title() ; ?>(<?php echo osc_item_category() ; ?>)</h1>
<h3><?php echo osc_item_city(); //osc_item()['s_city'];?> - (<?php echo osc_item_region(); ?>) - <?php echo osc_format_date(osc_item_pub_date()); ?>.</h3>
</div>
<div class="obiave_buttons">
<a class="com_but" href="<?php echo osc_item_edit_url(); ?>" rel="nofollow"><?php _e('Edit item', 'isha'); ?></a>
<a class="delete com_but" onclick="javascript:return confirm('<?php echo osc_esc_js(__('This action can not be undone. Are you sure you want to continue?', 'isha')); ?>')" href="<?php echo osc_item_delete_url();?>" ><?php _e('Delete', 'isha'); ?></a>
<?php if(osc_item_is_active()) {?>
<a class="com_but" href="<?php echo osc_item_deactivate_url();?>" ><?php _e('Deactivate', 'isha'); ?></a>
<?php
}
elseif (!osc_item_is_active())
{
?>
<a class="com_but" href="<?php echo osc_item_activate_url();?>" ><?php _e('Activate', 'isha'); ?></a>
<?php
}
?>
</div>
<div class="for_price"><a class="rate" href="#"><?php if (osc_price_enabled_at_items()) { echo osc_item_formated_price(); ?><?php }?></a></div>
</div>
<div class="account_list_text">
<p><?php echo osc_highlight( strip_tags( osc_item_description()) ,250) ; ?></p>
</div>
<div class="clear"></div>
<div class="clear"></div>
</article>
<?php }
}?>
</div>
</li>
<li>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/alert.png')?>">
<h2><?php _e('Alert', 'isha') ; ?><span><?php _e('Your Important Alerts', 'isha') ; ?></span></h2>
<div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist" style="display: none;">
<h1><?php _e('Alerts', 'isha') ; ?></h1>
<?php if(osc_count_alerts() <= 0) { ?>
<p><?php _e('You do not have any alerts yet.', 'isha') ; ?></p>
<?php } else { ?>
<?php
$i = 1;
while(osc_has_alerts()) { ?>
<div class="userItem" >
<div class="title-has-actions">
<h3><?php _e('Alert', 'isha'); ?> <?php echo $i; ?></h3> <a onclick="javascript:return confirm('<?php echo osc_esc_js(__('This action can\'t be undone. Are you sure you want to continue?', 'benderw')); ?>');" href="<?php echo osc_user_unsubscribe_alert_url(); ?>"><?php _e('Delete this alert', 'isha'); ?></a><div class="clear"></div></div>
<div>
<?php while(osc_has_items()) {
bender_draw_item();
} ?>
<?php if(osc_count_items() == 0) { ?>
<br />
0 <?php _e('Listings', 'isha'); ?>
<?php } ?>
</div>
</div>
<br />
<?php
$i++;
}
?>
<?php }?>
</div>
</li>
<li>
<?php
$recipPMs = ModelPM::newInstance()->getRecipientMessages(osc_logged_user_id(), 1, 0, 'pm_id', 'DESC');
$recipCount = count($recipPMs);
$odd = 1;
$newPMs = ModelPM::newInstance()->getRecipientMessages(osc_logged_user_id(), 1, 1, 'pm_id', 'DESC');
$countPMs = count($newPMs);
//echo '$recipCount: '.$recipCount;
?>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/inbox.png')?>">
<h2><?php _e('Inbox', 'isha'); ?> (<?php echo ' всего: '.$recipCount.' не прочитанных: '.$countPMs; ?>)<span><?php _e('Your Incoming Messages', 'isha'); ?></span></h2>
<div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist inbox" style="display: none;overflow:auto">
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<th><input id="all_inbox" type="checkbox"></th>
<th><?php _e('Date', 'isha'); ?></th>
<th><?php _e('Subject', 'isha'); ?></th>
<th><?php _e('From', 'isha'); ?></th>
<th><?php _e('Action', 'isha'); ?></th>
</tr>
<?php if($recipCount == 0) { ?>
<tr class="odd">
<td></td>
<td></td>
<td><?php _e('You have no messages', 'osclass_pm'); ?></td>
<td></td>
</tr>
<?php }else{
foreach($recipPMs as $recipPM){
if($odd==1) {
$odd_even = "odd";
$odd = 0;
} else {
$odd_even = "even";
$odd = 1;
}
if($recipPM['recipNew'] == 1) {
$styleNew = 'font-weight: bold;';
} else {
$styleNew = '';
}
?>
<tr class="<?php echo $odd_even;?>">
<!--<td><input type="checkbox"></td> -->
<td class="pmCheckboxes"><input class="delChecks1" type="checkbox" id="delete<?php echo $recipPM['pm_id']; ?>" name="pms[]" value="<?php echo $recipPM['pm_id']; ?>" /></td>
<td style="<?php echo $styleNew; ?>"><?php echo osc_format_date($recipPM['message_date']) . ', ' . osclass_pm_format_time($recipPM['message_date']); ?></td>
<td style="<?php echo $styleNew; ?>"><!--<a class="mesLink" href="<?php echo osc_render_file_url('osclass_pm/' . 'user-messages.php?message=' . $recipPM['pm_id'] . '&box=inbox'); ?>">--><?php echo $recipPM['pm_subject']; ?><!--</a>--></td>
<td style="<?php echo $styleNew; ?>">
<?php
$user = $user = User::newInstance()->findByPrimaryKey($recipPM['sender_id']);;
echo ($user['s_name']=='') ? 'Admin' : "<a href='" . osc_user_public_profile_url($recipPM['sender_id']) . "'>". $user['s_name'] . "</a>";
?>
</td>
<td>
<li class="read">
<a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-messages.php&box=inbox&message=' . $recipPM['pm_id'] ; ?>&p1=1" class="fancybox fancybox.iframe" >Читать</a>
</li>
<li class="reply">
<a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=reply&messId=' . $recipPM['pm_id'] . '&userId=' . $recipPM['sender_id'] ; ?>&p1=1" class="fancybox fancybox.iframe" ><?php _e('Reply','osclass_pm'); ?></a></li>
<li class="quote"><a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=quote&messId=' . $recipPM['pm_id'] . '&userId=' . $recipPM['sender_id']; ?>&p1=1" class="fancybox fancybox.iframe"><?php _e('Quote','osclass_pm'); ?></a></li>
<li class="del">
<a onclick="if (!confirm('Вы уверены, что хотите удалить это личное сообщение?')) return false;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&pms=' . $recipPM['pm_id'].'&option=delMessages&box=inbox' ; ?>&p1=1" class="fancybox fancybox.iframe">
Удалить</a></li>
</td>
</tr>
<?php }
} ?>
</tbody></table>
<!--<input type="button" onclick="if (!confirm('<?php _e('Are you sure you want to delete all selected personal messages?','osclass_pm'); ?>')) return false;" class="delete apply pmDeleteButton" value="Delete Selected">
-->
<!--
<input id="btn1" type="button" onclick="if (!confirm('<?php _e('Are you sure you want to delete all selected personal messages?','osclass_pm'); ?>')) return false;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=inbox&p1=1' ; ?>" class="fancybox fancybox.iframe delete apply" value="Delete Selected">
-->
<a id="btn1" onclick="if (!confirm('<?php _e('Are you sure you want to delete all selected personal messages?','osclass_pm'); ?>')) return true;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=inbox&p1=1' ; ?>" class="fancybox fancybox.iframe" >Delete Selected</a>
<div class="admin subscribe send_but"> <a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&userId=0&mType=new';?>&p1=1" class="fancybox fancybox.iframe"><?php echo __('Send PM to the ','osclass_pm') . ' ' . pmAdmin(); ?></a></div>
</div>
</li>
<li>
<?php $recipPMs = ModelPM::newInstance()->getSenderMessages(osc_logged_user_id(), 1, 'pm_id', 'DESC');
$recipCount = count($recipPMs); ?>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/outbox.png')?>"><h2>
<?php _e('Outbox', 'osclass_pm'); ?> (<?php echo ' всего: '.$recipCount; ?>)<span><?php _e('Your Outgoing Messages', 'isha'); ?></span></h2> <div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist inbox" style="display: none;overflow:auto">
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<th><input id="all_outbox" type="checkbox"></th>
<th><?php _e('Date', 'osclass_pm'); ?></th>
<th><?php _e('Subject', 'osclass_pm'); ?></th>
<th><?php _e('Sent To', 'osclass_pm'); ?></th>
<th><?php _e('Action', 'osclass_pm'); ?></th>
</tr>
<?php
if($recipCount == 0) {?>
<tr class="odd">
<td></td>
<td></td>
<td><?php _e('You have no messages', 'osclass_pm'); ?></td>
<td></td>
</tr>
<?php }else{
foreach($recipPMs as $recipPM){
?>
<tr>
<!--<td><input type="checkbox"></td> -->
<td class="pmCheckboxes"><input class="delChecks2" type="checkbox" id="delete<?php echo $recipPM['pm_id']; ?>" name="pms[]" value="<?php echo $recipPM['pm_id']; ?>" /></td>
<td><?php echo osc_format_date($recipPM['message_date']) . ', ' . osclass_pm_format_time($recipPM['message_date']); ?></td>
<td><!--<a class="mesLink" href="<?php echo osc_render_file_url('osclass_pm/' . 'user-messages.php?message=' . $recipPM['pm_id'] . '&box=outbox'); ?>">--><?php echo $recipPM['pm_subject'];
//http://test.playandbay.com/index.php?page=custom&file=osclass_pm/user-proc.php&pms=79&option=delMessages&box=inbox&p1=1
?><!--</a>--></td>
<td>
<?php
$user = User::newInstance()->findByPrimaryKey($recipPM['recip_id']);
echo ($user['s_name']=='') ? 'Admin' : "<a href='" . osc_user_public_profile_url($recipPM['recip_id']) . "'>". $user['s_name'] . "</a>";?>
</td>
<td>
<li class="read">
<a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-messages.php&box=outbox&message=' . $recipPM['pm_id'] ; ?>&p1=1" class="fancybox fancybox.iframe" >Читать</a>
</li>
<li class="del">
<a onclick="if (!confirm('Вы уверены, что хотите удалить это личное сообщение?')) return false;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&pms=' . $recipPM['pm_id'].'&option=delMessages&box=outbox' ; ?>&p1=1" class="fancybox fancybox.iframe">
Удалить</a></li>
<!--
<li class="reply">
<a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=reply&messId=' . $recipPM['pm_id'] . '&userId=' . $recipPM['sender_id'] ; ?>&p1=1" class="fancybox fancybox.iframe" ><?php _e('Reply','osclass_pm'); ?></a>
</li>
<li class="quote">
<a href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-send.php&mType=quote&messId=' . $recipPM['pm_id'] . '&userId=' . $recipPM['sender_id']; ?>&p1=1" class="fancybox fancybox.iframe" ><?php _e('Quote','osclass_pm'); ?></a>
</li>-->
</td>
</tr>
<?php
}
} ?>
</tbody></table>
<a id="btn2" onclick="if (!confirm('<?php _e('Are you sure you want to delete all selected personal messages?','osclass_pm'); ?>')) return true;" href="<?php echo osc_base_url(true) . '?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=outbox&p1=1' ; ?>" class="fancybox fancybox.iframe" >Delete Selected</a>
</div>
</li>
<li>
<?php
if(Params::getParam('delete') != '' && osc_is_web_user_logged_in()){
delete_item(Params::getParam('delete'), $i_userId);
}
$itemsPerPage = (Params::getParam('itemsPerPage') != '') ? Params::getParam('itemsPerPage') : 5;
$iPage = (Params::getParam('iPage') != '') ? Params::getParam('iPage') : 0;
Search::newInstance()->addConditions(sprintf("%st_item_watchlist.fk_i_user_id = %d", DB_TABLE_PREFIX, $i_userId));
Search::newInstance()->addConditions(sprintf("%st_item_watchlist.fk_i_item_id = %st_item.pk_i_id", DB_TABLE_PREFIX, DB_TABLE_PREFIX));
Search::newInstance()->addTable(sprintf("%st_item_watchlist", DB_TABLE_PREFIX));
Search::newInstance()->page($iPage, $itemsPerPage);
$aItems = Search::newInstance()->doSearch();
$iTotalItems = Search::newInstance()->count();
$iNumPages = ceil($iTotalItems / $itemsPerPage) ;
View::newInstance()->_exportVariableToView('items', $aItems);
View::newInstance()->_exportVariableToView('search_total_pages', $iNumPages);
View::newInstance()->_exportVariableToView('search_page', $iPage) ;
// delete item from watchlist
function delete_item($item, $uid){
$conn = getConnection();
$conn->osc_dbExec("DELETE FROM %st_item_watchlist WHERE fk_i_item_id = %d AND fk_i_user_id = %d LIMIT 1", DB_TABLE_PREFIX , $item, $uid);
}
?>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/wishlist.png')?>">
<h2><?php _e('Watchlist', 'isha') ; ?><span><?php _e('Your Selected Watchlist', 'isha') ; ?></span></h2>
<div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist" style="display: none;">
<?php if (osc_count_items() == 0) { ?>
<h3><?php _e('You don\'t have any items yet', 'watchlist'); ?></h3>
<?php } else { ?>
<h3><?php printf(_n('You are watching <span class="list-count">%d</span> item', 'You are watching <span class="list-count">%d</span> items', $iTotalItems, 'watchlist'), $iTotalItems) ; ?></h3>
<?php while ( osc_has_items() ) { ?>
<article class="list_result" id="list-item-<?php echo osc_item_id() ?>">
<figure>
<?php if (osc_images_enabled_at_items()) { ?>
<?php if (osc_count_item_resources()) { ?>
<a href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" width="75px" height="56px" title="" alt="" /></a>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif'); ?>" title="" alt="" />
<?php } ?>
<?php }?>
</figure>
<div class="list_textbox list_t12">
<a class="rate" href="#"><?php if (osc_price_enabled_at_items()) { echo osc_item_formated_price(); ?> - <?php }?></a>
<!-- <a class="other" href="#">Other currencies
<ul>
<li>378 EUR</li>
<li>320 GBP</li>
<li>4231 UAH</li>
<li>516 USD</li>
</ul>
</a>-->
<h1> <a href="<?php echo osc_item_url(); ?>"><?php echo osc_item_title(); ?></a></h1>
<h3><?php echo osc_item_city();?> - (<?php echo osc_item_region(); ?>) - <?php echo osc_format_date(osc_item_pub_date()); ?>.</h3>
<p><?php echo osc_highlight(strip_tags(osc_item_description())); ?></p>
<p><a rel="list-item-<?php echo osc_item_id() ?>" href="<?php echo osc_base_url(true) . "?page=custom&file=watchlist/watchlist.php&delete=" . osc_item_id(); ?>" class="remove-watchlist"><?php _e('Delete', 'bender'); ?></a></p>
</div>
<div class="clear"></div>
</article>
<?php }
}?>
<script type="text/javascript">
$('.remove-watchlist').click(function()
{
$.ajax(
{
data : "",
type :'POST',
cache : false,
url : $(this).prop('href'),
success : function(response) {
}
});
$('#'+$(this).prop('rel')).remove();
$('.list-count').text($('.list_result').length);
return false;
});
</script>
</div>
</li>
<li>
<a href="javascript:void(0)"><img class="icon" alt="" src="<?php echo osc_current_web_theme_url('images/account.png')?>">
<h2><?php _e('Settings', 'isha') ; ?><span><?php _e('View Full Account', 'isha') ; ?></span></h2>
<div class="plus_min">
<img class="minus opaci" alt="" src="<?php echo osc_current_web_theme_url('images/minus_dropdown.png')?>">
<img class="pluss" alt="" src="<?php echo osc_current_web_theme_url('images/plus_dropdown.png')?>">
</div></a>
<div class="wishlist account" style="display: none;">
<h1><?php _e('Update account', 'isha') ; ?></h1>
<?php
$osc_user = osc_user();
?>
<form action="<?php echo osc_base_url(true); ?>" method="post">
<input type="hidden" name="page" value="user" />
<input type="hidden" name="action" value="profile_post" />
<ul>
<li><label><?php _e('Name', 'isha') ; ?></label><?php UserForm::name_text(osc_user()); ?></li>
<li><label><?php _e('User Type', 'isha') ; ?></label> <?php UserForm::is_company_select(osc_user()); ?></li>
<li><label><?php _e('Cell Phone', 'isha') ; ?></label><?php UserForm::mobile_text(osc_user()); ?></li>
<li><label><?php _e('Phone', 'isha') ; ?></label><?php UserForm::phone_land_text(osc_user()); ?></li>
<li><label><?php _e('Country', 'isha') ; ?></label><?php UserForm::country_select(osc_get_countries(), osc_user()); ?></li>
<li><label><?php _e('Region', 'isha') ; ?></label> <?php UserForm::region_select(osc_get_regions(), osc_user());?></li>
<li><label><?php _e('City', 'isha') ; ?></label> <?php UserForm::city_select(osc_get_cities(), osc_user()); ?></li>
<li><label><?php _e('City Area', 'isha') ; ?></label> <?php UserForm::city_area_text(osc_user()); ?></li>
<li><label><?php _e('Address', 'isha') ; ?></label><?php UserForm::address_text(osc_user()); ?></li>
<li><label><?php _e('Website', 'isha') ; ?></label><?php UserForm::website_text(osc_user()); ?></li>
<li><label><?php _e('Description', 'isha') ; ?></label> <?php UserForm::info_textarea('s_info', osc_locale_code(), @$osc_user['locale'][osc_locale_code()]['s_info']); ?></li>
<li> <button type="submit" class="Update apply ui-button ui-button-middle ui-button-main"><?php _e("Update", 'isha');?></button></li>
<?php //osc_run_hook('user_form'); ?>
<?php osc_run_hook('user_form', osc_user()); ?>
</ul>
</form>
<?php
if(osc_is_web_user_logged_in()){
$userSettings = ModelPM::newInstance()->getUserPmSettings(osc_logged_user_id());
?>
<h1><?php _e('PM Settings', 'isha') ; ?></h1>
<form action="<?php echo osc_base_url() . 'oc-content/plugins/osclass_pm/user-proc.php'; ?>" method="POST">
<input type="hidden" name="page" value="custom" />
<input type="hidden" name="file" value="osclass_pm/user-proc.php" />
<input type="hidden" name="option" value="userSettings" />
<input type="hidden" name="user_id" value="<?php echo osc_logged_user_id(); ?>" />
<ul class="pm">
<li><label><?php _e('Notify by email every time you get a new personal message', 'isha') ; ?>?</label>
<select name="emailAlert">
<option value="1" <?php if($userSettings['send_email'] == 1) { echo 'selected';}?>><?php _e('Always','osclass_pm'); ?></option>
<option value="0" <?php if($userSettings['send_email'] == 0) { echo 'selected';}?>><?php _e('Never','osclass_pm'); ?></option>
</select>
</li>
<li><label><?php _e('Show a flash message when you have new personal messages', 'isha') ; ?>?</label>
<select name="flashAlert">
<option value="1" <?php if($userSettings['flash_alert'] == 1) { echo 'selected';}?>><?php _e('Always','osclass_pm'); ?></option>
<option value="0" <?php if($userSettings['flash_alert'] == 0) { echo 'selected';}?>><?php _e('Never','osclass_pm'); ?></option>
</select>
</li>
<!--
<li><label><?php _e('Notify by email every time you get a new personal message', 'isha') ; ?>?</label>
<select name="saveSent">
<option value="1" <?php if($userSettings['save_sent'] == 1) { echo 'selected';}?>><?php _e('Always','osclass_pm'); ?></option>
<option value="0" <?php if($userSettings['save_sent'] == 0) { echo 'selected';}?>><?php _e('Never','osclass_pm'); ?></option>
</select>
</li> -->
<?php if( pmSent() ) { ?>
<li><label><?php _e('Save a copy of each personal message in your outbox by default', 'isha') ; ?>?</label>
<select name="saveSent">
<option value="1" <?php if($userSettings['save_sent'] == 1) { echo 'selected';}?>><?php _e('Always','osclass_pm'); ?></option>
<option value="0" <?php if($userSettings['save_sent'] == 0) { echo 'selected';}?>><?php _e('Never','osclass_pm'); ?></option>
</select>
</li>
<?php } ?>
<li><button type="submit" class="Update apply ui-button ui-button-middle ui-button-main"><?php _e("Save Settings", 'isha');?></button>
</li>
</ul>
</form>
<?php } ?>
<form action="<?php echo osc_base_url(true); ?>" method="post">
<h1><?php _e('Change your Username', 'isha') ; ?></h1>
<input type="hidden" name="page" value="user" />
<input type="hidden" name="action" value="change_username_post" />
<ul>
<li><label><?php _e('User Name', 'isha') ; ?></label><input type="text" name="s_username" id="s_username" value="" /></li>
<li><button type="submit" class="Update apply ui-button ui-button-middle ui-button-main"><?php _e("Update", 'isha');?></button></li>
</ul>
</form>
<h1><?php _e('Change your Email', 'isha') ; ?></h1>
<form action="<?php echo osc_base_url(true); ?>" method="post">
<input type="hidden" name="page" value="user" />
<input type="hidden" name="action" value="change_email_post" />
<ul>
<li><label><?php _e('Current Email', 'isha') ; ?></label><?php echo osc_logged_user_email(); ?></li>
<li><label><?php _e('New Email*', 'isha') ; ?></label><input type="text" name="new_email" id="new_email" value="" /></li>
<li><button type="submit" class="Update apply ui-button ui-button-middle ui-button-main"><?php _e("Update", 'isha');?></button></li>
</ul>
</form>
<h1><?php _e('Change your Password', 'isha') ; ?></h1>
<form action="<?php echo osc_base_url(true); ?>" method="post">
<input type="hidden" name="page" value="user" />
<input type="hidden" name="action" value="change_password_post" />
<ul>
<li><label class="control-label" for="password"><?php _e('Current password', 'isha'); ?> *</label>
<input type="password" name="password" id="password" value="" /></li>
<li> <label class="control-label" for="new_password"><?php _e('New password', 'isha'); ?> *</label><input type="password" name="new_password" id="new_password" value="" /></li>
<li> <label class="control-label" for="new_password2"><?php _e('Repeat new password', 'isha'); ?> *</label><input type="password" name="new_password2" id="new_password2" value="" /></li>
<li><button type="submit" class="Update apply ui-button ui-button-middle ui-button-main"><?php _e("Update", 'isha');?></button></li>
</ul>
</form>
<?php /*$options = array();
$options[] = array('name' => __('Delete account', 'isha'),
'url' => '#',
'class' => 'opt_delete_account');
$options = osc_apply_filter('user_menu_filter', $options);
echo '<ul><li class="' . $options[0]['class'] . '" ><a href="' . $options[0]['url'] . '" >' . $options[0]['name'] . '</a></li></ul>'; */
?>
<input id="dialog-delete-account" class="delete_account subscribe" title="Delete Account" onclick="return confirm('Are you sure you want to delete your account?');" value="<?php _e('Delete account', 'isha'); ?>"/>
<div class="clear"></div>
</div>
</li>
</ul>
</section>
<script>
(function($){
$( "#all_inbox" ).click(function() {
if($('.delChecks1').prop('checked')) {
// something when checked
$( ".delChecks1" ).prop( "checked", false );
var href1='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=inbox&p1=1';
//console.log(href1);
$('#btn1').attr('href',href1);
} else {
// something else when not
$( ".delChecks1" ).prop( "checked", true);
var tt1='&';
$('.delChecks1').each(function(i,elem)
{
tt1=tt1+'pms[]='+$(elem).val()+'&';
}
);
//console.log(tt1);
var href1='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=inbox&p1=1'+ tt1;
//console.log(href1);
$('#btn1').attr('href',href1);
}
});
$( "#all_outbox" ).click(function() {
if($('.delChecks2').prop('checked')) {
// something when checked
$( ".delChecks2" ).prop( "checked", false );
var href2='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=outbox&p1=1';
//console.log(href2);
$('#btn2').attr('href',href2);
} else {
// something else when not
$( ".delChecks2" ).prop( "checked", true);
var tt2='&';
$('.delChecks2').each(function(ii,elemi)
{
//if ($(elemi).attr('checked')=='checked')
tt2=tt2+'pms[]='+$(elemi).val()+'&';
}
);
//console.log(tt2);
var href2='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=outbox&p1=1'+ tt2;
//console.log(href2);
$('#btn2').attr('href',href2);
}
});
var url='';var pos=''; var pos2=''; var pos1='';
// $( ".account_box ul li" ).click(function() {
$( ".account_box ul li a" ).click(function() {
//$(this).children(".wishlist").slideToggle( "slow", function() {});
$(this).parent().children(".wishlist").slideToggle( "slow", function() {});
});
$('.delChecks1').on('change', function() {
// From the other examples
var tt1='&';
$('.delChecks1').each(function(i,elem)
{
if ($(elem).attr('checked')=='checked')
{
// //console.log($(elem).val());
tt1=tt1+'pms[]='+$(elem).val()+'&';
}
}
);
//console.log(tt1);
var href1='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=inbox&p1=1'+ tt1;
//console.log(href1);
$('#btn1').attr('href',href1);
});
$('.delChecks2').on('change', function() {
// From the other examples
var tt2='&';
$('.delChecks2').each(function(ii,elemi)
{
if ($(elemi).attr('checked')=='checked')
tt2=tt2+'pms[]='+$(elemi).val()+'&';
}
);
//console.log(tt2);
var href2='/index.php?page=custom&file=osclass_pm/user-proc.php&option=delMessages&box=outbox&p1=1'+ tt2;
//console.log(href2);
$('#btn2').attr('href',href2);
});
var url='';var pos=''; var pos2=''; var pos1='';var pos3='';
$('.fancybox').fancybox({
afterShow : function(){
url= $(this.element).attr("href");
//console.log(url);
pos =url.indexOf('option=delMessages&box=inbox&p1=1');
pos1 =url.indexOf('option=delMessages&box=outbox&p1=1');
pos2 =url.indexOf('page=custom&file=osclass_pm/user-messages.php&box=inbox&message');
pos3 =url.indexOf('page=custom&file=osclass_pm/user-send.php&box=inbox&message');
pos4 =url.indexOf('page=custom&file=osclass_pm/user-proc.php');
if ((pos===-1)&&(pos1===-1)&&(pos2===-1)&&(pos3===-1)&&(pos4===-1))
{
}
else
{
//window.location.reload();
}
// this.href = url;
},
afterClose:function() {
window.location.reload();
}
});
})(jQuery)
$("#countryId").on("change",function(){
var pk_c_code = $(this).val();
<?php if($path=="admin") { ?>
var url = '<?php echo osc_admin_base_url(true)."?page=ajax&action=regions&countryId="; ?>' + pk_c_code;
<?php } else { ?>
var url = '<?php echo osc_base_url(true)."?page=ajax&action=regions&countryId="; ?>' + pk_c_code;
<?php }; ?>
var result = '';
if(pk_c_code != '') {
$("#regionId").attr('disabled',false);
$("#cityId").attr('disabled',true);
$.ajax({
type: "POST",
url: url,
dataType: 'json',
success: function(data){
var length = data.length;
if(length > 0) {
result += '<option value=""><?php _e("Select a region..."); ?></option>';
for(key in data) {
result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
}
$("#region").before('<select name="regionId" id="regionId" ></select>');
$("#region").remove();
$("#city").before('<select name="cityId" id="cityId" ></select>');
$("#city").remove();
} else {
result += '<option value=""><?php _e('No results') ?></option>';
$("#regionId").before('<input type="text" name="region" id="region" />');
$("#regionId").remove();
$("#cityId").before('<input type="text" name="city" id="city" />');
$("#cityId").remove();
}
$("#regionId").html(result);
$("#cityId").html('<option selected value=""><?php _e("Select a city..."); ?></option>');
}
});
} else {
// add empty select
$("#region").before('<select name="regionId" id="regionId" ><option value=""><?php _e("Select a region..."); ?></option></select>');
$("#region").remove();
$("#city").before('<select name="cityId" id="cityId" ><option value=""><?php _e("Select a city..."); ?></option></select>');
$("#city").remove();
if( $("#regionId").length > 0 ){
$("#regionId").html('<option value=""><?php _e("Select a region..."); ?></option>');
} else {
$("#region").before('<select name="regionId" id="regionId" ><option value=""><?php _e("Select a region..."); ?></option></select>');
$("#region").remove();
}
if( $("#cityId").length > 0 ){
$("#cityId").html('<option value=""><?php _e("Select a city..."); ?></option>');
} else {
$("#city").before('<select name="cityId" id="cityId" ><option value=""><?php _e("Select a city..."); ?></option></select>');
$("#city").remove();
}
$("#regionId").attr('disabled',true);
$("#cityId").attr('disabled',true);
}
});
$("#regionId").on("change",function(){
var pk_c_code = $(this).val();
<?php if($path=="admin") { ?>
var url = '<?php echo osc_admin_base_url(true)."?page=ajax&action=cities®ionId="; ?>' + pk_c_code;
<?php } else { ?>
var url = '<?php echo osc_base_url(true)."?page=ajax&action=cities®ionId="; ?>' + pk_c_code;
<?php }; ?>
var result = '';
if(pk_c_code != '') {
$("#cityId").attr('disabled',false);
$.ajax({
type: "POST",
url: url,
dataType: 'json',
success: function(data){
var length = data.length;
if(length > 0) {
result += '<option selected value=""><?php _e("Select a city..."); ?></option>';
for(key in data) {
result += '<option value="' + data[key].pk_i_id + '">' + data[key].s_name + '</option>';
}
$("#city").before('<select name="cityId" id="cityId" ></select>');
$("#city").remove();
} else {
result += '<option value=""><?php _e('No results') ?></option>';
$("#cityId").before('<input type="text" name="city" id="city" />');
$("#cityId").remove();
}
$("#cityId").html(result);
}
});
} else {
$("#cityId").attr('disabled',true);
}
});
if( $("#regionId").attr('value') == "") {
$("#cityId").attr('disabled',true);
}
if( $("#countryId").prop('type').match(/select-one/) ) {
if( $("#countryId").attr('value') == "") {
$("#regionId").attr('disabled',true);
}
}
</script>
</section>
<?php osc_current_web_theme_path('footer.php') ; ?>