Fixes #367 - added model number to dropdown

This commit is contained in:
snipe
2014-11-21 05:20:08 -05:00
parent 1b41c974cf
commit 89a2b87e42
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -94,7 +94,14 @@ class AssetsController extends AdminController
{
// Grab the dropdown list of models
$model_list = array('' => '') + Model::orderBy('name', 'asc')->lists('name', 'id');
//$model_list = array('' => 'Select a Model') + Model::orderBy('name', 'asc')->lists('name'.' '. 'modelno', 'id');
$model_list = array('' => 'Select a Model') + DB::table('models')
->select(DB::raw('concat(name," / ",modelno) as name, id'))->orderBy('name', 'asc')
->orderBy('modelno', 'asc')
->lists('name', 'id');
$supplier_list = array('' => '') + Supplier::orderBy('name', 'asc')->lists('name', 'id');
$assigned_to = array('' => 'Select a User') + DB::table('users')->select(DB::raw('concat (first_name," ",last_name) as full_name, id'))->whereNull('deleted_at')->lists('full_name', 'id');
$location_list = array('' => '') + Location::orderBy('name', 'asc')->lists('name', 'id');
+1 -1
View File
@@ -80,7 +80,7 @@
<i class='icon-asterisk'></i></label>
</label>
<div class="col-md-7">
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ Form::select('model_id', $model_list , Input::old('model_id', $asset->model_id), array('class'=>'select2', 'style'=>'min-width:400px')) }}
{{ $errors->first('model_id', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}
</div>
</div>