<th scope="col" id="categories" class="manage-column column-categories" style="">Parent Name</th> <th scope="col" id="tags" class="manage-column column-tags" style="">Parent No.</th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> Source </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> Reg. Date </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> Course Date </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> Invoice No. </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> Status </th> </tr> </thead> <tbody id="the-list"> <?php foreach ($user_protege as $protege_id) { $protege_orders = User::getOrdersByDate($protege_id, $date_type); if (!empty($protege_orders)) { $protege_form_id = User::getRegistrationFormID($protege_id); $protege_form = User::getRegistrationForm($protege_form_id); $protege_status = ''; $ptotege_invoice = ''; $protege_course_start = ''; foreach ($protege_orders as $order) { $order_obj = new \WC_Order($order->ID); $order_items = $order_obj->get_items(); $protege_course_id = db::getEntryMeta($order->ID, $user_fields['course']); $ptotege_invoice = db::getEntryMeta($order->ID, '_transaction_id')[0]; if ($protege_course_id) { $stages = Course::getChilds($protege_course_id); foreach ($stages as $stage) { $stage_name = Event::getNameByID($stage->ID); if ($stage_name === 'INT') { $protege_course_start = date('Y-m-d', db::getEntryMeta($stage->ID, $stage_type_fields['start'])[0]);
public function getConfirmedByCountry($stage_id) { $stage_name = $this->getNameByID($stage_id); $stage_fields = $this->addition_fields_list(); $users_bought_stage = User::getBoughtStage($stage_fields['name'] . $stage_name, $stage_id); $stage_counter = array('SG' => 0, 'MYR' => 0); foreach ($users_bought_stage as $user_obj) { $user_id = $user_obj->ID; $user_form_id = User::getRegistrationFormID($user_id); $user_country = User::getRegistrationForm($user_form_id)[11] === 'singapore' ? $stage_counter['SG']++ : $stage_counter['MYR']++; } $response1 = $stage_counter['SG'] > 0 ? $stage_counter['SG'] . 'SG' : '0SG'; $response2 = $stage_counter['MYR'] > 0 ? $stage_counter['MYR'] . 'MYR' : '0MYR'; #$response = !empty($response1) && !empty($response2) ? $response1 . ' - ' . $response2 : empty($response1) && !empty($response2) ? $response2 : !empty($response1) && empty($response2) ? $response1 : 0; $response = $response1 . ' - ' . $response2; return $response; }