This commit is contained in:
2022-07-16 19:22:20 -04:00
parent 2f6050fb08
commit 1a6bade648
6 changed files with 148 additions and 134 deletions
-28
View File
@@ -129,33 +129,7 @@ class Dash extends Users_Controller {
}
private function activeProjects(){
$jbx = "''/proj/thisjob''";
$mysql = "SELECT '<b>ID:</b><a href=\"#\" onclick=\"showJobModal('''||mc.contract||''');\" >'||mc.contract||'</a><br><b>Timeline:</b>'||mc.timeline_days||' day(s)<br><b>Price:</b>'||mc.price*0.01 AS Project,"
. " '<b>Title: </b>'||mc.title||'<br><b>Description: </b>'||mc.description AS description,'\/proj\/thisjob' AS qpath, mc.id AS offer_id,"
. " (CASE WHEN mc.status=4 THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"Review\">' "
. " WHEN mc.status = 1 AND mc.delivery_date > now() THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-success btn-xs btn-block\" value=\"View\">' "
. " WHEN mc.status = 1 AND mc.delivery_date <now() THEN '<span class=\"label label-flat border-danger text-danger-600\">PastDue</span>' "
. " ELSE '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"View\">' END) AS manage "
. " FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id "
. " WHERE mc.member_id = " . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() "
. " OR mc.client_id =" . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() LIMIT 4";
$query = $this->db->query($mysql);
$this->load->library('table');
$this->table->set_template($this->template);
$this->table->set_heading(array('data' => 'Job', 'style' => 'width:180px'), 'Title/Description', array('data' => '', 'style' => 'width:100px; cellpadding:0px;'));
$data['job_table'] = $this->table->generate($query);
$data['job_table_result'] = $query->result(); // used in new impl.
return $data;
}
private function dashTaskMessage() {
$data = array();
$jbx = "''/proj/thisjob''";
@@ -198,8 +172,6 @@ class Dash extends Users_Controller {
$data["dash_title"] = "Pending Offer(s)";
if ($num > 0) {
// array('data' => 'Added', 'style' => 'width:80px')
$this->table->set_heading(array('data' => 'Added', 'style' => 'width:80px'), 'Title', array('data' => '', 'style' => 'width:80px'));
+8
View File
@@ -520,6 +520,14 @@ class Jobs extends Users_Controller {
public function viewjob() {
$data = $this->getSessionArray();
//-----------------active job
$acp = array();
$acp = $this->activeProjects();
$data['job_table'] = $acp['job_table'];
$data['job_table_result'] = $acp['job_table_result'];
//------------------------------------------
$jobOfferID = $this->input->post('jobOfferID');
$data['jobOfferID'] = $jobOfferID;
if ($jobOfferID != '') {
@@ -26,6 +26,34 @@ class Users_Controller extends WRB_Controller {
$this->data = $this->getSessionArray();
}
public function activeProjects(){
$jbx = "''/proj/thisjob''";
$mysql = "SELECT '<b>ID:</b><a href=\"#\" onclick=\"showJobModal('''||mc.contract||''');\" >'||mc.contract||'</a><br><b>Timeline:</b>'||mc.timeline_days||' day(s)<br><b>Price:</b>'||mc.price*0.01 AS Project,"
. " '<b>Title: </b>'||mc.title||'<br><b>Description: </b>'||mc.description AS description,'\/proj\/thisjob' AS qpath, mc.id AS offer_id,"
. " (CASE WHEN mc.status=4 THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"Review\">' "
. " WHEN mc.status = 1 AND mc.delivery_date > now() THEN '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-success btn-xs btn-block\" value=\"View\">' "
. " WHEN mc.status = 1 AND mc.delivery_date <now() THEN '<span class=\"label label-flat border-danger text-danger-600\">PastDue</span>' "
. " ELSE '<input type=submit onclick=\"return post_nav_find_action($jbx, '||mc.id||')\" name=\"manage\" class=\"btn btn-info btn-xs btn-block\" value=\"View\">' END) AS manage "
. " FROM members_jobs_contract mc LEFT JOIN members m ON m.id=mc.client_id "
. " WHERE mc.member_id = " . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() "
. " OR mc.client_id =" . $_SESSION['member_id'] . " AND mc.status IN (1,2,4) AND mc.delivery_date > now() LIMIT 4";
$query = $this->db->query($mysql);
$this->load->library('table');
$this->table->set_template($this->template);
$this->table->set_heading(array('data' => 'Job', 'style' => 'width:180px'), 'Title/Description', array('data' => '', 'style' => 'width:100px; cellpadding:0px;'));
$data['job_table'] = $this->table->generate($query);
$data['job_table_result'] = $query->result(); // used in new impl.
return $data;
}
public function getSessionArray() {
$data["current_date"] = date('l jS \of F Y h:i:s A');
$data['username'] = $_SESSION['username']; // = $this->input->post('username');
@@ -0,0 +1,91 @@
<form method="post" name="job_nav_find" action="">
<input type="hidden" name="jobOfferID" value="">
<input type="hidden" name="jobID" value="">
</form>
<div class="card card-xl-stretch mb-5 mb-xl-8">
<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">Active Projects</span>
</h3>
<div class="card-toolbar">
</div>
</div>
<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 head-->
<thead>
<tr class="border-0">
<th class="p-0 min-w-180px">Job</th>
<th class="p-0 min-w-180px">Title/Description</th>
<th class="p-0 min-w-90px">Status</th>
<th class="p-0 min-w-50px"></th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
<?php
foreach ($job_table_result as $row)
{
?>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> <?= $row->project ?></a>
</td>
<td><?= $row->description ?></td>
<td class="text-end">
<span class="badge badge-light-success"></span>
</td>
<td class="text-end">
<a href="#" onclick="return post_nav_find_action('<?=$row->qpath?>','<?=$row->offer_id?>')" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary">
<!--begin::Svg Icon | path: icons/duotune/arrows/arr064.svg-->
<span class="svg-icon svg-icon-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<rect opacity="0.5" x="18" y="13" width="13" height="2" rx="1" transform="rotate(-180 18 13)" fill="black" />
<path d="M15.4343 12.5657L11.25 16.75C10.8358 17.1642 10.8358 17.8358 11.25 18.25C11.6642 18.6642 12.3358 18.6642 12.75 18.25L18.2929 12.7071C18.6834 12.3166 18.6834 11.6834 18.2929 11.2929L12.75 5.75C12.3358 5.33579 11.6642 5.33579 11.25 5.75C10.8358 6.16421 10.8358 6.83579 11.25 7.25L15.4343 11.4343C15.7467 11.7467 15.7467 12.2533 15.4343 12.5657Z" fill="black" />
</svg>
</span>
<!--end::Svg Icon-->
</a>
</td>
</tr>
<?php
}
?>
</tbody>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<script type="text/javascript">
<!--
function post_nav_find_action(what, value) {
// alert(what);
document.job_nav_find.action = what + '';
document.job_nav_find.jobOfferID.value = value;
document.job_nav_find.jobID.value = value;
document.job_nav_find.submit();
return false;
}
// -->
</script>
@@ -70,32 +70,9 @@
</div>
</div>
<div class="col-xl-6">
<div class="card card-xl-stretch mb-5 mb-xl-8">
<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">Active Projects</span>
</h3>
<div class="card-toolbar">
</div>
</div>
<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">
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
<?php
include(VIEWPATH.'/compo/comp_active_jobs.php');
?>
</div>
<!--end::Col-->
</div>
@@ -105,6 +82,13 @@
<!--
function acceptOffer() {
let confirmAction = confirm("Are you sure to accept this offer?");
if (confirmAction) {
} else {
return true;
}
$('#offer_result').html('Processing...');
$('#accept_submit').prop('disabled', true);
$.ajax({
@@ -118,6 +102,13 @@
}
function rejectOffer() {
let confirmAction = confirm("Are you sure to reject this offer?");
if (confirmAction) {
} else {
return true;
}
$('#offer_result').html('Processing...');
$('#reject_submit').prop('disabled', true);
//alert(element.value);
+4 -80
View File
@@ -70,79 +70,9 @@
</div>
</div>
<div class="col-xl-6">
<div class="card card-xl-stretch mb-5 mb-xl-8">
<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">Active Projects</span>
</h3>
<div class="card-toolbar">
</div>
</div>
<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 head-->
<thead>
<tr class="border-0">
<th class="p-0 min-w-180px">Job</th>
<th class="p-0 min-w-180px">Title/Description</th>
<th class="p-0 min-w-90px">Status</th>
<th class="p-0 min-w-50px"></th>
</tr>
</thead>
<!--end::Table head-->
<!--begin::Table body-->
<tbody>
<?php
foreach ($job_table_result as $row)
{
?>
<tr>
<td>
<a href="#" class="text-dark fw-bolder text-hover-primary mb-1 fs-6"> <?= $row->project ?></a>
</td>
<td><?= $row->description ?></td>
<td class="text-end">
<span class="badge badge-light-success"></span>
</td>
<td class="text-end">
<a href="#" onclick="return post_nav_find_action('<?=$row->qpath?>','<?=$row->offer_id?>')" class="btn btn-sm btn-icon btn-bg-light btn-active-color-primary">
<!--begin::Svg Icon | path: icons/duotune/arrows/arr064.svg-->
<span class="svg-icon svg-icon-2">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<rect opacity="0.5" x="18" y="13" width="13" height="2" rx="1" transform="rotate(-180 18 13)" fill="black" />
<path d="M15.4343 12.5657L11.25 16.75C10.8358 17.1642 10.8358 17.8358 11.25 18.25C11.6642 18.6642 12.3358 18.6642 12.75 18.25L18.2929 12.7071C18.6834 12.3166 18.6834 11.6834 18.2929 11.2929L12.75 5.75C12.3358 5.33579 11.6642 5.33579 11.25 5.75C10.8358 6.16421 10.8358 6.83579 11.25 7.25L15.4343 11.4343C15.7467 11.7467 15.7467 12.2533 15.4343 12.5657Z" fill="black" />
</svg>
</span>
<!--end::Svg Icon-->
</a>
</td>
</tr>
<?php
}
?>
</tbody>
<!--end::Table body-->
</table>
</div>
<!--end::Table-->
</div>
<!--end::Tap pane-->
</div>
</div>
<!--end::Body-->
</div>
<!--end::Tables Widget 5-->
<?php
include(VIEWPATH.'/compo/comp_active_jobs.php');
?>
</div>
<!--end::Col-->
</div>
@@ -240,15 +170,10 @@
<!--end::Row-->
<?php //include('common/othermenu.php'); ?>
<?php //include('common/iconmenu.php'); ?>
<script type="text/javascript">
<!--
function post_nav_find_action(what, value) {
// alert(what);
// alert(what);
document.post_nav_find.action = what + '';
document.post_nav_find.jobOfferID.value = value;
document.post_nav_find.jobID.value = value;
@@ -259,7 +184,6 @@
</script>
<script type="text/javascript">
<!--