Skip to content

Commit

Permalink
Update admin.php
Browse files Browse the repository at this point in the history
Foundation CSS used for styles
  • Loading branch information
rajagopalpalani committed Aug 22, 2014
1 parent 52b5f03 commit 0cee829
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<html>
<head>
<title>Admin Portal</title>
<link rel="stylesheet" type="text/css" href="css/foundation.css" />
<link rel="stylesheet" type="text/css" href="css/foundation.min.css" />
<style>
.height{
min-height:400px;
Expand All @@ -9,11 +11,24 @@
</head>
<body>
<?php include('config.php'); ?>
<div class="admin-home height">
<div class="row">
<div class="admin-home large-12 columns">
<h1>Admin Panel</h1>
<div class="search large-4 columns">
<input type="search" name="search" id="search">
</div>
<div class="add height">
<div class="search large-4 columns">
<input type="submit" name="search-submit" value="Search" id="search-submit">
</div>
<div class="row">
<div class="large-12 columns" id="show-details"></div>
</div>
</div>
</div>
<div class="row">
<div class="add large-12 columns" style="display:none;">
<h1>Add</h1>
<div class="addform">
<div class="addform large-4 columns">
<?php
if($_POST['add-submit']){
$productname = $_POST['productname'];
Expand All @@ -22,15 +37,15 @@
$productimage = file_get_contents($_FILES['productimage']['tmp_name']);
$productimage = mysql_real_escape_string($productimage);
$sql="Insert into project (productname,productcity,productimage,productdate) VALUES ('$productname','$productcity','$productimage','$productdate')";
$addproduct = mysql_query($sql,$link);
$addproduct = mysql_query($sql,$con);
if($addproduct){
echo "<script>alert('Added Successfully');</script>";
}else{
echo "<script>alert('Failed to Added');</script>";
}
mysql_close($link);
mysql_close($con);
}
?>
?>
<form action="admin.php" method="post" enctype="multipart/form-data">
<p>Product Name : <input name="productname" id="productname" type="text"/></p>
<p>Product City : <input name="productcity" id="productcity" type="text"/></p>
Expand All @@ -40,7 +55,9 @@
</form>
</div>
</div>
<div class="modify height">
</div>
<div class="row">
<div class="modify large-12 columns" style="display:none;">
<h1>Edit Details</h1>
<div class="editform">
<?php
Expand All @@ -59,7 +76,7 @@
}
mysql_close($link);
}
?>
?>
<form action="admin.php" method="post" enctype="multipart/form-data">
<p>Product Name : <input name="productname" id="productname" type="text" value=""/></p>
<p>Product City : <input name="productcity" id="productcity" type="text" value=""/></p>
Expand All @@ -68,8 +85,11 @@
<input type="submit" name="edit-submit" value="Update" />
</form>
</div>

</div>
</div>
<div class="row">
<div class="view height"></div>
</div>
</body>
</html>

0 comments on commit 0cee829

Please sign in to comment.