PK

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

<?php
include("header.php");
$eid=$_GET['id'];

$qry_gallery="select * from jeff_galleryimage where id='".$eid."'";
$mysql_query=$db->get_a_line($qry_gallery);
// $fetch_galleryimage=stripslashes($mysql_query['galleryimage']);

if(isset($_POST['submit']))
{
	$qry1=mysql_query("SELECT * FROM jeff_gallery image where id='".$eid."'");
	$row=mysql_fetch_array($qry1);
	$path = "uploads/gallery/".$row['galleryimage']."";
	unlink($path);
	
	
	$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);
		
		echo $qry=mysql_query("UPDATE jeff_galleryimage SET image_date='".$currentdatetime."',galleryimage='".$file_name."' where id='".$eid."'");
		//echo "Success";
	}
	else
	{
		print_r($errors);
	}
	
	
	
	echo "<script>window.location='gallery_management.php?msg=update';</script>";
}

?>

<script>
function validation();
{
	if(document.editimage.uploadedimage.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:15px;">Upload Image Here</p>';
		editimage.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
												$qry1=mysql_query("SELECT * FROM jeff_galleryimage where id='".$eid."'");
												$row=mysql_fetch_array($qry1);
												$file_name=$row['galleryimage'];
											?>
											<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="editimage" onsubmit="return validation();" 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"><?php echo $file_name; ?></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>	
														<input class="btn btn-success col-md-offset-4" type="submit" name="submit" value="submit">
											</form>													
										</div>
								</div>
								</div><div class="col-lg-1"></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