smart menu things
All checks were successful
Build and push / Pulling repo on server (push) Successful in 2s

This commit is contained in:
2023-10-23 14:36:28 +02:00
parent 88ec74af75
commit 9f3aab4033
5 changed files with 66 additions and 27 deletions

View File

@ -1,17 +1,31 @@
<?php
<?php
class Dog extends Model {
class Dog extends Model
{
protected $dbTable = "dogs";
protected $dbFields = Array (
'uuid' => ['type'=>'text','required','unique','autoValMethod'=>'gen_ulid'],
'registered' => ['type'=>'datetime','required','unique','autoValMethod'=>'getDateTime'],
'name' => ['type'=>'text'],
'kennel_name' => ['type'=>'text'],
'breed' => ['type'=>'text'],
'size' => ['type'=>'text'], //in cm
'birthday' => ['type'=>'text'],
'agility_size' => ['type'=>'text'], //S,M,I,L
'active' => ['type'=>'int','default'=>1]
protected $dbFields = array(
'uuid' => ['type' => 'text', 'required', 'unique', 'autoValMethod' => 'gen_ulid'],
'registered' => ['type' => 'datetime', 'required', 'unique', 'autoValMethod' => 'getDateTime'],
'name' => ['type' => 'text'],
'kennel_name' => ['type' => 'text'],
'breed' => ['type' => 'text'],
'size' => ['type' => 'text'], //in cm
'birthday' => ['type' => 'text'],
'agility_size' => ['type' => 'text'], //S,M,I,L
'active' => ['type' => 'int', 'default' => 1]
);
}
function isMyDog($dog = false)
{
if ($dog == false)
$dog = $this->id;
if (!$this->exists($dog))
return false;
else {
if (in_array($dog, $_SESSION['user']->data['dogs']))
return true;
else return false;
}
}
}