-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathedit-data.php
More file actions
81 lines (73 loc) · 2.13 KB
/
edit-data.php
File metadata and controls
81 lines (73 loc) · 2.13 KB
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
<?php
/*
Author : Mohamed Aimane Skhairi
Email : skhairimedaimane@gmail.com
Repo : https://github.com/medaimane/crud-php-pdo-bootstrap-mysql
*/
include_once 'dbconfig.php';
if(isset($_POST['btn-update']))
{
$id = $_GET['edit_id'];
$fname = $_POST['first_name'];
$lname = $_POST['last_name'];
$email = $_POST['email_id'];
$contact = $_POST['contact_no'];
if($crud->update($id,$fname,$lname,$email,$contact))
{
$msg = "<div class='alert alert-info'>
Modification avec success
</div>";
}
else
{
$msg = "<div class='alert alert-warning'>
Erreur de modification
</div>";
}
}
if(isset($_GET['edit_id']))
{
$id = $_GET['edit_id'];
extract($crud->getID($id));
}
?>
<?php include_once 'header.php'; ?>
<div class="container">
<?php
if(isset($msg))
{
echo $msg;
}
?>
</div>
<div class="container">
<form method='post'>
<table class='table table-bordered'>
<tr>
<td>Nome</td>
<td><input type='text' name='first_name' class='form-control' value="<?php echo $first_name; ?>" required></td>
</tr>
<tr>
<td>Prénom</td>
<td><input type='text' name='last_name' class='form-control' value="<?php echo $last_name; ?>" required></td>
</tr>
<tr>
<td>E - mail</td>
<td><input type='text' name='email_id' class='form-control' value="<?php echo $email_id; ?>" required></td>
</tr>
<tr>
<td>Tél</td>
<td><input type='text' name='contact_no' class='form-control' value="<?php echo $contact_no; ?>" required></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-update">
<span class="glyphicon glyphicon-edit"></span> Modifier l'utilisateur
</button>
<a href="index.php" class="btn btn-large btn-success" style="float: right;"><i class="glyphicon glyphicon-backward"></i> Annuler</a>
</td>
</tr>
</table>
</form>
</div>
<?php include_once 'footer.php'; ?>