PK

ADDRLIN : /proc/self/root/home/bw2hgtn172qm/www/jeffharrismusic.com/admin/
FLL :
Current File : //proc/self/root/home/bw2hgtn172qm/www/jeffharrismusic.com/admin/galleryimage_upload.php

<?php
include("header.php");
if(isset($_POST['submit']))
{
	$errors=array();
	$current_timess = str_replace(':', '_', $current_time);
	$file_name=$current_date.'_'.$current_timess.'_'.$_FILES["uploadedimage"]["name"];
	$file_size=$_FILES["uploadedimage"]["size"];
	$temp_name=$_FILES["uploadedimage"]["tmp_name"];
	$file_type=$_FILES["uploadedimage"]["type"];
	$target_path="uploads/gallery/";
	$file_ext=strtolower(end(explode('.',$_FILES["uploadedimage"]["name"])));
	$expensions=array("jpeg","jpg","png");
	
	if(in_array($file_ext,$expensions)=== false)
	{
		$errors[]="Choose PNG or JPEG Files";
	}
	
	if($file_size > 5242880)
	{
		$errors[]='File Size should be less than 5MB';
	}

	if(empty($errors)==true)
	{
		move_uploaded_file($temp_name,$target_path.$file_name);
		$qry=mysql_query("INSERT into jeff_galleryimage(image_date,galleryimage,status) values ('".$currentdatetime."','".$file_name."','1')");
		//echo "Success";
	}
	else
	{
		print_r($errors);
	}
	
	
	
	
	echo "<script>window.location='gallery_management.php?msg=sucss';</script>";
}

?>

<script>
function validate()
{
	if(document.galleryupload.uploadedimage.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:5px;">Upload Image</p>';
		galleryupload.uploadedimage.focus();
		return false;
	}
	else
	{
		document.getElementById("error_message").innerHTML='<span><font style="color:#FF0000"></font></span>';
	}
	return true;
}
</script>

	<div id="wrapper">
		<?php 
			include('sidebar.php');
		?>
		<div id="page-wrapper" class="gray-bg">
			
			<!--------- Title ------------>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>Gallery</h2>
						<ol class="breadcrumb">
							<li>
								<a href="#">Home</a>
							</li>
                        
							<li class="active">
								<strong>Add Image</strong>
							</li>
						</ol>
                </div>
                <div class="col-lg-2"> </div>
			</div>
		   <!--------- End Title ------------>
			<div class="wrapper wrapper-content">
                <div class="row animated fadeInRight">
					<div class="col-md-12">
						<div class="ibox float-e-margins">
							<div class="ibox-title">
								<a href="galleryimage_upload.php" class="btn btn-danger btn-xs" id="header_hover" ><h5 >Add</h5></a>
								<a href="gallery_management.php" class="btn btn-primary btn-xs"  ><h5 >Gallery</h5></a>
							    <div class="pull-right tooltip-demo ibox-tools">
									<a class="collapse-link">
                                    <i class="fa fa-chevron-up"></i>
									</a>
									<a class="close-link">
                                    <i class="fa fa-times"></i>
									</a>
								</div>
							</div>
						<!---------------- Form ---------------->
							<div class="ibox-content">
								<div class="row">
									<div class="col-lg-1"></div>
									<div class="col-lg-10">
										<div class="col-lg-12">
												<h5>Upload Image In Gallery</h5>
												<?php
												echo $image_success;
												?>
												<span id="error_message" style="color:#FF0000;font-size:14px;text-align: center;font-weight:600;"></span>
												<form method="post" enctype="multipart/form-data" name="galleryupload" onsubmit="return validate();" action="">
													<div class="fileinput fileinput-new input-group" data-provides="fileinput">
														<div class="form-control" data-trigger="fileinput">
															<i class="glyphicon glyphicon-file fileinput-exists"></i> 
															<span class="fileinput-filename"></span>
														</div>
														<span class="input-group-addon btn btn-default btn-file">
														<!--<span class="fileinput-new">Select file</span>
														<span class="fileinput-exists">Change</span>
														<input type="file" name="...">--->
														<span class="fileinput-new">Select file</span>
														<input type="file" id="uploadedimage" name="uploadedimage"  placeholder="Enter upload image Here...">
														<span class="fileinput-exists">Change</span>
														</span>
														<a href="#" class="input-group-addon btn btn-default fileinput-exists" data-dismiss="fileinput">Remove</a>
													</div>	
													<div>
														<input class="btn btn-success col-md-offset-4" type="submit" name="submit" value="submit">
													</div>
												</form>													
											</div>
									</div>
									<div class="col-lg-1"></div>
								</div>
							</div><!-- card -->
						</div>
					</div>
				</div>
			</div>
			
<?php			
include("footer.php")
?>			
		</div>
	</div>
			
	<script>
        $(document).ready(function(){
            $('.dataTables-example').DataTable({
                pageLength: 25,
                responsive: true,
                dom: '<"html5buttons"B>lTfgitp',
                buttons: [
                    { extend: 'copy'},
                    {extend: 'csv'},
                    {extend: 'excel', title: 'ExampleFile'},
                    {extend: 'pdf', title: 'ExampleFile'},

                    {extend: 'print',
                     customize: function (win){
                            $(win.document.body).addClass('white-bg');
                            $(win.document.body).css('font-size', '10px');

                            $(win.document.body).find('table')
                                    .addClass('compact')
                                    .css('font-size', 'inherit');
                    }
                    }
                ]

            });

        });

    </script>


PK 99