ok

Mini Shell

Direktori : /home2/selectio/www/y1jobportal.in/admin/
Upload File :
Current File : /home2/selectio/www/y1jobportal.in/admin/slider-edit.php

<?php include 'header.php'; 
$ids = $_GET['id'];

$statement = $pdo->prepare("SELECT * FROM  `tbl_slider` WHERE id=?");
$statement->execute(array($ids));
$query = $statement->fetchAll(PDO::FETCH_ASSOC);
$totalData = $statement->rowCount();
if($totalData>0){
   
?>

<div class="page-wrapper" >
	<div class="page-content">
	    
	    
<form id="form_details" autocomplete="off">	   

    <input type="hidden" class="form-control" id="ids" name="ids" value="<?=$ids?>"  required>

	    <div class="row" style="margin-top: 25px;" id="content-div">
	        <div class="col-lg-12">
	             <div class="card" style="margin: 0px 10px 30px 10px; box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;">
			         <div class="card-body">


					<div class="row">
					    <div class="col-12 col-lg-12">
    				                   <a href="slider.php" class="btn btn-danger btn-sm" style="float: right;"><i class="bi bi-arrow-left-circle"></i> Back to List</a>
                                        <b style="font-weight: bolder;font-size: 17px;">Update Slider Image</b> 
        				                 <hr>
    				        </div>
    				        
    				        
					<div class="col-md-4 p-2">
                                <div class="form-group">
                                    <label class="required pb-1" for="name">Slider Image</label> 
                                    <?php if($query[0]['photo']!=''){ ?>
                                        <img src="<?=$query[0]['photo']?>" style="width:30%;height:100px;">
                                    <?php } ?>
                                    <input type="file" name="slider_image" id="slider_image"  class="form-control">
                                    <input type="hidden" name="old_slider_image" id="old_slider_image" value="<?=$query[0]['photo']?>" class="form-control">
                                </div>
                    </div>

					
					
					<div class="col-md-4 p-2">
                    	<label class="required pb-1">Status</label>
                            <select class="form-control" name="status">
                                <option value="1" <?php if( $query[0]['status'] == 1){ echo 'selected'; } ?> >Active</option>
                                <option value="0" <?php if( $query[0]['status'] == 0){ echo 'selected'; } ?> >In-Active</option>
                            </select>
                    </div>
                    </div>
	                    </div>
                	</div>
                	<div class="col text-center">
						<button type="submit" class="btn btn-primary px-5">Update Details</button>
					</div>
            	</div>
	        </div>
</form>	        


<div class="container" id="loading-div" style="display: none;">
        <center> <img src="img/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
</div>
                    
                    
                    
                    
                    <div class="container" id="success-div" style="display: none; margin-top: 40px;">
                        <center><b class="blinking" style="font-size:22px;">Slider Image Updated Successfully...</b><br>
                            <img src="img/success.gif" style="width: 250px;">
                            <br><br><a href="slider.php"><button class="btn btn-danger"><i class="fa fa-list"></i> Back to Slider's List</button></a>
                            &nbsp;&nbsp;
                            <a href="slider-edit.php?id=<?=$ids?>"><button class="btn btn-info"><i class="fa fa-refresh"></i> Reset Form</button></a>
                        </center>
                    </div>
	        
	        
	 </div>
</div>

<?php } ?>
<?php include 'footer.php';  ?>

<script>
$(document).ready(function(){
    $('.select2').select2();
    $('#form_details').on('submit', function(e){
                e.preventDefault();
                console.log("Form Submitted Successfully !!!")
                $('#loading-div').show();
                $('#content-div').hide();
                var formData = new FormData(this);
                formData.append('type', 'edit_slider');
                        $.ajax({
                            url: 'api/edit-slider.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            enctype: 'multipart/form-data',
                            success: function (response) {
                                if(response['status']==200){
                                     success(response['message']);
                                     $('#loading-div').hide();
                                     $('#form_details').trigger("reset");
                                     $('#success-div').show();
                                }else{
                                    warning(response['message']);
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                }
                            }
                        });
                
    });     
});
</script>

Zerion Mini Shell 1.0