This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
memberdb/resources/theme/backend/adminlte/widgets/category-select.blade.php

63 lines
2.2 KiB
PHP
Raw Permalink Normal View History

2017-08-05 23:53:57 +00:00
@php
use App\Models\{Category,Import};
@endphp
@section('category-select')
<div class="col-md-5 col-md-offset-0">
<!-- Default box -->
<div class="box {{isset($co->id) ? 'collapsed-box' : ''}}">
<div class="box-header with-border">
<h3 class="box-title">Select Data to View</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-{{ isset($co->id) ? 'plus' : 'minus' }}"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<form class="form-horizontal">
<div class="form-group">
<label for="category" class="col-sm-2 control-label">Category</label>
<div class="col-sm-7">
<select class="form-control" id="category">
@foreach (Category::active()->orderby('name')->get() as $o)
<option value="{{ $o->id }}" {{ ((isset($co) AND $o->id == $co->id) OR (Auth::user()->category_id == $o->id)) ? 'selected="selected"' : '' }}>{{ $o->name }} ({{ $o->segment->unit->name.':'.$o->segment->name }})</option>
@endforeach
</select>
</div>
</div>
<div class="form-group">
<label for="import" class="col-sm-2 control-label">Import Data</label>
<div class="col-sm-3">
<select class="form-control" id="import">
@foreach (Import::orderby('import_date','DESC')->get() as $o)
<option value="{{ $o->id }}" {{ (isset($io) AND $o->id == $io->id) ? 'selected="selected"' : '' }}>{{ $o->import_date->format('Y-m-d') }}</option>
@endforeach
</select>
</div>
</div>
<div class="box-footer">
<button id="go" class="btn btn-info pull-right">Submit</button>
</div>
</form>
</div>
</div> <!-- /.box -->
</div>
@endsection
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
$("#go").click(function() {
location.replace('{{ url('/category.iot/') }}/'+$('#category').val()+'/'+$('#import').val());
return false;
});
});
</script>
@endsection