1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
| <?php session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<?php
include ("parametres.php");
include ("fonction_base.php");
include ("droit_access.php");
?>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="3600" />
<meta name="revisit-after" content="2 days" />
<meta name="robots" content="index,follow" />
<meta name="publisher" content="Your publisher infos here ..." />
<meta name="copyright" content="Your copyright infos here ..." />
<meta name="author" content="Design: G. Wolfgang <a href="http://www.1-2-3-4.info" target="_blank">www.1-2-3-4.info</a> / Author: Your author infos here ..." />
<meta name="distribution" content="global" />
<meta name="description" content="Your page description here ..." />
<meta name="keywords" content="Your keywords, keywords, keywords, here ..." />
<link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_setup.css" />
<link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout1_text.css" />
<script type="text/javascript" src="javascript/info.js"></script>
<link rel="icon" type="image/x-icon" href="./img/favicon.ico" />
<title>consultation annuaire des professeurs </title>
<script language="javascript"><!--
function confirmLink(theLink, theSqlQuery) {
confirmMsg='Confirmation';
var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
if (is_confirmed) {
theLink.href += '&is_js_confirmed=1';
}
return is_confirmed;
}
</script>
</head>
<body>
<?php include 'header6.php';?>
<div class="header-bottom">
<div class="nav2">
<ul>
<li><a href="accueil.php">Accueil</a></li>
</ul>
<ul>
<li><a href="form_ajout_prof.php">Ajouter<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]--></li>
</ul>
<!-- Navigation item -->
<ul>
<li><a href="form_modif_prof.php">Modifier <!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]--></li>
</ul>
<ul> <!--[if lte IE 6]></td></tr></table></a><![endif]-->
<li><a href="#"> Consulter</a>
</li>
</ul>
</div>
<div class="header-breadcrumbs">
<!-- Search form -->
<ul>
<li><a href="Accueil.php">Accueil</a></li>
<li><a href="#">Professeurs</a></li>
<!-- <li>Multiflex-3</li> -->
</ul>
</div>
</div>
</div>
<div class="main">
<?php
$droit= $_SESSION['us_droit'];
if (CONSULT_PROFESSEUR & $droit)
{
$sql1="select count(*) from professeurs";
$result=mysql_query($sql1) or die ('Erreur SQL !<br />'.$sql1.'<br />'.mysql_error());
$nb_total= mysql_fetch_array($result); ?>
<div class="main-content">
<h1 class="block">Liste des Professeurs</h1>
<form name="resultat">
<hr class="clear-contentunit"/>
<?php
if (($nb_total = $nb_total[0]) == 0)
{
echo "Aucune réponse trouvée";
}
else
{
?>
<div class="column1-unit">
<table>
<tr>
<th width="275" class="top" scope="col">Nom</th>
<th width="440" class="top" scope="col">Prénoms</th>
<?php if ((SUPP_PROFESSEUR & $droit)) { ?>
<th width="40" align="center" class="top" scope="col"> Action</th><?php } ?>
</tr>
<?php
if (!isset($_GET['debut'])) $_GET['debut'] = 0;
$nb_affichage_par_page = 5;
// Préparation de la requête avec le LIMIT
$sql="select id_prof ,nom_prof,prenom_prof from professeurs order by nom_prof asc limit ".$_GET['debut'].",".$nb_affichage_par_page.";";
// on exécute la requête
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
//$lign= mysql_num_rows($result1);
//echo $lign;
while($row = mysql_fetch_array($req))
{
//echo 1;
$i=0;
?>
<tr><td> <a href='' onclick = "window.open('info_prof.php?champ=<?php echo $row['id_prof'] ?>', 'popup','width=640,height=480,scrollbars=yes,resizable=yes'); return false ;"> <?php echo htmlentities (trim($row['nom_prof'])); ?> </a> </td><td> <?php echo htmlentities (trim($row['prenom_prof'])); ?></td ><?php if ((SUPP_PROFESSEUR & $droit)) { ?> <td align ="center" width="15"> <a href="consultation_prof.php?id=<?php echo $row['id_prof'] ?> " onclick="return confirmLink(this, 'DELETE FROM `professeurs` WHERE `id_prof` =<?php echo $row['id_prof'] ?> LIMIT 1')"> <img src="./img/2868-63940.png" width="15" height="15" alt="Supprimer" /> </a> </td> <?php } ?> </tr>
<?php
}
mysql_free_result($req);
?>
</table>
<p class="caption"><strong><?php echo '<span class="gras">'.barre_navigation($nb_total, $nb_affichage_par_page, $_GET[
'debut'], 3).'</span>';?> </strong></p> <?php
}
mysql_free_result ($result);
// affichage des liens vers les pages
//affichePages($nombre,$page,$lign);
// affichage des boutons
//displayNextPreviousButtons($limite,$lign,$nombre,$page);
?>
</div>
</form>
<?php
if (isset($_REQUEST['id']))
{
if ($_REQUEST['id'])
{
$sql="DELETE FROM professeurs WHERE id_prof = ".$_REQUEST['id'].";";
$result= mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
}
}
}
else
echo "vous ne pouvez acceder cette page car vous ne disposer des droits necessaires"; ?>
</div>
</div>
<?php include'footer.php'; ?>
</body>
</html> |
Partager