[Bands] Updated edit/create band to include bandgroup, cw/ssb/data qrg
这个提交包含在:
父节点
7a4def1f3d
当前提交
4eae240fb9
共有 5 个文件被更改,包括 70 次插入 和 10 次删除
|
|
@ -65,7 +65,11 @@ class Band extends CI_Controller {
|
|||
$this->load->model('bands');
|
||||
|
||||
$id = $this->security->xss_clean($this->input->post('id', true));
|
||||
$band = $this->security->xss_clean($this->input->post('band', true));
|
||||
$band['band'] = $this->security->xss_clean($this->input->post('band', true));
|
||||
$band['bandgroup'] = $this->security->xss_clean($this->input->post('bandgroup', true));
|
||||
$band['ssbqrg'] = $this->security->xss_clean($this->input->post('ssbqrg', true));
|
||||
$band['dataqrg'] = $this->security->xss_clean($this->input->post('dataqrg', true));
|
||||
$band['cwqrg'] = $this->security->xss_clean($this->input->post('cwqrg', true));
|
||||
|
||||
$this->bands->saveupdatedband($id, $band);
|
||||
echo json_encode(array('message' => 'OK'));
|
||||
|
|
|
|||
|
|
@ -262,7 +262,11 @@ class Bands extends CI_Model {
|
|||
|
||||
function add() {
|
||||
$data = array(
|
||||
'band' => xss_clean($this->input->post('band', true)),
|
||||
'band' => xss_clean($this->input->post('band', true)),
|
||||
'bandgroup' => xss_clean($this->input->post('bandgroup', true)),
|
||||
'ssb' => xss_clean($this->input->post('ssbqrg', true)),
|
||||
'data' => xss_clean($this->input->post('dataqrg', true)),
|
||||
'cw' => xss_clean($this->input->post('cwqrg', true)),
|
||||
);
|
||||
|
||||
$this->db->where('band', xss_clean($this->input->post('band', true)));
|
||||
|
|
@ -283,7 +287,11 @@ class Bands extends CI_Model {
|
|||
|
||||
function saveupdatedband($id, $band) {
|
||||
$data = array(
|
||||
'band' => $band,
|
||||
'band' => $band['band'],
|
||||
'bandgroup' => $band['bandgroup'],
|
||||
'ssb' => $band['ssbqrg'],
|
||||
'data' => $band['dataqrg'],
|
||||
'cw' => $band['cwqrg'],
|
||||
);
|
||||
|
||||
$this->db->where('bands.id', $id);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,26 @@
|
|||
<input type="text" class="form-control" name="band" id="bandInput" aria-describedby="bandInputHelp" required>
|
||||
<small id="bandInputHelp" class="form-text text-muted">Band name</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bandGroup">Bandgroup</label>
|
||||
<input type="text" class="form-control" name="bandgroup" id="bandGroup" aria-describedby="bandgroupInputHelp" required>
|
||||
<small id="bandgroupInputHelp" class="form-text text-muted">Name of bandgroup (E.g. hf, vhf, uhf, shf)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ssbqrg">SSB QRG</label>
|
||||
<input type="text" class="form-control" name="ssbqrg" id="ssbqrg" aria-describedby="ssbqrgInputHelp" required>
|
||||
<small id="ssbqrgInputHelp" class="form-text text-muted">Frequency for SSB QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dataqrg">DATA QRG</label>
|
||||
<input type="text" class="form-control" name="dataqrg" id="dataqrg" aria-describedby="dataqrgInputHelp" required>
|
||||
<small id="dataqrgInputHelp" class="form-text text-muted">Frequency for DATA QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cwqrg">CW QRG</label>
|
||||
<input type="text" class="form-control" name="cwqrg" id="cwqrg" aria-describedby="cwqrgInputHelp" required>
|
||||
<small id="cwqrgInputHelp" class="form-text text-muted">Frequency for CW QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="createBand(this.form);" class="btn btn-primary"><i class="fas fa-plus-square"></i> Create band</button>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,30 @@
|
|||
|
||||
<input type="hidden" name="id" value="<?php echo $my_band->id; ?>">
|
||||
<div class="form-group">
|
||||
<label for="modeInput">Band</label>
|
||||
<label for="bandInput">Band</label>
|
||||
<input type="text" class="form-control" name="band" id="bandInput" aria-describedby="bandInputHelp" value="<?php if(set_value('band') != "") { echo set_value('band'); } else { echo $my_band->band; } ?>" required>
|
||||
<small id="bandInputHelp" class="form-text text-muted">Name of band</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bandGroup">Bandgroup</label>
|
||||
<input type="text" class="form-control" name="bandgroup" id="bandGroup" aria-describedby="bandgroupInputHelp" value="<?php if(set_value('bandgroup') != "") { echo set_value('bandgroup'); } else { echo $my_band->bandgroup; } ?>" required>
|
||||
<small id="bandgroupInputHelp" class="form-text text-muted">Name of bandgroup (E.g. hf, vhf, uhf, shf)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="ssbqrg">SSB QRG</label>
|
||||
<input type="text" class="form-control" name="ssbqrg" id="ssbqrg" aria-describedby="ssbqrgInputHelp" value="<?php echo $my_band->ssb; ?>" required>
|
||||
<small id="ssbqrgInputHelp" class="form-text text-muted">Frequency for SSB QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dataqrg">DATA QRG</label>
|
||||
<input type="text" class="form-control" name="dataqrg" id="dataqrg" aria-describedby="dataqrgInputHelp" value="<?php echo $my_band->data; ?>" required>
|
||||
<small id="dataqrgInputHelp" class="form-text text-muted">Frequency for DATA QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cwqrg">CW QRG</label>
|
||||
<input type="text" class="form-control" name="cwqrg" id="cwqrg" aria-describedby="cwqrgInputHelp" value="<?php echo $my_band->cw; ?>" required>
|
||||
<small id="cwqrgInputHelp" class="form-text text-muted">Frequency for CW QRG in band (must be in Hz)</small>
|
||||
</div>
|
||||
|
||||
<button type="button" onclick="saveUpdatedBand(this.form);" class="btn btn-primary"><i class="fas fa-plus-square"></i> Update band</button>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@
|
|||
</p>
|
||||
<div class="table-responsive">
|
||||
|
||||
<table style="width:100%" class="bandtable table table-striped">
|
||||
<table style="width:100%" class="bandtable table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Band</th>
|
||||
<th>Active</th>
|
||||
<th>CQ</th>
|
||||
<th>DOK</th>
|
||||
<th>DXCC</th>
|
||||
|
|
@ -37,6 +37,10 @@
|
|||
<th>US Counties</th>
|
||||
<th>WAS</th>
|
||||
<th>VUCC</th>
|
||||
<th>Bandgroup</th>
|
||||
<th>SSB QRG</th>
|
||||
<th>DATA QRG</th>
|
||||
<th>CW QRG</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
|
|
@ -46,8 +50,8 @@
|
|||
<tbody>
|
||||
<?php foreach ($bands as $band) { ?>
|
||||
<tr>
|
||||
<td><?php echo $band->band;?></td>
|
||||
<td class='band_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->active == 1) {echo 'checked';}?>></td>
|
||||
<td><?php echo $band->band;?></td>
|
||||
<td class='cq_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->cq == 1) {echo 'checked';}?>></td>
|
||||
<td class='dok_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->dok == 1) {echo 'checked';}?>></td>
|
||||
<td class='dxcc_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->dxcc == 1) {echo 'checked';}?>></td>
|
||||
|
|
@ -57,14 +61,18 @@
|
|||
<td class='uscounties_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->uscounties == 1) {echo 'checked';}?>></td>
|
||||
<td class='was_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->was == 1) {echo 'checked';}?>></td>
|
||||
<td class='vucc_<?php echo $band->id ?>'><input type="checkbox" <?php if ($band->vucc == 1) {echo 'checked';}?>></td>
|
||||
<td><?php echo $band->bandgroup;?></td>
|
||||
<td><?php echo $band->ssb;?></td>
|
||||
<td><?php echo $band->data;?></td>
|
||||
<td><?php echo $band->cw;?></td>
|
||||
<td>
|
||||
<a href="javascript:editBandDialog('<?php echo $band->bandid ?>');" class="btn btn-outline-primary btn-sm"><i class="fas fa-edit"></i> Edit</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>
|
||||
<a href="javascript:deleteBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-danger btn-sm" ><i class="fas fa-trash-alt"></i> Delete</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>
|
||||
<a href="javascript:saveBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-primary btn-sm ld-ext-right btnband_<?php echo $band->id ?>" ><i class="fas fa-save"></i></i> Save<div class="ld ld-ring ld-spin"></div></a>
|
||||
<a href="javascript:saveBand('<?php echo $band->id . '\',\'' . $band->band ?>');" class="btn btn-primary btn-sm ld-ext-right btnband_<?php echo $band->id ?>" title="Save band"><i class="fas fa-save"></i></i><div class="ld ld-ring ld-spin"></div></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
|
|
|||
正在加载…
在新工单中引用