ok

Mini Shell

Direktori : /proc/thread-self/root/home2/selectio/public_html/y1jobportal.in/admin/
Upload File :
Current File : //proc/thread-self/root/home2/selectio/public_html/y1jobportal.in/admin/category.php

<?php include('header.php'); ?>
<div class="page-wrapper">
	<div class="page-content">
	   <div class=" card card-body">
	       <div class="tab-content ">
<!--new order start-->
    <div class="tab-pane fade show active" id="new" role="tabpanel">

	<button type="button" class="btn btn-success btn-sm" data-bs-toggle="modal" style="float: right;" data-bs-target="#exampleVerticallycenteredModal"> <i class="fa fa-plus-circle"></i>  Add Category </button>
<span class="btn btn-secondary btn-sm filter" style="float: right; margin-right: 5px;"><i class="bi bi-funnel"></i> Show/Hide Filter</span>
<b style="font-size:14px;">Category Details</b>
                    
                    
                    


<div class="row" style="margin: 10px 0px 10px 0px;" id="filter">
    
    <div class="col-sm-3 pb-1">
        <div class="form-group">
            <label class="control-label" for="status">Status</label>
            <select name="status" class="form-control select2" style="width:100%" id="status">
                <option value="">All Status</option>
                <option value="1">Active</option>
                <option value="0">In-Active</option>
                
            </select>
        </div>
    </div>
                  
</div>

    <div class="col">

	
		<!-- Modal -->
		<div class="modal fade" id="exampleVerticallycenteredModal" tabindex="-1" aria-hidden="true">
			<div class=" modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<h5 class="modal-title">Category Add</h5>
						<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
					</div>
					<div id="content-div">
    				   <form id="form_details" method="post">	   
                	    <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-md-12 p-2">
                                                <div class="form-group">
                                                    <label class="required pb-1" for="name">Name</label>                                    
                                                    <input type="text" name="name" placeholder="Enter the Category Name" class="form-control tip" id="name"  required="required" />
                                                </div>
                                            </div>
                                            <div class="col-md-12 p-2">
                                                <div class="form-group">
                                                    <label class="required pb-1" for="name">Image</label>                                    
                                                    <input type="file" name="image"  class="form-control tip" id="image"  required="required" />
                                                </div>
                                            </div>
                                        </div>
                	                    </div>
                                	</div>
                                	<div class="col text-center">
                						<button type="submit" class="btn btn-primary px-5">Save Details</button>
                					</div>
                            	</div>
                	        </div>
                    </form>
                    </div>
                    <div class="container" id="success-div" style="display: none;">
                        <center><b class="blinking">Category Added Successfully...</b><br>
                            <img src="image/success.gif" style="height:100px;"><br>
                            <a href="category.php"><button class="btn btn-success"><i class="fa fa-plus"></i>Category List</button></a>
                        </center>
                    </div><br>
                    <div class="container" id="loading-div" style="display: none;">
                        <center> <img src="image/loading.gif" style="width: 250px;"><br><b class="blinking">Processing Please Wait...</b></center>
                    </div>
				</div>
			</div>
		</div>
	</div>
	


<div class="row" style="margin:10px 0px 10px 0px;" >
    
</div>
<div style="overflow-x:scroll;padding: 10px;">
	    <table id="DataTable" style="width: 100% !important;">
	        <thead>
	            <tr>
	                <th class="text-center">Actions</th>
                    <th>S.No</th>
				    <th>Category Name</th>
				    <th>Category Image</th>
					<th>Status</th>
    	        </tr>

	        </thead>
	    </table>
	    

	    </div>
	</div>
<!--new order end-->
			</div>
	    </div>
	</div>
</div>

<style>
    table{ width:100%;font-size:14px;font-family: SFProDisplay-Semibold;}
    th{padding:10px;font-weight:bold;}
    td{padding:7px;}
    tr{margin:5px;}
   thead,tr{
        border: 0 solid transparent;
        margin-bottom: 1.5rem;
        border-radius:5px;
        box-shadow: 0 2px 6px 0 rgb(218 218 253 / 65%), 0 2px 6px 0 rgb(206 206 238 / 54%);
   }.span-success{
        background: #819558;
        color: white;
        padding: 3px 6px 3px 6px;
        border-radius: 15px;
   }
   

   .breadcrumb-title {
    font-size: 20px;
    border-right: 0px solid #ffffff !important;
}
</style>







<?php include('footer.php'); ?>


<script>


    
    $('#form_details').on('submit', function(e){
                e.preventDefault();
                console.log("Form Submitted Successfully !!!")
                $('#loading-div').show();
                $('#content-div').hide();
                $('.btn-close').trigger('click');
                var formData = new FormData(this);
                formData.append('type', 'add_category');
                            $.ajax({
                            url: 'apis/category.php',
                            type: 'post',
                            dataType: 'json',
                            data: formData,
                            cache: false,
                            contentType: false,
                            processData: false,
                            enctype: 'multipart/form-data',
                            success: function (response) {
                                //console.log(response);
                                if(response['status']==200){
                                     success(response['message']);
                                     $('#loading-div').hide();
                                     $('#form_details').trigger("reset");
                                     $('#success-div').show();
                                     getData();
                                    
                                }else{
                                    warning(response['message']);
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                    $('#exampleVerticallycenteredModal').modal('show');
                                }
                            }
                        });
                
    });     


<?php
$data_table = "var status = $('#status').val();
			   var dataTable = $('#DataTable').DataTable( {									     
					processing: true,
					order:[[0,'asc']],
					serverSide: true,
					lengthMenu: [[10, 25, 50, 100], [10, 25, 50, 100]],
                    destroy:true,
                        ajax:{
    						url : 'data-tables/category-data-table.php',
    						data: {type:'get-users-details',status:status},
    						type: 'post',  
    						error: function(){ 
    							$('.example-error').html('');
    							$('#DataTable').css('display','none');
    						}
    					}
				});";
?>


$(document).ready(function() {
    getData();
    function getData(){
        <?=$data_table?>
	}
			    
	$('#status').change(function() {
            getData();
        });
});

function delete_meterial(id){
            var result = confirm("Confirm Want to Delete This Details?");
            if (result) {
                    $.ajax({
                    type: 'POST',
                    url: 'api/delete.php',
                    data: {type:'soft_delete',delete_id:id,table:'tbl_materials'},                  
                    success: function(response) {
                        console.log(response); 
                        emp_datas();
                    }
                });
            }
         }
 function DynamicActive(id){
            var result = confirm("Confirm Want to Active This Details?");
            if (result) {
                $.ajax({
                    type: 'POST',
                    url: 'api/delete.php',
                    data: {type:'dynamic_active',delete_id:id, table:'tbl_materials'},                  
                    success: function(response) {
                        console.log(response); 
                        emp_datas();
                    }
                });
            }
    }        
function emp_datas(){
    <?=$data_table?>
}
/***********************************/        
</script>
<script>
    $(document).ready(function(){
        $('#filter').hide();
        $('.filter').click(function(){
            $("#filter").slideToggle();
            return false;
        });
    });
</script>

Zerion Mini Shell 1.0