id = 0; // N'appartient a personne $this->group_id = 0; // Pas de groupe $this->user_id = 0; // Pas d'utilisateur $this->secret_key = time(); // Clef secrete $this->provider_id;// Pas de fournisseur $this->parent_id;// Pas d'evenement parent par defaut. $this->status = 0; // WAITING_FOR_APPROVAL $this->date_in = time(); // Maintenant par defaut $this->start = time(); // Maintenant par defaut. $this->end = $this->start; $this->title = ""; $this->fees = ""; $this->organisation = ""; $this->country = ""; $this->area = ""; $this->place = ""; $this->address = ""; $this->url = ""; $this->email = ""; $this->comment = ""; $this->artists = ""; $this->sms = ""; $this->genre = 1; } // Constructeur par ID // Retourne la soiree identifiee par ID si ID est un ID de // la BD, sinon ne fait rien. function fetchById($id) { global $_D; $id = intval($id); $query_select = "SELECT * FROM parties where id = " . intval($id); $result = $_D->query($query_select); $fields = $_D->fetch_array($result); if ($fields) { $this->id = $id; $this->group_id = $fields["group_id"]; $this->user_id = $fields["user_id"]; $this->secret_key = $fields["secret_key"]; $this->provider_id = $fields["provider_id"]; $this->parent_id = $fields["parent_id"]; $this->status = $fields["status"]; $this->date_in = $fields["date_in"]; $this->start = $fields["start"]; $this->end = $fields["end"]; $this->title = $fields["title"]; $this->fees = $fields["fees"]; $this->organisation = $fields["organisation"]; $this->country = $fields["country"]; $this->area = $fields["area"]; $this->place = $fields["place"]; $this->address = $fields["address"]; $this->url = $fields["url"]; $this->email = $fields["email"]; $this->comment = $fields["comment"]; $this->artists = $fields["artists"]; $this->sms = $fields["sms"]; $this->genre = $fields["genre"]; $this->image_verso = $fields["image_verso"]; $this->image_recto = $fields["image_recto"]; $_D->free_result($result); return TRUE; } else return FALSE; } // Retourne une hash des sous-soirees eventuelles function getSubParties() { global $_D; $query_select = "SELECT id,title,start FROM parties where parent_id = " . $this->id; $result = $_D->query($query_select); $subParties = array(); if ($result) { $i = 0; while($fields = $_D->fetch_array($result)) { $subParties[$i++] = $fields; } $_D->free_result($result); } return $subParties; } // Modifie l'etat de la soiree function modifyStatus($status = "WAITING_FOR_APPROVAL") { switch ($status): case "WAITING_FOR_APPROVAL": $this->status = 0; break; case "CONFIRMED": $this->status = 1; break; case "ANNOUNCED": $this->status = 2; break; case "CANCELLED": $this->status = 3; break; default: $this->status = 0; endswitch; } // Retourne la clef secrete associee a la soiree function getSecretKey( ) { global $_D; $query_select = "select secret_key from parties where id = " . $this->id; $row = $_D->fetch_array($_D->query($query_select)); if ($row) return $row['secret_key']; else return ""; } // Insere une soiree dans la BD function insert() { global $_D; $query_insert = "INSERT INTO parties (id,group_id,user_id,secret_key,provider_id,parent_id,status,date_in,start,end,title,fees,organisation,country,area,place,address,url,email,comment,artists,sms,genre) VALUES ('','" ; $query_insert .= intval($this->group_id) . "','" . intval($this->user_id) . "','" . addslashes($this->secret_key) . "','" . intval($this->provider_id) . "','" . intval($this->parent_id) . "','" . intval($this->status) . "','" . intval($this->date_in) . "','" . intval($this->start) . "','"; $query_insert .= intval($this->end) . "','" . addslashes($this->title) . "','" . addslashes($this->fees) . "','" . addslashes($this->organisation) . "','" . addslashes($this->country) . "','" . addslashes($this->area) . "','" . addslashes($this->place) . "','" . addslashes($this->address) . "','" . addslashes($this->url) . "','" . addslashes($this->email) . "','" . addslashes($this->comment) . "','" . addslashes($this->artists) . "','" . addslashes($this->sms) . "','" . addslashes($this->genre) . "')"; $result = $_D->query($query_insert); if ($result) $this->id = $_D->insert_id(); // On recupere l'ID d'insertion. return $result; } // Supprime une soiree de la BD function deleteById($id) { global $_D; $query_delete = "DELETE FROM parties where id = " . intval($id) . " or parent_id = " . intval($id); return $_D->query($query_delete); } function deleteWithId($id) { $query_delete = "DELETE FROM parties where id = " . intval($id); return $DB->query($query_delete); } // Modifie le contenu d'une soiree function updateContent() { global $_D; $query_update = "UPDATE parties SET user_id = ". intval($this->user_id) . ", group_id = " . intval($this->group_id) . ",date_in = '" . intval($this->date_in) . "',start = '" . intval($this->start) . "',end = '" . intval($this->end) . "',title = '" . addslashes($this->title) . "',fees = '" . addslashes($this->fees) . "',organisation = '" . addslashes($this->organisation) . "',country = '" . addslashes($this->country) . "',area = '" . addslashes($this->area) . "',place = '" . addslashes($this->place) . "',address = '" . addslashes($this->address) . "',url = '" . addslashes($this->url) . "',email = '" . addslashes($this->email) . "',comment = '" . addslashes($this->comment) . "',artists = '" . addslashes($this->artists) . "',sms = '" . addslashes($this->sms) . "',genre = '" . addslashes($this->genre). "' WHERE id = " . intval($this->id); return $_D->query($query_update); } // Modifie le statut de la soiree en BD function updateStatus($DB) { $query_update = "UPDATE parties SET status = '" . intval($this->status) . "' WHERE id = " . intval($this->id); return $DB->query($query_update); } // Modifie le ownership de la soiree function updateOwner($DB) { $query_update = "UPDATE parties SET user_id = " . intval($this->user_id) . ", group_id = " . intval($this->group_id) . " WHERE id = " . intval($this->id); return $DB->query($query_update); } function isAuthorizedGroup($groupId) { return FALSE; } // Retourne l'etat sous forme d'une chaine. function statusToString() { switch ($this->status): case 0: return "EN ATTENTE D'APPROBATION"; break; case 1: return "CONFIRMEE"; break; case 2: return "ANNONCEE"; break; case 3: return "ANNULEE"; break; default : return "EN ATTENTE D'APPROBATION"; endswitch; } function setExtensionFlyer($extension,$value) { if ($extension == "recto") $this->recto_ext = $value; else $this->verso_ext = $value; } } ?> (#) France techno | Bienvenue !
France Techno est hors service. Le service est maintenu en l'état mais n'est plus maintenu.
Accueil            Actu            Soirées            Chroniques Membres            Webmail            Contact