Compare commits
No commits in common. "6dbca7cbd44afeb381536aa7d31913aa8db81755" and "63899ffa8f1db1958ea5f3a2d4799cef1b467e3f" have entirely different histories.
6dbca7cbd4
...
63899ffa8f
@ -130,19 +130,6 @@ class NotesModel extends Database
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNoteCount() {
|
|
||||||
$pdo = $this->linkDB();
|
|
||||||
if (!$pdo) return 0;
|
|
||||||
try {
|
|
||||||
$stmt = $pdo->prepare("SELECT COUNT(*) FROM notes");
|
|
||||||
$stmt->execute();
|
|
||||||
return $stmt->fetchColumn();
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
error_log("Get Notes Count Error: " . $e->getMessage());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function isLoggedIn() {
|
function isLoggedIn() {
|
||||||
return isset($_SESSION['user_id']);
|
return isset($_SESSION['user_id']);
|
||||||
}
|
}
|
||||||
|
@ -69,17 +69,4 @@ class UserModel extends Database
|
|||||||
return ['success' => false, 'message' => 'An error occurred during registration.'];
|
return ['success' => false, 'message' => 'An error occurred during registration.'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserCount() {
|
|
||||||
$pdo = $this->linkDB();
|
|
||||||
if (!$pdo) return 0;
|
|
||||||
try {
|
|
||||||
$stmt = $pdo->prepare("SELECT COUNT(*) FROM users");
|
|
||||||
$stmt->execute();
|
|
||||||
return $stmt->fetchColumn();
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
error_log("Get User Count Error: " . $e->getMessage());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,32 +1,6 @@
|
|||||||
<?php
|
<?php include dirname(__DIR__).'/header.phtml'; ?>
|
||||||
use ppa\Model\NotesModel;
|
|
||||||
include dirname(__DIR__).'/header.phtml';
|
|
||||||
|
|
||||||
$parsedown = new Parsedown();
|
<h2>Baustelle</h2>
|
||||||
$parsedown->setSafeMode(true);
|
|
||||||
|
|
||||||
$this->notesModel = new \ppa\Model\NotesModel();
|
|
||||||
$this->userModel = new \ppa\Model\UserModel();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h2>Willkommen in der Notiz App!</h2>
|
|
||||||
|
|
||||||
<p>Um loszulegen, wählen Sie bitte eine Option aus der Navigation.</p>
|
|
||||||
|
|
||||||
<h2>Notiz App Statistiken</h2>
|
|
||||||
<b style="font-size: 20px; margin: 20px">
|
|
||||||
<?php
|
|
||||||
echo $this->notesModel->getNoteCount();
|
|
||||||
?>
|
|
||||||
Notizen
|
|
||||||
</b><br>
|
|
||||||
|
|
||||||
<b style="font-size: 20px; margin: 20px">
|
|
||||||
<?php
|
|
||||||
echo $this->userModel->getUserCount();
|
|
||||||
?>
|
|
||||||
Benutzer
|
|
||||||
</b>
|
|
||||||
|
|
||||||
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
<?php include dirname(__DIR__).'/footer.phtml'; ?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user