-
Notifications
You must be signed in to change notification settings - Fork 7
/
delete.php
executable file
·50 lines (50 loc) · 2.27 KB
/
delete.php
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
<?php
include "util.php";
//malfermidatumbazon();
$pagxtitolo="Suppression d'une personne";
$persono_id=isset($_SESSION["persono_id"])?$_SESSION["persono_id"]:"";
if ($persono_id=="") {header("Location:index.php?erarkodo=8");}
$celpersono_id=isset($_POST["celpersono_id"])?$_POST["celpersono_id"]:"";
$celpersono_id=isset($_GET["celpersono_id"])?$_GET["celpersono_id"]:$celpersono_id;
$validperson=isset($_GET["validperson"])?$_GET["validperson"]:"";
$erarkodo = isset($_GET['erarkodo']) ? $_GET['erarkodo'] : "";
$celpersono = apartigiPersonon($celpersono_id);
if (($celpersono_id!="") && ($validperson==$celpersono["enirnomo"])) {
$demando = "delete from personoj where id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from nuna_kurso where korektanto='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from nuna_kurso where studanto='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from komentoj where studanto='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from personoj_lecioneroj where persono_id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from personoj_lecionoj where persono_id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from respondoj where persono_id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from takso_leciono where persono_id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from personoj_vortoj where persono_id='$celpersono_id'";
$bdd->exec($demando);
$demando = "delete from personoj_vortoj_respondoj where persono_id='$celpersono_id'";
$bdd->exec($demando);
header("Location:administri.php?validi=jes");
}
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
include "pagxkapo.inc.php";
?>
<div class="row">
<article class="col s12 m10 l7 offset-m1 offset-l2">
<h1>Confirmez la suppression</h1>
<p>Pour supprimer <b><?php echo $celpersono["enirnomo"]; ?></b>, veuiller recopier son identifiant :
<form method="post" action="delete.php">
<input type="text" name="validperson">
<input type="hidden" name="celpersono_id" value="<?php echo $celpersono_id?>">
<input type="submit" value="Confirmer">
</form>
</article>
</div>
<?php include "pagxpiedo.inc.php";?>