-
Notifications
You must be signed in to change notification settings - Fork 9
/
alumnigallery.php
74 lines (63 loc) · 1.83 KB
/
alumnigallery.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
<?php
include("sqlcon.php");
if(isset($_POST[upload]))
{
$flag = false;
for($i=0; $i < count(array_filter($_FILES[photo][name])); $i++)
{
$filename = rand().$_FILES['photo']['name'][$i];
move_uploaded_file($_FILES['photo']['tmp_name'][$i],"gallery/".$filename);
$glry = "gallery/".$filename;
$qry = "insert into tblgallery(eventid,photo) values (".$_POST[event].",".$glry.")";
$quest = mysqli_query($con, $qry);
if($quest)
{
$flag = true;
}
}
if($flag)
{
echo "<script>alert(success!!!);</script>";
}
}
/* ### */ ?>
<?php
include("header.php")
/* ### */ ?>
<div class="container">
<div class="page">
<h3>Update Event Gallery</h3>
<div class="bs-example" data-example-id="simple-horizontal-form">
<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Event</label>
<div class="col-sm-6">
<select name="event" id="event" class="form-control"> <?php
$res = mysqli_query($con, "select * from tblalumnimeet");
echo "<option value=0>--Select -- </option>";
while($row = mysqli_fetch_array($res))
{
echo "<option value=$row[0]>$row[1]</option>";
}
/* ### */ ?>
</select>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Event</label>
<div class="col-sm-6">
<input type="file" name="photo[]" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" name="upload" value="UPLOAD" class="btn btn-default"/>
<input type="submit" name="cancel" value="CANCEL" class="btn btn-default"/> <br/>
</div></div>
</form>
</div>
</div>
</div>
<?php
include("footer.php");
/* ### */ ?>