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($conn, $id, $author, $assignment) { parent::__construct($conn, $id, $author); $sql_get_solution = "SELECT * FROM solutions WHERE context_id = " . $id; $solution = mysqli_query($conn, $sql_get_solution); if ($solution != false) { $solution_pole = mysqli_fetch_array($solution); $this->text = $solution_pole['text']; $this->best = $solution_pole['best']; $this->assignment = $assignment; $this->id = $id; $this->author = $author; if (is_null($this->assignment)) { $selectAssignmentId = "SELECT assignment_id FROM solutions WHERE context_id = {$this->id}"; if ($result = mysqli_query($conn, $selectAssignmentId)) { if ($row = mysqli_fetch_array($result)) { $this->assignment = new Assignment($conn, $row['assignment_id']); } } } $sql_get_comment = "SELECT * FROM comments WHERE solution_id = " . $id; $comment = mysqli_query($conn, $sql_get_comment); if ($comment != false) { $comments = array(); while ($comments_pole = mysqli_fetch_array($comment)) { $comments[] = new Comment($conn, $comments_pole['comment_id'], $this->id, $comments_pole['user_id'], $comments_pole['text'], $comments_pole['points']); } $this->setComments($comments); } } }
/** * @param string $baseUrl * @param string $areaType * @param string $themePath * @param string $localeCode */ public function __construct($baseUrl, $areaType, $themePath, $localeCode) { $this->area = $areaType; $this->theme = $themePath; $this->locale = $localeCode; parent::__construct($baseUrl, \Magento\Framework\App\Filesystem::STATIC_VIEW_DIR, $this->generatePath()); }
public function __construct($href, $text = null) { parent::__construct("link"); $this->dict['href'] = (string) $href; if (!empty($text)) { $this->dict['text'] = (string) $text; } }
public function __construct() { parent::__construct(); if (array_key_exists('argv', $_SERVER)) { foreach ($_SERVER['argv'] as $key => $value) { $this->setParam($key, $this->cleanString($value)); } } }
public function __construct($src, $href = null, $text = null) { parent::__construct("image"); $this->dict['src'] = (string) $src; if (!empty($href)) { $this->dict['href'] = (string) $href; } if (!empty($text)) { $this->dict['text'] = (string) $text; } }
public function __construct() { parent::__construct(); foreach ($_SERVER as $key => $value) { $this->setParam($key, $this->cleanArray($value)); } foreach ($_POST as $key => $value) { $this->setParam($key, $this->cleanArray($value)); } foreach ($_FILES as $key => $value) { $this->setParam($key, $this->cleanArray($value)); } foreach ($_GET as $key => $value) { $this->setParam($key, $this->cleanArray($value)); } }
/** * Creates new instance of context. * * @param HttpApplication $application */ public function __construct(HttpApplication $application) { parent::__construct($application); }
/** * Constructor */ function __construct() { parent::__construct(); }