$is_expired_class = $current_time > strtotime($time_arr['expire_time']) ? 'ihc-expired-level' : ''; } ?> <div class="level-type-list <?php echo $is_expired_class; ?> "><?php echo $temp_data['name']; ?> </div> <?php } } } else { $temp_data = ihc_get_level_by_id($user_levels); $time_arr = ihc_get_start_expire_date_for_user_level($user->data->ID, $user_levels); $is_expired_class = ''; if (isset($time_arr['expire_time'])) { $is_expired_class = $current_time > strtotime($time_arr['expire_time']) ? 'ihc-expired-level' : ''; } echo '<div class="level-type-list ' . $is_expired_class . '">' . $temp_data['name'] . '</div>'; } } ?> </td> <td> <div id="user-<?php echo $user->data->ID; ?> -status"> <?php
private function print_level_expire_time_edit() { /* * @param none, use variables from class * @return string with input for each level expire */ $string = ''; if (isset($this->user_data['ihc_user_levels']) && $this->user_data['ihc_user_levels'] != -1) { $user_levels = explode(',', $this->user_data['ihc_user_levels']); $i = 1; foreach ($user_levels as $v) { $v = (int) $v; $temp_data = ihc_get_level_by_id($v); if ($temp_data) { $time = ihc_get_start_expire_date_for_user_level($this->user_id, $v); $placeholder['start_time'] = ''; $placeholder['expire_time'] = ''; if (!$time['start_time']) { $placeholder['start_time'] = '----/--/----'; } if (!$time['expire_time']) { $placeholder['expire_time'] = '----/--/----'; } if (!isset($temp_data['access_type'])) { $temp_data['access_type'] = 'LifeTime'; } $string .= '<tr class="' . ($i % 2 == 0 ? 'alternate' : '') . '">' . '<td style="color: #21759b; font-weight:bold; width:120px;font-family: "Oswald", arial, sans-serif !important;font-size: 14px;font-weight: 300;">' . $temp_data['name'] . '</td>' . '<td style="color: #888; font-weight:bold; width:120px;font-family: "Oswald", arial, sans-serif !important;font-size: 14px;font-weight: 300;">' . $temp_data['access_type'] . '</td>' . '<td>' . indeed_create_form_element(array('type' => 'text', 'name' => 'start_time_levels[' . $v . ']', 'class' => 'start_input_text', 'value' => $time['start_time'], 'placeholder' => $placeholder['start_time'])) . '</td>' . '<td>' . indeed_create_form_element(array('type' => 'text', 'name' => 'expire_levels[' . $v . ']', 'class' => 'expire_input_text', 'value' => $time['expire_time'], 'placeholder' => $placeholder['expire_time'])) . '</td>' . '</tr>'; } $i++; } } if ($string) { $string = '<table class="wp-list-table widefat fixed tags ihc-manage-user-expire"><thead><tr><th>' . __('Level Name', 'ihc') . '</th><th>' . __('Acess Type', 'ihc') . '</th><th>' . __('Start Time', 'ihc') . '</th><th>' . __('Expire Time', 'ihc') . '</th></tr></thead><tbody>' . $string . '</tbody></table>'; } return $string; }