File: /mnt/data/kofejob-wp/wp-content/themes/kofejob/template-parts/auth/hire-freelancer-modal.php
<?php
$pid = get_the_ID();
$freelancer_title = '';
$current_user_id = get_current_user_id();
$freelancer_title = __('Hire Freelancer','kofejob');
?>
<div class="modal fade forget_pwd" id="hire-freelancer-modal" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form class="modal-from hire-freelancer-form" method="POST" id="hire-freelancer-form">
<div class="modal-header">
<h5 class="modal-title"><?php echo esc_html($freelancer_title); ?></h5>
<span class="modal-close"><a href="#" data-bs-dismiss="modal" aria-label="Close"><i class="far fa-times-circle orange-text" aria-hidden="true"></i></a></span>
</div>
<div class="modal-body">
<?php
if( is_user_logged_in() )
{
?>
<div class="fr-report-form">
<div class="form-group">
<label><?php echo esc_html__('Choose a Project','kofejob'); ?></label>
<?php
if( is_user_logged_in() )
{
$the_query = new WP_Query(
array(
'author__in' => array( $current_user_id ) ,
'post_type' =>'projects',
'post_status' => 'publish' ,
'orderby' => 'date',
'order' => 'DESC',
)
);
$total_count = $the_query->found_posts;
$report_category = '<select name="project-id" class="form-control general_select">';
if ( $the_query->have_posts() )
{
while ( $the_query->have_posts() )
{
$the_query->the_post();
$project_id = get_the_ID();
$report_category .= '<option value="'. esc_attr( $project_id ) .'">
'. esc_html( get_the_title($project_id) ) .'</option>';
}
}
else
{
$report_category .= '<option value="">'. __('No published project available','kofejob').'</option>';
}
$report_category.='</select>';
echo wp_return_echo($report_category);
}
?>
</div>
<div class="form-group m-0">
<input type="hidden" id="fl_hire_freelancer_nonce" value="<?php echo wp_create_nonce('fl_hire_freelancer__secure'); ?>" />
<a href="javascript:void(0)" id="btn-hire-freelancer" class="btn btn-primary click-btn btn-plan btn-loading" data-freelancer-id="<?php echo esc_attr($pid); ?>"><?php echo esc_html__("Send Invitation", 'kofejob'); ?><span class="bubbles"> <i class="fa fa-circle"></i> <i class="fa fa-circle"></i> <i class="fa fa-circle"></i> </span></a>
</div>
</div>
<?php
}
else
{
?>
<div class="form-group m-0">
<p class="mb-0"><?php echo esc_html__("Please login to send invitation", 'kofejob'); ?></p>
</div>
<?php
}
?>
</div>
</form>
</div>
</div>
</div>