ok for form to add entry for equipment not listed, next save entry and equipment in db

This commit is contained in:
JBthePenguin 2021-06-05 00:30:48 +02:00
parent 5b47a9d0ba
commit cd22b2a759
17 changed files with 178 additions and 25 deletions

View file

@ -6,13 +6,10 @@ use Garradin\DB;
class Category
{
protected $id;
protected $name;
protected $_types = [
'id' => 'int',
'name' => 'string',
];
protected $columns_order = array(
'id',
'name',
);
public function add($data = [])
{

30
src/lib/Entry.php Normal file
View file

@ -0,0 +1,30 @@
<?php
namespace Garradin\Plugin\Materiels;
use Garradin\DB;
class Entry
{
protected $columns_order = array(
'id',
'kind',
'number_of_equipments',
'equipment_id',
'date_of_entry',
);
public function listKinds()
{
return array(
'Achat',
'Don',
'Récupération',
);
}
public function listEquipmentIds()
{
// return $this->kinds;
}
}

16
src/lib/Equipment.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Garradin\Plugin\Materiels;
use Garradin\DB;
class Equipment
{
protected $columns_order = array(
'id',
'category_id',
'localisation_id',
'number_of_equipments',
'designation'
);
}

View file

@ -6,13 +6,10 @@ use Garradin\DB;
class Location
{
protected $id;
protected $name;
protected $_types = [
'id' => 'int',
'name' => 'string',
];
protected $columns_order = array(
'id',
'name',
);
public function add($data = [])
{