PK

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

<?php 
/*Project Name : Jeff Harris Music
Author :R.Thenaruvi
Created on : 3/04/2018
File Description : File showing details of admin on changing his login option details
Last Modified on : 
Creeted by :R.Thenaruvi
Modified by : */

include("header.php");

@extract($_POST);
$cur_date_time=date("Y-m-d H:i:s", time());

$query="SELECT * FROM jeff_event where id='".$_GET['id']."'";


/*$mysql_query=$db->get_a_line($query);
$fetch_event_title=stripslashes($mysql_query['event_title']);
$fetch_note=stripslashes($mysql_query['notes']);
$fetch_event_date=stripslashes($mysql_query['event_date']);
$fetch_eventstart_time=stripslashes($mysql_query['eventstart_time']);
$fetch_eventend_time=stripslashes($mysql_query['eventend_time']);
$fetch_event_image=stripslashes($mysql_query['event_image']);
*/

$result = mysqli_query($conn, $query);
$row = mysqli_fetch_row($result);

$fetch_event_title=stripslashes($row['1']);
$fetch_note=stripslashes($row['2']);
$fetch_event_date=stripslashes($row['3']);
$fetch_eventstart_time=stripslashes($row['4']);
$fetch_eventend_time=stripslashes($row['5']);
$fetch_event_image=stripslashes($row['6']);
// result should be 46:00:00

/*if($submit)
{
	$event_title=addslashes($event_title);
	$note=addslashes($note);
	$event_date=addslashes($event_date);
	$eventstart_time=addslashes($eventstart_time);
	$eventend_time=addslashes($eventend_time);


	$qry1="SELECT * FROM jeff_event where id='".$_GET['id']."'";
	$row = mysqli_query($conn, $qry1);
	
	$errors=array();
	$current_timess = str_replace(':', '_', $current_time);
	
	$file_size=$_FILES["uploadedimage"]["size"];
	$temp_name=$_FILES["uploadedimage"]["tmp_name"];
	$file_type=$_FILES["uploadedimage"]["type"];
	$target_path="uploads/event_image/";
	$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($_FILES["uploadedimage"]["name"]!=''){
		$file_name=$current_date.'_'.$current_timess.'_'.$_FILES["uploadedimage"]["name"];
	}
	if($file_name!='')
	{
		if($row['event_image']!='')
		{
			$path = "uploads/event_image/".$row['event_image']."";
			unlink($path);
		}
		move_uploaded_file($temp_name,$target_path.$file_name);
		//$subqry=",event_image='$file_name'";
	}
	
		$event_time= $event_time.':00'.':00';
		$eventstart_time= $eventstart_time.':00'.':00';
		$eventend_time= $eventend_time.':00'.':00';
	//print_r($_POST);
	
	
	
   $mysql= "UPDATE jeff_event SET event_title='$event_title',notes='$note',event_date='$event_date',eventstart_time='$eventstart_time',eventend_time='$eventend_time',event_image='$file_name' where id='".$_GET['id']."'";
   
   $row= mysqli_query($conn, $mysql);
   
	echo "<script>window.location='event_management.php?msg=update';</script>";
	
}*/


if(isset($_POST['submit']))

{
    $event_title=addslashes($event_title);
	$note=addslashes($note);
	$event_date=addslashes($event_date);
	$eventstart_time=addslashes($eventstart_time);
	$eventend_time=addslashes($eventend_time);
	$event_image=addslashes($event_image);
    
	$qry1="SELECT * FROM jeff_event where id='".$_GET['id']."'";
	$result = mysqli_query($conn, $qry1);
	
	$errors=array();
	$current_times = str_replace(':', '_', $current_time);
	
	$curdatetimesss=$current_date.'_'.$current_times;
	$file_size=$_FILES["uploadedimage"]["size"];
	$temp_name=$_FILES["uploadedimage"]["tmp_name"];
	$file_type=$_FILES["uploadedimage"]["type"];
	$target_path="uploads/event_image/";
	$file_ext=explode('.',$_FILES["uploadedimage"]["name"]);
	$expensions=array("jpeg","jpg","png");
		$event_time= $event_time.':00'.':00';
		$eventstart_time= $eventstart_time.':00'.':00';
		$eventend_time= $eventend_time.':00'.':00';
	
	if($_FILES["uploadedimage"]["name"]!='')
	{
		$event_image=$curdatetimesss.'_'.$_FILES["uploadedimage"]["name"];
		$file_name=$event_image;
		if($file_name!='')
	{
		if($row['event_image']=='')
		{
			$path = "uploads/event_image/".$row['event_image']."";
			unlink($path);
		}
		
		move_uploaded_file($temp_name,$target_path.$file_name);
		$qry1= "UPDATE jeff_event SET event_title='$event_title',notes='$note',event_date='$event_date',eventstart_time='$eventstart_time',eventend_time='$eventend_time',event_image='$file_name'  where id='".$_GET['id']."'";
	
	}
	 	
	  
	
	}
	else
	{
	    	$qry1= "UPDATE jeff_event SET event_title='$event_title',notes='$note',event_date='$event_date',eventstart_time='$eventstart_time',eventend_time='$eventend_time'  where id='".$_GET['id']."'";
	
	}

		   
	
	     $result = mysqli_query($conn, $qry1);
	     
	     
	
		
	echo "<script>window.location='event_management.php';</script>";
}

?>

 <script>

 function validate()
 {
	 
	 if(document.event_management.event_title.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:5px;">Enter Your Event Title</p>';
		event_management.event_title.focus();
		return(false);	
	}
	else
	{
		document.getElementById("error_message").innerHTML='<span><font color="#FF0000"></font></span>';
	}
	 
	if(document.event_management.event_date.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:5px;">Enter Your Event Date</p>';
		event_management.event_date.focus();
		return(false);	
	}
	else
	{
		document.getElementById("error_message").innerHTML='<span><font color="#FF0000"></font></span>';
	}
if(document.event_management.event_time.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:5px;">Enter Your Event Time</p>';
		event_management.event_time.focus();
		return(false);	
	}
	else
	{
		document.getElementById("error_message").innerHTML='<span><font color="#FF0000"></font></span>';
	}
if(document.event_management.event_image.value=="")
	{
		document.getElementById("error_message").innerHTML='<p style="color:red;padding-top:5px;">Enter Your Event Image</p>';
		event_management.event_image.focus();
		return(false);	
	}
	else
	{
		document.getElementById("error_message").innerHTML='<span><font color="#FF0000"></font></span>';
	}

 }

 </script>

<style>
#header_hover:hover{
	background-color:#000 ! important;
}
</style>


<div id="wrapper">
	<?php include('sidebar.php');?>
        <div id="page-wrapper" class="gray-bg">
         <?php include('afterlog_top.php'); ?>
			<!--------- Title ------------>
            <div class="row wrapper border-bottom white-bg page-heading">
                <div class="col-lg-10">
                    <h2>Add Event</h2>
                    <ol class="breadcrumb">
                        <li>
                            <a href="dashboard.php">Home</a>
                        </li>
                        
                        <li class="active">
                            <strong>Add Event</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="" class="btn btn-danger btn-xs" id="header_hover" ><h5 >Add</h5></a>
								<a href="event_management.php" class="btn btn-primary btn-xs" ><h5 >Event Management</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">
								
									<span id="error_message" style="color:#FF0000;font-size:14px;text-align: center;font-weight:600;"></span>
									
								
										<form class="form-horizontal" enctype="multipart/form-data" id="event_management" name="event_management" method="POST" action="" onsubmit="return validate();">
											<div class="form-group">
												<label style="text-align:left;" class="col-lg-4 control-label">Event Title <span style="color:#FF0000;">*</span></label>
												<div class="col-lg-8"> 
													<input style="color:#777;" name="event_title" id="event_title" placeholder="Event Title" type="text" class="form-control"  value="<?php echo $fetch_event_title; ?>"/>
													
												</div>
											</div>
											<div class="form-group">
												<label style="text-align:left;" class="col-lg-4 control-label">Note:</label>
												<div class="col-lg-8"> <span id="id_video_name" style=	"color:#FE2805;font-size:14px; font-weight:600"> </span>
													<input style="color:#777;" name="note" id="note" placeholder="Note" type="text" class="form-control"  value="<?php echo $fetch_note; ?>"/>
													
												</div>
											</div>
											 <div class="form-group" id="data_1">
												<label style="text-align:left;" class="col-lg-4 control-label">Date<span style="color:#FF0000;">*</span></label>
													<div class="col-lg-8 input-group date">
														<span class="input-group-addon"><i class="fa fa-calendar"></i></span><input style="color:#777;" name="event_date" id="event_date"  placeholder="yyyy-mm-dd"type="text" class="form-control"  value="<?php echo $fetch_event_date; ?>"/>
													</div>
											</div>
											<?php 
											// print_r (explode(":",$fetch_eventstart_time));
											?>
											<div class="form-group">
												<label style="text-align:left;" class="col-lg-4 control-label">Start Time <span style="color:#FF0000;">*</span></label>
												<div class="col-lg-8"> 
												<?php
													$sql_time=explode(':',$fetch_eventstart_time);
													$starttime=$sql_time[0];
												?>
												<select name="eventstart_time" id="eventstart_time" class="form-control">
														<option value="">Time Hours</option>
														<option value="00" <?php if($starttime=='00'){ echo "selected='selected'";  } ?>>12:00 am</option>
														  <option value="01"<?php if($starttime=='01'){ echo "selected='selected'";  } ?>>1:00 am</option>
														  <option value="02"<?php if($starttime=='02'){ echo "selected='selected'";  } ?>>2:00 am</option>
														  <option value="03"<?php if($starttime=='03'){ echo "selected='selected'";  } ?>>3:00 am</option>
														  <option value="04"<?php if($starttime=='04'){ echo "selected='selected'";  } ?>>4:00 am</option>
														  <option value="05"<?php if($starttime=='05'){ echo "selected='selected'";  } ?>>5:00 am</option>
														  <option value="06"<?php if($starttime=='06'){ echo "selected='selected'";  } ?>>6:00 am</option>
														  <option value="07"<?php if($starttime=='07'){ echo "selected='selected'";  } ?>>7:00 am</option>
														  <option value="08"<?php if($starttime=='08'){ echo "selected='selected'";  } ?>>8:00 am</option>
														  <option value="09"<?php if($starttime=='09'){ echo "selected='selected'";  } ?>>9:00 am</option>
														  <option value="10"<?php if($starttime=='10'){ echo "selected='selected'";  } ?>>10:00 am</option>
														  <option value="11"<?php if($starttime=='11'){ echo "selected='selected'";  } ?>>11:00 am</option>
														  <option value="12"<?php if($starttime=='12'){ echo "selected='selected'";  } ?>>12:00 pm</option>
														  <option value="13"<?php if($starttime=='13'){ echo "selected='selected'";  } ?>>1:00 pm</option>
														  <option value="14"<?php if($starttime=='14'){ echo "selected='selected'";  } ?>>2:00 pm</option>
														  <option value="15"<?php if($starttime=='15'){ echo "selected='selected'";  } ?>>3:00 pm</option>
														  <option value="16"<?php if($starttime=='16'){ echo "selected='selected'";  } ?>>4:00 pm</option>
														  <option value="17"<?php if($starttime=='17'){ echo "selected='selected'";  } ?>>5:00 pm</option>
														  <option value="18"<?php if($starttime=='18'){ echo "selected='selected'";  } ?>>6:00 pm</option>
														  <option value="19"<?php if($starttime=='19'){ echo "selected='selected'";  } ?>>7:00 pm</option>
														  <option value="20"<?php if($starttime=='20'){ echo "selected='selected'";  } ?>>8:00 pm</option>
														  <option value="21"<?php if($starttime=='21'){ echo "selected='selected'";  } ?>>9:00 pm</option>
														  <option value="22"<?php if($starttime=='22'){ echo "selected='selected'";  } ?>>10:00 pm</option>
														  <option value="23"<?php if($starttime=='23'){ echo "selected='selected'";  } ?>>11:00 pm</option>
												</select>
												</div>
											</div>
											
											<div class="form-group">
												<label style="text-align:left;" class="col-lg-4 control-label">End Time <span style="color:#FF0000;">*</span></label>
												<div class="col-lg-8"> <select name="eventend_time" id="eventend_time" class="form-control">
												<option value="<?php echo $fetch_eventend_time;?>">Time Hours</option>
													<?php
													    $sql_time1=explode(':',$fetch_eventend_time);
														$endtime=$sql_time1[0];
														/* $sql_time1=explode(':',$fetch_eventend_time);
														$hh1=$sql_time1[0];
														for($i=0; $i<=23; $i++) 
														{
														print "<option ".sprintf("%02d",$i)."";
														if($hh1 == $i) { print " selected='selected'"; }
														print ">".sprintf("%02d",$i)."</option>";
														} */	
													?>
													 <option value="">Time Hours</option>
														<option value="00" <?php if($endtime=='00'){ echo "selected='selected'";  } ?>>12:00 am</option>
														  <option value="01"<?php if($endtimee=='01'){ echo "selected='selected'";  } ?> >1:00 am</option>
														  <option value="02" <?php if($endtime=='02'){ echo "selected='selected'";  } ?>>2:00 am</option>
														  <option value="03"<?php if($endtime=='03'){ echo "selected='selected'";  } ?>>3:00 am</option>
														  <option value="04"<?php if($endtime=='04'){ echo "selected='selected'";  } ?>>4:00 am</option>
														  <option value="05"<?php if($endtime=='05'){ echo "selected='selected'";  } ?>>5:00 am</option>
														  <option value="06"<?php if($endtime=='06'){ echo "selected='selected'";  } ?>>6:00 am</option>
														  <option value="07"<?php if($endtime=='07'){ echo "selected='selected'";  } ?>>7:00 am</option>
														  <option value="08"<?php if($endtime=='08'){ echo "selected='selected'";  } ?>>8:00 am</option>
														  <option value="09"<?php if($endtime=='09'){ echo "selected='selected'";  } ?>>9:00 am</option>
														  <option value="10"<?php if($endtime=='10'){ echo "selected='selected'";  } ?>>10:00 am</option>
														  <option value="11"<?php if($endtime=='11'){ echo "selected='selected'";  } ?>>11:00 am</option>
														  <option value="12"<?php if($endtime=='12'){ echo "selected='selected'";  } ?>>12:00 pm</option>
														  <option value="13"<?php if($endtime=='13'){ echo "selected='selected'";  } ?>>1:00 pm</option>
														  <option value="14"<?php if($endtime=='14'){ echo "selected='selected'";  } ?>>2:00 pm</option>
														  <option value="15"<?php if($endtime=='15'){ echo "selected='selected'";  } ?>>3:00 pm</option>
														  <option value="16"<?php if($endtime=='16'){ echo "selected='selected'";  } ?>>4:00 pm</option>
														  <option value="17"<?php if($endtime=='17'){ echo "selected='selected'";  } ?>>5:00 pm</option>
														  <option value="18"<?php if($endtime=='18'){ echo "selected='selected'";  } ?>>6:00 pm</option>
														  <option value="19"<?php if($endtime=='19'){ echo "selected='selected'";  } ?>>7:00 pm</option>
														  <option value="20"<?php if($endtime=='20'){ echo "selected='selected'";  } ?>>8:00 pm</option>
														  <option value="21"<?php if($endtime=='21'){ echo "selected='selected'";  } ?>>9:00 pm</option>
														  <option value="22"<?php if($endtime=='22'){ echo "selected='selected'";  } ?>>10:00 pm</option>
														  <option value="23"<?php if($endtime=='23'){ echo "selected='selected'";  } ?>>11:00 pm</option>
														</select>
												</div>
											</div>
											
											<div class="form-group">
												<label style="text-align:left;" class="col-lg-4 control-label">Event Image</label>
												
												<div class="fileinput fileinput-new input-group col-lg-8" data-provides="fileinput">
												<div class="form-control" data-trigger="fileinput">
													<i class="glyphicon glyphicon-file fileinput-exists"></i> 
													<span class="fileinput-filename"><?php echo $fetch_event_image;?></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>
											
											<div class="form-group">
												<div class="col-lg-offset-4 col-lg-12">
													<input class="btn btn-danger" type="button"  value="Back" onclick="window.history.back();">
													<input class="btn btn-success" type="submit" name="submit" value="submit">
												
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
		    </div>
			<?php
			
include("footer.php")
?>
		</div>
	</div>
</body>

<script>
 //================ Date Picker==============
        $(document).ready(function(){

            $('#data_1 .input-group.date').datepicker({
                todayBtn: "linked",
                keyboardNavigation: false,
                forceParse: false,
                calendarWeeks: true,
                autoclose: true,
				format: "yyyy-mm-dd"
            });
          
            $(".touchspin3").TouchSpin({
                verticalbuttons: true,
                buttondown_class: 'btn btn-white',
                buttonup_class: 'btn btn-white'
            });

            $('.dual_select').bootstrapDualListbox({
                selectorMinimalHeight: 160
            });


        });
</script>


PK 99