[Bands] Don't show create or edit buttons for users who arent admin
这个提交包含在:
父节点
eecd2bf71d
当前提交
291d75f0fe
共有 2 个文件被更改,包括 7 次插入 和 0 次删除
|
|
@ -13,6 +13,7 @@ class Band extends CI_Controller {
|
||||||
|
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
|
||||||
|
print_r($this->session->userdata('user_type'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,10 @@ $wwff = 0;
|
||||||
<th>SSB QRG</th>
|
<th>SSB QRG</th>
|
||||||
<th>DATA QRG</th>
|
<th>DATA QRG</th>
|
||||||
<th>CW QRG</th>
|
<th>CW QRG</th>
|
||||||
|
<?php if($this->session->userdata('user_type') == '99') { ?>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -77,12 +79,14 @@ $wwff = 0;
|
||||||
<td><?php echo $band->ssb;?></td>
|
<td><?php echo $band->ssb;?></td>
|
||||||
<td><?php echo $band->data;?></td>
|
<td><?php echo $band->data;?></td>
|
||||||
<td><?php echo $band->cw;?></td>
|
<td><?php echo $band->cw;?></td>
|
||||||
|
<?php if($this->session->userdata('user_type') == '99') { ?>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:editBandDialog('<?php echo $band->bandid ?>');" class="btn btn-outline-primary btn-sm" title="Edit"><i class="fas fa-edit"></i></a>
|
<a href="javascript:editBandDialog('<?php echo $band->bandid ?>');" class="btn btn-outline-primary btn-sm" title="Edit"><i class="fas fa-edit"></i></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:deleteBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-danger btn-sm" title="Delete"><i class="fas fa-trash-alt"></i></a>
|
<a href="javascript:deleteBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-danger btn-sm" title="Delete"><i class="fas fa-trash-alt"></i></a>
|
||||||
</td>
|
</td>
|
||||||
|
<?php } ?>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
@ -111,9 +115,11 @@ $wwff = 0;
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<p>
|
<p>
|
||||||
|
<?php if($this->session->userdata('user_type') == '99') { ?>
|
||||||
<button onclick="createBandDialog();" class="btn btn-primary btn-sm"><i class="fas fa-plus"></i> Create a Band</button>
|
<button onclick="createBandDialog();" class="btn btn-primary btn-sm"><i class="fas fa-plus"></i> Create a Band</button>
|
||||||
<button onclick="activateAllBands();" class="btn btn-primary btn-sm">Activate All</button>
|
<button onclick="activateAllBands();" class="btn btn-primary btn-sm">Activate All</button>
|
||||||
<button onclick="deactivateAllBands();" class="btn btn-primary btn-sm">Deactivate All </button>
|
<button onclick="deactivateAllBands();" class="btn btn-primary btn-sm">Deactivate All </button>
|
||||||
|
<?php } ?>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用