public function __construct($conn, $id) { $sql_get_assignment = "SELECT * FROM assignments a, contexts c WHERE c.context_id = a.context_id AND c.context_id = " . $id; $assignment = mysqli_query($conn, $sql_get_assignment); if ($assignment != false && mysqli_num_rows($assignment) != 0) { $assignment_pole = mysqli_fetch_array($assignment); parent::__construct($conn, $assignment_pole['context_id'], Organisator::getFromDatabaseByID($conn, $assignment_pole['user_id'])); $this->timeOfPublishing = $assignment_pole['begin']; $this->deadline = $assignment_pole['end']; $this->text_id_name = $assignment_pole['text_id_name']; $this->text_id_desc = $assignment_pole['text_id_description']; $sql_get_text = "SELECT * FROM texts WHERE text_id = " . $this->text_id_name; $text = mysqli_query($conn, $sql_get_text); if ($text != false) { $text_pole = mysqli_fetch_array($text); $this->name_sk = $text_pole['sk']; $this->name_eng = $text_pole['eng']; } $sql_get_text = "SELECT * FROM texts WHERE text_id = " . $this->text_id_desc; $text = mysqli_query($conn, $sql_get_text); if ($text != false) { $text_pole = mysqli_fetch_array($text); $this->text_sk = $text_pole['sk']; $this->text_eng = $text_pole['eng']; } $this->setSolutions($conn); } else { $this->name_sk = "Nové zadanie"; $this->name_eng = "New assignment"; } }
public function __construct($id, $mail, $validated) { parent::__construct($id, $mail); $this->validated = $validated; }
public function __construct($id, $mail) { parent::__construct($id, $mail, true); }