JSFiddle - React, Tailwind, and code Playground
by fparent
HTML
<?php
/*
Template Name: Reimbursement
*/
?>
<?php
global $ultimatemember;
global $woocommerce;
$html_rp = '';
$html_rh = '';
$sort = 'ASC';
$sorting = 'DESC';
// Get current user ID
$current_user_id = get_current_user_id();
// Get user role
$current_user_role = um_user('role');
// Fetch user data
um_fetch_user( $current_user_id );
// Get user clinic id
$current_user_clinic_id = um_user('veterinarian_clinic_ID');
$current_user_clinic_balance = get_field('clinic_points_balance', $current_user_clinic_id);
// Get a list of veterinarians with same clinic ID
// Push in an array
$args = array(
'meta_query' => array(
'relation' => 'AND',
0 => array(
'key' => 'veterinarian_clinic_ID',
'value' => $current_user_clinic_id,
'compare' => '='
),
1 => array(
'key' => 'role',
'value' => 'member',
'compare' => 'LIKE'
),
2 => array(
'key' => 'veterinarian_status',
'value' => 'Actif',
'compare' => 'LIKE'
)
)
);
$user_query = new WP_User_Query( $args );
// Check if the test is not expired
// Expired if before Jan 1st of last year
$actualYear = date('Y');
$expirationYear = $actualYear - 2;
$expirationDate = $expirationYear.'1231';
$ecoli_ID = 128;
$clinicTotalAmount = 0;
// Get order from url
if(isset($_GET['order'])) {
if($_GET['order'] == 'ASC') {
$sort = 'ASC';
$sorting = 'DESC';
} else {
$sort = 'DESC';
$sorting = 'ASC';
}
}
?>
<?php
/* REIMBURSMENT PLAN */
$tblHead_rp = '<thead>';
$tblHead_rp .= '<tr>';
$tblHead_rp .= '<th rowspan="2" class="rp-veterinarian-name with-action"><a href="'.get_permalink(icl_object_id(66, 'page', true)).'?order='.$sorting.'">'.__('Nom du vétérinaire').' <b class="caret down"></b></a></th>';
$tblHead_rp .= '<th colspan="2" class="split rp-dryoff-results">'.__('Cultures').' <span class="fs-14">('.__('Tarissement').')</span></th>';
$tblHead_rp .= '<th colspan="2" class="split...