Compare commits
16 Commits
b3df3f0b47
...
4f9378899b
Author | SHA1 | Date | |
---|---|---|---|
4f9378899b | |||
031e4957b4 | |||
957cc88a3f | |||
6a26529bbf | |||
ff39c80f27 | |||
e4f3834488 | |||
beec4b8dce | |||
a773b825d0 | |||
69b93bc3f6 | |||
ea11579670 | |||
03449a5c27 | |||
d3f0695866 | |||
83ccd7ec19 | |||
f90974ba09 | |||
36a863eafd | |||
7f80290ff8 |
@ -18,7 +18,7 @@ class CategorieController extends Controller
|
|||||||
|
|
||||||
public static function insCategorie(Request $request)
|
public static function insCategorie(Request $request)
|
||||||
{
|
{
|
||||||
Categorie::inserisci($request['cat_name']);
|
Categorie::inserisci($request);
|
||||||
return view('conti.categorie.list',['categorie'=>Categorie::list()]);
|
return view('conti.categorie.list',['categorie'=>Categorie::list()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class CategorieController extends Controller
|
|||||||
|
|
||||||
public function updatePostCategorie(Request $request)
|
public function updatePostCategorie(Request $request)
|
||||||
{
|
{
|
||||||
Categorie::updateNameById($request['id'],$request['cat_name']);
|
Categorie::updateNameById($request);
|
||||||
return redirect(route('categorie'));
|
return redirect(route('categorie'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,20 +123,6 @@ class MovimentiController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*public function updateMovimenti(Request $request)
|
|
||||||
{
|
|
||||||
$id=$request['id'];
|
|
||||||
$mov=Movimenti::getMovimentoById($id);
|
|
||||||
$categorie=Categorie::list();
|
|
||||||
$tags=tag::getList();
|
|
||||||
return view('conti.movimenti.update',
|
|
||||||
[
|
|
||||||
'categorie'=> $categorie,
|
|
||||||
'movimenti'=> $mov,
|
|
||||||
'tags'=>$tags,
|
|
||||||
]);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public function updatePostMovimenti(Request $request)
|
public function updatePostMovimenti(Request $request)
|
||||||
{
|
{
|
||||||
Movimenti::updateMovimenti($request);
|
Movimenti::updateMovimenti($request);
|
||||||
|
@ -22,16 +22,38 @@ class Categorie extends Model
|
|||||||
|
|
||||||
public static function listSpesa()
|
public static function listSpesa()
|
||||||
{
|
{
|
||||||
return DB::table('categories')->where('cat_uscita','=',1)->get();
|
return DB::table('categories')->where('cat_uscita','=',1)->orderBy('cat_name')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listEntrata()
|
public static function listEntrata()
|
||||||
{
|
{
|
||||||
return DB::table('categories')->where('cat_entrata','=',1)->get();
|
return DB::table('categories')->where('cat_entrata','=',1)->orderBy('cat_name')->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function inserisci($name){
|
public static function inserisci($request){
|
||||||
return DB::table('categories')->insert(['cat_name'=> $name]);
|
if ($request['cat_entrata']==='on')
|
||||||
|
{
|
||||||
|
$entrata=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$entrata=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request['cat_uscita']==='on')
|
||||||
|
{
|
||||||
|
$uscita=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$uscita=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DB::table('categories')->insert([
|
||||||
|
'cat_name'=> $request['cat_name'],
|
||||||
|
'cat_entrata'=>$entrata,
|
||||||
|
'cat_uscita'=>$uscita
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function deleteById($id){
|
public static function deleteById($id){
|
||||||
@ -46,11 +68,31 @@ class Categorie extends Model
|
|||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updateNameById($id,$name) {
|
public static function updateNameById($request) {
|
||||||
|
if ($request['cat_entrata']==='on')
|
||||||
|
{
|
||||||
|
$entrata=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$entrata=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request['cat_uscita']==='on')
|
||||||
|
{
|
||||||
|
$uscita=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$uscita=0;
|
||||||
|
}
|
||||||
|
|
||||||
DB::table('categories')
|
DB::table('categories')
|
||||||
->where('id','=', $id)
|
->where('id','=', $request['id'])
|
||||||
->update([
|
->update([
|
||||||
'cat_name' => $name,
|
'cat_name' => $request['cat_name'],
|
||||||
|
'cat_entrata' => $entrata,
|
||||||
|
'cat_uscita'=>$uscita,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ use Rap2hpoutre\FastExcel\FastExcel;
|
|||||||
class Movimenti extends Model
|
class Movimenti extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
protected $dates = ['mov_data'];
|
||||||
|
protected $casts = [ 'mov_data'=>'datetime'];
|
||||||
|
|
||||||
public static function getList() {
|
public static function getList() {
|
||||||
return DB::table('movimentis')
|
return DB::table('movimentis')
|
||||||
@ -179,7 +181,8 @@ class Movimenti extends Model
|
|||||||
if($line['DARE']<>'')
|
if($line['DARE']<>'')
|
||||||
{
|
{
|
||||||
$dati=[
|
$dati=[
|
||||||
'mov_data'=>self::dateFormat(0,$line['VALUTA']),
|
'mov_data'=>self::dateFormat(0,$line['VALUTA']), // date_format(date_create($movimento->mov_data),'d/m/Y'
|
||||||
|
// 'mov_data'=>date_format(date_create($line['VALUTA']),'Y-m-d'),
|
||||||
'mov_fk_categoria'=>1,
|
'mov_fk_categoria'=>1,
|
||||||
'mov_descrizione'=>$line['DESCRIZIONE OPERAZIONE'],
|
'mov_descrizione'=>$line['DESCRIZIONE OPERAZIONE'],
|
||||||
'mov_importo'=>'-'.trim(str_replace(',','.',(str_replace('.','',$line['DARE'])))),
|
'mov_importo'=>'-'.trim(str_replace(',','.',(str_replace('.','',$line['DARE'])))),
|
||||||
@ -191,6 +194,7 @@ class Movimenti extends Model
|
|||||||
{
|
{
|
||||||
$dati=[
|
$dati=[
|
||||||
'mov_data'=>self::dateFormat(0,$line['VALUTA']),
|
'mov_data'=>self::dateFormat(0,$line['VALUTA']),
|
||||||
|
//'mov_data'=>date_format(date_create($line['VALUTA']),'Y-m-d'),
|
||||||
'mov_fk_categoria'=>1,
|
'mov_fk_categoria'=>1,
|
||||||
'mov_descrizione'=>$line['DESCRIZIONE OPERAZIONE'],
|
'mov_descrizione'=>$line['DESCRIZIONE OPERAZIONE'],
|
||||||
'mov_importo'=>trim(str_replace(',','.',(str_replace('.','',$line['AVERE'])))),
|
'mov_importo'=>trim(str_replace(',','.',(str_replace('.','',$line['AVERE'])))),
|
||||||
@ -216,11 +220,11 @@ class Movimenti extends Model
|
|||||||
|
|
||||||
if($type)
|
if($type)
|
||||||
{
|
{
|
||||||
$string=$string->format('Y-m-d');
|
// $string=$string->format('Y-m-d');
|
||||||
list($year,$month,$day) = explode('-',$string);
|
list($year,$month,$day) = explode('-',$string);
|
||||||
return $day.'/'.$month.'/'.$year;
|
return $day.'/'.$month.'/'.$year;
|
||||||
} else {
|
} else {
|
||||||
$string=$string->format('d/m/Y');
|
// $string=$string->format('d/m/Y');
|
||||||
list($day,$month,$year) =explode('/',$string);
|
list($day,$month,$year) =explode('/',$string);
|
||||||
return $year.'-'.$month.'-'.$day;
|
return $year.'-'.$month.'-'.$day;
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,23 @@ class CategorieSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
// Inserisce le categorie necessarie
|
// Inserisce le categorie necessarie
|
||||||
DB::table('categories')->insert(
|
DB::table('categories')->insert(
|
||||||
['cat_name'=>'Automobili']
|
[
|
||||||
|
'cat_name'=>'Automobili',
|
||||||
|
'cat_uscita'=>1,
|
||||||
|
'cat_entrata'=>0,
|
||||||
|
]
|
||||||
);
|
);
|
||||||
DB::table('categories')->insert(
|
DB::table('categories')->insert(
|
||||||
['cat_name'=>'Stipendio']
|
[
|
||||||
|
'cat_name'=>'Stipendio',
|
||||||
|
'cat_uscita'=>0,
|
||||||
|
'cat_entrata'=>1]
|
||||||
);
|
);
|
||||||
DB::table('categories')->insert(
|
DB::table('categories')->insert(
|
||||||
['cat_name'=>'Utenze']
|
[
|
||||||
|
'cat_name'=>'Utenze',
|
||||||
|
'cat_uscita'=>1,
|
||||||
|
'cat_entrata'=>0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
84
database/seeders/OnlySeeder.php
Normal file
84
database/seeders/OnlySeeder.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Spatie\Permission\Models\Permission;
|
||||||
|
use Spatie\Permission\Models\Role;
|
||||||
|
use Spatie\Permission\PermissionRegistrar;
|
||||||
|
|
||||||
|
class OnlySeeder extends Seeder
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
// Role Creation
|
||||||
|
$role_admin = Role::create([
|
||||||
|
'name' => 'admin'
|
||||||
|
]);
|
||||||
|
$role_user = Role::create([
|
||||||
|
'name' => 'user'
|
||||||
|
]);
|
||||||
|
$role_guest = Role::create([
|
||||||
|
'name' => 'guest'
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Permission Creation
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'conti'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'consumi'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'automobili'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'contatti'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'affitti'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'progetti'
|
||||||
|
]);
|
||||||
|
Permission::create([
|
||||||
|
'name' => 'amministrazione'
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Assegnazione permessi al ruolo user
|
||||||
|
$role_user->givePermissionTo('affitti');
|
||||||
|
$role_user->givePermissionTo('automobili');
|
||||||
|
$role_user->givePermissionTo('contatti');
|
||||||
|
$role_user->givePermissionTo('consumi');
|
||||||
|
$role_user->givePermissionTo('conti');
|
||||||
|
$role_user->givePermissionTo('progetti');
|
||||||
|
// Assegnazione permessi al ruolo guest
|
||||||
|
$role_guest->givePermissionTo('affitti');
|
||||||
|
// Il ruolo admin ha già tutti i permessi da middleware
|
||||||
|
|
||||||
|
$admin = User::create([
|
||||||
|
'name'=>'Amministratore',
|
||||||
|
'email'=>'admin@localhost.local',
|
||||||
|
'password'=>Hash::make('admin'),
|
||||||
|
])->assignRole('admin');
|
||||||
|
|
||||||
|
$user = User::create([
|
||||||
|
'name'=>'Utente',
|
||||||
|
'email'=>'user@localhost.local',
|
||||||
|
'password'=>Hash::make('user'),
|
||||||
|
])->assignRole('user');
|
||||||
|
|
||||||
|
$guest = User::create([
|
||||||
|
'name'=>'Guest',
|
||||||
|
'email'=>'guest@localhost.local',
|
||||||
|
'password'=>Hash::make('guest'),
|
||||||
|
])->assignRole('guest');
|
||||||
|
}
|
||||||
|
}
|
21
public/js/app/conti_categorie.js
vendored
21
public/js/app/conti_categorie.js
vendored
@ -13,19 +13,38 @@ $(document).ready(function() {
|
|||||||
responsive: true
|
responsive: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click','.open_modal',function(){
|
$(document).on('click','.open_modal',function(){
|
||||||
var url = "/admin/categorie/modify";
|
var url = "/admin/categorie/modify";
|
||||||
var riga_id= $(this).val();
|
var riga_id= $(this).val();
|
||||||
$.getJSON(url + '/' + riga_id, function (data) {
|
$.getJSON(url + '/' + riga_id, function (data) {
|
||||||
//success data
|
//success data
|
||||||
|
$('#cat_entrata').prop('checked', false);
|
||||||
|
$('#cat_uscita').prop('checked', false);
|
||||||
|
|
||||||
|
|
||||||
console.log(data[0]);
|
console.log(data[0]);
|
||||||
console.log(data[0].cat_name);
|
console.log(data[0].cat_name);
|
||||||
$('#H_cat_cat_name').val(data[0].cat_name);
|
|
||||||
|
|
||||||
|
|
||||||
|
if (data[0].cat_uscita === 1)
|
||||||
|
{
|
||||||
|
// $('.myCheckbox').prop('checked', true);
|
||||||
|
$('#cat_uscita').prop('checked', true);
|
||||||
|
}
|
||||||
|
if (data[0].cat_entrata ===1)
|
||||||
|
{
|
||||||
|
$('#cat_entrata').prop('checked', true);
|
||||||
|
}
|
||||||
$('#H_cat_id').val(data[0].id);
|
$('#H_cat_id').val(data[0].id);
|
||||||
|
$('#H_cat_cat_name').val(data[0].cat_name);
|
||||||
$('#myModal').modal('show');
|
$('#myModal').modal('show');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click','.open_modal_new',function(){
|
$(document).on('click','.open_modal_new',function(){
|
||||||
|
console.log('richiesto apertura form');
|
||||||
$('#myModal_new').modal('show');
|
$('#myModal_new').modal('show');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
108
public/js/app/movimenti.js
vendored
108
public/js/app/movimenti.js
vendored
@ -24,24 +24,32 @@ var strDate = d.getFullYear() + '-' +
|
|||||||
$(document).on('click', '.open_modal_spesa', function() {
|
$(document).on('click', '.open_modal_spesa', function() {
|
||||||
console.log(strDate);
|
console.log(strDate);
|
||||||
$("#categoria").empty();
|
$("#categoria").empty();
|
||||||
|
$("#tags").empty();
|
||||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
||||||
$('#form').find('input[type="date"]').val(strDate);
|
$('#form').find('input[type="date"]').val(strDate);
|
||||||
$('#myModal').modal('show');
|
$('#myModal').modal('show');
|
||||||
$('.modal-title').text(' Nuovo movimento in uscita');
|
$('.modal-title').text(' Nuovo movimento in uscita');
|
||||||
$('#form').attr('action', '/admin/movimenti/spesa');
|
$('#form').attr('action', '/admin/movimenti/spesa');
|
||||||
$.getJSON("/admin/service/catlistSpesa", {}, function(data) {
|
$.getJSON("/admin/service/catlistSpesa", {}, function(cats) {
|
||||||
$.each(data, function(i, item) {
|
$.each(cats, function(i, cat) {
|
||||||
$("select[name='mov_fk_categoria']").append(
|
$("select[name='mov_fk_categoria']").append(
|
||||||
new Option(item.cat_name, item.id)
|
new Option(cat.cat_name, cat.id)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
||||||
|
$.each(tags, function(i, tag) {
|
||||||
|
$("select[name='mov_fk_tags']").append(
|
||||||
|
new Option(tag.tag_name, tag.id)
|
||||||
|
)
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('click', '.open_modal_entrata', function() {
|
$(document).on('click', '.open_modal_entrata', function() {
|
||||||
console.log(strDate);
|
console.log(strDate);
|
||||||
$("#categoria").empty();
|
$("#categoria").empty();
|
||||||
|
$("#tags").empty();
|
||||||
$('#form').find('input[type="text"], textarea, input[type="number"],option').val("");
|
$('#form').find('input[type="text"], textarea, input[type="number"],option').val("");
|
||||||
$('#form').find('input[type="date"]').val(strDate);
|
$('#form').find('input[type="date"]').val(strDate);
|
||||||
$('#myModal').modal('show');
|
$('#myModal').modal('show');
|
||||||
@ -55,44 +63,6 @@ $(document).on('click', '.open_modal_entrata', function() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('click', '.open_modal_modifica', function() {
|
|
||||||
var url = "/admin/movimenti/modify";
|
|
||||||
var riga_id = $(this).val();
|
|
||||||
$("#categoria").empty();
|
|
||||||
$.getJSON(url + '/' + riga_id, function(data) {
|
|
||||||
// success data
|
|
||||||
console.log(data[0]);
|
|
||||||
$('.modal-title').text('Modifica movimento');
|
|
||||||
$('#data').val(data[0].mov_data);
|
|
||||||
$('#descrizione').val(data[0].mov_descrizione);
|
|
||||||
$('#importo').val(data[0].mov_importo);
|
|
||||||
$('#tags')
|
|
||||||
.find('option:contains(' + data[0].tag_name + ')')
|
|
||||||
.prop('selected', true)
|
|
||||||
.trigger('change');
|
|
||||||
$('#categoria')
|
|
||||||
.find('option:contains(' + data[0].cat_name + ')')
|
|
||||||
.prop('selected', true)
|
|
||||||
.trigger('change');
|
|
||||||
$('#myModal').modal('show');
|
|
||||||
// $('.panel-heading').text('Modifica movimento');
|
|
||||||
$('#form').attr('action', '/admin/movimenti/modify');
|
|
||||||
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$.getJSON("/admin/service/catlist", {}, function(data) {
|
|
||||||
$.each(data, function(i, item) {
|
|
||||||
$("select[name='mov_fk_categoria']").append(
|
|
||||||
new Option(item.cat_name, item.id)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||||
$.each(data, function(i, item) {
|
$.each(data, function(i, item) {
|
||||||
$("select[name='mov_fk_tags']").append(
|
$("select[name='mov_fk_tags']").append(
|
||||||
@ -100,3 +70,57 @@ $.getJSON("/admin/service/taglist", {}, function(data) {
|
|||||||
)
|
)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.open_modal_modifica', function() {
|
||||||
|
var url = "/admin/movimenti/modify";
|
||||||
|
var riga_id = $(this).val();
|
||||||
|
$("#categoria").empty();
|
||||||
|
$("#tags").empty();
|
||||||
|
$.getJSON(url + '/' + riga_id, function(data) {
|
||||||
|
// success data
|
||||||
|
console.log(data[0]);
|
||||||
|
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
||||||
|
$.each(tags, function(i, tag) {
|
||||||
|
$("select[name='mov_fk_tags']").append(
|
||||||
|
new Option(tag.tag_name, tag.id)
|
||||||
|
)
|
||||||
|
$('#tags')
|
||||||
|
.find('option:contains(' + data[0].tag_name + ')')
|
||||||
|
.prop('selected', true)
|
||||||
|
.trigger('change');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$.getJSON("/admin/service/catlist", {}, function(cats) {
|
||||||
|
$.each(cats, function(i, cat) {
|
||||||
|
$("select[name='mov_fk_categoria']").append(
|
||||||
|
new Option(cat.cat_name, cat.id)
|
||||||
|
)
|
||||||
|
$('#categoria')
|
||||||
|
.find('option:contains(' + data[0].cat_name + ')')
|
||||||
|
.prop('selected', true)
|
||||||
|
.trigger('change');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
$('.modal-title').text('Modifica movimento');
|
||||||
|
$('#data').val(data[0].mov_data);
|
||||||
|
$('#descrizione').val(data[0].mov_descrizione);
|
||||||
|
$('#importo').val(data[0].mov_importo);
|
||||||
|
|
||||||
|
$('#myModal').modal('show');
|
||||||
|
// $('.panel-heading').text('Modifica movimento');
|
||||||
|
$('#form').attr('action', '/admin/movimenti/modify');
|
||||||
|
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
/*$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||||
|
$.each(data, function(i, item) {
|
||||||
|
$("select[name='mov_fk_tags']").append(
|
||||||
|
new Option(item.tag_name, item.id)
|
||||||
|
)
|
||||||
|
});
|
||||||
|
});*/
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Categoria</th>
|
<th>Categoria</th>
|
||||||
|
<th>Classificazione</th>
|
||||||
<th>Azione</th>
|
<th>Azione</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -30,6 +31,14 @@
|
|||||||
<td><a
|
<td><a
|
||||||
href="movimenti/report/movimentibycat?cat={{ $categoria->id }}">{{
|
href="movimenti/report/movimentibycat?cat={{ $categoria->id }}">{{
|
||||||
$categoria->cat_name; }}</a></td>
|
$categoria->cat_name; }}</a></td>
|
||||||
|
<td>
|
||||||
|
@if($categoria->cat_entrata == 1)
|
||||||
|
Entrata ,
|
||||||
|
@endif
|
||||||
|
@if($categoria->cat_uscita == 1)
|
||||||
|
Uscita
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-warning btn-detail open_modal"
|
<button class="btn btn-warning btn-detail open_modal"
|
||||||
value="{{$categoria->id}}">Edit</button> <a
|
value="{{$categoria->id}}">Edit</button> <a
|
||||||
@ -47,23 +56,39 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<!-- MODAL MODIFICA -->
|
<!-- MODAL MODIFICA -->
|
||||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
|
||||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
|
<form action="/admin/categorie/modify" method="POST">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">Modifica Categoria</h4>
|
<h4 class="modal-title">Modifica Categoria</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<form action="/admin/categorie/modify" method="POST">
|
|
||||||
@csrf <label for="H_cat_cat_name" class="form-label">Categoria</label>
|
|
||||||
<input type="text" class="form-control" id="H_cat_cat_name"
|
|
||||||
size="50" name="cat_name" value="" size="50">
|
|
||||||
|
|
||||||
|
@csrf
|
||||||
|
<label for="H_cat_cat_name" class="form-label">Categoria</label>
|
||||||
|
<input type="text" class="form-control" id="H_cat_cat_name" size="50" name="cat_name">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="cat_entrata" name="cat_entrata" >
|
||||||
|
<label class="form-check-label" for="cat_entrata">Entrata</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="cat_uscita" name="cat_uscita">
|
||||||
|
<label class="form-check-label" for="cat_uscita">Uscita</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -71,14 +96,14 @@
|
|||||||
<input type="hidden" name="id" id="H_cat_id">
|
<input type="hidden" name="id" id="H_cat_id">
|
||||||
<button type="submit" class="btn btn-primary">Modifica</button>
|
<button type="submit" class="btn btn-primary">Modifica</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- FINE MODAL MODIFICA -->
|
<!-- FINE MODAL MODIFICA -->
|
||||||
<!-- MODAL INSERIMENTO -->
|
<!-- MODAL INSERIMENTO -->
|
||||||
<div class="modal fade" id="myModal_new" tabindex="-1" role="dialog"
|
<div class="modal fade" id="myModal_new" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||||
aria-labelledby="myModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog" role="document">
|
<div class="modal-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@ -89,11 +114,26 @@
|
|||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<!-- FORM INSERIMENTO NUOVA CATEGORIA -->
|
<!-- FORM INSERIMENTO NUOVA CATEGORIA -->
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
@csrf <label for="categoria" class="form-label">Categoria</label>
|
@csrf
|
||||||
|
<label for="categoria" class="form-label">Categoria</label>
|
||||||
<input type="text" class="form-control" id="categoria"
|
<input type="text" class="form-control" id="categoria"
|
||||||
name="cat_name" size="50">
|
name="cat_name" size="50">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="cat_entrata" name="cat_entrata" >
|
||||||
|
<label class="form-check-label" for="cat_entrata">Entrata</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" role="switch" id="cat_uscita" name="cat_uscita">
|
||||||
|
<label class="form-check-label" for="cat_uscita">Uscita</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@ -103,11 +143,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- FINE MODAL INSERIMENTO -->
|
<!-- FINE MODAL INSERIMENTO -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- /.col-lg-12 -->
|
<!-- /.col-lg-12 -->
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -123,6 +123,7 @@ Route::group(['middleware'=>['permission:amministrazione']], function(){
|
|||||||
Route::post('users/new',[Utenti::class,'createUser']);
|
Route::post('users/new',[Utenti::class,'createUser']);
|
||||||
Route::get('users/roles',[Utenti::class,'listRoles']);
|
Route::get('users/roles',[Utenti::class,'listRoles']);
|
||||||
Route::get('users/delete/{id}',[Utenti::class,'deleteUser']);
|
Route::get('users/delete/{id}',[Utenti::class,'deleteUser']);
|
||||||
|
//});
|
||||||
Route::get('users/givepermission',[Utenti::class,'givePermissionToUser']);
|
Route::get('users/givepermission',[Utenti::class,'givePermissionToUser']);
|
||||||
Route::post('users/givepermission',[Utenti::class,'assignPermission']);
|
Route::post('users/givepermission',[Utenti::class,'assignPermission']);
|
||||||
Route::get('users/giverole',[Utenti::class,'giveRoleToUser']);
|
Route::get('users/giverole',[Utenti::class,'giveRoleToUser']);
|
||||||
|
Loading…
Reference in New Issue
Block a user