keyContent = 'general'; if (isset($_GET['k'])) $this->keyContent = $_GET['k']; } public function display() { $this->setContent(); include('templates/default/admin.html'); } public function getMenu() { $array = array( 'general' => 'Infos générales', 'informations' => 'Première page', 'users' => 'Utilisateurs', 'photos' => 'Photos', 'calendar' => 'Calendrier' ); if ( isset ( $this->options['meteo'] ) ) $array = array_merge ( $array , array( 'meteo' => 'Météo' ) ); if ( isset ( $this->options['map'] ) ) $array = array_merge ( $array , array( 'map' => 'Adresse' ) ) ; $content = '
'; return $content; } public function setContent() { if ( $this->keyContent == 'general' ) { $content .= $this->getAdminGeneral(); } else if ( $this->keyContent == 'informations' ){ $content .= $this->getAdminInformations(); } else if ( $this->keyContent == 'users' ) { $content .= $this->getAdminUsers(); } else if ( $this->keyContent == 'calendar' ) { $content .= $this->getAdminCalendar(); } else if ( $this->keyContent == 'photos' ) { $content .= $this->getAdminPhotos(); } else if ( $this->keyContent == 'meteo' ) { $content .= $this->getAdminMeteo(); } else if ( $this->keyContent == 'map' ) { $content .= $this->getAdminMap(); } else { $content .= 'Une erreur est survenue... '; } $content .= ''; $this->content = $content; } public function getAdminInformations() { if (isset($_POST['id'])) $this->saveContent($_POST['html']); $content = ''; return $content; } public function getAdminMeteo() { if (isset($_POST['id'])) $this->saveContent($_POST['html']); $content = ''; return $content; } public function getAdminMap() { if (isset($_POST['id'])) { $this->saveContent( serialize ( array ( 'address' => $_POST['address'], 'info' => $_POST['info'] ))); } $v = unserialize (stripslashes($this->options['map']['html'] ) ); $content = ''; return $content; } public function getAdminGeneral() { $content = ''; $this->headCode .= ' '; if (isset($_POST['footer'])) { $this->footer = $_POST['footer']; } if (isset($_POST['color'])) { $this->color = substr( $_POST['color'], -6 ); } if ( isset( $_FILES['img_header'] ) ) { $u = new upload(); $u->upload_file( 'img_header', 'uploads/'.$this->key .'/', 'image' ); $element->question_number = $_POST['q']; if ($u->error == 'sucess') { $this->img_header = $u->filename; } else { $content .= $u->error; } } if (isset($_POST)) { $this->save(); } $content .= ''; return $content; } public function getAdminUsers() { if (isset($_POST['email'])) $this->saveUser(); $content = ''; $q = db::getInstance()->q( 'SELECT *, sm_jtusers.status as type FROM `sm_jtusers` , `sm_users` WHERE `FK_web_id` = "'. $this->id .'" AND FK_use_id = id '); $content .= 'Nom | Prénom | Administrateur | |
'.$array['email'].' | '.$array['name'].' | '.$array['surname'].' | '.$array['type'].' |