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/job-assign-add.php

<?php include 'header.php'; ?>
<div class="page-wrapper" >
	<div class="page-content">
	    
	    	   
    <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;">Assign Job</b> 
        				              <hr>
    				             </div>
    				             <div class="row" >
    				                 
    				                 
    				                 <!--executive role-->
                            <?php if($_SESSION['y1_jobs']['role_json'] !=2 ){?>
    				                 <div class="col-sm-3">
                                        <div class="form-group">
                                            <label class="control-label" for="state_id">State</label>
                                            <select name="state_id" onchange="get_district()" class="form-control select2" style="width:100%" id="state_id">
                                                <option value="">All State</option>
                                                <?php 
                                                
                                                    $statement = $pdo->prepare("SELECT * FROM `state` WHERE status=1");
                                                    $statement->execute();
                                                    $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                                    foreach ($resultss as $result) { 
                                                ?>
                                                        <option  value="<?=$result['id']?>"><?=$result['state_name']?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    
                                    <div class="col-sm-3">
                                        <div class="form-group">
                                            <label class="control-label" for="district_id">District</label>
                                            <select name="district_id" id="district_id" class="form-select select2" style="font-size: 12px;" required>
               
		                                    </select>
                                        </div>
                                    </div>
                            <?php } else{ ?>   				                 
                                    
                                        <input type="hidden" value="<?=$_SESSION['y1_jobs']['state']?>" name="state_id" id="state_id"  />
                                        <input type="hidden" value="<?=$_SESSION['y1_jobs']['city']?>" name="district_id" id="district_id"  />
                                    
                                <?php }    ?>
                                    
            				        <div class="col-sm-3">
                                        <div class="form-group">
                                            <label class="control-label" for="category_ids">Select Category</label>
                                            <select name="category_ids" onchange="Categories()" class="form-control select2" style="width:100%" id="category_ids">
                                                <option value="">All Category</option>
                                                <?php 
                                                
                                                    $statement = $pdo->prepare("SELECT * FROM `category` WHERE status=1");
                                                    $statement->execute();
                                                    $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                                    foreach ($resultss as $result) { 
                                                ?>
                                                        <option  value="<?=$result['id']?>"><?=$result['name']?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                    
                                    
                                    
                                    <div  hidden class="col-sm-3">
                                        <div class="form-group">
                                            <label for="sub_category" class="form-label required">Select Subcategory</label>
                                		    <select class="form-control select2" id="sub_category" name="sub_category" >
                                		            <option value="">Select Category First !</option>
                                                        
                                		    </select>
                                        </div>
                                    </div>
                                    
                                    
                                    <div class="col-sm-3">
                                        <div class="form-group">
                                            <label for="client_id" class="form-label required">Select Client</label>
                                		    <select class="form-control select2" id="client_id" name="client_id" >
                                		            <option value="">Select Category First !</option>
                                                        
                                		    </select>
                                        </div>
                                    </div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label class="control-label" for="job_details">Job Details</label>
                                            <select name="job_details" class="form-control select2" style="width:100%" id="job_details">
                                                <option value="">Select Job Details</option>
                                                <?php 
                                                
                                                    $statement = $pdo->prepare("SELECT jv.*,sub_category.name as sub_category_name
                                                                                    FROM `tbl_job_vacancy` jv
                                                                                    LEFT JOIN sub_category ON sub_category.id=jv.sub_category WHERE jv.status=1");
                                                    $statement->execute();
                                                    $resultss = $statement->fetchAll(PDO::FETCH_ASSOC); 
                                                    foreach ($resultss as $result) { 
                                                ?>
                                                        <option  value="<?=$result['id']?>" data-subcategory="<?=$result['sub_category']?>"><?=$result['sub_category_name']?>  ( Job Vacancy - <?=$result['job_vacancy']?>) - Experience - (<?=$result['minimum_experience']?>)</option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
        				    	 </div>
        				    	 <div  class="row">
        				    	     <div class="col-sm-12">
                                        <div class="col text-center">
                        					<span class="btn btn-primary btn-sm" onclick="get_employee()" style="margin-top: 15px;"><i class="bi bi-arrow-left-circle"></i> Get Employee Details</span>
                        				</div>
                                    </div>
        				    	 </div>
        				    	 
        				    	 <div id="action_details"></div>
        				    	 
        				    	 
        				    	 </div>
        				     </div>
                        </div>
                	</div>
                
            	</div>
    </div>    

<style>
    .form-group{
        padding:3px;
    }
</style>


<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>
$(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>


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

function Categories(){
    var category_id = $('#category_ids').val();
    get_subcategory(category_id);
    get_client(category_id);
}

$("#client_id").change(function () {
     get_jobs_details();
});
function get_jobs_details(){
        $('#job_details').empty(); 
        
        var client_id = $("#client_id").val();
   
        $.ajax({
                    url: 'api/get-subcategory-api.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_job_details',client_id:client_id},
                    success: function (response) {
                        console.log(response);
                         if(response['error']==false){
                                var m='<option value="">Select Any One Job Requirements</option>';
                                for(var n=0;n<response['data'].length;n++){
                                    
                                        m+='<option value='+response['data'][n]['id']+' data-subcategory="'+response['data'][n]['sub_category']+'">'+response['data'][n]['sub_category_name']+' ( Job Vacancy - '+response['data'][n]['job_vacancy']+') - Experience - ('+response['data'][n]['minimum_experience']+')</option>';
                 
                                }
                                $('#job_details').append(m);  
                        }else{
                            var m='<option value="">No Job Details Found</option>';
                            $('#job_details').append(m);  
                        }
                    }
                });
}





/*$("#category_ids,#sub_category,#client_id, #district_id, #state_id, #job_details").change(function () {
     job_details();
});*/

function get_employee() {
   
    var job_details = $('#job_details').val();
    if(job_details!=""){
        get_employee_job_request_details();
    }else{
        alert("select Job Requirement Type");
    }
     
}



function get_employee_job_request_details(){
    console.log('Payment Integration');
    var category_ids = $('#category_ids').val() || null;
    var sub_category = $('#sub_category').val() || null;
    var client_id = $('#client_id').val() || null;
    var state_id = $('#state_id').val() || null;
    var district_id = $('#district_id').val() || null;
    var job_details = $("#job_details").val();
    
    var selectedOption = $('#job_details option:selected');
    var JobSubcategory = selectedOption.data('subcategory');
    
                $.ajax({
                    url: 'api/get-subcategory-api.php',
                    type: 'post',
                    dataType: 'json',
                    data: {type:'get_jobs_availabilty',category_ids:category_ids,sub_category:sub_category,client_id:client_id, 
                                    state_id:state_id, district_id:district_id, job_details:job_details, JobSubcategory:JobSubcategory},
                                    
                    success: function (response) {
                        if(response['error']==false){
                            $('#action_details').empty();
                            $('#action_details').append(response['data']);  
                        }else{
                            
                            $('#action_details').empty();
                            $('#action_details').append('<div style="text-align: center;height:50%;">No Data Found</div>');
                        }
                    }
                    
                });
}


function get_subcategory(category_id){
    $('#sub_category').empty(); 
            $.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>';
                 
                                }
                                $('#sub_category').append(m);  
                        }else{
                            var m='<option value="">No Subcategory Found</option>';
                            $('#sub_category').append(m);  
                        }
                    }
                });
}
function get_client(client_id){
        
     
    $('#client_id').empty(); 

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



function JobAssign(){
    
    
    var checkValues = $('input[name=assign_ids]:checked').map(function(){
                return $(this).val();
        }).get();
        
    var job_details = $("#job_details").val();
    var interview_date = $("#interview_date").val();
    
    if(job_details==''){
        alert("Please Choose Job Details");
        return;
    }
            
            
    if(checkValues != ''){
        var r = confirm("Confirm If You Want to Job Assign for Employees?");
	    console.log(checkValues);
        if (r == true) {
            var ids=[];
            ids = checkValues;
            $.ajax({
                url: 'api/bulk_updates.php',
                type: 'post',
                data: {type:'bulk_job_assign',assign_id:ids, job_details:job_details, interview_date:interview_date},
                success: function(response){
                alert(response);
                job_details();
                }
            });
        }
    }else{
        alert("Please Select Minimum One Employee for Assign");
    }
    
    
    
  
}

</script>

Zerion Mini Shell 1.0