ok

Mini Shell

Direktori : /home2/selectio/www/y1jobportal.in/admin/
Upload File :
Current File : /home2/selectio/www/y1jobportal.in/admin/recruitment-add.php

<?php include 'header.php'; ?>
<div class="page-wrapper" >
	<div class="page-content">

<?php if((($_SESSION['y1_organization']['payment_status']) == 0)&&($_SESSION['y1_jobs']['role_json']!=2) && ($_SESSION['y1_jobs']['id']!= 1)){ 
    

header("Location: job_recruitment.php");
exit();




} 

?>
	    
<form id="form_details">	   
	    <div class="row" 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 g-3" style="padding: 0px 0px 20px 0px;">
    				               <div class="col-12 col-lg-12">
    				                   <a  href="job_recruitment.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;">Add Recruitment Details</b> 
        				                 <hr>
    				                </div>
    				                
    				            <div class="col-sm-4">
                                    <div class="form-group">
                                        <label for="category_id" class="form-label required">Select Client</label>
                            		    <select class="form-control select2" onchange="get_category()" id="client_id" name="client_id" required >
                            		            <option value="">All Client</option>
                                                    <?php 
                                                        $condition='';
                                                    
                                                        if(isset($_SESSION['y1_organization'])){
                                                            
                                                            $condition.=" AND id = ".$_SESSION['y1_organization']['id'];
                                                           
                                                        }
                                                        error_log("SELECT * FROM `client` WHERE status='Active' ".$condition);
                                                    
                                                        $company = $pdo->prepare("SELECT * FROM `client` WHERE status='Active' and payment_status = 1 ".$condition);
                                                        $company->execute();
                                                        $company_results = $company->fetchAll(PDO::FETCH_ASSOC); 
                                                        foreach ($company_results as $company_datas) { 
                                                            
                                                    ?>
                                                            <option  value="<?=$company_datas['id']?>" data-option="<?= $company_datas['category_id'] ?>" cat_id="<?=$company_datas['category_id']?>" ><?=$company_datas['company_name']?></option>
                                                    <?php } ?>
                            		    </select>
                                    </div>
                                </div>
                                
                                <div class="col-sm-4">
                                    <div class="form-group">
                                        <label for="subcategory_id" class="form-label required">Select Category</label>
                            		    <select class="form-control select2" onchange="get_subcategory()" id="category_id" name="cate_id" required >
                            		            <option value="" >All Category</option>
                            		    </select>
                                    </div>
                                </div>
                                
    				                
    				            <div class="col-sm-4">
                                    <div class="form-group">
                                        <label for="subcategory_id" class="form-label required">Select Subcategory</label>
                            		    <select class="form-control select2"  id="subcategory_id" name="category_id" required >
                            		            <option value="" >All Subcategory</option>
                            		    </select>
                                    </div>
                                </div>
    				                
    				                
    					        <div class="col-12 col-lg-4">
        						    <label for="vacancy" class="form-label required">How Many Vacancy</label>
        						    <input type="number" class="form-control" id="vacancy" name="vacancy" placeholder="Enter Job Vacancy" required>
        				    	</div>
        				    	
        				    	
        				    	<div class="col-12 col-lg-4">
        						    <label for="minimum_experience" class="form-label required">Minimum Experience</label>
        						    <select class="form-control select2" id="minimum_experience" name="minimum_experience" required >
                            		            <option value="0" >Fresher</option>
                            		            <option value="1" >1 Year Experience</option>
                            		            <option value="2" >2 Year Experience</option>
                            		            <option value="3" >3 Year Experience</option>
                            		            <option value="4" >4 Year Experience</option>
                            		            <option value="5" >5 Year Experience</option>
                            		</select>
        				    	</div>
        				    	
        				    	<div class="col-12 col-lg-4">
        						    <label for="salary" class="form-label required">Salary</label>
        						    <input type="text" class="form-control" id="salary" name="salary" placeholder="Enter Salary" required>
        				    	</div>
        				    	
        				    	<!--<div class="col-12 col-lg-4">
        						    <label for="salary" class="form-label required">Min Salary</label>
        						    <input type="text" class="form-control" id="salary" name="min_salary" placeholder="Enter Min Salary" required>
        				    	</div>
        				    	
        				    	<div class="col-12 col-lg-4">
        						    <label for="salary" class="form-label required">Max Salary</label>
        						    <input type="text" class="form-control" id="max_salary" name="max_salary" placeholder="Enter Max Salary" required>
        				    	</div>-->
        				    	
        				    	<div class="col-12 col-lg-4">
        						    <label for="job_description" class="form-label optional">Job Description</label>
        						    <textarea class="form-control" id="job_description" name="job_description" placeholder="Enter Job Description" rows="4" cols="50"></textarea>
        				    	</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 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 class="container" id="success-div" style="display: none; margin-top: 40px;">
                        <center><b class="blinking" style="font-size:22px;">Recruitment Details Added Successfully...</b><br>
                            <img src="image/success.gif" style="width: 250px;">
                            <br><br><a href="job_recruitment.php"><button class="btn btn-warning"><i class="fa fa-list"></i> Back to Recruitment List</button></a>
                            &nbsp;
                            <a href="recruitment-add.php"><button class="btn btn-success"><i class="fa fa-plus"></i> Add Recruitment Details</button></a>
                        </center>
                    </div>
	        
	        
	 </div>
</div>
<?php include 'footer.php';  ?>
<script>


function get_subcategory(){
    
    $('#subcategory_id').empty(); 
    var category_id = $('#category_id').val();
   // var category_id = selectedOption.data('option');
  
            $.ajax({
                    url: 'api/get-subcategory-api.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_subcategory',category_id:category_id},
                    success: function (response) {
                        console.log(response);
                         if(response['error']==false){
                                var m='<option value="">All Subcategory</option>';
                                for(var n=0;n<response['data'].length;n++){
                                    m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['name']+'</option>';
                                }
                                $('#subcategory_id').append(m);  
                        }else{
                            var m='<option value="">No Subcategory Found</option>';
                            $('#subcategory_id').append(m);  
                        }
                    }
                });
}


function get_category(){
    
    $('#category_id').empty(); 
    var selectedOption = $('#client_id option:selected');
    var category_id = $('#client_id option:selected').attr("cat_id");
    console.log(category_id);
            $.ajax({
                    url: 'api/get-subcategory-api.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_category'},
                    success: function (response) {
                        console.log(response);
                         if(response['error']==false){
                                var m='<option value="">All Category</option>';var s='';
                                for(var n=0;n<response['data'].length;n++){
                                    s='';
                                    if(category_id==response['data'][n]['id']){s='selected';}
                                    m+='<option value='+response['data'][n]['id']+' +s+>'+response['data'][n]['name']+'</option>';
                                }
                                $('#category_id').append(m);  
                        }else{
                            var m='<option value="">No Category Found</option>';
                            $('#category_id').append(m);  
                        }
                    }
                });
}


$(document).ready(function(){
    
    $('#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', 'add_vacancy');
                            $.ajax({
                            url: 'apis/subcategory.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();
                                }else{
                                    warning(response['message']);
                                    $('#loading-div').hide();
                                    $('#content-div').show();
                                }
                            }
                        });
                
    });     
});
</script>
<script>
$("#hostel").change(function () {
     get_rooms();
     
     setTimeout(function() {
                get_rooms_available();
            }, 800);
            
     
});

$("#rooms_id").change(function () {
     get_rooms_available();
});





    
function get_rooms(){
    $('#rooms_id').empty(); 
    var hostel_id = $('#hostel').val();
            $.ajax({
                    url: 'api/get-values.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_rooms',hostel_id:hostel_id},
                    success: function (response) {
                        console.log(response);
                        if(response['error']==false){
                                var m='';
                                for(var n=0;n<response['data'].length;n++){
                                    
                                        m+='<option value='+response['data'][n]['id']+'>'+response['data'][n]['room_name']+'</option>';
                 
                                }
                                $('#rooms_id').append(m);  
                        }else{
                            var m='<option value="">No Rooms Found</option>';
                            $('#rooms_id').append(m);  
                        }
                    }
                });
}

function get_rooms_available(){
    $('#bed_id').empty(); 
    var rooms_id = $('#rooms_id').val();
            $.ajax({
                    url: 'api/get-values.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_rooms_availabilty',room_id:rooms_id},
                    success: function (response) {
                        console.log(response);
                        if(response['error']==false){
                                var m='';
                                for(var n=0;n<response['data'].length;n++){
                                    if(response['data'][n]['Room_Status']=='Available'){
                                        m+='<option value="'+response['data'][n]['id']+'">'+response['data'][n]['name']+' - ('+response['data'][n]['Room_Status']+')</option>';
                                    }
                                }
                                $('#bed_id').append(m);  
                        }else{
                            var m='No Beds Found';
                            $('#bed_id').append(m);  
                        }
                    }
                });
}
</script>

Zerion Mini Shell 1.0