-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgallery.php
95 lines (88 loc) · 2.71 KB
/
gallery.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
<?php
include("header.php");
include("connection.php");
$dt = date("Y-m-d");
if(isset($_POST["createalbum"]))
{
$sql="INSERT INTO gallery(album_name,date,time,description)
VALUES
('$_POST[title]','$_POST[date]','$_POST[time]','$_POST[description]')";
if (!mysqli_query($con,$sql,$con))
{
die('Error: ' . mysqli_error($con));
}
$gallery = "<b>New album created successfully...</b>";
}
?>
<SCRIPT LANGUAGE="JavaScript">
function generate()
{
if(document.form1.title.value=="")
{
alert("enter the title");
return false;
}
if(document.form1.description.value=="")
{
alert("enter the description");
return false;
}
if(document.form1.lastdate.value=="")
{
alert("enter the date");
return false;
}
}
</script>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3>Create Album</h3>
<p><strong><a href="viewgallery.php">View Gallery</a></strong></p>
<?php echo $gallery; ?>
<form id="form1" name="form1" method="post" action="">
<table width="536" height="256" border="0">
<tr>
<td width="262">Album Name</td>
<td width="264"><input name="title" type="text" id="title" size="50" /></td>
</tr>
<tr>
<td>Description</td>
<td><textarea name="description" id="description" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td>Date</td>
<script language="javascript" type="text/javascript" src="datetimepicker.js">
</script>
<td><input type="Text" name="lastdate" id="lastdate" > <a href="javascript:NewCal('lastdate','ddmmmyyyy',false,24)"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a></td>
</tr>
<tr>
<td>Time</td>
<td><input name="time" type="text" id="time" value="<?php echo date("h:i:s"); ?>" size="25" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="createalbum" id="createalbum" value="Create Abum" onclick="return generate()"/></td>
</tr>
</table>
</form>
<p> </p>
</div>
<div class="projects">
<div class="item"></div>
<div class="item">
<div class="cl"> </div>
</div>
</div>
</div>
<?php
include("sidebar.php");
?>
<div class="cl"> </div>
</div>
<div class="shadow-l"></div>
<div class="shadow-r"></div>
<div class="shadow-b"></div>
</div>
<?php
include("footer.php");
?>