kopia lustrzana https://github.com/magicbug/Cloudlog
[Labels] Added custom papertypes to create label
rodzic
41cd48f13d
commit
d76e7e74d5
|
@ -71,6 +71,9 @@ class Labels extends CI_Controller {
|
|||
$data['page_title'] = "Create Label Type";
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('labels_model');
|
||||
|
||||
$data['papertypes'] = $this->labels_model->fetchPapertypes($this->session->userdata('user_id'));
|
||||
|
||||
$this->form_validation->set_rules('label_name', 'Label Name', 'required');
|
||||
|
||||
|
|
|
@ -28,8 +28,16 @@
|
|||
<label class="col-sm-2 col-form-label" for="paperType">Paper Type</label>
|
||||
<div class="col-sm-4">
|
||||
<select name="paper_type" class="form-control" id="paperType">
|
||||
<option value="a3">A3</option>
|
||||
<option value="a5">A5</option>
|
||||
<option value="a4">A4</option>
|
||||
<option value="letter">Letter</option>
|
||||
<option value="legal">Legal</option>
|
||||
<?php
|
||||
foreach($papertypes as $paper){
|
||||
echo '<option value=' . $paper->paper_name . '>' . ucwords(strtolower(($paper->paper_name))) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
<option value="legal" <?php if($label->paper_type == "legal") { echo "selected=\"selected\""; } ?>>Legal</option>
|
||||
<?php
|
||||
foreach($papertypes as $paper){
|
||||
echo '<option value=' . $paper->paper_name . '>' . ucwords(strtolower(($paper->paper_name))) . '</option>';
|
||||
echo '<option value="' . $paper->paper_name . '"';
|
||||
if ($label->paper_type == $paper->paper_name) echo ' selected';
|
||||
echo '>' . ucwords(strtolower(($paper->paper_name))) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
|
Ładowanie…
Reference in New Issue