Jump to content
AJCWebServices

Add to pilot list in Admin

Recommended Posts

Hi all

I would like to add which group a pilot belongs to in the pilot list in the admin section. I have had a go but no luck unfortunately. Can anyone please advise how to do it. I would like it to be beside Last Name

Thanks in advance

 

<h3>Pilots List</h3>

<table id="grid"></table>
<div id="pager"></div>
<br />

<link rel="stylesheet" type="text/css" media="screen" href="<?php echo fileurl('/lib/js/jqgrid/css/ui.jqgrid.css');?>" />
<script src="<?php echo fileurl('/lib/js/jqgrid/js/i18n/grid.locale-en.js');?>" type="text/javascript"></script>
<script src="<?php echo fileurl('/lib/js/jqgrid/js/jquery.jqGrid.min.js');?>" type="text/javascript"></script>

<script type="text/javascript">
$("#grid").jqGrid({
   url: '<?php echo adminaction('/pilotadmin/getpilotsjson');?>',
   datatype: 'json',
   mtype: 'GET',
   colNames: ['','Pilot ID', 'First', 'Last', 'Email', 'Location', 'Status', 'Rank', 'Flights', 'Hours', 'IP', 'Edit'],
   colModel : [
		{index: 'id', name: 'id', hidden: true, search: false },
		{index: 'pilotid', name : 'pilotid',sortable : true, align: 'left', search: 'true', searchoptions:{sopt:['in']}},
		{index: 'firstname', name : 'firstname',sortable : true, align: 'left', search: 'true', searchoptions:{sopt:['in']}},
		{index: 'lastname', name : 'lastname',  sortable : true, align: 'left', searchoptions:{sopt:['in']}},
		{index: 'email', name : 'email', sortable : true, align: 'left',searchoptions:{sopt:['li']}},
		{index: 'location', name : 'location',  sortable : true, align: 'center',searchoptions:{sopt:['eq','ne']}},
		{index: 'status', name : 'status', sortable : true, align: 'center',searchoptions:{sopt:['in']}},
		{index: 'rank', name : 'rank', sortable : true, align: 'center', searchoptions:{sopt:['eq','ne']}},
		{index: 'totalflights', name : 'totalflights', sortable : true, align: 'center',searchoptions:{sopt:['lt','gt']}},
		{index: 'totalhours', name : 'totalhours', sortable : true, align: 'center',searchoptions:{sopt:['lt','gt']}},
		{index: 'lastip', name : 'lastip', sortable : true, align: 'center', searchoptions:{sopt:['in']}},
		{index: '', name : '', sortable : true, align: 'center', search: false}
	],
    pager: '#pager', rowNum: 25,
    sortname: 'pilotid', sortorder: 'asc',
    viewrecords: true, autowidth: true,
    height: '100%'
});

jQuery("#grid").jqGrid('navGrid','#pager', 
	{edit:false,add:false,del:false,search:true,refresh:true},
	{}, // edit 
	{}, // add 
	{}, //del 
	{multipleSearch:true} // search options 
); 
</script>

 

Share this post


Link to post
Share on other sites

Each pilot can be part of multiple groups, do you want to show all the groups the pilot is assigned to?

Share this post


Link to post
Share on other sites
7 hours ago, servetas said:

Each pilot can be part of multiple groups, do you want to show all the groups the pilot is assigned to?

Hi @servetas,

I thought about that afterwards and dont really want to show them all. What I was really trying to achieve was to keep a check on who had admin rights and I thought this was probably the best way. I guess the better way would be a module for the admin center showing who belongs to each group, but that would probably be a big job.

 

Thanks for the reply

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×