0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www.OLD
/
classes
/
[
Home
]
File: Document.class.php
<?php include_once("Baseobj.class.php"); include_once("Documentdesc.class.php"); class Document extends Baseobj{ var $id; var $produit; var $rubrique; var $contenu; var $dossier; var $fichier; var $classement; var $table="document"; var $bddvars = array("id", "produit", "rubrique", "contenu", "dossier", "fichier", "classement"); function Document(){ $this->Baseobj(); } function charger($id){ return $this->getVars("select * from $this->table where id=\"$id\""); } function changer_classement($id, $type){ $this->charger($id); $remplace = new Document(); if($type == "M") $res = $remplace->getVars("select * from $this->table where produit=\"" . $this->produit . "\" and rubrique=\"" . $this->rubrique . "\" and contenu=\"" . $this->contenu . "\" and dossier=\"" . $this->dossier . "\" and classement<" . $this->classement . " order by classement desc limit 0,1"); else if($type == "D") $res = $remplace->getVars("select * from $this->table where produit=\"" . $this->produit . "\" and rubrique=\"" . $this->rubrique . "\" and contenu=\"" . $this->contenu . "\" and dossier=\"" . $this->dossier . "\" and classement>" . $this->classement . " order by classement limit 0,1"); if(! $res) return ""; $sauv = $remplace->classement; $remplace->classement = $this->classement; $this->classement = $sauv; $remplace->maj(); $this->maj(); } function delete($requete){ $resul = mysql_query($requete); } function supprimer(){ $documentdesc = new Documentdesc(); $this->delete("delete from $this->table where id=\"$this->id\""); $this->delete("delete from $documentdesc->table where document=\"$this->id\""); return 1; } } ?>
©
2018.