id = $id; $this->fieldset = explode(",",$this->fields); if(is_numeric($id)) { //properties vullen uit db $db = new Database(); $results = $db->Query($this->table, $this->fields, "SELECT", "id = '".$id."'"); foreach($results as $field => $value) { $this->$field = $value; } } else { //leeg object, alleen velden ophalen en properties declareren, lege values $results = $this->fieldset; foreach($results as $field) { $this->$field = ''; } $this->id = 'n'; } } function Id() { return $this->id; } function Title() { return $this->title; } function MetaTitle() { return $this->metatitle; } function MetaKey() { return $this->metakey; } function MetaDesc() { return $this->metadesc; } function Content() { return $this->content; } /* LISTEN EN SAVEN */ function setProperties($PropName, $PropValue) { $this->$PropName = $PropValue; } function DisplayList($where = '', $order = '') { $db = new Database(); $db->Query($this->table, "id", "SELECT", $where, $order); $list = $db->LoopThroughRows(); $return = array(); $class = get_class($this); // get name of this class foreach($list as $row) { $return[] = new $class($row->id); // create new item of type of this class } return $return; } function Save() { $i = 0; $query = ""; $qry = ""; $left = ""; $right = ""; //ff declareruhhh nulacht'nfuuvtig ehhhh $results = $this->fieldset; //array met velden $total = count($results); $db = new Database(); if ($this->id=="n") { //insert foreach($results as $field){ $i++; //query string opbouwen $left .= ($i == $total) ? "$field" : "$field, "; //geen komma bij laatste field $right .= ($i == $total) ? "'".$this->$field."'" : "'".$this->$field."', "; } $query = "($left) VALUES ($right)"; $method = "INSERT"; $where = ""; } else { //update foreach($results as $field){ $i++; //query string opbouwen $qry .= ($i == $total) ? "$field = '".$this->$field."'" : "$field = '".$this->$field."', "; //geen komma bij laatste field } $query = $qry; $method = "UPDATE"; $where = "id = '$this->id'"; } //uitvoeren $db->Query($this->table, $query, $method, $where); if($method == "INSERT"){ $this->id = mysql_insert_id(); } } } ?> Massage Praktijk de Stream - Aanbiedingen

Massage Praktijk
de Stream

0517-234-215

Aanbiedingen