This commit is contained in:
2022-07-30 12:18:06 -04:00
parent c85d578b46
commit c3ce8490d7
4 changed files with 19 additions and 2 deletions
+8 -1
View File
@@ -689,7 +689,7 @@ $data = $this->getSessionArray();
$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 "
@@ -697,6 +697,12 @@ $data = $this->getSessionArray();
. "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,"
. "(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 "
. "FROM jobs_contract_message jc "
. "LEFT JOIN members m ON m.id=jc.member_id "
. "WHERE jc.contract='" . $data['contract_id'] . "' ORDER by jc.id DESC";
$query_message = $this->db->query($sqlMsg);
@@ -1050,6 +1056,7 @@ $data = $this->getSessionArray();
} else {
$result = "Files were not uploaded${d_txt}";
}
// echo $result;
return $result;
}
@@ -1,13 +1,21 @@
<div class="accordion" id="kt_accordion_1">
<?php
foreach($message_result as $row){
$msg_type = $row->msg_type;
$file_icon = "";
if( $msg_type === 'FILE'){
$pieces = explode(".", $row->message);
// echo $pieces[0]; // piece1
// echo "----". $pieces[1]; // piece2
$file_icon = "<img style='width:25px; height:25px;' alt='Icon' src='/site3/assets/media/svg/files/".$pieces[1].".svg'>";
}
?>
<div class="accordion-item">
<h2 class="accordion-header" id="kt_accordion_1_header_1">
<button class="accordion-button fs-4 fw-semibold"
type="button" data-bs-toggle="collapse" data-bs-target="#kt_accordion_1_<?=$row->msg_id?>"
aria-expanded="true" aria-controls="kt_accordion_1_body_1">
<?=$row->title . "-".$row->date1?>
<?=$file_icon?> <?=$row->title . "-".$row->date1?>
</button>
</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">