chore: remove unused configuration file and associated references

This commit is contained in:
Ümit Tunç
2026-04-28 23:07:39 +03:00
parent 4a3f693aee
commit 382469d16c
127 changed files with 0 additions and 50824 deletions
@@ -1,115 +0,0 @@
<?php $documents = db("document_templates")
->whereNotNull("kid")
->where("type", "akt")
->get();
if(getisset("select-document"))
{
$selectDocument = db("document_templates")->where("type", "akt")
->where("slug", get("select-document"))
->first();
}
?>
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-12">
<div class="input-group">
<select name="document" id="" onchange="location.href='?select-document=' + $(this).val()" class="form-control select2">
<option value="">{{e2("Select AKT Document")}}</option>
<?php foreach($documents AS $document) {
?>
<option value="{{$document->slug}}"
@if(getesit("select-document", $document->slug))
selected
@endif
>{{$document->title}}</option>
<?php
} ?>
</select>
@if(getisset("select-document"))
<?php //$lineLists = // db("weld_logs")->groupBy("iso_number")->select("iso_number")->groupBy("iso_number")->get()->pluck("iso_number")->toArray();
$path = "storage/documents/{$selectDocument->kid}";
$lineLists = glob("$path/*.*");
?>
<select name="" id="line_no" title="Folder: {{$selectDocument->kid}} " required class="form-control select2">
<option value="">Folder: {{$selectDocument->kid}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".html", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show Selected Document")}}</button>
<div class="btn btn-outline-success generate-all-akt">{{e2("Generate All")}}</div>
<script>
$(function(){
$(".generate-all-akt").on("click", function(){
var bu = $(this);
Swal.fire({
title: "{{e2("Are you sure?")}}",
html: "{{e2("According to the Akt document named <strong>:title</strong>, all files will be written to the <strong>:folder</strong> folder. If there are existing files, they will be overwritten. This process is irreversible and may take a long time. Are you sure?", [
'title' => $selectDocument->title,
'folder' => $selectDocument->kid,
])}}",
icon: "warning", // Set the warning icon
showCancelButton: true, // Enable confirmation buttons
confirmButtonColor: '#d33', // Customize "Yes" button color
cancelButtonColor: '#3085d6', // Customize "Cancel" button color
confirmButtonText: '{{e2("Yes")}}',
cancelButtonText: '{{e2("Cancel")}}' // Customize button labels
}).then((result) => {
if(result.isConfirmed) {
Swal.fire(
'{{$selectDocument->title}}',
'{{e2("Generate Started! When the process is completed, all documents will be created in the <strong>:folder</strong> folder.",
[
'folder' => $selectDocument->kid
]
)}}',
'success');
bu.html("Generating Please wait...").attr("disabled", "disabled");
$.get("?ajax=pdf.akt-creator-excel&document={{$selectDocument->slug}}", function(d) {
Swal.fire('{{$selectDocument->title}}', d.trim(), 'success');
});
} else {
}
});
});
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/{{$selectDocument->kid}}/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
@endif
</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
@@ -1,45 +0,0 @@
<?php
$projects = active_projects();
if(getisset("update")) {
// dump($_POST);
unset($_POST['_token']);
foreach($_POST AS $key => $value) {
firstOrUpdate([
'title' => $key,
'html' => $value
],"settings",[
'title' => $key
]);
}
}
?>
<div class="content">
<h1>{{e2($c->title)}}</h1>
<form action="?update" method="post">
@csrf
<div class="row">
{{col("col-md-4","General",0,['no-options' => true])}}
{{e2("Approximate Planned (WDI)")}}:
<input type="number" step="any" name="general-approximate-planned-wdi" value="{{setting('general-approximate-planned-wdi')}}" class="form-control" id="">
{{_col()}}
<?php foreach($projects AS $project) {
$projectId = str_slug($project);
?>
{{col("col-md-4", $project, 0, ['no-options' => true])}}
{{e2("Approximate Planned (WDI)")}}:
<input type="number" step="any" name="{{$projectId}}-approximate-planned-wdi" value="{{setting($projectId . '-approximate-planned-wdi')}}" class="form-control" id="">
{{_col()}}
<?php } ?>
<div class="col-md-12 text-center">
<button class="btn btn-primary">{{e2("Update")}}</button>
</div>
</div>
</form>
</div>
@@ -1,170 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.min.js"></script>
<script src="https://unpkg.com/konva@7.0.6/konva.min.js"></script>
<input type="file" id="file-select" accept=".pdf" class="form-control d-none" onchange="handleFileSelect(event)">
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
<div class="btn-group" data-toggle="buttons" role="group" aria-label="Second group">
<div class="btn-group mr-5" role="group" aria-label="First group">
<div class="btn btn-outline-primary" onclick="$('#file-select').trigger('click')">
<img src="{{url("assets/icons/editor/open-folder.png")}}" width="16" alt="">
</div>
</div>
<div class="btn btn-outline-primary" type="cursor">
<img src="{{url("assets/icons/editor/cursor.png")}}" width="16" alt="">
</div>
<div class="btn btn-outline-primary" type="circle">
<img src="{{url("assets/icons/editor/dry-clean.png")}}" width="16" alt="">
</div>
<div class="btn btn-outline-primary" type="line">
<img src="{{url("assets/icons/editor/nodes.png")}}" width="16" alt="">
</div>
<div class="btn btn-outline-primary" type="square">
<img src="{{url("assets/icons/editor/square.png")}}" width="16" alt="">
</div>
<div class="btn btn-outline-primary" type="triangle">
<img src="{{url("assets/icons/editor/triangle.png")}}" width="16" alt="">
</div>
<div class="btn btn-outline-primary" type="text">
<img src="{{url("assets/icons/editor/text.png")}}" width="16" alt="">
</div>
</div>
</div>
<div style="width:100%;height:80vh;overflow:auto">
<div id="canvas-container"></div>
</div>
<script>
async function handleFileSelect(event) {
const file = event.target.files[0];
if (!file) return;
const pdfData = await readFile(file);
renderPdfToCanvas(pdfData);
}
async function readFile(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = (event) => {
resolve(event.target.result);
};
reader.onerror = (error) => {
reject(error);
};
reader.readAsArrayBuffer(file);
});
}
async function renderPdfToCanvas(pdfData) {
const pdf = await pdfjsLib.getDocument({ data: pdfData }).promise;
const page = await pdf.getPage(1);
const canvasContainer = document.getElementById('canvas-container');
const canvas = document.createElement('canvas');
canvasContainer.appendChild(canvas);
const context = canvas.getContext('2d');
const viewport = page.getViewport({ scale: 1.5 });
canvas.width = viewport.width;
canvas.height = viewport.height;
const renderContext = {
canvasContext: context,
viewport: viewport,
};
await page.render(renderContext).promise;
// Now, you can use KonvaJS to draw on the canvas if needed
const layer = new Konva.Layer();
const pdfImage = new Konva.Image({
image: canvas,
x: 0,
y: 0,
width: viewport.width,
height: viewport.height,
});
layer.add(pdfImage);
stage.add(layer);
}
</script>
<script>
var width = window.innerWidth;
var height = window.innerHeight;
var stage = new Konva.Stage({
container: 'canvas-container',
width: width,
height: height,
});
$(".btn-toolbar .btn").on("click", function() {
$(".btn-toolbar .btn").removeClass("active");
var type = $(this).attr("type");
console.log(type);
if(type == "line") {
@include("admin.type.as-build-editor.js-line")
}
if(type == "text") {
@include("admin.type.as-build-editor.js-text")
}
if(type == "square") {
@include("admin.type.as-build-editor.js-square")
}
});
</script>
<script>
$(function(){
var pdfjsLib = window['pdfjs-dist/build/pdf'];
pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.6.347/pdf.worker.min.js';
});
</script>
</div>
</div>
</div>
</div>
@@ -1,46 +0,0 @@
<?php
$tabs = [
'Material Group Test Piece' => 'setting',
];
?>
<div class="content">
<div class="block">
<ul class="nav nav-tabs nav-tabs-block js-tabs-enabled" data-toggle="tabs" role="tablist">
<?php foreach($tabs AS $tab => $icon) {
$id = str_slug($tab);
?>
<li class="nav-item">
<a class="nav-link {{getesit("t",$id) ? "active show" : ""}}" href="?t={{$id}}">
<i class="float-left mr-1">
<img src="{{url("assets/icons/".$icon . '.png')}}" width="16" alt="">
</i>
{{e2($tab)}}</a>
</li>
<?php } ?>
</ul>
<div class="block-content tab-content">
<div class="tab-pane active show" id="btabs-static-home" role="tabpanel">
<?php if(getisset("t")) { ?>
@include("admin.type.settings." . get("t"))
<?php } else {
?>
<div class="hero-inner">
<div class="content content-full">
<div class="py-30 text-center">
<i class="si si-settings text-primary display-3"></i>
<h1 class="h2 font-w700 mt-30 mb-10">{{e2("Settings System")}}</h1>
<h2 class="h3 font-w400 text-muted mb-50">{{e2("Please select a setting tab from the top tab and set it")}}</h2>
</div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
</div>
@@ -1,318 +0,0 @@
<?php
use App\Models\CalibrationLog;
$title = "Calibration Logs";
$tableWidth = "160%";
$path = "admin.type.calibration-logs";
$id = "calibration-logs";
$listDatas = CalibrationLog::orderBy("calibration_due_date", "ASC")
->orderBy("item_no", "ASC")
->paginate(setting('row_count'));
$tableName = "calibration_logs";
$relationDatas = [
'certification_document' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>',
],
'user_guide' => [
'type' => 'link-search',
'html' => '<i class="fa fa-file"></i>',
],
'calibration_certificate' => [
'type' => 'link-search',
'html' => '<i class="fa fa-certificate"></i>',
],
'discipline' => [
'values' => db("disciplines")->get()->pluck("discipline_title")->toArray(),
'type' => 'manuel-select'
],
'instrument' => [
'values' => [
'Civil Works Test Equipment',
'Piping/Mechanical Test Equipment',
'Instrument Test Equipment',
'Painting and Coating Test Equipment',
'Electrical Test Equipment',
'Welding Equipment',
],
'type' => 'manuel-select',
],
'place_of_calibration_verification' => [
'values' => [
'Laboratory',
'In house verification',
'In house calibration',
],
'type' => 'manuel-select',
],
'status' => [
'values' => [
'In use',
'Out Of service',
'Repair',
'Calibration-Verification',
],
'type' => 'manuel-select',
],
'quantity' => [
'values' => ['1'],
'type' => 'manuel-select',
],
];
$blockGroup = [
'General Information' => [
'certification_document',
'user_guide',
'discipline',
'instrument',
'item_no',
'equipment_name',
'manufacturer',
'model_no',
'serial_no',
'quantity',
],
'Calibration Info' => [
'passport_certificate_no',
'place_of_calibration_verification',
'calibrated_by',
'calibration_frequency',
'calibration_certificate',
'calibration_certificate_no',
'calibration_date',
'calibration_due_date',
'deviation_ratio',
'status',
],
'Documents & Notes' => [
'remarks',
'comments',
'source_module',
'source_id',
],
];
// QA document folder for calibration certificates
$firstUploadFolder = '004_QA/0025_Calibration/';
$firstUploadTitle = 'Upload Calibration Certificate';
$uploadPermissionKey = 'calibration_log_upload_permission';
// Sync button for NAKS Welding Equipments
$topButtons = [];
// Permission Check for NAKS Sync
$allowedSyncLevels = j(setting('calibration_naks_sync_permission'));
$userLevel = u()->level ?? null;
$hasSyncPermission = false;
if (empty($allowedSyncLevels) || !is_array($allowedSyncLevels)) {
// If no permission set, maybe default to allow or deny.
// Usually if not set, no restriction or restricted to admin.
// Let's assume strict: if not set, no one (or maybe just admin) can see.
// But user asked to "Choose authorized personnel", implies if nothing chosen, maybe no one.
// Let's allow Admin (1) by default or if array is empty?
// Safest is: if array is defined, check it. If not defined/empty, maybe hide?
// Let's check if the user level is in the array.
$hasSyncPermission = false;
} else {
if (in_array($userLevel, $allowedSyncLevels)) {
$hasSyncPermission = true;
}
}
// Ensure Admin always has access (optional but good practice, though user settings might override)
// If you want strict adherence to the setting, simply adhere to $hasSyncPermission as calculated.
// But usually system admins (level 1) should have access.
// Let's stick to the setting as requested.
if ($hasSyncPermission) {
$topButtons[] = [
'href' => '?sync-from-naks',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync from NAKS Equipments")
];
}
?>
<style>
/* Calibration due status row colors - only for In use / Calibration-Verification */
.calibration-expired-row, .calibration-expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important;
}
.calibration-due-soon-row, .calibration-due-soon-row * {
background-color: #fff7e0 !important;
color: #9c6f19 !important;
}
/* Status-based coloring for Out of service / Repair */
.status-inactive-row, .status-inactive-row * {
background-color: #f8d7da !important;
color: #721c24 !important;
opacity: 0.85;
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
if (row.rowType !== "data" || !row.data) return;
var rowIndex = row.rowIndex;
if (typeof rowIndex === 'undefined') return;
var $rowElement = $(e.component.getRowElement(rowIndex));
var status = (row.data.status || '').toLowerCase().trim();
// Status-based coloring: Out of service / Repair -> matte red
if (status === 'out of service' || status === 'repair') {
$rowElement.addClass("status-inactive-row");
$rowElement.find("td").addClass("status-inactive-row");
return; // No date-based coloring for inactive items
}
// Date-based coloring only for "In use" or "Calibration-Verification"
if (status !== 'in use' && status !== 'calibration-verification') {
return;
}
if (!row.data.calibration_due_date) return;
var dateStr = row.data.calibration_due_date;
var dueDate = null;
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
if (parts.length === 3) {
dueDate = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya benzeri
dueDate = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
dueDate = dateStr;
}
if (dueDate && !isNaN(dueDate.getTime())) {
dueDate.setHours(0, 0, 0, 0);
var diffMs = dueDate - today;
var diffDays = Math.round(diffMs / (1000 * 60 * 60 * 24));
// Expired: red
if (diffDays < 0) {
$rowElement.addClass("calibration-expired-row");
$rowElement.find("td").addClass("calibration-expired-row");
}
// Due soon (0-20 days): yellow
else if (diffDays <= 20) {
$rowElement.addClass("calibration-due-soon-row");
$rowElement.find("td").addClass("calibration-due-soon-row");
}
}
});
}
</script>
<div class="content">
<div class="row">
<div class="col-12">
<?php
if(getisset("sync-from-naks")) {
$count = 0;
$errors = [];
$beforeCount = CalibrationLog::count();
try {
// Get all welding equipment
$equipments = \App\Models\WeldingEquipment::all();
if($equipments->count() == 0) {
bilgi("No NAKS welding equipment records found to sync.", "warning");
} else {
foreach($equipments as $equipment) {
try {
$data = $equipment->toArray();
$sourceId = $data['id'] ?? null;
// Find or create calibration log
$log = CalibrationLog::firstOrNew([
'source_module' => 'naks_welding_equipment',
'source_id' => $sourceId,
]);
$log->instrument = 'Welding Equipment';
$log->description = $data['type_of_welding_machine'] ?? null;
$log->equipment_name = $data['brand'] ?? null;
$log->manufacturer = $data['producer'] ?? null;
$log->serial_no = $data['manufacturer_code'] ?? null;
$log->passport_certificate_no = $data['attestation'] ?? null;
$log->quantity = 1;
if (!empty($data['date_of_issue'])) {
$log->calibration_date = $data['date_of_issue'];
}
if (!empty($data['valid_until'])) {
$log->calibration_due_date = $data['valid_until'];
}
// Status calculation
if (!empty($log->calibration_due_date)) {
$today = \Illuminate\Support\Carbon::today();
$dueDate = \Illuminate\Support\Carbon::parse($log->calibration_due_date)->startOfDay();
if ($dueDate->lt($today)) {
$log->status = 'Out Of service';
} elseif ($dueDate->lte($today->copy()->addDays(20))) {
$log->status = 'Calibration-Verification';
} else {
$log->status = 'In use';
}
}
$log->save();
$count++;
} catch(\Exception $innerE) {
$errors[] = "ID {$equipment->id}: " . $innerE->getMessage();
}
}
$afterCount = CalibrationLog::count();
$newRecords = $afterCount - $beforeCount;
if(count($errors) > 0) {
bilgi("Errors: " . implode(" | ", array_slice($errors, 0, 3)), "danger");
}
bilgi(":count record(s) synced from NAKS. Total: :before → :after (:new new)",
"success",
['count' => $count, 'before' => $beforeCount, 'after' => $afterCount, 'new' => $newRecords]
);
}
} catch(\Exception $e) {
bilgi("Sync Error: " . $e->getMessage(), "danger");
}
// Remove query param to prevent re-sync on refresh
echo "<script>
if(window.history.replaceState) {
window.history.replaceState({}, document.title, window.location.pathname);
}
</script>";
}
?>
</div>
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,58 +0,0 @@
<?php
use App\Models\ColorSystem;
//$noRemoteOperations = true;
$title = "Color Systems";
$tableWidth="100%";
$listDatas = ColorSystem::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "color_systems";
$ralCodes = j(setting("ral-codes"));
$ralCodeValues =array_column($ralCodes, 'ral_code');
//$tableType = "datagrid";
$relationDatas = [
'ral_1' => [
'values' => $ralCodeValues,
'type' => 'manuel-select'
],
'ral_2' => [
'values' => $ralCodeValues,
'type' => 'manuel-select'
],
'ral_3' => [
'values' => $ralCodeValues,
'type' => 'manuel-select'
],
];
$blockGroup = [
'Engineering' => [
'unit',
'fluid_code',
'fluid_code_description',
'working_temperature',
'design_temperature'
],
'Ral' => [
'ral_1',
'ral_2',
'ral_3'
]
];
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,749 +0,0 @@
<?php
//$noRemoteOperations = true;
$title = "Construction Paint Log";
$tableWidth="100%";
$tableName = "construction_paint_logs";
$moduleSlug = "construction_paint_log";
$inspectionHistoryActive = false;
$documentInfo = document_template("Construction_Paint_Log");
// Doküman kontrolü
if (!$documentInfo) {
echo '<script>
document.addEventListener("DOMContentLoaded", function() {
DevExpress.ui.notify("{{ e2("Construction Paint Log document template is not found in the system. Please contact the administrator.") }}", "error", 5000);
});
</script>';
$documentJson = [];
$documentPath = '';
} else {
$documentJson = j($documentInfo->json);
$documentPath = $documentInfo->kid;
}
$dataGridOptions = "
selection: {
mode: 'multiple',
showCheckBoxesMode: 'always'
},
onSelectionChanged: function(e) {
var selectedData = e.component.getSelectedRowsData();
window.selectedRows = selectedData;
console.log('Selection changed. Selected rows:', window.selectedRows);
},
customizeColumns: function(columns) {
var fittingsColumns = ['elbow_pcs', 'elbow_45_pcs', 'elbow_m2', 'tee_pcs', 'tee_m2', 'reductions_pcs', 'reductions_m2', 'vent_pcs', 'vent_m2', 'cap_pcs', 'cap_m2', 'flange_pcs', 'flange_m2'];
columns.forEach(function(col) {
// Rename vent columns to Nippel-Olet
if (col.dataField === 'vent_pcs') {
col.caption = 'nippel-olet_pcs';
}
if (col.dataField === 'vent_m2') {
col.caption = 'nippel-olet_m2';
}
// Hide Fittings band header
if (col.caption === 'Fittings') {
col.visible = true;
col.allowExporting = true;
col.allowSorting = false;
col.headerCellTemplate = function(headerCell, headerInfo) {
var headerEl = $(headerCell);
headerEl.empty();
if (typeof window.fittingsVisible === 'undefined') {
window.fittingsVisible = false;
}
var wrapEl = $('<div>')
.addClass('fittings-toggle-header')
.css({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
cursor: 'pointer',
userSelect: 'none',
gap: '8px'
});
var captionText = (headerInfo && headerInfo.column && headerInfo.column.caption) ? headerInfo.column.caption : 'Fittings';
var textEl = $('<span>').text(captionText);
var iconEl = $('<i>').addClass(window.fittingsVisible ? 'fa fa-chevron-up' : 'fa fa-chevron-down');
wrapEl.append(textEl);
wrapEl.append(iconEl);
wrapEl.on('click', function(ev) {
ev.preventDefault();
ev.stopPropagation();
if (window.toggleFittingsColumns) {
window.toggleFittingsColumns(headerInfo.component);
}
});
headerEl.append(wrapEl);
};
}
// Hide Fittings columns
if (fittingsColumns.includes(col.dataField)) {
col.visible = false;
col.allowExporting = true;
}
});
},
";
$paintSystem = db("paint_systems")->get()->map(function($item) {
return [
'paint_cycle' => $item->paint_cycle,
'consumption_paint_kg_1' => $item->consumption_paint_kg_1,
'consumption_paint_kg_2' => $item->consumption_paint_kg_2,
'consumption_paint_kg_3' => $item->consumption_paint_kg_3
];
})->keyBy('paint_cycle')->toArray();
//$tableType = "datagrid";
$paintMatrix = db("paint_matrices")->get();
$brends = [];
foreach($paintMatrix AS $pm) {
if(!is_null($pm->brend_name_1))
$brends[] = $pm->brend_name_1;
if(!is_null($pm->brend_name_2))
$brends[] = $pm->brend_name_2;
if(!is_null($pm->brend_name_3))
$brends[] = $pm->brend_name_3;
}
$brends = array_unique($brends);
$relationDatas = [
'brend_name_1' => [
'values' => $brends,
'type' => 'manuel-select'
],
'brend_name_2' => [
'values' => $brends,
'type' => 'manuel-select'
],
'brend_name_3' => [
'values' => $brends,
'type' => 'manuel-select'
],
'paint_subcontructer' => [
'values' => db("subcontractors")->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select'
],
];
$blockGroup = [
'Report Information' => [
'report_no',
'construction_report_no',
'test_package',
'rev',
'sheet',
],
'Project Information' => [
'engineering',
'area',
'unit',
'paint_subcontructer',
],
'Line Details' => [
'line',
'iso_drawings',
'spool',
'spool_status',
'fluid_code',
'fluid_code_description',
'isolation_info',
],
'Painting System' => [
'painting_system_type_1',
],
'First Layer Details' => [
'brend_name_1',
'ral_1',
'color_1',
'thickness_1',
],
'Second Layer Details' => [
'brend_name_2',
'ral_2',
'color_2',
'thickness_2',
],
'Third Layer Details' => [
'brend_name_3',
'ral_3',
'color_3',
'thickness_3',
],
'Dimensions' => [
'dn_1',
'dn_2',
'line_pipe_mm_1',
'line_pipe_mm_2',
'cutting_mm',
'total_line_mm',
],
'Fittings' => [
'elbow_pcs',
'elbow_45_pcs',
'elbow_m2',
'tee_pcs',
'tee_m2',
'reductions_pcs',
'reductions_m2',
'vent_pcs',
'vent_m2',
'cap_pcs',
'cap_m2',
'flange_pcs',
'flange_m2',
],
'Surface Spool(m2)' => [
'fittings_m2',
'pipe_m2',
'total_m2',
],
'Consumption Paint(kg)' => [
'first_layer',
'second_layer',
'third_layer',
'total_layer',
],
'Blasting Process' => [
'blasting_date',
'blasting_finish_date',
'blasting_rfi_no',
],
'First Layer Application' => [
'painting_date_1',
'painting_finish_date_1',
'rfi_date_1',
'rfi_no_1',
],
'Second Layer Application' => [
'painting_date_2',
'painting_finish_date_2',
'rfi_date_2',
'rfi_no_2',
],
'Third Layer Application' => [
'painting_date_3',
'painting_finish_date_3',
'rfi_date_3',
'rfi_no_3',
],
];
?>
<script>
// Paint system data from PHP
var paintSystemData = @json($paintSystem);
console.log("paintSystemData");
console.log(paintSystemData);
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
var readOnly = [
'design_area',
'fluid',
'line',
'line_spec',
'operation_temp',
'operations_pressure_kg',
'pwht',
'ndt',
'piping_class_according_to_gost',
'piping_group',
'rev',
'report_no',
'construction_report_no',
];
// Check brend_name fields status
var isBrendName1Filled = dataRow.brend_name_1 ? true : false;
var isBrendName2Filled = dataRow.brend_name_2 ? true : false;
var isBrendName3Filled = dataRow.brend_name_3 ? true : false;
// Define calculation fields
var calculationFields = [
'dn_1',
'dn_2',
'total_m2',
'fittings_m2',
'pipe_m2',
'elbow_m2',
'tee_m2',
'reductions_m2',
'vent_m2',
'cap_m2',
'flange_m2'
];
// Handle automatic calculations for all calculation fields
if (calculationFields.includes(e.dataField)) {
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
// Recalculate total_m2 if it's not the current field
if (e.dataField !== 'total_m2') {
var fittingsM2 = parseFloat(dataRow.fittings_m2) || 0;
var pipeM2 = parseFloat(dataRow.pipe_m2) || 0;
var totalM2 = fittingsM2 + pipeM2;
e.component.cellValue(rowIndex, "total_m2", totalM2.toFixed(2));
}
// Update paint consumption if painting system is selected
var selectedSystem = paintSystemData[dataRow.painting_system_type_1];
if (selectedSystem) {
var totalM2 = parseFloat(dataRow.total_m2) || 0;
// Calculate layer values by multiplying consumption with total_m2
var firstLayerValue = (parseFloat(selectedSystem.consumption_paint_kg_1) || 0) * totalM2;
var secondLayerValue = (parseFloat(selectedSystem.consumption_paint_kg_2) || 0) * totalM2;
var thirdLayerValue = (parseFloat(selectedSystem.consumption_paint_kg_3) || 0) * totalM2;
// Update consumption values
e.component.cellValue(rowIndex, "first_layer", firstLayerValue.toFixed(2));
e.component.cellValue(rowIndex, "second_layer", secondLayerValue.toFixed(2));
e.component.cellValue(rowIndex, "third_layer", thirdLayerValue.toFixed(2));
// Calculate total layer
var totalLayer = firstLayerValue + secondLayerValue + thirdLayerValue;
e.component.cellValue(rowIndex, "total_layer", totalLayer.toFixed(2));
}
}
}
// Check if painting system fields are filled
var paintingSystemFields = [
'painting_system_type_1',
'brend_name_1',
'ral_1',
'thickness_1'
];
// Layer application fields
var firstLayerFields = ['painting_date_1', 'painting_finish_date_1', 'rfi_date_1', 'rfi_no_1'];
var secondLayerFields = ['painting_date_2', 'painting_finish_date_2', 'rfi_date_2', 'rfi_no_2'];
var thirdLayerFields = ['painting_date_3', 'painting_finish_date_3', 'rfi_date_3', 'rfi_no_3'];
// Make fields readonly based on painting system status
if (firstLayerFields.includes(e.dataField) && !isBrendName1Filled) {
e.editorOptions.readOnly = true;
}
if (secondLayerFields.includes(e.dataField) && !isBrendName2Filled) {
e.editorOptions.readOnly = true;
}
if (thirdLayerFields.includes(e.dataField) && !isBrendName3Filled) {
e.editorOptions.readOnly = true;
}
// Original readonly check
if(readOnly.includes(e.dataField)) {
e.editorOptions.readOnly = true;
}
if (['dn_1', 'dn_2', 'cutting_mm'].includes(e.dataField)) {
var row = e.row.data;
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
var dn1 = parseFloat(row.dn_1) || 0;
var dn2 = parseFloat(row.dn_2) || 0;
var cuttingMm = parseFloat(row.cutting_mm) || 0;
// Calculate using the formula: total_line_mm = πR*DN1 + cutting_mm + πR*DN2 + cutting_mm
var pi = Math.PI;
var totalLineMm = (pi * dn1) + cuttingMm + (pi * dn2) + cuttingMm;
// Update the total_line_mm field
e.component.cellValue(rowIndex, "total_line_mm", totalLineMm.toFixed(2));
// Calculate pipe_m2 using the formula: pipe_m2 = πR*DN1 + cutting_mm + πR*DN2 + cutting_mm
var pipeM2 = (pi * dn1) + cuttingMm + (pi * dn2) + cuttingMm;
// Update the pipe_m2 field
e.component.cellValue(rowIndex, "pipe_m2", pipeM2.toFixed(2));
// Get current fittings_m2 value
var fittingsM2 = parseFloat(row.fittings_m2) || 0;
// Calculate total_m2 = fittings_m2 + pipe_m2
var totalM2 = fittingsM2 + pipeM2;
// Update the total_m2 field
e.component.cellValue(rowIndex, "total_m2", totalM2.toFixed(2));
}
}
// Calculate fittings_m2 when any of the fitting areas change
if (['elbow_m2', 'tee_m2', 'reductions_m2', 'vent_m2', 'cap_m2', 'flange_m2'].includes(e.dataField)) {
var row = e.row.data;
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
var elbowM2 = parseFloat(row.elbow_m2) || 0;
var teeM2 = parseFloat(row.tee_m2) || 0;
var reductionsM2 = parseFloat(row.reductions_m2) || 0;
var ventM2 = parseFloat(row.vent_m2) || 0;
var capM2 = parseFloat(row.cap_m2) || 0;
var flangeM2 = parseFloat(row.flange_m2) || 0;
// Calculate total fittings_m2
var totalFittingsM2 = elbowM2 + teeM2 + reductionsM2 + ventM2 + capM2 + flangeM2;
// Update the fittings_m2 field
e.component.cellValue(rowIndex, "fittings_m2", totalFittingsM2.toFixed(2));
// Get current pipe_m2 value
var pipeM2 = parseFloat(row.pipe_m2) || 0;
// Calculate total_m2 = fittings_m2 + pipe_m2
var totalM2 = totalFittingsM2 + pipeM2;
// Update the total_m2 field
e.component.cellValue(rowIndex, "total_m2", totalM2.toFixed(2));
}
}
// Calculate total_layer when any paint layer changes
if (['first_layer', 'second_layer', 'third_layer'].includes(e.dataField)) {
var row = e.row.data;
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
var firstLayer = parseFloat(row.first_layer) || 0;
var secondLayer = parseFloat(row.second_layer) || 0;
var thirdLayer = parseFloat(row.third_layer) || 0;
// Calculate total_layer = first_layer + second_layer + third_layer
var totalLayer = firstLayer + secondLayer + thirdLayer;
// Update the total_layer field
e.component.cellValue(rowIndex, "total_layer", totalLayer.toFixed(2));
}
}
}
</script>
<script>
window.updateFittingsChevron = function(dataGrid) {
try {
var $grid = $(dataGrid.element());
var $icon = $grid.find('.fittings-toggle-header i').first();
if (!$icon.length) return;
$icon.removeClass('fa-chevron-up fa-chevron-down');
$icon.addClass(window.fittingsVisible ? 'fa-chevron-up' : 'fa-chevron-down');
} catch (e) {
}
};
window.toggleFittingsVisibility = function(visible, dataGrid) {
var dg = dataGrid;
if (!dg) {
try {
if ($('#dataGrid').length) {
dg = $('#dataGrid').dxDataGrid('instance');
}
} catch (e) {
}
}
if (!dg) return;
window.fittingsVisible = !!visible;
var fittingsColumns = ['elbow_pcs', 'elbow_45_pcs', 'elbow_m2', 'tee_pcs', 'tee_m2', 'reductions_pcs', 'reductions_m2', 'vent_pcs', 'vent_m2', 'cap_pcs', 'cap_m2', 'flange_pcs', 'flange_m2'];
dg.beginUpdate();
dg.columnOption('Fittings', 'visible', true);
fittingsColumns.forEach(function(colName) {
dg.columnOption(colName, 'visible', window.fittingsVisible);
});
dg.endUpdate();
window.updateFittingsChevron(dg);
};
window.toggleFittingsColumns = function(dataGrid) {
if (typeof window.fittingsVisible === 'undefined') {
window.fittingsVisible = false;
}
window.toggleFittingsVisibility(!window.fittingsVisible, dataGrid);
};
function contentReady(e) {
var dataGrid = e.component;
console.log("DataGrid initialized:", dataGrid);
// Change startEditAction to dblClick so single click can select rows
dataGrid.option('editing.startEditAction', 'dblClick');
// Override onRowClick to select row on single click
dataGrid.option('onRowClick', function(e) {
// Select row on single click
if(e.rowType === 'data' && e.data && e.data.id !== undefined) {
// Select the row (false = don't preserve previous selection)
// Check if Ctrl or Shift is not pressed for single selection
if(!e.event.ctrlKey && !e.event.shiftKey) {
dataGrid.selectRows([e.data.id], false);
} else {
// If Ctrl or Shift is pressed, preserve selection (multiple selection)
dataGrid.selectRows([e.data.id], true);
}
}
});
// Add onRowDblClick to edit row on double click
dataGrid.option('onRowDblClick', function(e) {
// Edit row on double click
if(e.rowType === 'data') {
dataGrid.editRow(e.rowIndex);
}
});
// Make report_no column clickable
var documentPath = "{{url($documentPath)}}";
/*
setTimeout(function() {
var rows = $(dataGrid.element()).find('td[data-column-index]');
rows.each(function() {
var $td = $(this);
var colIndex = $td.data('columnIndex');
var col = dataGrid.getVisibleColumns()[colIndex];
if(col && col.dataField === 'report_no') {
var value = $td.text().trim();
if(value) {
var link = documentPath + '/' + value + '.pdf';
$td.html('<a href="' + link + '" target="_blank">' + value + '</a>');
}
}
});
}, 100);
*/
// Custom Toolbar Items
var toolbarItems = e.component.option("toolbar.items");
// Persist filter value
if (toolbarItems) {
toolbarItems.forEach(function(item) {
if (item.widget === 'dxSelectBox' && item.options && item.options.items &&
Array.isArray(item.options.items) &&
item.options.items.some(function(i) { return i.id === 'with_inspection'; })) {
if (window.inspectionFilterValue) {
item.options.value = window.inspectionFilterValue;
}
var originalHandler = item.options.onValueChanged;
item.options.onValueChanged = function(e) {
window.inspectionFilterValue = e.value;
if (originalHandler) {
originalHandler.apply(this, arguments);
}
};
}
});
}
var newItems = [
{
location: 'center',
widget: 'dxButton',
options: {
icon: 'pdffile',
text: '{{e2("Generate Report")}}',
onClick: function(e) {
var selectedData = dataGrid.getSelectedRowsData();
console.log("Selected rows in toolbar:", selectedData);
if (!selectedData || selectedData.length === 0) {
Swal.fire({
icon: 'warning',
title: '{{e2("Warning")}}',
text: '{{e2("Please select at least one row")}}',
confirmButtonText: '{{e2("OK")}}'
});
return;
}
$("#generatePDF").modal();
}
}
},
{
location: 'center',
widget: 'dxButton',
options: {
icon: 'formula',
text: '{{e2("Calculate Surface Area")}}',
onClick: function(btnEvent) {
var selectedData = dataGrid.getSelectedRowsData();
if (!selectedData || selectedData.length === 0) {
Swal.fire({
icon: 'warning',
title: '{{e2("Warning")}}',
text: '{{e2("Please select a row to calculate surface area")}}',
confirmButtonText: '{{e2("OK")}}'
});
return;
}
// Get the first selected row
var rowData = selectedData[0];
var rowIndex = dataGrid.getRowIndexByKey(rowData.id);
if (typeof window.toggleFittingsVisibility === 'function') {
window.toggleFittingsVisibility(true, dataGrid);
}
openSurfaceAreaModal(rowData, rowIndex);
}
}
}
];
if(toolbarItems){
newItems.forEach(function(item){
var exists = false;
toolbarItems.forEach(function(existingItem){
if(existingItem.options && existingItem.options.text === item.options.text){
exists = true;
}
});
if(!exists){
toolbarItems.push(item);
}
});
e.component.option("toolbar.items", toolbarItems);
} else {
e.component.option("toolbar.items", newItems);
}
window.updateFittingsChevron(dataGrid);
}
</script>
<style>
.dx-datagrid .dx-row td:first-child,
.dx-datagrid .dx-header-row td:first-child {
width: 30px !important;
max-width: 30px !important;
min-width: 30px !important;
padding: 0 !important;
overflow: hidden !important;
white-space: nowrap !important;
}
.dx-datagrid .dx-row td:first-child i {
font-size: 16px !important;
}
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
<!-- Add Modal for Report Generation -->
<div class="modal" id="generatePDF">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">{{e2("Generate Report of Selected Rows")}}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<div class="btn btn-outline-primary mt-5" id="generatePDFBtn"><i class="fa fa-file-pdf"></i> {{e2("Generate Report")}}</div>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
$(function() {
$("#generatePDFBtn").on("click", function() {
if (!window.selectedRows || window.selectedRows.length === 0) {
Swal.fire({
icon: 'warning',
title: '{{e2("Warning")}}',
text: '{{e2("Please select at least one row")}}',
confirmButtonText: '{{e2("OK")}}'
});
return;
}
$(this).html("{{e2('Please Wait...')}}");
console.log("Selected rows:", window.selectedRows);
var dataToSend = JSON.stringify(window.selectedRows);
console.log("Data being sent:", dataToSend);
$.post("?ajax=construction-paint-log-generate-report", {
'_token': '{{csrf_token()}}',
'data': dataToSend
}, function(d) {
console.log("Response:", d);
$("#generatePDFBtn").html("{{e2('Generate Report')}}");
Swal.fire({
icon: 'success',
title: '{{e2("Success")}}',
text: '{{e2("Report generated successfully")}}',
confirmButtonText: '{{e2("OK")}}'
});
location.reload();
}).fail(function(error) {
console.error("Error:", error);
$("#generatePDFBtn").html("{{e2('Generate Report')}}");
Swal.fire({
icon: 'error',
title: '{{e2("Error")}}',
text: '{{e2("An error occurred while generating the report")}}',
confirmButtonText: '{{e2("OK")}}'
});
});
});
});
</script>
@include('components.modals.surface-area-modal')
@@ -1,128 +0,0 @@
<?php
use App\Models\CutList;
$title = "Cut Lists";
$tableWidth="100%";
$listDatas = CutList::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "cut_lists";
//$tableType = "datagrid";
$relationDatas = [
'beveeling_1' => [
'datas' => db("beveelings")->get(),
'pattern' => '{beveeling_title}',
'type' => 'select-dropdown'
],
'beveeling_2' => [
'datas' => db("beveelings")->get(),
'pattern' => '{beveeling_title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Drawing and Identification Information' => [
'drawing_no',
'work_order_no',
'zone',
'subcontructer',
'line_no',
'area',
'sheet',
'rev',
],
'Material Information' => [
'material',
'id_number',
'heat_number',
'manufacturing_pipe_no',
],
'Part Properties' => [
'pose_no',
'piece_no',
'inch',
'diamm',
'thicknessmm',
'beveeling_1',
'beveeling_2',
'cut_pipe_length',
'mesasured_length',
],
'Process Information' => [
'cutting_date',
'formen',
'inspector',
'release_date',
'remarks',
]
];
?>
<script>
$(function(){
});
</script>
<script>
function editorPreparing(e, dataRow) {
{{dxAutocomplete("drawing_no", "weld_logs", "iso_number", "", [
'zone' => '{project}',
'line_no' => '{line_number}',
'area' => '{design_area}',
'sheet' => '{quantity_of_iso}',
'rev' => '{iso_rev}',
'id_number' => '{element_code_1}',
'material' => '{material_no_1}',
'pose_no' => '{pose_no_1}',
'inch' => '{nps_1}',
'diamm' => '{outside_diameter_1}',
])}}
{{dxAutocomplete("heat_number", "incoming_controls", "heat_number", [
'component_code' => 'id_number',
]
)}}
{{dxAutocomplete("sheet", "weld_logs", "quantity_of_iso", [
'iso_number' => 'drawing_no'
])}}
{{dxAutocomplete("material", "weld_logs", "material_no_1", [
'iso_number' => 'drawing_no'
])}}
{{dxAutocomplete("id_number", "weld_logs", "element_code_1", [
'iso_number' => 'drawing_no'
])}}
if(e.dataField == "cut_pipe_length") {
e.validationRules[0] = {
type: 'numeric',
min: 0,
message: 'Please enter number'
};
}
if(e.dataField == "mesasured_length") {
e.validationRules[0] = {
type: 'numeric',
min: 0,
message: 'Please enter number'
};
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,76 +0,0 @@
<?php
/**
* NAKS Pool - Dashboard
*
* This dashboard displays aggregated statistics from all sites.
* Data is fetched from: /api/stats/dashboard-stats
*
* Charts:
* - WDI Monthly (Prefab/Field/Total) - Line Charts
* - WDI per Welder - Line Charts
* - Welder Status - Stacked Bar
* - Spool Progress - Horizontal Stacked Bar
* - NDT/Repair Backlog - Table with alerts
* - Hand-over Status - Bar Chart
* - Welding Equipment - Bar Chart
*/
$title = "NAKS Pool - Dashboard";
// API Endpoint - will be called via JavaScript
$apiEndpoint = "https://dev.stellarcons.com/api/stats/dashboard-stats";
?>
@include('admin.type.partials.dashboard.styles')
<div class="content dashboard-container">
<!-- Loading State -->
<div id="loadingState" class="loading-overlay">
<div style="text-align: center;">
<i class="fa fa-spinner"></i>
<div style="margin-top: 10px;">Loading dashboard data...</div>
</div>
</div>
<!-- Error State -->
<div id="errorState" class="error-message" style="display: none;">
<i class="fa fa-exclamation-triangle" style="font-size: 40px;"></i>
<p>Failed to load dashboard data. Please try again later.</p>
</div>
<!-- Dashboard Content (hidden until data loads) -->
<div id="dashboardContent" style="display: none;">
<!-- Section 0: Main Data Grid -->
@include('admin.type.partials.dashboard.overview')
<!-- Section 1: WDI Charts -->
@include('admin.type.partials.dashboard.wdi-performance')
<!-- Section 2: Welder Status -->
@include('admin.type.partials.dashboard.welder-status')
<!-- Section 3: Spool Progress -->
@include('admin.type.partials.dashboard.spool-progress')
<!-- Section 4: NDT/Repair Backlog -->
@include('admin.type.partials.dashboard.backlog')
<!-- Section 5: Hand-over Status -->
@include('admin.type.partials.dashboard.handover-status')
<!-- Section 6: Welding Equipment -->
@include('admin.type.partials.dashboard.welding-equipment')
</div>
</div>
@include('admin.type.partials.dashboard.scripts')
@@ -1,137 +0,0 @@
<?php
use App\Models\DeletedJoint;
$title = "Deleted Joints";
$tableWidth="2000%";
$listDatas = DeletedJoint::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "deleted_joints";
$blockGroup = [
'Info' => [
'comment',
'deleted_date'
],
'Information About the PIPE' => [
'general_contractor','contractor',
// 'ste_subcontractor',
'design_area','line_specification','line_number','main_material','main_nps','fluid_code','service_category','fluid_group','piping_class','design_temperature_s','design_pressure_mpa','operating_temperature_s','operating_pressure_mpa','painting_cycle','external_finish_type'
],
'Iso Information' => [
'iso_number','quantity_of_iso','iso_rev','spool_number'
],
'Information about the welding' => [
'type_of_joint','no_of_the_joint_as_per_as_built_survey','type_of_welds','welding_date','wps_no','wps_approval_date','welding_method','welding_materials_1','welding_materials_1_lot_no','welding_materials_1_certificate_no','welding_materials_2','welding_materials_2_lot_no','welding_materials_2_certificate_no','welding_materials_3','welding_materials_3_lot_no','welding_materials_3_certificate_no','welder_1','welder_2',
'certificate_no_1','wpq_report_1',
'certificate_no_2','wpq_report_2',
],
'Information about the welding elements' => [
'element_code_1', 'pose_no_1', 'member_no_1',
'element_code_2', 'pose_no_2', 'member_no_2',
'material_no_1','ru_material_group_1','certificate_number_of_1','heat_number_1','nps_1','thickness_by_asme_1','outside_diameter_1','wall_thickness_1','material_no_2','ru_material_group_2','certificate_number_of_2','heat_number_2','nps_2','thickness_by_asme_1','outside_diameter_2','wall_thickness_2',
],
'VT' => [
'ndt_percent',
// 'vt_request_no',
'vt_report',
'vt_request_date',
'test_laboratory_vt',
'vt_result'
],
'RT' => [
'rt_scope',
'rt_request_no',
'rt_request_date',
'rt_report',
'rt_test_date',
'test_laboratory_rt',
'rt_result'
],
'UT' => [
'ut_scope',
'ut_request_no',
'ut_type',
'ut_request_date',
'ut_report',
'ut_test_date',
'test_laboratory_ut',
'ut_result'
],
'PT' => [
'pt_scope','pt_request_no',
'pt_request_date',
'pt_report','pt_test_date','test_laboratory_pt','pt_result'
],
'MT' => [
'mt_scope','mt_request_no','mt_report','mt_test_date','test_laboratory_mt','mt_result'
],
'PMI' => [
'pmi_scope','pmi_request_no',
'pmi_request_date',
'no_of_testing_report','pmi_test_date','test_laboratory_pmi','pmi_result','pwht','pwht_date'
],
'PWHT' => [
'pwht',
'pwht_date',
'no_of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht'
],
'HT' => [
'ht_scope',
'ht_request_no',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result'
],
'Ferrite Check' => [
'ferrite_scope',
'ferrite_request_no',
'ferrite_request_date',
'ferrite_report',
'ferrite_test_date',
'test_laboratory_ferrite',
'ferrite_result'
],
'PIPE testing' => [
'test_package_no',
'test_pressure',
'type_of_test',
'date_test',
'test_result'
],
'Status' => [
'real_welder_1','real_welder_2','ste_subcontractor','remarks'
]
];
$columnRedesign = [];
$columnRedesign['diameter']['class'] = "col-md-6";
$columnRedesign['thickness']['class'] = "col-md-6";
$columnRedesign['pwht_operator_name_surname']['class'] = "col-md-6";
$columnRedesign['pwht_operator_id']['class'] = "col-md-6";
$columnsArray = ['vt', 'rt', 'ut', 'mt', 'pt', 'pmi', 'pwht', 'ht', 'ferrite-check', 'pipe-testing'];
foreach($columnsArray AS $columnKey) {
$columnRedesign[$columnKey]['class'] = "col-md-6";
$columnRedesign[$columnKey]['border'] = true;
$columnRedesign[$columnKey]['color'] = 15;
}
?>
<style>
.block-options {
display:none;
}
</style>
@include("admin.type.weldmap.datagrid-script")
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,115 +0,0 @@
<?php
use App\Models\DocumentProcedure;
$title = "Document Procedure";
$tableWidth="100%";
$listDatas = DocumentProcedure::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "document_procedures";
$noRemoteOperations = true;
$requiredFields = [];
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-download"></i>'
],
'publisher' => [
'values' => j(setting("publisher")),
'type' => 'manuel-select'
],
'language' => [
'values' => [
'TR',
'EN',
'RU',
],
//'default' => 'RU',
'type' => 'manuel-select'
],
'scope' => [
'values' => [
'CENTER',
'INTERNAL',
],
'type' => 'manuel-select'
],
'status' => [
'values' => [
'PREPAIRING',
'SIGNED',
'COMMENTED',
],
'default' => 'PREPAIRING',
'type' => 'manuel-select'
],
'document_type' => [
'values' => j(setting("document_procedure_type")),
'type' => 'manuel-select'
],
];
$blockGroup = [
'General Information' => [
'download',
'scope',
'publisher',
'publish_date',
'document_no',
'disipline',
'description',
'language',
'prepared_by',
'document_type',
'status',
],
'Revision Info' => [
'revision_info',
'revision_date',
'controller',
'control_given_date',
'remarks',
]
];
$dataGridOptions = '
grouping: {
contextMenuEnabled: true
},
groupPanel: {
visible: true
},
/*
onInitialized : function(e) {
$("#dataGrid").dxDataGrid("columnOption", "document_no", "groupIndex", 1);
},
*/
';
$path = "004_QA/0018_Procedure";
/*
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => $path . '/',
'pattern' => "{document_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
]
];
*/
$firstUploadFolder = $path;
$firstUploadTitle = "Upload Document Procedures";
?>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,242 +0,0 @@
<?php
use App\Models\DocumentRevision;
use App\Models\Discipline;
$title = "Document Revision";
$tableWidth="100%";
$listDatas = DocumentRevision::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "document_revisions";
// Güncel revizyonların ID'lerini hesapla (her drawing_no için en yüksek revision_no'ya sahip kayıtlar)
$currentRevisionIds = db("document_revisions as dr1")
->select('dr1.id')
->whereNotNull('dr1.drawing_no')
->where('dr1.drawing_no', '<>', '')
->whereRaw('dr1.revision_no = (
SELECT MAX(dr2.revision_no)
FROM document_revisions dr2
WHERE dr2.drawing_no = dr1.drawing_no
)')
->pluck('id')
->toArray();
// DataGrid için onRowPrepared callback'i
// DataGrid için onRowPrepared callback'i
$dataGridOptions = '
onRowPrepared: function(e) {
if (e.rowType === "data" && e.data) {
var currentRevisionIds = ' . json_encode($currentRevisionIds) . ';
// IDleri number tipine cevirerek karsilastir (js strict equality)
var rowId = Number(e.data.id);
if (currentRevisionIds.includes(rowId)) {
$(e.rowElement).addClass("current-revision-row");
$(e.rowElement).removeClass("old-revision-row");
} else {
$(e.rowElement).addClass("old-revision-row");
$(e.rowElement).removeClass("current-revision-row");
}
}
// Total footer - sticky Total cell
if (e.rowType === "totalFooter") {
$(e.rowElement).find("td").each(function () {
if ($(this).text().indexOf("Total") !== -1) {
$(this).css({
"position": "sticky",
"left": "0",
"z-index": "11",
"background-color": "#e9ecef",
});
}
});
}
},
';
//$tableType = "datagrid";
/*
$prependColumns = [
'Engineering' => [
'type' => 'link-search',
'path' => '001_Drawings/001_Engineering/',
'pattern' => "{drawing_no}*{revision_no}*.pdf",
'html' => '<i class="fa fa-file-pdf"></i>'
],
'ISO' => [
'type' => 'link-search',
'path' => '001_Drawings/002_Iso/',
'pattern' => "*{drawing_no}*{revision_no}*.pdf",
'html' => '<i class="fa fa-file-pdf"></i>'
],
];
*/
$relationDatas = [
'pdf_engineering' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pdf_spool_iso' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pdf_as_build' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'discipline' => [
'type' => 'manuel-select',
'values' => Discipline::pluck('discipline_title', 'discipline_title')->toArray()
],
];
$blockGroup = [
'Attachment' => [
'pdf_engineering',
'pdf_spool_iso',
'pdf_as_build',
'working_documentation',
'axonometry',
],
'General Information' => [
'transmittal_document',
'discipline',
'publish_date',
'document_name',
'zone',
'subcontructer',
'area',
'line_number',
'drawing_no',
'revision_no',
'remarks',
]
];
/*
$topButtons = [
0 => [
'href' => '#',
'html' => 'Upload PDF',
'class' => 'upload-pdf'
]
];
*/
?>
<script>
$(function(){
$(".upload-pdf").on("click", function() {
$("#uploadModal").modal();
});
});
// Current revision ID'leri
var currentRevisionIds = <?php echo json_encode($currentRevisionIds); ?>;
var revisionFilter = 'all'; // 'all', 'current', 'old'
// Toolbar'a dropdown eklemek için contentReady callback'i
function contentReady(e) {
var dataGrid = e.component;
// Toolbar'a revision filter dropdown ekle
e.component.option("toolbar.items", [
{
location: 'before',
widget: 'dxSelectBox',
options: {
width: 150,
items: [
{ value: 'all', text: '{{e2("All Revisions")}}' },
{ value: 'current', text: '{{e2("Current Only")}}' },
{ value: 'old', text: '{{e2("Old Revisions")}}' }
],
valueExpr: 'value',
displayExpr: 'text',
value: revisionFilter,
onValueChanged: function(args) {
revisionFilter = args.value;
applyRevisionFilter(dataGrid);
}
}
},
@include("components.table.datagrid.partials.js-toolbar")
]);
}
// Filtreleme fonksiyonu
function applyRevisionFilter(dataGrid) {
if (revisionFilter === 'all') {
// Tum satirlari goster
$('.old-revision-row, .current-revision-row').show();
} else if (revisionFilter === 'current') {
// Sadece current satirlari goster
$('.old-revision-row').hide();
$('.current-revision-row').show();
} else if (revisionFilter === 'old') {
// Sadece old satirlari goster
$('.old-revision-row').show();
$('.current-revision-row').hide();
}
}
</script>
<script>
function editorPreparing(e, dataRow) {
// <?php echo dxAutocomplete("subcontructer", "subcontractors", "company_name_en", ['job_description' => 'Montaj']); ?>
}
</script>
<style>
/* Eski revizyonlar için stil - silik/soluk görünüm */
.old-revision-row {
background-color: #f8f8f8 !important;
opacity: 0.6;
}
.old-revision-row td {
background-color: #f8f8f8 !important;
color: #999 !important;
}
.old-revision-row:hover {
opacity: 0.8;
background-color: #f0f0f0 !important;
}
/* Güncel revizyonlar için stil - normal/koyu */
.current-revision-row {
background-color: #fff !important;
font-weight: 500;
}
.current-revision-row td {
background-color: #fff !important;
color: #333 !important;
}
.current-revision-row:hover {
background-color: #f5f5f5 !important;
}
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
<?php
if(getisset("upload-pdf")) {
uploadDocument("iso", "001_Drawings/002_Iso");
uploadDocument("engineer", "001_Drawings/001_Engineering");
?>
<div class="col-12">
{{bilgi("Upload has been success!")}}
</div>
<?php
}
?>
@include("components.blocks.module-block")
</div>
</div>
@include("admin.type.weldmap.upload-modal")
@@ -1,26 +0,0 @@
<?php
use App\Models\DyePenetrantTest;
$title = "DyePenetrant Test";
$tableWidth="100%";
$listDatas = DyePenetrantTest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "dye_penetrant_tests";
$tableType = "datagrid";
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,97 +0,0 @@
<?php
use App\Models\User;
$title = "Employees";
$tableWidth="300%";
/*
$levels = [
'Welder, Painter, Insulator (Subcontractor / Payrollless)',
'Welder (Subcontractor)',
'',
'',
];
*/
if(getisset("welder-sync")) {
$welders = db("naks_welders")->get();
foreach($welders AS $welder) {
db("users")->updateOrInsert([
'registration_no' => $welder->welder_id,
], [
'level' => "Welder",
'name' => $welder->welder_name_en,
'name_ru' => $welder->welder_name_ru,
'registration_no' => $welder->welder_id,
'subcontructer' => $welder->company,
]);
}
}
$jobDesc = job_descriptions();
$listDatas = User::orderBy("id","DESC")
->whereIn("level", ['Welder'])
->orWhereNull("level")
->paginate(setting('row_count'));
$tableName = "users";
$excepts = [
'json',
'slug',
'pic',
'email_verified_at',
'password',
'permissions',
'phone',
//'level',
'alias',
'email',
'remember_token',
'recover',
'last_seen',
'branslar',
'ust',
'uid',
'note',
];
$relationDatas = [
'gender' => [
'values' => [
'Male',
'Female',
],
'type' => 'manuel-select'
],
'status' => [
'values' => [
'Active',
'Transfer to ...',
'Black list',
'Exit',
],
'type' => 'manuel-select'
],
'subcontructer' => [
'datas' => db("subcontractors")->get(),
'pattern' => '{company_name_en}',
'type' => 'select-dropdown'
],
'level' => [
'datas' => db("job_descriptions")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
?>
<div class="content">
<div class="row">
{{col("col-12")}}
<a href="?welder-sync" class="btn btn-outline-primary">{{e2("Sync From Welder")}}</a>
{{_col()}}
@include("components.blocks.module-block")
</div>
</div>
@@ -1,226 +0,0 @@
<?php use App\Models\WelderTest; ?>
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php if(getisset("welder-sync")) {
$welders = WelderTest::
// ->selectRaw()
join("naks_welders", "welder_tests.naks_id", "naks_welders.welder_id")
->whereNotNull("naks_id")
->groupBy("naks_id")
->get();
$k = 0;
foreach($welders AS $welder) {
db("users")->updateOrInsert([
'registration_no' => $welder->welder_id,
], [
'level' => "Welder",
'name' => $welder->welder_name_en,
'name_ru' => $welder->welder_name_ru,
'registration_no' => $welder->welder_id,
'subcontructer' => $welder->company,
]);
$k++;
}
bilgi(":count Row added or updated", "success", ['count' =>$k]);
} ?>
<div class="row">
<?php if(getisset("id")) {
?>
@include("admin.users.detail")
<?php
} ?>
</div>
<a href="?welder-sync" class="btn btn-outline-primary">{{e2("Sync From Welder")}}</a>
<div id="employees-datagrid"></div>
<script>
$(function(){
var dataSource = new DevExpress.data.CustomStore({
key: "id",
load(loadOptions) {
const deferred = $.Deferred();
const args = {};
args['module'] = "{{$id}}";
$.ajax({
url: '?ajax=employees',
dataType: 'json',
method: 'GET',
data: args,
success(result) {
deferred.resolve(result);
},
error(e) {
console.log("Data Loading Error");
console.log(e);
deferred.reject('{{e2("Data Loading Error")}}');
},
//timeout: 20000,
});
return deferred.promise();
},
update: function(key, values) {
var deferred = $.Deferred();
// console.log("val" + values);
$.ajax({
url: "{{url("admin/save-json/users" )}}",
method: "PUT",
data: {
'_token' : "{{ csrf_token() }}",
values : values,
key : key
}
})
.done(function(e) {
//console.log(e);
//deferred.resolve;
return deferred.promise();
})
.fail(function(e){
deferred.reject("{{e2("Update failed")}}");
});
}
});
var welderWdi = $("#employees-datagrid").dxDataGrid({
dataSource: dataSource,
filterRow: { visible: true },
searchPanel: { visible: false },
headerFilter: {
visible: true,
allowSearch: true,
},
export: {
enabled: false,
formats: ['xlsx'],
},
columns: [
{
caption: "Photo",
cellTemplate: function (container, options) {
console.log(options);
var pic = "assets/icons/man.png";
console.log(options.row.data);
if(options.row.data.pic != null) {
pic = options.row.data.pic;
$("<span>✅</span>").appendTo(container);
}
// $("<img src='{{url("/")}}/"+ pic +"' width='16'/>").appendTo(container);
}
},
'welder_id',
'name',
'name_ru',
'subcontructer',
{
type: "buttons",
width: 100,
height:200,
fixed: true,
buttons: [
{
text: "{{e2("Edit")}}",
hint: "{{e2("User Info Detail")}}",
onClick: function (e) {
console.log(e);
window.open('?id=' + e.row.data.id, "_self");
}
}
]
},
],
summary: {
groupItems: [{
summaryType: "count"
}]
},
paging: {
pageSize: 20,
},
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: {
enabled: true
},
selection: {
mode: 'single',
deferred: true,
},
groupPanel: { visible: false },
toolbar: {
items: [
"saveButton",
]
},
editing: {
<?php if(isAuth($id, "modify")) { ?>
allowUpdating: true,
<?php } ?>
startEditAction: 'dblClick',
refreshMode: 'repaint',
mode: 'batch', // 'batch' | 'cell' | 'form' | 'popup',
},
onEditorPreparing(e) {
if(e.parentType == "dataRow") {
if(e.dataField == "real_welder_1" || e.dataField == "real_welder_2") {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.acceptCustomValue = false;
e.editorOptions.dataSource = '{{autocomplete_type("wqt*welder_1")}}?row=' + JSON.stringify(e.row.data);
} else {
e.editorOptions.readOnly = true;
}
}
},
onRowClick: function(e) {
if(e.rowType === "data") {
console.log(e);
}
}
});
/*
setTimeout(function() {
weldmap.dxDataGrid("instance").columnOption("welding_date", "dataType", "date");
}, 2000);
*/
});
</script>
</div>
</div>
</div>
</div>
@@ -1,355 +0,0 @@
@extends("admin.master")
@section("title", "Feedback Reports")
@section("content")
@php
use App\Models\FeedbackReport;
use Illuminate\Support\Facades\DB;
$statusFilter = request("status", "all");
$userFilter = request("username", "all");
$query = FeedbackReport::orderBy("id","DESC");
if ($statusFilter !== "all") {
$query->where("status", $statusFilter);
}
if ($userFilter !== "all") {
$query->where("username", $userFilter);
}
$listDatas = $query->paginate(15);
$counts = [
"all" => FeedbackReport::whereNotNull("username")->count(),
"submitted" => FeedbackReport::where("status","submitted")->whereNotNull("username")->count(),
"reviewed" => FeedbackReport::where("status","reviewed")->whereNotNull("username")->count(),
"closed" => FeedbackReport::where("status","closed")->whereNotNull("username")->count(),
];
// Get users with feedback count
$users = FeedbackReport::select('username', DB::raw('count(*) as total'))
->groupBy('username')
->orderBy('total', 'DESC')
->get();
@endphp
<div class="content">
<div class="row">
<div class="col-md-4 col-xl-3">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title">Status Filter</h3>
</div>
<div class="block-content">
<ul class="nav nav-pills flex-column push">
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $statusFilter=='all' ? 'active' : '' }}"
href="?status=all&username={{ $userFilter }}">
<span><i class="fa fa-list mr-5"></i> All</span>
<span class="badge badge-pill badge-secondary">{{ $counts['all'] }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $statusFilter=='submitted' ? 'active' : '' }}"
href="?status=submitted&username={{ $userFilter }}">
<span><i class="fa fa-paper-plane mr-5"></i> Submitted</span>
<span class="badge badge-pill badge-secondary">{{ $counts['submitted'] }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $statusFilter=='reviewed' ? 'active' : '' }}"
href="?status=reviewed&username={{ $userFilter }}">
<span><i class="fa fa-search mr-5"></i> Reviewed</span>
<span class="badge badge-pill badge-secondary">{{ $counts['reviewed'] }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $statusFilter=='closed' ? 'active' : '' }}"
href="?status=closed&username={{ $userFilter }}">
<span><i class="fa fa-check-circle mr-5"></i> Closed</span>
<span class="badge badge-pill badge-secondary">{{ $counts['closed'] }}</span>
</a>
</li>
</ul>
</div>
</div>
<div class="block mt-3">
<div class="block-header block-header-default">
<h3 class="block-title">User Filter</h3>
</div>
<div class="block-content" style="max-height: 400px; overflow-y: auto;">
<ul class="nav nav-pills flex-column push">
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $userFilter=='all' ? 'active' : '' }}"
href="?status={{ $statusFilter }}&username=all">
<span><i class="fa fa-users mr-2"></i> All Users</span>
</a>
</li>
@foreach($users as $u)
@if($u->username)
<li class="nav-item">
<a class="nav-link d-flex justify-content-between {{ $userFilter==$u->username ? 'active' : '' }}"
href="?status={{ $statusFilter }}&username={{ $u->username }}">
<span><i class="fa fa-user mr-2"></i> {{ $u->username ?? 'Unknown' }}</span>
<span class="badge badge-pill badge-secondary">{{ $u->total }}</span>
</a>
</li>
@endif
@endforeach
</ul>
</div>
</div>
</div>
<div class="col-md-8 col-xl-9">
<form action="/admin/feedback/save-statuses" method="POST">
@csrf
<div class="d-flex justify-content-between align-items-center mb-3">
<h4 class="font-w600 mb-0 text-muted"><i class="fa fa-comments mr-2"></i> Feedback List</h4>
<button class="btn btn-sm btn-success px-3">
<i class="fa fa-save mr-1"></i> Save Changes
</button>
</div>
<div class="block block-rounded">
<div class="block-content p-0">
<table class="table table-hover table-vcenter mb-0">
<thead class="thead-light">
<tr>
<th style="width: 60px;" class="text-center"><i class="fa fa-user"></i></th>
<th>Feedback Details</th>
<th style="width: 180px;">Status</th>
<th style="width: 120px;" class="text-center">Actions</th>
</tr>
</thead>
<tbody>
@foreach($listDatas as $item)
<tr>
<td class="text-center">
<div class="item item-circle bg-gray-light mx-auto">
<i class="fa fa-user text-secondary"></i>
</div>
</td>
<td>
<div class="font-w600" style="font-size: 16px;">{{ $item->username ?? "Unknown User" }}</div>
<div class="text-muted mt-1" style="font-size: 14px;">
{{ Str::limit($item->description, 100) }}
<a href="#" class="text-primary showDescription ml-1"
data-full="{{ e($item->description) }}">
<i class="fa fa-info-circle"></i> view
</a>
</div>
</td>
<td>
<select name="statuses[{{ $item->id }}]" class="form-control form-control-sm">
<option {{ $item->status=="submitted" ? "selected":"" }}>submitted</option>
<option {{ $item->status=="reviewed" ? "selected":"" }}>reviewed</option>
<option {{ $item->status=="closed" ? "selected":"" }}>closed</option>
</select>
</td>
<td class="text-center">
@if($item->screenshot_path)
<div class="action-buttons">
<button type="button"
class="btn btn-view showScreenshot"
title="View Screenshot"
data-toggle="tooltip"
data-img="{{ asset($item->screenshot_path) }}">
<i class="fa fa-eye"></i>
</button>
<a href="{{ asset($item->screenshot_path) }}"
download
class="btn btn-download"
title="Download"
data-toggle="tooltip">
<i class="fa fa-download"></i>
</a>
</div>
@else
<span class="text-muted font-size-sm font-italic">No Attach</span>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="p-3 border-top">
{{ $listDatas->appends(['status' => $statusFilter, 'username' => $userFilter])->links("vendor.pagination.bootstrap-4") }}
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="modalDesc" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header bg-primary-dark text-white">
<h5 class="modal-title">Description</h5>
<button class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body" id="modalDescContent"></div>
</div>
</div>
</div>
<div class="modal fade" id="modalScreenshot" tabindex="-1">
<div class="modal-dialog" style="max-width: 1200px;">
<div class="modal-content">
<div class="modal-header bg-primary text-white py-2">
<h5 class="modal-title">Screenshot</h5>
<button class="close text-white" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body p-2" style="text-align:center;">
<img id="screenshotImage"
src=""
style="max-width: 100%; max-height: 800px; border-radius:8px; object-fit:contain;"
>
</div>
</div>
</div>
</div>
<style>
/* Action Buttons Style (Inspired by Notifications) */
.action-buttons {
display: flex;
gap: 8px;
justify-content: center;
align-items: center;
}
.action-buttons .btn {
width: 32px;
height: 32px;
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.2s;
border: 1px solid transparent;
padding: 0;
}
.action-buttons .btn i {
font-size: 13px;
}
/* View Button (Pastel Blue) */
.action-buttons .btn-view {
background: #edf2ff;
border-color: #dbe4ff;
color: #4263eb;
}
.action-buttons .btn-view:hover {
background: #dbe4ff;
color: #364fc7;
}
/* Download Button (Pastel Green) */
.action-buttons .btn-download {
background: #e6fcf5;
border-color: #c3fae8;
color: #0ca678;
}
.action-buttons .btn-download:hover {
background: #c3fae8;
color: #099268;
}
/* Table Avatar Circle */
.item-circle {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
}
</style>
@endsection
@section("scripts")
<script>
$(document).ready(function(){
// Initialize tooltips
$('[data-toggle="tooltip"]').tooltip();
// AJAX Form Submission for Status Updates
$('form[action="/admin/feedback/save-statuses"]').on('submit', function(e){
e.preventDefault();
var form = $(this);
var btn = form.find('.btn-success');
var originalBtnText = btn.html();
btn.html('<i class="fa fa-spinner fa-spin"></i> Saving...');
btn.prop('disabled', true);
$.ajax({
url: form.attr('action'),
method: form.attr('method'),
data: form.serialize(),
success: function(response) {
Swal.fire({
icon: 'success',
title: 'Success',
text: 'Statuses updated successfully!',
timer: 1500,
showConfirmButton: false
});
},
error: function() {
Swal.fire({
icon: 'error',
title: 'Error',
text: 'An error occurred while saving statuses.'
});
},
complete: function() {
btn.html(originalBtnText);
btn.prop('disabled', false);
}
});
});
});
$(document).on("click", ".showDescription", function(e){
e.preventDefault();
$("#modalDescContent").text($(this).data("full"));
$("#modalDesc").modal("show");
});
$(document).on("click", ".showScreenshot", function(){
$("#screenshotImage").attr("src", $(this).data("img"));
$("#modalScreenshot").modal("show");
});
</script>
@endsection
@@ -1,141 +0,0 @@
<?php
use App\Models\Ferrit;
//$noRemoteOperations = true;
$title = "Ferrit Log";
$tableWidth="100%";
$listDatas = Ferrit::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "ferrits";
$tableType = "datagrid";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'ferrite_result' => [
'datas' => [],
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_ferrite',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Base Element Info' => [
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'Ferrite Info' => [
'ferrite_scope',
'ferrite_request_date',
'ferrite_request_no',
'ferrite_report',
'ferrite_test_date',
'ferrite_result',
'control_standart',
'tester_name',
'real_welder_1',
'real_welder_2',
'record_1_fn',
'record_2_fn',
'record_3_fn',
],
];
$firstUploadFolder = '004_QA/0006_Ferrite/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'ferrite_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,746 +0,0 @@
<?php
use App\Models\Handover;
$title = "Hand-Over";
$tableWidth = "100%";
$tableName = "handovers";
$handoverControlCount = (int) setting('handover_control_count', 3); // Varsayılan 3
// Controller'ları JavaScript dizisi haline getir
$controllerFields = [];
for ($i = 1; $i <= $handoverControlCount; $i++) {
$controllerFields[] = "control{$i}_controller";
}
$controllerFieldsJson = json_encode($controllerFields);
// Tüm controller değerlerini alıp translate et
$allControllers = db('handovers')->select($controllerFields)->get();
$translatedControllers = [];
foreach ($allControllers as $row) {
foreach ($controllerFields as $field) {
if (!empty($row->$field) && !isset($translatedControllers[$row->$field])) {
$translatedControllers[$row->$field] = e2($row->$field);
}
}
}
$translatedControllersJson = json_encode($translatedControllers);
$blockGroup = [
'General Info' => [
'object',
'location',
'work_type',
'project',
'collected_volumes',
'not_collected_volumes',
'total_volumes',
'responsible',
'responsible_company',
'subcontractor',
'created_date',
'revision_date',
'final_status',
'id_status',
'pto_comments',
],
];
for ($i = 1; $i <= $handoverControlCount; $i++) {
$blockGroup['Control ' . $i] = [
"control{$i}_controller",
"control{$i}_date1",
"control{$i}_date2",
"control{$i}_date3",
"control{$i}_id_status",
"control{$i}_comments",
"control{$i}_responsible",
];
}
$blockGroup += [
/*
'Waiting Tech' => [
'waiting_tech1',
'waiting_tech2',
'waiting_tech3',
'sum_tech',
],
'Waiting STE' => [
'waiting_ste1',
'waiting_ste2',
'waiting_ste3',
'sum_ste',
],
'STE Status' => [
'date_of_transfer_ste1',
'date_of_return_ste1',
'status_ste1',
'date_of_transfer_ste2',
'date_of_return_ste2',
'status_ste2',
],
'APAT Status' => [
'waiting_apat1',
'waiting_apat2',
'sum_apat',
'waiting_ste_apat1',
'waiting_ste_apat2',
'sum_ste_apat',
'atg',
],
*/
'Location Info' => [
'archive',
'status_atg',
'atg_date',
'atg_comment',
'reminder',
],
/*
'Tex Info' => [
'month_tex1',
'year_tex1',
'year_month_tex1',
'month_tex2',
'year_tex2',
'year_month_tex2',
'month_tex3',
'year_tex3',
'year_month_tex3',
],
'Apatit Info' => [
'month_apatit1',
'year_apatit1',
'year_month_apatit1',
'month_apatit2',
'year_apatit2',
'year_month_apatit2',
],
*/
];
$relationDatas = [
'object' => [
'values' => db("weld_logs")->groupBy("project")->get()->pluck("project")->toArray(),
'type' => 'manuel-select'
],
'work_type' => [
'values' => db("work_types")->get()->pluck("title_ru")->toArray(),
'type' => 'manuel-select'
],
];
$subcontractors = db("subcontractors")->get();
// Control controller alanları için dinamik olarak select-dropdown ekleme
for ($i = 1; $i <= $handoverControlCount; $i++) {
$relationDatas["control{$i}_controller"] = [
'datas' => $subcontractors,
'pattern' => '{company_name_en}',
'type' => 'select-dropdown'
];
}
// Control status alanları için dinamik olarak values ekleme
for ($i = 1; $i <= $handoverControlCount; $i++) {
$relationDatas["control{$i}_id_status"] = [
'values' => [
'Agreed / подписано',
'Comment / замечание',
'Revision / Редакция',
],
'type' => 'manuel-select'
];
}
$relationDatas["archive"] = [
'values' => [
'Agreed / подписано',
'Comment / замечание',
'Revision / Редакция',
'Archive / Архив',
],
'type' => 'manuel-select'
];
// Control comments alanları için dinamik olarak long-text ekleme
for ($i = 1; $i <= $handoverControlCount; $i++) {
$relationDatas["control{$i}_comments"] = [
'type' => 'long-text',
];
$relationDatas["control{$i}_responsible"] = [
'type' => 'manuel-select',
'values' => db("work_permit_documents")->whereNotNull("name_surname")->get()->pluck("name_surname")->toArray(),
];
}
$relationDatas += [
'pto_comments' => [
'type' => 'long-text',
],
'atg_comment' => [
'type' => 'long-text',
],
'status_ste1' => [
'values' => [
'Agreed / подписано',
'Comment / замечание',
'Revision / Редакция',
],
'type' => 'manuel-select'
],
'status_ste2' => [
'values' => [
'Agreed / подписано',
'Comment / замечание',
'Revision / Редакция',
],
'type' => 'manuel-select'
],
'status_atg' => [
'values' => [
'Agreed / подписано',
'Comment / замечание',
'Revision / Редакция',
],
'type' => 'manuel-select'
],
'final_status' => [
'type' => 'text',
'readonly' => true
],
'id_status' => [
'type' => 'text',
'readonly' => true
],
];
/*
'test_package_number',
'circuit_number',
'p_id',
'iso_quantity',
'subcontractor',
'welding_status',
'total_wdi',
'total_complated_wdi',
'total_shop_wdi',
'total_complated_shop_wdi',
'total_field_wdi',
'total_complated_field_wdi',
'test_type',
'test_medium',
'test_pressure',
'golden_joints',
'tp_general_status',
'test_package_sent_date',
'status',
'test_package_approval_date',
'walkdown_date',
'punch_list',
'a_punch_point_open',
'b_punch_point_open',
'c_punch_point_open',
'received_by_qc',
'ndt_status',
'repair_status_total',
'planned_test',
'responsible_test',
'rfi_no',
'rfi_date',
'test_status',
'cleaning_blowing_drying_rfi',
'responsible_cleaning',
'cleaning_blowing_drying_status',
' ',
'cleaning_blowing_drying_rfi_no',
'reinstatement_rfi',
'responsible_reinstatement',
'reinstatement_status',
'reinstatement_date',
'cw',
'priority',
'priority_info',
'system_combine',
'planned_test_date',
*/
?>
<script>
// Controller alanlarını JavaScript dizisi olarak tanımla
var controllerFields = <?php echo $controllerFieldsJson; ?>;
// Translate edilmiş controller değerlerini JavaScript'e aktar
var translatedControllers = <?php echo $translatedControllersJson; ?>;
function contentReady(e) {
// onRowInserted event'ini DataGrid'e bağla
e.component.on('rowInserted', onRowInserted);
}
function FocusedCellChanged(e, dataRow) {
{{onPreparingVariables()}}
var status;
if (typeof e.row !== "undefined") {
var dataRow = e.row.data;
/*
if(dataRow.test_package_sent_date != null) {
status = "Prepairing";
}
if(dataRow.test_package_approval_date != null) {
status = "Waiting Punch";
}
if(dataRow.walkdown_date != null) {
status = "Construction";
}
if(dataRow.received_by_qc != null) {
status = "QC";
}
if(dataRow.cleaning_blowing_drying_date != null) {
status = "Cleaining / Blowing";
}
if(dataRow.responsible_reinstatement != null) {
status = "Reinstatement";
}
e.component.cellValue(rowIndex, "tp_general_status", status);
*/
}
}
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
if (e.dataField == "tp_general_status") {
e.editorOptions.readOnly = true;
}
// Total volumes alanını salt okunur yap (otomatik hesaplandığı için)
if (e.dataField == "total_volumes") {
e.editorOptions.readOnly = true;
}
// Final status alanını salt okunur yap
if (e.dataField == "final_status") {
e.editorOptions.readOnly = true;
}
// id_status alanını salt okunur yap
if (e.dataField == "id_status") {
e.editorOptions.readOnly = true;
}
if (e.dataField == "work_type") {
e.editorOptions.onFocusOut = function (args) {
console.log("work_type");
console.log(e);
console.log(e.row.data.work_type);
if (typeof e.row.data.work_type === "undefined") {
e.component.cellValue(rowIndex, "work_type", "ТРУБКА");
}
if (e.row.data.work_type == null) {
e.component.cellValue(rowIndex, "work_type", "ТРУБКА");
}
if (e.row.data.work_type == "") {
e.component.cellValue(rowIndex, "work_type", "ТРУБКА");
}
}
}
// Collected volumes değiştiğinde total hesapla
if (e.dataField == "collected_volumes") {
e.editorOptions.onValueChanged = function (args) {
console.log("Collected volumes changed:", args.value);
e.setValue(args.value);
// Yeni collected değeri
var collected = parseFloat(args.value) || 0;
// Mevcut not_collected değeri
var notCollected = parseFloat(e.component.cellValue(rowIndex, 'not_collected_volumes')) || 1;
var total = collected + notCollected;
console.log("Calculated total:", total);
// Total değerini güncelle
e.component.cellValue(rowIndex, 'total_volumes', total);
};
}
// Not collected volumes değiştiğinde total hesapla
if (e.dataField == "not_collected_volumes") {
e.editorOptions.onValueChanged = function (args) {
console.log("Not collected volumes changed:", args.value);
// Eğer boş veya 0 girilirse 1 yap
var finalValue = args.value;
if (!args.value || args.value === "" || parseFloat(args.value) === 0) {
finalValue = 1;
}
e.setValue(finalValue);
// Yeni not_collected değeri
var notCollected = parseFloat(finalValue) || 1;
// Mevcut collected değeri
var collected = parseFloat(e.component.cellValue(rowIndex, 'collected_volumes')) || 0;
var total = collected + notCollected;
console.log("Calculated total:", total);
// Total değerini güncelle
e.component.cellValue(rowIndex, 'total_volumes', total);
};
}
// Control status alanları değiştiğinde final_status'u güncelle
if (e.dataField.includes('_id_status')) {
e.editorOptions.onValueChanged = function (args) {
e.setValue(args.value);
updateFinalStatus(e, rowIndex);
updateIdStatus(e, rowIndex, e.dataField, args.value);
};
}
// Archive alanı değiştiğinde id_status'u güncelle
if (e.dataField == "archive") {
e.editorOptions.onValueChanged = function (args) {
e.setValue(args.value);
updateIdStatus(e, rowIndex, "archive", args.value);
};
}
// Controller alanları değiştiğinde final_status'u güncelle
if (controllerFields.includes(e.dataField)) {
e.editorOptions.onValueChanged = function (args) {
e.setValue(args.value);
updateFinalStatus(e, rowIndex);
updateIdStatus(e, rowIndex, e.dataField, args.value);
};
}
// Control date alanları değiştiğinde responsible'ı otomatik doldur
if (e.dataField.includes('_date') && e.dataField.includes('control')) {
e.editorOptions.onValueChanged = function (args) {
e.setValue(args.value);
// Eğer bir tarih girildi ve responsible alanı boşsa
if (args.value && !e.component.cellValue(rowIndex, 'responsible')) {
// Mevcut kullanıcının adını responsible alanına yaz
var currentUser = '<?php echo auth()->user()->name ?? ""; ?>';
if (currentUser) {
e.component.cellValue(rowIndex, 'responsible', currentUser);
}
}
};
}
// Control responsible alanları için dxSelectBox kullanarak özel değer girişi
if (e.dataField.includes('_responsible') && e.dataField.includes('control')) {
e.editorName = "dxSelectBox";
e.editorOptions.dropDownOptions = {
width: 300
};
e.editorOptions.searchEnabled = true;
e.editorOptions.acceptCustomValue = true;
// Mevcut değerleri dataSource olarak kullan
var existingValues = <?php echo json_encode(db("work_permit_documents")->whereNotNull("name_surname")->get()->pluck("name_surname")->toArray()); ?>;
e.editorOptions.dataSource = existingValues;
}
}
// Final status'u güncelle
// Yeni satır eklendiğinde default değerleri ayarla
function onRowInserted(e) {
{{onPreparingVariables()}}
// work_type alanına default "Piping" değerini ata
e.component.cellValue(e.rowIndex, "work_type", "ТРУБКА");
// not_collected_volumes alanına default "1" değerini ata
e.component.cellValue(e.rowIndex, "not_collected_volumes", 1);
// Diğer default değerler buraya eklenebilir
// e.component.cellValue(e.rowIndex, "field_name", "default_value");
}
function updateFinalStatus(e, rowIndex) {
var finalStatus = '';
var allAgreed = true;
var hasController = false;
var firstCommentController = null;
// Dinamik olarak tüm control alanlarını kontrol et
for (var i = 1; i <= <?php echo $handoverControlCount; ?>; i++) {
var statusField = 'control' + i + '_id_status';
var controllerField = 'control' + i + '_controller';
var statusValue = e.component.cellValue(rowIndex, statusField);
var controllerValue = e.component.cellValue(rowIndex, controllerField);
// Eğer controller alanı doluysa, bu controller'ı dikkate al
if (controllerValue) {
hasController = true;
// İlk "Comment / замечание" olan controller'ı bul
if (statusValue == 'Comment / замечание' && firstCommentController === null) {
firstCommentController = controllerValue;
}
// Eğer status "Agreed" değilse, tümü agreed değil
if (statusValue != 'Agreed / подписано') {
allAgreed = false;
}
}
}
// Eğer hiç controller yoksa, final status boş olsun
if (!hasController) {
finalStatus = '';
}
// Eğer herhangi bir "Comment / замечание" varsa, ilk olan controller'ı yaz
else if (firstCommentController) {
finalStatus = translatedControllers[firstCommentController] || firstCommentController;
}
// Eğer tüm controller'lar "Agreed" ise, "Archive" yaz
else if (allAgreed) {
finalStatus = 'Archive';
}
// Değilse, bir sonraki bekleyen controller'ın ismini bul
else {
for (var i = 1; i <= <?php echo $handoverControlCount; ?>; i++) {
var statusField = 'control' + i + '_id_status';
var controllerField = 'control' + i + '_controller';
var statusValue = e.component.cellValue(rowIndex, statusField);
var controllerValue = e.component.cellValue(rowIndex, controllerField);
if (statusValue == 'Agreed / подписано' && controllerValue) {
// Bir sonraki controller'ın ismini al
var nextControllerIndex = i + 1;
if (nextControllerIndex <= <?php echo $handoverControlCount; ?>) {
var nextControllerField = 'control' + nextControllerIndex + '_controller';
var nextControllerValue = e.component.cellValue(rowIndex, nextControllerField);
if (nextControllerValue) {
// Bir sonraki controller'ın translate edilmiş ismini kullan
finalStatus = translatedControllers[nextControllerValue] || nextControllerValue;
}
}
break;
}
}
}
// Final status'u güncelle
e.component.cellValue(rowIndex, 'final_status', finalStatus);
}
function updateIdStatus(e, rowIndex, changedField, changedValue) {
var idStatus = '';
var allAgreed = true;
var hasController = false;
// 1. Tüm control aşamalarını kontrol et
for (var i = 1; i <= <?php echo $handoverControlCount; ?>; i++) {
var statusField = 'control' + i + '_id_status';
var controllerField = 'control' + i + '_controller';
var statusValue = (changedField === statusField) ? changedValue : e.component.cellValue(rowIndex, statusField);
var controllerValue = (changedField === controllerField) ? changedValue : e.component.cellValue(rowIndex, controllerField);
if (controllerValue) {
hasController = true;
// Eğer "Comment / замечание" varsa, id_status direkt bu olur
if (statusValue == 'Comment / замечание') {
idStatus = 'Comment / замечание';
allAgreed = false;
break;
}
// Eğer "Revision / Редакция" varsa, id_status direkt bu olur
if (statusValue == 'Revision / Редакция') {
idStatus = 'Revision / Редакция';
allAgreed = false;
break;
}
// Eğer herhangi biri "Agreed / подписано" değilse
if (statusValue != 'Agreed / подписано') {
allAgreed = false;
}
}
}
// 2. Logic'i uygula
// Eğer idStatus henüz bir değer almadıysa (Comment veya Revision yoksa)
if (idStatus === '') {
if (allAgreed && hasController) {
// Eğer hepsi "Agreed" ise ve controller varsa
// Archive değerine bak, varsa onu kullan, yoksa "Agreed"
var archiveValue = (changedField === 'archive') ? changedValue : e.component.cellValue(rowIndex, 'archive');
idStatus = archiveValue ? archiveValue : 'Agreed / подписано';
} else {
// Controller yoksa veya henüz hepsi agreed değilse (ve comment/revision da yoksa -> boş/pending)
idStatus = 'Wait - Not Prepared';
}
}
// 3. id_status'u güncelle
e.component.cellValue(rowIndex, 'id_status', idStatus);
}
</script>
<style>
.dx-datagrid-headers {
background-color: #f8f9fa;
color: #333;
font-weight: bold;
}
.dx-header-row>td {
vertical-align: middle !important;
text-align: center !important;
white-space: normal !important;
}
.dx-data-row>td {
vertical-align: middle !important;
}
</style>
<div class="content">
<!-- Handover Dashboard Charts -->
<div class="row mb-4 d-none">
<div class="col-md-6 mb-3">
<div class="block block-rounded block-bordered">
<div class="block-header block-header-default">
<h3 class="block-title">Weekly Created Packages</h3>
</div>
<div class="block-content">
<div id="weeklyCreatedChart" style="height: 300px;"></div>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="block block-rounded block-bordered">
<div class="block-header block-header-default">
<h3 class="block-title">Weekly Created Packages by Personnel</h3>
</div>
<div class="block-content">
<div id="weeklyPersonnelChart" style="height: 300px;"></div>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="block block-rounded block-bordered">
<div class="block-header block-header-default">
<h3 class="block-title">Weekly Archived Packages</h3>
</div>
<div class="block-content">
<div id="weeklyArchivedChart" style="height: 300px;"></div>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="block block-rounded block-bordered">
<div class="block-header block-header-default">
<h3 class="block-title">Wait Time Analysis (Avg Days)</h3>
</div>
<div class="block-content">
<div id="waitTimeChart" style="height: 300px;"></div>
</div>
</div>
</div>
</div>
<script>
$(function () {
$.getJSON('?ajax=hand-over-status', function (data) {
// 1. Weekly Created
$("#weeklyCreatedChart").dxChart({
dataSource: data.weeklyCreated,
series: {
argumentField: "week",
valueField: "count",
name: "Packages",
type: "bar",
color: "#3498db",
label: { visible: true, format: { type: 'fixedPoint', precision: 0 } }
},
legend: { visible: false },
argumentAxis: { label: { format: "shortDate" } },
tooltip: { enabled: true }
});
// 2. Weekly Personnel
var personnelSeries = [];
// Group data by responsible for Chart series
// Need to pivot or use series template
// Using seriesTemplate for dynamic series based on 'responsible'
$("#weeklyPersonnelChart").dxChart({
dataSource: data.weeklyPersonnel,
seriesTemplate: {
nameField: "responsible",
customizeSeries: function (valueName) {
return { valueField: "count", argumentField: "week" };
}
},
commonSeriesSettings: {
type: "stackedBar"
},
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center"
},
tooltip: { enabled: true }
});
// 3. Weekly Archived
$("#weeklyArchivedChart").dxChart({
dataSource: data.weeklyArchived,
series: {
argumentField: "week",
valueField: "count",
name: "Archived",
type: "bar",
color: "#2ecc71",
label: { visible: true, format: { type: 'fixedPoint', precision: 0 } }
},
legend: { visible: false },
argumentAxis: { label: { format: "shortDate" } },
tooltip: { enabled: true }
});
// 4. Wait Time
$("#waitTimeChart").dxChart({
dataSource: data.waitData,
commonSeriesSettings: {
argumentField: "month",
type: "line",
point: { visible: true }
},
series: [
{ valueField: "control1_avg", name: "Control 1 Avg Days", color: "#e74c3c" },
{ valueField: "control2_avg", name: "Control 2 Avg Days", color: "#f39c12" }
],
tooltip: { enabled: true, customizeTooltip: function (arg) { return { text: arg.seriesName + ": " + arg.valueText + " days" }; } },
legend: { verticalAlignment: "bottom", horizontalAlignment: "center" }
});
});
});
</script>
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,26 +0,0 @@
<?php
use App\Models\HardnessTest;
$title = "Hardness Test";
$tableWidth="100%";
$listDatas = HardnessTest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "hardness_tests";
$tableType = "datagrid";
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
-139
View File
@@ -1,139 +0,0 @@
<?php
use App\Models\HardnessTest;
//$noRemoteOperations = true;
$title = "HT Log";
$tableWidth="100%";
$listDatas = HardnessTest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "hardness_tests";
$tableType = "datagrid";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'ht_result' => [
'datas' => db("results")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_ht',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Base Element Info' => [
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'HT Info' => [
'ht_request_no',
'ht_request_date',
'no_of_ht_hardnes_test',
'ht_test_date',
'ht_result',
'control_standart',
'tester_name',
'real_welder_1',
'real_welder_2',
'record_1_rc',
'record_2_rc',
'record_3_rc',
],
];
$firstUploadFolder = '004_QA/0008_HT/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'ht_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,50 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php //$lineLists = // db("weld_logs")->groupBy("iso_number")->select("iso_number")->groupBy("iso_number")->get()->pluck("iso_number")->toArray();
$path = "storage/documents/005_PTO/06_Прочность и плотность";
$lineLists = glob("$path/*.*");
?>
<div class="row">
<div class="col-md-10">
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select Line No")}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".html", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show Hydro Test PDF")}}</button>
</div>
</div>
<div class="col-md-2">
<div class="btn btn-primary generate-all2" type="pdf-hydro-test-generator">{{e2("Generate All")}}</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/005_PTO/06_Прочность и плотность/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
@@ -1,282 +0,0 @@
<?php
use App\Models\IncomingControlPaint;
$ralCodes = array_column(j(setting('ral-codes')), 'ral_code');
$title = "Incoming Control Paint";
$tableWidth="10000px";
$tableName = "incoming_control_paints";
/*
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From MTO")
];
*/
$blockGroup = [
'General Information' => [
'pdf_certificate',
'pdf_akt',
'rfi_no',
'rfi_date',
'akt_number',
'akt_date',
'suplier',
'project',
'revision',
'component_name',
],
'Paint Details' => [
'brend_name',
'colour',
'ral_code',
'manufacturing_standard',
'lot_no',
],
'Quantity Information' => [
'quantity',
'unit_kgmetc',
'certificate_quantity',
'certificate_page_quantity',
],
'Certificate Information' => [
'certificate_no',
'certificate_date',
],
'Status Information' => [
'akt_status',
'inspected_by',
'third_party',
]
];
$paintMatrix = db("paint_matrices")->get();
$brends = [];
foreach($paintMatrix AS $pm) {
if(!is_null($pm->brend_name_1))
$brends[] = $pm->brend_name_1;
if(!is_null($pm->brend_name_2))
$brends[] = $pm->brend_name_2;
if(!is_null($pm->brend_name_3))
$brends[] = $pm->brend_name_3;
}
$brends = array_unique($brends);
$relationDatas = [
'pdf_certificate' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pdf_akt' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'unit_kgmetc' => [
'values' => [
'KG',
'MM',
'Piece',
],
'type' => 'manuel-select'
],
'akt_status' => [
'values' => [
'Signed',
'Waiting',
'Preparing',
],
'type' => 'manuel-select'
],
'ral_code' => [
'values' => $ralCodes,
'type' => 'manuel-select'
],
'discipline' => [
'datas' => db("disciplines")->get(),
'pattern' => '{discipline_title}',
'type' => 'select-dropdown'
],
'brend_name' => [
'values' => $brends,
'type' => 'manuel-select'
],
];
$prependColumns = [
/*
'Certificate File' => [
'type' => 'link-search',
'path' => '002_Project_Materials/002_Material Certificate/',
'pattern' => "{certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
'AKT File' => [
'type' => 'link-search',
'path' => '002_Project_Materials/001_Material Akt/',
'pattern' => "{akt_number}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
*/
];
$firstUploadFolder = '002_Project_Materials/002_Material Certificate/';
$firstUploadTitle = 'Upload Certificate File PDF';
$secondUploadFolder = '002_Project_Materials/001_Material Akt/';
$secondUploadTitle = 'Upload AKT File PDF';
$uploadPermissionKey = 'incoming_control_paint_upload_permission';
?>
<script>
$(function(){
});
</script>
<script>
function editorPreparing(e, dataRow) {
var options = e.editorOptions;
var rowIndex = e.row.rowIndex;
var dataGrid = $("#dataGrid").dxDataGrid("instance");
var exceptValue = ['undefined', 'null'];
if(e.dataField == "component_code") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("m_t_o_s","component_code_id")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'component_code_id';
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("m_t_o_s","component_code_id")}}?value=" + selectData.value, function(responseJSON) {
if(typeof responseJSON.component_code_id !== 'undefined') {
<?php
$affectedCols = [
'description_ru' => '{responseJSON.description_ru}',
'description_en' => '{responseJSON.description_en}',
'manufacturing_standard' => '{responseJSON.manufacturing_standard}',
'material' => '{responseJSON.material}',
'material_quality_standard' => '{responseJSON.material_quality_standard}',
'dia_inch_1' => '{responseJSON.dia_inch_1}',
'diainch_2' => '{responseJSON.diainch_2}',
'dn_1' => '{responseJSON.dn_1}',
'dn_2' => '{responseJSON.dn_2}',
'odmm_1' => '{responseJSON.odmm_1}',
'odmm_2' => '{responseJSON.odmm_2}',
'schedule_1' => '{responseJSON.schedule_1}',
'schedule_2' => '{responseJSON.schedule_2}',
'thicknessmm_1' => '{responseJSON.thicknessmm_1}',
'thicknessmm_2' => '{responseJSON.thicknessmm_2}',
];
foreach($affectedCols AS $affectedCol => $valueCol) {
$valueCol = str_replace('{', '${', $valueCol);
?>
if(!exceptValue.includes(`{{$valueCol}}`)) {
dataGrid.cellValue(rowIndex, "{{$affectedCol}}", `{{$valueCol}}`);
}
<?php
}
?>
}
});
}
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
<?php
if(getisset("sync")) {
$cachePrefix = 'incoming_control_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$mtos = db("m_t_o_s")->where("id",">", $lastId)->take(1000)->get();
// dd($mtos);
$count = 0;
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
foreach($mtos AS $mto) {
$data = [
'component_code' => $mto->component_code_id,
'description_en' => $mto->description_en,
'description_ru' => $mto->description_ru,
'manufacturing_standard' => $mto->manufacturing_standard,
'material' => $mto->material ,
'material_quality_standard' => $mto->material_quality_standard,
'dia_inch_1' => $mto->dia_inch_1,
'dn_1' => $mto->dn_1,
'odmm_1' => $mto->odmm_1,
'schedule_1' => $mto->schedule_1,
'thicknessmm_1' => $mto->thicknessmm_1,
'diainch_2' => $mto->diainch_2,
'dn_2' => $mto->dn_2,
'odmm_2' => $mto->odmm_2,
'schedule_2' => $mto->schedule_2,
'thicknessmm_2' => $mto->thicknessmm_2,
'pn_mpa' => $mto->pn_mpa,
/*
'heat_number',
'akt_status',
'scan_certificate_link',
'scan_akt_link',
'inspected_by',
'third_party',
'constructor',
'osd_report_no',
*/
];
IncomingControlPaint::firstOrCreate($data);
Cache::put($cachePrefix, $mto->id);
$count++;
}
bilgi(":count Data has been sync from MTO",
"success",
['count' => $count]
);
}
$listDatas = IncomingControlPaint::orderBy("id","DESC")->paginate(setting('row_count'));
?>
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,427 +0,0 @@
<?php
use App\Models\IncomingControl;
$title = "Incoming Control";
$tableWidth="10000px";
$tableName = "incoming_controls";
$disableTotalSummary = false; // Enable summary for Incoming Control
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From MTO")
];
$blockGroup = [
'Files' => [
'certificate_file',
'akt_file',
'email_tq_file',
'osd_defect_akt_file',
],
'General Information' => [
'rfi',
'rfi_date',
'discipline',
'designer',
'component_code',
'request_no',
'request_date',
],
'Packing Info' => [
'packing_list_number',
'packing_list_position',
'packing_list_quantity',
'akt_number',
'date_of_akt',
],
'Project Info' => [
'project',
'drawing_number',
'revision',
'short_name_material',
'description_en',
'description_ru',
'manufacturing_standard',
'material',
'material_quality_standard',
],
'Diameter & Thickness' => [
'dia_inch_1',
'dn_1',
'odmm_1',
'schedule_1',
'thicknessmm_1',
'diainch_2',
'dn_2',
'odmm_2',
'schedule_2',
'thicknessmm_2',
],
'Quantity Info' => [
'pn_mpa',
'requested_quantity',
'received_quantity',
'certificate_quantity',
'unit_kgmetc',
],
'Cleaning Material Certificate' => [
'cleaning_certificate_no',
'cleaning_certificate_date',
'cleaning_certificate_page_quantity',
'cleaning_heat_number',
'cleaning_akt_status',
],
'Certificate Info' => [
'certificate_no',
'certificate_date',
'certificate_page_quantity',
'heat_number',
'akt_status',
/*
'scan_certificate_link',
'scan_akt_link',
*/
],
'Email / Technical Query Tracking' => [
'email_tq_number',
],
'Result' => [
'inspected_by',
'third_party',
'constructor',
'osd_report_no',
'osd_report_date',
'remarks',
],
];
$relationDatas = [
'certificate_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-download"></i>'
],
'akt_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-download"></i>'
],
'email_tq_file' => [
'caption' => 'TQ',
'type' => 'link-search',
'html' => '<i class="fa fa-download"></i>'
],
'osd_defect_akt_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-download"></i>'
],
'unit_kgmetc' => [
'values' => j(setting('unit_kgmetc')) ?? [],
'type' => 'manuel-select'
],
'akt_status' => [
'values' => [
'Signed',
'Waiting',
'Preparing',
],
'type' => 'manuel-select'
],
'designer' => [
'datas' => db("subcontractors")->where("operation_type", "Engineering")->get(),
'pattern' => '{company_name_ru}',
'type' => 'select-dropdown'
],
'discipline' => [
'datas' => db("disciplines")->get(),
'pattern' => '{discipline_title}',
'type' => 'select-dropdown'
],
'description_en' => [
'type' => 'string',
'headerFilter' => [
'dataSource' => 'custom'
]
],
'description_ru' => [
'type' => 'string',
'headerFilter' => [
'dataSource' => 'custom'
]
],
'material' => [
'type' => 'string',
'headerFilter' => [
'dataSource' => 'custom'
]
],
'manufacturing_standard' => [
'type' => 'string',
'headerFilter' => [
'dataSource' => 'custom'
]
],
'drawing_number' => [
'caption' => 'Line',
'type' => 'string'
],
'project' => [
'caption' => 'Project',
'type' => 'string'
],
'email_tq_number' => [
'type' => 'string'
],
];
/*
$prependColumns = [
'Certificate File' => [
'type' => 'link-search',
'path' => '002_Project_Materials/002_Material Certificate/',
'pattern' => "{certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
'AKT File' => [
'type' => 'link-search',
'path' => '002_Project_Materials/001_Material Akt/',
'pattern' => "{akt_number}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
];
*/
$firstUploadFolder = '002_Project_Materials/002_Material Certificate/';
$firstUploadTitle = 'Upload Certificate File PDF';
$secondUploadFolder = '002_Project_Materials/001_Material Akt/';
$secondUploadTitle = 'Upload AKT File PDF';
$thirdUploadFolder = '002_Project_Materials/005_Material_Agreement/';
$thirdUploadTitle = 'Upload Email/TQ File';
$thirdUploadDescription = 'Drop Email/TQ agreement files here or upload them selectively.';
$thirdUploadAccepted = '.pdf,.jpg,.jpeg,.png';
$fourthUploadFolder = '002_Project_Materials/006_Defect_Documents/';
$fourthUploadTitle = 'Upload OSD Defect Document';
$fourthUploadDescription = 'Drop OSD Defect documents here or upload them selectively.';
$fourthUploadAccepted = '.pdf,.jpg,.jpeg,.png';
$uploadPermissionKey = 'incoming_control_upload_permission';
?>
<script>
var readOnlyForDiscipline = [
''
];
function editorPreparing(e, dataRow) {
var options = e.editorOptions;
var rowIndex = e.row.rowIndex;
var dataGrid = $("#dataGrid").dxDataGrid("instance");
var exceptValue = ['undefined', 'null'];
if(readOnlyForDiscipline.includes(e.dataField)) {
if(e.row.data.discipline != "") {
e.editorOptions.readOnly = true;
}
}
if(e.dataField == "material") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("materials","steel_grade")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'steel_grade';
}
if(e.dataField == "description_ru") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("m_t_o_s","description_ru")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'description_ru';
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("m_t_o_s","description_ru")}}?value=" + selectData.value, function(responseJSON) {
if(typeof responseJSON.description_ru !== 'undefined') {
<?php
$affectedCols = [
'project' => '{responseJSON.project}',
'revision' => '{responseJSON.rev}',
'discipline' => '{responseJSON.discipline}',
'description_en' => '{responseJSON.description_en}',
'manufacturing_standard' => '{responseJSON.manufacturing_standard}',
'material' => '{responseJSON.material}',
'material_quality_standard' => '{responseJSON.material_quality_standard}',
'dia_inch_1' => '{responseJSON.dia_inch_1}',
'diainch_2' => '{responseJSON.diainch_2}',
'dn_1' => '{responseJSON.dn_1}',
'dn_2' => '{responseJSON.dn_2}',
'odmm_1' => '{responseJSON.odmm_1}',
'odmm_2' => '{responseJSON.odmm_2}',
'schedule_1' => '{responseJSON.schedule_1}',
'schedule_2' => '{responseJSON.schedule_2}',
'thicknessmm_1' => '{responseJSON.thicknessmm_1}',
'thicknessmm_2' => '{responseJSON.thicknessmm_2}',
'designer' => '{responseJSON.designer}',
];
foreach($affectedCols AS $affectedCol => $valueCol) {
$valueCol = str_replace('{', '${', $valueCol);
?>
if(!exceptValue.includes(`{{$valueCol}}`)) {
dataGrid.cellValue(rowIndex, "{{$affectedCol}}", `{{$valueCol}}`);
}
<?php
}
?>
}
});
}
}
if(e.dataField == "component_code") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("m_t_o_s","component_code_id")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'component_code_id';
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("m_t_o_s","component_code_id")}}?value=" + selectData.value, function(responseJSON) {
if(typeof responseJSON.component_code_id !== 'undefined') {
<?php
$affectedCols = [
'material_quality_standard' => '{responseJSON.material_quality_standard}',
'project' => '{responseJSON.project}',
'revision' => '{responseJSON.rev}',
'discipline' => '{responseJSON.discipline}',
'description_ru' => '{responseJSON.description_ru}',
'description_en' => '{responseJSON.description_en}',
'manufacturing_standard' => '{responseJSON.manufacturing_standard}',
'material' => '{responseJSON.material}',
'material_quality_standard' => '{responseJSON.material_quality_standard}',
'dia_inch_1' => '{responseJSON.dia_inch_1}',
'diainch_2' => '{responseJSON.diainch_2}',
'dn_1' => '{responseJSON.dn_1}',
'dn_2' => '{responseJSON.dn_2}',
'odmm_1' => '{responseJSON.odmm_1}',
'odmm_2' => '{responseJSON.odmm_2}',
'schedule_1' => '{responseJSON.schedule_1}',
'schedule_2' => '{responseJSON.schedule_2}',
'thicknessmm_1' => '{responseJSON.thicknessmm_1}',
'thicknessmm_2' => '{responseJSON.thicknessmm_2}',
'designer' => '{responseJSON.designer}',
];
foreach($affectedCols AS $affectedCol => $valueCol) {
$valueCol = str_replace('{', '${', $valueCol);
?>
if(!exceptValue.includes(`{{$valueCol}}`)) {
dataGrid.cellValue(rowIndex, "{{$affectedCol}}", `{{$valueCol}}`);
}
<?php
}
?>
}
});
}
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
<?php
if(getisset("sync")) {
$cachePrefix = 'incoming_control_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$mtos = db("m_t_o_s")->where("id",">", $lastId)->take(1000)->get();
// dd($mtos);
$count = 0;
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
foreach($mtos AS $mto) {
$data = [
'component_code' => $mto->component_code_id,
'description_en' => $mto->description_en,
'description_ru' => $mto->description_ru,
'manufacturing_standard' => $mto->manufacturing_standard,
'material' => $mto->material ,
'material_quality_standard' => $mto->material_quality_standard,
'dia_inch_1' => $mto->dia_inch_1,
'dn_1' => $mto->dn_1,
'odmm_1' => $mto->odmm_1,
'schedule_1' => $mto->schedule_1,
'thicknessmm_1' => $mto->thicknessmm_1,
'diainch_2' => $mto->diainch_2,
'dn_2' => $mto->dn_2,
'odmm_2' => $mto->odmm_2,
'schedule_2' => $mto->schedule_2,
'thicknessmm_2' => $mto->thicknessmm_2,
'pn_mpa' => $mto->pn_mpa,
'drawing_number' => $mto->drawing_number,
/*
'heat_number',
'akt_status',
'scan_certificate_link',
'scan_akt_link',
'inspected_by',
'third_party',
'constructor',
'osd_report_no',
*/
];
IncomingControl::firstOrCreate($data);
Cache::put($cachePrefix, $mto->id);
$count++;
}
bilgi(":count Data has been sync from MTO",
"success",
['count' => $count]
);
}
$listDatas = IncomingControl::orderBy("id","DESC")->paginate(setting('row_count'));
?>
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,50 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php //$lineLists = // db("weld_logs")->groupBy("iso_number")->select("iso_number")->groupBy("iso_number")->get()->pluck("iso_number")->toArray();
$path = "storage/documents/005_PTO/11_Внутренней очистки";
$lineLists = glob("$path/*.*");
?>
<div class="row">
<div class="col-md-10">
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select Line No")}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".html", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show PDF")}}</button>
</div>
</div>
<div class="col-md-2">
<div class="btn btn-primary generate-all2" type="pdf-internal-cleaning-of-pipelines">{{e2("Generate All")}}</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){https://devqms.stellarcons.com/storage/documents/004_QA
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/005_PTO/11_Внутренней очистки/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
-62
View File
@@ -1,62 +0,0 @@
<?php
use App\Models\ITP;
$title = "ITP";
$tableWidth="100%";
$listDatas = ITP::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "i_t_p_s";
//$noRemoteOperations = true;
$blockGroup = [
'General Informations' => [
'download',
'discipline',
'itp_no',
'item_no',
'inspection_step_ru',
'inspection_step_en',
'standard_procedures',
'working_drawing',
'report_document_protocol',
],
'Inspection Control' => [
'subcontractor',
'ste',
'cas',
'mf',
],
'Remarks' => ['remarks']
];
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'discipline' => [
'values' => db("disciplines")->groupBy("discipline_title")->get()->pluck("discipline_title")->toArray(),
'type' => 'manuel-select'
],
];
$firstUploadFolder = '004_QA/000_ITP/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'itp_upload_permission';
?>
<script>
function contentReady(e) {
// e.component.columnOption("itp_no", "groupIndex", 0);
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,275 +0,0 @@
<?php
use App\Models\WeldLog;
use Illuminate\Support\Facades\DB;
$title = "Joint Release Log";
$tableWidth = "2000%";
// KRİTİK KURAL: Joint Release = (is_welded=1 olanlar) + (silinmiş ama welded olanlar)
// Weldlog = gerçek üretim | Deleted = geçmiş/hata/revizyon
// Joint Release = müşteriye gösterilen gerçek welded jointler + silinmiş ama welded olan önemli jointler
// Filtre: joint_types tablosundaki is_welded=1 olan type_of_welds değerleri
$skipListDatasOverride = true;
$tableName = "weld_logs";
$excludeMechanicalFromSummaries = true;
$alwaysSelectColumns = ['type_of_welds'];
$enableMechanicalControls = true;
$id = "joint-release-log";
$moduleId = "joint-release-log";
$readOnlyColumns = [
'general_contractor',
'contractor',
'ste_subcontractor',
'spool_zone',
'piping_class',
'design_area',
'line_number',
'spool_status',
'clearance_date',
'clearance_no',
'iso_number',
'spool_number',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'joint_release_rfi_no',
'joint_release_rfi_date',
'joint_release_document_no',
'joint_release_document_date',
'rt_scope',
'rt_report',
'rt_test_date',
'rt_result',
'rt_release_rfi_no',
'rt_release_rfi_date',
'ut_scope',
'ut_report',
'ut_test_date',
'ut_result',
'ut_release_rfi_no',
'ut_release_rfi_date',
'pt_scope',
'pt_report',
'pt_test_date',
'pt_result',
'pt_release_rfi_no',
'pt_release_rfi_date',
'mt_scope',
'mt_report',
'mt_test_date',
'mt_result',
'mt_release_rfi_no',
'mt_release_rfi_date',
'pmi_scope',
'pmi_report',
'pmi_test_date',
'pmi_result',
'pmi_release_rfi_no',
'pmi_release_rfi_date',
'vt_scope',
'vt_report',
'date_of_vt',
'vt_result',
'vt_release_rfi_no',
'vt_release_rfi_date',
'pwht',
'pwht_date',
'pwht_release_rfi_no',
'pwht_release_rfi_date',
'ht_scope',
'ht_report',
'ht_result',
'ht_release_rfi_no',
'ht_release_rfi_date',
'ferrite_scope',
'no_of_ferrite_check',
'date_of_ferrite_check',
'ferrite_result',
'ferrite_release_rfi_no',
'ferrite_release_rfi_date',
];
$blockGroup = [
'Attachment' => [
'pdf_engineering',
'pdf_spool_iso',
'pdf_as_build',
],
'General Information' => [
'general_contractor',
'contractor',
'ste_subcontractor',
'project',
'spool_zone',
'piping_class',
'design_area',
'line_number',
],
'Spool Information' => [
'iso_number',
'iso_rev',
'spool_number',
'spool_status',
'clearance_no',
'clearance_date',
],
'Joint Information' => [
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
],
'Joint Release' => [
'joint_release_rfi_no',
'joint_release_rfi_date',
'joint_release_document_no',
'joint_release_document_date',
],
'RT Release' => [
'rt_scope',
'rt_report',
'rt_test_date',
'rt_result',
'rt_release_rfi_no',
'rt_release_rfi_date',
],
'UT Release' => [
'ut_scope',
'ut_report',
'ut_test_date',
'ut_result',
'ut_release_rfi_no',
'ut_release_rfi_date',
],
'PT Release' => [
'pt_scope',
'pt_report',
'pt_test_date',
'pt_result',
'pt_release_rfi_no',
'pt_release_rfi_date',
],
'MT Release' => [
'mt_scope',
'mt_report',
'mt_test_date',
'mt_result',
'mt_release_rfi_no',
'mt_release_rfi_date',
],
'PMI Release' => [
'pmi_scope',
'pmi_report',
'pmi_test_date',
'pmi_result',
'pmi_release_rfi_no',
'pmi_release_rfi_date',
],
'VT Release' => [
'vt_scope',
'vt_report',
'date_of_vt',
'vt_result',
'vt_release_rfi_no',
'vt_release_rfi_date',
],
'PWHT Release' => [
'pwht',
'pwht_date',
'pwht_release_rfi_no',
'pwht_release_rfi_date',
],
'HT Release' => [
'ht_scope',
'ht_report',
'ht_result',
'ht_release_rfi_no',
'ht_release_rfi_date',
],
'Ferrite Release' => [
'ferrite_scope',
'no_of_ferrite_check',
'date_of_ferrite_check',
'ferrite_result',
'ferrite_release_rfi_no',
'ferrite_release_rfi_date',
],
];
$columnRedesign = [];
$columnsArray = ['rt', 'ut', 'pt', 'mt', 'pmi', 'vt', 'pwht', 'ht', 'ferrite'];
foreach ($columnsArray as $columnKey) {
$columnRedesign[$columnKey]['class'] = "col-md-6";
$columnRedesign[$columnKey]['border'] = true;
$columnRedesign[$columnKey]['color'] = 15;
}
// RFI no alanları ve karşılık gelen date alanları
$rfiFields = [
'joint_release_rfi_no' => 'joint_release_rfi_date',
'rt_release_rfi_no' => 'rt_release_rfi_date',
'ut_release_rfi_no' => 'ut_release_rfi_date',
'pt_release_rfi_no' => 'pt_release_rfi_date',
'mt_release_rfi_no' => 'mt_release_rfi_date',
'pmi_release_rfi_no' => 'pmi_release_rfi_date',
'vt_release_rfi_no' => 'vt_release_rfi_date',
'pwht_release_rfi_no' => 'pwht_release_rfi_date',
'ht_release_rfi_no' => 'ht_release_rfi_date',
'ferrite_release_rfi_no' => 'ferrite_release_rfi_date',
];
?>
<script>
function contentReady(e) {
var dataGrid = e.component;
// RFI popup helper'ını başlat
if (typeof window.setupRFIPopupHelpers === 'function') {
window.setupRFIPopupHelpers(dataGrid);
// Tüm RFI no alanlarına büyüteç ekle
var rfiFields = @json($rfiFields);
for (var rfiNoField in rfiFields) {
if (typeof window.attachRFIMagnifier === 'function') {
window.attachRFIMagnifier(rfiNoField, rfiFields[rfiNoField]);
}
}
}
// Deleted badge için onRowPrepared event'i
dataGrid.on('rowPrepared', function (e) {
if (e.rowType === 'data' && e.data) {
var rowData = e.data;
var isDeleted = rowData.deleted_comment || rowData.deleted_date;
if (isDeleted) {
// Deleted badge ekle
var $row = $(e.rowElement);
var $firstCell = $row.find('td').first();
if ($firstCell.find('.deleted-badge').length === 0) {
var badgeHtml = '<span class="badge badge-danger deleted-badge" title="' + (rowData.deleted_comment || 'Deleted') + '">DELETED</span>';
if (rowData.deleted_comment) {
badgeHtml += ' <span class="text-muted" style="font-size: 11px;">(' + rowData.deleted_comment + ')</span>';
}
$firstCell.prepend(badgeHtml + ' ');
}
// Satırı gri yap
$row.css('background-color', '#f5f5f5');
$row.css('opacity', '0.7');
}
}
});
// is_deleted sütununu gizle (sadece badge için kullanıyoruz)
dataGrid.columnOption('is_deleted', 'visible', false);
dataGrid.columnOption('deleted_comment', 'visible', false);
}
</script>
@include("admin.type.weldmap.main")
@include("components.rfi-popup")
@@ -1,50 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php // $lineLists = db("weld_logs")->groupBy("iso_number")->select("iso_number")->groupBy("iso_number")->get()->pluck("iso_number")->toArray();
$path = "storage/documents/005_PTO/07_Герметичность";
$lineLists = glob("$path/*.*");
?>
<div class="row">
<div class="col-md-10">
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select Line No")}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".html", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show Leak Test PDF")}}</button>
</div>
</div>
<div class="col-md-2">
<div class="btn btn-primary generate-all2" type="leak-test-generator">{{e2("Generate All")}}</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){https://devqms.stellarcons.com/storage/documents/004_QA
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/005_PTO/07_Герметичность/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
@@ -1,54 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php
$path = "storage/documents/005_PTO/03_свидетельство";
$lineLists = glob("$path/*.*");
// db("line_lists")->groupBy("line_no")->select("line_no")->groupBy("line_no")->get()->pluck("line_no")->toArray();
?>
<div class="row">
<div class="col-md-10">
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select Line No")}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".html", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show Line Certificates PDF")}}</button>
</div>
</div>
<div class="col-md-2">
<div class="btn btn-primary generate-all2" type="pdf-line-certificate-generator">{{e2("Generate All")}}</div>
<div class="btn btn-primary generate-all2" type="pdf-line-certificate-generator&first">{{e2("Generate One")}}</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/005_PTO/03_свидетельство/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
@@ -1,350 +0,0 @@
<?php
use App\Models\LineList;
////$noRemoteOperations = true;
$title = "Line List";
$tableWidth="300%";
$path = "admin.type.line-list";
$listDatas = LineList::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "line_lists";
if(getisset("fill")) {
$pattern = setting("line_list_drawing_no_pattern");
$emptyLists = LineList::orderBy("id","DESC")->get()->toArray();
$fillCount = 0;
foreach($emptyLists AS $emptyList) {
$thisPattern = $pattern;
foreach($emptyList AS $column => $value) {
$thisPattern = str_replace("{". $column. "}",$value, $thisPattern);
}
LineList::where("id", $emptyList['id'])
->update(
[
'sheet'=>$thisPattern]
);
$fillCount++;
}
}
$relationDatas = [
'naks_technology' => [
'values' => db("hazard_classes")->select("serial_number")->get()->pluck("serial_number"),
'type' => 'manuel-select'
],
'engineering' => [
'values' => db("subcontractors")->select("company_name_en")->where("job_description", "ENGINEERING")->get()->pluck("company_name_en"),
'type' => 'manuel-select'
],
'pwht' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'category' => [
'type' => 'auto-complete',
'table' => 'line_list_categories',
'column' => 'category_title',
'pattern' => '{category_title}',
'affected' => [],
],
'fluid_group' => [
'type' => 'auto-complete',
'table' => 'line_list_groups',
'column' => 'group_title',
'pattern' => '{group_title}',
'affected' => [],
],
'leakage' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'tracing' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'tracing_type' => [
'values' => [
'Steam',
'Heat',
'Oil',
'Electrical',
],
'type' => 'manuel-select'
],
/*
'sheet' => [
'type' => 'auto-complete',
'table' => 'weld_logs',
'column' => 'iso_number',
'pattern' => '{iso_number}',
'affected' => [],
],
*/
];
/*
dd(table_columns($tableName));
0 => "id"
3 => "unit"
4 => "line_no"
5 => "sheet"
6 => "p_id"
7 => "line_specification"
8 => "painting_cycle"
9 => "external_finish_type"
10 => "rev"
11 => "fluid_code"
12 => "from"
13 => "to"
14 => "pipe_material_class"
15 => "dn"
16 => "design_pressure_mpa"
17 => "working_pressure_mpa"
18 => "working_temperature"
19 => "design_temperature"
20 => "density"
21 => "ndt"
22 => "pwht"
23 => "asme_fluid_service"
24 => "category"
25 => "fluid_group"
26 => "test_media"
27 => "test_pressure_mpa"
28 => "pneumatic_test_pressure"
29 => "remarks"
]
*/
$blockGroup = [
'Basic Drawing Data' => [
'naks_technology',
'plant',
'engineering',
'unit',
'line_no',
'sheet',
'p_id',
'line_specification',
'painting_cycle',
'external_finish_type',
'tracing',
'tracing_type',
'rev',
],
'Design Data' => [
'circuit_number',
'fluid_code',
'fluid_ru',
'fluid_en',
'from',
'to',
'pipe_material_class',
'dn',
'design_pressure_mpa',
'working_pressure_mpa',
'working_temperature',
'design_temperature',
'density',
'ndt',
'pwht',
],
'Clasification Data' => [
'asme_fluid_service',
'category',
'fluid_group',
],
'Test Pressures Information' => [
'test_media',
'test_pressure_mpa',
'leakage',
'test_pressure',
'remarks',
]
];
$columnRedesign['test-pressures-information']['class'] = "col-md-6";
$columnRedesign['clasification-data']['class'] = "col-md-6";
$topButtons = [];
$topButtons[] = [
'href' => '?fill',
'html' => '<i class="fa fa-sync"></i> ' . __("Fill Drawing No Use Pattern")
];
?>
<script>
const lineListOverrideColumns = [];
@if(isSpecificPermission("line_list_external_finish_type_edit_permission"))
lineListOverrideColumns.push("external_finish_type");
@endif
@if(isSpecificPermission("line_list_paint_cycle_edit_permission"))
lineListOverrideColumns.push("painting_cycle");
@endif
window.lineListOverrideColumns = lineListOverrideColumns;
function initialized() {
var dataGrid = $("#dataGrid").dxDataGrid("instance");
var editingOptions = dataGrid.option("editing") || {};
var hasModifyPermission = !!editingOptions.allowUpdating;
if(lineListOverrideColumns.length > 0) {
lineListOverrideColumns.forEach(function(columnName) {
dataGrid.columnOption(columnName, "allowEditing", true);
});
}
window.lineListOverrideActive = lineListOverrideColumns.length > 0 && !hasModifyPermission;
if(window.lineListOverrideActive) {
var newEditingOptions = Object.assign(
{
mode: 'batch',
startEditAction: 'click',
refreshMode: 'repaint'
},
editingOptions,
{
allowUpdating: true
}
);
dataGrid.option("editing", newEditingOptions);
}
var toolbarItems = dataGrid.option("toolbar.items");
toolbarItems.unshift({
widget: 'dxButton',
location: 'before',
options: {
icon: 'compare',
text: 'Compare Weldlog',
onClick: function() {
$("#modal-popin").modal();
$("#modal-popin .modal-dialog").addClass("modal-lg");
$("#modal-popin .modal-footer").remove();
$("#modal-popin .block-content").html("Loading...");
$("#modal-popin .block-title").html("Compare Weldlog");
$.get("?ajax2=admin.type.weld-line-comparator", function(d) {
$("#modal-popin .block-content").html(d);
$("#modal-popin .alert").remove();
$("#modal-popin .block-header-default").remove();
});
}
}
});
dataGrid.option("toolbar.items", toolbarItems);
dataGrid.columnOption("tracing", "setCellValue", function(newData, value, currentRowData) {
newData.tracing = value;
if (value !== "YES") {
newData.tracing_type = null;
}
});
dataGrid.columnOption("test_pressure_mpa", "width", 180);
dataGrid.columnOption("test_pressure", "width", 280);
}
</script>
<script>
const numberFields = [
'ndt',
];
function editorPreparing(e, dataRow) {
var rowIndex = e.row.rowIndex;
if(e.dataField == "group_no") {
e.editorOptions.mask = "00";
e.editorOptions.useMaskBehavior = true;
}
var pattern = "{{setting("line_list_drawing_no_pattern")}}";
@if(isSpecificPermission("line_list_external_finish_type_edit_permission"))
if(e.dataField == "external_finish_type") {
e.editorOptions.readOnly = false;
}
@endif
@if(isSpecificPermission("line_list_paint_cycle_edit_permission"))
if(e.dataField == "painting_cycle") {
e.editorOptions.readOnly = false;
}
@endif
if(window.lineListOverrideActive) {
var overrideColumns = window.lineListOverrideColumns || [];
if(overrideColumns.indexOf(e.dataField) === -1) {
e.editorOptions.readOnly = true;
} else {
e.editorOptions.readOnly = false;
}
}
if(numberFields.includes(e.dataField)) {
console.log(e.dataField + " number");
e.validationRules[0] = {
type: 'range',
min: 0,
max: 100,
message: 'Value should be between 0 and 100'
};
}
if(e.dataField == "sheet") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("weld_logs","iso_number")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'iso_number';
}
if(e.dataField === "tracing_type") {
var tracingValue = e.row.data.tracing;
if(e.row.modifiedValues && e.row.modifiedValues.hasOwnProperty('tracing')){
tracingValue = e.row.modifiedValues.tracing;
}
if (tracingValue !== 'YES') {
e.editorOptions.readOnly = true;
} else {
e.editorOptions.readOnly = false;
}
}
}
</script>
<div class="content">
<div class="row">
<div class="col-12">
{{isset($fillCount) ? bilgi(":count Data has been fill use pattern",
"success",
['count' => $fillCount]
) : ""}}
</div>
@include("components.blocks.module-block")
</div>
</div>
@@ -1,55 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php
$path = "storage/documents/005_PTO/08_Спецификация";
$lines = glob("$path/*.*");
//db("m_t_o_s")->groupBy("line")->select("line")->groupBy("line")->get()->pluck("line")->toArray();
?>
<div class="row">
<div class="col-md-10">
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select Line No")}}</option>
<?php foreach($lines AS $line) {
$line = str_replace("$path/", "", $line);
$line2 = str_replace(".html", "", $line);
?>
<option value="{{$line}}">{{$line2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn">
<i class="fa fa-file-pdf"></i> {{e2("Show Line Certificates PDF")}}
</button>
</div>
</div>
<div class="col-md-2">
<div class="btn btn-primary generate-all2" type="line-specification-generator">{{e2("Generate All")}}</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){https://devqms.stellarcons.com/storage/documents/004_QA
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/storage/documents/005_PTO/08_Спецификация/" + $('#line_no').val() + '?{{rand()}}');
});
});
</script>
@@ -1,475 +0,0 @@
<?php
$get = false;
$datas = apply_welded_filter(db("weld_logs"));
$progress = "Weld Completed";
$progress_type = "success";
$isoNumberTitle = "";
$tableName = "weld_logs";
if(!getesit("iso_number","")) {
$datas = $datas->where("iso_number", "like", "%" . trim(get("iso_number")) . "%");
$get = true;
}
if(!getesit("d1","")) {
$datas = $datas->whereDate("welding_date", ">=", get("d1"));
$datas = $datas->whereDate("welding_date", "<=", get("d2"));
$get = true;
}
if(!getesit("spool_no","")) {
$datas = $datas->where("spool_number", trim(get("spool_no")));
$get = true;
}
$naksWelders = db("naks_welders")->groupBy("welder_id")->whereNotNull("welder_id")->get();
if($get) {
$datas = $datas->get();
} else {
$datas = $datas->paginate(20);
}
$requiredFields = required_fields();
$neverWeldingDate = true;
foreach($datas AS $data) {
if($data->welding_date == "0000-00-00" || $data->welding_date == "") {
$progress = "Waiting";
$progress_type = "danger";
} else {
$neverWeldingDate = false;
}
}
if($neverWeldingDate) {
$progress = "On Going";
$progress_type = "warning";
}
if($datas->count() != 0) {
$firstData = $datas[0];
if(!getesit("iso_number","")) {
$isoNumberTitle = "<div class='badge badge-danger'>LINE: {$firstData->iso_number}</div>";
}
}
$columns = [
'id',
'general_contractor',
'contractor',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'certificate_no',
'wpq_report',
'member_1',
'material_1',
'ru_material_group',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_s_20_std',
'outside_diameter_mm',
'wall_thickness_mm',
'1_element_code',
'member_2',
'material_2',
'ru_material_group2',
'certificate_number_of_2',
'heat_number_2',
'nps2',
'thickness_by_asme_s_20_std2',
'outsidediametermm',
'wallthickness_mm',
'2_element_code',
'ndt_percent',
'vt_scope',
'vt_request_no',
'vt_report',
'date_of_vt',
'vt_request_date',
'test_laboratory_vt',
'vt_result',
'rt_scope',
'rt_request_no',
'rt_report',
'rt_test_date',
'rt_request_date',
'test_laboratory_rt',
'rt_result',
'ut_scope',
'ut_request_no',
'ut_report',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_result',
'ut_type',
'pt_scope',
'pt_request_no',
'pt_report',
'pt_test_date',
'pt_request_date',
'test_laboratory_pt',
'pt_result',
'mt_scope',
'mt_request_no',
'mt_report',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'mt_result',
'pmi_scope',
'pmi_request_no',
'pmi_report',
'no_of_testing_report',
'pmi_test_date',
'pmi_request_date',
'test_laboratory_pmi',
'pmi_result',
'nde',
'group_no',
'pwht',
'pwht_date',
'of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht',
'nt_scope',
'ht_request',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'ferrite_scope',
'ferrite_check_request',
'no_of_ferrite_check',
'date_of_ferrite_check',
'test_laboratory_ferrite',
'ferrite_result',
'test_package',
'test_pressure',
'type_of_test',
'date_test',
'test_result',
'real_welder_1',
'real_welder_2',
'ste_subcontructer'
];
$lineWeldDate = [
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'spool_number',
'welder_1',
'welder_2',
'outside_diameter_1',
'wall_thickness_1',
'outside_diameter_2',
'wall_thickness_2',
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
'spool_release_date',
];
$jointByLineTo = [
'id',
'spool_number',
'test_package_no',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'welder_1',
'welder_2',
'member_no_1',
'material_no_1',
'outside_diameter_1',
'wall_thickness_1',
'member_no_2',
'material_no_2',
'outside_diameter_2',
'wall_thickness_2',
'date_of_vt',
'vt_result',
'rt_scope',
'rt_test_date',
'rt_request_date',
'rt_result',
'ut_scope',
'ut_test_date',
'ut_request_date',
'ut_result',
'mt_scope',
'mt_test_date',
'mt_request_date',
'mt_result',
'pt_scope',
'pt_test_date',
'pt_request_date',
'pt_result',
'pmi_scope',
'pmi_test_date',
'pmi_request_date',
'ferrite_scope',
'ferrite_request_no',
];
if(!getisset("iso_number")) {
array_unshift($jointByLineTo, 'iso_number');
}
$editableColumns = [
/*
'fit_up_date',
'welding_date',
'welder_1',
'welder_2',
*/
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
'spool_release_date',
];
$dateColumns = [
'fit_up_date',
'welding_date',
'rt_test_date',
'ut_test_date',
'pt_test_date',
'pwht_date',
'rt_request_date',
'ut_request_date',
'vt_request_date',
'ht_request_date',
'mt_request_date',
];
$selectDropdowns = [
/*
'welder_1',
'welder_2',
'vt_result',
*/
];
$query = "";
if(getisset("iso_number")) {
$query = "&iso_number={$_GET['iso_number']}";
}
if(getisset("spool_no")) {
$query .= "&spool_no={$_GET['spool_no']}";
}
if(getisset("d1")) {
$query .= "&d1={$_GET['d1']}&d2={$_GET['d2']}";
}
?>
<style>
/*
.isometric {
width:300px;
}
.line-weld-date {
width: calc(100% -)
}
*/
</style>
<script>
$(function(){
});
</script>
<style>
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-xl-3 col-lg-2 col-md-12 isometric","Isometric", 0, ['no-options'=>true])}}
{{e2("Iso Number")}}
<form action="" method="get">
<div class="input-group">
<input type="text" name="iso_number"
value="{{get("iso_number")}}"
id="iso_number" class="form-control">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<form action="" method="get">
{{e2("Welding Date")}}
<div class="input-group">
<input type="date" required class="form-control" name="d1" value="{{get("d1")}}" id="">
<input type="date" required class="form-control" name="d2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<?php if(isset($firstData)) {
?>
<?php if(getisset("iso_number")) {
?>
<hr>
<div class="row">
<div class="col-md-6">
<strong>{{e2("NDT %")}}</strong> : {{$firstData->ndt_percent}}
</div>
<div class="col-md-6">
<strong>{{e2("STE Subcontructer")}}</strong> : {{$firstData->contractor}}
</div>
<div class="col-md-6">
<strong>{{e2("Project")}}</strong> : {{$firstData->project}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Design Area")}}</strong> : {{$firstData->design_area}}
</div>
<div class="col">
<strong>{{e2("QTY of ISO")}}</strong> : {{$firstData->quantity_of_iso}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("ISO Rev")}}</strong> : {{$firstData->iso_rev}}
</div>
<div class="col">
<strong>{{e2("Fluid Group")}}</strong> : {{$firstData->fluid_group}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Service Category")}}</strong> : {{$firstData->service_category}}
</div>
<div class="col">
<strong>{{e2("Painting Cycle")}}</strong> : {{$firstData->painting_cycle}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("PWHT")}}</strong> : {{$firstData->pwht}}
</div>
<div class="col">
<strong>{{e2("Progress")}}:</strong>
<div class="alert alert-{{$progress_type}}" id="is_active">{{$progress}}</div>
</div>
</div>
@include("admin.type.inc.manage-calc")
<div class="row">
<div class="col-12">
<hr>
<div class="row">
<div class="col-md-6">
<?php $fileName = $firstData->iso_number ?>
<a href="{{url("storage/documents/001_Drawings/001_Engineering/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Engineering")}}
</a>
</div>
<div class="col-md-6">
<a href="{{url("storage/documents/001_Drawings/002_Iso/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Spool ISO")}}
</a>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
{{_col()}}
{{col("col-xl-9 col-lg-10 col-md-12 line-weld-date w-90","Line & Weld Date", 0, ['no-options'=>true])}}
@include("admin.type.manage-ndt.line-weld-date")
{{_col()}}
{{col("col-md-12","Joint by Line No $isoNumberTitle", 0, ['no-options'=>true])}}
@include("admin.type.manage-ndt.joint-by-line-no")
{{_col()}}
</div>
</div>
@@ -1,523 +0,0 @@
<?php
$get = false;
$datas = db("weld_logs");
$progress = "Completed";
$progress_type = "success";
$isoNumberTitle = "";
$requiredFields = [];
if(!getesit("iso_number","")) {
$datas = $datas->where("iso_number", "like", "%" . trim(get("iso_number")) . "%");
$get = true;
}
if(!getesit("d1","")) {
$datas = $datas->whereDate("welding_date", ">=", get("d1"));
$datas = $datas->whereDate("welding_date", "<=", get("d2"));
$get = true;
}
$naksWelders = db("naks_welders")->groupBy("welder_id")->whereNotNull("welder_id")->get();
if($get) {
$datas = $datas->get();
} else {
$datas = $datas->paginate(20);
}
$neverWeldingDate = true;
foreach($datas AS $data) {
if($data->welding_date == "0000-00-00" || $data->welding_date == "") {
$progress = "On Going";
$progress_type = "warning";
} else {
$neverWeldingDate = false;
}
}
if($neverWeldingDate) {
$progress = "Waiting";
$progress_type = "danger";
}
if($datas->count() != 0) {
$firstData = $datas[0];
if(!getesit("iso_number","")) {
$isoNumberTitle = "<div class='badge badge-danger'>LINE: {$firstData->iso_number}</div>";
}
}
//echo(implode("','",table_columns("weld_logs")));
$columns = [
'id',
'general_contractor',
'contractor',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'certificate_no',
'wpq_report',
'member_1',
'material_1',
'ru_material_group',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_s_20_std',
'outside_diameter_mm',
'wall_thickness_mm',
'1_element_code',
'member_2',
'material_2',
'ru_material_group2',
'certificate_number_of_2',
'heat_number_2',
'nps2',
'thickness_by_asme_s_20_std2',
'outsidediametermm',
'wallthickness_mm',
'2_element_code',
'ndt_percent',
'vt_request',
'vt_report',
'date_of_vt',
'test_laboratory_vt',
'vt_result',
'rt_scope',
'rt_request',
'rt_report',
'rt_test_date',
'test_laboratory_rt',
'rt_result',
'ut_scope',
'ut_request',
'ut_report',
'ut_test_date',
'test_laboratory_ut',
'ut_result',
'pt_scope',
'pt_request',
'pt_report',
'pt_test_date',
'test_laboratory_pt',
'pt_result',
'mt_scope',
'mt_request',
'mt_report',
'mt_test_date',
'test_laboratory_mt',
'mt_result',
'pmi_scope',
'pmi_request',
'no_of_testing_report',
'pmi_test_date',
'test_laboratory_pmi',
'pmi_result',
'pwht',
'pwht_date',
'of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht',
'nt_scope',
'ht_request',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'ferrite_scope',
'ferrite_check_request',
'no_of_ferrite_check',
'date_of_ferrite_check',
'test_laboratory_ferrite',
'ferrite_result',
'test_package',
'test_pressure',
'type_of_test',
'date_test',
'test_result',
'real_welder_1',
'real_welder_2',
'ste_subcontructer'
];
$lineWeldDate = [
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'test_package_no',
'pwht',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'remarks',
'spool_release_date',
];
$jointByLineTo = [
'id',
'spool_number',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'welder_1',
'welder_2',
'member_no_1',
'material_no_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'date_of_vt',
'vt_result',
'rt_scope',
'rt_test_date',
'rt_result',
'ut_scope',
'ut_test_date',
'ut_result',
'pt_scope',
'pt_test_date',
'pt_result',
'mt_scope',
'mt_result',
'pmi_scope',
'pmi_result',
'pwht',
'pwht_date',
'ferrite_scope',
'ferrite_result',
];
if(!getisset("iso_number")) {
array_unshift($jointByLineTo, 'iso_number');
}
$editableColumns = [
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
'spool_release_date',
];
$dateColumns = [
'fit_up_date',
'welding_date',
'rt_test_date',
'ut_test_date',
'pt_test_date',
'pwht_date',
];
$selectDropdowns = [
/*
'welder_1',
'welder_2',
'vt_result',
*/
];
?>
<script>
$(function(){
});
</script>
<style>
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-md-3","Isometric", 0, ['no-options'=>true])}}
{{e2("Iso Number")}}
<form action="" method="get">
<div class="input-group">
<input type="text" name="iso_number"
value="{{get("iso_number")}}"
id="iso_number" class="form-control">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<form action="" method="get">
{{e2("Welding Date")}}
<div class="input-group">
<input type="date" required class="form-control" name="d1" value="{{get("d1")}}" id="">
<input type="date" required class="form-control" name="d2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<?php if(isset($firstData)) {
?>
<?php if(getisset("iso_number")) {
?>
<hr>
<div class="row">
<div class="col-md-6">
<strong>{{e2("NDT %")}}</strong> : {{$firstData->ndt_percent}}
</div>
<div class="col-md-6">
<strong>{{e2("STE Subcontructer")}}</strong> : {{$firstData->contractor}}
</div>
<div class="col-md-6">
<strong>{{e2("Project")}}</strong> : {{$firstData->project}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Design Area")}}</strong> : {{$firstData->design_area}}
</div>
<div class="col">
<strong>{{e2("QTY of ISO")}}</strong> : {{$firstData->quantity_of_iso}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("ISO Rev")}}</strong> : {{$firstData->iso_rev}}
</div>
<div class="col">
<strong>{{e2("Fluid Group")}}</strong> : {{$firstData->fluid_group}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Service Category")}}</strong> : {{$firstData->service_category}}
</div>
<div class="col">
<strong>{{e2("Painting Cycle")}}</strong> : {{$firstData->painting_cycle}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("PWHT")}}</strong> : {{$firstData->pwht}}
</div>
<div class="col">
<strong>{{e2("Progress")}}:</strong>
<div class="alert alert-{{$progress_type}}" id="is_active">{{$progress}}</div>
</div>
</div>
@include("admin.type.inc.manage-calc")
<div class="row">
<div class="col-12">
<hr>
<div class="row">
<div class="col-md-6">
<?php $fileName = $firstData->iso_number ?>
<a href="{{url("storage/documents/001_Drawings/001_Engineering/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Engineering")}}
</a>
</div>
<div class="col-md-6">
<a href="{{url("storage/documents/001_Drawings/002_Iso/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Spool ISO")}}
</a>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
{{_col()}}
{{col("col-md-9","Line & Weld Date")}}
<table style="table-layout:fixed; width:100%" id="lineWeldDate" class="data-tables table table-bordered table-sm table-striped table-hover" >
<thead>
<tr>
<?php foreach($lineWeldDate AS $spoolColumn) { ?>
<th>{{e2($spoolColumn)}}</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($datas AS $data) {
?>
<tr>
<?php foreach($lineWeldDate AS $spoolColumn) { ?>
<td>
<?php if(isset($data->$spoolColumn)) { ?>
{{$data->$spoolColumn}}
<?php } else {
?>
<input type="text" name="" id="">
<?php
} ?>
</td>
<?php } ?>
</tr>
<?php
} ?>
</tbody>
</table>
{{_col()}}
<?php
$relationDatas['welder_1']['datas'] = $naksWelders;
$relationDatas['welder_2']['datas'] = $naksWelders;
$relationDatas['vt_result']['datas'] = db("results")->get();
$relationDatas['welder_1']['pattern'] = "[{welder_id}] {welder_name_en}";
$relationDatas['welder_2']['pattern'] = "[{welder_id}] {welder_name_en}";
$relationDatas['vt_result']['pattern'] = "{title}";
$rowName = "jointByLineTo";
$tableName = "weld_logs";
?>
{{col("col-md-12","Joint by Line No $isoNumberTitle")}}
<div style="overflow:hidden">
<table id="jointByLineNo" class="data-tables table table-bordered table-sm table-striped table-hover" >
<thead>
<tr>
<?php foreach($jointByLineTo AS $column) { ?>
<th>{{e2($column)}}</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($datas AS $data) {
?>
<tr>
<?php foreach($jointByLineTo AS $jointColumn) {
$inputType = "text";
?>
<td>
<?php if(in_array($jointColumn, $selectDropdowns)) {
?>
<?php
$columnName = $jointColumn;
$column = [];
$column['name'] = $jointColumn;
$listData = $data;
?>
@include("components.columns.select-dropdown")
<?php
} else {
?>
<?php if(array_key_exists($jointColumn,(Array) $data)) { ?>
<?php if(in_array($jointColumn, $editableColumns)) {
if(in_array($jointColumn, $dateColumns)) $inputType = "date";
?>
<input type="text" class="edit form-control {{$inputType}}" table="weld_logs" data-id="{{$data->id}}" value="{{$data->$jointColumn}}" name="{{$jointColumn}}" id="">
<?php
} else {
?>
<?php
$resultData = $data->$jointColumn;
if(in_array($jointColumn, ['welder_1', 'welder_2'])) {
$resultData = get_welder_id($resultData);
} ?>
{{$resultData}}
<?php } ?>
<?php } elseif(in_array($jointColumn, $editableColumns)) {
if(in_array($jointColumn, $dateColumns)) $inputType = "date";
?>
<!--
<input type="{{$inputType}}" name="" class=" form-control" id="">
-->
<?php
} ?>
<?php } ?>
</td>
<?php } ?>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
{{_col()}}
</div>
</div>
<script src="{{url("assets/admin/data-tables/fixed-header/js/dataTables.fixedHeader.min.js")}}"></script>
<script>
$(function() {
$("#lineWeldDate").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollY: "310px",
scrollX: true,
responsive: true,
stateSave: true,
});
$("#jointByLineNo").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollX: true,
responsive: true,
stateSave: true,
});
});
</script>
@@ -1,569 +0,0 @@
<?php
$get = false;
$datas = db("weld_logs");
$progress = "Completed";
$progress_type = "success";
$isoNumberTitle = "";
$requiredFields = required_fields();
if(!getesit("iso_number","")) {
$datas = $datas->where("iso_number", "like", "%" . trim(get("iso_number")) . "%");
$get = true;
}
if(!getesit("d1","")) {
$datas = $datas->whereDate("welding_date", ">=", get("d1"));
$datas = $datas->whereDate("welding_date", "<=", get("d2"));
$get = true;
}
$naksWelders = db("naks_welders")->groupBy("welder_id")->whereNotNull("welder_id")->get();
if($get) {
$datas = $datas->get();
} else {
$datas = $datas->paginate(20);
}
$neverWeldingDate = true;
foreach($datas AS $data) {
if($data->welding_date == "0000-00-00" || $data->welding_date == "") {
$progress = "On Going";
$progress_type = "warning";
} else {
$neverWeldingDate = false;
}
}
if($neverWeldingDate) {
$progress = "Waiting";
$progress_type = "danger";
}
$firstData = $datas[0];
if(!getesit("iso_number","")) {
$isoNumberTitle = "<div class='badge badge-danger'>LINE: {$firstData->iso_number}</div>";
}
//echo(implode("','",table_columns("weld_logs")));
$columns = [
'id',
'general_contractor',
'contractor',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'certificate_no',
'wpq_report',
'member_1',
'material_1',
'ru_material_group',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_s_20_std',
'outside_diameter_mm',
'wall_thickness_mm',
'1_element_code',
'member_2',
'material_2',
'ru_material_group2',
'certificate_number_of_2',
'heat_number_2',
'nps2',
'thickness_by_asme_s_20_std2',
'outsidediametermm',
'wallthickness_mm',
'2_element_code',
'ndt_percent',
'vt_request',
'vt_report',
'date_of_vt',
'test_laboratory_vt',
'vt_result',
'rt_scope',
'rt_request',
'rt_report',
'rt_test_date',
'test_laboratory_rt',
'rt_result',
'ut_scope',
'ut_request',
'ut_report',
'ut_test_date',
'test_laboratory_ut',
'ut_result',
'pt_scope',
'pt_request',
'pt_report',
'pt_test_date',
'test_laboratory_pt',
'pt_result',
'mt_scope',
'mt_request',
'mt_report',
'mt_test_date',
'test_laboratory_mt',
'mt_result',
'pmi_scope',
'pmi_request',
'no_of_testing_report',
'pmi_test_date',
'test_laboratory_pmi',
'pmi_result',
'pwht',
'pwht_date',
'of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht',
'nt_scope',
'ht_request',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'ferrite_scope',
'ferrite_check_request',
'no_of_ferrite_check',
'date_of_ferrite_check',
'test_laboratory_ferrite',
'ferrite_result',
'test_package',
'test_pressure',
'type_of_test',
'date_test',
'test_result',
'real_welder_1',
'real_welder_2',
'ste_subcontructer'
];
/*
Spool number
No of the joint As per As Built survey
Type of joint
Type of welds
WPS №
Welding materials 1
Welding materials 1
Lot No
Welding materials 1
Certificate No
Welding materials 2
Welding materials 2 Lot No
Welding materials 2
Certificate No
Welding materials 3
Welding materials 3 Lot No
Welding materials 3 Certificate No
Test Package №
Remarks
NDT Release Date
Paint Status
Spool Weight
*/
$lineWeldDate = [
// 'spool_number',
// 'no_of_the_joint_as_per_as_built_survey',
//'type_of_joint',
//'type_of_welds',
'no_of_the_joint_as_per_as_built_survey',
'wps_no',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welding_materials_3',
'welding_materials_3_lot_no',
'welding_materials_3_certificate_no',
'test_package_no',
'remarks',
'ndt_release_date',
'paint_status',
'spool_weight',
];
/*
Spool number
No of the joint As per As Built survey
Type of joint
Type of welds
Welding date
Welder 1
Welder 2
Fit-Up Date
Welding date
Mechanic Supervisor
Mechanic Supervisor Control Date
Welding Supervisor
Welding Supervisor Control Date
№1 Element Code
Member №1
Material №1
NPS
Thickness by ASME (S-20. STD…)
Outside Diameter. ,mm
Wall thickness mm
Certificate number of 1
Heat number 1
№2 Element Code
Member №2
Material №2
NPS2
OutsideDiameter.(mm)
Wallthickness (mm)
Certificate number of 2
Heat number 2
*/
$jointByLineTo = [
'id',
'spool_number',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'welder_1',
'welder_2',
'fit_up_date',
'mechanic_supervisor',
'mechanic_supervisor_control_date',
'welding_supervisor',
'welding_supervisor_control_date',
'element_code_1',
'pose_no_1',
'member_no_1',
'material_no_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'certificate_number_of_1',
'heat_number_1',
'element_code_2',
'member_no_2',
'material_no_2',
'nps_2',
'outside_diameter_2',
'wall_thickness_2',
'certificate_number_of_2',
'heat_number_2',
];
if(!getisset("iso_number")) {
array_unshift($jointByLineTo, 'iso_number');
}
$editableColumns = [
'fit_up_date',
'welding_date',
'mechanic_supervisor',
'mechanic_supervisor_control_date',
'welding_supervisor',
'welding_supervisor_control_date',
'welder_1',
'welder_2',
];
$dateColumns = [
'fit_up_date',
'welding_date',
'mechanic_supervisor_control_date',
'welding_supervisor_control_date',
];
?>
<script>
$(function(){
});
</script>
<style>
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-md-3","Isometric", 0, ['no-options'=>true])}}
{{e2("Iso Number")}}
<form action="" method="get">
<div class="input-group">
<input type="text" name="iso_number"
value="{{get("iso_number")}}"
id="iso_number" class="form-control">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<form action="" method="get">
{{e2("Welding Date")}}
<div class="input-group">
<input type="date" required class="form-control" name="d1" value="{{get("d1")}}" id="">
<input type="date" required class="form-control" name="d2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<?php if(getisset("iso_number")) {
?>
<hr>
<div class="row">
<div class="col-md-6">
<strong>{{e2("NDT %")}}</strong> : {{$firstData->ndt_percent}}
</div>
<div class="col-md-6">
<strong>{{e2("STE Subcontructer")}}</strong> : {{$firstData->contractor}}
</div>
<div class="col-md-6">
<strong>{{e2("Project")}}</strong> : {{$firstData->project}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Design Area")}}</strong> : {{$firstData->design_area}}
</div>
<div class="col">
<strong>{{e2("QTY of ISO")}}</strong> : {{$firstData->quantity_of_iso}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("ISO Rev")}}</strong> : {{$firstData->iso_rev}}
</div>
<div class="col">
<strong>{{e2("Fluid Group")}}</strong> : {{$firstData->fluid_group}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Service Category")}}</strong> : {{$firstData->service_category}}
</div>
<div class="col">
<strong>{{e2("Painting Cycle")}}</strong> : {{$firstData->painting_cycle}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("PWHT")}}</strong> : {{$firstData->pwht}}
</div>
<div class="col">
<strong>{{e2("Progress")}}:</strong>
<div class="alert alert-{{$progress_type}}" id="is_active">{{$progress}}</div>
</div>
</div>
<div class="row">
<div class="col-12">
<hr>
<div class="row">
<div class="col-md-6">
<?php $fileName = $firstData->iso_number ?>
<a href="{{url("storage/documents/001_Drawings/001_Engineering/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Engineering")}}
</a>
</div>
<div class="col-md-6">
<a href="{{url("storage/documents/001_Drawings/002_Iso/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Spool ISO")}}
</a>
</div>
</div>
</div>
</div>
<?php } ?>
{{_col()}}
{{col("col-md-9","Line & Weld Date")}}
<table style="table-layout:fixed; width:100%" id="lineWeldDate" class="data-tables table table-bordered table-sm table-striped table-hover" >
<thead>
<tr>
<?php foreach($lineWeldDate AS $spoolColumn) { ?>
<th>{{e2($spoolColumn)}}</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($datas AS $data) {
?>
<tr>
<?php foreach($lineWeldDate AS $spoolColumn) {
$inputType = "text";
?>
<td>
<?php if(isset($data->$spoolColumn)) { ?>
{{$data->$spoolColumn}}
<?php } else {
?>
<?php if(array_key_exists($spoolColumn,(Array) $data)) { ?>
<?php if(in_array($spoolColumn, $editableColumns)) {
if(in_array($spoolColumn, $dateColumns)) $inputType = "date";
?>
<input type="{{$inputType}}" class="edit form-control" table="weld_logs" data-id="{{$data->id}}" value="{{$data->$spoolColumn}}" name="{{$spoolColumn}}" id="">
<?php
} else {
?>
{{$data->$spoolColumn}}
<?php } ?>
<?php } elseif(in_array($spoolColumn, $editableColumns)) {
if(in_array($spoolColumn, $dateColumns)) $inputType = "date";
?>
<input type="{{$inputType}}" name="" class=" form-control" id="">
<?php
} ?>
<?php
} ?>
</td>
<?php } ?>
</tr>
<?php
} ?>
</tbody>
</table>
{{_col()}}
<?php
$relationDatas['welder_1']['datas'] = $naksWelders;
$relationDatas['welder_2']['datas'] = $naksWelders;
$relationDatas['welder_1']['pattern'] = "[{welder_id}] {welder_name_en}";
$relationDatas['welder_2']['pattern'] = "[{welder_id}] {welder_name_en}";
$rowName = "jointByLineTo";
$tableName = "weld_logs";
?>
{{col("col-md-12","Joint by Line No $isoNumberTitle")}}
<div style="overflow:hidden">
<table id="jointByLineNo" class="data-tables table table-bordered table-sm table-striped table-hover" >
<thead>
<tr>
<?php foreach($jointByLineTo AS $column) { ?>
<th>{{e2($column)}}</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($datas AS $data) {
?>
<tr>
<?php foreach($jointByLineTo AS $jointColumn) {
$inputType = "text";
?>
<td>
<?php if($jointColumn=="welder_1" || $jointColumn =="welder_2") {
?>
<?php
$columnName = $jointColumn;
$column = [];
$column['name'] = $jointColumn;
$listData = $data;
?>
@include("components.columns.select-dropdown")
<?php
} else {
?>
<?php if(array_key_exists($jointColumn,(Array) $data)) { ?>
<?php if(in_array($jointColumn, $editableColumns)) {
if(in_array($jointColumn, $dateColumns)) $inputType = "date";
?>
<input type="{{$inputType}}" class="edit form-control" table="weld_logs" data-id="{{$data->id}}" value="{{$data->$jointColumn}}" name="{{$jointColumn}}" id="">
<?php
} else {
?>
{{$data->$jointColumn}}
<?php } ?>
<?php } elseif(in_array($jointColumn, $editableColumns)) {
if(in_array($jointColumn, $dateColumns)) $inputType = "date";
?>
<input type="{{$inputType}}" name="" class=" form-control" id="">
<?php
} ?>
<?php } ?>
</td>
<?php } ?>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
{{_col()}}
</div>
</div>
<script src="{{url("assets/admin/data-tables/fixed-header/js/dataTables.fixedHeader.min.js")}}"></script>
<script>
$(function() {
$("#lineWeldDate").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollY: "310px",
scrollX: true,
responsive: true,
stateSave: true,
});
$("#jointByLineNo").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollX: true,
responsive: true,
stateSave: true,
});
});
</script>
@@ -1,474 +0,0 @@
<?php
$get = false;
$datas = db("weld_logs");
$tableName = "weld_logs";
$progress = "Weld Completed";
$progress_type = "success";
$isoNumberTitle = "";
if(!getesit("iso_number","")) {
$datas = $datas->where("iso_number", "like", "%" . trim(get("iso_number")) . "%");
$get = true;
}
if(!getesit("d1","")) {
$datas = $datas->whereDate("welding_date", ">=", get("d1"));
$datas = $datas->whereDate("welding_date", "<=", get("d2"));
$get = true;
}
if(!getesit("spool_no","")) {
$datas = $datas->where("spool_number", trim(get("spool_no")));
$get = true;
}
$naksWelders = db("naks_welders")->groupBy("welder_id")->whereNotNull("welder_id")->get();
if($get) {
$datas = $datas->get();
} else {
$datas = $datas->paginate(20);
}
$requiredFields = required_fields();
$neverWeldingDate = true;
foreach($datas AS $data) {
if($data->welding_date == "0000-00-00" || $data->welding_date == "") {
$progress = "Waiting";
$progress_type = "danger";
} else {
$neverWeldingDate = false;
}
}
if($neverWeldingDate) {
$progress = "On Going";
$progress_type = "warning";
}
if($datas->count() != 0) {
$firstData = $datas[0];
if(!getesit("iso_number","")) {
$isoNumberTitle = "<div class='badge badge-danger'>LINE: {$firstData->iso_number}</div>";
}
}
$columns = [
'id',
'general_contractor',
'contractor',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'certificate_no',
'wpq_report',
'member_1',
'material_1',
'ru_material_group',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_s_20_std',
'outside_diameter_mm',
'wall_thickness_mm',
'1_element_code',
'member_2',
'material_2',
'ru_material_group2',
'certificate_number_of_2',
'heat_number_2',
'nps2',
'thickness_by_asme_s_20_std2',
'outsidediametermm',
'wallthickness_mm',
'2_element_code',
'ndt_percent',
'vt_scope',
'vt_request_no',
'vt_report',
'date_of_vt',
'vt_request_date',
'test_laboratory_vt',
'vt_result',
'rt_scope',
'rt_request_no',
'rt_report',
'rt_test_date',
'rt_request_date',
'test_laboratory_rt',
'rt_result',
'ut_scope',
'ut_request_no',
'ut_report',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_result',
'ut_type',
'pt_scope',
'pt_request_no',
'pt_report',
'pt_test_date',
'pt_request_date',
'test_laboratory_pt',
'pt_result',
'mt_scope',
'mt_request_no',
'mt_report',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'mt_result',
'pmi_scope',
'pmi_request_no',
'pmi_report',
'no_of_testing_report',
'pmi_test_date',
'pmi_request_date',
'test_laboratory_pmi',
'pmi_result',
'nde',
'group_no',
'pwht',
'pwht_date',
'of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht',
'nt_scope',
'ht_request',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'ferrite_scope',
'ferrite_check_request',
'no_of_ferrite_check',
'date_of_ferrite_check',
'test_laboratory_ferrite',
'ferrite_result',
'test_package',
'test_pressure',
'type_of_test',
'date_test',
'test_result',
'real_welder_1',
'real_welder_2',
'ste_subcontructer'
];
$lineWeldDate = [
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'spool_number',
'welder_1',
'welder_2',
'outside_diameter_1',
'wall_thickness_1',
'outside_diameter_2',
'wall_thickness_2',
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
'spool_release_date',
];
$jointByLineTo = [
'id',
'spool_number',
'test_package_no',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'welder_1',
'welder_2',
'member_no_1',
'material_no_1',
'outside_diameter_1',
'wall_thickness_1',
'member_no_2',
'material_no_2',
'outside_diameter_2',
'wall_thickness_2',
'date_of_vt',
'vt_result',
'rt_scope',
'rt_test_date',
'rt_request_date',
'rt_result',
'ut_scope',
'ut_test_date',
'ut_request_date',
'ut_result',
'mt_scope',
'mt_test_date',
'mt_request_date',
'mt_result',
'pt_scope',
'pt_test_date',
'pt_request_date',
'pt_result',
'pmi_scope',
'pmi_test_date',
'pmi_request_date',
'ferrite_scope',
'ferrite_request_no',
];
if(!getisset("iso_number")) {
array_unshift($jointByLineTo, 'iso_number');
}
$editableColumns = [
/*
'fit_up_date',
'welding_date',
'welder_1',
'welder_2',
*/
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'mt_request_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
'spool_release_date',
];
$dateColumns = [
'fit_up_date',
'welding_date',
'rt_test_date',
'ut_test_date',
'pt_test_date',
'pwht_date',
'rt_request_date',
'ut_request_date',
'vt_request_date',
'ht_request_date',
'mt_request_date',
];
$selectDropdowns = [
/*
'welder_1',
'welder_2',
'vt_result',
*/
];
$query = "";
if(getisset("iso_number")) {
$query = "&iso_number={$_GET['iso_number']}";
}
if(getisset("spool_no")) {
$query .= "&spool_no={$_GET['spool_no']}";
}
if(getisset("d1")) {
$query .= "&d1={$_GET['d1']}&d2={$_GET['d2']}";
}
?>
<style>
/*
.isometric {
width:300px;
}
.line-weld-date {
width: calc(100% -)
}
*/
</style>
<script>
$(function(){
});
</script>
<style>
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-xl-3 col-lg-2 col-md-12 isometric","Isometric", 0, ['no-options'=>true])}}
{{e2("Iso Number")}}
<form action="" method="get">
<div class="input-group">
<input type="text" name="iso_number"
value="{{get("iso_number")}}"
id="iso_number" class="form-control">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<form action="" method="get">
{{e2("Welding Date")}}
<div class="input-group">
<input type="date" required class="form-control" name="d1" value="{{get("d1")}}" id="">
<input type="date" required class="form-control" name="d2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
</form>
<?php if(isset($firstData)) {
?>
<?php if(getisset("iso_number")) {
?>
<hr>
<div class="row">
<div class="col-md-6">
<strong>{{e2("NDT %")}}</strong> : {{$firstData->ndt_percent}}
</div>
<div class="col-md-6">
<strong>{{e2("STE Subcontructer")}}</strong> : {{$firstData->ste_subcontractor}}
</div>
<div class="col-md-6">
<strong>{{e2("Project")}}</strong> : {{$firstData->project}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Design Area")}}</strong> : {{$firstData->design_area}}
</div>
<div class="col">
<strong>{{e2("QTY of ISO")}}</strong> : {{$firstData->quantity_of_iso}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("ISO Rev")}}</strong> : {{$firstData->iso_rev}}
</div>
<div class="col">
<strong>{{e2("Fluid Group")}}</strong> : {{$firstData->fluid_group}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("Service Category")}}</strong> : {{$firstData->service_category}}
</div>
<div class="col">
<strong>{{e2("Painting Cycle")}}</strong> : {{$firstData->painting_cycle}}
</div>
</div>
<div class="row">
<div class="col">
<strong>{{e2("PWHT")}}</strong> : {{$firstData->pwht}}
</div>
<div class="col">
<strong>{{e2("Progress")}}:</strong>
<div class="alert alert-{{$progress_type}}" id="is_active">{{$progress}}</div>
</div>
</div>
<div class="row">
<div class="col-12">
<hr>
<div class="row">
<div class="col-md-6">
<?php $fileName = $firstData->iso_number ?>
<a href="{{url("storage/documents/001_Drawings/001_Engineering/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Engineering")}}
</a>
</div>
<div class="col-md-6">
<a href="{{url("storage/documents/001_Drawings/002_Iso/$fileName.pdf")}}" class="btn btn-outline-primary btn-block" target="_blank">
<i class="fa fa-file-pdf"></i> {{e2("PDF Spool ISO")}}
</a>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
{{_col()}}
{{col("col-xl-9 col-lg-10 col-md-12 line-weld-date w-90","Line & Weld Date", 0, ['no-options'=>true])}}
@include("admin.type.manage-welding.line-weld-date")
{{_col()}}
{{col("col-md-12","Joint by Line No $isoNumberTitle", 0, ['no-options'=>true])}}
@include("admin.type.manage-welding.joint-by-line-no")
{{_col()}}
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,56 +0,0 @@
<?php
$tabs = [
'Packing List' => '📦',
'Packing List Detail' => '📋',
'Current Material Status' => '📊',
];
?>
<script>
$(function(){
<?php if(getisset("detail")) {
?>
var id = "{{get("detail")}}";
var plNumber = $("#material-planning #t{{get("detail")}} .pl_number").val();
var project = $("#material-planning #t{{get("detail")}} .project").val();
$("#material-planning-detail .new-tr .pl_number").val(plNumber);
$("#material-planning-detail .new-tr .project").val(project);
<?php
} ?>
});
</script>
<div class="content">
<div class="block">
<ul class="nav nav-tabs nav-tabs-block js-tabs-enabled" data-toggle="tabs" role="tablist">
<?php foreach($tabs AS $tab => $icon) {
$tabId = str_slug($tab);
?>
<li class="nav-item">
<a class="nav-link {{getesit("t",$tabId) ? "active show" : ""}}" href="?t={{$tabId}}">
{{$icon}}
{{e2($tab)}}</a>
</li>
<?php } ?>
</ul>
<div class="block-content tab-content">
<div class="tab-pane active show" id="btabs-static-home" role="tabpanel">
<?php if(getisset("t")) { ?>
@include("admin.type.material-planing." . get("t"))
<?php } else {
?>
<div class="hero-inner">
<div class="content content-full">
<div class="py-30 text-center">
<i class="si si-settings text-primary display-3"></i>
<h1 class="h2 font-w700 mt-30 mb-10">{{e2("Material Planning System")}}</h1>
<h2 class="h3 font-w400 text-muted mb-50">{{e2("Please select a tab from above to continue")}}</h2>
</div>
</div>
</div>
<?php
} ?>
</div>
</div>
</div>
</div>
-139
View File
@@ -1,139 +0,0 @@
<?php
use App\Models\MagneticTest;
//$noRemoteOperations = true;
$title = "MT Log";
$tableWidth="100%";
$listDatas = MagneticTest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "magnetic_tests";
$tableType = "datagrid";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'mt_result' => [
'datas' => db("results")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_mt',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Element Info' => [
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'MT Info' => [
'mt_scope',
'mt_request_no',
'mt_request_date',
'mt_report',
'mt_test_date',
'mt_result',
'control_standart',
'defects',
'tester_name',
'real_welder_1',
'real_welder_2',
],
];
$firstUploadFolder = '004_QA/0003_MT/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'mt_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
-283
View File
@@ -1,283 +0,0 @@
<?php
use App\Models\MTO;
$title = "MTO";
$tableWidth="5000px";
$tableName = "m_t_o_s";
//dd(implode("',\n'",table_columns($tableName)));
$weld_maps = db("weld_maps")->groupBy("iso_number")->get();
$relationDatas = [
/*
'line' => [
'type' => 'select-dropdown',
'table' => 'weld_maps',
'column' => 'iso_number',
'affected' => [
'rev' => '{iso_rev}',
'component_code' => '{no1_element_code}',
'piping_class' => '{category} + {fluid_group}',
'description_en' => '{member_no_1}',
'description_ru' => '{member_no_2}',
'dia_inch_1' => '{nps}',
'odmm_1' => '{outside_diameter_mm}',
'schedule_1' => '{thickness_by_asme}',
'thicknessmm_1' => '{wall_thickness_mm}',
],
],
*/
/*
'line' => [
'datas' => $weld_maps,
'pattern' => '{iso_number}',
'type' => 'select-dropdown',
'affected' => [
'rev' => '{iso_rev}',
'component_code' => '{no1_element_code}',
'piping_class' => '{category} + {fluid_group}',
'description_en' => '{member_no_1}',
'description_ru' => '{member_no_2}',
'dia_inch_1' => '{nps}',
'odmm_1' => '{outside_diameter_mm}',
'schedule_1' => '{thickness_by_asme}',
'thicknessmm_1' => '{wall_thickness_mm}',
],
],
*/
'discipline' => [
'datas' => db("disciplines")->get(),
'pattern' => '{discipline_title}',
'type' => 'select-dropdown'
],
'designer' => [
'datas' => db("subcontractors")->where("job_description", "ENGINEERING")->get(),
'pattern' => '{company_name_en}',
'type' => 'select-dropdown'
],
];
$topButtons = [];
$syncPermission = setting('mto_sync_permission');
$allowedLevels = is_string($syncPermission) ? j($syncPermission) : [];
$hasSyncPermission = is_array($allowedLevels) && in_array(u()->level, $allowedLevels);
if($hasSyncPermission) {
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From Line List")
];
}
?>
<script>
$(function(){
});
</script>
<script>
function editorPreparing(e, dataRow) {
var options = e.editorOptions;
var rowIndex = e.row.rowIndex;
var dataGrid = $("#dataGrid").dxDataGrid("instance");
var exceptValue = ['undefined', 'null'];
if(e.dataField == "line") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("weld_logs","iso_number")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'iso_number';
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("weld_logs","iso_number")}}?value=" + selectData.value, function(responseJSON) {
if(typeof responseJSON.iso_rev !== 'undefined') {
<?php
$affectedCols = [
'rev' => '{responseJSON.iso_rev}',
'component_code' => '{responseJSON.no1_element_code}',
'piping_class' => '{responseJSON.category} + {responseJSON.fluid_group}',
'description_en' => '{responseJSON.member_no_1}',
'description_ru' => '{responseJSON.member_no_2}',
'dia_inch_1' => '{responseJSON.nps}',
'odmm_1' => '{responseJSON.outside_diameter_mm}',
'schedule_1' => '{responseJSON.thickness_by_asme}',
'thicknessmm_1' => '{responseJSON.wall_thickness_mm}',
];
foreach($affectedCols AS $affectedCol => $valueCol) {
$valueCol = str_replace('{', '${', $valueCol);
?>
if(!exceptValue.includes(`{{$valueCol}}`)) {
dataGrid.cellValue(rowIndex, "{{$affectedCol}}", `{{$valueCol}}`);
}
<?php
}
?>
}
});
}
}
if(e.dataField == "quantity") {
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
var calculateValue = Math.round(selectData.value * dataRow.weight * 100)/100;
dataGrid.cellValue(rowIndex, "total_weight", calculateValue);
}
}
if(e.dataField == "weight") {
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
var calculateValue = Math.round(selectData.value * dataRow.quantity * 100)/100;
dataGrid.cellValue(rowIndex, "total_weight", calculateValue);
}
}
if(e.dataField == "material") {
e.editorName = "dxAutocomplete";
e.editorOptions.dataSource = new DevExpress.data.ODataStore({
url: '{{autocomplete_url("materials","steel_grade")}}',
key: 'id',
});
e.editorOptions.valueExpr = 'steel_grade';
}
}
function setCellValue(datas) {
}
</script>
<style>
</style>
<div class="content">
<div class="row">
<?php
if(getisset("sync")) {
if(!$hasSyncPermission) {
bilgi("You do not have permission to sync.", "danger");
} else {
$cachePrefix = 'mto_sync_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$weldMaps = db("weld_logs")->where("id",">", $lastId)->take(1000)->get();
$count = 0;
$processedKeys = [];
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
foreach($weldMaps AS $weldMap) {
Cache::put($cachePrefix, $weldMap->id);
$uniqueKey = $weldMap->line_number . '_' . $weldMap->element_code_1;
if(in_array($uniqueKey, $processedKeys)) {
continue;
}
$processedKeys[] = $uniqueKey;
$data = [
//'project' => ,
'line' => $weldMap->line_number,
'rev' => $weldMap->iso_rev,
'component_code_id' => $weldMap->element_code_1,
// 'longdescription' ,
'description_en' => $weldMap->member_no_1,
// 'description_ru',
'manufacturing_standard' => $weldMap->wall_thickness_1,
'material' => $weldMap->main_material,
// 'material_quality_standard',
// 'pose_number' => $weldMap->pose_no_1,
// 'quantity' => $weldMap->,
'dia_inch_1' => $weldMap->nps_1,
'dn_1' => $weldMap->wall_thickness_1,
'odmm_1' => $weldMap->outside_diameter_1,
'schedule_1' => $weldMap->thickness_by_asme_1,
'thicknessmm_1' => $weldMap->wall_thickness_1,
'diainch_2' => $weldMap->nps_2,
'dn_2' => $weldMap->wall_thickness_1,
'odmm_2' => $weldMap->outside_diameter_2,
'schedule_2' => $weldMap->thickness_by_asme_2,
'thicknessmm_2' => $weldMap->wall_thickness_2,
// 'pn_mpa' => $weldMap->wall_thickness_1,
// 'remarks'
];
MTO::updateOrCreate([
'line' => $weldMap->line_number,
'component_code_id' => $weldMap->element_code_1
], $data);
$count++;
}
bilgi(":count Data has been sync from Weld Map",
"success",
['count' => $count]
);
}
}
$blockGroup = [
'General Information' => [
'project',
'discipline',
'designer',
'line',
'drawing_number',
'rev',
'component_code_id',
'longdescription',
'description_en',
'description_ru',
'manufacturing_standard',
],
'Material Information' => [
'material',
'material_quality_standard',
'quantity',
'dia_inch_1',
'dn_1',
'odmm_1',
'schedule_1',
'thicknessmm_1',
'diainch_2',
'dn_2',
'odmm_2',
'schedule_2',
'thicknessmm_2',
'pn_mpa',
'weight',
'total_weight',
'remarks',
],
];
$listDatas = MTO::orderBy("id","DESC")->paginate(setting('row_count'));
?>
@include("components.blocks.module-block")
</div>
</div>
@@ -1,272 +0,0 @@
<?php
use App\Models\NaksConsumable;
$title = "Naks Consumables";
$tableWidth="400%";
$path = "admin.type.naks-consumables";
$listDatas = NaksConsumable::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "naks_consumables";
$weldingConsumables = db("welding_consumables")->get();
$materials = db("materials");
$relationDatas = [
'type_of_consumable' => [
'datas' => db("type_of_consumables")->get(),
'pattern' => '{title_en} / {title_ru}',
'type' => 'select-dropdown'
],
'brand' => [
'datas' => db("welding_materials_brends")->groupBy("title")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown',
'filter-columns' => ['product_name']
],
'product_name' => [
'datas' => $weldingConsumables,
'pattern' => '{brend}',
'type' => 'select-dropdown',
'filter-columns' => ['aws_classification'],
'affected' => [
'aws_classification' => "{aws_class} {aws_specification}"
]
],
/*
'aws_classification' => [
'datas' => $weldingConsumables,
'pattern' => '{aws_class} {aws_specification}',
'type' => 'select-dropdown',
],
*/
'group_of_base_material' => [
'datas' => $materials->groupBy("short_name")->get(),
'pattern' => '{short_name}',
'type' => 'select-dropdown',
'filter-columns' => ['base_material']
],
'naks_tech_group' => [
'datas' => db("hazard_classes")->groupBy("category_serial_number")->get(),
'pattern' => '{category_serial_number}',
'type' => 'multiple-choice'
],
'base_material' => [
'datas' => $materials->groupBy("steel_grade")->get(),
'pattern' => '{steel_grade}',
'type' => 'multiple-choice'
],
'naks_technology' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'inspection_test_report_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'icm_akt_no_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
];
$blockGroup =
[
'Download' => [
'naks_technology',
'inspection_test_report_download',
'icm_akt_no_download',
],
'General Information' => [
'source_project',
'type_of_consumable',
'brand',
'product_name',
'aws_classification',
],
'Material' => [
'diameter',
'group_of_base_material',
'base_material',
'qty',
'unit',
'batch_number',
'naks_certificate_no',
'naks_certificate_date',
'naks_valid_date',
'naks_tech_group',
],
'Certification Info' => [
'inspection_test_report',
'inspection_certificate_standart',
'certification_date',
'certification_qty',
'icm_inspection_status',
'icm_rfi_no',
'icm_akt_no',
'icm_akt_date',
'remarks',
],
];
/*
$prependColumns = [
'Naks Technology' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0003_Naks_Consumables/',
'pattern' => "*{naks_certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
'Inspection Test Report' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0003_Naks_Consumables/',
'pattern' => "*{{inspection_test_report},{batch_number}}*.pdf",
'html' => '<i class="fa fa-download"></i>'
]
];
*/
$firstUploadFolder = "003_Welding_Database/0003_Naks_Consumables";
$firstUploadTitle = "Upload Naks Tech or Inspection Test Report Document";
$secondUploadFolder = "003_Welding_Database/0003_Naks_Consumables";
$secondUploadTitle = "Upload ICM Akt No Document";
$dataGridOptions = "
onToolbarPreparing: function(e) {
var toolbarItems = e.toolbarOptions.items;
// Source Project Dropdown Filter
toolbarItems.unshift({
location: 'before',
widget: 'dxSelectBox',
options: {
width: 200,
placeholder: 'Source Project',
showClearButton: true,
dataSource: {
store: {
type: 'array',
data: " . json_encode(
array_merge(
[['value' => '__this_project__', 'text' => '📍 This Project']],
DB::table('naks_consumables')
->whereNotNull('source_project')
->where('source_project', '!=', '')
->groupBy('source_project')
->pluck('source_project')
->map(function($item) {
return ['value' => $item, 'text' => $item];
})
->toArray()
)
) . ",
key: 'value'
}
},
displayExpr: 'text',
valueExpr: 'value',
onValueChanged: function(args) {
if (args.value === '__this_project__') {
e.component.filter([['source_project', '=', null], 'or', ['source_project', '=', '']]);
} else if (args.value) {
e.component.filter(['source_project', '=', args.value]);
} else {
e.component.clearFilter('dataSource');
}
}
}
});
// All Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'All',
icon: 'refresh',
stylingMode: 'text',
onClick: function() {
e.component.clearFilter();
}
}
});
},
";
?>
<script>
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
/*
if(e.dataField == "aws_classification") {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.acceptCustomValue = true;
e.editorOptions.dataSource = '{{autocomplete_type("aws_classification")}}?row=' + JSON.stringify(rowData);
}
*/
}
</script>
<style>
/* Satır rengini zorla değiştir */
.expired-row, .expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important; /* Yazıyı da koyu kırmızı yap */
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
// row.data.naks_valid_date verisi var mı kontrol et
if (row.rowType === "data" && row.data && row.data.naks_valid_date) {
var dateStr = row.data.naks_valid_date;
var validUntil = null;
// Tarih formatını kontrol et ve parse et
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı kontrolü
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
// [DD, MM, YYYY] -> new Date(YYYY, MM-1, DD)
if (parts.length === 3) {
validUntil = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya diğer formatlar
validUntil = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
validUntil = dateStr;
}
if (validUntil && !isNaN(validUntil.getTime())) {
validUntil.setHours(0, 0, 0, 0);
if (validUntil < today) {
// Satır elementini rowIndex ile bul
var rowIndex = row.rowIndex;
if (typeof rowIndex !== 'undefined') {
// DataGrid'in kendi metodunu kullanarak elementi al
var $rowElement = $(e.component.getRowElement(rowIndex));
$rowElement.addClass("expired-row");
// Hücrelere de stilin işlediğinden emin olmak için
$rowElement.find("td").addClass("expired-row");
}
}
}
}
});
}
</script>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,519 +0,0 @@
<?php
use App\Models\NaksCertificate;
$title = "Certificates";
$tableWidth="400%";
$path = "admin.type.naks-technology";
$listDatas = NaksCertificate::orderBy("id","DESC");
// Only show Total count, no SUM/AVG
$limitedSummaryColumns = [];
$tableType = "datagrid";
if(getisset("filter")) {
$get = $_GET;
unset($get['filter']);
unset($get['page']);
$listDatas = $listDatas->where(function($query) use($get) {
foreach($get AS $column => $values) {
$query->whereIn($column, $values);
}
});
}
$listDatas = $listDatas->paginate(setting('row_count'));
$tableName = "naks_certificates";
$materials = db('materials')->groupBy("ru_group")->get();
$jointTypes = db("joint_types")->get();
$jointViews = db("joint_views")->get();
$weldingPositions = db("welding_positions")->get();
$tableDifferentValues = table_different_values($tableName);
//$recordedDatas = recorded_data($tableName);
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'short_number' => [
'datas' => db('naks_centers')->get(),
'pattern' => '{center_no}',
'type' => 'select-dropdown',
'affected' => [
'short_name' => '{center_name}',
]
],
'welding_method' => [
'table' => 'welding_methods',
'datas' => db('welding_methods')->whereNotIn("ru_short_name",['*'])->get(),
'value' => 'ru_short_name',
'text' => ['ru_short_name'],
'type' => 'select',
],
'mat_group_1' => [
'datas' => $materials,
'pattern' => '{ru_group}-{short_name}',
'type' => 'select-dropdown'
],
'mat_group_2' => [
'datas' => $materials,
'pattern' => '{ru_group}-{short_name}',
'type' => 'select-dropdown'
],
'welding_consumable' => [
'datas' => db("welding_consumables")->get(),
'pattern' => '{brend}',
'type' => 'multiple-choice'
],
'technology_category' => [
'datas' => db("hazard_classes")->groupBy("serial_number")->get(),
'pattern' => '{serial_number}',
'type' => 'select-dropdown'
],
'work_type' => [
'datas' => db("work_types")->get(),
'pattern' => '{title_en}',
'type' => 'select-dropdown'
],
'performed_works_type' => [
'datas' => db('performed_work_types')->get(),
'pattern' => '{title}',
'type' => 'multiple-choice'
],
'joint_type' => [
'datas' => $jointTypes,
'pattern' => '{short_name_ru}',
'type' => 'select-dropdown',
'filter-columns' => [
'connection_type'
],
'affected' => [
'connection_type' => '{naks_name}',
]
],
'joint_view' => [
'datas' => $jointViews,
'pattern' => '{short_name_ru}',
'type' => 'multiple-choice'
],
'connection_type' => [
'datas' => $jointTypes,
'pattern' => '{naks_name}',
'type' => 'multiple-choice'
],
'electrode_coating' => [
'datas' => db('electrode_coatings')->get(),
'pattern' => '{short_name_ru}',
'type' => 'multiple-choice',
'disabled' => [
'column' => 'welding_method',
'type' => '!=',
'value' => 'РД',
],
],
'welding_equipment' => [
'datas' => db("welding_machine_types")->get(),
'pattern' => '{code}',
'type' => 'multiple-choice'
],
'pwht' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'pre_heating' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'position' => [
'datas' => $weldingPositions,
'pattern' => '{gost}',
'type' => 'multiple-choice',
'seperator' => ';'
],
];
/*
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0000_Naks Technology/',
'pattern' => "{short_number}*{certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
'Certificate No' => [
'type' => 'text',
'pattern' => "{short_number}-{certificate_no}"
],
];
*/
$blockGroup = [
'General Information' => [
// 'source_project',
'download',
'short_number',
'certificate_no',
'short_name',
'valid_from',
'valid_to',
'welding_method',
'mat_group_1',
'mat_group_2',
'welding_consumable',
'technology_category',
'work_type',
],
'Base Material' => [
'min_dia',
'max_dia',
'min_dia2',
'max_dia2',
'min_thick',
'max_thick',
'min_thick2',
'max_thick2',
'joint_type',
'pwht',
'connection_type',
'joint_view',
'angle_type',
'position',
'pre_heating',
'shielding_gas',
'electrode_coating',
],
'Result' => [
'welding_equipment',
'performed_works_type',
'remarks',
]
];
?>
<script>
$(function(){
$(".welding_method").on("change", function() {
var value = $(this).val();
var dataGroup = $(this).attr("data-group");
var dataGroupParent = $("." + dataGroup);
var electrodeCoating = dataGroupParent.find(".electrode_coating > input");
if(value == "РД") {
electrodeCoating.attr("required", "required");
electrodeCoating.prop("required", true);
} else {
electrodeCoating.removeAttr("required", "required");
}
});
});
</script>
<script>
/*
datas.data,
datas.name,
datas.rowData,
datas.type,
datas.values,
*/
function focusedCellChanging(e, rowData) {
console.log(e);
console.log(this);
var column = "";
if(column == "electrode_coating") {
if( rowData.welding_method == "РД") {
console.log("РД detect");
console.log(column);
column.validationRules = [{
type : 'required',
}];
} else {
column.validationRules = [];
}
}
}
function editorPreparing(e, rowData) {
console.log("editorPreparing");
console.log(rowData);
console.log(e);
var column = e.dataField;
var columnOptions = e.editorOptions;
if(column == "short_name") {
columnOptions.readOnly = true;
}
console.log(column);
}
function initChange(datas) {
console.log("initChange");
console.log(datas);
// console.log(datas.rowData.electrode_coating.validationRules[0].type = 'required');
/*
datas.rowData.electrode_coating.dxValidator({
type : 'required'
});
*/
/*
if(datas.name=="welding_method") {
if(datas.value=="РД") {
datas.rowData.electrode_coating.required = true;
} else {
datas.rowData.electrode_coating.required = false;
}
}
*/
}
function FocusedCellChanging(e) {
console.log("FocusedCellChanging");
console.log(e.cellElement);
/*
var cellElement = datas.options.component.getCellElement(datas.options.row.rowIndex, "electrode_coating");
var validator = datas.rowData.cellElement.data("dxValidator");
validator.option("validationRules", [{ type: "required" }]);
*/
}
function FocusedCellChanged(e) {
/*
console.log("FocusedCellChanged");
console.log(e);
var cellElement = e.component.getCellElement(e.rowIndex, "electrode_coating");
console.log("cellElement");
console.log(cellElement);
cellElement.dxValidator({
validationRules : [
{
type : "required"
}
]
});
console.log("cellElement");
console.log(cellElement.data("dxValidator"));
var validator = cellElement.data("dxValidator");
validator.option("validationRules", [{ type: "required" }]);
var validator = cellElement.data("dxValidator");
console.log("validator");
console.log(validator);
validator.option("validationRules", [{ type: "required" }]);
validator.validate();
*/
//e.column.electrode_coating.component.option("validationRules", [{ type: "required" }]);
// console.log(e.row.cellElement.option("validationRules", [{ type: "required" }]);
/*
cellElement.dxValidator({
validationRules : [
{
type : "required"
}
]
})
var validator = e.row.cellElement.data("dxValidator");
validator.option("validationRules", [{ type: "required" }]);
*/
}
</script>
<style>
/* Satır rengini zorla değiştir */
.expired-row, .expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important; /* Yazıyı da koyu kırmızı yap */
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
// row.data.valid_to verisi var mı kontrol et
if (row.rowType === "data" && row.data && row.data.valid_to) {
var dateStr = row.data.valid_to;
var validUntil = null;
// Tarih formatını kontrol et ve parse et
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı kontrolü
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
// [DD, MM, YYYY] -> new Date(YYYY, MM-1, DD)
if (parts.length === 3) {
validUntil = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya diğer formatlar
validUntil = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
validUntil = dateStr;
}
if (validUntil && !isNaN(validUntil.getTime())) {
validUntil.setHours(0, 0, 0, 0);
if (validUntil < today) {
// Satır elementini rowIndex ile bul
var rowIndex = row.rowIndex;
if (typeof rowIndex !== 'undefined') {
// DataGrid'in kendi metodunu kullanarak elementi al
var $rowElement = $(e.component.getRowElement(rowIndex));
$rowElement.addClass("expired-row");
// Hücrelere de stilin işlediğinden emin olmak için
$rowElement.find("td").addClass("expired-row");
}
}
}
}
});
}
</script>
<div class="content">
<div class="row">
<?php
$firstUploadFolder = '003_Welding_Database/0000_Naks%20Technology/';
$firstUploadTitle = 'Upload Certificate File PDF';
$dataGridOptions = "
onToolbarPreparing: function(e) {
var toolbarItems = e.toolbarOptions.items;
var today = new Date();
today.setHours(0,0,0,0);
// Source Project Dropdown Filter
toolbarItems.unshift({
location: 'before',
widget: 'dxSelectBox',
options: {
width: 200,
placeholder: 'Source Project',
showClearButton: true,
dataSource: {
store: {
type: 'array',
data: " . json_encode(
array_merge(
[['value' => '__this_project__', 'text' => '📍 This Project']],
DB::table('naks_certificates')
->whereNotNull('source_project')
->where('source_project', '!=', '')
->groupBy('source_project')
->pluck('source_project')
->map(function($item) {
return ['value' => $item, 'text' => $item];
})
->toArray()
)
) . ",
key: 'value'
}
},
displayExpr: 'text',
valueExpr: 'value',
onValueChanged: function(args) {
if (args.value === '__this_project__') {
e.component.filter([['source_project', '=', null], 'or', ['source_project', '=', '']]);
} else if (args.value) {
e.component.filter(['source_project', '=', args.value]);
} else {
e.component.clearFilter('dataSource');
}
}
}
});
// Temizle / Tümü
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'All',
icon: 'refresh',
stylingMode: 'text',
onClick: function() {
e.component.clearFilter();
}
}
});
// Süresi Dolmayanlar (Geçerli)
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Valid',
icon: 'check',
type: 'success',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['valid_to', '>=', today]);
}
}
});
// Süresi Dolanlar
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Expired',
icon: 'remove',
type: 'danger',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['valid_to', '<', today]);
}
}
});
// Reset View Button (Mevcut butonu korumak için tekrar ekliyoruz)
toolbarItems.push({
location: 'after',
widget: 'dxButton',
options: {
icon: 'refresh',
text: 'Reset View',
hint: 'Reset View',
onClick: function () {
localStorage.removeItem(storageKey);
location.reload();
}
}
});
},
";
?>
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,335 +0,0 @@
<?php
use App\Models\NaksWelder;
$title = "Naks Welder";
$tableWidth="400%";
$path = "admin.type.naks-welder";
$listDatas = NaksWelder::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "naks_welders";
$users = db("users")->whereIn("level", ['Welder', 'Engineer'])->get();
$weldingMethods = db("welding_methods")->whereNotIn('ru_short_name',['*'])->get();
$productType = db("product_types")->get();
$jointType = db("joint_types")->get();
$hazardClasses = db("hazard_classes")->get();
$materials = db("materials")->whereNotIn("ru_group", ['*'])->groupBy("ru_group")->get("ru_group");
$mainMaterials = db("materials")->whereNotIn("main_material", ['*'])->groupBy("main_material")->get("main_material");
$weldingPositions = db("welding_positions")->get();
$subcontractors = db("subcontractors")->get();
$blockGroup = [
'General Information' => [
'source_project',
'download',
'user_id',
'welder_name_ru',
'welder_name_en',
'year_of_birth',
'company',
'qualitification_category',
'work_experience',
'welder_id',
'process',
'component',
'weld_type',
'naks_certificate_no',
'period_of_validity',
'group_of_technical_device',
],
];
for($k=1;$k<=4;$k++) {
$blockGroup['Material ' . $k] = [
'material_' . $k,
'diameter_min_' . $k,
'diameter_max_' . $k,
'min_thick_' . $k,
'max_thick_' . $k,
];
$columnRedesign['material-' . $k]['class'] = "col-md-6";
$columnRedesign['material_' . $k]['class'] = "col-12";
$columnRedesign['material-' . $k]['color'] = 10;
$columnRedesign['material-' . $k]['border'] = true;
$columnRedesign['material-' . $k]['content-class'] = "bg-gray";
}
$blockGroup['Result'] = [
'welding_position',
'order_no',
'date',
];
$columnRedesign['result']['content-class'] = "bg-white";
$columnRedesign['result']['color'] = 19;
$columnRedesign['general-information']['class'] = "col-md-12";
$columnRedesign['general-information']['color'] = 30;
$columnRedesign['general-information']['border'] = true;
$material_group_test_pieces = db("material_group_test_pieces")
->get("provision_value")
->pluck("provision_value");
$result = [];
foreach ($material_group_test_pieces as $piece) {
$items = explode(',', $piece);
foreach ($items as $item) {
$result[] = (object) ['ru_group' => $item]; // Nesneye dönüştür
}
}
// $materials'ı nesnelere dönüştür ve birleştir
$materialsArray = $materials->toArray();
$materialsArray = array_map(fn($material) => (object) $material, $materialsArray);
$mergedMaterials = array_merge($materialsArray, $result);
// Benzersiz öğeleri bul
$uniqueMaterials = [];
foreach ($mergedMaterials as $material) {
if (!in_array($material, $uniqueMaterials, true)) {
$uniqueMaterials[] = $material;
}
}
// Sonucu Object olarak döndür
$materials2 = $uniqueMaterials;
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'user_id' => [
'table' => 'users',
'datas' => $users,
'value' => 'id',
'text' => ['registration_no', 'name'],
'type' => 'select',
'affected' => [
'year_of_birth' => '{date_of_birth}',
'welder_name_ru' => '{name_ru}',
'welder_name_en' => '{name}',
'company' => '{subcontructer}',
'qualitification_category' => '{qualitification}',
]
],
'process' => [
'datas' => $weldingMethods,
'pattern' => '{ru_short_name}',
'type' => 'select-dropdown'
],
'component' => [
'datas' => $productType,
'pattern' => '{short_name_ru}',
'type' => 'multiple-choice'
],
'weld_type' => [
'datas' => $jointType,
'pattern' => '{short_name_ru} {short_name_en}',
'type' => 'multiple-choice'
],
'group_of_technical_device' => [
'datas' => $hazardClasses,
'pattern' => '{serial_number}',
'type' => 'multiple-choice'
],
'material_1' => [
'datas' => $mainMaterials,
'pattern' => '{main_material}',
'type' => 'select-dropdown'
],
'material_2' => [
'datas' => $mainMaterials,
'pattern' => '{main_material}',
'type' => 'select-dropdown'
],
'material_3' => [
'datas' => $mainMaterials,
'pattern' => '{main_material}',
'type' => 'select-dropdown'
],
'material_4' => [
'datas' => $mainMaterials,
'pattern' => '{main_material}',
'type' => 'multiple-choice'
],
'welding_position' => [
'datas' => $weldingPositions,
'pattern' => '{gost}/{en}',
'type' => 'multiple-choice'
],
'company' => [
'datas' => $subcontractors,
'pattern' => '{company_name_en}',
'type' => 'multiple-choice'
],
'status' => [
'values' => [
'Shop Active',
'Field Active',
'Transfer to',
'Black list',
'Exit'
],
'type' => 'manuel-select'
],
];
/*
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0001_Naks_Welder/',
'pattern' => "*{naks_certificate_no}*{welder_id}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
];
*/
$firstUploadFolder = "003_Welding_Database/0001_Naks_Welder";
$firstUploadTitle = "Upload Naks Welder Document";
$dataGridOptions = "
onToolbarPreparing: function(e) {
var toolbarItems = e.toolbarOptions.items;
var today = new Date();
today.setHours(0,0,0,0);
// Source Project Dropdown Filter
toolbarItems.unshift({
location: 'before',
widget: 'dxSelectBox',
options: {
width: 200,
placeholder: 'Source Project',
showClearButton: true,
dataSource: {
store: {
type: 'array',
data: " . json_encode(
array_merge(
[['value' => '__this_project__', 'text' => '📍 This Project']],
DB::table('naks_welders')
->whereNotNull('source_project')
->where('source_project', '!=', '')
->groupBy('source_project')
->pluck('source_project')
->map(function($item) {
return ['value' => $item, 'text' => $item];
})
->toArray()
)
) . ",
key: 'value'
}
},
displayExpr: 'text',
valueExpr: 'value',
onValueChanged: function(args) {
if (args.value === '__this_project__') {
e.component.filter([['source_project', '=', null], 'or', ['source_project', '=', '']]);
} else if (args.value) {
e.component.filter(['source_project', '=', args.value]);
} else {
e.component.clearFilter('dataSource');
}
}
}
});
// All Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'All',
icon: 'refresh',
stylingMode: 'text',
onClick: function() {
e.component.clearFilter();
}
}
});
},
";
?>
<script>
$(function(){
})
</script>
<style>
/* Satır rengini zorla değiştir */
.expired-row, .expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important; /* Yazıyı da koyu kırmızı yap */
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
// row.data.period_of_validity verisi var mı kontrol et
if (row.rowType === "data" && row.data && row.data.period_of_validity) {
var dateStr = row.data.period_of_validity;
var validUntil = null;
// Tarih formatını kontrol et ve parse et
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı kontrolü
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
// [DD, MM, YYYY] -> new Date(YYYY, MM-1, DD)
if (parts.length === 3) {
validUntil = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya diğer formatlar
validUntil = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
validUntil = dateStr;
}
if (validUntil && !isNaN(validUntil.getTime())) {
validUntil.setHours(0, 0, 0, 0);
if (validUntil < today) {
// Satır elementini rowIndex ile bul
var rowIndex = row.rowIndex;
if (typeof rowIndex !== 'undefined') {
// DataGrid'in kendi metodunu kullanarak elementi al
var $rowElement = $(e.component.getRowElement(rowIndex));
$rowElement.addClass("expired-row");
// Hücrelere de stilin işlediğinden emin olmak için
$rowElement.find("td").addClass("expired-row");
}
}
}
}
});
}
</script>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,235 +0,0 @@
<?php
use App\Models\WeldingEquipment;
$title = "NAKS Welding Equipments";
$tableWidth="200%";
$path = "admin.type.naks-welding-equipments";
$listDatas = WeldingEquipment::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "welding_equipment";
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'working_status' => [
'values' => [
'Working',
'Attestation waiting',
'Repair',
'Out of use',
],
'type' => 'manuel-select'
],
'groups_of_technical_devices' => [
'datas' => db('hazard_classes')->groupBy("category_serial_number")->get(),
'pattern' => '{category_serial_number}',
'type' => 'multiple-choice'
],
'type_of_welding_machine' => [
'datas' => db('welding_machine_types')->get(),
'pattern' => '{code}',
'type' => 'multiple-choice'
],
'type_of_weld' => [
'datas' => db('welding_methods')->whereNotIn("ru_short_name", ['*'])->get(),
'pattern' => '{ru_short_name}',
'type' => 'multiple-choice'
],
];
/*
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0002_Naks_Equipments/',
'pattern' => "{attestation}*.pdf",
'html' => '<i class="fa fa-download"></i>'
]
];
*/
$firstUploadFolder = "003_Welding_Database/0002_Naks_Equipments";
$firstUploadTitle = "Upload Naks Equipments Document";
$dataGridOptions = "
onToolbarPreparing: function(e) {
var toolbarItems = e.toolbarOptions.items;
var today = new Date();
today.setHours(0,0,0,0);
// Source Project Dropdown Filter
toolbarItems.unshift({
location: 'before',
widget: 'dxSelectBox',
options: {
width: 200,
placeholder: 'Source Project',
showClearButton: true,
dataSource: {
store: {
type: 'array',
data: " . json_encode(
array_merge(
[['value' => '__this_project__', 'text' => '📍 This Project']],
DB::table('welding_equipment')
->whereNotNull('source_project')
->where('source_project', '!=', '')
->groupBy('source_project')
->pluck('source_project')
->map(function($item) {
return ['value' => $item, 'text' => $item];
})
->toArray()
)
) . ",
key: 'value'
}
},
displayExpr: 'text',
valueExpr: 'value',
onValueChanged: function(args) {
if (args.value === '__this_project__') {
e.component.filter([['source_project', '=', null], 'or', ['source_project', '=', '']]);
} else if (args.value) {
e.component.filter(['source_project', '=', args.value]);
} else {
e.component.clearFilter('dataSource');
}
}
}
});
// All Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'All',
icon: 'refresh',
stylingMode: 'text',
onClick: function() {
e.component.clearFilter();
}
}
});
// Valid Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Valid',
icon: 'check',
type: 'success',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['valid_until', '>=', today]);
}
}
});
// Expired Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Expired',
icon: 'remove',
type: 'danger',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['valid_until', '<', today]);
}
}
});
},
";
$blockGroup = [
'General Information' => [
'source_project',
'download',
'location',
'attestation',
'producer',
],
'Welding Info' => [
'type_of_welding_machine',
'brand',
'manufacturer_code',
'type_of_weld',
'groups_of_technical_devices',
'date_of_issue',
'valid_until',
],
'Result' => [
'working_status',
'remarks',
],
];
?>
<style>
/* Satır rengini zorla değiştir */
.expired-row, .expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important; /* Yazıyı da koyu kırmızı yap */
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
// row.data.valid_until verisi var mı kontrol et
if (row.rowType === "data" && row.data && row.data.valid_until) {
var dateStr = row.data.valid_until;
var validUntil = null;
// Tarih formatını kontrol et ve parse et
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı kontrolü
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
// [DD, MM, YYYY] -> new Date(YYYY, MM-1, DD)
if (parts.length === 3) {
validUntil = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya diğer formatlar
validUntil = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
validUntil = dateStr;
}
if (validUntil && !isNaN(validUntil.getTime())) {
validUntil.setHours(0, 0, 0, 0);
if (validUntil < today) {
// Satır elementini rowIndex ile bul
var rowIndex = row.rowIndex;
if (typeof rowIndex !== 'undefined') {
// DataGrid'in kendi metodunu kullanarak elementi al
var $rowElement = $(e.component.getRowElement(rowIndex));
$rowElement.addClass("expired-row");
// Hücrelere de stilin işlediğinden emin olmak için
$rowElement.find("td").addClass("expired-row");
}
}
}
}
});
}
</script>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,79 +0,0 @@
<?php
$templateInfo = document_template("NCR");
$templateName = $templateInfo->files;
$tableName = "n_c_r_logs";
$title = "NCR";
$outputFilePath = "007_NCR/";
$outputFileName = "ncr_no";
$numberColumn = "ncr_no";
$relationDatas = [
'subcontractor' => [],
'thirdparty' => [],
'contractor' => [],
'itp' => db("i_t_p_s")->groupBy("itp_no")->get()->pluck("itp_no")->toArray(),
];
?>
<script>
$(function() {
$(".print-pdf input[type='checkbox']:eq(0)").attr("name", "current_status").attr("value","Yes");
$(".print-pdf input[type='checkbox']:eq(1)").attr("name", "current_status").attr("value","Bare Chance");
$(".print-pdf input[type='checkbox']:eq(2)").attr("name", "current_status").attr("value","No");
function updateSuccess() {
$.get('?ajax=get-ncr-no', function(d) {
$("[name='ncr_no']").val(d.trim());
});
}
$("[name='itp']").change(function() {
var itp = $(this).val();
if (itp) {
$.ajax({
url: '{{autocomplete_url("i_t_p_s", "item_no")}}&filter={"itp_no":"' + itp + '"}',
type: 'GET',
dataType: 'json',
success: function(data) {
var phaseSelect = $("[name='phase']");
phaseSelect.empty();
phaseSelect.append('<option value="">Select Phase</option>');
$.each(data, function(index, item) {
phaseSelect.append('<option value="' + item.item_no + '">' + item.item_no + '</option>');
});
},
error: function(xhr, status, error) {
console.error('AJAX Error: ' + status + error);
}
});
} else {
$("[name='phase']").empty().append('<option value="">Select Phase</option>');
}
});
$("[name='phase']").change(function() {
$.getJSON('{{row_detail_url("i_t_p_s", "item_no")}}?value=' + $(this).val(), function(d) {
$("[name='description']").val(d.inspection_step_en);
$("[name='description_ru']").val(d.inspection_step_ru);
});
});
$.get('?ajax=get-ncr-no', function(d) {
$("[name='ncr_no']").val(d.trim());
});
});
</script>
@include("admin.type.inc.excel-form-templates")
<style>
.creator-form {
width: 400mm;
display: block;
margin: 0 auto;
}
</style>
@@ -1,165 +0,0 @@
<?php
use App\Models\NCRLog;
$title = "NCR Log";
$tableWidth="100%";
$listDatas = NCRLog::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "n_c_r_logs";
$blockGroup = [
'General Info' => [
'date',
'type',
'ncr_no',
'discipline',
'department',
'description_ru',
'description_eng',
'project',
'evidence_or_ref_documents',
'location',
'subcontractor',
],
'Corrective Actions' => [
'corrective_action_ru',
'corrective_action_eng',
'root_cause_investigation',
'current_status',
'issued_by',
'issue_date',
'approved_percent',
'approved_date',
],
'Timeline' => [
'planned_close_out_date',
'close_out_date',
'on_time',
'difference_day',
],
'Cost Analysis' => [
'construction_cost',
'technical_office_cost',
'quality_cost',
'total_cost',
],
'Related Info' => [
'related_ncrciar',
'effectiveness',
'remarks',
],
];
$relationDatas = [
'type' => [
'values' => j(setting("ncr_types")) ?: [],
'type' => 'manuel-select'
],
'current_status' => [
'values' => j(setting("ncr_current_status")) ?: [],
'type' => 'manuel-select'
],
/*
'subcontractor' => [
'values' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'type' => 'manuel-select',
'customValue' => true
],
*/
'discipline' => [
'values' => db("disciplines")->get()->pluck("discipline_title")->toArray(),
'type' => 'manuel-select'
],
'department' => [
'type' => 'long-text'
],
'description_eng' => [
'type' => 'long-text'
],
'description_ru' => [
'type' => 'long-text'
],
'corrective_action_eng' => [
'type' => 'long-text'
],
'corrective_action_ru' => [
'type' => 'long-text'
],
'root_cause_investigation' => [
'type' => 'long-text'
],
];
$prependColumns = [
'NCR File' => [
'type' => 'link-search',
'path' => '007_NCR/',
'pattern' => "*{ncr_no}*.pdf",
'html' => '<i class="fa fa-file-pdf"></i>'
],
'NCR Excel' => [
'type' => 'link-search',
'path' => '007_NCR/',
'pattern' => "*{ncr_no}*.xlsx",
'html' => '<i class="fa fa-file-excel"></i>'
],
];
$firstUploadFolder = '007_NCR/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'ncr_log_upload_permission';
?>
<script>
function editorPreparing(e, dataRow) {
if(e.dataField == "subcontractor" ) {
                        e.editorName = "dxSelectBox";
                        e.editorOptions.searchEnabled = true;
                        e.editorOptions.acceptCustomValue = true;      
                        e.editorOptions.dataSource = <?php echo json_encode_tr(db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray()) ?>;
                    }
if (e.dataField === "planned_close_out_date" || e.dataField === "close_out_date") {
const oldValue = e.value;
e.editorOptions.onValueChanged = function(args) {
const rowData = e.row.data;
let planned, actual;
if (e.dataField === "planned_close_out_date") {
planned = args.value;
actual = rowData.close_out_date;
e.component.cellValue(e.row.rowIndex, "planned_close_out_date", args.value);
} else {
planned = rowData.planned_close_out_date;
actual = args.value;
e.component.cellValue(e.row.rowIndex, "close_out_date", args.value);
}
if (planned && actual) {
const plannedDate = new Date(planned);
const actualDate = new Date(actual);
const diffTime = actualDate.getTime() - plannedDate.getTime();
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
const onTime = actualDate <= plannedDate ? "On Time" : "Delay";
e.component.cellValue(e.row.rowIndex, "difference_day", diffDays);
e.component.cellValue(e.row.rowIndex, "on_time", onTime);
}
};
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,960 +0,0 @@
<!-- Export Libraries -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
<style>
#ncrExportActions {
background: #f5f7ff;
border: 1px solid #dbe3ff;
border-radius: 10px;
padding: 12px 16px;
}
#ncrExportActions strong {
font-size: 0.9rem;
color: #2f3b64;
}
.ncr-section-header {
position: relative;
display: flex;
align-items: center;
padding-right: 150px;
min-height: 48px;
}
.ncr-section-header > *:first-child {
flex: 1;
}
.ncr-section-checkbox {
position: absolute;
right: 16px;
top: 50%;
transform: translateY(-50%);
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
font-weight: 500;
background: #f8f9fc;
border: 1px solid #d8deed;
border-radius: 14px;
padding: 4px 10px;
margin-left: auto;
color: #3b4f7a;
cursor: pointer;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ncr-section-checkbox input {
margin: 0;
position: relative;
}
.ncr-section-checkbox span {
white-space: nowrap;
}
.ncr-section-checkbox.d-none {
display: none !important;
}
.ncr-section-highlight {
box-shadow: 0 0 0 2px rgba(82, 109, 255, 0.15);
border-radius: 12px;
transition: box-shadow 0.2s ease;
}
.ncr-section-highlight .block-header {
border-bottom: 1px solid #e2e7f3;
}
</style>
<script>
$(function () {
const exportMeta = <?php echo json_encode([
'user' => u()->name ?? '',
'project' => setting('project_code') ?? ''
]); ?>;
const notify = (message, type = 'info', duration = 1500) => {
if (window.DevExpress && DevExpress.ui && DevExpress.ui.notify) {
DevExpress.ui.notify(message, type, duration);
} else {
console.log(`[${type}] ${message}`);
}
};
let sectionDefinitions = [];
const sectionMap = {};
const defaultProjectCode = "{{setting('project_code') ?? 'PROJECT'}}";
const exportState = {
mode: null,
isProcessing: false
};
const $excelButton = $('#btnExportExcelNcr');
const $jpegButton = $('#btnExportJpegNcr');
const $actionsPanel = $('#ncrExportActions');
const $downloadBtn = $('#ncrDownloadSelected');
const $selectAllBtn = $('#ncrSelectAll');
const $cancelBtn = $('#ncrCancelSelection');
function discoverSections() {
sectionDefinitions = [];
$('#ncrCapture .ncr-section-block').each(function () {
const $block = $(this);
const blockId = $block.attr('id');
if (!blockId) return;
const $title = $block.find('.block-title').first();
const titleText = $title.text().trim();
if (!titleText) return;
const section = {
key: blockId,
label: titleText,
excelTitle: titleText,
target: '#' + blockId,
blockElement: $block.get(0)
};
sectionDefinitions.push(section);
sectionMap[section.key] = section;
});
}
function initializeSectionCheckboxes() {
sectionDefinitions.forEach(function (section) {
const block = section.blockElement;
if (!block) return;
const header = block.querySelector('.block-header');
if (!header) return;
header.classList.add('ncr-section-header');
const existing = header.querySelector('.ncr-section-checkbox[data-section="' + section.key + '"]');
if (existing) {
section.checkboxElement = existing.querySelector('input');
return;
}
const label = document.createElement('label');
label.className = 'ncr-section-checkbox d-none';
label.setAttribute('data-section', section.key);
label.innerHTML = '<input type="checkbox" class="form-check-input ncr-section-toggle" data-section="' + section.key + '" checked> <span>Select</span>';
header.appendChild(label);
section.checkboxElement = label.querySelector('input');
});
}
function openSelectionMode(mode) {
if (!sectionDefinitions.some(section => section.checkboxElement)) {
notify('No exportable sections found on this page.', 'warning', 2000);
return;
}
exportState.mode = mode;
updateDownloadButton();
toggleCheckboxVisibility(true);
$actionsPanel.removeClass('d-none');
$excelButton.prop('disabled', true);
$jpegButton.prop('disabled', true);
notify('Select the sections you want to export, then click Download.', 'info', 1800);
}
function closeSelectionMode(resetChecks) {
exportState.mode = null;
toggleCheckboxVisibility(false);
$actionsPanel.addClass('d-none');
$excelButton.prop('disabled', false);
$jpegButton.prop('disabled', false);
if (resetChecks) {
sectionDefinitions.forEach(function (section) {
if (section.checkboxElement) section.checkboxElement.checked = true;
});
syncSelectAllText();
}
}
function toggleCheckboxVisibility(show) {
sectionDefinitions.forEach(function (section) {
if (!section.checkboxElement || !section.blockElement) return;
const wrapper = section.checkboxElement.closest('.ncr-section-checkbox');
if (wrapper) wrapper.classList.toggle('d-none', !show);
section.blockElement.classList.toggle('ncr-section-highlight', show);
});
}
function setAllSectionChecks(value) {
sectionDefinitions.forEach(function (section) {
if (section.checkboxElement) section.checkboxElement.checked = value;
});
}
function areAllSectionsChecked() {
return sectionDefinitions.every(function (section) {
return !section.checkboxElement || section.checkboxElement.checked;
});
}
function syncSelectAllText() {
$selectAllBtn.text(areAllSectionsChecked() ? 'Deselect All' : 'Select All');
}
function setDownloadBusy(isBusy) {
$downloadBtn.prop('disabled', isBusy);
$cancelBtn.prop('disabled', isBusy);
$selectAllBtn.prop('disabled', isBusy);
}
function updateDownloadButton() {
if (exportState.mode === 'excel') {
$downloadBtn.text('Download Excel').removeClass('btn-warning').addClass('btn-primary');
} else if (exportState.mode === 'jpeg') {
$downloadBtn.text('Download JPEG').removeClass('btn-primary').addClass('btn-warning');
}
}
function getCheckedSectionKeys() {
return sectionDefinitions
.filter(section => section.checkboxElement && section.checkboxElement.checked)
.map(section => section.key);
}
function prettifyHeader(text) {
if (!text) return '';
return text.replace(/_/g, ' ').replace(/\s+/g, ' ').trim()
.replace(/\b\w/g, char => char.toUpperCase());
}
function columnNumberFromAddress(address) {
if (!address || typeof address !== 'string') return 1;
const letters = address.replace(/[0-9]/g, '').toUpperCase();
if (!letters.length) return 1;
let number = 0;
for (let i = 0; i < letters.length; i++) {
number = number * 26 + (letters.charCodeAt(i) - 64);
}
return number || 1;
}
function extractTableData(blockElement) {
const tables = blockElement.querySelectorAll('table');
const tableData = [];
tables.forEach(function (table) {
const rows = [];
const headerCells = table.querySelectorAll('thead th, thead td');
if (headerCells.length > 0) {
const headers = [];
headerCells.forEach(cell => headers.push(cell.textContent.trim()));
rows.push(headers);
}
const bodyRows = table.querySelectorAll('tbody tr');
bodyRows.forEach(function (tr) {
const row = [];
tr.querySelectorAll('td, th').forEach(cell => row.push(cell.textContent.trim()));
if (row.length > 0) rows.push(row);
});
if (rows.length > 0) tableData.push(rows);
});
return tableData;
}
function appendMetaRows(worksheet, currentRow) {
const metaStartRow = currentRow + 2;
worksheet.getCell(metaStartRow, 1).value = 'Generated By:';
worksheet.getCell(metaStartRow, 2).value = exportMeta.user || '';
worksheet.getCell(metaStartRow + 1, 1).value = 'Project:';
worksheet.getCell(metaStartRow + 1, 2).value = exportMeta.project || defaultProjectCode;
worksheet.getCell(metaStartRow + 2, 1).value = 'Generated At:';
worksheet.getCell(metaStartRow + 2, 2).value = new Date().toLocaleString();
for (let r = metaStartRow; r <= metaStartRow + 2; r++) {
worksheet.getCell(r, 1).font = { bold: true };
}
return metaStartRow + 3;
}
function autoSizeColumns(worksheet) {
worksheet.columns.forEach(function (column) {
let maxLength = 10;
column.eachCell({ includeEmpty: false }, function (cell) {
const cellValue = cell.value ? cell.value.toString() : '';
if (cellValue.length > maxLength) maxLength = cellValue.length;
});
column.width = Math.min(maxLength + 2, 50);
});
}
function applyBorders(worksheet, startRow, endRow, startCol, endCol) {
if (startCol === undefined || endCol === undefined || startRow === undefined || endRow === undefined) return;
for (let row = startRow; row <= endRow; row++) {
for (let col = startCol; col <= endCol; col++) {
const cell = worksheet.getCell(row, col);
cell.border = {
top: { style: 'thin', color: { argb: 'FF000000' } },
bottom: { style: 'thin', color: { argb: 'FF000000' } },
left: { style: 'thin', color: { argb: 'FF000000' } },
right: { style: 'thin', color: { argb: 'FF000000' } }
};
}
}
}
async function performExcelExport(selectedKeys) {
try {
notify('Preparing Excel export...', 'info', 1000);
const workbook = new ExcelJS.Workbook();
workbook.creator = exportMeta.user || 'Unknown';
workbook.created = new Date();
const worksheet = workbook.addWorksheet('NCR Status', {
properties: { defaultRowHeight: 18 },
pageSetup: { orientation: 'landscape' }
});
let currentRow = 1;
for (const key of selectedKeys) {
const section = sectionMap[key];
if (!section || !section.blockElement) continue;
const titleCell = worksheet.getCell(currentRow, 1);
titleCell.value = section.excelTitle || section.label;
titleCell.font = { bold: true, size: 16, color: { argb: 'FF1F4E78' } };
titleCell.alignment = { horizontal: 'left', vertical: 'middle' };
currentRow += 1;
const dataGridElement = section.blockElement.querySelector('.dx-datagrid');
if (dataGridElement) {
const gridInstance = $(dataGridElement).dxDataGrid('instance');
if (gridInstance) {
const dataSource = gridInstance.getDataSource();
const items = dataSource ? dataSource.items() : [];
if (items.length > 0) {
const headers = Object.keys(items[0]).map(prettifyHeader);
const headerRow = worksheet.getRow(currentRow);
headers.forEach((header, index) => {
const cell = headerRow.getCell(index + 1);
cell.value = header;
cell.font = { bold: true, color: { argb: 'FFFFFFFF' } };
cell.fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FF4472C4' }
};
cell.alignment = { horizontal: 'center', vertical: 'middle' };
});
currentRow += 1;
items.forEach(item => {
const dataRow = worksheet.getRow(currentRow);
Object.values(item).forEach((value, index) => {
dataRow.getCell(index + 1).value = value;
});
currentRow += 1;
});
applyBorders(worksheet, currentRow - items.length - 1, currentRow - 1, 1, headers.length);
}
}
}
const tableData = extractTableData(section.blockElement);
tableData.forEach(function (tableRows) {
tableRows.forEach(function (rowData, rowIndex) {
const excelRow = worksheet.getRow(currentRow);
rowData.forEach(function (cellValue, colIndex) {
const cell = excelRow.getCell(colIndex + 1);
cell.value = cellValue;
if (rowIndex === 0) {
cell.font = { bold: true, color: { argb: 'FFFFFFFF' } };
cell.fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FF4472C4' }
};
cell.alignment = { horizontal: 'center', vertical: 'middle' };
}
});
currentRow += 1;
});
if (tableRows.length > 0) {
applyBorders(worksheet, currentRow - tableRows.length, currentRow - 1, 1, tableRows[0].length);
}
});
currentRow += 2;
}
appendMetaRows(worksheet, currentRow);
autoSizeColumns(worksheet);
const now = new Date();
const dateStr = now.getFullYear() + String(now.getMonth() + 1).padStart(2, '0') + String(now.getDate()).padStart(2, '0');
const timeStr = String(now.getHours()).padStart(2, '0') + String(now.getMinutes()).padStart(2, '0');
const fileName = `NCR_Status_${exportMeta.project || defaultProjectCode}_${dateStr}_${timeStr}.xlsx`;
const buffer = await workbook.xlsx.writeBuffer();
saveAs(new Blob([buffer]), fileName);
notify('Excel exported successfully!', 'success', 3000);
closeSelectionMode(false);
} catch (error) {
console.error('Excel export error:', error);
notify('Failed to export Excel: ' + error.message, 'error', 3000);
}
}
async function performJpegExport(selectedKeys) {
try {
notify('Preparing JPEG export...', 'info', 1000);
const captureElement = document.getElementById('ncrCapture');
if (!captureElement) {
notify('Dashboard content not found.', 'error', 2000);
return;
}
sectionDefinitions.forEach(function (section) {
if (!selectedKeys.includes(section.key) && section.blockElement) {
section.blockElement.style.display = 'none';
}
});
await new Promise(resolve => setTimeout(resolve, 500));
const canvas = await html2canvas(captureElement, {
scale: 1.5,
useCORS: true,
logging: false,
backgroundColor: '#ffffff',
ignoreElements: function (el) {
if (el.id === 'ncrExportActions') return true;
if (el.classList && el.classList.contains('ncr-section-checkbox')) return true;
if (el.closest && el.closest('.ncr-export-controls')) return true;
return false;
},
onclone: function (clonedDoc) {
const tables = clonedDoc.querySelectorAll('table');
tables.forEach(function (table) {
table.style.borderCollapse = 'collapse';
table.style.borderSpacing = '0';
table.style.width = table.scrollWidth + 'px';
});
}
});
sectionDefinitions.forEach(function (section) {
if (section.blockElement) section.blockElement.style.display = '';
});
canvas.toBlob(function (blob) {
const now = new Date();
const dateStr = now.getFullYear() + String(now.getMonth() + 1).padStart(2, '0') + String(now.getDate()).padStart(2, '0');
const timeStr = String(now.getHours()).padStart(2, '0') + String(now.getMinutes()).padStart(2, '0');
const fileName = `NCR_Status_${exportMeta.project || defaultProjectCode}_${dateStr}_${timeStr}.jpg`;
saveAs(blob, fileName);
notify('JPEG exported successfully!', 'success', 3000);
closeSelectionMode(false);
}, 'image/jpeg', 0.95);
} catch (error) {
console.error('JPEG export error:', error);
notify('Failed to export JPEG: ' + error.message, 'error', 3000);
sectionDefinitions.forEach(function (section) {
if (section.blockElement) section.blockElement.style.display = '';
});
}
}
$excelButton.on('click', function () {
if (exportState.isProcessing) return;
openSelectionMode('excel');
});
$jpegButton.on('click', function () {
if (exportState.isProcessing) return;
openSelectionMode('jpeg');
});
$selectAllBtn.on('click', function () {
const allSelected = areAllSectionsChecked();
setAllSectionChecks(!allSelected);
syncSelectAllText();
});
$cancelBtn.on('click', function () {
if (exportState.isProcessing) return;
closeSelectionMode(true);
});
$(document).on('change', '.ncr-section-toggle', function () {
syncSelectAllText();
});
$downloadBtn.on('click', async function () {
if (exportState.isProcessing) return;
const selectedKeys = getCheckedSectionKeys();
if (!selectedKeys.length) {
notify('Please select at least one section.', 'warning', 2000);
return;
}
exportState.isProcessing = true;
setDownloadBusy(true);
try {
if (exportState.mode === 'excel') {
await performExcelExport(selectedKeys);
} else if (exportState.mode === 'jpeg') {
await performJpegExport(selectedKeys);
}
} finally {
exportState.isProcessing = false;
setDownloadBusy(false);
}
});
setTimeout(function () {
discoverSections();
initializeSectionCheckboxes();
syncSelectAllText();
}, 1500);
});
</script>
<div class="content" id="ncrCapture">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-bar-chart"></i> NCR Status Summary</h3>
</div>
<div class="block-content">
<!-- Export Controls -->
<div class="row mb-3 ncr-export-controls">
<div class="col-12">
<div style="display:flex;gap:10px;align-items:center;flex-wrap:wrap;justify-content:flex-end;">
<button type="button" class="btn btn-success" id="btnExportExcelNcr" style="min-width:160px;font-weight:600;">
<i class="fa fa-file-excel"></i> Export to Excel
</button>
<button type="button" class="btn btn-warning" id="btnExportJpegNcr" style="min-width:160px;font-weight:600;">
<i class="fa fa-file-image"></i> Export to JPEG
</button>
</div>
</div>
</div>
<!-- Selection Panel -->
<div id="ncrExportActions" class="row mb-3 d-none ncr-export-controls">
<div class="col-12">
<div style="display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;">
<strong>Select sections to export:</strong>
<div style="display:flex;gap:10px;">
<button type="button" class="btn btn-sm btn-outline-secondary" id="ncrSelectAll">Select All</button>
<button type="button" class="btn btn-primary" id="ncrDownloadSelected">Download Excel</button>
<button type="button" class="btn btn-sm btn-outline-danger" id="ncrCancelSelection">Cancel</button>
</div>
</div>
</div>
</div>
<!-- TOTAL NCR TABLE & CHART -->
<div class="row mb-5">
<div class="col-12">
<div class="block block-themed block-rounded ncr-section-block" id="totalNcrBlock">
<div class="block-header bg-earth-dark">
<h3 class="block-title">TOTAL NCR</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="total-ncr-table">
<thead class="thead-dark">
<tr>
<th>NCR TYPE</th>
<th>TOTAL NCR</th>
<th>OPEN</th>
<th>With Comments</th>
<th>CLOSED</th>
<th>CLOSURE RATE</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col-md-5 d-flex align-items-center justify-content-center">
<div id="total-ncr-donut" style="width:100%;height:350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- AUDIT NCR TABLE & CHART -->
<div class="row mb-5">
<div class="col-12">
<div class="block block-themed block-rounded ncr-section-block" id="auditNcrBlock">
<div class="block-header bg-earth-dark">
<h3 class="block-title">AUDIT NCR</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="audit-ncr-table">
<thead class="thead-dark">
<tr>
<th>RESPONSIBLE</th>
<th>TOTAL QTY</th>
<th>OPEN</th>
<th>With Comments</th>
<th>CLOSED</th>
<th>CLOSURE RATE</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col-md-5 d-flex align-items-center justify-content-center">
<div id="audit-ncr-donut" style="width:100%;height:350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- INTERNAL NCR TABLE & CHART -->
<div class="row mb-5">
<div class="col-12">
<div class="block block-themed block-rounded ncr-section-block" id="internalNcrBlock">
<div class="block-header bg-earth-dark">
<h3 class="block-title">INTERNAL NCR by Company</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="internal-ncr-table">
<thead class="thead-dark">
<tr>
<th>COMPANY</th>
<th>TOTAL NCR</th>
<th>OPEN</th>
<th>With Comments</th>
<th>CLOSED</th>
<th>CLOSURE RATE</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col-md-5 d-flex align-items-center justify-content-center">
<div id="internal-ncr-donut" style="width:100%;height:350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- EXTERNAL NCR TABLE & CHART -->
<div class="row mb-5">
<div class="col-12">
<div class="block block-themed block-rounded ncr-section-block" id="externalNcrBlock">
<div class="block-header bg-earth-dark">
<h3 class="block-title">EXTERNAL NCR (SDR) by Company</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="external-ncr-table">
<thead class="thead-dark">
<tr>
<th>COMPANY</th>
<th>TOTAL NCR</th>
<th>OPEN</th>
<th>CLOSED</th>
<th>CLOSURE RATE</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col-md-5 d-flex align-items-center justify-content-center">
<div id="external-ncr-donut" style="width:100%;height:350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- IMPROVEMENT NOTES TABLE & CHART -->
<div class="row mb-5">
<div class="col-12">
<div class="block block-themed block-rounded ncr-section-block" id="improvementNcrBlock">
<div class="block-header bg-earth-dark">
<h3 class="block-title">IMPROVEMENT NOTES</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-7">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="improvement-notes-table">
<thead class="thead-dark">
<tr>
<th>RESPONSIBLE</th>
<th>TOTAL QTY</th>
<th>OPEN</th>
<th>With Comments</th>
<th>CLOSED</th>
<th>CLOSURE RATE</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="col-md-5 d-flex align-items-center justify-content-center">
<div id="improvement-notes-donut" style="width:100%;height:350px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
// Yardımcı fonksiyonlar
function closureRate(closed, total) {
if (!total || total == 0) return '0.00%';
return (closed / total * 100).toFixed(2) + '%';
}
function drawDonutChart(target, value, label) {
$(target).dxPieChart({
dataSource: [
{ label: label, value: value },
{ label: 'Other', value: 100 - value }
],
type: 'doughnut',
palette: 'Soft Pastel',
legend: { visible: false },
series: [{
argumentField: 'label',
valueField: 'value',
label: {
visible: true,
format: 'percent',
customizeText: function(arg) {
if(arg.argument === label) return arg.valueText;
return '';
}
}
}],
centerTemplate: function(pieChart, container) {
var percent = value.toFixed(2) + '%';
container.append('<div style="font-size:2em;text-align:center;width:100%;margin-top:40%;">'+percent+'</div>');
}
});
}
// Ana veri çekme ve işleme
$.getJSON("{{url('admin-ajax/ncr-status')}}", function(data) {
// 1. TOTAL NCR (by type)
var ncrTypes = ['CLIENT','INTERNAL','AUDIT','IMPROVEMENT'];
var totalRows = [];
var totalSum = { type: 'TOTAL', total: 0, open: 0, comments: 0, closed: 0 };
ncrTypes.forEach(function(type) {
var filtered = data.filter(x => (x.type||'').toUpperCase() === type);
var total = filtered.length;
var open = filtered.filter(x => (x.current_status||'').toUpperCase() === 'OPEN').length;
var comments = filtered.filter(x => (x.current_status||'').toUpperCase() === 'WITH COMMENTS').length;
var closed = filtered.filter(x => (x.current_status||'').toUpperCase() === 'CLOSED').length;
totalRows.push({
type: type,
total: total,
open: open,
comments: comments,
closed: closed,
rate: closureRate(closed, total)
});
totalSum.total += total;
totalSum.open += open;
totalSum.comments += comments;
totalSum.closed += closed;
});
totalSum.rate = closureRate(totalSum.closed, totalSum.total);
totalRows.push(totalSum);
var $tbody = $('#total-ncr-table tbody').empty();
totalRows.forEach(function(row) {
$tbody.append('<tr>'
+'<td><b>'+row.type+'</b></td>'
+'<td>'+row.total+'</td>'
+'<td>'+row.open+'</td>'
+'<td>'+row.comments+'</td>'
+'<td>'+row.closed+'</td>'
+'<td><b>'+row.rate+'</b></td>'
+'</tr>');
});
drawDonutChart('#total-ncr-donut', parseFloat(totalSum.rate), 'Closure Rate');
// 2. AUDIT NCR (by responsible)
var auditRows = [];
var auditFiltered = data.filter(x => (x.type||'').toUpperCase() === 'AUDIT');
var auditGroup = {};
auditFiltered.forEach(function(x){
var key = x.responsible || '-';
if(!auditGroup[key]) auditGroup[key] = { responsible: key, total: 0, open: 0, comments: 0, closed: 0 };
auditGroup[key].total++;
if((x.current_status||'').toUpperCase() === 'OPEN') auditGroup[key].open++;
if((x.current_status||'').toUpperCase() === 'WITH COMMENTS') auditGroup[key].comments++;
if((x.current_status||'').toUpperCase() === 'CLOSED') auditGroup[key].closed++;
});
var auditSum = { responsible: 'TOTAL', total: 0, open: 0, comments: 0, closed: 0 };
Object.values(auditGroup).forEach(function(row){
row.rate = closureRate(row.closed, row.total);
auditSum.total += row.total;
auditSum.open += row.open;
auditSum.comments += row.comments;
auditSum.closed += row.closed;
auditRows.push(row);
});
auditSum.rate = closureRate(auditSum.closed, auditSum.total);
auditRows.push(auditSum);
var $tbody2 = $('#audit-ncr-table tbody').empty();
auditRows.forEach(function(row) {
$tbody2.append('<tr>'
+'<td>'+row.responsible+'</td>'
+'<td>'+row.total+'</td>'
+'<td>'+row.open+'</td>'
+'<td>'+row.comments+'</td>'
+'<td>'+row.closed+'</td>'
+'<td><b>'+row.rate+'</b></td>'
+'</tr>');
});
drawDonutChart('#audit-ncr-donut', parseFloat(auditSum.rate), 'Closure Rate');
// 3. INTERNAL NCR by Company
var internalRows = [];
var internalFiltered = data.filter(x => (x.type||'').toUpperCase() === 'INTERNAL');
var internalGroup = {};
internalFiltered.forEach(function(x){
var key = x.subcontractor || '-';
if(!internalGroup[key]) internalGroup[key] = { company: key, total: 0, open: 0, comments: 0, closed: 0 };
internalGroup[key].total++;
if((x.current_status||'').toUpperCase() === 'OPEN') internalGroup[key].open++;
if((x.current_status||'').toUpperCase() === 'WITH COMMENTS') internalGroup[key].comments++;
if((x.current_status||'').toUpperCase() === 'CLOSED') internalGroup[key].closed++;
});
var internalSum = { company: 'TOTAL', total: 0, open: 0, comments: 0, closed: 0 };
Object.values(internalGroup).forEach(function(row){
row.rate = closureRate(row.closed, row.total);
internalSum.total += row.total;
internalSum.open += row.open;
internalSum.comments += row.comments;
internalSum.closed += row.closed;
internalRows.push(row);
});
internalSum.rate = closureRate(internalSum.closed, internalSum.total);
internalRows.push(internalSum);
var $tbody3 = $('#internal-ncr-table tbody').empty();
internalRows.forEach(function(row) {
$tbody3.append('<tr>'
+'<td>'+row.company+'</td>'
+'<td>'+row.total+'</td>'
+'<td>'+row.open+'</td>'
+'<td>'+row.comments+'</td>'
+'<td>'+row.closed+'</td>'
+'<td><b>'+row.rate+'</b></td>'
+'</tr>');
});
drawDonutChart('#internal-ncr-donut', parseFloat(internalSum.rate), 'Closure Rate');
// 4. EXTERNAL NCR (SDR) by Company
var externalRows = [];
var externalFiltered = data.filter(x => (x.type||'').toUpperCase() === 'CLIENT');
var externalGroup = {};
externalFiltered.forEach(function(x){
var key = x.subcontractor || '-';
if(!externalGroup[key]) externalGroup[key] = { company: key, total: 0, open: 0, closed: 0 };
externalGroup[key].total++;
if((x.current_status||'').toUpperCase() === 'OPEN') externalGroup[key].open++;
if((x.current_status||'').toUpperCase() === 'CLOSED') externalGroup[key].closed++;
});
var externalSum = { company: 'TOTAL', total: 0, open: 0, closed: 0 };
Object.values(externalGroup).forEach(function(row){
row.rate = closureRate(row.closed, row.total);
externalSum.total += row.total;
externalSum.open += row.open;
externalSum.closed += row.closed;
externalRows.push(row);
});
externalSum.rate = closureRate(externalSum.closed, externalSum.total);
externalRows.push(externalSum);
var $tbody4 = $('#external-ncr-table tbody').empty();
externalRows.forEach(function(row) {
$tbody4.append('<tr>'
+'<td>'+row.company+'</td>'
+'<td>'+row.total+'</td>'
+'<td>'+row.open+'</td>'
+'<td>'+row.closed+'</td>'
+'<td><b>'+row.rate+'</b></td>'
+'</tr>');
});
drawDonutChart('#external-ncr-donut', parseFloat(externalSum.rate), 'Closure Rate');
// 5. IMPROVEMENT NOTES (by responsible)
var improvementRows = [];
var improvementFiltered = data.filter(x => (x.type||'').toUpperCase() === 'IMPROVEMENT');
var improvementGroup = {};
improvementFiltered.forEach(function(x){
var key = x.responsible || '-';
if(!improvementGroup[key]) improvementGroup[key] = { responsible: key, total: 0, open: 0, comments: 0, closed: 0 };
improvementGroup[key].total++;
if((x.current_status||'').toUpperCase() === 'OPEN') improvementGroup[key].open++;
if((x.current_status||'').toUpperCase() === 'WITH COMMENTS') improvementGroup[key].comments++;
if((x.current_status||'').toUpperCase() === 'CLOSED') improvementGroup[key].closed++;
});
var improvementSum = { responsible: 'TOTAL', total: 0, open: 0, comments: 0, closed: 0 };
Object.values(improvementGroup).forEach(function(row){
row.rate = closureRate(row.closed, row.total);
improvementSum.total += row.total;
improvementSum.open += row.open;
improvementSum.comments += row.comments;
improvementSum.closed += row.closed;
improvementRows.push(row);
});
improvementSum.rate = closureRate(improvementSum.closed, improvementSum.total);
improvementRows.push(improvementSum);
var $tbody5 = $('#improvement-notes-table tbody').empty();
improvementRows.forEach(function(row) {
$tbody5.append('<tr>'
+'<td>'+row.responsible+'</td>'
+'<td>'+row.total+'</td>'
+'<td>'+row.open+'</td>'
+'<td>'+row.comments+'</td>'
+'<td>'+row.closed+'</td>'
+'<td><b>'+row.rate+'</b></td>'
+'</tr>');
});
drawDonutChart('#improvement-notes-donut', parseFloat(improvementSum.rate), 'Closure Rate');
});
});
</script>
@@ -1,347 +0,0 @@
<?php
use App\Models\NdeMatrix;
$title = "NDE Matrix";
$tableWidth="300%";
$path = "admin.type.line-list";
$tableName = "nde_matrices";
$tableType = "classic-table";
$showMechanicalNdtPlaceholder = true;
$mechanicalNdtFields = [
'ndt','ndt_percent','rt','rt_scope','ut','ut_scope','mt','mt_scope',
'pt','pt_scope','pmi','pmi_scope','ht','ht_scope','pwht','pwht_field','fn','ferrite_scope'
];
$jointTypes = db("joint_types")->get();
$relationDatas = [
'type_of_joint' => [
'datas' => $jointTypes,
'pattern' => '{short_name_en}',
'type' => 'select-dropdown'
],
/*
'group_no' => [
'values' => range(1,100),
'type' => 'manuel-select'
],
*/
'pwht_field' => [
'values' => ['YES', 'NO'],
'type' => 'manuel-select',
// 'default' => 'NO',
],
/*
'line' => [
'type' => 'auto-complete',
'table' => 'line_lists',
'column' => 'line_no',
'affected' => [
'rev' => '{iso_rev}',
'component_code' => '{no1_element_code}',
'piping_class' => '{category} + {fluid_group}',
'description_en' => '{member_no_1}',
'description_ru' => '{member_no_2}',
'dia_inch_1' => '{nps}',
'odmm_1' => '{outside_diameter_mm}',
'schedule_1' => '{thickness_by_asme}',
'thicknessmm_1' => '{wall_thickness_mm}',
],
],
*/
];
//$recordedDatas = recorded_data($tableName);
$tableDifferentValues = table_different_values($tableName);
$topButtons = [];
$ndeMatrixCol = table_columns($tableName);
$lineListCol = table_columns("line_lists");
/*
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From Line List")
];
*/
//dump(implode("', '", $ndeMatrixCol));
//dump($lineListCol);
$blockGroup = [
'General Information' => [
'project',
'group_no',
'design_area',
],
'Line Info' => [
'fluid',
'line',
'line_spec',
'pipe_material_class',
'material',
'operation_temp',
'operations_pressure_kg',
'type_of_joint',
'pwht',
'pwht_field',
'tracing',
'tracing_type',
'naks_technology',
'control_standart',
],
'NDT' => [
'ndt',
],
'Piping Class' => ['piping_class_according_to_gost', 'piping_group'],
'RT' => ['rt'],
'UT' => ['ut'],
'MT' => ['mt'],
'PT' => ['pt'],
'Phased Array' => ['phased_array'],
'PT Procedure Approved' => ['pt_procedure_approved'],
'HT' => ['ht'],
'PMI' => ['pmi'],
'FN' => ['fn'],
'Rev' => ['rev'],
];
?>
<script>
$(function(){
});
</script>
<div class="content">
<div class="col-12">
<?php
//$typeOfJoint = db("joint_types")->pluck("short_name_en")->toArray();
// dump($typeOfJoint);
if(getisset("sync")) {
$weldlogs = apply_welded_filter(db("weld_logs"))->get();
$specJointTypes = [];
foreach($weldlogs AS $weldlog) {
if(!isset($specJointTypes[$weldlog->line_number]))
$specJointTypes[$weldlog->line_number] = [];
if(!in_array($weldlog->type_of_welds, $specJointTypes[$weldlog->line_number]))
$specJointTypes[$weldlog->line_number][] = $weldlog->type_of_welds;
}
$cachePrefix = 'nde_matrix_sync_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$lineLists = db("line_lists")
->where("id",">", $lastId)
->take(2000)
->get();
$count = 0;
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
$added = [];
if(Cache::has($cachePrefix.'_added')) {
$added = Cache::get($cachePrefix.'_added');
}
foreach($lineLists AS $lineList) {
if(isset($specJointTypes[$lineList->line_no])) {
$typeOfJoint = $specJointTypes[$lineList->line_no];
foreach($typeOfJoint AS $jointItem) {
$data = [
// 'group_no' => '',
'design_area' => $lineList->unit,
'fluid' => $lineList->fluid_code,
'line' => $lineList->line_no,
'line_spec' => $lineList->line_specification,
// 'material' => '',
'operation_temp' => $lineList->working_temperature,
'operations_pressure_kg' => $lineList->working_pressure_mpa,
'type_of_joint' => $jointItem,
'pwht' => $lineList->pwht,
// 'ht' => '',
'ndt' => $lineList->ndt,
'piping_class_according_to_gost' => $lineList->category,
'piping_group' => $lineList->fluid_group,
/* 'rt' => '',
'ut' => '',
'mt' => '',
'pt' => '',
'phased_array' => '',
'pt_procedure_approved' => '',
'pmi' => '',
'fn' => '',
*/
'rev' => $lineList->rev
];
NdeMatrix::firstOrCreate($data);
}
Cache::put($cachePrefix, $lineList->id);
Cache::put($cachePrefix.'_added', $added);
}
$count++;
}
bilgi(":count Data has been sync from Line List",
"success",
['count' => $count]
);
}
$listDatas = NdeMatrix::orderBy("id","DESC");
if(getisset("filter")) {
$get = $_GET;
unset($get['filter']);
unset($get['page']);
$listDatas = $listDatas->where(function($query) use($get) {
foreach($get AS $column => $values) {
$query->whereIn($column, $values);
}
});
}
$listDatas = $listDatas->paginate(setting('row_count'));
$tableType = "datagrid";
?>
</div>
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
<script>
var clicked = [];
const numberFields = ['ndt', 'rt', 'ht', 'ut', 'mt', 'pt', 'phased_array'];
function editorPreparing(e, dataRow) {
// console.log("nde editor preparing");
// console.log(e);
var readOnly = [
'design_area',
'fluid',
'line',
'line_spec',
'operation_temp',
'operations_pressure_kg',
'pwht',
'ndt',
'piping_class_according_to_gost',
'piping_group',
'rev',
'tracing',
'tracing_type',
'naks_technology',
];
if(e.dataField == "group_no") {
// e.editorOptions.mask = "00";
// e.editorOptions.useMaskBehavior = true;
}
if(readOnly.includes(e.dataField)) {
e.editorOptions.readOnly = true;
}
if(numberFields.includes(e.dataField)) {
console.log(e.dataField + " number");
e.validationRules[0] = {
type: 'range',
min: 0,
max: 100,
message: 'Value should be between 0 and 100'
};
}
{{dxAutocomplete("line", "line_lists", "line_no")}}
}
function init(that) {
//alert(e);
var index = that.index();
var column = $(".data-tables").find("th:eq("+index+")");
var type = column.attr("data-type");
var name = column.attr("data-name");
var id = that.parent().find("td:eq(0)").text();
var relation = JSON.parse(column.attr("data-relation"));
/*
console.log(type);
console.log(name);
console.log(id);
console.log(column);
console.log(index);
console.log(relation);
*/
if(name=="type_of_joint") {
if(!clicked.includes(name+id)) {
/*
console.log("html");
var clone = $(".new-form .type_of_joint").clone(true, true);
clone.find("input").addClass("edit");
clone.find("input").attr("table", "nde_matrices");
clone.find("input").attr("id", id);
clone.find("input").val(that.html().trim());
clone.find(".dropdown-item").on("click", function() {
$.post("{{ url('admin-ajax/input-edit') }}",{
table : "nde_matrices",
key : "id",
value : $(this).html().trim(),
_token : "{{ csrf_token() }}",
id : id,
name : "type_of_joint"
},function(){
});
});
that.html(clone);
clicked.push(name+id);
*/
}
}
}
</script>
@@ -1,19 +0,0 @@
<style>
</style>
<div class="content">
<div class="row">
{{col("col-12","Welder & Line")}}
@include("admin.type.inc.ndt-calculation")
{{_col()}}
@include("admin.type.inc.ndt-calculation-tp")
</div>
</div>
@@ -1,186 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<?php $progress = Cache::get('ndt-clearance-report-progress'); ?>
<?php $queueId = rand(); ?>
<div class="border p-5 border-radius mb-10">
<p><strong></strong></p>
<div class="description{{$queueId}}">{{e2("Waiting...")}}</div>
<div id="progress-bar-{{$queueId}}" class="mb-10">
</div>
</div>
<?php
$documentInfo = document_template("NDT_Clearance_TP");
$path = "storage/documents/{$documentInfo->kid}";
$lineLists = glob("$path/*.pdf");
?>
<div class="row">
<div class="col-12 text-center">
<button class="generate-all btn btn-outline-success">Generate All Start</button>
<button class="pause-process btn btn-outline-info d-none">Generate All Pause</button>
<button class="stop-process btn btn-outline-danger d-none">Generate All Stop</button>
</div>
<div class="col-md-6">
New Generate Single
<div class="input-group">
<select name="" id="test_package_no" class="form-control select2">
<?php $testPackages = db("weld_logs")->groupBy("test_package_no")->select("test_package_no")->get()->pluck("test_package_no");
?>
@foreach($testPackages AS $testPackage)
@if(trim($testPackage) != "")
<option value="{{$testPackage}}">{{$testPackage}}</option>
@endif
@endforeach
</select>
<div class="btn btn-primary generate-one" type="pdf-ndt-clearance-report">{{e2("Generate Just One")}}</div>
</div>
</div>
<div class="col-md-6">
Generated Files
<div class="input-group">
<select name="wpq_document_no" id="line_no" required class="form-control select2">
<option value="">{{e2("Select File")}}</option>
<?php foreach($lineLists AS $lineList) {
$lineList = str_replace("$path/", "", $lineList);
$lineList2 = str_replace(".pdf", "", $lineList);
?>
<option value="{{$lineList}}">{{$lineList2}}</option>
<?php } ?>
</select>
<button class="btn btn-primary generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Show PDF")}}</button>
</div>
</div>
<div class="col-md-12">
<iframe name="show_pdf" id="show_pdf" style="width:100%;height:80vh;margin-top:10px" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(".generate-btn").on("click", function(){
$("#show_pdf").attr("src", "{{url("/")}}/{{$path}}/" + $('#line_no').val() + '?{{rand()}}');
});
$(".generate-one").on("click", function(){
Swal.fire('Process Started', $('#test_package_no').val());
$.get("{{url('cron-documents')}}?type=pdf-ndt-clearance-report&test_package_no=" + $('#test_package_no').val(), function(d) {
var fileName = d.split('/').pop();
$("#show_pdf").attr("src", "{{url("/")}}/{{$path}}/" + fileName);
Swal.fire('Generate Success', fileName);
});
});
let currentIndex = 0;
let totalOptions = $('#test_package_no option').length;
let isPaused = false;
let isStopped = false;
var progressBar{{$queueId}} = $("#progress-bar-{{$queueId}}").dxProgressBar({
min: 0,
max: 100,
value: 0
}).dxProgressBar("instance");
$(".generate-all").on("click", function () {
Swal.fire('Generate All Started');
isPaused = false;
isStopped = false;
$(this).addClass("d-none");
$(".pause-process").removeClass("d-none");
$(".stop-process").removeClass("d-none");
startProcessing();
});
$(".pause-process").on("click", function () {
Swal.fire('Process Pausing...');
$(".generate-all").removeClass("d-none");
$(this).addClass("d-none");
isPaused = true;
});
$(".stop-process").on("click", function () {
Swal.fire('Process Stopping...');
$(this).addClass("d-none");
$(".generate-all").removeClass("d-none");
$(".pause-process").addClass("d-none");
isStopped = true;
});
function processNext() {
if (currentIndex >= totalOptions || isStopped) {
Swal.fire('Process Stopped');
return;
}
if (isPaused) {
Swal.fire('Process Paused');
return;
}
let currentOptionValue = $('#test_package_no option').eq(currentIndex).val();
// Start the process and return a Promise
return new Promise((resolve, reject) => {
$.get("{{url('cron-documents')}}?type=pdf-ndt-clearance-report&test_package_no=" + currentOptionValue, function(d) {
var fileName = d.split('/').pop();
$("#show_pdf").attr("src", "{{url("/")}}/{{$path}}/" + fileName);
// Wait for the PDF to load in the iframe
$('#show_pdf').one('load', function() {
// Update progress bar
let newValue = Math.round(((currentIndex + 1) / totalOptions) * 100);
progressBar{{$queueId}}.option("value", newValue);
$(".description{{$queueId}}").html('(' + (currentIndex + 1) + '/' + totalOptions + ') Generating report for: ' + currentOptionValue);
currentIndex++;
resolve(); // Resolve the Promise when done
});
}).fail(function() {
reject(); // Reject the Promise on error
});
});
}
// Start processing
function startProcessing() {
// Loop through all options
(function processOptions() {
if (currentIndex < totalOptions && !isStopped) {
processNext().then(function() {
setTimeout(processOptions, 1000); // Wait before processing the next one
}).catch(function() {
Swal.fire('An error occurred while generating the report for: ' + $('#test_package_no option').eq(currentIndex).val());
// Optionally handle the error, e.g., by proceeding to the next index or stopping
currentIndex++;
processOptions();
});
}
})();
}
// Call startProcessing() to initiate the process
});
</script>
File diff suppressed because it is too large Load Diff
@@ -1,490 +0,0 @@
<div class="content">
<div class="row">
{{col("col-md-12 col-lg-12","Chart", 0, ['no-options' => false])}}
@include("admin.type.inc.ndt-calculation")
<style>
#ndtCalculation {
height:500px;
}
</style>
{{_col()}}
{{col("col-md-12 col-lg-12", "Order List", 0, ['no-options' => false])}}
<div id="order-list-datagrid"></div>
<script>
$(function(){
var editableColumns = [
'vt_request_date',
'test_laboratory_vt',
'pwht_request_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_request_date',
'test_laboratory_ut',
'ut_type',
'pt_request_date',
'test_laboratory_pt',
'mt_request_date',
'test_laboratory_mt',
'pmi_request_date',
'test_laboratory_pmi',
'spool_release_date',
];
var dataSource = new DevExpress.data.CustomStore({
key: "id",
load(loadOptions) {
const deferred = $.Deferred();
const args = {};
args['module'] = "{{$id}}";
$.ajax({
url: '?ajax=ndt-order.order-list',
dataType: 'json',
method: 'GET',
data: args,
success(result) {
deferred.resolve(result);
},
error(e) {
console.log("Data Loading Error");
console.log(e);
deferred.reject('{{e2("Data Loading Error")}}');
},
//timeout: 20000,
});
return deferred.promise();
},
update: function(key, values) {
var deferred = $.Deferred();
// console.log("val" + values);
$.ajax({
url: "{{url("admin/save-json/weld_logs" )}}",
method: "PUT",
data: {
'_token' : "{{ csrf_token() }}",
values : values,
key : key
}
})
.done(function(e) {
return deferred.promise();
})
.fail(function(e){
deferred.reject("{{e2("Update failed")}}");
});
}
});
var welderWdi = $("#order-list-datagrid").dxDataGrid({
dataSource: dataSource,
filterRow: { visible: true },
searchPanel: { visible: false },
groupPanel: { visible: true },
headerFilter: {
visible: true,
allowSearch: true,
},
@include("components.table.datagrid.partials.js-excel")
@include("components.table.datagrid.partials.js-right-menu")
summary: {
groupItems: [{
summaryType: "count"
}]
},
paging: {
pageSize: 20,
},
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: {
enabled: true
},
selection: {
mode: 'single',
deferred: true,
},
onToolbarPreparing: function(e) {
e.toolbarOptions.items.unshift({
location: "before",
widget: "dxButton",
options: {
icon: 'filter',
text: '{{e2("Clear Filter")}}',
onClick: function() {
e.component.clearFilter();
}
}
});
},
editing: {
<?php if(isAuth($id, "modify")) { ?>
allowUpdating: true,
<?php } ?>
startEditAction: 'dblClick',
refreshMode: 'repaint',
mode: 'batch', // 'batch' | 'cell' | 'form' | 'popup',
},
columns: [
{
caption: "General Information",
headerCellTemplate: function(container) {
container.parent().addClass("table-secondary text-center");
container.html("General Information");
},
columns: [
{ dataField: "test_package_no", caption: "Test Package No" },
{ dataField: "line_number", caption: "Line Number" },
{ dataField: "iso_number", caption: "ISO Number" },
{ dataField: "project", caption: "Project" },
{ dataField: "design_area", caption: "Design Area" },
{ dataField: "spool_number", caption: "Spool Number" }
]
},
{
caption: "Welding Information",
headerCellTemplate: function(container) {
container.parent().addClass("table-primary text-center");
container.html("Welding Information");
},
columns: [
{ dataField: "welding_date", caption: "Welding Date", dataType: "date", format: "dd/MM/yyyy" },
{ dataField: "quantity_of_iso", caption: "Quantity of ISO" },
{ dataField: "no_of_the_joint_as_per_as_built_survey", caption: "Joint No" },
{ dataField: "type_of_joint", caption: "Type of Joint" },
{ dataField: "pwht", caption: "PWHT" },
{ dataField: "service_category", caption: "Service Category" },
{ dataField: "fluid_group", caption: "Fluid Group" },
{ dataField: "ste_subcontractor", caption: "STE Subcontractor" },
{ dataField: "type_of_welds", caption: "Type of Welds" },
{ dataField: "welder_1", caption: "Welder 1" },
{ dataField: "welder_2", caption: "Welder 2" }
]
},
{
caption: "Member Information",
headerCellTemplate: function(container) {
container.parent().addClass("table-info text-center");
container.html("Member Information");
},
columns: [
{ dataField: "member_no_1", caption: "Member No 1" },
{ dataField: "nps_1", caption: "NPS 1" },
{ dataField: "outside_diameter_1", caption: "Outside Diameter 1" },
{ dataField: "wall_thickness_1", caption: "Wall Thickness 1" },
{ dataField: "member_no_2", caption: "Member No 2" },
{ dataField: "nps_2", caption: "NPS 2" },
{ dataField: "outside_diameter_2", caption: "Outside Diameter 2" },
{ dataField: "wall_thickness_2", caption: "Wall Thickness 2" }
]
},
{
caption: "Test Laboratories",
headerCellTemplate: function(container) {
container.parent().addClass("table-dark text-center");
container.html("Test Laboratories");
},
columns: [
{
caption: "VT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-success text-center");
container.html("VT Laboratory");
},
columns: [
{ dataField: "test_laboratory_vt", caption: "Test Laboratory VT" },
{ dataField: "vt_request_date", caption: "VT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "PWHT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-info text-center");
container.html("PWHT Laboratory");
},
columns: [
{ dataField: "test_laboratory_pwht", caption: "Test Laboratory PWHT" },
{ dataField: "pwht_request_date", caption: "PWHT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "HT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-warning text-center");
container.html("HT Laboratory");
},
columns: [
{ dataField: "test_laboratory_ht", caption: "Test Laboratory HT" },
{ dataField: "ht_request_date", caption: "HT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "RT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-danger text-center");
container.html("RT Laboratory");
},
columns: [
{ dataField: "test_laboratory_rt", caption: "Test Laboratory RT" },
{ dataField: "rt_request_date", caption: "RT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "UT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-primary text-center");
container.html("UT Laboratory");
},
columns: [
{ dataField: "test_laboratory_ut", caption: "Test Laboratory UT" },
{ dataField: "ut_request_date", caption: "UT Request Date", dataType: "date", format: "dd/MM/yyyy" },
{ dataField: "ut_type", caption: "UT Type" }
]
},
{
caption: "PT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-secondary text-center");
container.html("PT Laboratory");
},
columns: [
{ dataField: "test_laboratory_pt", caption: "Test Laboratory PT" },
{ dataField: "pt_request_date", caption: "PT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "MT Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-light text-center");
container.html("MT Laboratory");
},
columns: [
{ dataField: "test_laboratory_mt", caption: "Test Laboratory MT" },
{ dataField: "mt_request_date", caption: "MT Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
},
{
caption: "PMI Laboratory",
headerCellTemplate: function(container) {
container.parent().addClass("table-dark text-center");
container.html("PMI Laboratory");
},
columns: [
{ dataField: "test_laboratory_pmi", caption: "Test Laboratory PMI" },
{ dataField: "pmi_request_date", caption: "PMI Request Date", dataType: "date", format: "dd/MM/yyyy" }
]
}
]
}
],
onRowValidating: function(e) {
var data = $.extend({}, e.oldData, e.newData);
var parseDate = function(d) {
if(!d) return null;
var date;
if(d instanceof Date) {
date = new Date(d);
} else if(typeof d === 'string' && d.match(/^\d{2}\/\d{2}\/\d{4}$/)) {
var p = d.split('/');
date = new Date(p[2], p[1]-1, p[0]);
} else {
date = new Date(d);
}
date.setHours(0,0,0,0);
return date;
};
var weldDate = parseDate(data.welding_date);
var getStageDate = function(fields) {
var maxDate = null;
fields.forEach(function(f) {
if(data[f]) {
var d = parseDate(data[f]);
if(!maxDate || d > maxDate) maxDate = d;
}
});
return maxDate;
};
var dates = {
vt: getStageDate(['vt_request_date', 'vt_test_date']),
pmi: getStageDate(['pmi_request_date', 'pmi_test_date']),
pt_mt: getStageDate(['pt_request_date', 'pt_test_date', 'mt_request_date', 'mt_test_date']),
ut_rt: getStageDate(['ut_request_date', 'ut_test_date', 'rt_request_date', 'rt_test_date']),
pwht: getStageDate(['pwht_request_date', 'pwht_test_date']),
ht: getStageDate(['ht_request_date', 'ht_test_date'])
};
var check = function(current, min, msg) {
if(current && min && current < min) {
e.isValid = false;
e.errorText = msg;
Swal.fire('', msg, 'error');
return false;
}
return true;
};
if(!check(dates.vt, weldDate, "VT date cannot be before Welding date")) return;
if(!check(dates.pmi, dates.vt || weldDate, "PMI date cannot be before VT/Welding date")) return;
if(!check(dates.pt_mt, dates.ht || dates.pwht || dates.vt || weldDate, "PT/MT date cannot be before HT/PWHT/VT/Welding date")) return;
if(!check(dates.ut_rt, dates.pt_mt || dates.ht || dates.pwht || dates.vt || weldDate, "UT/RT date cannot be before PT/MT/HT/PWHT/Previous NDT steps")) return;
if(!check(dates.pwht, dates.vt || weldDate, "PWHT date cannot be before VT/Welding date")) return;
if(!check(dates.ht, dates.pwht || dates.vt || weldDate, "HT date cannot be before PWHT/VT/Welding date")) return;
},
onEditorPreparing(e) {
if(e.parentType == "dataRow") {
// NDT Order Date Logic
var row = e.row.data;
var parseDate = function(d) {
if(!d) return null;
var date;
if(d instanceof Date) {
date = new Date(d);
} else if(typeof d === 'string' && d.match(/^\d{2}\/\d{2}\/\d{4}$/)) {
var p = d.split('/');
date = new Date(p[2], p[1]-1, p[0]);
} else {
date = new Date(d);
}
date.setHours(0,0,0,0);
return date;
};
var weldDate = parseDate(row.welding_date);
var getStageDate = function(fields) {
var maxDate = null;
fields.forEach(function(f) {
if(row[f]) {
var d = parseDate(row[f]);
if(!maxDate || d > maxDate) maxDate = d;
}
});
return maxDate;
};
var dates = {
vt: getStageDate(['vt_request_date', 'vt_test_date']),
pmi: getStageDate(['pmi_request_date', 'pmi_test_date']),
pt_mt: getStageDate(['pt_request_date', 'pt_test_date', 'mt_request_date', 'mt_test_date']),
ut_rt: getStageDate(['ut_request_date', 'ut_test_date', 'rt_request_date', 'rt_test_date']),
pwht: getStageDate(['pwht_request_date', 'pwht_test_date']),
ht: getStageDate(['ht_request_date', 'ht_test_date'])
};
var minDate = null;
// weld_date <<< VT
if (['vt_request_date', 'vt_test_date'].includes(e.dataField)) {
minDate = weldDate;
}
// VT < PMI
else if (['pmi_request_date', 'pmi_test_date'].includes(e.dataField)) {
minDate = dates.vt || weldDate;
}
// PMI < PT, MT
else if (['pt_request_date', 'pt_test_date', 'mt_request_date', 'mt_test_date'].includes(e.dataField)) {
minDate = dates.ht || dates.pwht || dates.vt || weldDate;
}
// PT, MT < UT, RT
else if (['ut_request_date', 'ut_test_date', 'rt_request_date', 'rt_test_date'].includes(e.dataField)) {
minDate = dates.pt_mt || dates.ht || dates.pwht || dates.vt || weldDate;
}
// VT < PWHT
else if (['pwht_request_date', 'pwht_test_date'].includes(e.dataField)) {
minDate = dates.vt || weldDate;
}
// PWHT < HT
else if (['ht_request_date', 'ht_test_date'].includes(e.dataField)) {
minDate = dates.pwht || dates.vt || weldDate;
}
if (minDate) {
if(e.editorOptions) {
e.editorOptions.min = minDate;
}
e.validationRules = e.validationRules || [];
e.validationRules = e.validationRules.filter(function(r) { return r.type !== 'range'; });
e.validationRules.push({
type: "range",
min: minDate,
message: "Date must be after " + minDate.toLocaleDateString()
});
}
e.editorOptions.readOnly = true;
if(e.dataField.indexOf("test_laboratory") != -1) {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.acceptCustomValue = false;
e.editorOptions.readOnly = false;
e.editorOptions.dataSource = '{{autocomplete_type("ndt-order*subcontractor")}}?row=' + JSON.stringify(e.row.data);
}
if(e.dataType == "date") {
e.editorName = 'dxDateBox';
e.displayFormat = 'dd/MM/yyyy';
e.dataType = 'date';
e.editorOptions.format = 'dd/MM/yyyy';
e.editorOptions.useMaskBehavior = true;
e.editorOptions.readOnly = false;
}
if(e.dataField == "welding_date") {
e.editorOptions.readOnly = true;
}
if(editableColumns.includes(e.dataField)) {
e.editorOptions.readOnly = false;
}
}
},
onRowClick: function(e) {
if(e.rowType === "data") {
// $("#ndtCalculation").dxDataGrid("instance").option('dataSource', '?ajax=ndt-calculation&all&iso_number=' + e.data.iso_number);
$("#ndtCalculation").dxDataGrid("instance").filter(["iso_number", "=", e.data.iso_number]);
}
}
});
/*
setTimeout(function() {
weldmap.dxDataGrid("instance").columnOption("welding_date", "dataType", "date");
}, 2000);
*/
});
</script>
{{_col()}}
</div>
</div>
@@ -1,546 +0,0 @@
<?php
$get = false;
$datas = db("weld_logs");
$progress = "Completed";
$progress_type = "success";
$isoNumberTitle = "";
$rowName = "orderList";
$tableName = "weld_logs";
$requiredFields = required_fields();
/*
if(!getesit("iso_number","")) {
$datas = $datas->where("iso_number", "like", "%" . trim(get("iso_number")) . "%");
$get = true;
}
*/
if(!getesit("welding_date_1","")) {
$datas = $datas->whereDate("welding_date", ">=", get("welding_date_1"));
$datas = $datas->whereDate("welding_date", "<=", get("welding_date_2"));
// $get = true;
}
if(getisset("filter")) {
$getData = $_GET;
unset($getData['welding_date_1']);
unset($getData['welding_date_2']);
unset($getData['filter']);
// unset($getData['iso_number']);
unset($getData['page']);
$datas = $datas->where(function($query) use($getData) {
foreach($getData AS $column => $values) {
// dd($get);
if(is_array($values)) {
$query->whereIn($column, $values);
} else {
if($values!="") {
$query->where($column, trim($values));
}
}
}
});
}
//dd($datas->toSql());
$naksWelders = db("naks_welders")->groupBy("welder_id")->whereNotNull("welder_id")->get();
$subContractors = db("subcontractors")->get();
if($get) {
$datas = $datas->get();
} else {
$datas = $datas->paginate(20);
}
//dd($datas);
$neverWeldingDate = true;
foreach($datas AS $data) {
if($data->welding_date == "0000-00-00" || $data->welding_date == "") {
$progress = "On Going";
$progress_type = "warning";
} else {
$neverWeldingDate = false;
}
}
if($neverWeldingDate) {
$progress = "Waiting";
$progress_type = "danger";
}
/*
$firstData = $datas[0];
if(!getesit("iso_number","")) {
$isoNumberTitle = "<div class='badge badge-danger'>LINE: {$firstData->iso_number}</div>";
}
*/
$tableDifferentValues = table_different_values($tableName);
$columns = [
'id',
'general_contractor',
'contractor',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'certificate_no',
'wpq_report',
'member_1',
'material_1',
'ru_material_group',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_s_20_std',
'outside_diameter_mm',
'wall_thickness_mm',
'1_element_code',
'member_2',
'material_2',
'ru_material_group2',
'certificate_number_of_2',
'heat_number_2',
'nps2',
'thickness_by_asme_s_20_std2',
'outsidediametermm',
'wallthickness_mm',
'2_element_code',
'ndt_percent',
'vt_request',
'vt_report',
'date_of_vt',
'test_laboratory_vt',
'vt_result',
'rt_scope',
'rt_request',
'rt_report',
'rt_test_date',
'test_laboratory_rt',
'rt_result',
'ut_scope',
'ut_request',
'ut_report',
'ut_test_date',
'test_laboratory_ut',
'ut_result',
'pt_scope',
'pt_request',
'pt_report',
'pt_test_date',
'test_laboratory_pt',
'pt_result',
'mt_scope',
'mt_request',
'mt_report',
'mt_test_date',
'test_laboratory_mt',
'mt_result',
'pmi_scope',
'pmi_request',
'no_of_testing_report',
'pmi_test_date',
'test_laboratory_pmi',
'pmi_result',
'pwht',
'pwht_date',
'of_pwht_report',
'diagram_number_pwht',
'test_laboratory_pwht',
'nt_scope',
'ht_request',
'no_of_ht_hardnes_test',
'ht_request_date',
'test_laboratory_ht',
'ht_result',
'ferrite_scope',
'ferrite_check_request',
'no_of_ferrite_check',
'date_of_ferrite_check',
'test_laboratory_ferrite',
'ferrite_result',
'test_package',
'test_pressure',
'type_of_test',
'date_test',
'test_result',
'real_welder_1',
'real_welder_2',
'ste_subcontructer'
];
/*
Spool number
No of the joint As per As Built survey
Type of joint
Type of welds
WPS
Welding materials 1
Welding materials 1
Lot No
Welding materials 1
Certificate No
Welding materials 2
Welding materials 2 Lot No
Welding materials 2
Certificate No
Welding materials 3
Welding materials 3 Lot No
Welding materials 3 Certificate No
Test Package
Remarks
NDT Release Date
Paint Status
Spool Weight
*/
$filterLists = [
'iso_number',
'project',
'design_area',
'spool_number',
'welding_date',
'quantity_of_iso',
'test_package_no',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'pwht',
'service_category',
'fluid_group',
'contractor',
'ste_subcontractor',
];
$orderList = [
'test_package_no',
'no_of_the_joint_as_per_as_built_survey',
'type_of_joint',
'type_of_welds',
'welding_date',
'spool_number',
'welder_1',
'welder_2',
'member_no_1',
'material_no_1',
'nps_1',
'outside_diameter_1',
'wall_thickness_1',
'member_no_2',
'material_no_2',
'nps_2',
'outside_diameter_2',
'wall_thickness_2',
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
];
if(getesit("iso_number","")) {
array_unshift($orderList, 'iso_number');
}
$editableColumns = [
'fit_up_date',
'welding_date',
'welder_1',
'welder_2',
'vt_request_date',
'test_laboratory_vt',
'pwht_date',
'test_laboratory_pwht',
'ht_request_date',
'test_laboratory_ht',
'rt_request_date',
'test_laboratory_rt',
'ut_test_date',
'test_laboratory_ut',
'ut_type',
'pt_test_date',
'test_laboratory_pt',
'mt_test_date',
'test_laboratory_mt',
'pmi_test_date',
'test_laboratory_pmi',
];
$textColumns = [
'iso_number',
'project',
];
$dateColumns = [
'fit_up_date',
'welding_date',
'vt_request_date',
'pwht_date',
'ht_request_date',
'rt_request_date',
'ut_test_date',
'pt_test_date',
'mt_test_date',
'pmi_test_date',
];
?>
<script>
$(function(){
});
</script>
<style>
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-md-12 col-lg-9", "Filter", 0, ['no-options' => false])}}
<form action="" method="get">
<input type="hidden" name="filter" value="ok">
<div class="row">
<?php foreach($filterLists AS $filterList) {
?>
<div class="col-md-3">
<div class="form-material">
<label >{{e2($filterList)}}</label>
<?php
if(in_array($filterList, $textColumns)) {
?>
<div class="input-group">
<input type="text" name="{{$filterList}}" value="{{get($filterList)}}" class="form-control" id="">
</div>
<?php
} else if(in_array($filterList, $dateColumns)) {
?>
<div class="input-group">
<input type="date" name="{{$filterList}}_1" value="{{get($filterList . "_1")}}" class="form-control" id="">
<input type="date" name="{{$filterList}}_2" value="{{get($filterList . "_2")}}" class="form-control" id="">
</div>
<?php
} else {
$selectedValue = [];
if(getisset($filterList)) {
$selectedValue = get($filterList);
}
?>
<select class="form-control select2" name="{{$filterList}}[]" multiple>
<option></option><!-- Empty value for demostrating material select box -->
<?php if(isset($tableDifferentValues[$filterList])) {
?>
<?php foreach($tableDifferentValues[$filterList] AS $value) {
?>
<option value="{{$value}}" {{in_array($value, $selectedValue) ? "selected" : ""}}>{{$value}}</option>
<?php } ?>
<?php } ?>
</select>
<?php } ?>
</div>
</div>
<?php
} ?>
<div class="col-md-12">
<div class="mt-10 text-center">
<button type="submit" class="btn btn-outline-primary">{{e2("Filter")}}</button>
</div>
</div>
</div>
</form>
{{_col()}}
{{col("col-md-12 col-lg-3","Chart", 0, ['no-options' => false])}}
<?php if(getisset("iso_number")) {
?>
@include("admin.type.inc.manage-calc")
<?php
} else {
?>
<div class="alert alert-info">{{e2("Please select drawing no")}}</div>
<?php
} ?>
{{_col()}}
<?php
$relationDatas['welder_1']['datas'] = $naksWelders;
$relationDatas['welder_2']['datas'] = $naksWelders;
$relationDatas['test_laboratory_pwht']['datas'] = $subContractors;
$relationDatas['welder_1']['pattern'] = "[{welder_id}] {welder_name_en}";
$relationDatas['welder_2']['pattern'] = "[{welder_id}] {welder_name_en}";
$relationDatas['test_laboratory_pwht']['pattern'] = "{company_name_en}";
$selectDropdowns = [
/*
'welder_1',
'welder_2',
*/
'test_laboratory_pwht',
];
?>
{{col("col-md-12","Order List")}}
{{$datas->appends($_GET)->links()}}
<div class="table-responsive">
<table id="orderList" class="table table-bordered table-sm table-striped table-hover" >
<thead>
<tr>
<?php foreach($orderList AS $column) { ?>
<th>{{e2($column)}}</th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php foreach($datas AS $data) {
?>
<tr>
<?php foreach($orderList AS $orderColumn) {
$inputType = "text";
?>
<td>
<?php
if(in_array($orderColumn, $selectDropdowns)) {
?>
<?php
$columnName = $orderColumn;
$column = [];
$column['name'] = $orderColumn;
$listData = $data;
?>
@include("components.columns.select-dropdown")
<?php
} else {
?>
<?php if(array_key_exists($orderColumn,(Array) $data)) { ?>
<?php if(in_array($orderColumn, $editableColumns)) {
if(in_array($orderColumn, $dateColumns)) $inputType = "date";
?>
<input type="text" class="edit form-control {{$inputType}}" table="weld_logs" data-id="{{$data->id}}" value="{{$data->$orderColumn}}" name="{{$orderColumn}}" id="">
<?php
} else {
?>
{{$data->$orderColumn}}
<?php } ?>
<?php } elseif(in_array($orderColumn, $editableColumns)) {
if(in_array($orderColumn, $dateColumns)) $inputType = "date";
?>
<!--
<input type="{{$inputType}}" name="" class=" form-control" id="">
-->
<?php
} ?>
<?php } ?>
</td>
<?php } ?>
</tr>
<?php
} ?>
</tbody>
</table>
</div>
{{$datas->appends($_GET)->links()}}
{{_col()}}
</div>
</div>
<script src="{{url("assets/admin/data-tables/fixed-header/js/dataTables.fixedHeader.min.js")}}"></script>
<script>
$(function() {
/*
$("#lineWeldDate").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollY: "310px",
scrollX: true,
responsive: true,
stateSave: true,
});
$("#jointByLineNo").DataTable({
fixedHeader: {
header: true,
footer: true
},
scrollX: true,
responsive: true,
stateSave: true,
});
*/
});
</script>
@@ -1,179 +0,0 @@
@extends('admin.master')
@section("title", "Filtered List - " . ($notification->title ?? 'Notification'))
@section('content')
<div class="content">
<div class="block block-rounded">
<div class="block-header block-header-default">
<h3 class="block-title">
<i class="fa fa-filter mr-2"></i>Filtered List
</h3>
<div class="block-options">
<a href="/admin/types/my-notifications" class="btn btn-sm btn-secondary">
<i class="fa fa-arrow-left"></i> Back to Notifications
</a>
</div>
</div>
<div class="block-content">
<!-- Notification Info -->
<div class="alert alert-info mb-4">
<h5 class="alert-heading">
<i class="fa fa-bell mr-2"></i>{{ $notification->title }}
</h5>
<p class="mb-2">{{ $notification->message }}</p>
</div>
<!-- Filtered Data Table -->
<div id="filteredDataContainer">
<div class="text-center py-5">
<i class="fa fa-spinner fa-spin fa-3x text-muted"></i>
<p class="mt-3">Loading filtered data...</p>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var notificationId = {{ $notification->id }};
// Get filtered data
$.ajax({
url: '/admin/notifications/get-filtered-data',
method: 'GET',
data: { id: notificationId },
success: function(response) {
if (response.success && response.data && response.data.length > 0) {
// Create DataGrid
var dataGridHtml = '<div id="filteredDataGrid"></div>';
$('#filteredDataContainer').html(dataGridHtml);
// Initialize DevExtreme DataGrid
$("#filteredDataGrid").dxDataGrid({
dataSource: response.data,
keyExpr: "id",
allowColumnResizing: true,
allowColumnReordering: true,
showBorders: true,
showRowLines: true,
rowAlternationEnabled: true,
filterRow: {
visible: true
},
searchPanel: {
visible: true,
width: 240,
placeholder: "Search..."
},
headerFilter: {
visible: true
},
paging: {
pageSize: 20
},
pager: {
showPageSizeSelector: true,
allowedPageSizes: [10, 20, 50, 100],
showInfo: true,
infoText: "Page {0} of {1} ({2} items)"
},
columnAutoWidth: true,
columnResizingMode: 'widget',
editing: {
mode: "popup",
allowUpdating: true,
allowAdding: false,
allowDeleting: false,
popup: {
title: "Edit Record",
showTitle: true,
width: 700,
height: 525
},
form: {
items: response.columns.map(function(col) {
return {
dataField: col,
colSpan: 1
};
})
}
},
columns: response.columns.map(function(col) {
var column = {
dataField: col,
caption: col.replace(/_/g, ' ').replace(/\b\w/g, function(l) { return l.toUpperCase(); })
};
// Set data type for date columns
if (col.includes('date') || col.includes('_at')) {
column.dataType = 'date';
column.format = 'yyyy-MM-dd';
}
// Set data type for numeric columns
if (col.includes('id') || col.includes('no') || col.includes('number')) {
column.dataType = 'number';
}
return column;
}),
onRowUpdating: function(e) {
// Update data via AdminController
var updateData = {};
response.columns.forEach(function(col) {
if (e.newData[col] !== undefined) {
updateData[col] = e.newData[col];
}
});
$.ajax({
url: '/admin/save-json/' + response.tableName,
method: 'PUT',
data: {
data: JSON.stringify([{
id: e.key,
...updateData
}]),
_token: '{{ csrf_token() }}'
},
success: function(result) {
if (result.success) {
DevExpress.ui.notify("Record updated successfully", "success", 2000);
} else {
DevExpress.ui.notify("Error updating record", "error", 2000);
e.cancel = true;
}
},
error: function() {
DevExpress.ui.notify("Error updating record", "error", 2000);
e.cancel = true;
}
});
}
});
} else {
$('#filteredDataContainer').html(
'<div class="text-center py-5">' +
'<i class="fa fa-info-circle fa-3x text-muted"></i>' +
'<p class="mt-3">No items found matching the criteria.</p>' +
'</div>'
);
}
},
error: function(xhr) {
var errorMsg = 'Error loading filtered data.';
if (xhr.responseJSON && xhr.responseJSON.error) {
errorMsg = xhr.responseJSON.error;
}
$('#filteredDataContainer').html(
'<div class="alert alert-danger">' + errorMsg + '</div>'
);
}
});
});
</script>
@endsection
@@ -1,313 +0,0 @@
@extends('admin.master')
@section("title", "Notification Logs")
@section('content')
<div class="content">
<div class="block block-rounded">
<div class="block-header block-header-default py-2">
<h3 class="block-title mb-0" style="font-size: 16px;">
<i class="fa fa-file-text mr-2"></i>Notification Command Logs
</h3>
<div class="block-options">
<form method="GET" action="" class="d-inline-flex align-items-center">
<input type="date" name="date" value="{{ request('date', date('Y-m-d')) }}" class="form-control form-control-sm" style="width: 140px;">
<button type="submit" class="btn btn-sm btn-primary ml-2">
<i class="fa fa-search"></i>
</button>
</form>
</div>
</div>
<div class="block-content">
<?php
$selectedDate = request('date', date('Y-m-d'));
$summary = getNotificationLogSummary($selectedDate);
// Get schedule status info
$scheduleRunLog = storage_path('logs/schedule-run.log');
$lastScheduleRun = null;
if (file_exists($scheduleRunLog)) {
$lastModified = filemtime($scheduleRunLog);
$lastScheduleRun = date('Y-m-d H:i:s', $lastModified);
}
// Get today's scheduler activity
$today = date('Y-m-d');
$notificationLog = storage_path('logs/notifications-' . $today . '.log');
$scheduleRuns = [];
$commandStats = [];
if (file_exists($notificationLog)) {
$logContent = file_get_contents($notificationLog);
$lines = explode("\n", $logContent);
foreach ($lines as $line) {
if (preg_match('/\[(.+?)\]\s+(scheduled|finished)\s+\|\s+SCHEDULER\s+\|\s+(.+)/', $line, $matches)) {
$data = json_decode($matches[3], true);
if ($data && isset($data['command'])) {
$scheduleRuns[] = [
'time' => $matches[1],
'status' => $matches[2],
'command' => $data['command']
];
$cmd = $data['command'];
if (!isset($commandStats[$cmd])) {
$commandStats[$cmd] = ['scheduled' => 0, 'finished' => 0, 'last_run' => null];
}
if ($matches[2] === 'scheduled') {
$commandStats[$cmd]['scheduled']++;
} elseif ($matches[2] === 'finished') {
$commandStats[$cmd]['finished']++;
}
if (!$commandStats[$cmd]['last_run'] || $matches[1] > $commandStats[$cmd]['last_run']) {
$commandStats[$cmd]['last_run'] = $matches[1];
}
}
}
}
}
$activeCommands = 0;
foreach ($commandStats as $stats) {
if ($stats['last_run'] && strtotime($stats['last_run']) > (time() - 600)) {
$activeCommands++;
}
}
?>
<style>
.stat-card {
border: none;
border-radius: 6px;
padding: 12px 15px;
height: 100%;
transition: transform 0.2s, box-shadow 0.2s;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.stat-card:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.stat-card-danger {
background: #ff5722;
color: #fff;
}
.stat-card-success {
background: #4caf50;
color: #fff;
}
.stat-card-warning {
background: #ff9800;
color: #fff;
}
.stat-card-info {
background: #00bcd4;
color: #fff;
}
.stat-icon {
width: 40px;
height: 40px;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
margin-right: 10px;
flex-shrink: 0;
background: rgba(255, 255, 255, 0.2);
color: #fff;
}
.stat-value {
font-size: 24px;
font-weight: 600;
line-height: 1.2;
margin-bottom: 2px;
color: #fff;
}
.stat-label {
font-size: 11px;
color: rgba(255, 255, 255, 0.9);
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.3px;
}
</style>
<!-- Schedule Status Info -->
<div class="row mb-3">
<div class="col-12">
<div class="alert alert-info mb-0 py-2" style="font-size: 13px;">
<div class="d-flex justify-content-between align-items-center">
<div>
<i class="fa fa-clock-o mr-2"></i>
<strong>Schedule Status:</strong>
<span class="ml-2">Last Run: {{ $lastScheduleRun ? date('H:i:s', strtotime($lastScheduleRun)) : 'N/A' }}</span>
<span class="ml-3">Active Commands: <strong>{{ $activeCommands }}</strong> / {{ count($commandStats) }}</span>
</div>
<div>
@if($lastScheduleRun && strtotime($lastScheduleRun) > (time() - 60))
<span class="badge badge-success">Running</span>
@else
<span class="badge badge-warning">Inactive</span>
@endif
</div>
</div>
</div>
</div>
</div>
<!-- All Cards in Single Row -->
<div class="row mb-3">
<!-- Total Executions -->
<div class="col-6 col-md-4 col-lg">
<div class="stat-card stat-card-danger">
<div class="d-flex align-items-center">
<div class="stat-icon">
<i class="fa fa-play-circle"></i>
</div>
<div>
<div class="stat-value">{{ $summary['total_executions'] }}</div>
<div class="stat-label">Total Executions</div>
</div>
</div>
</div>
</div>
<!-- Completed -->
<div class="col-6 col-md-4 col-lg">
<div class="stat-card stat-card-success">
<div class="d-flex align-items-center">
<div class="stat-icon">
<i class="fa fa-check-circle"></i>
</div>
<div>
<div class="stat-value">{{ $summary['completed'] }}</div>
<div class="stat-label">Completed</div>
</div>
</div>
</div>
</div>
<!-- Skipped -->
<div class="col-6 col-md-4 col-lg">
<div class="stat-card stat-card-warning">
<div class="d-flex align-items-center">
<div class="stat-icon">
<i class="fa fa-pause-circle"></i>
</div>
<div>
<div class="stat-value">{{ $summary['skipped'] }}</div>
<div class="stat-label">Skipped</div>
</div>
</div>
</div>
</div>
<!-- Errors -->
<div class="col-6 col-md-4 col-lg">
<div class="stat-card stat-card-danger">
<div class="d-flex align-items-center">
<div class="stat-icon">
<i class="fa fa-exclamation-circle"></i>
</div>
<div>
<div class="stat-value">{{ $summary['errors'] }}</div>
<div class="stat-label">Errors</div>
</div>
</div>
</div>
</div>
<!-- Total Notifications Sent -->
<div class="col-12 col-md-4 col-lg">
<div class="stat-card stat-card-info">
<div class="d-flex align-items-center">
<div class="stat-icon">
<i class="fa fa-bell"></i>
</div>
<div>
<div class="stat-value">{{ $summary['total_notifications_sent'] }}</div>
<div class="stat-label">Total Notifications Sent</div>
</div>
</div>
</div>
</div>
</div>
<!-- Command Details -->
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Command</th>
<th class="text-center" title="Scheduler tarafından kaç kez planlandı">Scheduled</th>
<th class="text-center" title="Komutun gerçekten kaç kez çalıştığı (completed + skipped + errors)">Executions</th>
<th class="text-center">Completed</th>
<th class="text-center">Skipped</th>
<th class="text-center">Errors</th>
<th class="text-center">Total Sent</th>
</tr>
</thead>
<tbody>
@if(empty($summary['commands']))
<tr>
<td colspan="7" class="text-center text-muted">
<i class="fa fa-info-circle"></i> No logs found for {{ $selectedDate }}
</td>
</tr>
@else
@foreach($summary['commands'] as $command => $stats)
<tr>
<td><code>{{ $command }}</code></td>
<td class="text-center">
<span class="badge badge-info">{{ $stats['scheduled_count'] ?? 0 }}</span>
</td>
<td class="text-center">{{ $stats['executions'] }}</td>
<td class="text-center">
<span class="badge badge-success">{{ $stats['completed'] }}</span>
</td>
<td class="text-center">
<span class="badge badge-warning">{{ $stats['skipped'] }}</span>
</td>
<td class="text-center">
<span class="badge badge-danger">{{ $stats['errors'] }}</span>
</td>
<td class="text-center">
<strong>{{ $stats['total_sent'] }}</strong>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<!-- Raw Log File -->
<div class="mt-4">
<h4>Raw Log File</h4>
<div class="card">
<div class="card-body">
<?php
$logFile = storage_path('logs/notifications-' . $selectedDate . '.log');
if (file_exists($logFile)) {
$logContent = file_get_contents($logFile);
$lines = explode("\n", $logContent);
$reversedLines = array_reverse($lines);
$lastLines = array_slice($reversedLines, 0, 100); // Son 100 satır
?>
<pre class="mb-0" style="max-height: 500px; overflow-y: auto; font-size: 12px;">{{ implode("\n", $lastLines) }}</pre>
<?php
} else {
?>
<p class="text-muted mb-0">No log file found for {{ $selectedDate }}</p>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@@ -1,449 +0,0 @@
<?php
use App\Models\PaintFollowUp;
$title = "Paint Follow Up";
$tableWidth="300%";
$tableName = "paint_follow_ups";
//$tableType = "classic-table";
$blockGroup = [
'General Info' => [
'project',
'description',
'area',
'location',
],
'Line Info' => [
'line',
'iso_number',
'spool_no_joint_no',
'fluid_code',
'fluid_code_description',
],
'Primer' => [
'cycle',
'primer_coat_name_1',
'brend_name_1',
'colour_1',
'ral_code_1',
'thickness_1',
],
'Intermediate' => [
'intermediate_coat_name_2',
'brend_name_2',
'colour_2',
'ral_code_2',
'thickness_2',
],
'Final' => [
'final_coat_name_3',
'brend_name_3',
'colour_3',
'ral_code_3',
'thickness_3',
],
'Incoming Control' => [
'certificate_passport_no_1',
'incoming_control_akt_no_1',
'incoming_control_rfi_no_1',
'akt_date_1',
'standartgost_iso_en_1',
'certificate_passport_date_1',
],
'Incoming Control 2' => [
'certificate_passport_no_2',
'incoming_control_akt_no_2',
'incoming_control_rfi_no_2',
'akt_date_2',
'standartgost_iso_en_2',
'certificate_passport_date_2',
],
'Incoming Control 3' => [
'certificate_passport_no_3',
'incoming_control_akt_no_3',
'incoming_control_rfi_no_3',
'akt_date_3',
'standartgost_iso_en_3',
'certificate_passport_date_3',
],
'Cleaning Information' => [
'surface_preparation_equipment',
'surface_roughness',
'standartgost_iso_en_cleaning',
'brend_name',
'passport_no',
'passport_date',
'protocol_no_cleaning',
'protocol_date_cleaning',
'surface_preparation_rfi_no',
'substrate_temprature',
'ambient_temprature',
],
'Primer Measured' => [
'primer_measured_thickness_1',
'primer_coating_protocol_no',
'primer_coating_protocol_date',
'primer_coating_start_date',
'primer_coating_finish_date',
'primer_coating_rfi_no',
'primer_coating_rfi_date_1',
'volume_1',
],
'Intermadiate Measured' => [
'intermediate_measured_thickness_2',
'intermediate_coating_protocol_no_2',
'intermediate_coating_protocol_date2',
'start_intermediate_date2',
'finish_intermediate_date2',
'intermediate_coating_rfi_no2',
'intermediate_coating_rfi_date_3',
'volume_2',
],
'Final Coating Measured' => [
'final_coating_measured_thickness_3',
'final_coating_protocol_no_3',
'final_coatingprotocol_date_3',
'final_coat_start_date3',
'final_coat_finish_date3',
'final_coating_rfi_no3',
'final_coating_rfi_date_3',
'volume_3',
],
'Status' => [
'total_volume',
'total_thickness',
'status',
'remarks',
],
];
$jointTypes = db("joint_types")->get();
$paintMatrix = db("paint_matrices")->get();
$brends = [];
foreach($paintMatrix AS $pm) {
if(!is_null($pm->brend_name_1))
$brends[] = $pm->brend_name_1;
if(!is_null($pm->brend_name_2))
$brends[] = $pm->brend_name_2;
if(!is_null($pm->brend_name_3))
$brends[] = $pm->brend_name_3;
}
$brends = array_unique($brends);
$relationDatas = [
'brend_name_1' => [
'values' => $brends,
'type' => 'manuel-select'
],
'brend_name_2' => [
'values' => $brends,
'type' => 'manuel-select'
],
'brend_name_3' => [
'values' => $brends,
'type' => 'manuel-select'
],
'paint_subcontructer' => [
'values' => db("subcontractors")->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select'
],
'type_of_joint' => [
'datas' => $jointTypes,
'pattern' => '{short_name_en}',
'type' => 'select-dropdown'
],
];
//$recordedDatas = recorded_data($tableName);
$tableDifferentValues = table_different_values($tableName);
$topButtons = [];
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From Paint Matrix")
];
//dump(implode("', '", $ndeMatrixCol));
//dump($ndeMatrixCol);
?>
<script>
$(function(){
});
</script>
<div class="content">
<div class="col-12">
<?php
// $typeOfJoint = db("joint_types")->pluck("short_name_en")->toArray();
if(getisset("sync")) {
$cachePrefix = 'paint_follow_ups_sync_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$paintMatrixs = db("paint_matrices")->where("id",">", $lastId)->take(200)->get();
$count = 0;
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
$added = [];
if(Cache::has($cachePrefix.'_added')) {
$added = Cache::get($cachePrefix.'_added');
}
$paintMatrixCols = table_columns("paint_matrices");
$paintFollowUpCols = table_columns("paint_follow_ups");
$commonCols = array_intersect($paintMatrixCols, $paintFollowUpCols);
unset($commonCols[0]);
foreach($paintMatrixs AS $paintMatrix) {
$data = [];
foreach($commonCols AS $col) {
$data[$col] = $paintMatrix->$col;
};
PaintFollowUp::firstOrCreate($data);
Cache::put($cachePrefix, $paintMatrix->id);
Cache::put($cachePrefix.'_added', $added);
$count++;
}
bilgi(":count Data has been sync from Paint Matrix",
"success",
['count' => $count]
);
}
$listDatas = PaintFollowUp::orderBy("id","DESC");
if(getisset("filter")) {
$get = $_GET;
unset($get['filter']);
unset($get['page']);
$listDatas = $listDatas->where(function($query) use($get) {
foreach($get AS $column => $values) {
$query->whereIn($column, $values);
}
});
}
$listDatas = $listDatas->paginate(setting('row_count'));
?>
</div>
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
<script>
// Global calculation function for thickness and volume totals
function calculateTotals(rowIndex, dataGrid) {
try {
// Helper function to safely parse numeric values
function parseNumeric(value) {
const parsed = parseFloat(value);
return isNaN(parsed) ? 0 : parsed;
}
// Get current values directly from DataGrid cells (most reliable method)
var thickness1 = parseNumeric(dataGrid.cellValue(rowIndex, "thickness_1"));
var thickness2 = parseNumeric(dataGrid.cellValue(rowIndex, "thickness_2"));
var thickness3 = parseNumeric(dataGrid.cellValue(rowIndex, "thickness_3"));
var volume1 = parseNumeric(dataGrid.cellValue(rowIndex, "volume_1"));
var volume2 = parseNumeric(dataGrid.cellValue(rowIndex, "volume_2"));
var volume3 = parseNumeric(dataGrid.cellValue(rowIndex, "volume_3"));
console.log("Current thickness values:", thickness1, thickness2, thickness3);
console.log("Current volume values:", volume1, volume2, volume3);
// Calculate totals
var totalThickness = thickness1 + thickness2 + thickness3;
var totalVolume = volume1 + volume2 + volume3;
// Update total values with proper formatting
dataGrid.cellValue(rowIndex, "total_thickness", totalThickness.toFixed(2));
dataGrid.cellValue(rowIndex, "total_volume", totalVolume.toFixed(2));
console.log("Calculated totals:", totalThickness.toFixed(2), totalVolume.toFixed(2));
} catch (error) {
console.error('Error in calculateTotals:', error);
}
}
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
var readOnly = [
];
console.log("ok");
// Check start date dependencies for read-only fields
// If primer_coating_start_date is not filled, make finish date and subsequent stages read-only
if(!dataRow.primer_coating_start_date) {
var readonlyFields = [
'primer_coating_finish_date',
'start_intermediate_date2',
'finish_intermediate_date2',
'final_coat_start_date3',
'final_coat_finish_date3'
];
if(readonlyFields.includes(e.dataField)) {
e.editorOptions.readOnly = true;
}
}
// If start_intermediate_date2 is not filled, make intermediate finish and final stages read-only
if(!dataRow.start_intermediate_date2) {
var readonlyFields = [
'finish_intermediate_date2',
'final_coat_start_date3',
'final_coat_finish_date3'
];
if(readonlyFields.includes(e.dataField)) {
e.editorOptions.readOnly = true;
}
}
// If final_coat_start_date3 is not filled, make final finish date read-only
if(!dataRow.final_coat_start_date3) {
var readonlyFields = [
'final_coat_finish_date3'
];
if(readonlyFields.includes(e.dataField)) {
e.editorOptions.readOnly = true;
}
}
for(let k =1; k<=3; k++) {
if(e.dataField == "incoming_control_akt_no_" + k) {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.dataSource = '{{autocomplete_type("paint-follow-up*akt-no")}}-'+k+'?&row='+ JSON.stringify(rowData);
}
if(e.dataField == "certificate_passport_no_" + k) {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.dataSource = '{{autocomplete_type("paint-follow-up*certificate-no")}}?no='+k+'&row='+ JSON.stringify(rowData);
e.editorOptions.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("incoming_control_paints","certificate_no")}}?value=" + selectData.value, function(responseJSON) {
console.log(responseJSON);
console.log(rowIndex);
dataGrid.cellValue(rowIndex, "akt_date_" + k, responseJSON.akt_date);
dataGrid.cellValue(rowIndex, "incoming_control_akt_no_" + k, responseJSON.akt_number);
dataGrid.cellValue(rowIndex, "incoming_control_rfi_no_" + k, responseJSON.rfi_no);
dataGrid.cellValue(rowIndex, "standartgost_iso_en_" + k, responseJSON.manufacturing_standard);
dataGrid.cellValue(rowIndex, "certificate_passport_date_" + k, responseJSON.certificate_date);
});
}
}
/*
dataGrid.cellValue(rowIndex, "brend_name_" + k, responseJSON.brend_name);
dataGrid.cellValue(rowIndex, "certificate_passport_date_" + k, responseJSON.certificate_date);
*/
}
if(e.dataField == "passport_no") {
e.editorName = "dxSelectBox";
e.editorOptions.searchEnabled = true;
e.editorOptions.dataSource = '{{autocomplete_type("paint-follow-up*passport_no")}}';
e.editorOptions.onValueChanged = function(selectData) {
e.setValue(selectData.value);
$.getJSON("{{row_detail_url("incoming_control_paints","certificate_no")}}?value=" + selectData.value, function(responseJSON) {
console.log(responseJSON);
console.log(rowIndex);
dataGrid.cellValue(rowIndex, "brend_name", responseJSON.brend_name);
dataGrid.cellValue(rowIndex, "passport_date", responseJSON.certificate_date);
});
}
}
// Fields that trigger calculation
var calculationFields = ['volume_1', 'volume_2', 'volume_3', 'thickness_1', 'thickness_2', 'thickness_3'];
if (calculationFields.includes(e.dataField)) {
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
// Update the cell value immediately and then calculate
e.component.cellValue(rowIndex, e.dataField, value.value);
// Trigger calculation immediately
setTimeout(function() {
calculateTotals(rowIndex, e.component);
}, 50);
}
}
}
// DataGrid events for calculation
function onRowUpdated(e) {
// Recalculate totals when row is updated
setTimeout(function() {
calculateTotals(e.rowIndex, e.component);
}, 50);
}
function onCellValueChanged(e) {
// Recalculate totals when cell value changes
var calculationFields = ['volume_1', 'volume_2', 'volume_3', 'thickness_1', 'thickness_2', 'thickness_3'];
if (calculationFields.includes(e.dataField)) {
setTimeout(function() {
calculateTotals(e.rowIndex, e.component);
}, 50);
}
}
function onRowInserted(e) {
// Recalculate totals when new row is inserted
setTimeout(function() {
calculateTotals(e.rowIndex, e.component);
}, 50);
}
</script>
@@ -1,189 +0,0 @@
<?php
use App\Models\PaintMatrix;
$title = "Paint Matrix";
$tableWidth="300%";
$path = "admin.type.line-list";
$tableName = "paint_matrices";
//$tableType = "classic-table";
$jointTypes = db("joint_types")->get();
$relationDatas = [
'type_of_joint' => [
'datas' => $jointTypes,
'pattern' => '{short_name_en}',
'type' => 'select-dropdown'
],
];
//$recordedDatas = recorded_data($tableName);
$tableDifferentValues = table_different_values($tableName);
$topButtons = [];
$ndeMatrixCol = table_columns($tableName);
$ndeMatrixCol = table_columns("line_lists");
$blockGroup = [
'General' => [
'project',
'description',
'area',
'line',
'fluid_code',
'fluid_code_description',
],
'Design' => [
'design_temperature',
'operation_temperature',
'paint_cycle',
'surface_preparation',
'touch_up_of_damaged_parts',
],
'Primer' => [
'primer_coat',
'brend_name_1',
'colour_1',
'ral_code_1',
'thickness_1',
],
'Intermediate' => [
'intermediate_coat',
'brend_name_2',
'colour_2',
'ral_code_2',
'thickness_2',
],
'Final' => [
'final_coat',
'brend_name_3',
'colour_3',
'ral_code_3',
'thickness_3',
],
'Total' => [
'total_thickness',
'remarks',
],
];
?>
<script>
$(function(){
});
</script>
<div class="content">
<div class="col-12">
<?php
// $typeOfJoint = db("joint_types")->pluck("short_name_en")->toArray();
$listDatas = PaintMatrix::orderBy("id","DESC");
if(getisset("filter")) {
$get = $_GET;
unset($get['filter']);
unset($get['page']);
$listDatas = $listDatas->where(function($query) use($get) {
foreach($get AS $column => $values) {
$query->whereIn($column, $values);
}
});
}
$listDatas = $listDatas->paginate(setting('row_count'));
?>
</div>
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
<script>
var clicked = [];
var readOnly = [
'area',
'line',
'fluid_code',
'design_temperature',
'operation_temperature',
'paint_cycle',
];
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
{{dxAutocomplete("fluid_code_description", "line_lists", "fluid_ru", [
'line_no' => 'line',
'fluid_code' => 'fluid_code',
])}}
if (e.dataField == "thickness_1") {
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
// Tüm thickness değerlerini numerik olarak alıp topla
var thickness1 = parseFloat(value.value) || 0;
var thickness2 = parseFloat(dataRow.thickness_2) || 0;
var thickness3 = parseFloat(dataRow.thickness_3) || 0;
var totalThickness = thickness1 + thickness2 + thickness3;
// Toplam değeri güncelle
e.component.cellValue(rowIndex, "total_thickness", totalThickness);
}
}
if (e.dataField == "thickness_2") {
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
// Tüm thickness değerlerini numerik olarak alıp topla
var thickness1 = parseFloat(dataRow.thickness_1) || 0;
var thickness2 = parseFloat(value.value) || 0;
var thickness3 = parseFloat(dataRow.thickness_3) || 0;
var totalThickness = thickness1 + thickness2 + thickness3;
// Toplam değeri güncelle
e.component.cellValue(rowIndex, "total_thickness", totalThickness);
}
}
if (e.dataField == "thickness_3") {
e.editorOptions.onValueChanged = function(value) {
e.setValue(value.value);
// Tüm thickness değerlerini numerik olarak alıp topla
var thickness1 = parseFloat(dataRow.thickness_1) || 0;
var thickness2 = parseFloat(dataRow.thickness_2) || 0;
var thickness3 = parseFloat(value.value) || 0;
var totalThickness = thickness1 + thickness2 + thickness3;
// Toplam değeri güncelle
e.component.cellValue(rowIndex, "total_thickness", totalThickness);
}
}
if(readOnly.includes(e.dataField)) {
options.readOnly = true;
}
}
</script>
@@ -1,102 +0,0 @@
<?php
use App\Models\PaintSystem;
//$noRemoteOperations = true;
$title = "Paint Systems";
$tableWidth="100%";
$listDatas = PaintSystem::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "paint_systems";
//$tableType = "datagrid";
$relationDatas = [
];
$blockGroup = [
'Engineering' => [
'paint_cycle',
'surface_preparation',
'surface_roughness',
'revision'
],
'First Layer' => [
'primer_coat_name_1',
'brand_name_1',
'thickness_1',
'consumption_paint_kg_1'
],
'Second Layer' => [
'primer_coat_name_2',
'brand_name_2',
'thickness_2',
'consumption_paint_kg_2'
],
'Third Layer' => [
'primer_coat_name_3',
'brand_name_3',
'thickness_3',
'consumption_paint_kg_3'
],
'Totals' => [
'total_kg',
'total_microns'
]
];
?>
<script>
$(function(){
});
function editorPreparing(e) {
if (e.dataField === 'thickness_1' || e.dataField === 'thickness_2' || e.dataField === 'thickness_3' ||
e.dataField === 'consumption_paint_kg_1' || e.dataField === 'consumption_paint_kg_2' || e.dataField === 'consumption_paint_kg_3') {
e.editorOptions.onValueChanged = function(args) {
// Save the edited value
e.setValue(args.value);
var dataGrid = e.component;
var rowIndex = e.row.rowIndex;
var row = dataGrid.getDataSource().items()[rowIndex];
console.log('Current Row Data:', row);
// Get values directly from the grid
var thickness1 = parseFloat(dataGrid.cellValue(rowIndex, "thickness_1")) || 0;
var thickness2 = parseFloat(dataGrid.cellValue(rowIndex, "thickness_2")) || 0;
var thickness3 = parseFloat(dataGrid.cellValue(rowIndex, "thickness_3")) || 0;
var consumption1 = parseFloat(dataGrid.cellValue(rowIndex, "consumption_paint_kg_1")) || 0;
var consumption2 = parseFloat(dataGrid.cellValue(rowIndex, "consumption_paint_kg_2")) || 0;
var consumption3 = parseFloat(dataGrid.cellValue(rowIndex, "consumption_paint_kg_3")) || 0;
console.log('Thickness Values:', {thickness1, thickness2, thickness3});
console.log('Consumption Values:', {consumption1, consumption2, consumption3});
// Calculate total thickness
var totalThickness = thickness1 + thickness2 + thickness3;
// Calculate total consumption
var totalConsumption = consumption1 + consumption2 + consumption3;
console.log('Totals:', {totalThickness, totalConsumption});
// Update totals
dataGrid.cellValue(rowIndex, "total_microns", totalThickness);
dataGrid.cellValue(rowIndex, "total_kg", totalConsumption);
};
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,39 +0,0 @@
<!-- New PDF Editor System -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/5.3.0/fabric.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/v4-shims.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
@include('admin.type.pdf-editor.styles')
<meta name="csrf-token" content="{{ csrf_token() }}">
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<div class="pdf-editor-wrapper">
<!-- Sidebar Component -->
@include('admin.type.pdf-editor.sidebar')
<section class="pdf-editor-main">
<!-- Toolbar Component -->
@include('admin.type.pdf-editor.toolbar')
<!-- Canvas/PDF Container Component -->
@include('admin.type.pdf-editor.canvas')
</section>
</div>
</div>
</div>
</div>
<!-- Scripts Component -->
@include('admin.type.pdf-editor.scripts')
File diff suppressed because it is too large Load Diff
@@ -1,86 +0,0 @@
<?php
function list_all_subdirectories($dir) {
$subdirs = array();
$directories = glob($dir . '/*', GLOB_ONLYDIR);
foreach ($directories as $directory) {
$subdirs[] = $directory;
$subdirs = array_merge($subdirs, list_all_subdirectories($directory));
}
return $subdirs;
}
?>
<div class="content">
<h1>{{e2("Generate Folder to PDF from Document Templates")}}</h1>
<div class="row">
<?php
$documents = db("document_templates")->whereNotNull("kid")->get();
?>
@foreach($documents AS $document)
{{col("col-md-3",$document->title, 0, ['no-options'=> true])}}
{{$document->kid}} <br>
<?php $j = j($document->json);
?>
Paper: {{$j['paper']}} <br>
<div class="btn btn-outline-primary generate-folder" data-paper="{{$j['paper']}}" data-folder="{{$document->kid}}">{{e2("Generate Folder to PDF")}}</div>
{{_col()}}
@endforeach
</div>
<h2>{{e2("Recently Created PDF Zip Files")}}</h2>
<?php $zipFiles = glob("storage/documents/zip_files/*.zip");
?>
<div class="row">
{{col("col-12","")}}
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover">
<tr>
<th>{{e2("Zip File")}}</th>
<th>{{e2("Created Date")}}</th>
<th>{{e2("Process")}}</th>
</tr>
@foreach($zipFiles AS $zipFile)
<?php
$createdDate = filectime($zipFile);
?>
<tr>
<td>{{$zipFile}}</td>
<td>{{date("d.m.Y H:i:s", $createdDate)}}</td>
<td><a href="{{url($zipFile)}}" class="btn btn-outline-success"><i class="fa fa-download"></i></a></td>
</tr>
@endforeach
</table>
</div>
{{_col()}}
</div>
</div>
</div>
</div>
<script>
$(function() {
$(".generate-folder").on("click", function() {
$("#modal-popin").modal({
backdrop: 'static',
keyboard: false
});
var folder = $(this).attr("data-folder");
var paper = $(this).attr("data-paper");
$("#modal-popin .modal-footer").addClass("d-none")
$("#modal-popin .block-title").html("PDF Creator");
$("#modal-popin .block-content").html(folder + " folder processing, please wait...");
$.get("?ajax=html-to-pdf", {
path: "storage/documents//" + folder,
paper: paper
}, function(d) {
$("#modal-popin .block-content").html(d);
}).fail(function(jqXHR, textStatus, errorThrow) {
$("#modal-popin .block-content").html(jqXHR.responseJSON.message);
});
});
});
</script>
@@ -1,153 +0,0 @@
<?php
use App\Models\PMITest;
//$noRemoteOperations = true;
$title = "PMI Test";
$tableWidth="100%";
$listDatas = PMITest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "p_m_i_tests";
$tableType = "datagrid";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pmi_result' => [
'datas' => db("results")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_pmi',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Base Element Info' => [
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'PT Info' => [
'pmi_scope',
'pmi_request_no',
'pmi_request_date',
'no_of_testing_report',
'pmi_test_date',
'pmi_result',
'control_standart',
'tester_name',
'real_welder_1',
'real_welder_2',
],
'Element Info' => [
'carbon',
'silicon',
'manganese',
'phosphorus',
'sulfur',
'chromium',
'nickel',
'molybdenum',
'copper',
'aluminium',
'titanium',
'vanadium',
'tungsten',
]
];
$firstUploadFolder = '004_QA/0005_PMI/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'pmi_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
-311
View File
@@ -1,311 +0,0 @@
<?php
use App\Models\ProsedureQualificationRecord;
use App\Models\NaksCertificate;
use App\Models\Material;
use App\Models\WeldingConsumable;
$title = "Procedure Qualification Records";
$tableWidth="500%";
$listDatas = ProsedureQualificationRecord::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "prosedure_qualification_records";
$materials = db('materials')->get();
$weldingPositions = db('welding_positions')->get();
$weldingConsumables = db('welding_consumables')->get();
$weldingMethods = db('welding_methods')->whereNotIn("ru_short_name",['*'])->get();
$currentTypes = db('current_types')->get();
$jointTypes = db('joint_types')->get();
$naksTechnology = db('naks_certificates')->groupBy("certificate_no")->get();
$workTypes = db('work_types')->get();
$blockGroup = [
'PQR Info' => [
'download',
'pqr_no',
'rev_no',
'naks_technology',
'technology_category',
'pwps_no',
'base_metal_used_for_pqr_coupon',
'date',
'welding_process',
'welding_position',
],
'Base Material' => [
'type_grade_1',
'type_grade_2',
'russian_standart_group_no',
'russian_standart_group_no_2',
'p_no_to',
'p_no_from',
'outside_diameter',
'thickness',
'brend',
'filter_metals_aws_sfa_no_class',
'filter_metals_gost',
'pre_heating_min',
'inter_pass_max',
'pwht_temp_range',
'pwht_min_time',
'shielding_gas',
'backing_gas',
'current_polarity',
'joint_design',
'base_metal',
],
'Qualitification Range' => [
'qualitication_outside_diameter_min',
'qualitication_outside_diameter_max',
'thickness_min',
'thickness_max',
'qualitication_group_of_parent_material',
],
'Result' => [
'qualitication_process',
'pre_heating',
'qualitication_pwht',
'qualitication_type_of_joint',
'qualitication_backing_gas',
'approved_date',
'status',
],
];
$gasNaksConsumables = db("naks_consumables")->where("type_of_consumable", "Gas / Газ")->groupBy("product_name")->select("product_name")->get();
$relationDatas = [
'naks_technology' => [
'type' => 'string'
],
/*
'base_metal_used_for_pqr_coupon' => [
'datas' => $materials,
'pattern' => '{steel_grade}',
'type' => 'multiple-choice',
],
'welding_process' => [
'datas' => $weldingMethods,
'pattern' => '{ru_short_name}/{en_welding_number}',
'type' => 'multiple-choice',
],
*/
'welding_position' => [
'datas' => $weldingPositions,
'pattern' => '{gost}/{en}',
'type' => 'multiple-choice'
],
'shielding_gas' => [
'datas' => $gasNaksConsumables,
'pattern' => '{product_name}',
'type' => 'select-dropdown'
],
'backing_gas' => [
'datas' => $gasNaksConsumables,
'pattern' => '{product_name}',
'type' => 'select-dropdown'
],
'qualitication_position' => [
'type' => 'string'
],
/*
'technology_category' => [
'filter' => [
'targetColumn' => 'naks_technology',
'table' => 'naks_certificates',
'filterColumn' => 'certificate_no'
],
'datas' => $naksTechnology,
'pattern' => '{technology_category}',
'type' => 'select-dropdown'
],
*/
/*
'type_grade_1' => [
'datas' => $materials,
'filter' => [
'targetColumn' => 'naks_technology',
'table' => 'naks_certificates',
'filterColumn' => 'certificate_no'
],
'pattern' => '{steel_grade}',
'type' => 'select-dropdown2',
'affected' => [
'russian_standart_group_no' => '{ru_group}',
'p_no_from' => '{asme_number}',
]
],
'type_grade_1' => [
'type' => 'auto-complete2',
'table' => 'materials',
'column' => 'steel_grade',
'pattern' => '{steel_grade}',
'affected' => [
'russian_standart_group_no' => '{ru_group}',
'p_no_from' => '{asme_number}',
]
],
'type_grade_2' => [
'type' => 'auto-complete2',
'table' => 'materials',
'column' => 'steel_grade',
'pattern' => '{steel_grade}',
'affected' => [
'russian_standart_group_no_2' => '{ru_group}',
'p_no_to' => '{asme_number}',
]
],
*/
'welding_method' => [
'datas' => $weldingPositions,
'pattern' => '{gost}/{en}',
'type' => 'multiple-choice'
],
/*
'type_grade_1' => [
'table' => 'materials',
'datas' => $materials,
'value' => 'steel_grade',
'text' => ['steel_grade'],
'type' => 'select',
'affected' => [
'russian_standart_group_no' => '{ru_group}',
'p_no_from' => '{asme_number}',
]
],
'type_grade_2' => [
'table' => 'materials',
'datas' => $materials,
'value' => 'steel_grade',
'text' => ['steel_grade'],
'type' => 'select',
'affected' => [
'russian_standart_group_no_2' => '{ru_group}',
'p_no_to' => '{asme_number}',
]
],
*/
/*
'brend' => [
'table' => 'welding_consumables',
'datas' => $weldingConsumables,
'value' => 'brend',
'text' => ['brend'],
'type' => 'select',
'affected' => [
'filter_metals_aws_sfa_no_class' => '{aws_class}-{aws_specification}',
'filter_metals_gost' => '{gost_class}-{gost_specification}'
]
],
*/
/*
'brend' => [
'datas' => $weldingConsumables,
'pattern' => '{brend}',
'type' => 'multiple-choice',
'seperator' => ' + '
],
*/
'current_polarity' => [
'datas' => $currentTypes,
'pattern' => '{title}',
'type' => 'multiple-choice'
],
'joint_design' => [
'datas' => $jointTypes,
'pattern' => '{short_name_en}',
'type' => 'select-dropdown'
],
'qualitication_type_of_joint' => [
'datas' => $jointTypes,
'pattern' => '{short_name_en}',
'type' => 'multiple-choice'
],
/*
'base_metal' => [
'datas' => $workTypes,
'pattern' => '{title_en}',
'type' => 'select-dropdown'
],
*/
'pwht_temp_range' => [
'required' => [
'column' => 'pwht',
'value' => 'YES'
],
'type' => 'integer'
],
'pwht_min_time' => [
'required' => [
'column' => 'pwht',
'value' => 'YES'
],
'type' => 'integer'
],
'qualitication_pwht' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
];
$firstUploadFolder = "003_Welding_Database/0004_PQR";
$firstUploadTitle = "Upload PQR Document";
?>
<?php
$material_group_test_pieces = db("material_group_test_pieces")->select(
"incoming_value",
"provision_value"
)->get();
$material_group_test_pieces_data = [];
foreach($material_group_test_pieces AS $piece) {
$piece->incoming_value = str_replace(",", ".", $piece->incoming_value);
$material_group_test_pieces_data[$piece->incoming_value] = $piece->provision_value;
}
?>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@include("admin.type.pqr.datagrid-script")
<script>
$(function() {
});
</script>
-133
View File
@@ -1,133 +0,0 @@
<?php
use App\Models\PTLog;
//$noRemoteOperations = true;
$title = "PT Log";
$tableWidth="100%";
$listDatas = PTLog::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "p_t_logs";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pt_result' => [
'datas' => db("results")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_pt',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Element Info' => [
'certificate_no',
'wpq_report',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'PT Info' => [
'pt_scope',
'pt_request_no',
'pt_request_date',
'pt_report',
'pt_test_date',
'pt_result',
'control_standart',
'defects',
'tester_name',
],
];
$firstUploadFolder = '004_QA/0004_PT/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'pt_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,58 +0,0 @@
<?php
//$noRemoteOperations = true;
$title = "PTO PML";
$tableWidth="100%";
$tableName = "pto_pmls";
//$tableType = "datagrid";
$relationDatas = [
];
$blockGroup = [
'Project Info' => [
'project',
'line',
'revision',
'group',
'section',
],
'Document Details' => [
'list',
'position',
'quantity',
'standard',
],
'Material Details' => [
'material_name_en',
'material_name_ru',
'material',
'dn',
'thickness',
'pn',
'id_code',
],
];
$firstUploadFolder = '004_QA/0001_RT/';
$firstUploadTitle = 'Upload PDF';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,28 +0,0 @@
<?php
use App\Models\PunchDescription;
$title = "Punch Description";
$tableWidth="100%";
$listDatas = PunchDescription::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "punch_descriptions";
$relationDatas = [
'discipline' => [
'values' => db("general_disciplines")->get()->pluck("title")->toArray(),
'type' => 'manuel-select'
],
]
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,35 +0,0 @@
<?php
use App\Models\PunchListComment;
$title = "Punch List Comment";
$tableWidth="100%";
$listDatas = PunchListComment::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "punch_list_comments";
$relationDatas = [
'discipline' => [
'values' => db("general_disciplines")->get()->pluck("title")->toArray(),
'type' => 'manuel-select'
],
];
?>
<script>
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,138 +0,0 @@
<?php
use App\Models\PunchList;
$title = "Punch List";
$tableWidth="100%";
$listDatas = PunchList::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "punch_lists";
$requiredFields = ['category'];
$relationDatas = [
'punch_list_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'subcontractor' => [
'values' => db("subcontractors")->where("job_description", "Montaj")->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select'
],
'originator_company' => [
'values' => db("subcontractors")->whereIn("job_description", ['Engineering', 'Employeer', 'Third Party', 'Construction'])->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select'
],
'discipline' => [
'values' => db("general_disciplines")->get()->pluck("title")->toArray(),
'type' => 'manuel-select'
],
'area' => [
'values' => db("weld_logs")->groupBy("design_area")->get()->pluck("design_area")->toArray(),
'type' => 'manuel-select'
],
'status' => [
'values' => [
'Open',
'Closed',
'Canceled',
],
'default' => 'Open',
'type' => 'manuel-select'
],
'category' => [
'values' => [
'A',
'B',
'C',
'D',
'E',
],
'type' => 'manuel-select'
],
];
$blockGroup = [
'General Information' => [
'punch_list_download',
'subcontractor',
'discipline',
'unit',
'area',
],
'Test Pack Info' => [
'test_package',
'line_isometric_no',
'punch_list_no',
],
'Comments' => [
'code_number',
'eng',
'rus',
'category',
],
'RFI Info' => [
'rfi_no',
'rfi_date',
'reference_document',
'originator_name',
'originator_company',
'found_date',
'close_target_date',
],
'Results' => [
'action_by',
'status',
'items_cleared_by_name',
'items_cleared_by_close_date',
'responsible',
],
];
$firstUploadFolder = '009_Punch_List/';
$firstUploadTitle = 'Upload PDF';
?>
<script>
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
{{dxSelectBox("test_package", "weld_logs", "test_package_no", "", [
'area' => '{design_area}',
'line_isometric_no' => '{circuit_number}',
])}}
{{dxAutocomplete("unit", "weld_logs", "project")}}
{{dxSelectBox("line_isometric_no", "weld_logs", "iso_number", [
'test_package_no' => 'test_package',
],[
'unit' => '{project}',
])}}
{{dxSelectBox("code_number", "punch_list_comments", "code", "", [
'discipline' => '{discipline}',
'eng' => '{description_en}',
'rus' => '{opisanie_rus}',
'category' => '{category}',
])}}
if(e.dataField == "punch_list_no") {
e.validationRules[0].type = "async";
}
if(e.dataField == "status") {
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,887 +0,0 @@
<!-- ExcelJS and FileSaver for pivot exports -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/exceljs/4.1.1/exceljs.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.2/FileSaver.min.js"></script>
<div class="content">
<style>
.punch-card h3 { font-size: 16px; font-weight: 600; }
#totalConstructionPunchPointProgress .dx-datagrid-headers .dx-row > td {
font-weight: 600;
text-transform: uppercase;
}
#totalConstructionPunchPointProgress .dx-datagrid-total-footer {
font-weight: 600;
}
.chart-block { min-height: 320px; }
/* 5 kart için özel genişlik */
@media (min-width: 992px) {
.col-lg-2-4 {
flex: 0 0 20%;
max-width: 20%;
}
}
</style>
<div class="block block-rounded">
<div class="block-content">
<div class="row g-3 mb-3">
<div class="col-lg-2-4">
<div class="block block-rounded text-center h-100 bg-white shadow-sm">
<div class="block-content py-4">
<p class="text-muted text-uppercase fw-semibold mb-1">{{e2("Total Punch")}}</p>
<p class="fs-2 fw-bold mb-0" id="punch-total-count">-</p>
</div>
</div>
</div>
<div class="col-lg-2-4">
<div class="block block-rounded text-center h-100 bg-white shadow-sm">
<div class="block-content py-4">
<p class="text-muted text-uppercase fw-semibold mb-1">{{e2("Open Punches")}}</p>
<p class="fs-2 fw-bold mb-0 text-danger" id="punch-open-count">-</p>
<p class="fs-6 text-muted mb-0 mt-1" id="punch-open-breakdown" style="font-size: 11px;">-</p>
</div>
</div>
</div>
<div class="col-lg-2-4">
<div class="block block-rounded text-center h-100 bg-white shadow-sm">
<div class="block-content py-4">
<p class="text-muted text-uppercase fw-semibold mb-1">{{e2("Closed Punches")}}</p>
<p class="fs-2 fw-bold mb-0 text-success" id="punch-closed-count">-</p>
<p class="fs-6 text-muted mb-0 mt-1" id="punch-closed-breakdown" style="font-size: 11px;">-</p>
</div>
</div>
</div>
<div class="col-lg-2-4">
<div class="block block-rounded text-center h-100 bg-white shadow-sm">
<div class="block-content py-4">
<p class="text-muted text-uppercase fw-semibold mb-1">{{e2("Canceled Punches")}}</p>
<p class="fs-2 fw-bold mb-0 text-warning" id="punch-canceled-count">-</p>
<p class="fs-6 text-muted mb-0 mt-1" id="punch-canceled-breakdown" style="font-size: 11px;">-</p>
</div>
</div>
</div>
<div class="col-lg-2-4">
<div class="block block-rounded text-center h-100 bg-white shadow-sm">
<div class="block-content py-4">
<p class="text-muted text-uppercase fw-semibold mb-1">{{e2("Progress")}}</p>
<p class="fs-2 fw-bold mb-0 text-info" id="punch-progress-percent">-</p>
</div>
</div>
</div>
</div>
<div class="row g-3">
<div class="col-12">
<div class="block block-rounded h-100">
<div class="block-header block-header-default">
<h3 class="block-title mb-0">{{e2("Punch Details Pivot")}}</h3>
</div>
<div class="block-content pt-0">
<div id="constructionPuncListProgress" style="min-height:420px;"></div>
</div>
</div>
</div>
</div>
<div class="row g-3 mt-3">
<div class="col-lg-6">
<div class="block block-rounded h-100">
<div class="block-header block-header-default">
<h3 class="block-title mb-0">{{e2("Punch Status Breakdown by Category")}}</h3>
</div>
<div class="block-content">
<div id="totalConstructionPunchPointProgress"></div>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="block block-rounded h-100">
<div class="block-header block-header-default">
<h3 class="block-title mb-0">{{e2("Project vs Category Open/Closed")}}</h3>
</div>
<div class="block-content chart-block">
<div id="project-category-chart" style="height: 280px;"></div>
</div>
</div>
</div>
</div>
<div class="row g-3 mt-3">
<div class="col-12">
<div class="block block-rounded h-100">
<div class="block-header block-header-default">
<h3 class="block-title mb-0">{{e2("Monthly Status by Area")}}</h3>
<div class="block-options">
<label class="me-2 mb-0" style="font-size: 12px;"><i class="fa fa-calendar"></i> {{e2("Year")}}:</label>
<select id="monthly-year-filter" class="form-control form-control-sm" style="width: 100px; display: inline-block;">
@php
$currentYear = date('Y');
for($y = $currentYear; $y >= $currentYear - 5; $y--) {
$selected = ($y == $currentYear) ? 'selected' : '';
echo "<option value=\"$y\" $selected>$y</option>";
}
@endphp
</select>
</div>
</div>
<div class="block-content chart-block">
<div id="monthly-status-chart" style="height: 320px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
var punchColors = {
a_open: "#ff7043",
a_closed: "#4caf50",
b_open: "#2196f3",
b_closed: "#8bc34a",
c_open: "#ab47bc",
c_closed: "#ffca28"
};
var totalConstructionPunchPointProgress = $("#totalConstructionPunchPointProgress").dxDataGrid({
dataSource: [],
showBorders: true,
columnAutoWidth: true,
rowAlternationEnabled: true,
hoverStateEnabled: true,
export: {
enabled: true,
fileName: "Punch_Status_Breakdown"
},
columns: [
{ dataField: "Status", caption: "{{e2('Status')}}", width: 90 },
{ dataField: "Punch A", caption: "Punch A", alignment: "center", format: { type: "fixedPoint", precision: 2 } },
{ dataField: "Punch B", caption: "Punch B", alignment: "center", format: { type: "fixedPoint", precision: 2 } },
{ dataField: "Punch C", caption: "Punch C", alignment: "center", format: { type: "fixedPoint", precision: 2 } }
],
summary: {
totalItems: []
},
onCellPrepared: function(e) {
if (e.rowType === "totalFooter") {
e.cellElement.css({
"background-color": "#e3f2fd",
"font-weight": "bold",
"color": "#1976d2"
});
}
if (e.rowType === "data" && e.data && e.data.Status === "Total") {
e.cellElement.css({
"background-color": "#e3f2fd",
"font-weight": "bold",
"color": "#1976d2"
});
}
if (e.rowType === "data" && e.data && e.data.Status === "Progress") {
e.cellElement.css({
"background-color": "#e3f2fd",
"font-weight": "bold",
"color": "#1976d2"
});
}
}
}).dxDataGrid("instance");
function updateStatusCards(rows) {
var totals = {
Open: 0,
Closed: 0,
Canceled: 0
};
var categoryBreakdown = {
Open: { A: 0, B: 0, C: 0 },
Closed: { A: 0, B: 0, C: 0 },
Canceled: { A: 0, B: 0, C: 0 }
};
rows.forEach(function(row) {
if (totals.hasOwnProperty(row.Status)) {
var punchA = parseFloat((row['Punch A'] || '0').toString().replace('%', ''));
var punchB = parseFloat((row['Punch B'] || '0').toString().replace('%', ''));
var punchC = parseFloat((row['Punch C'] || '0').toString().replace('%', ''));
var sum = punchA + punchB + punchC;
totals[row.Status] += sum;
categoryBreakdown[row.Status].A += punchA;
categoryBreakdown[row.Status].B += punchB;
categoryBreakdown[row.Status].C += punchC;
}
});
var totalAll = totals.Open + totals.Closed + totals.Canceled;
var progressPercent = totalAll > 0 ? ((totals.Closed / totalAll) * 100).toFixed(1) : 0;
$("#punch-total-count").text(totalAll.toLocaleString());
$("#punch-open-count").text(totals.Open.toLocaleString());
$("#punch-closed-count").text(totals.Closed.toLocaleString());
$("#punch-canceled-count").text(totals.Canceled.toLocaleString());
$("#punch-progress-percent").text(progressPercent + "%");
// Category breakdown text
$("#punch-open-breakdown").text("A: " + categoryBreakdown.Open.A.toLocaleString() +
" | B: " + categoryBreakdown.Open.B.toLocaleString() +
" | C: " + categoryBreakdown.Open.C.toLocaleString());
$("#punch-closed-breakdown").text("A: " + categoryBreakdown.Closed.A.toLocaleString() +
" | B: " + categoryBreakdown.Closed.B.toLocaleString() +
" | C: " + categoryBreakdown.Closed.C.toLocaleString());
$("#punch-canceled-breakdown").text("A: " + categoryBreakdown.Canceled.A.toLocaleString() +
" | B: " + categoryBreakdown.Canceled.B.toLocaleString() +
" | C: " + categoryBreakdown.Canceled.C.toLocaleString());
}
$.getJSON('?ajax=punch-summary.point-progress&type=totalConstructionPunchPointProgress', function(data) {
totalConstructionPunchPointProgress.option("dataSource", data);
updateStatusCards(data || []);
});
$.getJSON('?ajax=punch-summary.punch-list', function(data) {
var pivotDataStore = new DevExpress.data.ArrayStore({
data: data,
key: "id"
});
punchPivotGridInstance = $('#constructionPuncListProgress').dxPivotGrid({
allowSortingBySummary: true,
allowFiltering: true,
showBorders: true,
showColumnGrandTotals: true,
showRowGrandTotals: true,
showRowTotals: true,
showColumnTotals: true,
allowExpandAll: true,
fieldChooser: {
enabled: true,
height: 400,
},
export: {
enabled: true
},
onExporting: function(e) {
var workbook = new ExcelJS.Workbook();
var worksheet = workbook.addWorksheet('Punch Details Pivot');
DevExpress.excelExporter.exportPivotGrid({
component: e.component,
worksheet: worksheet,
customizeCell: function(options) {
var excelCell = options.excelCell;
// Base styling
excelCell.font = { name: 'Arial', size: 10 };
excelCell.alignment = { horizontal: 'center', vertical: 'middle' };
// Header cells
if(options.pivotCell && options.pivotCell.type === 'H') {
excelCell.fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FFD1ECF1' }
};
excelCell.font = { name: 'Arial', size: 10, bold: true, color: { argb: 'FF0C5460' } };
}
// Total cells
if(options.pivotCell && (options.pivotCell.type === 'GT' || options.pivotCell.type === 'T')) {
excelCell.fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FFE3F2FD' }
};
excelCell.font = { name: 'Arial', size: 10, bold: true, color: { argb: 'FF1976D2' } };
}
}
}).then(function() {
workbook.xlsx.writeBuffer().then(function(buffer) {
saveAs(new Blob([buffer], { type: 'application/octet-stream' }), 'Punch_Details_Pivot.xlsx');
});
});
},
dataSource: {
fields: [
{
caption: 'Project',
dataField: 'project',
area: 'row',
sortOrder: 'asc'
},
{
caption: 'Design Area',
dataField: 'design_area',
area: 'row',
sortOrder: 'asc'
},
{
caption: 'Discipline',
dataField: 'discipline',
area: 'row',
sortOrder: 'asc'
},
{
caption: 'Category',
dataField: 'category',
area: 'column',
},
{
caption: 'Status',
dataField: 'status',
area: 'column',
},
{
caption: 'Total Count',
dataField: 'id',
dataType: 'number',
summaryType: 'count',
area: 'data',
},
{
caption: 'Progress',
dataField: 'id',
dataType: 'number',
summaryType: 'count',
summaryDisplayMode: 'percentOfColumnGrandTotal',
format: {
type: "percent",
precision: 2
},
area: 'data',
},
],
store: pivotDataStore
},
}).dxPivotGrid('instance');
});
function renderCategoryPie(data) {
$('#open-punch-point-chart').dxPieChart({
dataSource: data,
palette: "Soft Pastel",
type: "doughnut",
innerRadius: 0.55,
legend: {
orientation: "horizontal",
horizontalAlignment: "center",
verticalAlignment: "bottom"
},
tooltip: {
enabled: true,
font: {
size: 12,
color: "#fff"
},
customizeTooltip: function(point) {
var value = point.originalValue || 0;
var formatted = DevExpress.localization.formatNumber(value, { type: "fixedPoint", precision: 2 });
return {
html: "<div class='text-left' style='padding:6px; min-width:160px;'>"
+ "<div class='font-weight-bold mb-1' style='color:#fff !important;'>" + point.argumentText + "</div>"
+ "<div class='font-size-h5 font-weight-bold' style='color:#fff !important;'>" + formatted + "</div>"
+ "<div style='color:#fff !important;'>" + point.percentText + "</div>"
+ "</div>"
};
}
},
series: [{
argumentField: "name",
valueField: "value",
label: {
visible: true,
format: {
type: "percent",
precision: 1
},
customizeText: function(info) {
try {
if (!info || typeof info !== 'object') return "";
var argumentText = (info.argumentText !== undefined && info.argumentText !== null) ? String(info.argumentText) : "";
var percentText = (info.percentText !== undefined && info.percentText !== null) ? String(info.percentText) : "";
if (!argumentText && !percentText) return "";
return argumentText + (percentText ? " - " + percentText : "");
} catch (e) {
console.error("Label customizeText error:", e);
return "";
}
}
}
}]
});
}
function renderProjectCategoryChart(data) {
console.log('Project Category Chart Data:', data);
if (!data || data.length === 0) {
$("#project-category-chart").html('<div class="text-center p-4 text-muted">No data available</div>');
return;
}
// Her project için toplam Open/Closed/Canceled hesapla
var processedData = [];
var projectTotals = {};
data.forEach(function(item) {
var project = item.project || 'Unknown';
if (!projectTotals[project]) {
projectTotals[project] = {
project: project,
open: 0,
closed: 0,
canceled: 0
};
}
// A, B, C kategorilerindeki Open/Closed/Canceled'ları topla
projectTotals[project].open += (parseInt(item.a_open) || 0) + (parseInt(item.b_open) || 0) + (parseInt(item.c_open) || 0);
projectTotals[project].closed += (parseInt(item.a_closed) || 0) + (parseInt(item.b_closed) || 0) + (parseInt(item.c_closed) || 0);
projectTotals[project].canceled += (parseInt(item.a_canceled) || 0) + (parseInt(item.b_canceled) || 0) + (parseInt(item.c_canceled) || 0);
});
processedData = Object.values(projectTotals);
console.log('Processed Project Category Data:', processedData);
if (processedData.length === 0) {
$("#project-category-chart").html('<div class="text-center p-4 text-muted">No project data available</div>');
return;
}
var series = [
{
valueField: "open",
name: "{{e2('Open')}}",
color: "#ff7043",
label: {
visible: false
}
},
{
valueField: "closed",
name: "{{e2('Closed')}}",
color: "#4caf50",
label: {
visible: false
}
},
{
valueField: "canceled",
name: "{{e2('Canceled')}}",
color: "#ffb74d",
label: {
visible: true,
format: {
type: "fixedPoint",
precision: 0
},
customizeText: function(arg) {
try {
if (!arg || !arg.data) return "";
// Sadece en üstteki seri (canceled) total'i göstersin
var open = (arg.data && arg.data.open !== undefined) ? arg.data.open : 0;
var closed = (arg.data && arg.data.closed !== undefined) ? arg.data.closed : 0;
var canceled = (arg.data && arg.data.canceled !== undefined) ? arg.data.canceled : 0;
var total = open + closed + canceled;
return total > 0 ? total.toString() : "";
} catch (e) {
console.error("Label customizeText error:", e);
return "";
}
},
position: "outside"
}
}
];
// Container'ı temizle
var $container = $("#project-category-chart");
if ($container.length === 0) {
console.error('Project category chart container not found');
return;
}
// Önce mevcut chart'ı temizle (güvenli şekilde)
try {
var existingChart = $container.dxChart("instance");
if (existingChart) {
existingChart.dispose();
}
} catch (e) {
// Chart henüz initialize edilmemiş, devam et
}
$container.empty();
$container.dxChart({
dataSource: processedData,
commonSeriesSettings: {
argumentField: "project",
type: "stackedBar"
},
series: series,
argumentAxis: {
label: {
wordWrap: true,
overlappingBehavior: "rotate",
rotationAngle: -45,
font: {
size: 10
},
customizeText: function(arg) {
// Project ismini kısalt veya daha okunabilir hale getir
var text = arg.value || '';
// Eğer çok uzunsa kısalt
if (text.length > 15) {
return text.substring(0, 12) + '...';
}
return text;
}
},
visualRange: {
length: 10 // Maksimum 10 project göster, scroll ile diğerleri görülebilir
}
},
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center",
columnCount: 3
},
tooltip: {
enabled: true,
shared: true,
font: {
size: 12,
color: "#fff"
},
customizeTooltip: function(arg) {
var tooltipHtml = "<div class='text-left' style='padding:6px; min-width:180px;'>"
+ "<div class='font-weight-bold mb-1' style='color:#fff !important;'>" + arg.argumentText + "</div>";
if (arg.points && arg.points.length > 0) {
var total = 0;
// Tüm serileri göster (Open, Closed, Canceled)
arg.points.forEach(function(point) {
var pointValue = parseFloat(point.value || 0);
total += pointValue;
var pointFormatted = DevExpress.localization.formatNumber(pointValue, { type: "fixedPoint", precision: 0 });
tooltipHtml += "<div style='color:#fff !important; margin-bottom:4px;'>"
+ "<strong>" + point.seriesName + ":</strong> " + pointFormatted
+ "</div>";
});
tooltipHtml += "<div style='color:#fff !important; border-top:1px solid rgba(255,255,255,0.3); padding-top:4px; margin-top:4px;'>"
+ "<strong>Total:</strong> " + DevExpress.localization.formatNumber(total, { type: "fixedPoint", precision: 0 })
+ "</div>";
} else {
// Fallback - tek seri için
var value = arg.originalValue || 0;
var formatted = DevExpress.localization.formatNumber(value, { type: "fixedPoint", precision: 2 });
tooltipHtml += "<div class='font-weight-bold mb-1' style='color:#fff !important;'>" + arg.seriesName + "</div>"
+ "<div class='font-size-h5 font-weight-bold' style='color:#fff !important;'>" + formatted + "</div>";
}
tooltipHtml += "</div>";
return { html: tooltipHtml };
}
},
valueAxis: {
title: {
text: "{{e2('Punch Count')}}"
}
}
});
}
function renderMonthlyChart(data) {
console.log('Rendering Monthly Chart with data:', data);
if (!data || data.length === 0) {
$("#monthly-status-chart").html('<div class="text-center p-4 text-muted">No data available</div>');
return;
}
// Tüm area'ları topla
var allAreas = new Set();
data.forEach(function(item) {
if (item.areas) {
Object.keys(item.areas).forEach(function(area) {
allAreas.add(area);
});
}
});
if (allAreas.size === 0) {
$("#monthly-status-chart").html('<div class="text-center p-4 text-muted">No area data available</div>');
return;
}
// Veriyi düzleştir - her area için open ve closed ayrı field oluştur
var flattenedData = data.map(function(item) {
var row = {
month_label: item.month_label || item.month || '',
month: item.month || ''
};
allAreas.forEach(function(area) {
var fieldName = 'area_' + area.replace(/[^a-zA-Z0-9]/g, '_');
var areaData = (item.areas && item.areas[area]) ? item.areas[area] : { open: 0, closed: 0 };
row[fieldName + '_open'] = areaData.open || 0;
row[fieldName + '_closed'] = areaData.closed || 0;
});
return row;
});
// Open ve Closed renk paletleri
var openColors = ['#ef5350', '#ff7043', '#ff8a65', '#ffab91', '#e57373', '#f44336'];
var closedColors = ['#66bb6a', '#81c784', '#a5d6a7', '#4caf50', '#43a047', '#388e3c'];
// Series oluştur - her area için Open ve Closed ayrı bar
var series = [];
var colorIdx = 0;
Array.from(allAreas).sort().forEach(function(area) {
var fieldName = 'area_' + area.replace(/[^a-zA-Z0-9]/g, '_');
// Open bar
series.push({
valueField: fieldName + '_open',
name: area + ' - Open',
stack: area,
color: openColors[colorIdx % openColors.length]
});
// Closed bar
series.push({
valueField: fieldName + '_closed',
name: area + ' - Closed',
stack: area,
color: closedColors[colorIdx % closedColors.length]
});
colorIdx++;
});
console.log('Flattened data:', flattenedData);
console.log('Series:', series);
// Container'ı kontrol et
var $monthlyContainer = $("#monthly-status-chart");
if ($monthlyContainer.length === 0) {
console.error('Monthly status chart container not found');
return;
}
// Önce mevcut chart'ı temizle (güvenli şekilde)
try {
var existingMonthlyChart = $monthlyContainer.dxChart("instance");
if (existingMonthlyChart) {
existingMonthlyChart.dispose();
}
} catch (e) {
// Chart henüz initialize edilmemiş, devam et
}
$monthlyContainer.empty();
$monthlyContainer.dxChart({
dataSource: flattenedData,
commonSeriesSettings: {
argumentField: "month_label",
type: "stackedBar",
barWidth: 25
},
series: series,
argumentAxis: {
label: {
wordWrap: true,
overlappingBehavior: "rotate",
rotationAngle: -40,
font: { size: 11 }
}
},
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center",
columnCount: 4
},
tooltip: {
enabled: true,
shared: true,
font: {
size: 12,
color: "#fff"
},
customizeTooltip: function(arg) {
var tooltipHtml = "<div class='text-left' style='padding:6px; min-width:200px;'>"
+ "<div class='font-weight-bold mb-2' style='color:#fff !important; border-bottom:1px solid rgba(255,255,255,0.3); padding-bottom:4px;'>" + arg.argumentText + "</div>";
if (arg.points && arg.points.length > 0) {
var totalOpen = 0;
var totalClosed = 0;
arg.points.forEach(function(point) {
var pointValue = parseFloat(point.value || 0);
if (point.seriesName.indexOf('Open') > -1) {
totalOpen += pointValue;
} else {
totalClosed += pointValue;
}
var pointFormatted = DevExpress.localization.formatNumber(pointValue, { type: "fixedPoint", precision: 0 });
var colorStyle = point.seriesName.indexOf('Open') > -1 ? 'color:#ff7043;' : 'color:#66bb6a;';
tooltipHtml += "<div style='color:#fff !important; margin-bottom:2px;'>"
+ "<span style='" + colorStyle + "'>●</span> " + point.seriesName + ": <strong>" + pointFormatted + "</strong>"
+ "</div>";
});
var grandTotal = totalOpen + totalClosed;
tooltipHtml += "<div style='color:#fff !important; border-top:1px solid rgba(255,255,255,0.3); padding-top:4px; margin-top:4px;'>"
+ "<div><strong>Total Open:</strong> " + DevExpress.localization.formatNumber(totalOpen, { type: "fixedPoint", precision: 0 }) + "</div>"
+ "<div><strong>Total Closed:</strong> " + DevExpress.localization.formatNumber(totalClosed, { type: "fixedPoint", precision: 0 }) + "</div>"
+ "<div><strong>Grand Total:</strong> " + DevExpress.localization.formatNumber(grandTotal, { type: "fixedPoint", precision: 0 }) + "</div>"
+ "</div>";
}
tooltipHtml += "</div>";
return { html: tooltipHtml };
}
},
valueAxis: {
title: {
text: "{{e2('Punch Count')}}"
},
min: 0
}
});
}
// Area renk mapping'i - her area için benzersiz renk
var areaColorMap = {};
var areaColorIndex = 0;
var colorPalette = [
'#ff7043', '#34bfa3', '#ffb74d', '#ab47bc', '#2196f3',
'#8bc34a', '#ffca28', '#ef5350', '#26a69a', '#42a5f5',
'#ff6b6b', '#4ecdc4', '#45b7d1', '#f9ca24', '#f0932b',
'#eb4d4b', '#6c5ce7', '#a29bfe', '#00b894', '#00cec9',
'#fd79a8', '#fdcb6e', '#e17055', '#d63031', '#0984e3'
];
function getAreaColor(area) {
if (!area || area === 'Unknown' || area === 'No Data') {
return '#cccccc';
}
// Eğer bu area için daha önce renk atanmamışsa, yeni renk ata
if (!areaColorMap[area]) {
areaColorMap[area] = colorPalette[areaColorIndex % colorPalette.length];
areaColorIndex++;
}
return areaColorMap[area];
}
$.getJSON('?ajax=punch-summary.point-progress&type=openPunchPoint', function(data) {
renderCategoryPie(data);
});
$.getJSON('?ajax=punch-summary.point-progress&type=projectCategory', function(data) {
console.log('Project Category Data:', data);
if (!data || data.length === 0) {
console.warn('No project category data received');
renderProjectCategoryChart([]);
return;
}
renderProjectCategoryChart(data);
});
// Monthly Status Chart yükleme fonksiyonu
function loadMonthlyStatusChart(year) {
$.getJSON('?ajax=punch-summary.point-progress&type=monthlyStatus&year=' + year, function(data) {
console.log('Monthly Status Data for year ' + year + ':', data);
if (!data || data.length === 0) {
console.warn('No monthly status data received');
renderMonthlyChart([]);
return;
}
// Ay bazlı ve area bazlı veri dönüşümü
var monthlyAreaData = {};
(data || []).forEach(function(item) {
var monthKey = item.month || item.month_label || '';
var area = item.design_area || item.area || "{{e2('Unknown')}}";
if (!monthKey) return;
if (!monthlyAreaData[monthKey]) {
monthlyAreaData[monthKey] = {
month: monthKey,
month_label: item.month_label || monthKey,
areas: {}
};
}
if (!monthlyAreaData[monthKey].areas[area]) {
monthlyAreaData[monthKey].areas[area] = {
open: 0,
closed: 0,
canceled: 0
};
}
monthlyAreaData[monthKey].areas[area].open += (parseInt(item.open_count) || 0);
monthlyAreaData[monthKey].areas[area].closed += (parseInt(item.closed_count) || 0);
monthlyAreaData[monthKey].areas[area].canceled += (parseInt(item.canceled_count) || 0);
});
// Tüm area'ları topla
var allAreas = new Set();
Object.values(monthlyAreaData).forEach(function(monthData) {
Object.keys(monthData.areas).forEach(function(area) {
allAreas.add(area);
});
});
// Normalize data - her ay için tüm area'ları içeren format (open/closed ayrı)
var normalized = Object.values(monthlyAreaData).map(function(monthData) {
var row = {
month: monthData.month,
month_label: monthData.month_label,
areas: {}
};
allAreas.forEach(function(area) {
var areaData = monthData.areas[area] || { open: 0, closed: 0, canceled: 0 };
row.areas[area] = {
open: areaData.open,
closed: areaData.closed
};
});
return row;
}).sort(function(a, b) {
return a.month.localeCompare(b.month);
});
console.log('Normalized Monthly Data:', normalized);
renderMonthlyChart(normalized);
});
}
// İlk yükleme
var monthlyYearFilter = $('#monthly-year-filter');
loadMonthlyStatusChart(monthlyYearFilter.val());
// Yıl değiştiğinde yeniden yükle
monthlyYearFilter.on('change', function() {
loadMonthlyStatusChart($(this).val());
});
});
</script>
@@ -1,26 +0,0 @@
<?php
use App\Models\NDT;
$title = "PWHT AKT";
$tableWidth="100%";
$listDatas = NDT::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "n_d_t_s";
$tableType = "datagrid";
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,137 +0,0 @@
<?php
use App\Models\PWHT;
//$noRemoteOperations = true;
$title = "PWHT Log";
$tableWidth="100%";
$listDatas = PWHT::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "p_w_h_t_s";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'pwht_result' => [
'datas' => db("results")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_no',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_pwht',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Base Element Info' => [
'certificate_no',
'wpq_report',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
'real_welder_1',
'real_welder_2',
],
'PWHT Info' => [
'pwht',
'pwht_request_no',
'pwht_request_date',
'no_of_pwht_report',
'pwht_date',
'diagram_number_pwht',
'pwht_operator',
'pwht_operator_id',
'pwht_result',
'control_standart',
],
];
$firstUploadFolder = '004_QA/0007_PWHT/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'pwht_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,299 +0,0 @@
<?php
use App\Models\RegisterOfExpert;
use Illuminate\Support\Facades\Cache;
$title = "Register of Experts";
$tableWidth="300%";
$path = "admin.type.naks-consumables";
$tableName = "register_of_experts";
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'employees_id' => [
'table' => 'users',
'datas' => db('users')->whereIn("level", ['Engineer', 'Formen'])->get(),
'value' => 'id',
'pattern' => '{name} / {name_ru}',
'type' => 'select',
'affected' => [
'name_ru' => '{name_ru}',
'name_en' => '{name}',
'date_of_birth' => '{date_of_birth}',
]
],
'groups_of_technical_devices' => [
'datas' => db("hazard_classes")->groupBy("serial_number")->get(),
'pattern' => '{serial_number}',
'type' => 'multiple-choice'
],
'company' => [
'datas' => db("subcontractors")->get(),
'pattern' => '{company_name_en}',
'type' => 'select-dropdown'
],
];
$topButtons = [];
$topButtons[] = [
'href' => '?sync',
'html' => '<i class="fa fa-sync"></i> ' . __("Sync Data From Emplooyes")
];
$blockGroup = [
'General Information' => [
'source_project',
'download',
'location',
'company',
'employees_id',
],
'Welder Information' => [
'name_ru',
'name_en',
'date_of_birth',
'certificate_no',
'welding_specialist_level',
'groups_of_technical_devices',
'date_of_attestation',
'expration_of_the_certificate',
],
'Permit Info' => [
'permit_no',
'permit_date',
'comments',
],
];
/*
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0007_Welding Experts/',
'pattern' => "{certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
]
];
*/
$firstUploadFolder = "003_Welding_Database/0007_Welding Experts";
$firstUploadTitle = "Upload Register Of Experts Document";
$dataGridOptions = "
onToolbarPreparing: function(e) {
var toolbarItems = e.toolbarOptions.items;
var today = new Date();
today.setHours(0,0,0,0);
// Source Project Dropdown Filter
toolbarItems.unshift({
location: 'before',
widget: 'dxSelectBox',
options: {
width: 200,
placeholder: 'Source Project',
showClearButton: true,
dataSource: {
store: {
type: 'array',
data: " . json_encode(
array_merge(
[['value' => '__this_project__', 'text' => '📍 This Project']],
DB::table('register_of_experts')
->whereNotNull('source_project')
->where('source_project', '!=', '')
->groupBy('source_project')
->pluck('source_project')
->map(function($item) {
return ['value' => $item, 'text' => $item];
})
->toArray()
)
) . ",
key: 'value'
}
},
displayExpr: 'text',
valueExpr: 'value',
onValueChanged: function(args) {
if (args.value === '__this_project__') {
e.component.filter([['source_project', '=', null], 'or', ['source_project', '=', '']]);
} else if (args.value) {
e.component.filter(['source_project', '=', args.value]);
} else {
e.component.clearFilter('dataSource');
}
}
}
});
// All Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'All',
icon: 'refresh',
stylingMode: 'text',
onClick: function() {
e.component.clearFilter();
}
}
});
// Valid Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Valid',
icon: 'check',
type: 'success',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['expration_of_the_certificate', '>=', today]);
}
}
});
// Expired Button
toolbarItems.unshift({
location: 'before',
widget: 'dxButton',
options: {
text: 'Expired',
icon: 'remove',
type: 'danger',
stylingMode: 'contained',
onClick: function() {
e.component.filter(['expration_of_the_certificate', '<', today]);
}
}
});
},
";
?>
<style>
/* Satır rengini zorla değiştir */
.expired-row, .expired-row * {
background-color: #ffe6e6 !important;
color: #b02a37 !important; /* Yazıyı da koyu kırmızı yap */
}
</style>
<script>
function contentReady(e) {
var rows = e.component.getVisibleRows();
var today = new Date();
today.setHours(0, 0, 0, 0);
rows.forEach(function(row) {
// row.data.expration_of_the_certificate verisi var mı kontrol et
if (row.rowType === "data" && row.data && row.data.expration_of_the_certificate) {
var dateStr = row.data.expration_of_the_certificate;
var validUntil = null;
// Tarih formatını kontrol et ve parse et
if (typeof dateStr === 'string') {
// DD.MM.YYYY formatı kontrolü
if (dateStr.includes('.')) {
var parts = dateStr.split('.');
// [DD, MM, YYYY] -> new Date(YYYY, MM-1, DD)
if (parts.length === 3) {
validUntil = new Date(parts[2], parts[1] - 1, parts[0]);
}
} else {
// YYYY-MM-DD veya diğer formatlar
validUntil = new Date(dateStr);
}
} else if (dateStr instanceof Date) {
validUntil = dateStr;
}
if (validUntil && !isNaN(validUntil.getTime())) {
validUntil.setHours(0, 0, 0, 0);
if (validUntil < today) {
// Satır elementini rowIndex ile bul
var rowIndex = row.rowIndex;
if (typeof rowIndex !== 'undefined') {
// DataGrid'in kendi metodunu kullanarak elementi al
var $rowElement = $(e.component.getRowElement(rowIndex));
$rowElement.addClass("expired-row");
// Hücrelere de stilin işlediğinden emin olmak için
$rowElement.find("td").addClass("expired-row");
}
}
}
}
});
}
</script>
<div class="content">
<div class="row">
<div class="col-12">
<?php
if(getisset("sync")) {
$cachePrefix = 'register_of_experts_sync_last_id';
$lastId = 0;
if(Cache::has($cachePrefix)) {
$lastId = Cache::get($cachePrefix);
}
$users = db("users")->where("id",">", $lastId)
->whereIn("level", job_descriptions())
->take(1000)->get();
$count = 0;
bilgi("Started ID :Id", "success", ['Id' => $lastId]);
foreach($users AS $user) {
// dd($lineList);
$data = [
'employees_id' => $user->id,
'name_ru' => $user->name_ru,
'name_en' => $user->name,
'date_of_birth' => $user->date_of_birth,
'certificate_no' => $user->id,
// 'welding_specialist_level' => $user->date_of_birth,
// 'groups_of_technical_devices' => $user->date_of_birth,
// 'date_of_attestation' => $user->date_of_birth,
// 'expration_of_the_certificate' => $user->date_of_birth,
];
RegisterOfExpert::updateOrCreate(
[
'employees_id' => $user->id
], $data);
Cache::put($cachePrefix, $user->id);
$count++;
}
bilgi(":count Data has been sync from Emplooyes",
"success",
['count' => $count]
);
}
$listDatas = RegisterOfExpert::orderBy("id","DESC")->paginate(setting('row_count'));
?>
</div>
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,145 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<div class="row">
<div class="col-md-8">
<div id="register-datagrid"></div>
</div>
<div class="col-md-4"></div>
</div>
<script>
$(function(){
var dataGrid = $("#register-datagrid").dxDataGrid({
dataSource: '?ajax=register',
filterRow: { visible: true },
searchPanel: { visible: false },
headerFilter: {
visible: true,
allowSearch: true,
},
export: {
enabled: false,
formats: ['xlsx'],
},
summary: {
groupItems: [{
summaryType: "count"
}]
},
columns : [
'line_number',
{
dataField: "updated_at",
caption: "{{e2("Last Update")}}",
dataType: "date",
format: "dd/MM/yyyy"
},
],
paging: {
pageSize: 100,
},
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: {
enabled: true
},
selection: {
mode: 'multiple',
},
groupPanel: { visible: false },
toolbar: {
items: [
{
location: 'center',
widget: 'dxButton',
options: {
icon: 'pdffile',
text: '{{e2("Register PDF of Selected Row")}}',
onClick: function(e) {
$("#generatePDF").modal();
console.log(dataGrid.getSelectedRowsData());
}
}
},
]
},
onEditorPreparing(e) {
},
onRowClick: function(e) {
if(e.rowType === "data") {
console.log(e);
}
}
}).dxDataGrid("instance");
$("#generatePDFBtn").on("click", function() {
$(this).html("{{e2("Please Wait...")}}");
$.post("?ajax=register-pdf", {
'_token' : '{{csrf_token()}}',
'data' : JSON.stringify(dataGrid.getSelectedRowsData())
}, function(d) {
Swal.fire('', '{{e2("Register PDF is Complete")}}', 'success');
$("#generatePDFBtn").html("{{e2("Register PDF")}}");
});
})
/*
setTimeout(function() {
weldmap.dxDataGrid("instance").columnOption("welding_date", "dataType", "date");
}, 2000);
*/
});
</script>
</div>
</div>
</div>
</div>
<div class="modal" id="generatePDF">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">{{e2("Register PDF of Selected Row")}}</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body text-center">
<div class="btn btn-outline-primary mt-5" id="generatePDFBtn"><i class="fa fa-file-pdf"></i> {{e2("Register PDF")}}</div>
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
@@ -1,566 +0,0 @@
<?php if(getisset("sync")) {
$dones = db("repair_logs")
->where("repair_status", "Done")
->whereNotNull("repair_date")
->whereNotNull("new_joint_no")
->get();
foreach($dones AS $done) {
//db("weld_logs")->
}
} ?>
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<a href="?sync" class="btn btn-outline-primary d-none"><i class="fa fa-sync"></i> {{e2("Sync completed to Weldlog")}}</a>
<style>
.header-repair { background-color: #ffcdd2 !important; color: #b71c1c !important; font-weight: bold; text-align: center !important; }
.header-dates { background-color: #e1bee7 !important; color: #4a148c !important; font-weight: bold; text-align: center !important; }
.header-project { background-color: #bbdefb !important; color: #0d47a1 !important; font-weight: bold; text-align: center !important; }
.header-welding { background-color: #ffe0b2 !important; color: #e65100 !important; font-weight: bold; text-align: center !important; }
.header-materials { background-color: #d1c4e9 !important; color: #311b92 !important; font-weight: bold; text-align: center !important; }
.header-side1 { background-color: #c8e6c9 !important; color: #1b5e20 !important; font-weight: bold; text-align: center !important; }
.header-side2 { background-color: #b2dfdb !important; color: #004d40 !important; font-weight: bold; text-align: center !important; }
.header-ndt { background-color: #f0f4c3 !important; color: #827717 !important; font-weight: bold; text-align: center !important; }
.header-test { background-color: #ffccbc !important; color: #bf360c !important; font-weight: bold; text-align: center !important; }
</style>
<div id="repair-log-datagrid"></div>
<script>
$(function(){
const userId = "{{ u()->id }}";
const tableName = "repair_logs";
const storageKey = `grid_state_${userId}_${tableName}`;
var dataSource = new DevExpress.data.CustomStore({
key: "id",
load(loadOptions) {
const deferred = $.Deferred();
const args = {};
args['module'] = "{{$id}}";
$.ajax({
url: '?ajax=repair-log',
dataType: 'json',
method: 'GET',
data: args,
success(result) {
deferred.resolve(result);
},
error(e) {
console.log("Data Loading Error");
console.log(e);
deferred.reject('{{e2("Data Loading Error")}}');
},
//timeout: 20000,
});
return deferred.promise();
},
remove: function(key) {
var deferred = $.Deferred();
$.ajax({
url: "{{url("admin/remove/repair_logs")}}",
data : {
'_token' : "{{ csrf_token() }}",
'key' : key,
'module' : "{{ $id }}",
},
beforeSend: function(x) {
$("#modal-popin .block-content").append("<div class='d-block m-1 btn btn-info' id='ajax"+key+"'>ID:#"+key+" Delete Processing...</div>");
},
method: "DELETE"
})
.done(function(e) {
$("#ajax" + key).removeClass("btn-info").addClass("btn-success").html("ID:#" + key + " deleted");
return deferred.resolve();
})
.fail(function(e){
deferred.reject("Deletion failed");
});
return deferred.promise();
},
update: function(key, values) {
var deferred = $.Deferred();
// console.log("val" + values);
$.ajax({
url: "{{url("admin/save-json/repair_logs" )}}",
method: "PUT",
data: {
'_token' : "{{ csrf_token() }}",
values : values,
key : key
}
})
.done(function(e) {
//console.log(e);
//deferred.resolve;
return deferred.promise();
})
.fail(function(e){
deferred.reject("{{e2("Update failed")}}");
});
}
});
var welderWdi = $("#repair-log-datagrid").dxDataGrid({
dataSource: dataSource,
height: "calc(100vh - 200px)",
filterRow: { visible: true },
searchPanel: { visible: false },
headerFilter: {
visible: true,
allowSearch: true,
},
columnChooser: {
enabled: true,
mode: "select",
position: {
my: "right top",
at: "right bottom",
of: ".dx-datagrid-column-chooser-button",
},
search: { enabled: true, editorOptions: { placeholder: "Kolon ara" } },
selection: { mode: "multiple", recursive: true, selectByClick: true, allowSelectAll: true },
},
stateStoring: {
enabled: true,
type: "localStorage",
storageKey: storageKey,
customSave: function(state) {
const filteredState = {
columns: state.columns
};
localStorage.setItem(storageKey, JSON.stringify(filteredState));
},
customLoad: function() {
const saved = localStorage.getItem(storageKey);
if (saved) {
return JSON.parse(saved);
}
return null;
}
},
onToolbarPreparing: function(e) {
e.toolbarOptions.items.unshift({ location: "after", name: "columnChooserButton" });
e.toolbarOptions.items.push({
location: "after",
widget: "dxButton",
options: {
icon: "refresh",
text: "Reset View",
hint: "Görünümü sıfırla",
onClick: function () {
localStorage.removeItem(storageKey);
location.reload();
}
}
});
},
@include("components.table.datagrid.partials.js-excel")
summary: {
totalItems: [
{
column: "id",
summaryType: "count",
displayFormat: "Total: {0}"
},
// NPS columns
{
column: "nps_1",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}"
},
{
column: "nps_1",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}"
},
{
column: "nps_2",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}"
},
{
column: "nps_2",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}"
},
// Outside diameter columns
{
column: "outside_diameter_1",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}"
},
{
column: "outside_diameter_1",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}"
},
{
column: "outside_diameter_2",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}"
},
{
column: "outside_diameter_2",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}"
}
],
groupItems: [
{
summaryType: "count",
displayFormat: "Count: {0}",
showInGroupFooter: false
},
// NPS columns for group summary
{
column: "nps_1",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "nps_1",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "nps_2",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "nps_2",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}",
alignByColumn: true,
showInGroupFooter: true
},
// Outside diameter columns for group summary
{
column: "outside_diameter_1",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "outside_diameter_1",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "outside_diameter_2",
summaryType: "sum",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "SUM: {0}",
alignByColumn: true,
showInGroupFooter: true
},
{
column: "outside_diameter_2",
summaryType: "avg",
valueFormat: { type: "fixedPoint", precision: 2 },
displayFormat: "AVG: {0}",
alignByColumn: true,
showInGroupFooter: true
}
]
},
scrolling: {
// mode: 'standard',//'virtual',
mode: 'infinite',
rowRenderingMode: 'infinite',
columnRenderingMode: 'infinite',
useNative: true,
},
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: {
enabled: true
},
selection: {
mode: 'single',
deferred: true,
},
groupPanel: { visible: false },
editing: {
<?php if(isAuth($id, "modify")) { ?>
allowUpdating: true,
<?php } ?>
<?php if(isAuth($id, "full_control")) { ?>
allowDeleting: true,
<?php } ?>
startEditAction: 'dblClick',
refreshMode: 'repaint',
mode: 'batch', // 'batch' | 'cell' | 'form' | 'popup',
},
columns : [
{
caption: "Repair Information",
cssClass: "header-repair",
columns: [
'id',
{
dataField: 'repair_status',
lookup: {
dataSource: ['Done', 'Not Done', 'Repair']
}
},
{
dataField: "repair_date",
dataType: "date",
format: "dd/MM/yyyy"
},
'new_joint_no',
{
dataField: "type_of_joint",
caption: "Type of Joint",
lookup: {
dataSource: [
{ value: "S", text: "S" },
{ value: "F", text: "F" }
],
displayExpr: "text",
valueExpr: "value"
},
validationRules: [
{ type: "required", message: "Type of Joint is required" }
]
},
'spool_status',
]
},
{
caption: "Release Dates",
cssClass: "header-dates",
columns: [
{ dataField: "ndt_release_date", dataType: "date", format: "dd/MM/yyyy" },
{ dataField: "paint_release_date", dataType: "date", format: "dd/MM/yyyy" },
]
},
{
caption: "Project & Line Details",
cssClass: "header-project",
columns: [
'general_contractor',
'contractor',
'ste_subcontractor',
'project',
'design_area',
'line_specification',
'line_number',
'main_material',
'main_nps',
'fluid_code',
'service_category',
'fluid_group',
'piping_type',
'piping_class',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'painting_cycle',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'spool_release_date',
'spool_zone',
{ dataField: "no_of_the_joint_as_per_as_built_survey", caption: "joint_no" },
]
},
{
caption: "Welding Process",
cssClass: "header-welding",
columns: [
'type_of_welds',
{ dataField: "welding_date", dataType: "date", format: "dd/MM/yyyy" },
'wps_no',
'wps_approval_date',
'welding_method',
'fit_up_date',
]
},
{
caption: "Consumables",
cssClass: "header-materials",
columns: [
'welding_materials_1', 'welding_materials_1_lot_no', 'welding_materials_1_certificate_no',
'welding_materials_2', 'welding_materials_2_lot_no', 'welding_materials_2_certificate_no',
'welding_materials_3', 'welding_materials_3_lot_no', 'welding_materials_3_certificate_no',
]
},
{
caption: "Personnel",
cssClass: "header-welding",
columns: [
'welder_1', 'welder_2',
'real_welder_1', 'real_welder_2',
'mechanic_supervisor', 'mechanic_supervisor_control_date',
'welding_supervisor', 'welding_supervisor_control_date',
'certificate_no_1', 'wpq_report_1',
'certificate_no_2', 'wpq_report_2',
]
},
{
caption: "Material Side 1",
cssClass: "header-side1",
columns: [
'pose_no_1', 'element_code_1', 'member_no_1', 'material_no_1',
'product_standart_1', 'ru_material_group_1', 'certificate_number_of_1',
'heat_number_1', 'nps_1', 'thickness_by_asme_1', 'outside_diameter_1', 'wall_thickness_1',
]
},
{
caption: "Material Side 2",
cssClass: "header-side2",
columns: [
'pose_no_2', 'element_code_2', 'member_no_2', 'material_no_2',
'product_standart_2', 'ru_material_group_2', 'certificate_number_of_2',
'heat_number_2', 'nps_2', 'thickness_by_asme_2', 'outside_diameter_2', 'wall_thickness_2',
]
},
{
caption: "NDT & Tests",
cssClass: "header-ndt",
columns: [
{
caption: "Visual Test (VT)",
columns: ['vt_scope', 'vt_request_no', 'vt_report', 'date_of_vt', 'vt_request_date', 'test_laboratory_vt', 'vt_result']
},
{
caption: "Radiographic Test (RT)",
columns: ['rt_scope', 'rt_request_no', 'rt_report', 'rt_test_date', 'rt_request_date', 'test_laboratory_rt', 'rt_result']
},
{
caption: "Ultrasonic Test (UT)",
columns: ['ut_scope', 'ut_request_no', 'ut_report', 'ut_test_date', 'ut_request_date', 'test_laboratory_ut', 'ut_result', 'ut_type']
},
{
caption: "Penetrant Test (PT)",
columns: ['pt_scope', 'pt_request_no', 'pt_report', 'pt_test_date', 'pt_request_date', 'test_laboratory_pt', 'pt_result']
},
{
caption: "Magnetic Particle (MT)",
columns: ['mt_scope', 'mt_request_no', 'mt_report', 'mt_test_date', 'mt_request_date', 'test_laboratory_mt', 'mt_result']
},
{
caption: "PMI",
columns: ['pmi_scope', 'pmi_request_no', 'pmi_report', 'pmi_test_date', 'pmi_request_date', 'test_laboratory_pmi', 'pmi_result']
}
]
},
{
caption: "Heat Treatment & Hardness",
cssClass: "header-test",
columns: [
'pwht', 'pwht_date', 'no_of_pwht_report', 'diagram_number_pwht', 'test_laboratory_pwht',
'ht_scope', 'ht_request_no', 'ht_request_date', 'ht_report', 'no_of_ht_hardnes_test', 'test_laboratory_ht', 'ht_result',
'nde', 'nde_pwht', 'group_no'
]
},
{
caption: "Final Tests",
cssClass: "header-test",
columns: [
'ferrite_scope', 'ferrite_request_no', 'no_of_ferrite_check', 'date_of_ferrite_check', 'test_laboratory_ferrite', 'ferrite_result',
'test_package_no', 'test_pressure', 'type_of_test', 'date_test', 'test_result'
]
},
'remarks',
'ndt_release_no',
'paint_request_no',
],
onEditorPreparing(e) {
@include("components.table.datagrid.events.js-editor-preparing")
if(e.parentType == "dataRow") {
if(
e.dataField == "repair_date"
|| e.dataField == "repair_status"
|| e.dataField == "new_joint_no"
|| e.dataField == "type_of_joint"
) {
e.editorOptions.readOnly = false;
} else {
e.editorOptions.readOnly = true;
}
}
},
onRowClick: function(e) {
if(e.rowType === "data") {
console.log(e);
}
}
});
/*
setTimeout(function() {
weldmap.dxDataGrid("instance").columnOption("welding_date", "dataType", "date");
}, 2000);
*/
});
</script>
</div>
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,91 +0,0 @@
<?php
$u = u();
if(getisset("save-state")) {
dump($_POST);
$fields = json_encode_tr($_POST);
db("document_templates")
->where("id", post("documentId"))
->update([
'fields' => $fields
]);
dump($fields);
exit();
} ?>
@include("admin.type.report-builder.state-handler")
@include("admin.type.report-builder.styles")
@include("admin.type.report-builder.toggle-script")
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}} <span id="selectedDocumentTitle" class="ml-2 font-italic d-none"></span></h3>
<div class="block-options">
<a href="#" id="selectedDocumentExcel" class="btn btn-outline-success d-none" title="{{e2('Excel Template File')}}"><i class="fa fa-file-excel"></i></a>
<div id="selectedDocumentPdf" class="btn btn-outline-primary d-none" title="{{e2('PDF Preview')}}"><i class="fa fa-file-pdf"></i></div>
</div>
</div>
<div class="block-content">
<div class="row d-none">
@include("admin.type.report-builder.diagram")
</div>
<div class="mb-1 p-3 row border @if($u->level != "Admin") d-none @endif">
@include("admin.type.report-builder.sql-builder-panel")
</div>
<!-- Column Placeholder Items - Tüm kullanıcılar için görünür -->
<div class="mb-1 p-3 row border">
<div class="col-12">
<button class="btn btn-outline-secondary" data-toggle="collapse" data-target="#columnItemsPanel" aria-expanded="false" aria-controls="columnItemsPanel">
<i class="fa fa-columns"></i> {{e2('Column Placeholder Items')}}
</button>
<div id="columnItemsPanel" class="collapse" aria-labelledby="columnItemsPanel">
<div class="row">
<div class="col-12">
@include("admin.type.report-builder.column-items")
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 tabs-nav">
<ul class="nav nav-tabs nav-tabs-block nav-fill" id="wizardTabs">
<li class="nav-item">
<a class="nav-link active" href="#tab1" data-toggle="tab">{{e2("Step 1: Select Document")}}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab2" data-toggle="tab">{{e2("Step 2: Select Rows")}}</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#tab3" data-toggle="tab">{{e2("Step 3: Preview PDF")}}</a>
</li>
</ul>
<div id="progressBar"></div>
</div>
<div class="col-md-12 tabs-container">
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<!-- Aşama 1 içeriği: Doküman Seçimi -->
@include("admin.type.report-builder.document-selection")
</div>
<div class="tab-pane" id="tab2">
<!-- Aşama 2 içeriği: Satır Seçimi -->
<hr>
@include("admin.type.report-builder.row-selection")
</div>
<div class="tab-pane" id="tab3">
<!-- Aşama 3 içeriği: PDF Önizleme -->
@include("admin.type.report-builder.pdf-preview")
</div>
</div>
</div>
</div>
<div class="col-md-12 tabs-container">
</div>
</div>
</div>
</div>
@@ -1,415 +0,0 @@
<?php
$get = true;
//$datas = db("weld_logs");
$progress = "Completed";
$progress_type = "success";
$isoNumberTitle = "";
?>
<script>
$(function () {
});
</script>
<style>
.header-request {
background-color: #E3F2FD !important;
color: #0d47a1;
font-weight: bold;
text-align: center !important;
}
.header-line {
background-color: #E8F5E9 !important;
color: #1b5e20;
font-weight: bold;
text-align: center !important;
}
.header-weld {
background-color: #FFF3E0 !important;
color: #e65100;
font-weight: bold;
text-align: center !important;
}
.header-materials {
background-color: #F3E5F5 !important;
color: #4a148c;
font-weight: bold;
text-align: center !important;
}
.header-mat1 {
background-color: #E0F7FA !important;
color: #006064;
font-weight: bold;
text-align: center !important;
}
.header-mat2 {
background-color: #E0F2F1 !important;
color: #004d40;
font-weight: bold;
text-align: center !important;
}
.header-result {
background-color: #FFEBEE !important;
color: #b71c1c;
font-weight: bold;
text-align: center !important;
}
/* Modern Badge Styles */
.modern-badge {
padding: 0px 8px;
border-radius: 12px;
font-size: 0.85em;
font-weight: 700;
margin-left: 6px;
display: inline-block;
transition: all 0.2s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Vibrant colors to match mobile */
.badge-ndt-all {
background-color: #E3F2FD;
color: #1976D2;
border: 1px solid #BBDEFB;
}
.badge-ndt-active {
background-color: #2196F3;
color: #FFFFFF;
border: 1px solid #1976D2;
}
.badge-ndt-inactive {
background-color: #F5F5F5;
color: #9E9E9E;
border: 1px solid #E0E0E0;
}
</style>
<?php
?>
<div class="content">
<div class="row">
{{col("col-md-3 d-none", "Filter", 0, ['no-options' => true])}}
<form action="" method="get">
{{e2("Date")}}
<div class="input-group">
<input type="date" class="form-control" name="d1" value="{{get("d1")}}" id="">
<input type="date" class="form-control" name="d2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
{{e2("Request Date")}}
<div class="input-group">
<input type="date" class="form-control" name="rd1" value="{{get("d1")}}" id="">
<input type="date" class="form-control" name="rd2" value="{{get("d2")}}" id="">
<button class="btn btn-success" id="iso_search"><?php icon("refresh") ?></button>
</div>
{{e2("Subcontractor")}}
<select name="subcontractor" id="" class="form-control select2">
<option value="">Select</option>
<?php $taseron = db("subcontractors")->where("operation_type", "Taseron")->get();
foreach ($taseron as $tas) {
?>
<option value="{{$tas->company_name_en}}">{{$tas->company_name_en}}</option>
<?php
}
?>
</select>
{{e2("Location")}}
<select name="location" id="" class="form-control select2">
<option value="">Select</option>
</select>
<button class="btn btn-primary mt-5">{{e2("Filter")}}</button>
</form>
{{_col()}}
{{col("col-md-12", "List", 0, ['no-options' => true])}}
<script>
$(function () {
var ajaxUrl = "?ajax=request-ndt";
if (window.location.search) {
ajaxUrl += "&" + window.location.search.replace("?", "").replace(/&?ajax=[^&]*/g, "");
}
$.getJSON(ajaxUrl, function (fullData) {
var updateBadges = function () {
var currentNdtType = $(".ndt-filter.active").data("val") || "";
var ndtTypeCounts = { "": 0 };
fullData.forEach(function (item) {
var type = item.ndt_type;
if (type) {
ndtTypeCounts[type] = (ndtTypeCounts[type] || 0) + 1;
}
ndtTypeCounts[""]++;
});
$(".ndt-filter").each(function () {
var val = $(this).data("val");
var count = ndtTypeCounts[val] || 0;
var text = $(this).data("text");
var isActive = $(this).hasClass("active");
var badgeClass = "badge-ndt-inactive";
if (isActive) {
badgeClass = "badge-ndt-active";
} else if (val === "") {
badgeClass = "badge-ndt-all";
}
$(this).html(text + " <span class='modern-badge " + badgeClass + "'>" + count + "</span>");
});
};
var dataGrid = $("#dataGridRequestNDT").dxDataGrid({
dataSource: fullData,
filterRow: { visible: true },
searchPanel: { visible: true },
headerFilter: {
visible: true,
allowSearch: true,
},
toolbar: {
items: [
{
location: "before",
template: function () {
return $("<div/>")
.addClass("btn-group mr-2")
.append(
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter active").data("val", "").data("text", "ALL").attr("data-text", "ALL").text("ALL"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "FERRITE").data("text", "FERRITE").attr("data-text", "FERRITE").text("FERRITE"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "HT").data("text", "HT").attr("data-text", "HT").text("HT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "MT").data("text", "MT").attr("data-text", "MT").text("MT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "PMI").data("text", "PMI").attr("data-text", "PMI").text("PMI"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "PT").data("text", "PT").attr("data-text", "PT").text("PT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "PWHT").data("text", "PWHT").attr("data-text", "PWHT").text("PWHT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "RT").data("text", "RT").attr("data-text", "RT").text("RT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "UT").data("text", "UT").attr("data-text", "UT").text("UT"),
$("<button>").addClass("btn btn-sm btn-outline-primary ndt-filter").data("val", "VT").data("text", "VT").attr("data-text", "VT").text("VT")
);
}
},
@include("components.table.datagrid.partials.js-toolbar")
]
},
@include("components.table.datagrid.partials.js-excel")
summary: {
groupItems: [{
summaryType: "count"
}],
totalItems: [{
column: "request_no",
summaryType: "count",
displayFormat: "Total: {0}"
}]
},
scrolling: {
mode: "infinite"
},
paging: {
pageSize: 20,
},
columns: [
{
dataField: "spool_status",
visible: false
},
{
caption: "NDT Request Info",
cssClass: "header-request",
columns: [
'test_laboratory',
'ndt_type',
'request_no',
{
dataField: "request_date",
dataType: "date",
format: "dd/MM/yyyy"
},
'scope',
]
},
{
caption: "Pipeline / Line Info",
cssClass: "header-line",
columns: [
'contractor',
'project',
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'design_temperature_s',
'design_pressure_mpa',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
]
},
{
caption: "Welding Info",
cssClass: "header-weld",
columns: [
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
{
dataField: "welding_date",
dataType: "date",
format: "dd/MM/yyyy"
},
'wps_no',
'welding_method',
]
},
{
caption: "Consumables & Welders",
cssClass: "header-materials",
columns: [
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
]
},
{
caption: "Material 1 Details",
cssClass: "header-mat1",
columns: [
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
]
},
{
caption: "Material 2 Details",
cssClass: "header-mat2",
columns: [
'pose_no_2',
'element_code_2',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
]
},
{
caption: "Test Results",
cssClass: "header-result",
columns: [
{
dataField: "testing_date",
dataType: "date",
format: "dd/MM/yyyy"
},
'report',
'result',
'control_standart',
'aa', 'ab', 'ac',
'ba', 'bb', 'bc',
'ca', 'cb', 'cc',
'da', 'db', 'dc',
'ea', 'eb', 'ec',
'fa', 'fb',
]
}
],
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: {
enabled: true
},
groupPanel: { visible: true },
height: "calc(100vh - 200px)",
}).dxDataGrid("instance");
setTimeout(function () {
var applyDatagridFilters = function () {
var ndtType = $(".ndt-filter.active").data("val");
var filters = [];
if (ndtType) {
filters.push(["ndt_type", "=", ndtType]);
}
if (filters.length > 0) {
dataGrid.filter(filters);
} else {
dataGrid.clearFilter();
}
updateBadges();
};
$(".ndt-filter").on("click", function () {
$(".ndt-filter").removeClass("active");
$(this).addClass("active");
applyDatagridFilters();
});
applyDatagridFilters();
dataGrid.columnOption("welding_date", "dataType", "date");
dataGrid.columnOption("request_date", "dataType", "date");
dataGrid.columnOption("testing_date", "dataType", "date");
}, 1000);
}); // end getJSON
});
</script>
<div id="dataGridRequestNDT"></div>
{{_col()}}
</div>
</div>
@@ -1,92 +0,0 @@
<?php
$selectType = "RFI_Type1";
if(getisset("type"))
{
$selectType = get("type");
}
$templateInfo = document_template($selectType);
$templateName = $templateInfo->files;
$tableName = "r_f_i_s";
$title = $templateInfo->title;
$outputFilePath = "006_RFI/";
$outputFileName = "rfi_no";
$numberColumn = "rfi_no";
$relationDatas = [
'subcontractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'thirdparty' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'contractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'itp' => db("i_t_p_s")->groupBy("itp_no")->get()->pluck("itp_no")->toArray(),
];
?>
<script>
$(function() {
function updateSuccess() {
$.get('?ajax=get-rfi-no', function(d) {
$("[name='rfi_no']").val(d.trim());
});
}
$("[name='itp']").change(function() {
var itp = $(this).val();
if (itp) {
$.ajax({
url: '{{autocomplete_url("i_t_p_s", "item_no")}}&filter={"itp_no":"' + itp + '"}',
type: 'GET',
dataType: 'json',
success: function(data) {
var phaseSelect = $("[name='phase']");
phaseSelect.empty();
phaseSelect.append('<option value="">Select Phase</option>');
$.each(data, function(index, item) {
phaseSelect.append('<option value="' + item.item_no + '">' + item.item_no + '</option>');
});
},
error: function(xhr, status, error) {
console.error('AJAX Error: ' + status + error);
}
});
} else {
$("[name='phase']").empty().append('<option value="">Select Phase</option>');
}
});
$("[name='phase']").change(function() {
$.getJSON('{{row_detail_url("i_t_p_s", "item_no")}}?value=' + $(this).val(), function(d) {
$("[name='description']").val(d.inspection_step_en);
$("[name='description_ru']").val(d.inspection_step_ru);
});
});
$.get('?ajax=get-rfi-no', function(d) {
$("[name='rfi_no']").val(d.trim());
});
});
</script>
@if(isAdmin())
{{col("col-12","")}}
<select name="" onchange="location.href='?type='+$(this).val(); " id="" class="form-control">
<?php $types = ['RFI_Type1', 'RFI_Type2'];
foreach($types AS $type) {
?>
<option value="{{$type}}" <?php if(getesit("type", $type)) echo "selected"; ?>>{{$type}}</option>
<?php } ?>
</select>
{{_col()}}
@endif
@include("admin.type.inc.excel-form-templates")
@if(getesit("type", "RFI_Type2"))
<style>
.creator-form{
width: 100%;
}
</style>
@endif
@@ -1,171 +0,0 @@
<?php
if(getisset("save")) {
$documentInfo = document_template(post("document_id"));
$j = j($documentInfo->json);
$post = $_POST;
unset($post['_token']);
unset($post['document_id']);
unset($post['html']);
$document = pdf_html_content(urldecode(post("html")));
foreach($post AS $field => $value)
{
if(strpos($field, "date") !== false) {
$value = date("d.m.Y", strtotime($value));
}
$document = str_replace("{{$field}}", $value, $document);
}
$path = $documentInfo->kid;
$fileName = $post['rfi_no'];
$path = "$path/$fileName";
html_create($path, $document, $j['paper']);
unset($post['custom']);
db("r_f_i_s")->updateOrInsert([
'rfi_no' => $post['rfi_no']
], $post);
$fullPath = url("storage/documents/$path");
echo "<a href='$fullPath.pdf' target='_blank' class='btn btn-primary'>Download PDF File</a>";
exit();
}
$rfiDocs = db("document_templates")->where("type", "rfi")->get() ?>
<div class="content">
<div class="row">
{{col("col-12","")}}
<select onchange="location.href='?select='+$(this).val();" name="" id="" class="form-control">
<option value="">{{e2("Select Document")}}</option>
@foreach($rfiDocs AS $rfiDoc)
<option value="{{$rfiDoc->id}}" @if(getesit("select", $rfiDoc->id)) selected @endif>{{$rfiDoc->title}}</option>
@endforeach
</select>
{{_col()}}
@if(!getesit("select", ""))
<?php $doc = db("document_templates")->where("id", get("select"))->first();
$relationDatas = [
'subcontractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'thirdparty' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'contractor' => db("subcontractors")->select("company_name_ru")->get()->pluck("company_name_ru")->toArray(),
'itp' => db("i_t_p_s")->groupBy("itp_no")->get()->pluck("itp_no")->toArray(),
];
$formHtml = replacePlaceholdersWithInputs($doc->html, $relationDatas);
?>
{{col("col-12",$doc->title)}}
<form action="?save" method="post" class="creator-form">
<input type="hidden" name="document_id" value="{{get("select")}}">
@csrf
<div class="print-pdf">
<?php echo $formHtml ?>
</div>
<button type="button" id="save-button" class="btn btn-primary btn-lg">{{e2("Save")}}</button>
</form>
<script>
$(document).ready(function() {
$("[name='itp']").change(function() {
var itp = $(this).val();
if (itp) {
$.ajax({
url: '{{autocomplete_url("i_t_p_s", "item_no")}}&filter={"itp_no":"' + itp + '"}',
type: 'GET',
dataType: 'json',
success: function(data) {
var phaseSelect = $("[name='phase']");
phaseSelect.empty();
phaseSelect.append('<option value="">Select Phase</option>');
$.each(data, function(index, item) {
phaseSelect.append('<option value="' + item.item_no + '">' + item.item_no + '</option>');
});
},
error: function(xhr, status, error) {
console.error('AJAX Error: ' + status + error);
}
});
} else {
$("[name='phase']").empty().append('<option value="">Select Phase</option>');
}
});
$("[name='phase']").change(function() {
$.getJSON('{{row_detail_url("i_t_p_s", "item_no")}}?value=' + $(this).val(), function(d) {
$("[name='description']").val(d.inspection_step_en);
$("[name='description_ru']").val(d.inspection_step_ru);
});
});
$('#save-button').click(function() {
var printPdfClone = $('.print-pdf').clone();
printPdfClone.find('input, textarea, select').each(function() {
var element = $(this);
var value = "{" + element.attr("name") + "}";
console.log(element.attr("type"));
if(element.attr("type") == "checkbox" || element.attr("type") == "radio")
{
if($(this).is(":checked")) {
value = '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">'
+'<path d="M9 16.2L4.8 12L3.4 13.4L9 19L21 7L19.6 5.6L9 16.2Z" fill="black"/>'
+'</svg>';
} else {
value = "";
}
}
element.replaceWith(value);
});
var form = $('.creator-form');
var formData = form.serializeArray();
var htmlContent = printPdfClone.html();
formData.push({name: 'html', value: encodeURIComponent(htmlContent)});
$.ajax({
url: form.attr('action'),
method: form.attr('method'),
data: formData,
success: function(response) {
// Başarılı sonuç işlemleri
console.log('Form başarıyla gönderildi', response);
Swal.fire('Success', response, 'success');
$.get('?ajax=get-rfi-no', function(d) {
$("[name='rfi_no']").val(d.trim());
});
},
error: function(jqXHR, textStatus, errorThrown) {
// Hata işlemleri
console.log('Form gönderme hatası', textStatus, errorThrown);
Swal.fire('Error', errorThrown, 'error');
}
});
});
$.get('?ajax=get-rfi-no', function(d) {
$("[name='rfi_no']").val(d.trim());
});
});
</script>
{{_col()}}
@endif
</div>
</div>
@@ -1,156 +0,0 @@
<?php $status = j(setting("rfi-status")); ?>
<div class="content">
<div class="row">
{{col("col-md-4","RFI Summary")}}
<div id="rfiSummaryGrid"></div>
{{_col()}}
{{col("col-md-4","Subcontractor")}}
<div id="subcontractorGrid"></div>
{{_col()}}
{{col("col-md-4","RFI Opening Period")}}
<div id="monthlyGrid"></div>
{{_col()}}
{{col("col-12","RFI Summary Chart")}}
<div id="rfiSummaryChart"></div>
{{_col()}}
{{col("col-md-6","RFI Summary Pie Chart")}}
<div id="rfiSummaryPieChart"></div>
{{_col()}}
{{col("col-md-6","RFI Subcontractor Pie Chart")}}
<div id="rfiSubcontractorPieChart"></div>
{{_col()}}
</div>
</div>
<script>
$(function(){
$.getJSON('?ajax=rfi-dashboard', function(json) {
$("#rfiSummaryGrid").dxDataGrid({
dataSource: json.rfi_summary,
showBorders: true,
columns: [
{ dataField: "status", caption: "Status" },
{ dataField: "count", caption: "Count" }
]
});
$("#rfiSummaryPieChart").dxPieChart({
dataSource: json.rfi_summary,
// palette: ['#FF5733', '#33FF57', '#3357FF', '#FF33A1', '#33FFF4', '#F4FF33'],
series: [{
argumentField: "status",
valueField: "count",
label: {
visible: true,
connector: {
visible: true
},
format: "fixedPoint",
customizeText: function(e) {
return e.argumentText + ": " + e.valueText;
}
}
}],
title: "RFI Summary (Pie Chart)",
legend: {
horizontalAlignment: "center",
verticalAlignment: "bottom"
},
tooltip: {
enabled: true,
customizeTooltip: function (arg) {
return {
text: arg.argumentText + ": " + arg.valueText + " (" + arg.percent.toFixed(2) + "%)"
};
}
}
});
$("#subcontractorGrid").dxDataGrid({
dataSource: json.subcontractor,
showBorders: true,
columns: [
{ dataField: "subcontractor", caption: "Subcontractor" },
<?php foreach ($status as $stat): ?>
{ dataField: "<?= $stat ?>", caption: "<?= $stat ?>" },
<?php endforeach; ?>
{ dataField: "Overall", caption: "Overall" }
]
});
$("#monthlyGrid").dxDataGrid({
dataSource: json.monthly,
showBorders: true,
columns: [
{ dataField: "month", caption: "Month" },
{ dataField: "qty", caption: "Quantity" }
]
});
$("#rfiSummaryChart").dxChart({
dataSource: json.rfi_summary,
commonSeriesSettings: {
argumentField: "status",
type: "bar",
color: function(info) {
// Generate a random color for each bar
const colors = ['#FF5733', '#33FF57', '#3357FF', '#FF33A1', '#33FFF4', '#F4FF33'];
return colors[info.index % colors.length];
}
},
series: [
{ valueField: "count", name: "Count" }
],
argumentAxis: {
label: {
rotationAngle: -45,
overlappingBehavior: "stagger"
}
},
title: "RFI Summary",
legend: {
visible: false
},
tooltip: {
enabled: true,
customizeTooltip: function (arg) {
return {
text: arg.argumentText + ": " + arg.valueText
};
}
}
});
$("#rfiSubcontractorPieChart").dxPieChart({
dataSource: json.subcontractor,
// palette: ['#FF5733', '#33FF57', '#3357FF', '#FF33A1', '#33FFF4', '#F4FF33'],
series: [{
argumentField: "subcontractor",
valueField: "Overall",
label: {
visible: true,
connector: {
visible: true
},
format: "fixedPoint",
customizeText: function(e) {
return e.argumentText + ": " + e.valueText;
}
}
}],
title: "RFI by Subcontractor",
legend: {
horizontalAlignment: "center",
verticalAlignment: "bottom"
},
tooltip: {
enabled: true,
customizeTooltip: function (arg) {
return {
text: arg.argumentText + ": " + arg.valueText + " (" + arg.percent.toFixed(2) + "%)"
};
}
}
});
});
});
</script>
@@ -1,270 +0,0 @@
<?php $disciplines = db("disciplines")->groupBy("discipline_title")->get()->pluck("discipline_title")->toArray(); ?>
<?php $contractors = db("subcontractors")
->whereNotIn("job_description", ['ENGINEERING', 'CONSTRUCTION','EMPLOYER'])
->groupBy("company_name_en")->get()->pluck("company_name_en")->toArray(); ?>
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
<div class="block-options">
<form action="" method="get">
<div class="input-group">
<input type="date" name="d1" value="{{get("d1")}}" id="" class="form-control">
<input type="date" name="d2" value="{{get("d2")}}" id="" class="form-control">
<select name="discipline" id="" class="form-control">
<option value="">{{e2("All Discipline")}}</option>
@foreach($disciplines AS $discipline)
<option value="{{$discipline}}" @if(getesit("discipline", $discipline)) selected @endif>{{$discipline}}</option>
@endforeach
</select>
<select name="contractor" id="" class="form-control">
<option value="">{{e2("All Contractor")}}</option>
@foreach($contractors AS $contractor)
<option value="{{$contractor}}" @if(getesit("contractor", $contractor)) selected @endif>{{$contractor}}</option>
@endforeach
</select>
<button class="btn btn-primary"><i class="fa fa-search"></i></button>
</div>
</form>
</div>
</div>
<div class="block-content">
<div id="kanban"></div>
</div>
<script>
$(() => {
const statuses = <?php echo setting("rfi-status") ?>;
var tasks;
$.getJSON("?ajax=rfi-tasks&{!! http_build_query($_GET) !!}", function(tasks2){
console.log(tasks);
tasks = tasks2;
renderKanban($('#kanban'), statuses);
});
function renderKanban($container, statusList) {
statusList.forEach((status) => {
renderList($container, status);
});
$container.addClass('scrollable-board').dxScrollView({
direction: 'horizontal',
showScrollbar: 'always',
});
$container.addClass('sortable-lists').dxSortable({
filter: '.list',
itemOrientation: 'horizontal',
handle: '.list-title',
moveItemOnDrop: true,
onDragEnd: function(e) {
console.log(e);
}
});
}
function renderList($container, status) {
const $list = $('<div>').addClass('list').appendTo($container);
renderListTitle($list, status);
console.log(tasks);
const listTasks = tasks.filter((task) => task.status === status);
renderCards($list, listTasks);
}
function renderListTitle($container, status) {
$('<div>')
.addClass('list-title')
.addClass('dx-theme-text-color')
.text(status)
.appendTo($container);
}
function renderCards($container, tasks) {
const $scroll = $('<div>').appendTo($container);
const $items = $('<div>').appendTo($scroll);
tasks.forEach((task) => {
renderCard($items, task);
});
$scroll.addClass('scrollable-list').dxScrollView({
direction: 'vertical',
showScrollbar: 'always',
});
$items.addClass('sortable-cards').dxSortable({
group: 'tasksGroup',
moveItemOnDrop: true,
onDragEnd: function(e) {
console.log(e);
window.setTimeout(function() {
var targetListElement = $(e.itemElement).closest(".list");
var listTitleElement = targetListElement.find(".list-title");
console.log(listTitleElement);
if (listTitleElement.length > 0) {
var rfiId = $(e.itemElement).attr("data-id");
console.log(listTitleElement.html());
console.log(rfiId);
$.get("?ajax=rfi-task-update", {
id : rfiId,
status: listTitleElement.html(),
}, function(d) {
});
} else {
console.log("List title not found");
}
}, 100);
}
});
}
<?php
$index = 1;
$priority = array_combine($disciplines, range($index, count($disciplines) + $index - 1)); ?>
var priority = <?php echo json_encode_tr($priority) ?>;
console.log(priority['QA/QC']);
function renderCard($container, task) {
const $item = $('<div>')
.addClass('card')
.addClass('dx-card')
.addClass('dx-theme-text-color')
.addClass('dx-theme-background-color')
.attr("data-id", task.id)
.appendTo($container);
// const employee = employees.filter((e) => e.ID === task.id)[0];
var priority_number = 1;
if(typeof task.discipline !== "undefined") {
priority_number = priority[task.discipline];
}
$('<div>').addClass('card-priority').addClass(`priority-${priority_number}`).appendTo($item);
$('<div>').addClass('card-subject').text("Discipline: " + task.discipline).appendTo($item);
$('<div>').addClass('card-assignee').text("RFI No: " + task.rfi_no).appendTo($item);
$('<div>').addClass('card-assignee').text("Date: " + task.inspection_date).appendTo($item);
$('<div>').addClass('card-assignee').text("Description: " + task.description).appendTo($item);
$('<div>').addClass('card-assignee').text("Item No: " + task.working_documents).appendTo($item);
$('<div>').addClass('card-assignee').text("QA Resp: " + task.contractor_responsiable_1).appendTo($item);
$('<div>').addClass('card-assignee').text("Subcon Resp: " + task.subcontractor_responsiable).appendTo($item);
$('<div>').addClass('card-assignee').text("Remarks: " + task.remarks).appendTo($item);
//$('<div>').addClass('card-assignee').text(employee.contractor).appendTo($item);
}
});
</script>
<style>
.scrollable-board, .scrollable-board .dx-scrollable-content {
white-space: nowrap;
}
.scrollable-board .list .dx-scrollable-content,
.scrollable-board .list .card {
white-space: normal;
word-wrap: break-word;
}
.list {
border-radius: 8px;
margin: 5px;
background-color: rgba(192, 192, 192, 0.4);
display: inline-block;
vertical-align: top;
white-space: normal;
}
.list-title {
font-size: 16px;
padding: 10px;
padding-left: 30px;
margin-bottom: -10px;
font-weight: bold;
cursor: pointer;
}
.scrollable-list {
height: 80vh;
min-width: 200px;
}
@media screen and (min-width: 768px) {
.scrollable-list {
width: calc((100vw - 385px) / 2);
}
}
@media screen and (min-width: 1500px) {
.scrollable-list {
width: calc((100vw - 385px) / 5);
}
}
.sortable-cards {
min-height: 380px;
}
.card {
position: relative;
background-color: white;
box-sizing: border-box;
width: calc(100% - 17px);
padding: 10px 20px;
margin: 10px;
cursor: pointer;
}
.card-subject {
padding-bottom: 10px;
}
.card-assignee {
opacity: 0.6;
}
.card-priority {
position: absolute;
top: 10px;
bottom: 10px;
left: 5px;
width: 5px;
border-radius: 2px;
background: #86c285;
}
.priority-1 {
background: #adadad;
}
.priority-2 {
background: #86c285;
}
.priority-3 {
background: #edc578;
}
.priority-4 {
background: #ef7d59;
}
</style>
</div>
</div>
</div>
@@ -1,263 +0,0 @@
<?php
use App\Models\RFI;
$title = "RFI Logs";
$tableWidth="100%";
$listDatas = RFI::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "r_f_i_s";
$prependColumns = [];
$relationDatas = [
'created_rfi' => [
'type' => 'link-search',
'html' => '<i class="fa fa-file-pdf" title="View Created RFI" style="color: #ffc107; font-size: 16px;"></i>'
],
'signed_rfi' => [
'type' => 'link-search',
'html' => '<i class="fa fa-file-pdf" title="View Signed RFI" style="color: #28a745; font-size: 16px;"></i>'
],
'status' => [
'values' => j(setting("rfi-status")),
'type' => 'manuel-select',
'default' => 'Inspection Waiting'
],
'discipline' => [
'values' => db("disciplines")->groupBy("discipline_title")->get()->pluck("discipline_title")->toArray(),
'type' => 'manuel-select'
],
'itp' => [
'values' => db("i_t_p_s")->groupBy("itp_no")->get()->pluck("itp_no")->toArray(),
'type' => 'manuel-select',
],
'subcontractor' => [
'values' => db("subcontractors")
->whereNotIn("job_description", ['ENGINEERING', 'CONSTRUCTION','EMPLOYER'])
->groupBy("company_name_en")->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select',
],
'contractor' => [
'values' => db("subcontractors")
->whereIn("job_description", ['ENGINEERING', 'CONSTRUCTION','EMPLOYER'])
->groupBy("company_name_en")
->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select',
],
'thirdparty' => [
'values' => db("subcontractors")
->whereIn("job_description", ['ENGINEERING', 'CONSTRUCTION','EMPLOYER'])
->groupBy("company_name_en")
->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select',
],
'company' => [
'values' => db("subcontractors")
->whereIn("job_description", ['ENGINEERING', 'CONSTRUCTION','EMPLOYER'])
->groupBy("company_name_en")
->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select',
],
'qc_activity' => [
'values' => db("q_c_activities")
->get()
->pluck("title")
->toArray(),
'type' => 'manuel-select',
],
/*
'unit' => [
'values' => db("weld_logs")
->groupBy("design_area")
->get()->pluck("design_area")->toArray(),
'type' => 'manuel-select',
],
*/
'the_period_between' => [
'values' => [
'Daily',
'Weekly',
'Monthly',
],
'type' => 'manuel-select',
],
];
$blockGroup = [
'Preparation' => [
'created_rfi',
'signed_rfi',
'preparing_date',
'preparing_time',
'project_no',
'itp',
'discipline',
'rfi_no',
],
'Responsibility' => [
'inspection_date',
'inspection_time',
'the_period_between',
'subcontractor',
'subcontractor_responsiable',
'contractor',
'contractor_responsiable_1',
'thirdparty',
'thirdparty_responsiable_2',
'company',
'company_responsiable_3',
],
'Location' => [
'unit',
'area',
'location',
],
'Inspection' => [
'qc_activity',
'phase',
'item',
'description',
'description_ru',
'working_documents',
'system',
'subsystem',
],
'Inspection Steps' => [
'sub',
'ste',
'cas',
'mf',
],
'Project Details' => [
'revision',
'revision_reasions',
'result_date',
'status',
'remarks',
],
];
$dataGridOptions = '
onCellValueChanged: function(e) {
console.log("onCellValueChanged");
if (e.column.dataField === "discipline") {
var rowIndex = e.row.rowIndex;
var rowData = e.data;
$.getJSON("?ajax=get-rfi-no&discipline=" + rowData.discipline, function(d) {
d = d.trim();
var dataGrid = $("#dataGrid").dxDataGrid("instance");
dataGrid.cellValue(rowIndex, "rfi_no", d);
});
}
},
onContentReady: function(e) {
var dataGrid = e.component;
if (typeof window.setupJointLogPopupHelpers === "function") {
window.setupJointLogPopupHelpers(dataGrid);
window.attachJointLogMagnifier("rfi_no");
}
},
';
$path = "006_RFI";
$prependColumns = [];
$firstUploadFolder = $path . "/001_Created_RFI";
$firstUploadTitle = "Upload Created RFI";
$secondUploadFolder = $path . "/002_Signed_RFI";
$secondUploadTitle = "Upload Signed RFI";
$uploadPermissionKey = 'rfi_log_upload_permission';
?>
<script>
var dataGrid = $("#dataGrid").dxDataGrid("instance");
function cellValueChanged(e) {
console.log("onCellValueChanged");
if (e.column.dataField === "discipline") {
var rowIndex = e.row.rowIndex;
var rowData = e.data;
$.getJSON("?ajax=get-rfi-no&discipline=" + rowData.discipline, function(d) {
d = d.trim();
// Önceden oluşturulan DataGrid örneğini kullanarak işlemi gerçekleştirin
dataGrid.cellValue(rowIndex, "rfi_no", d);
});
}
}
function editorPreparing(e, dataRow) {
var options = e.editorOptions;
var rowIndex = e.row.rowIndex;
var rowData = e.row.data;
var dataGrid = $("#dataGrid").dxDataGrid("instance");
var exceptValue = ['undefined', 'null'];
var column = e.dataField;
var urlRowData = encodeURIComponent(JSON.stringify(rowData));
{{dxSelectBox("itp", "i_t_p_s", "itp_no", [] , [
'discipline' => '{discipline}',
])}}
{{dxSelectBox("phase", "i_t_p_s", "item_no",
[
'itp_no' => 'itp',
],
[
'description' => '{inspection_step_en}',
'description_ru' => '{inspection_step_ru}',
'sub' => '{subcontractor}',
'ste' => '{ste}',
'cas' => '{cas}',
'mf' => '{mf}',
]
)}}
{{dxAutocomplete("project_no", "weld_logs", "project", [], [
'unit' => '{design_area}',
])}}
if(e.dataField == "rfi_no") {
e.validationRules[0].type = "async";
}
/*
if(e.dataField == "discipline") {
console.log("ok");
options.onValueChanged = function(selectData) {
$.get('?ajax=get-rfi-no&discipline=' + rowData.discipline, function(d) {
d = d.trim();
dataGrid.cellValue(rowIndex, "rfi_no", d);
});
}
}
*/
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
@include("components.joint-release-popup")
</div>
</div>
-158
View File
@@ -1,158 +0,0 @@
<?php
use App\Models\RadiographicTest;
//$noRemoteOperations = true;
$title = "Radiographic Test";
$tableWidth="100%";
$listDatas = RadiographicTest::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "radiographic_tests";
//$tableType = "datagrid";
$relationDatas = [
'report_file' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'rt_result' => [
'datas' => [],
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
$blockGroup = [
'Info' => [
'report_file',
'contractor',
],
'Invoice' => [
'invoice_number',
'invoice_date',
],
'Laboratory' => [
'test_laboratory_rt',
],
'Project' => [
'project',
],
'Design' => [
'design_area',
'line_specification',
'line_number',
'fluid_code',
'service_category',
'fluid_group',
'operating_temperature_s',
'operating_pressure_mpa',
'external_finish_type',
],
'ISO Info' => [
'iso_number',
'quantity_of_iso',
'iso_rev',
'spool_number',
'type_of_joint',
'no_of_the_joint_as_per_as_built_survey',
'type_of_welds',
],
'Welding Info' => [
'welding_date',
'wps_no',
'welding_method',
'welding_materials_1',
'welding_materials_1_lot_no',
'welding_materials_1_certificate_no',
'welding_materials_2',
'welding_materials_2_lot_no',
'welding_materials_2_certificate_no',
'welder_1',
'welder_2',
],
'Element Info' => [
'certificate_no_1',
'wpq_report_1',
'certificate_no_2',
'wpq_report_2',
'member_no_1',
'material_no_1',
'ru_material_group_1',
'certificate_number_of_1',
'heat_number_1',
'nps_1',
'thickness_by_asme_1',
'outside_diameter_1',
'wall_thickness_1',
'element_code_1',
'member_no_2',
'material_no_2',
'ru_material_group_2',
'certificate_number_of_2',
'heat_number_2',
'nps_2',
'thickness_by_asme_2',
'outside_diameter_2',
'wall_thickness_2',
'element_code_2',
],
'RT Info' => [
'rt_scope',
'rt_request_no',
'rt_request_date',
'rt_report',
'rt_test_date',
'rt_result',
'control_standart',
'tester_name',
'real_welder_1',
'real_welder_2',
],
'Other' => [
'aa',
'ab',
'ac',
'ba',
'bb',
'bc',
'ca',
'cb',
'cc',
'da',
'db',
'dc',
'ea',
'eb',
'ec',
'fa',
'fb',
'fc',
'other',
],
];
$firstUploadFolder = '004_QA/0001_RT/';
$firstUploadTitle = 'Upload PDF';
$uploadPermissionKey = 'rt_log_upload_permission';
?>
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,68 +0,0 @@
@php
$spoolReleaseNdtData = include resource_path('views/admin/type/spool-release/ndt/setup-data.php');
extract($spoolReleaseNdtData);
@endphp
<div class="content">
<!-- Toolbar -->
<div class="row mb-3">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-0">
<?php
$releaseTitle = "NDT Release List";
if(isset($paint)) {
$releaseTitle = "Paint Release List";
}
echo $releaseTitle;
?>
</h5>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#releaseListModal">
<i class="fa fa-list"></i> {{e2("Open Release List")}}
</button>
</div>
</div>
</div>
</div>
</div>
<!-- Main Content: Sidebar and Info Panel -->
<div class="row">
<div class="col-md-6">
@include("admin.type.spool-release.ndt.sidebar", compact('field'))
</div>
<div class="col-md-6">
@include("admin.type.spool-release.ndt.info-panel", compact('field', 'weldInfos', 'paintInfos', 'showReleaseButton'))
</div>
</div>
</div>
<!-- Release List Modal -->
<div class="modal fade" id="releaseListModal" tabindex="-1" role="dialog" aria-labelledby="releaseListModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="releaseListModalLabel">
<?php
$releaseTitle = "NDT Release List";
if(isset($paint)) {
$releaseTitle = "Paint Release List";
}
echo $releaseTitle;
?>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
@include("admin.type.spool-release.ndt.release-list", compact('field'))
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{e2("Close")}}</button>
</div>
</div>
</div>
</div>
@@ -1,197 +0,0 @@
<?php
$disableNewModal = true;
use Carbon\Carbon;
$u = u();
$subcontructer = $u->subcontructer;
$paint_release_number_pattern = setting("paint_release_number_pattern");
if(getisset("checklist-ok")) {
if(!getesit("iso_number","")) {
$result = db("weld_logs")
->where("iso_number", get("iso_number"))
->where("spool_number", get("spool_number"))
->update([
"spool_paint_check" => u()->id
]);
bilgi(":result row sign check", "success", ['result'=> $result]);
}
}
?>
<?php
if(!getesit("iso_number","")) {
$paintInfos = db("weld_logs")->where("spool_status", "Paint");
$get = $_GET;
unset($get['ndt_paint_release']);
unset($get['ndt_release']);
unset($get['rollback']);
foreach($get AS $col => $value) {
if($value!="")
{
if(is_array($value)) {
$paintInfos = $paintInfos->whereIn($col, $value);
} else {
$paintInfos = $paintInfos->where($col, trim($value));
}
}
}
if(!getesit("ndt_paint_release", "")) {
$newRequestNo = $paint_release_number_pattern;
$newRequestNo = str_replace("{number}",date("ynjg"), $newRequestNo);
$ndtReleaseUpdate = $paintInfos;
$ndtReleaseUpdate = $ndtReleaseUpdate->whereNotNull("welding_date")->whereNotNull("painting_cycle");
$ndtReleaseUpdate = $ndtReleaseUpdate->update([
"paint_release_no" => $newRequestNo,
"paint_release_date" => Carbon::now(),
'spool_status' => "Completed",
]);
bilgi(":count Row affected", "info", ['count' => $ndtReleaseUpdate]);
}
$paintInfos = $paintInfos->get();
$showReleaseButton = false;
if(isset($paintInfos[0])) {
if($paintInfos[0]->spool_paint_check != "") {
$showReleaseButton = true;
}
}
}
?>
@include("admin.type.spool-release.rollback")
<script>
$(function(){
});
</script>
<style>
</style>
<div class="content">
<div class="row">
{{col("col-md-4","Spool List", 0, ['no-options'=>true])}}
@include("admin.type.spool-release.spool-list")
{{_col()}}
{{col("col-md-4","Paint Info", 0, ['no-options'=>true])}}
<form action="" method="get" class="mb-10">
<div class="row">
<div class="col-md-6">
{{e2("Iso Number")}}:
<input type="text" name="iso_number" value="{{get("iso_number")}}" id="" class="form-control">
</div>
<div class="col-md-6">
<?php
$selectSpools = [];
if(getisset("spool_number")) {
$selectSpools = get("spool_number");
}
?>
{{e2("SPL")}}:
<select name="spool_number" id="" class="form-control select2">
<?php
$spoolNumbers = db("weld_logs")
->groupBy("spool_number")
->select("spool_number");
if(!getesit("iso_number", "")) {
$spoolNumbers = $spoolNumbers->where("iso_number", get("iso_number"));
}
$spoolNumbers = $spoolNumbers->get()
->pluck("spool_number")
->toArray();
foreach($spoolNumbers AS $spoolNumber) {
?>
<option value="{{$spoolNumber}}" {{getesit("spool_number", $spoolNumber) ? "selected" : ""}}>{{$spoolNumber}}</option>
<?php
}
?>
</select>
</div>
<div class="col-md-12">
<?php
$paintingCycles = db("weld_logs")
->groupBy("painting_cycle")
->select("painting_cycle")
->whereNotNull("painting_cycle")
->where("iso_number", get("iso_number"))
->get();
?>
@if($paintingCycles)
{{e2("Painting Cycle")}}:
<?php
foreach($paintingCycles AS $paintingCycle) {
?>
<div class="badge badge-success">{{$paintingCycle->painting_cycle}}</div>
<?php
}
?>
@endif
</div>
<div class="col-md-4 text-center">
<button class="btn btn-primary mt-5">{{e2("Filter")}}</button>
</div>
<?php if(!getesit("iso_number","")) {
?>
<div class="col-md-8 text-center">
<?php if(is_stellar()) {
?>
@if($showReleaseButton)
<a href="?{{http_build_query($_GET)}}&ndt_paint_release=ok" teyit="{{e2("Are you sure for ndt paint release spool?")}}" class="btn btn-outline-warning mt-5">{{e2("NDT & Paint Release")}}</a>
@endif
<?php } ?>
</div>
<?php } ?>
</div>
</form>
@if(!getesit("iso_number",""))
@include("admin.type.spool-release.paint-info")
@endif
{{_col()}}
{{col("col-md-4","Paint List", 0, ['no-options'=>true])}}
@include("admin.type.spool-release.ndt-release-paint-list")
{{_col()}}
</div>
</div>
@@ -1,4 +0,0 @@
<?php $paint = "ok";
?>
@include("admin.type.spool-release-ndt")
@@ -1,15 +0,0 @@
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
</div>
</div>
</div>
</div>
@@ -1 +0,0 @@
@include("admin.type.spool-release-ndt")
@@ -1,59 +0,0 @@
<?php
use App\Models\Subcontractor;
$title = "Subcontractor";
$tableWidth="100%";
/*
$levels = [
'Welder, Painter, Insulator (Subcontractor / Payrollless)',
'Welder (Subcontractor)',
'',
'',
];
*/
$blockGroup = [
'General Information' => [
'company_name_en',
'company_name_ru',
'company_code',
'sign_order',
],
'Job Information' => [
'job_description',
'operation_type',
],
'Address Information' => [
'city',
'logo',
'tax',
'address_ru',
'tax2',
'address_ru2',
'address_en',
'project_city_ru',
'project_city_en',
]
];
$listDatas = Subcontractor::orderBy("id","DESC")
->paginate(setting('row_count'));
$tableName = "subcontractors";
$relationDatas = [
'job_description' => [
'datas' => db("job_descriptions")->get(),
'pattern' => '{title}',
'type' => 'select-dropdown'
],
];
?>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,7 +0,0 @@
<?php
// Fetch the cached content
$cachedContent = Storage::get('cache/summary.blade.php');
// Display the cached content
echo $cachedContent;
?>
@@ -1,167 +0,0 @@
<?php
use App\Models\Support;
//$noRemoteOperations = true;
$title = "Support";
$tableWidth="100%";
$listDatas = Support::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "supports";
$requiredFields = [
'zone',
];
$erectionTypes = j(setting("erection_type")) ?? [];
$erectionMaterialNames = j(setting("erection_materials_name")) ?? [];
$relationDatas = [
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'materials' => [
'values' => db("materials")->get()->pluck("steel_grade")->toArray(),
'type' => 'manuel-select'
],
'erection_type' => [
'values' => $erectionTypes,
'type' => 'manuel-select'
],
'erection_materials_name' => [
'values' => $erectionMaterialNames,
'type' => 'manuel-select'
],
'designer' => [
'datas' => db("subcontractors")->where("job_description", "ENGINEERING")->get(),
'pattern' => '{company_name_en}',
'type' => 'select-dropdown'
],
'style' => [
'values' => ['Standart', 'Special'],
'type' => 'manuel-select'
],
/*
'welded_pad_measure' => [
'values' => ['200x100', '2*200x100', '3*200x100'],
'type' => 'manuel-select'
],
*/
];
$blockGroup = [
/*
'download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
*/
'General Info' => [
'download',
'designer',
'erection_materials_name',
'dwg_no',
'support_code',
'status',
'rev',
],
'Material Info' => [
'materials',
'pipe_dia',
'welded_pad_measure',
'thickness',
'ancillary',
'element_no',
],
'Location Info' => [
'erection_type',
'zone',
],
'Drawing Info' => [
'line_number',
'drawing_no',
'standart',
'elevation',
],
'Quantity Info' => [
'quantity',
'unit_weight',
'assembled_su_rt_quanti',
],
'Date Info' => [
'weld_or_assembled_date',
],
'Weight Info' => [
'total_weight',
],
'Remarks' => [
'remarks',
],
];
$firstUploadFolder = '001_Drawings/004_Support/';
$firstUploadTitle = 'Upload PDF';
?>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
<script>
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
{{dxAutocomplete("drawing_no", "document_revisions", "drawing_no", "", [
'zone' => '{zone}',
'line_number' => '{line_number}',
])}}
{{dxAutocomplete("line_number", "document_revisions", "line_number", "", [
'zone' => '{zone}',
'drawing_no' => '{drawing_no}',
])}}
if(e.dataField == "quantity") {
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
var calculateValue = Math.round(selectData.value * dataRow.unit_weight * 100)/100;
dataGrid.cellValue(rowIndex, "total_weight", calculateValue);
}
}
if(e.dataField == "unit_weight") {
options.onValueChanged = function(selectData) {
e.setValue(selectData.value);
var calculateValue = Math.round(selectData.value * dataRow.quantity * 100)/100;
dataGrid.cellValue(rowIndex, "total_weight", calculateValue);
}
}
/*
if(e.dataField == "weld_or_assembled_date") {
console.log("weld_or_assembled_date");
console.log(dataRow);
if (dataRow.erection_type === "Weld") {
e.editorOptions.readOnly = true;
} else {
e.editorOptions.readOnly = false;
}
}
*/
}
</script>
@@ -1,69 +0,0 @@
<?php
use App\Models\NaksCertificate;
$title = "Technology Summary";
$tableWidth="200%";
$path = "admin.type.naks-technology";
//$tableType = "classic-table";
$tableName = "naks_certificates";
$prependColumns = [
'Download' => [
'type' => 'link-search',
'path' => '003_Welding_Database/0000_Naks Technology/',
'pattern' => "{short_number}*{certificate_no}*.pdf",
'html' => '<i class="fa fa-download"></i>'
],
'Certificate No' => [
'type' => 'text',
'pattern' => "{short_number}-{certificate_no}"
],
'Material Group' => [
'type' => 'text',
'pattern' => "{mat_group_1} + {mat_group_2}"
],
'Certification Loc' => [
'type' => 'text',
'pattern' => "{short_name}"
]
];
$summaryTable = true;
// Block group definition, grouped by subject
$blockGroup = [
'Certificate Information' => [
'short_number',
'certificate_no',
],
'Welding Details' => [
'welding_method',
'technology_category',
'mat_group_1',
'mat_group_2',
'work_type',
'pwht',
],
'Validity' => [
'valid_to',
'valid_from',
]
];
?>
<style>
.add-btn {
display:none;
}
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
@@ -1,352 +0,0 @@
<?php
use App\Models\TestPackage;
$title = "Test Pack Base Status";
$tableWidth="100%";
$listDatas = TestPackage::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "test_packages";
$relationDatas = [
'punch_list_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'test_pack_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
'reinstatement_status' => [
'values' => [
'Accepted',
'Rejected',
'In Progress',
'Reviewed',
],
'type' => 'manuel-select'
],
'subcontractor' => [
'values' => db("subcontractors")
->select("company_name_en")
->whereIn("job_description",['Montaj'])
->get()->pluck("company_name_en")->toArray(),
'type' => 'manuel-select'
],
'cleaning_blowing_drying_status' => [
'values' => [
'Accepted',
'Rejected',
'In Progress',
'Reviewed',
],
'type' => 'manuel-select'
],
'ndt_status' => [
'values' => [
'Accepted',
'Not Accepted',
],
'type' => 'manuel-select'
],
'status' => [
'values' => [
'Approved',
'Rejected',
'Canceled',
],
'type' => 'manuel-select'
],
'test_status' => [
'values' => [
'Tested',
'Not Tested',
],
'type' => 'manuel-select'
],
'leakage' => [
'values' => [
'YES',
'NO',
],
'type' => 'manuel-select'
],
];
/*
'unit',
*/
$blockGroup = [
'General Info' => [
'punch_list_download',
'test_pack_download',
'discipline',
'test_package_number',
'isolation',
'tracing',
'circuit_number',
'p_id',
'iso_quantity',
'subcontractor',
'responsible_person',
],
'General Status' => [
'tp_general_status',
],
'Welding Process' => [
'welding_status',
'total_wdi',
'total_complated_wdi',
'welding_progress',
'total_shop_wdi',
'total_complated_shop_wdi',
'total_field_wdi',
'total_complated_field_wdi',
],
'Test Info' => [
'test_type',
'test_medium',
'test_pressure',
'planned_test',
'responsible_test',
'priority',
'priority_info',
'rfi_no',
'rfi_date',
'test_status',
'test_date',
'leakage_test_pressure',
'leakage',
'leakage_test_date',
],
'Golden Joints' => [
'golden_joints',
],
'Test Pack Status' => [
'test_package_sent_date',
'status',
'test_package_approval_date',
],
'Test Pack Punch List' => [
'walkdown_date',
'punch_status',
'punch_list',
'a_punch_point_open',
'b_punch_point_open',
'c_punch_point_open',
],
'QC' => [
'received_by_qc',
],
'NDT Logs' => [
'ndt_status',
'vt_backlog',
'rt_backlog',
'ut_backlog',
'mt_backlog',
'pmi_backlog',
'pt_backlog',
'ferrit_backlog',
'pwht_backlog',
],
'Support Process' => [
'support_progress',
'support_remaining',
'welded_support_quantity',
],
'Repair' => [
// 'repair_status_total',
'repair_qty',
'repair_completed',
'repair_remaining',
],
'Cleaning' => [
'cleaning_blowing_drying_rfi',
'responsible_cleaning',
'cleaning_blowing_drying_status',
'cleaning_blowing_drying_date',
'cleaning_blowing_drying_rfi_no',
],
'Reinstatement' => [
'reinstatement_rfi',
'responsible_reinstatement',
'reinstatement_status',
'reinstatement_date',
'cw',
'system_combine',
'planned_test_date',
'remarks',
],
];
/*
'test_package_number',
'circuit_number',
'p_id',
'iso_quantity',
'subcontractor',
'welding_status',
'total_wdi',
'total_complated_wdi',
'total_shop_wdi',
'total_complated_shop_wdi',
'total_field_wdi',
'total_complated_field_wdi',
'test_type',
'test_medium',
'test_pressure',
'golden_joints',
'tp_general_status',
'test_package_sent_date',
'status',
'test_package_approval_date',
'walkdown_date',
'punch_list',
'a_punch_point_open',
'b_punch_point_open',
'c_punch_point_open',
'received_by_qc',
'ndt_status',
'repair_status_total',
'planned_test',
'responsible_test',
'rfi_no',
'rfi_date',
'test_status',
'cleaning_blowing_drying_rfi',
'responsible_cleaning',
'cleaning_blowing_drying_status',
' ',
'cleaning_blowing_drying_rfi_no',
'reinstatement_rfi',
'responsible_reinstatement',
'reinstatement_status',
'reinstatement_date',
'cw',
'priority',
'priority_info',
'system_combine',
'planned_test_date',
*/
$firstUploadFolder = '008_Test_Pack/002_TP_(Scan)/';
$firstUploadTitle = 'Upload Scan PDF';
?>
<script>
var readOnly = [
'unit',
'discipline',
'test_package_number',
'circuit_number',
'p_id',
'iso_quantity',
// 'subcontractor',
'welding_status',
'total_wdi',
'total_complated_wdi',
'total_shop_wdi',
'total_complated_shop_wdi',
'total_field_wdi',
'total_complated_field_wdi',
'test_type',
'test_medium',
'test_pressure',
'golden_joints',
'tp_general_status',
/*
'test_package_sent_date',
'status',
'test_package_approval_date',
'walkdown_date',
*/
'punch_status',
'punch_list',
'a_punch_point_open',
'b_punch_point_open',
'c_punch_point_open',
//'received_by_qc',
'ndt_status',
'repair_status_total',
// 'planned_test',
// 'responsible_test',
//'rfi_no',
//'rfi_date',
// 'cleaning_blowing_drying_rfi',
// 'responsible_cleaning',
// 'cleaning_blowing_drying_status',
// 'cleaning_blowing_drying_date',
// 'cleaning_blowing_drying_rfi_no',
// 'reinstatement_rfi',
// 'responsible_reinstatement',
// 'reinstatement_status',
// 'reinstatement_date',
// 'cw',
// 'priority',
// 'priority_info',
// 'system_combine',
// 'planned_test_date',
// 'remarks',
// 'test_date',
// 'test_status',
];
function FocusedCellChanged(e, dataRow) {
{{onPreparingVariables()}}
var status;
if(typeof e.row !== "undefined") {
var dataRow = e.row.data;
/*
if(dataRow.test_package_sent_date != null) {
status = "Prepairing";
}
if(dataRow.test_package_approval_date != null) {
status = "Waiting Punch";
}
if(dataRow.walkdown_date != null) {
status = "Construction";
}
if(dataRow.received_by_qc != null) {
status = "QC";
}
if(dataRow.cleaning_blowing_drying_date != null) {
status = "Cleaining / Blowing";
}
if(dataRow.responsible_reinstatement != null) {
status = "Reinstatement";
}
e.component.cellValue(rowIndex, "tp_general_status", status);
*/
}
}
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
if(e.dataField == "tp_general_status") {
e.editorOptions.readOnly = true;
}
if(readOnly.includes(e.dataField) && (!e.row.isNewRow)) {
e.editorOptions.readOnly = true;
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("admin.type.document.upload")
@include("components.blocks.module-block")
</div>
</div>
@@ -1,150 +0,0 @@
<?php
use App\Models\TestPackBaseStatus;
$title = "Test Pack ISO Base Status";
$tableWidth="100%";
$listDatas = TestPackBaseStatus::orderBy("id","DESC")->paginate(setting('row_count'));
$tableName = "test_pack_base_statuses";
/*
*/
$relationDatas = [
'test_pack_download' => [
'type' => 'link-search',
'html' => '<i class="fa fa-pdf"></i>'
],
];
$blockGroup = [
'General Info' => [
'test_pack_download',
'area',
'drawing_no',
'test_package_no',
'subcontractor',
// 'responsible_person',
],
'TP General Status' => [
'tp_status'
],
'Iso Info' => [
'iso_qty',
'priority',
'priority_info',
],
'Test Packets' => [
'target_test_date',
'test_type',
'test_medium',
'test_pressure_mpa',
],
'Welding Process'=> [
'total_iso_quantity',
'welding_status',
'remaining_wdi',
'total_wdi',
'total_complated_wdi',
'pipe_progress',
'total_joint_qty',
'total_welded_joint_qty',
],
'Support Process' => [
'support_progress',
'support_remaining',
'welded_support_quantity',
],
'Repair' => [
'repair_qty',
'repair_completed',
'repair_remaining',
],
'Punch Lists' => [
'punch_status',
'punch_a_quantity',
'punch_b_quantity',
'punch_c_quantity',
],
'NDT Logs' => [
'vt_backlog',
'rt_backlog',
'ut_backlog',
'mt_backlog',
'pmi_backlog',
'pt_backlog',
'ferrit_backlog',
'pwht_backlog',
],
'Remarks' => [
'remarks',
'discipline',
],
];
?>
<script>
var readOnly = [
'priority',
'priority_info',
'drawing_no',
'test_package_no',
'subcontractor',
// 'responsible_person',
'iso_qty',
'target_test_date',
// 'test_type',
// 'test_medium',
// 'test_pressure_mpa',
'tp_status',
'total_iso_quantity',
'welding_status',
'remaining_wdi',
'total_wdi',
'total_complated_wdi',
'pipe_progress',
'total_joint_qty',
'total_welded_joint_qty',
'welded_support_quantity',
/*
'punch_a_quantity',
'punch_b_quantity',
'punch_c_quantity',
*/
'repair_qty',
'rt_ut_status',
'rt_ut_backlog',
'rt_ut_done',
'mt_pt_backlog',
'mt_pt_done',
'discipline',
'area',
];
function editorPreparing(e, dataRow) {
{{onPreparingVariables()}}
if(readOnly.includes(e.dataField) && (!e.row.isNewRow)) {
e.editorOptions.readOnly = true;
}
}
</script>
<style>
</style>
<div class="content">
<div class="row">
@include("components.blocks.module-block")
</div>
</div>
File diff suppressed because it is too large Load Diff
@@ -1,972 +0,0 @@
<?php
use Illuminate\Support\Facades\Cache;
$registerColumnBased = 'test_package_number';
$c = $c ?? (object)['icon' => 'file-text', 'title' => 'Test Package Creator 2'];
?>
<div class="content">
<div class="block">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-{{$c->icon}}"></i> {{e2($c->title)}}</h3>
</div>
<div class="block-content">
<div class="row mb-10">
<!-- Progress Tracker Container (AJAX Loaded) -->
<div class="col-12" id="progress-tracker-container"></div>
<div class="col-md-6">
<?php if(getisset("save"))
{
$oldArray = j(setting("tp_creator_states"));
if(!is_array($oldArray)) $oldArray = [];
$oldArray[post("title")] = post("data");
setting_put("tp_creator_states", $oldArray);
bilgi("State is saved");
} ?>
<?php $states = j(setting("tp_creator_states"));
if(!getesit("delete", "")) {
unset($states[get("delete")]);
setting_put("tp_creator_states", $states);
}
?>
<select name="" onchange="location.href='?load='+$(this).val()" id="" class="form-control">
<option value="">{{e2("Select State")}}</option>
<?php
if(is_array($states)) {
foreach($states AS $stateName => $value) {
?>
<option value="{{$stateName}}" @if(getesit("load", $stateName)) selected @endif>{{e2("Test Package Creator / " . $stateName)}}</option>
<?php } ?>
<?php } ?>
</select>
</div>
<div class="col-md-6">
<form action="?save" method="post">
@csrf
<div class="input-group">
<input type="text" value="{{get("load")}}" name="title" placeholder="{{e2("Save state name")}}" required id="" class="form-control">
<input type="hidden" name="data" value="" id="state_data">
@if(getisset("load"))
<a href="?delete={{get("load")}}" teyit="{{e2("Are you sure?")}}" class="btn btn-outline-danger"><i class="fa fa-times"></i></a>
@endif
<button class="btn btn-outline-success"><i class="fa fa-save"></i></button>
</div>
</form>
</div>
</div>
<!-- Documents Panel Section -->
<div class="row" style="position:relative">
<style>
.list-group-item .badge {
display:none;
}
.static-item { border-left: 4px solid #28a745; }
.template-item { border-left: 4px solid #17a2b8; }
.dynamic-item { border-left: 4px solid #ffc107; background-color: #fff8e1; }
</style>
<div class="col-12">
<a class="btn btn-outline-primary mb-3" data-toggle="collapse" href="#mainPanel">
<i class="fa fa-list"></i> {{e2("Documents Panel")}}
</a>
<button class="btn btn-outline-info mb-3 ml-2" data-toggle="modal" data-target="#placeholderModal">
<i class="fa fa-info-circle"></i> Placeholders
</button>
@if(isAuth($id, "write"))
<a href="?type=tp-item-creator" class="btn btn-outline-warning mb-3 ml-2">
<i class="fa fa-plus-circle"></i> {{e2("Create Dynamic Item")}}
</a>
@endif
</div>
<div class="col-md-12 collapse border border-radius p-3" id="mainPanel" style="position: absolute; z-index: 100; background: white; top: 50px; left: 15px; right: 15px; width: calc(100% - 30px); box-shadow: 0 5px 15px rgba(0,0,0,0.1);">
<div class="row">
<!-- Left Column: Selected Documents -->
<div class="col-md-6">
<div class="card" style="height: 80vh;">
<div class="card-header bg-light">
<h5 class="mb-0">{{e2("Selected Documents")}}</h5>
</div>
<div class="card-body p-2" style="display: flex; flex-direction: column; height: calc(100% - 60px);">
<div class="input-group mb-3" style="flex-shrink: 0;">
<input type="text" name="" placeholder="{{e2("Add Document Procedure Number")}}" id="" class="document-procedure-number form-control">
<div class="btn btn-primary add-document-procedure"><i class="fa fa-plus"></i></div>
</div>
<ol class="list-group connectedSortable border border-dashed border-radius p-2" id="selected" style="overflow:auto; flex: 1;">
<?php if(getisset("load"))
{
echo @$states[get("load")];
} ?>
</ol>
</div>
</div>
</div>
<!-- Right Column: All Documents -->
<div class="col-md-6">
<div class="card" style="height: 80vh;">
<div class="card-header d-flex justify-content-between align-items-center bg-light">
<h5 class="mb-0">{{e2("All Documents")}}</h5>
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-outline-primary active" id="showAllBtn">
<i class="fa fa-list"></i> {{e2("All")}}
</button>
<button type="button" class="btn btn-outline-success" id="showStaticBtn">
<i class="fa fa-folder"></i> {{e2("Static")}}
</button>
<button type="button" class="btn btn-outline-warning" id="showDynamicBtn">
<i class="fa fa-cogs"></i> {{e2("Dynamic")}}
</button>
</div>
</div>
<div class="card-body p-2" style="display: flex; flex-direction: column; height: calc(100% - 60px);">
<input type="search" name="" placeholder="{{e2("Search Document")}}" id="allSearch" class="mb-3 form-control" style="flex-shrink: 0;">
<ul class="list-group connectedSortable" style="overflow:auto; flex: 1;" id="all">
<?php
$mainPath = "storage/documents";
$qaFolders = [];
$qaPath = "$mainPath/004_QA/";
if (is_dir($qaPath)) {
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($qaPath, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($iterator as $file) {
if ($file->isDir()) {
$qaFolders[] = $file->getPathname();
}
}
}
$weldingDBFolders = glob("$mainPath/003_Welding_Database/*", GLOB_NOSORT) ?: [];
$drawingsFolders = glob("$mainPath/001_Drawings/*", GLOB_NOSORT) ?: [];
?>
<?php
foreach($drawingsFolders AS $drawings) {
$title = str_replace("001_Drawings/", "", $drawings);
?>
<li class="list-group-item static-item"
data-type="drawings"
data-id=""
data-path="{{$drawings}}"
data-title2="{{e2($title . '_register_title')}}">👷 {{e2($title . '_register_title')}}
<br>
<div class="badge badge-success">Drawings</div>
<small class="text-muted">{{$drawings}}</small>
</li>
<?php
}
foreach($weldingDBFolders AS $qa) {
$qa = str_replace("$mainPath/", "", $qa);
$title = str_replace("003_Welding_Database/", "", $qa);
?>
@if(strpos($qa, "Welding Experts") !== false)
<li class="list-group-item static-item"
data-type="wdb"
data-id=""
data-path="{{$qa}}"
data-title2="{{e2($qa . '_register_title')}}">👷 {{e2("Test Package Creator / " . $title)}}
<br>
<input type="text" placeholder="{{e2("File Name")}}" class="form-control file_name form-control-sm mt-1">
<div class="badge badge-success">Welding Database</div>
<small class="text-muted">{{$qa}}</small>
</li>
@else
<li class="list-group-item static-item"
data-type="wdb"
data-id=""
data-path="{{$qa}}"
data-title2="{{e2($qa . '_register_title')}}">👷 {{e2("Test Package Creator / " . $title)}}
<br>
<div class="badge badge-success">Welding Database</div>
<small class="text-muted">{{$qa}}</small>
</li>
@endif
<?php } ?>
<?php
foreach($qaFolders AS $qa) {
$qa = str_replace("$mainPath/", "", $qa);
?>
<li class="list-group-item static-item"
data-type="qa"
data-id=""
data-path="{{$qa}}"
data-title2="{{e2($qa . '_register_title')}}">📂 {{e2("Test Package Creator / " . $qa)}}
<br>
<div class="badge badge-success">QA</div>
<small class="text-muted">{{$qa}}</small>
</li>
<?php } ?>
<?php
$templates = db("document_templates")->where("type", "<>", "register")->get();
$registers = db("document_templates")->where("type", "register")->get();
foreach($templates AS $template) {
?>
<li class="list-group-item template-item" data-type="template" data-id="{{$template->slug}}" data-path="{{$template->kid}}" data-title2="{{$template->title2}}"> ✍️ {{e2("Test Package Creator / " . $template->title)}} <br>
<small class="badge badge-success">{{$template->type}}</small>
<small class="text-muted">{{$template->kid}}</small>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="d-none">
{{e2("Select Path")}}
<input type="text" name="path" readony="readonly" disabled="disabled" value="{{ setting("tp_register_creator_path") }}" id="path" class="form-control">
</div>
</div>
<div class="col-md-12">
<div id="register-datagrid"></div>
<hr>
</div>
<div class="col-md-12">
<div class="block block-bordered">
<div class="block-header block-header-default">
<h3 class="block-title"><i class="fa fa-list"></i> {{e2("Package Details")}}</h3>
</div>
<div class="block-content">
<div id="register-tp-detail-datagrid"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
#selected .list-group-item {
display:revert;
list-style-position: inside;
}
</style>
<!-- Placeholder Modal -->
<div id="placeholderModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{e2("Available Placeholders")}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{{e2("Placeholder")}}</th>
<th>{{e2("Description")}}</th>
<th>{{e2("Actions")}}</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>{test_package_no}</code></td>
<td>{{e2("Test Package Number")}}</td>
<td><button class="btn btn-sm btn-primary copy-placeholder" data-placeholder="{test_package_no}"><i class="fa fa-copy"></i> {{e2("Copy")}}</button></td>
</tr>
<tr>
<td><code>{project}</code></td>
<td>{{e2("Project Name")}}</td>
<td><button class="btn btn-sm btn-primary copy-placeholder" data-placeholder="{project}"><i class="fa fa-copy"></i> {{e2("Copy")}}</button></td>
</tr>
<tr>
<td><code>{iso_number}</code></td>
<td>{{e2("ISO Number")}}</td>
<td><button class="btn btn-sm btn-primary copy-placeholder" data-placeholder="{iso_number}"><i class="fa fa-copy"></i> {{e2("Copy")}}</button></td>
</tr>
<tr>
<td><code>{test_type}</code></td>
<td>{{e2("Test Type")}}</td>
<td><button class="btn btn-sm btn-primary copy-placeholder" data-placeholder="{test_type}"><i class="fa fa-copy"></i> {{e2("Copy")}}</button></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Main Script Block -->
<script>
// Progress Tracker Functions
function loadProgressTracker() {
$.ajax({
url: '{{ url("/admin-ajax/tp-creator-progress-tracker") }}',
type: 'GET',
success: function(response) {
$('#progress-tracker-container').html(response);
},
error: function(xhr, status, error) {
console.error('Failed to load progress tracker:', error);
}
});
}
function startProgressTrackerRefresh() {
if(typeof window.progressTrackerInterval !== 'undefined') {
clearInterval(window.progressTrackerInterval);
}
window.progressTrackerInterval = setInterval(function() {
loadProgressTracker();
}, 2000); // Refresh every 2 seconds
}
// Dynamic Items Functions
function loadDynamicItems() {
$.ajax({
url: '?ajax=get-dynamic-documents', // Ensure backend supports this or create a new ajax handler
type: 'GET',
dataType: 'json',
success: function(response) {
if (response.success && response.dynamic_items && response.dynamic_items.length > 0) {
renderDynamicItems(response.dynamic_items);
}
},
error: function(xhr, status, error) {
console.error('Failed to load dynamic items:', error);
}
});
}
function renderDynamicItems(items) {
const $allList = $('#all');
$allList.find('.dynamic-item').remove();
// Write permission check logic can be added here if needed
items.forEach(function(item) {
const badgeClass = item.badge_color || 'warning';
const listItem = `
<li class="list-group-item dynamic-item"
data-type="dynamic"
data-id="${item.id}"
data-path="${item.path}"
data-title2="${item.title2}"
data-sql-query="${encodeURIComponent(item.sql_query || '')}"
style="border-left: 4px solid #ffc107; background-color: #fff8e1;">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
${item.icon || '⚙️'} ${item.display_title || item.name}
<br>
<div class="badge badge-${badgeClass}">${item.badge_text || 'Dynamic'}</div>
<small class="text-muted">${item.path}</small>
</div>
</div>
</li>
`;
$allList.prepend(listItem);
});
$("#all").sortable('refresh');
}
function initializeFilterButtons() {
$('#showAllBtn').off('click').on('click', function() {
$('.static-item, .template-item, .dynamic-item').show();
$(this).addClass('active').siblings().removeClass('active');
});
$('#showStaticBtn').off('click').on('click', function() {
$('.static-item').show();
$('.template-item').show();
$('.dynamic-item').hide();
$(this).addClass('active').siblings().removeClass('active');
});
$('#showDynamicBtn').off('click').on('click', function() {
$('.static-item').hide();
$('.template-item').hide();
$('.dynamic-item').show();
$(this).addClass('active').siblings().removeClass('active');
});
}
function deleteQueue(queueId) {
Swal.fire({
title: '{{e2("Are you sure?")}}',
text: '{{e2("This queue will be permanently deleted!")}}',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#d33',
cancelButtonColor: '#3085d6',
confirmButtonText: '{{e2("Yes, delete it!")}}',
cancelButtonText: '{{e2("Cancel")}}'
}).then((result) => {
if (result.isConfirmed) {
$.post("?ajax=tp-creator-delete-queue", {
'_token': '{{csrf_token()}}',
'queue_id': queueId
}, function(response) {
try {
var res = JSON.parse(response);
if(res.status === 'success') {
Swal.fire('{{e2("Deleted!")}}', res.message, 'success');
loadProgressTracker();
} else {
Swal.fire('{{e2("Error!")}}', res.message, 'error');
}
} catch(e) {
// Fallback if response is simple string or empty
loadProgressTracker();
}
});
}
});
}
// Page Initialization
$(document).ready(function() {
loadProgressTracker();
startProgressTrackerRefresh();
loadDynamicItems();
initializeFilterButtons();
// Document Panel Logic
function selectedSave() {
var selectedItems = [];
$("#state_data").val($("#selected").html());
$("#selected li").each(function(index, item){
const $item = $(this);
let itemType = $item.attr("data-type") || 'qa';
// Fallback type detection
if(!itemType || itemType === 'undefined') {
if($item.attr("data-id") && $item.attr("data-id").indexOf('template') !== -1) itemType = 'template';
}
const itemData = {
order: index,
id: $item.attr("data-id") || "",
title: $item.html(),
title2: $item.attr("data-title2") || "",
path: $item.attr("data-path") || "",
type: itemType,
};
if (itemType === "dynamic") {
itemData.sql_query = decodeURIComponent($item.attr("data-sql-query") || "");
}
selectedItems.push(itemData);
});
localStorage.setItem("selectedDocsTP", JSON.stringify(selectedItems));
}
$(".file_name").on("blur", function() {
$(this).parent().attr("data-title2", $(this).val());
selectedSave();
});
$(".add-document-procedure").on("click", function() {
var title = $(".document-procedure-number").val();
if (!title) return;
var item = '<li class="list-group-item static-item"'
+ 'data-type="document-procedure" '
+ ' data-id="" '
+ ' data-path="004_QA/0018_Procedure" '
+ ' data-title2="'+title+'">' + title
+ ' <br>'
+ '<div class="badge badge-success">Document Procedure</div>'
+ '<small class="text-muted">004_QA/0018_Procedure</small>'
+ '</li>';
$("#selected").prepend(item);
$(".document-procedure-number").val('');
selectedSave();
});
$("#allSearch").on("keyup", function() {
var value = $(this).val().toLowerCase();
var showingAll = $('#showAllBtn').hasClass('active');
var showingStatic = $('#showStaticBtn').hasClass('active');
var showingDynamic = $('#showDynamicBtn').hasClass('active');
$("#all li").each(function() {
var matchesSearch = $(this).text().toLowerCase().indexOf(value) > -1;
var matchesFilter = true;
if (showingStatic) matchesFilter = $(this).hasClass('static-item') || $(this).hasClass('template-item');
if (showingDynamic) matchesFilter = $(this).hasClass('dynamic-item');
$(this).toggle(matchesSearch && matchesFilter);
});
});
$("#all, #selected").sortable({
connectWith: ".connectedSortable",
stop: function(event, ui) { selectedSave(); }
}).disableSelection();
$("#state_data").val($("#selected").html());
window.setTimeout(selectedSave(), 1000);
// Copy Placeholder
$('.copy-placeholder').on('click', function() {
var text = $(this).data('placeholder');
navigator.clipboard.writeText(text).then(() => {
var btn = $(this);
var originalHtml = btn.html();
btn.html('<i class="fa fa-check"></i>');
setTimeout(() => { btn.html(originalHtml); }, 2000);
}).catch(err => {
// Fallback
var textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.select();
document.execCommand('copy');
document.body.removeChild(textArea);
});
});
});
$(function(){
// DataGrid Configuration
var dataGrid = $("#register-datagrid").dxDataGrid({
dataSource: '?ajax=register-tp',
keyExpr: 'test_package_number',
filterRow: { visible: true },
searchPanel: { visible: false },
headerFilter: { visible: true, allowSearch: true },
stateStoring: {
enabled: true,
type: "localStorage",
storageKey: "tp-creator-2-grid-storage"
},
onSelectionChanged: function(e) {
const toolbarItems = e.component.option("toolbar.items");
if(toolbarItems && toolbarItems.length > 0) {
// Check index if toolbar items order changes
toolbarItems[1].visible = e.selectedRowsData.length > 0; // Generate button
toolbarItems[3].visible = e.selectedRowsData.length > 0; // Download button
e.component.option("toolbar.items", toolbarItems);
}
},
toolbar: {
items: [
{
location: 'after',
widget: 'dxButton',
options: {
icon: 'refresh',
text: '{{e2("Clear Filter")}}',
onClick: function(e) { dataGrid.clearFilter(); dataGrid.state({}); }
}
},
{
location: 'before',
widget: 'dxButton',
visible: false,
options: {
icon: 'save',
text: '{{e2("Generate TP of Selected")}}',
stylingMode: 'contained',
type: 'success',
onClick: function(e) {
var selectedRows = dataGrid.getSelectedRowsData();
var selectedDocuments = localStorage.getItem("selectedDocsTP");
if (!selectedDocuments || selectedDocuments === '[]') {
Swal.fire('{{e2("Warning")}}', '{{e2("Please select at least one document")}}', 'warning');
return;
}
Swal.fire({
title: '{{e2("Confirmation")}}',
text: '{{e2("Generate Test Packages for")}} ' + selectedRows.length + ' {{e2("items?")}}',
icon: 'question',
showCancelButton: true,
confirmButtonText: '{{e2("Yes, Generate")}}',
confirmButtonColor: '#28a745'
}).then((result) => {
if(result.isConfirmed) {
// Generate temp queue ID for progress bar
const tempQueueId = 'temp_' + Date.now();
showDispatchProgressBar(tempQueueId, selectedRows.length, JSON.parse(selectedDocuments).length);
$.post("{{ url('/admin/tp-creator/dispatch-jobs') }}", {
'_token' : '{{csrf_token()}}',
'lines' : JSON.stringify(selectedRows),
'path' : $("#path").val(),
'documents' : selectedDocuments,
}, function(response) {
try {
var data = typeof response === 'string' ? JSON.parse(response) : response;
if (data.status === 'success') {
Swal.fire('{{e2("Success")}}', data.message || '{{e2("Jobs added to queue successfully")}}', 'success');
hideDispatchProgressBar(tempQueueId);
loadProgressTracker();
} else {
Swal.fire('{{e2("Error")}}', data.message || '{{e2("An error occurred")}}', 'error');
hideDispatchProgressBar(tempQueueId);
}
} catch (e) {
console.error('Parse error:', e);
Swal.fire('{{e2("Job Added")}}', response, 'success');
hideDispatchProgressBar(tempQueueId);
loadProgressTracker();
}
}).fail(function(xhr, status, error) {
var message = '{{e2("An error occurred while adding to queue")}}';
if(xhr.responseJSON && xhr.responseJSON.message) {
message = xhr.responseJSON.message;
}
Swal.fire('{{e2("Error")}}', message, 'error');
hideDispatchProgressBar(tempQueueId);
});
}
});
}
}
},
{
location: 'after',
widget: 'dxButton',
options: {
icon: 'folder',
text: '{{e2("Go to Document Path")}}',
stylingMode: 'contained',
type: 'danger',
onClick: function(e) { window.open("{{url('admin/types/document-manager')}}", '_blank'); }
}
},
{
location: 'after',
widget: 'dxButton',
visible: false,
options: {
icon: 'pdffile',
text: '{{e2("Download Zip")}}',
onClick: function(e) {
var selectedRows = dataGrid.getSelectedRowsData();
Swal.fire('{{e2("Downloading")}}', "{{e2("Please Wait...")}}", 'success');
$.post("?ajax=pdf.tp-creator-download-zip", {
'_token' : '{{csrf_token()}}',
'lines' : JSON.stringify(selectedRows),
'path' : $("#path").val(),
}, function(d) {
Swal.fire('{{e2("Finished")}}', d, 'success');
});
}
}
}
]
},
columns : [
{
dataField: 'test_package_number',
caption: '{{e2("Test Package Number")}}',
cellTemplate: function(container, options) {
$('<a>')
.text(options.value)
.css({ color: "blue", cursor: "pointer", fontWeight: "bold" })
.on('click', function() {
var tpNumber = options.row.data.test_package_number;
var iframeLink = `?ajax=pdf.tp-register-creator-viewer&tp=${tpNumber}`;
// Update title
$('#myModal .modal-title').html('<i class="fa fa-file-text"></i> ' + tpNumber);
// Modal göster ve loading göster
$('#myModal').modal('show');
$('#myModal .modal-body').html('<div class="text-center p-5"><i class="fa fa-spinner fa-spin fa-3x mb-3 text-primary"></i><br>{{e2("Loading document preview...")}}</div>');
// AJAX ile içeriği yükle
$.ajax({
url: iframeLink,
type: 'GET',
success: function(data) {
$('#myModal .modal-body').html(data);
},
error: function(xhr, status, error) {
console.error('AJAX Error:', error);
$('#myModal .modal-body').html('<div class="alert alert-danger m-3">{{e2("Error loading content. Please try again.")}} <br><small>' + error + '</small></div>');
}
});
})
.appendTo(container);
}
},
{
dataField: "updated_at",
caption: "{{e2("Last Update")}}",
dataType: "date",
format: "dd/MM/yyyy"
},
{
dataField: "by_user",
caption: "{{e2('by User')}}",
visible: true
},
{
headerCellTemplate: function (headerElement) {
$(headerElement).parent().css({'background-color': '#A0D8EB', 'color': '#000', 'text-align': 'center'});
},
columns: [ { dataField: "tp_general_status", caption: "{{e2("General Status")}}" } ]
},
{
dataField: "progress_percent",
caption: "{{e2('Progress')}}",
alignment: "center",
width: 150,
cellTemplate: function(container, options) {
var val = options.data.welding_progress || 0;
var percent = parseFloat(val) || 0;
var colorClass = "bg-danger";
if(percent >= 50) colorClass = "bg-warning";
if(percent >= 100) colorClass = "bg-success";
var html = '<div class="progress" style="height: 15px; border-radius: 4px;">' +
'<div class="progress-bar ' + colorClass + '" role="progressbar" style="width: ' + percent + '%;" aria-valuenow="' + percent + '" aria-valuemin="0" aria-valuemax="100"></div>' +
'</div><small>' + percent + '%</small>';
container.html(html);
}
},
{
caption: '{{e2("Test Info")}}',
headerCellTemplate: function (headerElement) {
$(headerElement).parent().css({'background-color': '#F2A0D8', 'color': '#000', 'text-align': 'center'});
},
columns: [
{ dataField: "test_status", caption: "{{e2("Test Status")}}" },
{ dataField: "test_type", caption: "{{e2("Test Type")}}" },
{ dataField: "test_pressure", caption: "{{e2("Test Pressure")}}"},
]
},
{
caption: '{{e2("Punch Lists")}}',
headerCellTemplate: function (headerElement) {
$(headerElement).parent().css({'background-color': '#B2D7FF', 'color': '#000', 'text-align': 'center'});
},
columns: [
{ dataField: "a_punch_point_open", caption: "A"},
{ dataField: "b_punch_point_open", caption: "B"},
{ dataField: "c_punch_point_open", caption: "C"},
{ dataField: "punch_status", caption: "{{e2("Punch Status")}}", width: 125 },
]
},
{
caption: '{{e2("Welding Process")}}',
headerCellTemplate: function (headerElement) {
$(headerElement).parent().css({'background-color': '#A0D8B3', 'color': '#000', 'text-align': 'center'});
},
columns: [
{ dataField: 'welding_status', caption: '{{e2("Welding Status")}}' },
{ dataField: 'total_wdi', caption: '{{e2("Total WDI")}}' },
{ dataField: 'total_complated_wdi', caption: '{{e2("Total Completed WDI")}}' },
{ dataField: "repair_remaining", caption: "{{e2("Repair Remaining")}}" },
]
},
{
caption: '{{e2("NDT Logs")}}',
headerCellTemplate: function (headerElement) {
$(headerElement).parent().css({'background-color': '#FF8B82', 'color': '#000', 'text-align': 'center'});
},
columns: [
{ dataField: 'ndt_status', caption: '{{e2("NDT Status")}}' },
{ dataField: 'rt_backlog', caption: '{{e2("RT")}}' },
{ dataField: 'ut_backlog', caption: '{{e2("UT")}}' },
{ dataField: 'mt_backlog', caption: '{{e2("MT")}}' },
{ dataField: 'pt_backlog', caption: '{{e2("PT")}}' },
{ dataField: 'pmi_backlog', caption: '{{e2("PMI")}}' },
{ dataField: 'pwht_backlog', caption: '{{e2("PWHT")}}' }
]
}
],
paging: { pageSize: 15 },
hoverStateEnabled: true,
showBorders: true,
allowColumnResizing: true,
columnAutoWidth: true,
allowColumnReordering: true,
showColumnLines: true,
columnFixing: { enabled: true },
selection: { mode: 'multiple' },
onRowClick: function(e) {
if(e.rowType === "data") {
var detailGrid = $("#register-tp-detail-datagrid").dxDataGrid("instance");
var tpNumber = e.data.test_package_number;
// Show loading
detailGrid.option("dataSource", []);
detailGrid.beginCustomLoading("{{e2('Loading Details...')}}");
// Fetch data
$.ajax({
url: '?ajax=register-tp-detail&test_package_number=' + tpNumber,
dataType: 'json',
method: 'GET',
success: function(result) {
detailGrid.option('dataSource', result);
detailGrid.endCustomLoading();
},
error: function() {
detailGrid.endCustomLoading();
DevExpress.ui.notify("{{e2('Data Loading Error')}}", "error", 2000);
}
});
$('html, body').animate({
scrollTop: $("#register-tp-detail-datagrid").offset().top - 100
}, 500);
}
}
}).dxDataGrid("instance");
$("#register-tp-detail-datagrid").dxDataGrid({
filterRow: { visible: true },
searchPanel: { visible: false },
headerFilter: { visible: true },
export: { enabled: true },
showBorders: true,
columnAutoWidth: true,
dataSource: [],
columns: [
{ dataField: "iso_number", caption: "ISO Number", dataType: "string", headerCellTemplate: function (headerElement, info) { $(headerElement).text(info.column.caption).parent().css({'background-color': '#A0D8EB', 'color': '#000', 'text-align': 'center'}); } },
{ dataField: "test_package_no", caption: "Test Package No", dataType: "string" },
{
caption: "Backlog",
headerCellTemplate: function (headerElement, info) { $(headerElement).text(info.column.caption).parent().css({'background-color': '#FF8B82', 'color': '#000', 'text-align': 'center'}); },
columns: [
{ dataField: "rt", caption: "RT" },
{ dataField: "ut", caption: "UT" },
{ dataField: "mt", caption: "MT" },
{ dataField: "pt", caption: "PT" },
{ dataField: "pmi", caption: "PMI" },
{ dataField: "pwht", caption: "PWHT" },
{ dataField: "repair_remaining", caption: "Repair" }
]
},
{
caption: "Punch Points",
headerCellTemplate: function (headerElement, info) { $(headerElement).text(info.column.caption).parent().css({'background-color': '#B2D7FF', 'color': '#000', 'text-align': 'center'}); },
columns: [
{ dataField: "a_punch_point_open_sum", caption: "A Open" },
{ dataField: "b_punch_point_open_sum", caption: "B Open" },
{ dataField: "c_punch_point_open_sum", caption: "C Open" }
]
},
{
caption: "Progress",
headerCellTemplate: function (headerElement, info) { $(headerElement).text(info.column.caption).parent().css({'background-color': '#A0D8B3', 'color': '#000', 'text-align': 'center'}); },
columns: [
{ dataField: "shop_progress", caption: "Shop %", dataType: "number", format: { type: "fixedPoint", precision: 2 } },
{ dataField: "field_progress", caption: "Field %", dataType: "number", format: { type: "fixedPoint", precision: 2 } },
{ dataField: "pipe_progress_sum", caption: "Pipe %", dataType: "number", format: { type: "fixedPoint", precision: 2 } }
]
}
]
});
});
</script>
<script>
// Dispatch Progress Bar Functions
function showDispatchProgressBar(tempQueueId, linesCount, documentsCount) {
// Progress bar HTML
var progressHtml = `
<div class="border p-5 border-radius mb-10" id="dispatch-progress-${tempQueueId}" style="background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%); border-left: 4px solid #2196f3;">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
<p><strong><i class="fa fa-cogs fa-spin"></i> Dispatch Job Progress (Temp ID: ${tempQueueId})</strong></p>
<div class="dispatch-description-${tempQueueId}">{{e2("Adding to queue...")}}</div>
<div id="dispatch-progress-bar-${tempQueueId}" class="mb-10">
<div class="progress" style="height: 20px;">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<small class="text-muted">
<strong>{{e2("Lines")}}:</strong> ${linesCount} |
<strong>{{e2("Documents")}}:</strong> ${documentsCount}
</small>
</div>
<div class="ml-3">
<button class="btn btn-sm btn-outline-danger" onclick="hideDispatchProgressBar('${tempQueueId}')" title="{{e2('Cancel')}}">
<i class="fa fa-times"></i>
</button>
</div>
</div>
</div>
`;
// Add to page top
$('.col-12').first().prepend(progressHtml);
// Start animation
animateDispatchProgress(tempQueueId);
}
function animateDispatchProgress(tempQueueId) {
var progress = 0;
var interval = setInterval(function() {
progress += Math.random() * 15; // Random increase
if (progress > 90) progress = 90; // Cap at 90%
$(`#dispatch-progress-bar-${tempQueueId} .progress-bar`).css('width', progress + '%');
// Update description
var descriptions = [
'{{e2("Adding to queue...")}}',
'{{e2("Preparing job...")}}',
'{{e2("Validating data...")}}',
'{{e2("Almost ready...")}}'
];
var randomDesc = descriptions[Math.floor(Math.random() * descriptions.length)];
$(`.dispatch-description-${tempQueueId}`).text(randomDesc);
}, 500);
// Store interval
window.dispatchIntervals = window.dispatchIntervals || {};
window.dispatchIntervals[tempQueueId] = interval;
}
function hideDispatchProgressBar(tempQueueId) {
// Stop interval
if (window.dispatchIntervals && window.dispatchIntervals[tempQueueId]) {
clearInterval(window.dispatchIntervals[tempQueueId]);
delete window.dispatchIntervals[tempQueueId];
}
// Remove progress bar
$(`#dispatch-progress-${tempQueueId}`).fadeOut(300, function() {
$(this).remove();
});
}
</script>
<!-- Modal HTML -->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document" style="max-width: 95%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{e2("Viewer")}}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More