hundedaten jetzt korrekt
This commit is contained in:
parent
f7a7c3457b
commit
7779d189df
@ -65,13 +65,10 @@ class Model {
|
||||
{
|
||||
if(isset($this->data[$field]))
|
||||
{
|
||||
error_log($field.' -> '.$options['type']);
|
||||
if($options['type']=='array')
|
||||
$GLOBALS['redis']->hset($this->dbTable.':'.$this->id,$field,json_encode($this->data[$field]));
|
||||
else
|
||||
{
|
||||
|
||||
error_log("hset $this->dbTable:$this->id $field {$this->data[$field]}");
|
||||
$GLOBALS['redis']->hset($this->dbTable.':'.$this->id,$field,$this->data[$field]);
|
||||
}
|
||||
}
|
||||
@ -85,7 +82,7 @@ class Model {
|
||||
{
|
||||
$this->id = $id;
|
||||
if(!$GLOBALS['redis']->exists($this->dbTable.':'.$this->id))
|
||||
return false;
|
||||
throw new Exception($this->dbTable.':'.$this->id.' not found');
|
||||
$keys = array_keys($this->dbFields);
|
||||
|
||||
foreach($keys as $key)
|
||||
|
@ -9,8 +9,8 @@ class Dog extends Model {
|
||||
'kennel_name' => ['type'=>'text'],
|
||||
'breed' => ['type'=>'text'],
|
||||
'size' => ['type'=>'text'], //in cm
|
||||
'birthday' => ['type'=>'int'], //unix timestamp
|
||||
'agility_size' => ['type'=>'int'], //S,M,I,L
|
||||
'birthday' => ['type'=>'text'],
|
||||
'agility_size' => ['type'=>'text'], //S,M,I,L
|
||||
'active' => ['type'=>'int','default'=>1]
|
||||
);
|
||||
|
||||
|
@ -19,14 +19,18 @@ class Dogs extends Page {
|
||||
$dogs = $_SESSION['user']->data['dogs'];
|
||||
$doggos = [];
|
||||
|
||||
foreach($dogs as $dogid)
|
||||
foreach($dogs as $key => $dogid)
|
||||
{
|
||||
//var_dump($dogid);
|
||||
$dog = new Dog();
|
||||
try{
|
||||
$dog->load($dogid);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
error_log("Dog $dogid not found. Deleting from user");
|
||||
unset($_SESSION['user']->data['dogs'][$key]);
|
||||
$_SESSION['user']->save();
|
||||
continue;
|
||||
}
|
||||
if($dog->data)
|
||||
|
@ -1,10 +1,8 @@
|
||||
<h1 class="text-2xl p-6 text-center">Meine Hunde</h1>
|
||||
|
||||
<div class="container flex justify-center mx-auto">
|
||||
<div class="flex flex-col">
|
||||
<div class="w-full">
|
||||
<div class="border-b border-gray-200 shadow">
|
||||
<table class="divide-y divide-gray-300 ">
|
||||
|
||||
<div class="border-b border-gray-200 shadow overflow-x">
|
||||
<table class="divide-y divide-gray-300 table-auto overflow-scroll w-ful">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<?php foreach (array_keys($doggos[0]) as $key) : ?>
|
||||
@ -42,7 +40,4 @@
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -20,7 +20,7 @@
|
||||
<div class="flex flex-col">
|
||||
<div class="w-full">
|
||||
<div class="border-b border-gray-200 shadow">
|
||||
<table class="divide-y divide-gray-300 ">
|
||||
<table class="divide-y divide-gray-300 table-auto overflow-x-scroll w-full">
|
||||
<thead class="bg-gray-50">
|
||||
<tr>
|
||||
<?php foreach (array_keys($userdata[0]) as $key) : ?>
|
||||
|
Reference in New Issue
Block a user