| 1 |
<?php |
| 2 |
if (!defined( 'ABSPATH' ) )exit('No Such File'); |
| 3 |
wpsp_header(); |
| 4 |
if( is_user_logged_in() ) { |
| 5 |
global $current_user, $wpdb; |
| 6 |
$current_user_role=$current_user->roles[0]; |
| 7 |
if($current_user_role=='administrator' || $current_user_role=='teacher') |
| 8 |
{ |
| 9 |
wpsp_topbar(); |
| 10 |
wpsp_sidebar(); |
| 11 |
wpsp_body_start(); |
| 12 |
?> |
| 13 |
<div class="wpsp-card"> |
| 14 |
<div class="wpsp-card-body"> |
| 15 |
<table id="transport_table" class="wpsp-table" cellspacing="0" width="100%" style="width:100%"> |
| 16 |
<thead> |
| 17 |
<tr> |
| 18 |
<th class="nosort">#</th> |
| 19 |
<th><?php esc_html_e( 'Vehicle Name', 'wpschoolpress' ); ?></th> |
| 20 |
<th><?php esc_html_e( 'Vehicle Number', 'wpschoolpress' ); ?></th> |
| 21 |
<th><?php esc_html_e( 'Driver Name', 'wpschoolpress' ); ?></th> |
| 22 |
<th><?php esc_html_e( 'Driver Phone', 'wpschoolpress' ); ?></th> |
| 23 |
<th><?php esc_html_e( 'Route Fees', 'wpschoolpress' ); ?></th> |
| 24 |
<th><?php esc_html_e( 'Vehicle Route', 'wpschoolpress' ); ?> </th> |
| 25 |
<?php if($current_user_role=='administrator'){?> |
| 26 |
<th class="nosort" align="center"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 27 |
<?php }?> |
| 28 |
</tr> |
| 29 |
</thead> |
| 30 |
<tbody> |
| 31 |
<?php |
| 32 |
$trans_table=$wpdb->prefix."wpsp_transport"; |
| 33 |
$wpsp_trans =$wpdb->get_results("select * from $trans_table"); |
| 34 |
$sno=1; |
| 35 |
foreach ($wpsp_trans as $wpsp_tran){ ?> |
| 36 |
<tr> |
| 37 |
<td><?php echo esc_html($sno);?></td> |
| 38 |
<td><?php echo esc_html($wpsp_tran->bus_name); ?></td> |
| 39 |
<td><?php echo esc_html($wpsp_tran->bus_no);?> </td> |
| 40 |
<td><?php echo esc_html($wpsp_tran->driver_name); ?></td> |
| 41 |
<td><?php echo esc_html($wpsp_tran->phone_no);?></td> |
| 42 |
<td><?php echo esc_html($wpsp_tran->route_fees);?></td> |
| 43 |
<td><?php echo esc_html($wpsp_tran->bus_route);?></td> |
| 44 |
<?php if($current_user_role=='administrator'){?> |
| 45 |
<td align="center"> |
| 46 |
<div class="wpsp-action-col"> |
| 47 |
<a href="javascript:;" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" class="ViewTrans wpsp-popclick" data-pop="ViewModal" title="View"> |
| 48 |
<i class="icon wpsp-view wpsp-view-icon"></i></a> |
| 49 |
<a href="javascript:;" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" class="EditTrans wpsp-popclick" data-pop="ViewModal" title="Edit"> |
| 50 |
<i class="icon wpsp-edit wpsp-edit-icon"></i></a> |
| 51 |
<a href="javascript:;" id="d_teacher" class="wpsp-popclick" data-pop="DeleteModal" title="Delete" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" > |
| 52 |
<i class="icon wpsp-trash wpsp-delete-icon" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>"></i></a> |
| 53 |
</div> |
| 54 |
</td> |
| 55 |
<?php }?> |
| 56 |
</tr> |
| 57 |
<?php |
| 58 |
$sno++; |
| 59 |
} |
| 60 |
?> |
| 61 |
</tbody> |
| 62 |
<tfoot> |
| 63 |
<tr> |
| 64 |
<th class="nosort">#</th> |
| 65 |
<th><?php esc_html_e( 'Vehicle Name', 'wpschoolpress' ); ?></th> |
| 66 |
<th><?php esc_html_e( 'Vehicle Number', 'wpschoolpress' ); ?></th> |
| 67 |
<th><?php esc_html_e( 'Driver Name', 'wpschoolpress' ); ?></th> |
| 68 |
<th><?php esc_html_e( 'Driver Phone', 'wpschoolpress' ); ?></th> |
| 69 |
<th><?php esc_html_e( 'Route Fees', 'wpschoolpress' ); ?></th> |
| 70 |
<th><?php esc_html_e( 'Vehicle Route', 'wpschoolpress' ); ?> </th> |
| 71 |
<?php if($current_user_role=='administrator'){?> |
| 72 |
<th class="nosort" align="center"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 73 |
<?php }?> |
| 74 |
</tr> |
| 75 |
</tfoot> |
| 76 |
</table> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
<!--Info Modal--> |
| 80 |
<div class="wpsp-popupMain" id="ViewModal"> |
| 81 |
<div class="wpsp-overlayer"></div> |
| 82 |
<div class="wpsp-popBody"> |
| 83 |
<div class="wpsp-popInner"> |
| 84 |
<a href="javascript:;" class="wpsp-closePopup"></a> |
| 85 |
<div id="ViewModalContent" class="wpsp-text-left"></div> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
<?php |
| 90 |
wpsp_body_end(); |
| 91 |
wpsp_footer(); |
| 92 |
} |
| 93 |
else if($current_user_role=='parent' || $current_user_role=='student' ) |
| 94 |
{ |
| 95 |
wpsp_topbar(); |
| 96 |
wpsp_sidebar(); |
| 97 |
wpsp_body_start(); |
| 98 |
?> |
| 99 |
<div class="wpsp-card"> |
| 100 |
<div class="wpsp-card-body"> |
| 101 |
<table id="transport_table" class="wpsp-table" cellspacing="0" width="100%" style="width:100%"> |
| 102 |
<thead> |
| 103 |
<tr> |
| 104 |
<th class="nosort">#</th> |
| 105 |
<th><?php esc_html_e( 'Vehicle Name', 'wpschoolpress' ); ?></th> |
| 106 |
<th><?php esc_html_e( 'Vehicle Number', 'wpschoolpress' ); ?></th> |
| 107 |
<th><?php esc_html_e( 'Driver Name', 'wpschoolpress' ); ?></th> |
| 108 |
<th><?php esc_html_e( 'Driver Phone', 'wpschoolpress' ); ?></th> |
| 109 |
<th><?php esc_html_e( 'Route Fees', 'wpschoolpress' ); ?></th> |
| 110 |
<th><?php esc_html_e( 'Vehicle Route', 'wpschoolpress' ); ?> </th> |
| 111 |
<?php if($current_user_role=='administrator'){?> |
| 112 |
<th class="nosort" align="center"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 113 |
<?php }?> |
| 114 |
</tr> |
| 115 |
</thead> |
| 116 |
<tbody> |
| 117 |
<?php |
| 118 |
$trans_table=$wpdb->prefix."wpsp_transport"; |
| 119 |
$wpsp_trans =$wpdb->get_results("select * from $trans_table"); |
| 120 |
$sno=1; |
| 121 |
foreach ($wpsp_trans as $wpsp_tran){ ?> |
| 122 |
<tr> |
| 123 |
<td><?php echo esc_html($sno);?></td> |
| 124 |
<td><?php echo esc_html($wpsp_tran->bus_name); ?></td> |
| 125 |
<td><?php echo esc_html($wpsp_tran->bus_no);?> </td> |
| 126 |
<td><?php echo esc_html($wpsp_tran->driver_name); ?></td> |
| 127 |
<td><?php echo esc_html($wpsp_tran->phone_no);?></td> |
| 128 |
<td><?php echo esc_html($wpsp_tran->route_fees);?></td> |
| 129 |
<td><?php echo esc_html($wpsp_tran->bus_route);?></td> |
| 130 |
<?php if($current_user_role=='administrator'){?> |
| 131 |
<td align="center"> |
| 132 |
<div class="wpsp-action-col"> |
| 133 |
<a href="javascript:;" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" class="ViewTrans wpsp-popclick" data-pop="ViewModal" title="View"> |
| 134 |
<i class="icon wpsp-view wpsp-view-icon"></i></a> |
| 135 |
<a href="javascript:;" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" class="EditTrans wpsp-popclick" data-pop="ViewModal" title="Edit"> |
| 136 |
<i class="icon wpsp-edit wpsp-edit-icon"></i></a> |
| 137 |
<a href="javascript:;" id="d_teacher" class="wpsp-popclick" data-pop="DeleteModal" title="Delete" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>" > |
| 138 |
<i class="icon wpsp-trash wpsp-delete-icon" data-id="<?php echo esc_attr(intval($wpsp_tran->id));?>"></i></a> |
| 139 |
</div> |
| 140 |
</td> |
| 141 |
<?php }?> |
| 142 |
</tr> |
| 143 |
<?php |
| 144 |
$sno++; |
| 145 |
} |
| 146 |
?> |
| 147 |
</tbody> |
| 148 |
<tfoot> |
| 149 |
<tr> |
| 150 |
<th class="nosort">#</th> |
| 151 |
<th><?php esc_html_e( 'Vehicle Name', 'wpschoolpress' ); ?></th> |
| 152 |
<th><?php esc_html_e( 'Vehicle Number', 'wpschoolpress' ); ?></th> |
| 153 |
<th><?php esc_html_e( 'Driver Name', 'wpschoolpress' ); ?></th> |
| 154 |
<th><?php esc_html_e( 'Driver Phone', 'wpschoolpress' ); ?></th> |
| 155 |
<th><?php esc_html_e( 'Route Fees', 'wpschoolpress' ); ?></th> |
| 156 |
<th><?php esc_html_e( 'Vehicle Route', 'wpschoolpress' ); ?> </th> |
| 157 |
<?php if($current_user_role=='administrator'){?> |
| 158 |
<th class="nosort" align="center"><?php esc_html_e( 'Action', 'wpschoolpress' ); ?></th> |
| 159 |
<?php }?> |
| 160 |
</tr> |
| 161 |
</tfoot> |
| 162 |
</table> |
| 163 |
</div> |
| 164 |
</div> |
| 165 |
<!--Info Modal--> |
| 166 |
<div class="wpsp-popupMain" id="ViewModal"> |
| 167 |
<div class="wpsp-overlayer"></div> |
| 168 |
<div class="wpsp-popBody"> |
| 169 |
<div class="wpsp-popInner"> |
| 170 |
<a href="javascript:;" class="wpsp-closePopup"></a> |
| 171 |
<div id="ViewModalContent" class="wpsp-text-left"></div> |
| 172 |
</div> |
| 173 |
</div> |
| 174 |
</div> |
| 175 |
<?php |
| 176 |
wpsp_body_end(); |
| 177 |
wpsp_footer(); |
| 178 |
} |
| 179 |
} |
| 180 |
else{ |
| 181 |
//Include Login Section |
| 182 |
include_once( WPSP_PLUGIN_PATH .'/includes/wpsp-login.php'); |
| 183 |
} |
| 184 |
?> |
| 185 |
|