-
Notifications
You must be signed in to change notification settings - Fork 0
/
user-dashboard.php
97 lines (89 loc) · 4.02 KB
/
user-dashboard.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
<?php
#########################USER_PROFILE####################
use shopclass\includes\classes\tfcAdsLoop;
$address = '';
if ( osc_user_address() != '' ) {
if ( osc_user_city_area() != '' ) {
$address = osc_user_address() . ", " . osc_user_city_area();
} else {
$address = osc_user_address();
}
} else {
$address = osc_user_city_area();
}
$location_array = array ();
if ( trim( osc_user_city() . " " . osc_user_zip() ) != '' ) {
$location_array[] = trim( osc_user_city() . " " . osc_user_zip() );
}
if ( osc_user_region() != '' ) {
$location_array[] = osc_user_region();
}
if ( osc_user_country() != '' ) {
$location_array[] = osc_user_country();
}
$location = implode( ", " , $location_array );
unset( $location_array );
$userId = osc_logged_user_id();
osc_current_web_theme_path( 'head.php' ); ?>
<body>
<?php osc_current_web_theme_path( 'header.php' ); ?>
<div class="row">
<div class="col-md-4 profile">
<?php include 'user-sidebar.php'; ?>
</div>
<div class="col-md-8">
<div class="content user_account">
<div class="user-stats row card-box cardbox-info modal-body">
<p class="lead col-md-12 text-center"><?php _e( 'Your Stats' , 'shopclass' ); ?>:</p>
<div class="col-sm-4 text-center">
<p><i class="fa fa-user-plus fa-4x"></i></p>
<p class="fa-2x"><?php echo tfc_total_user_items( $userId ); ?></p>
<p><?php _e( 'Your Total Active Ads' , 'shopclass' ); ?></p>
</div>
<div class="col-sm-4 text-center">
<p><i class="fa fa-heart fa-4x"></i></p>
<p class="fa-2x"><?php echo tfc_favourite_user_items( $userId ); ?></p>
<p><?php _e( 'Your Favourite Ads' , 'shopclass' ); ?></p>
</div>
<div class="col-sm-4 text-center">
<p><i class="fa fa-eye fa-4x"></i></p>
<?php ?>
<p class="fa-2x"><?php echo tfc_total_user_item_views( $userId ); ?></p>
<p><?php _e( 'Total Views On Ads' , 'shopclass' ); ?></p>
</div>
</div>
<hr>
<div class="user-social-connection row card-box cardbox-warning">
<div class="col-md-12 text-center modal-body">
<p class="lead"><?php _e( 'Manage your social profile' , 'shopclass' ); ?>:</p>
<?php tfc_login_button( 'Google' ); ?>
<?php tfc_login_button( 'Facebook' ); ?>
<?php tfc_login_button( 'Twitter' ); ?>
</div>
</div>
<hr>
<div class="user-latest-items row card-box cardbox-default">
<div class="col-md-12 modal-body">
<?php echo '<p class="lead text-center">' . __( 'Your Last Posted Ad' , 'shopclass' ) . '</p>'; ?>
<?php
$userSearch = new Search();
$userSearch->fromUser( osc_logged_user_id() );
$userSearch->order( 'pk_i_id' , 'DESC' );
$userSearch->limit( 0 , 1 );
$items = $userSearch->doSearch();
View::newInstance()->_exportVariableToView( 'items' , $items );
if ( osc_count_items() > 0 ) { ?>
<?php while ( osc_has_items() ) { ?>
<?php tfcAdsLoop::newInstance()->renderItem( tfcAdsLoop::newInstance()->getItemProperty( 'item' ) , 'list' ); ?>
<?php } ?>
<?php } else {
echo '<h2>' . __( 'You have not published any Ad' , 'shopclass' ) . '</h2>';
} ?>
</div>
</div>
</div>
</div>
</div>
<?php osc_current_web_theme_path( 'footer.php' ); ?>
</body>
</html>