-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathform.php
216 lines (177 loc) · 6.56 KB
/
form.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
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php
require_once 'testadmin.php';
include 'classe/formweb.php';
include 'classe/db_conf.php';
$data=[""];
$form=new formweb($data);
$res=$form->selectformweb();
$rows = $res->fetch();
if(isset($_POST['ajoute'])){
$imgtop=$_POST['imgtop'];
$imgleft=$_POST['imgleft'];
$imgright=$_POST['imgright'];
$imgcarousel1=$_POST['imgcarousel1'];
$imgcarousel2=$_POST['imgcarousel2'];
$imgbcar=$_POST['imgbcar'];
$imgbot1=$_POST['imgbot1'];
$imgbot2=$_POST['imgbot2'];
$imgbot3=$_POST['imgbot3'];
if($imgtop==""){
$imgtop=$rows['imgtop'];
}
if($imgleft==""){
$imgleft=$rows['imgleft'];
}
if($imgright==""){
$imgright=$rows['imgright'];
}
if($imgcarousel1==""){
$imgcarousel1=$rows['imgcarousel1'];
}
if($imgcarousel2==""){
$imgcarousel2=$rows['imgcarousel2'];
}
if($imgbcar==""){
$imgbcar=$rows['imgbcar'];
}
if($imgbot1==""){
$imgbot1=$rows['imgbot1'];
}
if($imgbot2==""){
$imgbot2=$rows['imgbot2'];
}
if($imgbot3==""){
$imgbot3=$rows['imgbot3'];
}
$data=["image_top"=>$imgtop,"image_left"=>$imgleft,"image_right"=>$imgright,"image_carousel1"=>$imgcarousel1,"image_carousel2"=>$imgcarousel2 ,"image_bcar"=>$imgbcar,"image_bot1"=>$imgbot1,"image_bot2"=>$imgbot2,"image_bot3"=>$imgbot3];
$formweb=new formweb($data);
$req=$formweb->update_formweb();
header('Location: form.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Edit form </title>
<!-- Bootstrap Core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="vendor/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="css/metisMenu.min.css" rel="stylesheet">
<link href="css/sb-admin-2.css" rel="stylesheet">
<link href="vendor/font-awesom/css/font-awesome.css" rel="stylesheet" type="text/css">
</head>
<style type="text/css">
@font-face{
font-family: "Poppins-Regular";
src:url(Poppins-Regular.ttf) format("truetype");
}
.panel-body .primary_block{
border-right: 1px solid #ccc
}
.panel-body label{
margin-bottom: 0;
color: #555;
letter-spacing:0.3px;
font:200 12px/20px Poppins-Regular,'Open Sans','Helvetica Neue',Arial,sans-serif;
}
.secblock .formimg{
padding: 5px;
border: 1px solid #00acac;
margin: 10px 7px
}
.secblock .formimg input[type="file"]{
font-size: 4.5px;
padding:15px 0 5px
}
.secblock .col-sm-6{
width: 47%
}
.secblock .col-sm-4{
width: 29.5%
}
.secblock .formimg img{
width: 100%
}
</style>
<body>
<?php
include 'navbar.php';
?>
<div class="container">
<div class="row">
<div class="col-lg-12 form-title">
<h1>Form</h1>
<p>home / Form</p>
</div>
<!-- /.col-lg-12 -->
</div>
<form method="post">
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-12 secblock">
<div class="col-sm-12 formimg">
<img <?php echo 'src="images/'.$rows['imgtop'].'"';?>>
<input type="file" name="imgtop">
</div>
<div class="col-sm-3 formimg">
<img <?php echo 'src="images/'.$rows['imgleft'].'"';?>>
<input type="file" name="imgleft">
</div>
<div class="col-sm-6">
<div class="col-sm-12 formimg">
<img <?php echo 'src="images/'.$rows['imgcarousel1'].'"';?>>
<input type="file" name="imgcarousel1">
</div>
<div class="col-sm-12 formimg">
<img <?php echo 'src="images/'.$rows['imgcarousel2'].'"';?>>
<input type="file" name="imgcarousel2">
</div>
<div class="col-sm-12 formimg">
<img <?php echo 'src="images/'.$rows['imgbcar'].'"';?>>
<input type="file" name="imgbcar">
</div>
<div class="col-sm-12">
<div class="col-sm-4 formimg">
<img <?php echo 'src="images/'.$rows['imgbot1'].'"';?>>
<input type="file" name="imgbot1">
</div>
<div class="col-sm-4 formimg">
<img <?php echo 'src="images/'.$rows['imgbot2'].'"';?>>
<input type="file" name="imgbot2">
</div>
<div class="col-sm-4 formimg">
<img <?php echo 'src="images/'.$rows['imgbot3'].'"';?>>
<input type="file" name="imgbot3">
</div>
</div>
</div>
<div class="col-sm-3 formimg">
<img <?php echo 'src="images/'.$rows['imgright'].'"';?>>
<input type="file" name="imgright">
</div>
</div>
<button type="submit" class="btn-env" name="ajoute">Modifie</button>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
</form>
<!-- /.row -->
</div>
<!-- /#page-wrapper -->
<!-- /#wrapper -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="js/metisMenu.js"></script>
<script src="js/sb-admin-2.js"></script>
</body>
</html>