This commit is contained in:
2022-07-30 22:46:05 -04:00
parent 37e0433489
commit 7b8d0e2f69
3 changed files with 151 additions and 128 deletions
+28 -15
View File
@@ -405,7 +405,7 @@ class Proj extends Users_Controller {
} }
$data = $this->load_files($data, $jobID); $data = $this->load_files($data, $jobID);
$this->load_files($data, $jobID); //$this->load_files($data, $jobID);
$this->load->model('dash_model'); $this->load->model('dash_model');
$out = $this->dash_model->getDashData($data); $out = $this->dash_model->getDashData($data);
@@ -681,22 +681,22 @@ $data = $this->getSessionArray();
$data['this_job'] = $jbD->this_job; $data['this_job'] = $jbD->this_job;
$data['contract_id'] = $jbD->contract_id; $data['contract_id'] = $jbD->contract_id;
$data['job_detail'] = $jbD->job_detail; $data['job_detail'] = $jbD->job_detail;
/*
$sqlMsg = "SELECT (CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE '<b>['||m.firstname||']->'||jc.created||'</b><br>'||jc.message END) AS msg " $sqlMsg = "SELECT (CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE '<b>['||m.firstname||']->'||jc.created||'</b><br>'||jc.message END) AS msg "
. "FROM jobs_contract_message jc " . "FROM jobs_contract_message jc "
. "LEFT JOIN members m ON m.id=jc.member_id " . "LEFT JOIN members m ON m.id=jc.member_id "
. "WHERE jc.contract='" . $data['contract_id'] . "' ORDER by jc.id DESC"; . "WHERE jc.contract='" . $data['contract_id'] . "' ORDER by jcESC";
/*
$file_icon = "<img style=\"width:25px; height:25px;\" alt=\"Icon\" src=\"/site3/assets/media/svg/files/pdf.svg\">";
$file_icon = "<img style=\"width:25px; height:25px;\" alt=\"Icon\" src=\"/site3/assets/media/svg/files/pdf.svg\">"; $sqlMsg = "SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS date1, '<b>'||(CASE WHEN jc.msg_type='FILE' THEN 'FILE-' ELSE '' END) ||'</b>'||m.firstname AS title,jc.id as msg_id,"
. "(CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE jc.message END) AS msg "
$sqlMsg = "SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS date1, '<b>'||(CASE WHEN jc.msg_type='FILE' THEN 'FILE-' ELSE '' END) ||'</b>'||m.firstname AS title,jc.id as msg_id," . "FROM jobs_contract_message jc "
. "(CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE jc.message END) AS msg " . "LEFT JOIN members m ON m.id=jc.member_id "
. "FROM jobs_contract_message jc " . "WHERE jc.contract='" . $data['contract_id'] . "' ORDER by jc.id DESC";
. "LEFT JOIN members m ON m.id=jc.member_id " */
. "WHERE jc.contract='" . $data['contract_id'] . "' ORDER by jc.id DESC";
$sqlMsg = "SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS date1, '<b>'||(CASE WHEN jc.msg_type='FILE' THEN ' - ' ELSE '' END) ||'</b>'||m.firstname AS title,jc.id as msg_id," $sqlMsg = "SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS date1, '<b>'||(CASE WHEN jc.msg_type='FILE' THEN ' - ' ELSE '' END) ||'</b>'||m.firstname AS title,jc.id as msg_id,"
. "(CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE jc.message END) AS msg, " . "(CASE WHEN jc.msg_type='FILE' THEN '<a target=\"_blank\" href=\"/smedia/" . ($is_live ? "LIVE" : "TEST") . "/contract/" . $data['contract_id'] . "/'||jc.message||'\">'||jc.message||'</a>' ELSE jc.message END) AS msg, "
. " jc.msg_type, jc.message " . " jc.msg_type, jc.message "
@@ -714,6 +714,17 @@ $data = $this->getSessionArray();
$data['message_result'] = $query_message->result(); $data['message_result'] = $query_message->result();
//----------------------------------------------------------------
/* Neeed to get just the files here - part of the display items */
$files_only= [];
foreach ($data['message_result'] as $frow){
if ($frow->msg_type==='FILE'){
$files_only[]=$frow;
}
}
$data['files_only'] =$files_only;
//----- END OFFILYER FILES ONLY OUT ------------------------------
// $data['message_result_show'] = $this->messageAccordion($data['message_result']); // $data['message_result_show'] = $this->messageAccordion($data['message_result']);
@@ -1023,7 +1034,9 @@ $data = $this->getSessionArray();
} }
} }
/*
* This is the file upload function
*/
private function process_files($files) { private function process_files($files) {
$result = ""; $result = "";
$d_txt = ""; $d_txt = "";
@@ -20,7 +20,7 @@ foreach($message_result as $row){
</h2> </h2>
<div id="kt_accordion_1_<?=$row->msg_id?>" class="accordion-collapse collapse" aria-labelledby="kt_accordion_1_header_1" data-bs-parent="#kt_accordion_1"> <div id="kt_accordion_1_<?=$row->msg_id?>" class="accordion-collapse collapse" aria-labelledby="kt_accordion_1_header_1" data-bs-parent="#kt_accordion_1">
<div class="accordion-body"> <div class="accordion-body">
<?= $row->msg?> <?=$row->msg?>
</div> </div>
</div> </div>
</div> </div>
+119 -109
View File
@@ -66,130 +66,130 @@
<div class="table-responsive"> <div class="table-responsive">
<ul class="nav nav-tabs nav-line-tabs mb-5 fs-6"> <ul class="nav nav-tabs nav-line-tabs mb-5 fs-6">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#kt_tab_pane_1">Send Message</a> <a class="nav-link active" data-bs-toggle="tab" href="#kt_tab_pane_1">Send Message</a>
</li> </li>
<!-- li class="nav-item"> <!-- li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#kt_tab_pane_2">Add File(s)</a> <a class="nav-link" data-bs-toggle="tab" href="#kt_tab_pane_2">Add File(s)</a>
</li --> </li -->
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#kt_tab_pane_3">Actions</a> <a class="nav-link" data-bs-toggle="tab" href="#kt_tab_pane_3">Actions</a>
</li> </li>
</ul> </ul>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="kt_tab_pane_1" role="tabpanel"> <div class="tab-pane fade show active" id="kt_tab_pane_1" role="tabpanel">
<div id="sendmessagenote"></div> <div id="sendmessagenote"></div>
<form name="message" id="message" action="/proj/thisjob" method='POST'> <form name="message" id="message" action="/proj/thisjob" method='POST'>
<input type='hidden' name='ajax' value='1'> <input type='hidden' name='ajax' value='1'>
<input type='hidden' name='jobID' value='<?php echo $jobID; ?>'> <input type='hidden' name='jobID' value='<?php echo $jobID; ?>'>
<input type='hidden' name='contractId' value='<?php echo $contract_id; ?>'> <input type='hidden' name='contractId' value='<?php echo $contract_id; ?>'>
<div class="form-group"> <div class="form-group">
<textarea cols="18" onkeypress="textContentChanged();" style="height:180px;" rows="3" id='jobmessage' name='jobmessage' class="textarea wysihtml5 wysihtml5-min form-control" placeholder="Enter message here ..."></textarea> <textarea cols="18" onkeypress="textContentChanged();" style="height:180px;" rows="3" id='jobmessage' name='jobmessage' class="textarea wysihtml5 wysihtml5-min form-control" placeholder="Enter message here ..."></textarea>
</div> </div>
<div class="form-group"> <div class="form-group">
<table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4"> <table class="table table-row-dashed table-row-gray-200 align-middle gs-0 gy-4">
<tbody> <tbody>
<tr> <tr>
<td style="text-align: left;"> <td style="text-align: left;">
<div id="remain_text"></div> <div id="remain_text"></div>
</td> </td>
<td style="width: 30%;"><div id="sendmessagenote"></div></td> <td style="width: 30%;"><div id="sendmessagenote"></div></td>
<td style="width: 20%; text-align:right;"> <button id='btn_cancel' name='btn_cancel' type="submit" class="btn btn-danger btn-sm" onclick="document.message.jobmessage.value = ''; return false;">Clear</button></td> <td style="width: 20%; text-align:right;"> <button id='btn_cancel' name='btn_cancel' type="submit" class="btn btn-danger btn-sm" onclick="document.message.jobmessage.value = ''; return false;">Clear</button></td>
<td style="width: 20%; text-align:right;"><button id='btn_submit' name='btn_submit' type="submit" class="btn btn-primary btn-sm" onclick="SendMessage();return false;">Send</button> </td> <td style="width: 20%; text-align:right;"><button id='btn_submit' name='btn_submit' type="submit" class="btn btn-primary btn-sm" onclick="SendMessage();return false;">Send</button> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</form> </form>
<?php <?php
include 'uploads/upload_files.php'; include 'uploads/upload_files.php';
?> ?>
</div>
<!-- div class="tab-pane fade" id="kt_tab_pane_2" role="tabpanel">
<div class="form-group">
<form action="/proj/thisjob" method='POST' enctype="multipart/form-data">
<input type='hidden' name='uploadForm' value='1'>
<input type='hidden' name='jobID' value='<?php echo $jobID; ?>'>
<input type='hidden' name='contractId' value='<?php echo $contract_id; ?>'>
<input type="file" class="file-input" multiple="multiple" name="fileToUpload[]" id="fileToUpload[]">
<span class="help-block">There is a file size limit [<?php echo UPLOAD_FILE_SIZE; ?> MB]. Split large files into smaller size</span>
</form>
</div>
</div -->
<div class="tab-pane fade" id="kt_tab_pane_3" role="tabpanel">
<h3>Use action to manage the status of the project</h3>
<div class="form-group">
<?php
if ($this_is_client == true) {
?>
<table class='table table-striped table-hover table-bordered table-condensed'>
<tr>
<td>
If you have completed this task and will like the owner to review the work for acceptance, click "Completed" button.
</td>
<td style="width:140px;">
<div id="req_completion"> <button type="submit" id="req_completion_submit" class="btn btn-primary btn-sm" onclick="return requestCompletion('<?php echo $job_contract; ?>');" <?php echo $disabled1; ?> >Completed</button></div>
</td>
</tr>
<tr>
<td>
If you are unable to complete and will like this project canceled, click "Cancel task" button.
</td>
<td style="width:140px;">
<div id="req_cancel"> <button type="submit" id="req_cancel_submit" onclick="return requestCancel('<?php echo $job_contract; ?>');" class="btn btn-danger btn-sm" <?php echo $disabled2; ?> >Request Cancel</button> </div>
</td>
</tr>
</table>
<div style="font-size: large; font-family: sans-serif">
<p style="color: #ff0000; background-color: #ffffff">Note: Buttons may be disabled for some days at the start of the task</p>
</div> </div>
<!-- div class="tab-pane fade" id="kt_tab_pane_2" role="tabpanel">
<div class="form-group">
<form action="/proj/thisjob" method='POST' enctype="multipart/form-data">
<input type='hidden' name='uploadForm' value='1'>
<input type='hidden' name='jobID' value='<?php echo $jobID; ?>'>
<input type='hidden' name='contractId' value='<?php echo $contract_id; ?>'>
<input type="file" class="file-input" multiple="multiple" name="fileToUpload[]" id="fileToUpload[]">
<span class="help-block">There is a file size limit [<?php echo UPLOAD_FILE_SIZE; ?> MB]. Split large files into smaller size</span>
</form>
</div>
</div -->
<div class="tab-pane fade" id="kt_tab_pane_3" role="tabpanel">
<?php
} <h3>Use action to manage the status of the project</h3>
?> <div class="form-group">
<?php
if ($this_is_client == true) {
?>
<table class='table table-striped table-hover table-bordered table-condensed'>
<tr>
<td>
If you have completed this task and will like the owner to review the work for acceptance, click "Completed" button.
</td>
<td style="width:140px;">
<div id="req_completion"> <button type="submit" id="req_completion_submit" class="btn btn-primary btn-sm" onclick="return requestCompletion('<?php echo $job_contract; ?>');" <?php echo $disabled1; ?> >Completed</button></div>
</td>
</tr>
<tr>
<td>
If you are unable to complete and will like this project canceled, click "Cancel task" button.
</td>
<td style="width:140px;">
<div id="req_cancel"> <button type="submit" id="req_cancel_submit" onclick="return requestCancel('<?php echo $job_contract; ?>');" class="btn btn-danger btn-sm" <?php echo $disabled2; ?> >Request Cancel</button> </div>
</td>
</tr>
</table>
<div style="font-size: large; font-family: sans-serif">
<p style="color: #ff0000; background-color: #ffffff">Note: Buttons may be disabled for some days at the start of the task</p>
</div>
<?php
}
?>
<?php <?php
if ($this_is_project_owner == true) { if ($this_is_project_owner == true) {
?> ?>
<table class='table table-striped table-hover table-bordered table-condensed'> <table class='table table-striped table-hover table-bordered table-condensed'>
<tr> <tr>
<td> <td>
Accept or reject the completion of the task below. We will notify the other partner and finalize payment for the task. Accept or reject the completion of the task below. We will notify the other partner and finalize payment for the task.
</td> </td>
<td style="width:140px;"> <td style="width:140px;">
<div id="accept_completion"> <button type="submit" id="accept_completion_submit" class="btn btn-primary btn-sm" onclick="return acceptCompletion('<?php echo $job_contract; ?>');" <?php echo $disabled11; ?> >Accept Completion</button></div> <div id="accept_completion"> <button type="submit" id="accept_completion_submit" class="btn btn-primary btn-sm" onclick="return acceptCompletion('<?php echo $job_contract; ?>');" <?php echo $disabled11; ?> >Accept Completion</button></div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>
If you reject the work done or want more review before accepting, click "Reject Completion." If you reject the work done or want more review before accepting, click "Reject Completion."
</td> </td>
<td style="width:140px;"> <td style="width:140px;">
<div id="reject_completion"> <button type="submit" id="reject_completion_submit" class="btn btn-danger btn-sm" <?php echo $disabled22; ?> onclick="return rejectCompletion('<?php echo $job_contract; ?>');" >Reject Completion</button></div> <div id="reject_completion"> <button type="submit" id="reject_completion_submit" class="btn btn-danger btn-sm" <?php echo $disabled22; ?> onclick="return rejectCompletion('<?php echo $job_contract; ?>');" >Reject Completion</button></div>
</td> </td>
</tr> </tr>
</table> </table>
<?php <?php
} }
?> ?>
</div> </div>
</div> </div>
</div> </div>
@@ -197,6 +197,16 @@
</div> </div>
</div> </div>
</div> </div>
<div class="card-body py-3">
<?php
include 'uploads/file_table.php';
?>
</div>
</div> </div>
</div> </div>
<div class="col-xl-4"> <div class="col-xl-4">