File: /home/nyiet8349bzl/Backup/sbc_back/homedir/public_html/bsadmin-portal/add-image.php
<?php
//error_reporting('0');
include("../classes/site_class.php");
$obj = new Site();
if($_SESSION['admin']['user_id']=='')
{
echo "<script>window.location.href='index.php'</script>";
}
if(isset($_REQUEST['Submit']) and !empty($_REQUEST['Submit']) and ($_REQUEST['Submit']=='Submit'))
{
$resp = $obj->addImage();
if($resp==7)
{
echo "<script>alert('Image file is greater then 15 MB')</script>";
}
if($resp==8)
{
echo "<script>alert('Image file extension not accepted')</script>";
}
if($resp==0)
{
echo "<script>alert('Required parameter missing')</script>";
}
if($resp==5)
{
echo "<script>alert('Image add Successfully')</script>";
echo "<script>window.location.href='manage-image.php'</script>";
}
if($resp==1 )
{
echo "<script>alert('Image is not save, Please try later')</script>";
echo "<script>window.location.href='add-image.php'</script>";
}
}
?>
<!doctype html>
<html class="fixed">
<head>
<title>Image :: SBSC Admin</title>
<?php include("inc-head.php");?>
</head>
<body>
<section class="body">
<!-- start: header -->
<?php include("inc-header.php"); ?>
<!-- end: header -->
<div class="inner-wrapper">
<!-- start: sidebar -->
<?php include("inc-navigation.php"); ?>
<!-- end: sidebar -->
<section role="main" class="content-body">
<header class="page-header">
<h2>Image Management</h2>
<div class="right-wrapper pull-right">
<ol class="breadcrumbs">
<li>
<a href="dashboard.php">
<i class="fa fa-home"></i>
</a>
</li>
<li><span>Image Management</span></li>
<li><span>Add Event Image</span></li>
</ol>
<a class="sidebar-right-toggle"></a>
</div>
</header>
<!-- start: page -->
<div class="row">
<div class="col-lg-12">
<section class="panel">
<header class="panel-heading">
<div class="panel-actions">
<a href="#" class="panel-action panel-action-toggle" data-panel-toggle></a>
<a href="#" class="panel-action panel-action-dismiss" data-panel-dismiss></a>
</div>
<h2 class="panel-title">Add Event Image</h2>
</header>
<div class="panel-body">
<form class="form-horizontal form-bordered" name="image_form" method ="Post" action="" enctype="multipart/form-data">
<div class="form-group">
<label class="control-label col-sm-3" for="category">Image Category*</label>
<div class="col-sm-9">
<select name="category" class="form-control state" id="category">
<option value="">--Select Image Category--</option>
<?php echo $obj->getImageList($profileData['id']); ?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="inputDefault">Select Image*</label>
<div class="col-md-9">
<input type="file" class="form-control" name="image[]" multiple />
<p class="hint">You can select more than one image. Only jpg, jpeg, png</span>
</div>
</div>
<div class="row">
<div class="col-sm-3">
</div>
<div class="col-sm-1 text-center">
<input type="submit" class="btn btn-primary" name="Submit" value="Submit" onclick="return Validate_Image();"/>
</div>
</div>
</form>
</div>
</section>
</div>
</div>
</section>
</div>
</section>
<?php include("inc-footer.php"); ?>
</body>
</html>