This commit is contained in:
parent
a55db17684
commit
67a8197e06
@ -988,8 +988,9 @@ function viewIGRDetails()
|
|||||||
|
|
||||||
$notification = new Notification();
|
$notification = new Notification();
|
||||||
|
|
||||||
$history_content = "<br>IGR History<br><br> <ul>";
|
$history_content = "<br><b>IGR History</b><br><br> <ul>";
|
||||||
$history = $result_for_history['history'];
|
// $history = $result_for_history['history']; // old
|
||||||
|
$history = $this->inwardgateregister_model->ViewIGRHistory($IGRNo);
|
||||||
if(!empty($history)){
|
if(!empty($history)){
|
||||||
|
|
||||||
$field_labels = [
|
$field_labels = [
|
||||||
@ -1028,19 +1029,54 @@ function viewIGRDetails()
|
|||||||
for ($j = 0; $j < count($history); $j++) {
|
for ($j = 0; $j < count($history); $j++) {
|
||||||
$field_name = $history[$j]->field;
|
$field_name = $history[$j]->field;
|
||||||
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
|
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
|
||||||
$history_content .= "<li>" .
|
|
||||||
(($history[$j]->IGRItem_No)
|
if(intval($history[$j]->is_add) === 1) {
|
||||||
? $history[$j]->MaterialName . " (" . $history[$j]->MaterialCode . ") - "
|
$history_content .= $history[$j]->IGR_No . " was Created by " . $history[$j]->FullName . " on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time . " </br></br>";
|
||||||
: "") .
|
|
||||||
$readable_field . " " . $history[$j]->old_data .
|
if ($history[$j]->field === "IGRStatus") {
|
||||||
" was updated into " . $history[$j]->new_data .
|
$str1 = $history[$j]->new_data;
|
||||||
" by " . $history[$j]->history_by .
|
$str2 = preg_replace('/\bIGR\b/i', '', $str1);
|
||||||
" on " . $history[$j]->indian_date .
|
$str2 = trim($str2);
|
||||||
" at " . $history[$j]->indian_time .
|
$str2 = ($str2 === "CREATED") ? "GENERATED" : $str2;
|
||||||
"</li><br>";
|
|
||||||
|
$history_content .= $history[$j]->IGR_No . " was <b> ` " . $str2 . " ` </b> by " . $history[$j]->FullName .
|
||||||
|
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time;
|
||||||
|
} else {
|
||||||
|
$history_content .= $history[$j]->IGR_No . " was <b> ` GENERATED ` </b> by " . $history[$j]->FullName .
|
||||||
|
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time;
|
||||||
|
}
|
||||||
|
} else if (intval($history[$j]->is_edit) === 1) {
|
||||||
|
$str = $history[$j]->field;
|
||||||
|
|
||||||
|
if (!in_array($str, ["UpdateBY", "MaterialRcvdDate", "DeliveryChellanDate"])) {
|
||||||
|
$fieldName = preg_replace('/([a-z])([A-Z])/', '$1 $2', $str);
|
||||||
|
$displayOldData = (empty($history[$j]->old_data)) ? " " : $history[$j]->old_data;
|
||||||
|
$displayNewData = (empty($history[$j]->new_data)) ? " " : $history[$j]->new_data;
|
||||||
|
|
||||||
|
if ($history[$j]->field === "IGRStatus") {
|
||||||
|
$displayOldData = trim(preg_replace('/\bIGR\b/i', '', $displayOldData));
|
||||||
|
$displayOldData = ($displayOldData === "CREATED") ? "GENERATED" : $displayOldData;
|
||||||
|
|
||||||
|
$displayNewData = trim(preg_replace('/\bIGR\b/i', '', $displayNewData));
|
||||||
|
$displayNewData = ($displayNewData === "CREATED") ? "GENERATED" : $displayNewData;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($displayNewData || $displayOldData) {
|
||||||
|
$materialPart = (!empty($history[$j]->IGRItem_No)) ? $history[$j]->MaterialName . " ( " . $history[$j]->MaterialCode . " ) - " : "";
|
||||||
|
$history_content .= "<li> ".$materialPart . $readable_field . " <b> ` " . $displayOldData . " ` </b> was Updated into <b> ` " . $displayNewData . " ` </b> by " .
|
||||||
|
$history[$j]->FullName . " on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (intval($history[$j]->is_delete) === 1) {
|
||||||
|
$str = $history[$j]->field;
|
||||||
|
$fieldName = preg_replace('/([a-z])([A-Z])/', '$1 $2', $str);
|
||||||
|
$history_content .= "<li> ".$readable_field . " " . $history[$j]->new_data . " was deleted by " . $history[$j]->FullName .
|
||||||
|
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
|
||||||
|
}
|
||||||
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
|
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
|
||||||
}
|
}
|
||||||
$history_content .= "</ul>";
|
$history_content .= " </ul>";
|
||||||
|
|
||||||
$to_email_addr = "";
|
$to_email_addr = "";
|
||||||
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
||||||
@ -1097,6 +1133,14 @@ function viewIGRDetails()
|
|||||||
echo $finalstatement;
|
echo $finalstatement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateSentence($record) {
|
||||||
|
$sentence = "<li>";
|
||||||
|
|
||||||
|
|
||||||
|
return $sentence;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function CancelIGR(){
|
function CancelIGR(){
|
||||||
|
|
||||||
# Step 1 : Gethering Data..
|
# Step 1 : Gethering Data..
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user