function get_recs() { $dbh = dbops::getpdo(); $field_list = join(",",$this->select_fields); $where_clause = $this->where_clause; if (empty($where_clause) and !empty($this->where_keys_vals)) { $where_clause_ar = array(); foreach ($this->where_keys_vals as $key => $val) { $where_clause_ar[] = $key."=:".$key; } $where_clause = " WHERE " . join(" AND ",$where_clause_ar); } $sql = join(" ", array($this->select_clause , $field_list, $this->from_clause, $where_clause, $this->order_by, $this->limit_clause)); $stmt = $dbh->prepare($sql); foreach($this->where_keys_vals as $key => $val) { $stmt->bindParam(":".$key,$val); } $stmt->execute() or die("an error occurred: GenericDBDS,get_recs+846645410"); return $stmt->fetchAll(); }
function max_reached() { $dbh = dbops::getpdo(); $stmt = $dbh->prepare("SELECT COUNT(*) FROM entity_grouping WHERE eg_type=:eg_type"); $stmt->bindParam(":eg_type",$this->grouping_type); $stmt->execute() or die("an error occurred: EntityGrouping,+8465410"); $result = $stmt->fetchColumn(); return ($result >= AppSettings::gv("NumGroupedItemsType".$this->grouping_type."Max")) ? 1 : 0; }
function set_approved_value($approved_value) { $dbh = dbops::getpdo(); $stmt = $dbh->prepare("UPDATE medb_order set approved = :approved where order_id = :order_id"); $stmt->bindParam(":approved",$approved_value); $stmt->bindParam(":order_id",$this->order_id); $stmt->execute() or die("an error occurred: medb_order,83kjf641sl8890"); return 1; }