%PDF- %PDF-
Direktori : /var/www/pn/beta/64801_wp-content/themes/intosai/templates/logedin/ |
Current File : /var/www/pn/beta/64801_wp-content/themes/intosai/templates/logedin/my_projects.php |
<section class="content_section my_projects"> <div class="wrapper"> <a href="/my-projects/add-project/" class="create_project_btn btn trans-bg blue blue-border blue-hover-o"> <i class="fa fa-plus"></i> Add New Project </a> <div class="centered_title"> <h1><?php the_title(); ?></h1> </div> <div class="project_list published"> <div class="pl_title"> <h2>Published Projects</h2> </div> <div class="pl_headings"> <div class="id">ID</div> <div class="name">Name</div> <div class="created">Created</div> <div class="edited">Last Edited</div> <div class="status">Status</div> <div class="controlls">Controlls</div> </div> <?php $publishedArgs = array( 'post_type' => 'project', 'author' => $userID, 'post_status' => 'publish', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'ID' ); ?> <?php $publishedProjects = new WP_Query($publishedArgs); ?> <?php if($publishedProjects->have_posts()) : ?> <?php while($publishedProjects->have_posts()) : $publishedProjects->the_post(); ?> <?php $revisionCreated = ''; $lastEdited = get_the_modified_date('d-m-Y H:i'); $projectID = get_the_ID(); //echo $lastEdited; /*----- SE IF THERE ARE ANY REVISIONS -----*/ $revisionArgs = array( 'post_type' => 'project_revisions', 'author' => $userID, 'post_status' => 'pending', 'posts_per_page' => 1, 'order' => 'DESC', 'orderby' => 'ID', 'meta_query' => array( array( 'key' => 'revision_for_id', 'value' => $projectID, 'compare' => 'LIKE', ), ), ); $revisionProjects = new WP_Query($revisionArgs); while($revisionProjects->have_posts()) : $revisionProjects->the_post(); $revisionCreated = get_the_date('d-m-Y H:i'); //the_id(); echo ' '.$revisionCreated; endwhile;wp_reset_postdata(); /*----- END REVISION CHECK -----*/ ?> <div class="row"> <div class="id"> <div class="id_holder"> #<?= $projectID; ?> </div> </div> <div class="name"> <?= get_the_title($projectID); ?> </div> <div class="created"> <?= get_the_date('d-m-Y H:i', $projectID); ?> </div> <div class="edited"> <?php //echo $revisionCreated.'<br />'; //echo $lastEdited.'<br />'; if($revisionCreated == '') : echo $lastEdited; elseif($lastEdited < $revisionCreated) : echo $revisionCreated; elseif($lastEdited > $revisionCreated) : echo $lastEdited; elseif($lastEdited = $revisionCreated) : echo $lastEdited; endif; ?> </div> <div class="status"> <?php if($revisionCreated == '') : echo '<span class="published">Published</span>'; elseif($lastEdited < $revisionCreated) : echo '<span class="pending">Update pending</span>'; elseif($lastEdited > $revisionCreated) : echo '<span class="published">Published</span>'; elseif($lastEdited = $revisionCreated) : echo '<span class="published">Published</span>'; endif; ?> </div> <div class="controlls"> <a href="/my-projects/edit-project?id=<?= $projectID; ?>"> <div class="controll_holder edit"> <i class="fa fa-pencil"></i> <div class="tooltip"> Edit this project </div> </div> </a> </div> </div> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php else : ?> <div class="no-projects"> You have no published projects as of yet. </div> <?php endif; ?> </div> <div class="project_list drafts"> <div class="pl_title"> <h2>Project drafts</h2> </div> <div class="pl_headings"> <div class="id">ID</div> <div class="name">Name</div> <div class="created">Created</div> <div class="edited">Last Edited</div> <div class="status">Status</div> <div class="controlls">Controlls</div> </div> <?php $publishedArgs = array( 'post_type' => 'project', 'author' => $userID, 'post_status' => 'pending', 'posts_per_page' => -1, 'order' => 'ASC', 'orderby' => 'ID' ); ?> <?php $publishedProjects = new WP_Query($publishedArgs); ?> <?php if($publishedProjects->have_posts()) : ?> <?php while($publishedProjects->have_posts()) : $publishedProjects->the_post(); ?> <div class="row"> <div class="id"> <div class="id_holder"> #<?php the_ID(); ?> </div> </div> <div class="name"> <?php the_title(); ?> </div> <div class="created"> <?//= get_the_date('d-m-Y'); ?> <?= the_field('draft_creation'); ?> </div> <div class="edited"> <?= get_the_modified_date('d-m-Y H:i'); ?> </div> <div class="status"> <?php $pStatus = get_post_status(); $ppStatus = get_field('publish_status'); if($pStatus == 'pending' && $ppStatus == 'draft') : echo '<span class="draft">Draft</span>'; elseif($pStatus == 'pending' && $ppStatus == 'publish') : echo '<span class="pending">Pending publication</span>'; endif; ?> </div> <div class="controlls"> <a href="/my-projects/edit-project?id=<?= get_the_ID(); ?>"> <div class="controll_holder edit"> <i class="fa fa-pencil"></i> <div class="tooltip"> Edit this project </div> </div> </a> </div> </div> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php else : ?> <div class="no-projects"> You have no project drafts as of yet. </div> <?php endif; ?> </div> </div> </section>