%PDF- %PDF-
Direktori : /var/www/pn/wp-content/themes/intosai/ |
Current File : //var/www/pn/wp-content/themes/intosai/single-project.php |
<div class="page-content single-page"> <div class="wrapper"> <section class="single_project"> <?php $status = get_field('project_status'); $benlvl = get_field('beneficiary_level'); $regions = get_field('intosai_region'); $from = get_field('duration_from'); $to = get_field('duration_to'); $budget = get_field('total_budget'); $initiation = get_field('project_initiated'); // $further = get_field('further_info'); $cpbrc = get_field('cp_ben-sai_region_committee'); $sf = get_field('source_funding'); $sfc = get_field('source_funding_custom'); $cpdonor = get_field('cp_donor'); $agency = get_field('imp_agencys'); $cpip = get_field('cp_imp-partners'); $tos = get_field('type_of_support'); $sm = get_field('support_modality'); $scc = get_field('support_cats_covered'); $sbo = get_field('support_based_on'); $pc = get_field('project_connections'); $oi = get_field('other_info'); $gender_relevance = get_field('gender_relevance'); $project_activity_objective = get_field('project_activity_objective'); $numSAIS = wp_get_post_terms(get_the_ID(), 'wdi'); $numSAIS = count($numSAIS); ?> <?php while (have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php endwhile; ?> <?php /* * If the user is logged in he gets a Suggested Changes button displayed. The if statement below checks if the user is logged in. */ $loggedIn = false; if(is_user_logged_in()) { $loggedIn = true; $currentUser = wp_get_current_user(); $userName = $currentUser->user_firstname . ' ' . $currentUser->user_lastname; $userID = $currentUser->ID; $userStatus = get_field('active_user', 'user_'.$userID); if($userStatus == 'yes' || current_user_can('administrator')) { $userActive = true; } else { $userActive = false; } } if($loggedIn && $userActive ){ // If user is logged in as administrator //include('templates/forms/sai_project_changes_form.php'); /* Gets the information element */ //include('templates/forms/sai_project_applyadmin.php'); /* Gets the information element */ ?> <a href="/my-projects/edit-project?id=<?= get_the_ID(); ?>"> <button id="saichanges" type="button" data-saichange=""> <i class="fa fa-pencil"></i> Edit project </button> </a> <?php } else { // If user is NOT logged in as administrator //include('templates/forms/sai_project_applyacc_form.php'); /* Gets the information element */ } //if($loggedIn && $userActive ){ // If user is logged in / logged in as administrator // echo '<button id="saichanges" type="button" data-saichange="">'; // echo '<i class="fa fa-envelope-o"></i> Suggest changes'; // echo '</button>'; //echo '<button id="applyadmin" type="button" data-applyadmin="">'; // echo '<i class="fa fa-user"></i> Apply for admin'; //echo '</button>'; //} //else { // If user is NOT logged in as administrator // echo '<button id="applyacc" type="button" data-applyacc="">'; // echo '<i class="fa fa-envelope-o"></i> Suggest changes'; // echo '</button>'; //} /* * ENDOF: Suggested Changes */ ?> <div class="project_meta"> <div class="top"> <?php if($benlvl){ ?> <div id="benlvl"> <span>Beneficiary level:</span> <?= $benlvl; ?> </div> <?php } ?> <?php if($status){ ?> <div id="status"> <span>Project status:</span> <?= $status; ?> </div> <?php } ?> <?php if($regions){ ?> <div id="regions"> <span>INTOSAI region(s):</span> <?= $regions; ?> </div> <?php } ?> </div> <div class="bottom"> <div id="from"> <span>Duration from:</span> <?= $from; ?> </div> <div id="to"> <span>Duration to:</span> <?= $to; ?> </div> <?php if($budget){ ?> <div id="budget"> <span>Total budget <span>(US Dollar)</span>:</span> $<?= $budget; ?> </div> <?php } ?> <?php if($numSAIS == 1){ $singleSAIS = wp_get_post_terms(get_the_ID(), 'wdi'); //var_dump($singleSAIS); $saiID = $singleSAIS[0]->term_id; ?> <div id="dac"> <span>DAC Income classification:</span> <?= get_field('economic_classification', 'term_'.$saiID); ?> </div> <?php } ?> </div> </div> <article id="project_info"> <div class="row"> <div id="projDesc"> <?php while (have_posts()) : the_post(); ?> <?php the_content(); ?> <?php endwhile; ?> </div> <div id="connectSais"> <div class="list"> <h3>SAIs connected to this project</h3> <?php $wdis = wp_get_post_terms(get_the_ID(), 'wdi'); ?> <ul class="projList"> <?php foreach($wdis as $wdi){ $name = $wdi->name; echo "<li>{$name}</li>"; } ?> </ul> </div> </div> </div> <div class="row bg"> <div class="projInfo half left"> <div class="label">How the project was initiated</div> <?= $initiation; ?> </div> <div class="projInfo half right"> <div class="label">Gender Relevance</div> <?= $gender_relevance; ?> </div> </div> <div class="row"> <div class="projInfo full"> <div class="label">Has the project/activity as an objective “the strengthening of the SAI Institutional Framework/ Independence”?</div> <?= $project_activity_objective; ?> </div> </div> <div class="row bg"> <div class="projInfo full"> <div class="label">Contact person: Beneficiary SAI/Region/Committee</div> <?= $cpbrc; ?> </div> </div> <div class="row"> <div class="projInfo third"> <div class="label">Source of funding</div> <?= $sf; ?> </div> <div class="projInfo third middle"> <div class="label">Other Source of funding</div> <?= $sfc; ?> </div> <div class="projInfo third"> <div class="label">Contact person: Provider of support</div> <?= $cpdonor; ?> </div> </div> <div class="row bg"> <div class="projInfo half left"> <div class="label">Implementing agency(s)</div> <?= $agency; ?> </div> <div class="projInfo half right"> <div class="label">Contact person: Implementing partner(s)</div> <?= $cpip; ?> </div> </div> <div class="row"> <div class="projInfo half left"> <div class="label">Type of support</div> <?= $tos; ?> </div> <div class="projInfo half right"> <div class="label">Support modality</div> <?= $sm; ?> </div> </div> <div class="row bg"> <div class="projInfo full"> <div class="label">Support categories covered</div> <?= $scc; ?> </div> </div> <div class="row"> <div class="projInfo full"> <div class="label">Is support based on beneficiary SAI/INTOSAI region Strategic Plan?</div> <?= $sbo; ?> </div> </div> <div class="row bg"> <div class="projInfo full"> <div class="label">Link to related projects/programs</div> <?php if($pc): $relCount = count($pc); $c = 1; foreach($pc as $p): if($c != 1){ echo ', '; } echo '<a href="'.get_permalink($p).'">'; echo get_the_title($p); echo '</a>'; $c++; endforeach; else : echo 'No related projects/programs'; endif; ?> </div> </div> <div class="row"> <div class="projInfo full"> <div class="label">Any other information</div> <?= $oi; ?> </div> </div> </article> </section> </div> </div> <?php /* SOCIAL SHARINBG */ include('templates/sections/social_sharing.php'); ?>