function fetchContacts($lang = "fr", $status = "Y") { $sql = "SELECT id, name, job_" . $lang . " AS job, descr_job_" . $lang . " AS job_desc, email, image, description_" . $lang . " AS description"; $sql .= " FROM contacts "; $sql .= "WHERE 1 "; // filter by status if ($status != "") { $sql .= "AND online = '" . Data::magicAddSlashes($status) . "' "; } return $this->_db->select($sql); }
public function fetchActivitiesDetails($activitiesId, $status = "Y", $lang = "fr") { // fetch details from [projects], specified by productId, and optional status $sql = "SELECT r.*, r.description_" . $lang . " AS description, r.highlights_" . $lang . " AS highlights,r.name_" . $lang . " AS name"; $sql .= " FROM activities r "; $sql .= "WHERE r.id = '" . intval($activitiesId) . "' "; if ($status != "") { $sql .= "AND r.online = '" . Data::magicAddSlashes($status) . "' "; } return $this->_db->select($sql); }
public function fetchProjects($lang = "fr", $status = "Y", $order = "rank", $numReturn = 0, $numStart = 0, $location = "", $rooms = "", $exclude_id = 0) { $sql = "SELECT p.id AS project_id, p.online, p.name_" . $lang . " AS project_name, p.name_" . $lang; $sql .= " FROM projects p "; $sql .= "WHERE 1 "; if ($status != "") { $sql .= "AND p.online = '" . Data::magicAddSlashes($status) . "' "; } if ($exclude_id > 0) { $sql .= "AND p.id <> '" . intval($exclude_id) . "' "; } $sql .= "ORDER BY project_name ASC "; if ($numReturn > 0) { $sql .= "LIMIT " . $numStart . ", " . $numReturn; } return $this->_db->select($sql); }
public function fetchTestimonials($status = "Y", $lang = 'en', $type = 0, $limit = 0) { // type 1 Rentals // type 2 Sales // type 3 Magnament $sql = "SELECT * "; $sql .= "FROM testimonials "; $sql .= "WHERE 1 "; if ($status != "") { $sql .= "AND online = '" . Data::magicAddSlashes($status) . "' "; } if ($lang != "") { $sql .= "AND lang = '" . Data::magicAddSlashes($lang) . "' "; } if ($type != 0) { $sql .= "AND type = '" . Data::magicAddSlashes($type) . "' "; } $sql .= "ORDER BY id "; if ($limit > 0) { $sql .= "LIMIT " . $limit; } return $this->_db->select($sql); }
public function fetchSalesDetails($salesId, $status = "Y", $lang = "fr") { // fetch details from [projects], specified by productId, and optional status $sql = "SELECT r.*, r.locations_id, r.description_" . $lang . " AS description, r.highlights_" . $lang . " AS highlights, r.address, r.has_promotion, r.price_promotion, r.deadline_promotion, r.beds_details_" . $lang . " AS beds_details, p.image, l.name_" . $lang . " AS location "; $sql .= "FROM sales r "; $sql .= "LEFT JOIN sale_photos p ON p.sales_id = r.id AND p.rank = 1 "; $sql .= "INNER JOIN locations l ON l.id = r.locations_id "; $sql .= "WHERE r.id = '" . intval($salesId) . "' "; if ($status != "") { $sql .= "AND r.online = '" . Data::magicAddSlashes($status) . "' "; } return $this->_db->select($sql); }