This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
class star {
var $bean;
var $bean_id;
var $user_id;
var $db;
var $starExists;
function start() {}
function star($bean, $bean_id, $user_id) {
$this->bean = $bean;
$this->bean_id = $bean_id;
$this->user_id = $user_id;
$db = $GLOBALS['db'];
$starExists = $this->checkStar();
}
private function checkStar() {
$w = $this->db->query("SELECT * FROM stars WHERE
bean = '$this->bean' AND
bean_id = '$this->bean_id' AND
user_id = '$this->user_id");
if ($w->num_rows == 0)
return false;
else
return true;
}
private function createStar() {
if ($this->starExists == false) return;
$this->db->query("INSERT INTO stars VALUES ('$this->bean','$this->bean_id','$this->user_id')");
}
private function deleteStar() {
if ($this->starExists == true) return;
//$this->db->query("");
}
}
?>