This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
teachers-list.php
75 lines (69 loc) · 2.67 KB
/
teachers-list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/*
Template Name: Teachers List
*/
get_header();
?>
<div class="student_list_area">
<div class="student_list fix column">
<?php if( current_user_can('student_teacher_panel_manager') || current_user_can('administrator') || current_user_can('student_dataentry_manager') || current_user_can('student_manager') || current_user_can('editor') ) : ?>
<table border="1" class="box">
<tbody>
<tr>
<th><?php _e('Picture', 'edu_text_domain');?></th>
<th><?php _e('Teacher Name', 'edu_text_domain');?></th>
<th><?php _e('Index No', 'edu_text_domain');?></th>
<th><?php _e('Designation', 'edu_text_domain');?></th>
<th><?php _e('Experience', 'edu_text_domain');?></th>
<th><?php _e('Birthday<br/>M.D.Y', 'edu_text_domain');?></th>
<th><?php _e('Details', 'edu_text_domain');?></th>
</tr>
<?php
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query('showposts=30&post_type=teachers'.'&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post();
?>
<?php
/*-------------Meta Data Variable------------------------------*/
$t_designation = get_post_meta($post->ID, 't_designation', true);
$t_experience = get_post_meta($post->ID, 't_experience', true);
$t_index_no = get_post_meta($post->ID, 't_index_no', true);
$t_date_of_birth = get_post_meta($post->ID, 't_date_of_birth', true);
$t_list_pic = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 't_list_pic' );
?>
<tr>
<td><img src="<?php echo $t_list_pic[0]; ?>" alt="" /></td>
<td><?php the_title(); ?></td>
<td><?php echo $t_index_no; ?></td>
<td><?php echo $t_designation; ?></td>
<td><?php echo $t_experience; ?></td>
<td><?php echo $t_date_of_birth; ?></td>
<td class="view_student_details"><a href="<?php the_permalink(); ?>"><?php _e('View Details', 'edu_text_domain');?></a></td>
</tr>
<?php endwhile; ?>
<div class="post_pagi">
<?php
the_posts_pagination(array(
'screen_reader_text' => ' ',
));
?>
</div>
<?php
$wp_query = null;
$wp_query = $temp; // Reset
?>
</tbody>
</table>
<div class="print_button">
<h2 ><i class="fa fa-print"></i><a href="javascript:window.print()"><?php _e('Print', 'edu_text_domain');?></a></h2>
</div>
<?php else : ?>
<div class="dont_have_access">
<h2><?php _e('<span>Access denied!</span> You Don\'t have access the information. Only Computer Operator, Administrator and Teachers have permission to view the info.', 'edu_text_domain');?></h2>
</div>
<?php endif; ?>
</div>
</div>
<?php get_footer();?>