Files
WrenchBoradWeb/www/application/views/jobs/view_manageinterest.php
T
2022-08-31 18:25:55 -04:00

370 lines
15 KiB
PHP

<form method="post" name="post_nav_find" action="">
<input type="hidden" name="jobOfferID" value="">
<input type="hidden" name="interest_id" value="<?php echo $interest_id; ?>">
</form>
<script type="text/javascript">
<!--
function post_nav_find_action(what, value) {
// alert(what);
document.post_nav_find.action = what + '';
document.post_nav_find.jobOfferID.value = value;
document.post_nav_find.submit();
return false;
}
// -->
</script>
<script type="text/javascript">
<!--
function post_nav_other_interest(what, value) {
// alert(what);
document.post_nav_find.action = what + '';
document.post_nav_find.interest_id.value = value;
document.post_nav_find.submit();
return false;
}
// -->
</script>
<!-- Main content -->
<?php include('common/jobstrip.php'); ?>
<!--begin::Row-->
<div class="row g-5 g-xl-8">
<?php include('common/jobside.php'); ?>
<!--begin::Col-->
<div class="col-xl-9">
<!--begin::Tables Widget 5-->
<div class="card card-xl-stretch mb-5 mb-xl-8">
<!--begin::Header-->
<div class="card-header border-0 pt-5">
<h3 class="card-title align-items-start flex-column">
<a href="#" onclick="showOfferModal('<?= $offer_code; ?>');" >Interest in <?php echo $offer_code; ?></a>
</h3>
<div class="card-toolbar">
</div>
</div>
<!--end::Header-->
<!--begin::Body-->
<div class="card-body py-3">
<div class="tab-content">
<!--begin::Tap pane-->
<div class="tab-pane fade show active" id="kt_table_widget_5_tab_1">
<!-- /main charts -->
<div class="row">
<div class="col-md-8">
<div class="panel panel-flat" >
<div class="card mb-5 mb-xl-10" id="kt_profile_details_view">
<!--begin::Card header-->
<div class="card-header cursor-pointer">
<!--begin::Card title-->
<div class="card-title m-0">
<h3 class="fw-bolder m-0"><?php echo $dash_title; ?> [<a href="#" onclick="showOfferModal('<?= $offer_code; ?>');" ><?php echo $offer_code; ?></a>]</b>-<?php echo $title; ?></h3>
</div>
<!--end::Card title-->
</div>
<div class="card-body p-9">
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Name</label>
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $client; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Member Since</label>
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $client_added; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Jobs Completed</label>
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $total_jobs_completed; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Jobs Active</label>
<div class="col-lg-8">
<span class="fw-bolder fs-6 text-gray-800"><?php echo $total_jobs_active; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Jobs Uncompleted</label>
<div class="col-lg-8 fv-row">
<span class="fw-bold text-gray-800 fs-6"><?php echo $total_jobs_uncompleted; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">Pending Offers</label>
<div class="col-lg-8 fv-row">
<span class="fw-bold text-gray-800 fs-6"><?php echo $total_pending_offers; ?></span>
</div>
</div>
<div class="row mb-7">
<label class="col-lg-4 fw-bold text-muted">% Completion</label>
<div class="col-lg-8 fv-row">
<span class="fw-bold text-gray-800 fs-6"></span>
</div>
</div>
<div class="row mb-7">
<table class="table align-middle gs-0 gy-4">
<tbody>
<tr><td style='width: 33%;'><div id="cancdiv"><input type=submit id="submit_canc" name="rmview" onclick="return cancelInterest(<?php echo $interest_id; ?>);" class="btn btn-danger btn-sm btn-block" value="Cancel Job"></div></td>
<td><div id="rejtdiv"><input type=submit id="submit_rejt" name="rmview" onclick="return rejectInterest(<?php echo $interest_id; ?>);" class="btn btn-warning btn-sm btn-block" value="Reject"></div></td>
<td style='width: 33%;'><div id="accdiv"><input type=submit id="submit_acc" name="mview" onclick="return acceptInterest(<?php echo $interest_id; ?>);" class="btn btn-info btn-sm btn-block" value="Accept"></div></td> </tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="panel panel-flat" >
<div class="panel-heading">
<h6 class="panel-title"><b>Others Interested in this Task</b></h6>
</div>
<?php echo $job_others_interest_table; ?>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail" style="background-color: #CEECF5; padding: 10px;">
Message to <b><?php echo $client; ?></b><hr size='1'>
<form name='offer_message' >
<div class="thumb">
<textarea rows="3" name='offermessage' class="textarea form-control" placeholder="Enter message..."></textarea>
</div>
<div class="text-right" style="text-align: right; margin-top: 5px;">
<button type="submit" id="submit_yourmessage_<?= $offer_code; ?>" onclick="return OMessage('<?= $offer_code; ?>',<?= $interest_id; ?>);" name='btn_submit' class="btn btn-primary btn-sm btn-block" onclick="SendMessage();return false;">Send</button>
</div>
</form>
<div class="caption">
<div id='msg_result_<?= $offer_code; ?>'>
<? echo $message_list; ?>
</div>
</div>
</div>
</div>
</div>
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
<div class="content-wrapper">
<?php include('common/jobstrip.php'); ?>
<script type="text/javascript">
<!--
/*
$(document).ready(function(){
$('#modal_theme_primary').on('show.bs.modal', function(event){
var btn = $(event.relatedTarget);
var time = btn.data('time');
//$('#time').text(time);
alert('here!');
});
});
*/
function showModal(interest_id) {
if (typeof event !== 'undefined') {
event.preventDefault();
}
// collect data - either from forms or from data variables
var id = $(this).data('id');
// load the modal content with a loader gif and message
$('#modal-content').html('Loading...');
// show modal window
$('#modal_theme_primary').modal('show');
// do the ajax bit
var post_data = {
'interest_id': id,
};
$.ajax({
url: "/jobs/jobinterest_modal?interest_id=" + interest_id
}).done(function (data) {
//alert(data);
$('#modal-content').html(data);
});
}
function showOfferModal(contact_id) {
if (typeof event !== 'undefined') {
event.preventDefault();
}
// collect data - either from forms or from data variables
var id = $(this).data('id');
// load the modal content with a loader gif and message
$('#modal-content').html('Loading...');
// show modal window
$('#modal_theme_primary').modal('show');
// do the ajax bit
var post_data = {
'interest_id': id,
};
$.ajax({
url: "/jobs/offerdetail_modal?contact_id=" + contact_id
}).done(function (data) {
//alert(data);
$('#modal-content').html(data);
});
}
function OMessage(offer_code, interest_id) {
if (document.offer_message.offermessage.value == '') {
alert('Missing message!');
return false;
}
//$('#msg_result_'+offer_code).html('Processing...');
$('#submit_yourmessage_' + offer_code).prop('disabled', true);
$.ajax({
url: "/jobs/offermessage?proc=NCOMPLETE&offer_code=" + offer_code + "&interest_id=" + interest_id + "&yourmessage=" + offer_message.offermessage.value
}).done(function (data) {
$('#msg_result_' + offer_code).html(data);
document.offer_message.offermessage.value = '';
$('#submit_yourmessage_' + offer_code).prop('disabled', false);
});
return false;
}
// -->
</script>
</div>
<!-- /main content -->
<!-- Basic modal -->
<div id="modal_theme_primary" class="modal fade">
<div class="modal-dialog">
<div class="modal-content" id="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title"><?php echo $client; ?></h5>
</div>
<div class="modal-body">
<h6 class="text-semibold">Introduction</h6>
<p><?php echo $client_description; ?>.</p>
<hr>
<h6 class="text-semibold">Skills</h6>
<p><?php echo $skills_set; ?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-link" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- /basic modal -->
<script type="text/javascript">
<!--
function acceptInterest(interest_id) {
if (confirm("Are you sure you want to accept this interest in your task ?")) {
// do something
} else {
return false;
}
//$('#req_completion').html('Processing...');
//$('#req_completion_submit').prop('disabled', true);
$('#submit_acc').prop('disabled', true);
$.ajax({
url: "/jobs/procinterest?proc=ACCEPT&interest_id=" + interest_id
}).done(function (data) {
$('#accdiv').html(data);
$('#submit_acc').prop('disabled', false);
});
return false;
}
function rejectInterest(interest_id) {
if (confirm("Are you sure you want to reject this interest in your task ?")) {
// do something
} else {
return false;
}
//$('#req_completion').html('Processing...');
//$('#req_completion_submit').prop('disabled', true);
$('#submit_rejt').prop('disabled', true);
$.ajax({
url: "/jobs/procinterest?proc=REJECT&interest_id=" + interest_id
}).done(function (data) {
$('#rejtdiv').html(data);
$('#submit_rejt').prop('disabled', false);
});
return false;
}
function cancelInterest(interest_id) {
if (confirm("Are you sure you want to cancel this task completely ?")) {
// do something
} else {
return false;
}
//$('#req_completion').html('Processing...');
//$('#req_completion_submit').prop('disabled', true);
$('#submit_canc').prop('disabled', true);
$.ajax({
url: "/jobs/procinterest?proc=CANCEL&interest_id=" + interest_id
}).done(function (data) {
$('#cancdiv').html(data);
$('#submit_canc').prop('disabled', false);
});
return false;
}
// -->
</script>