Files
crm.e5.pl/include/ECM/star.class.php

46 lines
902 B
PHP
Raw Normal View History

2024-04-27 09:23:34 +02:00
<?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("");
}
}
?>