function profil($id) { //On teste que le paramètre de l'URL est bien un ID valide de médecin if ($id != null && $id == intval($id) && Medecin::exists($id)) { //Traitement du POST if (isset($_POST['posted'])) { $Mnom = $_POST['nom']; $Mprenom = $_POST['prenom']; $Mcivilite = $_POST['civilite']; echo $Mnom . $Mprenom; $retour = Medecin::update($id, $Mnom, $Mprenom, $Mcivilite); } //Récupération des données pour la vue $medecin = Medecin::selectByID($id); include VIEW . 'modifierMedecin.php'; //Tratiement du retour de la fonction update if (isset($retour) && $retour) { echo "<p id='messageOK'>Modifications effetuées</p>"; } elseif (isset($retour) && $retour) { echo "<p id='mErreur'>Erreur : Veuillez contacter votre administrateur.</p>"; } } else { unset($_POST); //Supprimer le post pour éviter les conflits avec l'autre page lister(); echo "<p id='mErreur'>Aucun médecin correspondant<p>"; } }
function get_thumbnail($dir) { $list = lister($dir, FALSE); // we don't care about thumbs, so save some time if (isset($list['picture']['thumbnail.jpg']) === TRUE) { return 'thumbnail.jpg'; } else { if (isset($list['picture']) === TRUE && sizeof($list['picture']) > 0) { // get first picture file in the folder $key = key($list['picture']); // get current value return $list['picture'][$key]['big']; } else { if (isset($list['folder']) === TRUE && sizeof($list['folder']) > 0) { // search in sub folders foreach ($list['folder'] as $a_folder) { // recursivity FTW $a_folder_thumb = get_thumbnail($dir . '/' . $a_folder); if ($a_folder_thumb !== '') { return $a_folder . '/' . $a_folder_thumb; } } } } } return ''; // nothing was found }
<option value=""></option> <?php lister('41'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> <div class="menu_table5"> <form method="POST"action="Forecast.php"> <p>その他: <select name="1"class="sel"required> <option value=""></option> <?php lister('39'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> \ </body> </html>
$controller = "chaine"; } if (isset($_GET['fonction'])) { $fonction = $_GET['fonction']; } else { $fonction = "lister"; } ?> <nav class="navbar navbar-inverse row"> <div class="col-md-3"> <img src="http://www.tunisie-radio.com/sites/default/files/logo_small.png" /> </div> <div class="col-md-9 nav navbar-nav"> <?php require_once 'Application/Controller/' . ucfirst($controller) . "/" . ucfirst($controller) . ".php"; lister(TRUE); ?> </div> </nav> <?php require_once 'fonctions.php'; if ($controller = "chaine") { require_once 'Application/Controller/' . ucfirst($controller) . "/" . ucfirst($controller) . ".php"; } $function_name = $fonction; if (function_exists($function_name)) { $param = ""; if ($function_name == "ecouter") { //Id chaine $param = (int) $_GET['chaine']; }
<p>パン: <select name="1"class="sel"required> <option value=""></option> <?php lister('53'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> <div class="menu_table4"> <form method="POST"action="Forecast.php"> <p>その他: <select name="1"class="sel"required> <option value=""></option> <?php lister('50'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> </body> </html>
function profil($id = null) { //On teste si on a bien au moins un paramètre et que c'est un nombre, puis que le patient existe if ($id != null && $id == intval($id) && Patient::exists($id)) { //Traitement associé au post if (isset($_POST['posted'])) { $Pcivilite = $_POST['civilite']; $Pnom = $_POST['nom']; $Pprenom = $_POST['prenom']; $Pdn = $_POST['date_naissance']; $Pln = $_POST['lieu_naissance']; $Pns = $_POST['num_secu']; $Padresse = $_POST['adresse']; $Pcp = $_POST['cp']; $Pville = $_POST['ville']; $Pid_med = $_POST['medecin']; $retour = Patient::update($id, $Pcivilite, $Pnom, $Pprenom, $Pdn, $Pln, $Pns, $Padresse, $Pcp, $Pville, $Pid_med); } $patient = Patient::select($id); //On récupère le médecin référent $medRef = Medecin::selectByID($patient['id_med']); //On récupère la liste des médecins pour le selecteur $tabMedecin = Medecin::selectAll(); include VIEW . "modifierPatient.php"; if (isset($retour) && $retour) { echo "<p id='messageOK'>Modifications effetuées</p>"; } elseif (isset($retour)) { echo "<p id='mErreur'>Erreur : Veuillez contacter votre administrateur.</p>"; } } else { unset($_POST); //Supprimer le post pour éviter les conflits avec l'autre page lister(); echo "<p id='mErreur'>Aucun patient correspondant<p>"; } }
<select name="1"class="sel"required> <option value=""></option> <?php lister('34'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> <div class="menu_table5"> <form method="POST"action="Forecast.php"> <p>その他: <select name="1"class="sel"required> <option value=""></option> <?php lister('49'); ?> </select> <input type="submit"value="予測を見る"class="Forecast"> </form> </div> </body> </html>
<p>果物類: <select name="1"class="sel"required> <option value=""></option> <?php lister('16'); ?> </select> <input type="submit"value="予測を見る"class="Forecast" name = 'button6'> </form> </div> <div class="menu_table7"> <form method="POST"action="Forecast.php"> <p>その他: <select name="1"class="sel"required> <option value=""></option> <?php lister('11'); ?> </select> <input type="submit"value="予測を見る"class="Forecast" name = 'button7'> </form> </div> \ </body> </html>
function teams($stub = "") { if ($stub == "") { $this->viewdata["function_title"] = "Team list"; $teams = new Team(); $teams->order_by('name', 'ASC')->get_iterated(); $rows = array(); foreach ($teams as $team) { $rows[] = array('title' => '<a href="' . site_url('admin/members/teams/' . $team->stub) . '">' . $team->name . '</a>'); } $data['list'] = lister($rows); $this->viewdata["main_content_view"] = $this->load->view('admin/members/users', $data, TRUE); $this->load->view("admin/default", $this->viewdata); } else { $team = new Team(); $team->where('stub', $stub)->get(); if ($this->tank_auth->is_admin() || $this->tank_auth->is_group('mod')) $can_edit = true; else $can_edit = false; if ($this->tank_auth->is_team_leader($team->id) && !$can_edit) $can_edit_limited = true; else $can_edit_limited = false; if (($post = $this->input->post()) && ($can_edit || $can_edit_limited)) { $team = new Team(); $team->where('stub', $stub)->get(); $post["id"] = $team->id; if ($can_edit_limited) { unset($post['name']); } $team->update_team($post, TRUE); set_notice('notice', _('Saved.')); } $this->viewdata["function_title"] = "Team"; $this->viewdata["extra_title"][] = $team->name; if ($can_edit_limited) $team->validation['name']['disabled'] = 'true'; $result = ormer($team); $result = tabler($result, TRUE, ($can_edit || $can_edit_limited)); $data['table'] = $result; $data['team'] = $team; $members = new Membership(); $users = $members->get_members($team->id); $users_arr = array(); foreach ($users->all as $key => $item) { $users_arr[$key][] = '<a href="' . site_url('/admin/members/member/' . $item->id) . '">' . $item->username . '</a>'; if ($can_edit) $users_arr[$key][] = $item->email; $users_arr[$key][] = $item->last_login; $users_arr[$key][] = ($item->is_leader) ? _('Leader') : _('Member'); if ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed()) { $buttoner = array(); $buttoner = array( 'text' => _("Remove member"), 'href' => site_url('/admin/members/reject_application/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to remove this team member?') ); } $users_arr[$key][] = (isset($buttoner) && !empty($buttoner)) ? buttoner($buttoner) : ''; if (!$item->is_leader && ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed())) { $buttoner = array(); $buttoner = array( 'text' => _("Make leader"), 'href' => site_url('/admin/members/make_team_leader/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to make this user a team leader?') ); } if ($item->is_leader && ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed())) { $buttoner = array(); $buttoner = array( 'text' => _("Remove leader"), 'href' => site_url('/admin/members/remove_team_leader/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to remove this user from the team leadership?') ); } $users_arr[$key][] = (isset($buttoner) && !empty($buttoner)) ? buttoner($buttoner) : ''; } // Spawn the form for adding a team leader $data["no_leader"] = FALSE; if ($this->tank_auth->is_allowed()) $data["no_leader"] = TRUE; $data['members'] = tabler($users_arr, TRUE, FALSE); $this->viewdata["main_content_view"] = $this->load->view('admin/members/team', $data, TRUE); $this->load->view("admin/default", $this->viewdata); } }
function teams($stub = "") { // no team selected if ($stub == "") { // set subtitle $this->viewdata["function_title"] = _('Teams'); // we can use get_iterated on teams $teams = new Team(); // support filtering via search if ($this->input->post()) { $teams->ilike('name', $this->input->post('search')); $this->viewdata['extra_title'][] = _('Searching') . " : " . $this->input->post('search'); } $teams->order_by('name', 'ASC')->get_iterated(); $rows = array(); // produce links for each team foreach ($teams as $team) { $rows[] = array('title' => '<a href="' . site_url('admin/members/teams/' . $team->stub) . '">' . $team->name . '</a>'); } // put in a list the teams $data['form_title'] = _('Teams'); $data['table'] = lister($rows); // print out $this->viewdata["main_content_view"] = $this->load->view('admin/members/users', $data, TRUE); $this->load->view("admin/default", $this->viewdata); } else { // team was selected, let's grab it and create a form for it $team = new Team(); $team->where('stub', $stub)->get(); // if the team was not found return 404 if ($team->result_count() != 1) { show_404(); } // if admin or mod allow full editing rights if ($this->tank_auth->is_allowed()) { $can_edit = true; } else { $can_edit = false; } // if it's a team leader, but not admin or mod, allow him to change data but not the team name if ($this->tank_auth->is_team_leader($team->id) && !$can_edit) { $can_edit_limited = true; } else { $can_edit_limited = false; } // if allowed in any way to edit, if (($post = $this->input->post()) && ($can_edit || $can_edit_limited)) { $post["id"] = $team->id; // save the stub in case it's changed $old_stub = $team->stub; // don't allow editing of name for team leaders if ($can_edit_limited) { unset($post['name']); } // send the data to database $team->update_team($post); // green box to tell data is saved set_notice('notice', _('Saved.')); if ($team->stub != $old_stub) { flash_notice('notice', _('Saved.')); redirect('admin/members/teams/' . $team->stub); } } // subtitle $this->viewdata["function_title"] = '<a href="' . site_url("admin/members/teams") . '">' . _('Teams') . '</a>'; // subsubtitle! $this->viewdata["extra_title"][] = $team->name; // gray out the name field for team leaders by editing directly the validation array if ($can_edit_limited) { $team->validation['name']['disabled'] = 'true'; } // convert the team information to an array $result = ormer($team); // convert the array to a form $result = tabler($result, TRUE, $can_edit || $can_edit_limited); $data['table'] = $result; $data['team'] = $team; // get the team's members $members = new Membership(); $users = $members->get_members($team->id); // the team members' array needs lots of buttons and links $users_arr = array(); foreach ($users->all as $key => $item) { $users_arr[$key][] = '<a href="' . site_url('/admin/members/member/' . $item->id) . '">' . $item->username . '</a>'; // show the email only to admins and mods if ($can_edit) { $users_arr[$key][] = $item->email; } $users_arr[$key][] = $item->last_login; // leader of normal member? $users_arr[$key][] = $item->is_leader ? _('Leader') : _('Member'); if ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed()) { $buttoner = array(); $buttoner = array('text' => _("Remove member"), 'href' => site_url('/admin/members/reject_application/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to remove this team member?')); } // add button to array or stay silent if there's no button $users_arr[$key]['action'] = isset($buttoner) && !empty($buttoner) ? buttoner($buttoner) : ''; if (!$item->is_leader && ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed())) { $buttoner = array(); $buttoner = array('text' => _("Make leader"), 'href' => site_url('/admin/members/make_team_leader/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to make this user a team leader?')); } if ($item->is_leader && ($this->tank_auth->is_team_leader($team->id) || $this->tank_auth->is_allowed())) { $buttoner = array(); $buttoner = array('text' => _("Remove leader"), 'href' => site_url('/admin/members/remove_team_leader/' . $team->id . '/' . $item->id), 'plug' => _('Do you want to remove this user from the team leadership?')); } // add button to array or stay silent if there's no button $users_arr[$key]['action'] .= isset($buttoner) && !empty($buttoner) ? buttoner($buttoner) : ''; } // Spawn the form for adding a team leader $data["no_leader"] = FALSE; if ($this->tank_auth->is_allowed()) { $data["no_leader"] = TRUE; } // make a form out of the array of members $data['members'] = tabler($users_arr, TRUE, FALSE); // print out $this->viewdata["main_content_view"] = $this->load->view('admin/members/team', $data, TRUE); $this->load->view("admin/default", $this->viewdata); } }
// do you want to use thumbnails? 60px images, galleries will load faster (big pictures are not loaded at the same time than the page) // it'll degrade smartly if no thumb is found - but disabling it may allow you to save a little time if you don't have any thumb $use_thumbs = TRUE; $thumbs_suffix = '_thumb'; // the thumbs corresponding to 'IMG42.jpg' should be called 'IMG42_thumb.jpg' $lang = 'en'; // either fr or en /* end of config, no more things to modify */ require 'lister.php'; require 'lang/' . $lang . '.php'; $subdir = get_folder(); // get only subdirectory $dir = $subdir == '' ? 'photos' : 'photos/' . $subdir; // full path - check if there's subdir to avoid ending / // scan folder $list = lister($dir, $use_thumbs, $thumbs_suffix); ?> <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title><?php echo $messages['title']; ?> </title> <link type="text/css" href="style.css" rel="stylesheet" /> <!-- jQuery --> <script type="text/javascript" src="lib/jquery.min.js"></script> <!-- Galleria (jQuery plugin) --> <script type="text/javascript" src="lib/galleria/galleria-1.3.2.min.js"></script> <script type="text/javascript" src="lib/galleria/themes/classic/galleria.classic.min.js"></script>
$list_1 .= "</graph>"; } adminTemplate('vote_see'); require_once adminTemplate('vote_see'); } //下面代码为控制层代码!!!!!!!!!!!!!!!!!!!!! if ($_REQUEST['act'] == 'edit') { edit($_REQUEST[vid]); } else { if ($_REQUEST['act'] == 'delect') { dele($_REQUEST[vid]); } else { if ($_REQUEST['act'] == 'edit_sub') { update($_REQUEST); } else { if ($_REQUEST['act'] == 'see') { see($_REQUEST[vid]); } else { if ($_REQUEST['act'] == 'view') { view($_REQUEST); } else { if ($_REQUEST['act'] == 'update_view') { update_view($_REQUEST); } else { lister(); } } } } } }