mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 10:49:10 -04:00
new instance for 227
This commit is contained in:
86
resources/views/admin/inventory/add.blade.php
Normal file
86
resources/views/admin/inventory/add.blade.php
Normal file
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.admin.main')
|
||||
|
||||
@section('content')
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header card-header-primary">
|
||||
<h4>Ajouter un item à l'inventaire</h4>
|
||||
</div>
|
||||
<div class="card-body mt-5">
|
||||
<form action="/admin/item/add" method="post">
|
||||
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Numéro d'article</label>
|
||||
<input name="official_number" type="text" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Nom de l'article</label>
|
||||
<input name="name" type="text" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Taille de l'article</label>
|
||||
<input name="metadata-size" type="text" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Quantité disponible</label>
|
||||
<input name="quantity" type="number" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Catégorie</label>
|
||||
<select name="category_id" class="form-control selectpicker" required>
|
||||
@foreach($categories as $category)
|
||||
<option value="{{$category->id}}">{{$category->name}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12 mt-4">
|
||||
<label for="desc">Description de l'image</label>
|
||||
<div class="form-group">
|
||||
<textarea name="desc" id="desc" class="form-control" required></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<button type="submit" class="btn btn-primary">Sauvegarder</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@section('custom_scripts')
|
||||
<script>
|
||||
$('#desc').trumbowyg({
|
||||
lang: 'fr'
|
||||
});
|
||||
function saveChange(pPerm) {
|
||||
(function($) {
|
||||
var myswitch = document.getElementById(pPerm);
|
||||
$.post('/api/config/general/save?api_token='+api_token, { value: myswitch.checked,perm: pPerm } , function(data) {
|
||||
swal({
|
||||
title: 'Modification enregistré !',
|
||||
type: 'success',
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
});
|
||||
})(jQuery);
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -13,19 +13,26 @@
|
||||
<table id="log-data" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Quantité</th>
|
||||
<th>#</th>
|
||||
<th>Nom</th>
|
||||
<th>Categorie</th>
|
||||
<th>Description</th>
|
||||
<th></th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($items as $item)
|
||||
<tr>
|
||||
<td style="width:5%;">{{$item->quantity}}</td>
|
||||
<td>{{$item->official_number}}</td>
|
||||
<td>{{$item->name}}</td>
|
||||
<td>{{$item->desc}}</td>
|
||||
<td style="width: 12%;"><a href="/admin/item/edit/{{$item->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a><a type="button" class="btn btn-danger" onclick="deleteEvent({{$item->id}});"><i class="fa fa-times-circle" style="color:white;"></i></a></td>
|
||||
<td>{{$item->category()->name}}</td>
|
||||
<td>{!! $item->desc !!}</td>
|
||||
<td style="width: 12%;">
|
||||
<div class="btn-group">
|
||||
<a href="/admin/item/edit/{{$item->id}}" type="button" class="btn btn-secondary"><i class="fa fa-cog"></i> Modifier</a>
|
||||
<a type="button" class="btn btn-danger" onclick="deleteEvent({{$item->id}});"><i class="fa fa-times-circle" style="color:white;"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@@ -58,13 +65,16 @@
|
||||
@endsection
|
||||
|
||||
@section('custom_scripts')
|
||||
|
||||
<script src="https://cdn.datatables.net/rowgroup/1.1.0/js/dataTables.rowGroup.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$(document).ready(function() {
|
||||
$('#log-data').DataTable({
|
||||
"order": [[ 0, "desc" ]],
|
||||
"order": [[ 2, "asc" ]],
|
||||
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
|
||||
"rowGroup": {
|
||||
dataSrc: 2
|
||||
}
|
||||
});
|
||||
} );
|
||||
})(jQuery);
|
||||
|
||||
Reference in New Issue
Block a user