Files
WrenchBoradWeb/www/application/views/jobs/view_joboffer.php
T
2022-08-14 03:41:23 -04:00

296 lines
13 KiB
PHP

<!-- Main content -->
<form method="post" name="post_nav_find" action="">
<input type="hidden" name="jobID" value="<?php echo $jobID; ?>">
</form>
<script type="text/javascript">
<!--
function post_nav_find_action(what, value) {
alert(what);
document.post_nav_find.action = what + '';
document.post_nav_find.jobID.value = value;
document.post_nav_find.submit();
return false;
}
// -->
</script>
<?php include('common/jobstrip.php'); ?>
<!--begin::Row-->
<div class="row g-5 g-xl-8">
<!--begin::Col-->
<div class="col-xl-6">
<!--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">
<span class="card-label fw-bolder fs-3 mb-1"><a href='/jobs/manage'>Retrun</a> : <?=$job_table_row->title?> </span>
</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">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4">
<!--begin::Table body-->
<tbody>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> Description</a>
</td>
<td><?= $job_table_row->description ?></td>
</tr>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> Timeline</a>
</td>
<td><?= $job_table_row->day_timeline ?></td>
</tr>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> Price</a>
</td>
<td><?= $job_table_row->price ?></td>
</tr>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> Created</a>
</td>
<td><?= $job_table_row->create_date ?></td>
</tr>
<tr><td colspan='2'>Please provide clear deliverables for this task.</td></tr>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> Delivery Detail</a>
</td>
<td>
<form name="job_detail">
<textarea cols="18" rows="3" id='jobdescription' name='jobdescription' class="wysihtml5 wysihtml5-min form-control" style="height:180px;" placeholder="Enter description here ..."> <?= $job_description ?></textarea>
</form>
</td>
</tr>
</tbody>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
<!--begin::Col-->
<div class="col-xl-6">
<!--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">
</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">
<!--begin::Table container-->
<div class="table-responsive">
<!--begin::Table-->
<?php
if (isset($active_job_data) && count($active_job_data) > 0 ){
echo "<div class=\"col-xl-12 bg-light-info rounded p-5 mb-7\">";
echo "This job is currently active : " ;
foreach ($active_job_data as $jr){
echo $jr->offer_code." - ". $jr->expire;
}
echo " </div>";
}
?>
<table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4">
<div class="col-xl-12 bg-light-danger rounded p-5 mb-7">
<h5>Offer this job to public</h5>
<form name="offer_public">
<?php echo $my_post_duration; ?>
<div style="text-align:right; padding-top:10px;"> <input id="public_submit" type="button" name='send' class="btn btn-primary btn-sm" value='Show Task to Public' onclick="return offerPublic();"><div id="public_result"></div></div>
</form>
</div>
<div class="col-xl-12 bg-light-danger rounded p-5 mb-7">
<h5>Offer this job to individual.</h5>
<form name="offer_individual">
<input type="text" class="form-control" id="rec_email" name="rec_email" value='' placeholder="Enter email to send offer...">
<div style="text-align:right; padding-top:10px;"><input id="individ_submit" type="button" class="btn btn-primary btn-sm" name='send' value='Send Offer to Individual' onclick="return offerIndividual();"><div id="individ_result"></div></div>
</form>
</div>
<div class="col-xl-12 bg-light-danger rounded p-5 mb-7">
<h5>Offer this job to your <a href='/jobs/jobgrp'>Group</a>.</h5>
<form name="offer_group">
<?php echo $my_job_group; ?>
<div style="text-align:right; padding-top:10px;"><input id="group_submit" type="button" name='send' class="btn btn-primary btn-sm" value='Send Offer to Group' onclick="return offerGroup();"><div id="group_result"></div></div>
</form>
</div>
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
</div>
<!--end::Col-->
</div>
<!--end::Row-->
<script type="text/javascript">
<!--
function isEmail(email) {
var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
return regex.test(email);
}
function offerIndividual() {
var email = document.offer_individual.rec_email.value;
if (email == '' || !isEmail(email)) {
alert('You must enter e-mail!');
return false;
}
if (document.job_detail.jobdescription.value == '') {
alert('Missing job description!');
return false;
}
var job_description = encodeURIComponent(JSON.stringify(document.job_detail.jobdescription.value));
// alert(job_description);
$('#individ_result').html('Processing...');
$('#individ_submit').prop('disabled', true);
$.ajax({
url: "/jobs/processjob_individ?jobID=<?php echo $jobID; ?>&rec_email=" + encodeURIComponent($('#rec_email').val()) + "&jobdescription=" + job_description
}).done(function (data) {
$('#individ_result').html(data);
document.offer_individual.rec_email.value = '';
$('#individ_submit').prop('disabled', false);
});
return false;
}
function offerGroup() {
if (document.offer_group.job_group.value == '') {
alert('You must select group!');
return false;
}
if (document.job_detail.jobdescription.value == '') {
alert('Missing job description!');
return false;
}
var job_description = encodeURIComponent(JSON.stringify(document.job_detail.jobdescription.value));
$('#group_result').html('Processing...');
$('#group_submit').prop('disabled', true);
//alert(element.value);
$.ajax({
url: "/jobs/processjob_group?jobID=<?php echo $jobID; ?>&job_group=" + document.offer_group.job_group.value + "&jobdescription=" + job_description
}).done(function (data) {
$('#group_result').html(data);
document.offer_group.job_group.value = '';
$('#group_submit').prop('disabled', false);
});
return false;
}
function offerPublic() {
if (document.offer_public.job_duration.value == '') {
alert('You must select duration!');
return false;
}
if (document.job_detail.jobdescription.value == '') {
alert('Missing job description!');
return false;
}
var job_description = encodeURIComponent(JSON.stringify(document.job_detail.jobdescription.value));
$('#public_result').html('Processing...');
$('#public_submit').prop('disabled', true);
//alert(element.value);
$.ajax({
url: "/jobs/processjob_public?jobID=<?php echo $jobID; ?>&job_duration=" + document.offer_public.job_duration.value + "&jobdescription=" + job_description
}).done(function (data) {
$('#public_result').html(data);
document.offer_group.job_group.value = '';
$('#public_submit').prop('disabled', false);
});
return false;
}
$(document).ready(function () {
$('#jobdescription').trumbowyg({
btns: [
['viewHTML'],
['undo','redo'],// Only supported in Blink browsers
['formatting'],
['strong','em','del'],
['superscript','subscript'],
['link'],
/* ['insertImage'], */
['justifyLeft','justifyCenter','justifyRight','justifyFull'],
['unorderedList','orderedList'],
['horizontalRule'],
['removeformat'],
['fullscreen']
]
});
/*$('#jobdescription').wysihtml5();
var length_limit = 500;
$('#jobdescription').data("wysihtml5").editor.observe("load", function () {
editor.composer.element.addEventListener("keyup", function () {
// enter your listener-triggered code or function call here
var content = $(this).html();
if (content.length > length_limit) {
//alert(length_limit + " characters is the limit!");
//$(this).html(content.substr(0, length_limit));
}
});
alert('Templae CSS is uterly broken and I do not know how to fix it. JS works though...');
});*/
});
// -->
</script>