File: /var/www/html/shootinschool/wp-content/themes/splash-child/wpuf/account.php
<?php global $current_user; ?>
<style>
body {font-family: Arial;}
/* Style the tab */
.tab {
overflow: hidden;
}
/* Style the tab content */
.tabcontent {
display: none;
padding: 6px 12px;
border-top: none;
}
</style>
<div class="wpuf-dashboard-container">
<nav class="wpuf-dashboard-navigation tab">
<ul>
<li class="black-banner">
presented by
</li>
<li class="edit-avtar">
<?php $user = wp_get_current_user();
if ( $user ) : ?>
<img src="<?php echo esc_url( get_avatar_url( $user->ID ) ); ?>" />
<?php endif; ?>
<p><?php echo $current_user->first_name; ?> <?php echo $current_user->last_name; ?> </p>
<a href="javascript:void(0)" class="active tablinks" onclick="openCity(event, 'editprofile')"><i class="fa fa-pencil" aria-hidden="true"></i> Edit Profile</a>
</li>
<li class="black-banner">
buy loan post
</li>
</ul>
<ul class="buy-loan-setting">
<li class="active tablinks" onclick="openCity(event, 'dashboard')">
<i class="fa fa-tachometer" aria-hidden="true"></i>
Dashboard
</li>
<li class="tablinks" onclick="openCity(event, 'my-page')">
<i class="fa fa-list" aria-hidden="true"></i>
Loan Post Request or Offer
</li>
<li class="tablinks" onclick="openCity(event, 'post')">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
My Posts
</li>
<li class="tablinks" onclick="openCity(event, 'message')">
<i class="fa fa-envelope-o" aria-hidden="true"></i>
Create a new message / Replies
</li>
<!--<li class="tablinks" onclick="openCity(event, 'reply')">-->
<!-- <i class="fa fa-commenting-o" aria-hidden="true"></i>-->
<!-- My Replies-->
<!--</li>-->
<li>
<a href="<?php echo wp_logout_url( get_permalink() ); ?>">
<i class="fa fa-sign-out" aria-hidden="true"></i>
Logout</a>
</li>
</ul>
</nav>
<div id="message" class="tabcontent wpuf-dashboard-content message" >
<?php echo do_shortcode('[phoen_ticket_system]'); ?>
</div>
<div id="editprofile" class="tabcontent wpuf-dashboard-content editprofile">
<h1 class="heading-one">Edit User profile ?</h1>
<p>Please enter your information below</p>
<div class="line"></div>
<?php echo do_shortcode("[wpuf_profile type='profile' id='329']"); ?>
</div>
<div id="dashboard" class="tabcontent wpuf-dashboard-content dashboard" style="display: block;">
<div class="row">
<h1 class="heading-one">Dashboard</h1>
<p><?php
printf(
__( 'From your account dashboard you can view your dashboard.' ),
esc_url( add_query_arg( array( 'section' => 'posts' ), get_permalink() ) ),
esc_url( add_query_arg( array( 'section' => 'subscription' ), get_permalink() ) ),
esc_url( add_query_arg( array( 'section' => 'edit-profile' ), get_permalink() ) )
);
?></p>
<ul class="dashboard-setting">
<li class="tablinks" onclick="openCity(event, 'my-page')">
<i class="fa fa-list" aria-hidden="true"></i>
<span>Post Loan Request or Offer</span>
</li>
<li class="tablinks" onclick="openCity(event, 'post')">
<i class="fa fa-file-text-o" aria-hidden="true"></i>
<span>My Post</span>
</li>
<li class="tablinks" onclick="openCity(event, 'message')">
<i class="fa fa-envelope-o" aria-hidden="true"></i>
<span>My Message</span>
</li>
<li class="tablinks" onclick="openCity(event, 'reply')">
<i class="fa fa-commenting-o" aria-hidden="true"></i>
<span>My Replies</span>
</li>
<li class="tablinks" onclick="openCity(event, 'editprofile')">
<i class="fa fa-user" aria-hidden="true"></i>
<span>My Profile</span>
</li>
</ul>
</div>
</div>
<div id="my-page" class="tabcontent wpuf-dashboard-content my-page" >
<div class="selectContainer">
<h1 class="heading-one">New Loan Post Request Or Offer</h1>
<h2 class="heading-yellow">information required</h2>
<div class="line"></div>
<ul class="wpuf-form form-label-left">
<li class="wpuf-el post_title field-size-large" data-label="Title"> <div class="wpuf-label">
<label for="post_title">Please Select Product Type <span class="required">*</span></label>
</div>
<select id="theSelect" required>
<option value="select">- Select -</option>
<option value="request">Loan Request</option>
<option value="loan">Loan Offer</option>
</select>
</li>
</ul>
</div>
<div class="isselect"></div>
<div class="isrequest post-form">
<?php echo do_shortcode('[wpuf_form id="237"]'); ?></div>
<div class="isloan post-form">
<?php echo do_shortcode('[wpuf_form id="411"]'); ?></div>
<script>
jQuery('[class^=is]').hide();
jQuery("#theSelect").change(function(){
var value = jQuery("#theSelect option:selected").val();
var theDiv = jQuery(".is" + value);
theDiv.slideDown('slow');
theDiv.siblings('[class^=is]').slideUp('slow');
});
</script>
</div>
<div id="post" class="tabcontent wpuf-dashboard-content post" >
<?php
$post_type = array( 'listing-post', 'loan-offer');
global $userdata;
$userdata = get_userdata( $userdata->ID ); //wp 3.3 fix
global $post;
$pagenum = isset( $_GET['pagenum'] ) ? intval( $_GET['pagenum'] ) : 1;
// delete post
if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == "del" ) {
$nonce = $_REQUEST['_wpnonce'];
if ( !wp_verify_nonce( $nonce, 'wpuf_del' ) ) {
die( "Security check" );
}
//check, if the requested user is the post author
$maybe_delete = get_post( $_REQUEST['pid'] );
if ( ($maybe_delete->post_author == $userdata->ID) || current_user_can( 'delete_others_pages' ) ) {
wp_delete_post( $_REQUEST['pid'] );
//redirect
$redirect = add_query_arg( array( 'section' => 'posts', 'msg' => 'deleted'), get_permalink() );
wp_redirect( $redirect );
} else {
echo '<div class="error">' . __( 'You are not the post author. Cheeting huh!', 'wp-user-frontend' ) . '</div>';
}
}
// show delete success message
if ( isset( $_GET['msg'] ) && $_GET['msg'] == 'deleted' ) {
echo '<div class="success">' . __( 'Post Deleted', 'wp-user-frontend' ) . '</div>';
}
$args = array(
'author' => get_current_user_id(),
'post_status' => array('draft', 'future', 'pending', 'publish', 'private'),
'post_type' => $post_type,
'posts_per_page' => wpuf_get_option( 'per_page', 'wpuf_dashboard', 10 ),
'paged' => $pagenum
);
$original_post = $post;
$dashboard_query = new WP_Query( apply_filters( 'wpuf_dashboard_query', $args ) );
$post_type_obj = get_post_type_object( $post_type );
?>
<?php if ( wpuf_get_option( 'show_post_count', 'wpuf_dashboard', 'on' ) == 'on' ) { ?>
<div class="post_count"><?php printf( __( 'You have created <span>%d</span> %s', 'wp-user-frontend' ), $dashboard_query->found_posts, $post_type_obj->label ); ?></div>
<?php } ?>
<?php do_action( 'wpuf_account_posts_top', $userdata->ID, $post_type_obj ) ?>
<?php if ( $dashboard_query->have_posts() ) { ?>
<?php
$featured_img = wpuf_get_option( 'show_ft_image', 'wpuf_dashboard' );
$featured_img_size = wpuf_get_option( 'ft_img_size', 'wpuf_dashboard' );
$current_user = wpuf_get_user();
$charging_enabled = $current_user->subscription()->current_pack_id();
?>
<table class="items-table <?php echo $post_type; ?>" cellpadding="0" cellspacing="0">
<thead>
<tr class="items-list-header">
<?php
if ( 'on' == $featured_img ) {
echo '<th>' . __( 'Featured Image', 'wp-user-frontend' ) . '</th>';
}
?>
<th><?php _e( 'Title', 'wp-user-frontend' ); ?></th>
<th><?php _e( 'Status', 'wp-user-frontend' ); ?></th>
<?php do_action( 'wpuf_account_posts_head_col', $args ) ?>
<?php
if ( $charging_enabled ) {
echo '<th>' . __( 'Payment', 'wp-user-frontend' ) . '</th>';
}
?>
<th><?php _e( 'Options', 'wp-user-frontend' ); ?></th>
</tr>
</thead>
<tbody>
<?php
global $post;
while ( $dashboard_query->have_posts() ) {
$dashboard_query->the_post();
$show_link = !in_array( $post->post_status, array('draft', 'future', 'pending') );
?>
<tr>
<?php if ( 'on' == $featured_img ) { ?>
<td>
<?php
echo $show_link ? '<a href="' . get_permalink( $post->ID ) . '">' : '';
if ( has_post_thumbnail() ) {
the_post_thumbnail( $featured_img_size );
} else {
printf( '<img src="%1$s" class="attachment-thumbnail wp-post-image" alt="%2$s" title="%2$s" />', apply_filters( 'wpuf_no_image', plugins_url( '/assets/images/no-image.png', dirname( __FILE__ ) ) ), __( 'No Image', 'wp-user-frontend' ) );
}
echo $show_link ? '</a>' : '';
?>
</td>
<?php } ?>
<td>
<?php if ( !$show_link ) { ?>
<?php the_title(); ?>
<?php } else { ?>
<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'wp-user-frontend' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
<?php } ?>
</td>
<td>
<?php wpuf_show_post_status( $post->post_status ) ?>
</td>
<?php do_action( 'wpuf_account_posts_row_col', $args, $post ) ?>
<?php
if ( $charging_enabled ) {
$order_id = get_post_meta( $post->ID, '_wpuf_order_id', true );
?>
<td>
<?php if ( $post->post_status == 'pending' && $order_id ) { ?>
<a href="<?php echo trailingslashit( get_permalink( wpuf_get_option( 'payment_page', 'wpuf_payment' ) ) ); ?>?action=wpuf_pay&type=post&post_id=<?php echo $post->ID; ?>"><?php _e( 'Pay Now', 'wp-user-frontend' ); ?></a>
<?php } ?>
</td>
<?php } ?>
<td>
<?php
if ( wpuf_get_option( 'enable_post_edit', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
$disable_pending_edit = wpuf_get_option( 'disable_pending_edit', 'wpuf_dashboard', 'on' );
$edit_page = (int) wpuf_get_option( 'edit_page_id', 'wpuf_frontend_posting' );
$url = add_query_arg( array('pid' => $post->ID), get_permalink( $edit_page ) );
if ( $post->post_status == 'pending' && $disable_pending_edit == 'on' ) {
// don't show the edit link
} else {
?>
<a href="<?php echo wp_nonce_url( $url, 'wpuf_edit' ); ?>"><?php _e( 'Edit', 'wp-user-frontend' ); ?></a> /
<?php
}
}
?>
<?php
if ( wpuf_get_option( 'enable_post_del', 'wpuf_dashboard', 'yes' ) == 'yes' ) {
$del_url = add_query_arg( array('action' => 'del', 'pid' => $post->ID) );
$message = __( 'Are you sure to delete?', 'wp-user-frontend' );
?>
<a href="<?php echo wp_nonce_url( $del_url, 'wpuf_del' ) ?>" onclick="return confirm('<?php echo $message ?>');"><span style="color: red;"><?php _e( 'Delete', 'wp-user-frontend' ); ?></span></a>
<?php } ?>
</td>
</tr>
<?php
}
wp_reset_postdata();
?>
</tbody>
</table>
<div class="wpuf-pagination">
<?php
$pagination = paginate_links( array(
'base' => add_query_arg( 'pagenum', '%#%' ),
'format' => '',
'prev_text' => __( '«', 'wp-user-frontend' ),
'next_text' => __( '»', 'wp-user-frontend' ),
'total' => $dashboard_query->max_num_pages,
'current' => $pagenum,
'add_args' => false
) );
if ( $pagination ) {
echo $pagination;
}
?>
</div>
<?php
} else {
printf( '<div class="wpuf-message">' . __( 'No %s found', 'wp-user-frontend' ) . '</div>', $post_type_obj->label );
do_action( 'wpuf_account_posts_nopost', $userdata->ID, $post_type_obj );
}
wp_reset_postdata();
?>
</div>
<div id="reply" class="tabcontent wpuf-dashboard-content reply" >
coming soom
</div>
</div>
<script>
jQuery(document).ready(function(){
jQuery('.buy-loan-setting li').click(function() {
//console.log("Clicked");
//jQuery('.buy-loan-setting li.active').removeClass('active');
jQuery(this).siblings().removeClass("active");
jQuery(this).addClass('active');
})
});
</script>
<script>
function openCity(evt, cityName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.className += " active";
}
</script>