ikinci temizlik tamamlandı
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
|
||||
<?php
|
||||
$typeArray = $types->toArray();
|
||||
//dump($typeArray);
|
||||
$reTypes = [];
|
||||
foreach($typeArray AS $type) {
|
||||
if($type['kid'] != "") {
|
||||
?>
|
||||
{{col("col-md-3 text-center","")}}
|
||||
<img src="{{url("assets/icons/".$type['icon'] . ".png")}}" width="48" alt="">
|
||||
<strong>{{$type['title']}}</strong>
|
||||
<div class="row">
|
||||
<?php foreach($typeArray AS $subType) {
|
||||
if($subType['kid'] != "") {
|
||||
if($subType['kid'] == $type['kid']) { ?>
|
||||
{{col("col-md-6 text-center","")}}
|
||||
<img src="{{url("assets/icons/".$subType['icon'] . ".png")}}" width="48" alt="">
|
||||
<a href="{{ url('admin/types/'. $subType['slug']) }}">{{$subType['title']}}</a>
|
||||
{{_col()}}
|
||||
<?php
|
||||
}
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
{{_col()}}
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,27 @@
|
||||
<style>
|
||||
.flowchart .page {
|
||||
zoom: 50%;
|
||||
transition:all .5s
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
var zoom = 50;
|
||||
$(".zoomin").on("click", function(){
|
||||
zoom = zoom + 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
$(".zoomout").on("click", function(){
|
||||
zoom = zoom - 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<button class="btn btn-outline-primary zoomin"><i class="fa fa-plus"></i></button>
|
||||
<button class="btn btn-outline-primary zoomout"><i class="fa fa-minus"></i></button>
|
||||
<div class="flowchart" style="overflow:auto;width:100%;height:80vh;margin-top:10px">
|
||||
|
||||
@include("admin.dashboard.flowchart")
|
||||
</div>
|
||||
@@ -0,0 +1,167 @@
|
||||
<!-- pdf.js CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.10.377/build/pdf.min.js"></script>
|
||||
<style>
|
||||
.flowchart .page {
|
||||
zoom: 50%;
|
||||
transition:all .5s
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
var zoom = 50;
|
||||
$(".zoomin").on("click", function(){
|
||||
zoom = zoom + 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
$(".zoomout").on("click", function(){
|
||||
zoom = zoom - 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(function(){
|
||||
const $pdf = '{{url("assets/diagram.pdf")}}';
|
||||
|
||||
const $initialState = {
|
||||
pdfDoc: null,
|
||||
currentPage: 1,
|
||||
pageCount: 0,
|
||||
zoom: 0.615,
|
||||
};
|
||||
|
||||
// Render the page.
|
||||
const renderPage = () => {
|
||||
// Load the first page.
|
||||
$initialState.pdfDoc
|
||||
.getPage($initialState.currentPage)
|
||||
.then((page) => {
|
||||
console.log('page', page);
|
||||
|
||||
const canvas = $('#canvas')[0];
|
||||
const $ctx = canvas.getContext('2d');
|
||||
const $viewport = page.getViewport({
|
||||
scale: $initialState.zoom,
|
||||
});
|
||||
|
||||
canvas.height = $viewport.height;
|
||||
canvas.width = $viewport.width;
|
||||
|
||||
// Render the PDF page into the canvas context.
|
||||
const renderCtx = {
|
||||
canvasContext: $ctx,
|
||||
viewport: $viewport,
|
||||
};
|
||||
|
||||
page.render(renderCtx);
|
||||
|
||||
$('#page_num').html($initialState.currentPage);
|
||||
});
|
||||
};
|
||||
|
||||
// Load the document.
|
||||
pdfjsLib
|
||||
.getDocument($pdf)
|
||||
.promise.then((doc) => {
|
||||
$initialState.pdfDoc = doc;
|
||||
console.log('pdfDocument', $initialState.pdfDoc);
|
||||
|
||||
$('#page_count').html($initialState.pdfDoc.numPages);
|
||||
|
||||
renderPage();
|
||||
})
|
||||
.catch((err) => {
|
||||
alert(err.message);
|
||||
});
|
||||
|
||||
function showPrevPage() {
|
||||
if ($initialState.pdfDoc === null || $initialState.currentPage <= 1)
|
||||
return;
|
||||
$initialState.currentPage--;
|
||||
// Render the current page
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
renderPage();
|
||||
}
|
||||
|
||||
function showNextPage() {
|
||||
if (
|
||||
$initialState.pdfDoc === null ||
|
||||
$initialState.currentPage >=
|
||||
$initialState.pdfDoc._pdfInfo.numPages
|
||||
)
|
||||
return;
|
||||
|
||||
$initialState.currentPage++;
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
renderPage();
|
||||
}
|
||||
|
||||
// Button events.
|
||||
$('#prev-page').click(showPrevPage);
|
||||
$('#next-page').click(showNextPage);
|
||||
|
||||
// Display a specific page.
|
||||
$('#current_page').on('keypress', (event) => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
// Get the key code.
|
||||
const $keycode = event.keyCode ? event.keyCode : event.which;
|
||||
if ($keycode === 13) {
|
||||
// Get the new page number and render it.
|
||||
let desiredPage = $('#current_page')[0].valueAsNumber;
|
||||
|
||||
$initialState.currentPage = Math.min(
|
||||
Math.max(desiredPage, 1),
|
||||
$initialState.pdfDoc._pdfInfo.numPages,
|
||||
);
|
||||
renderPage();
|
||||
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
// Zoom functionality.
|
||||
$('#zoom_in').on('click', () => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
$initialState.zoom *= 4 / 3;
|
||||
|
||||
renderPage();
|
||||
});
|
||||
|
||||
$('#zoom_out').on('click', () => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
$initialState.zoom *= 2 / 3;
|
||||
renderPage();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<header>
|
||||
<table class="table ">
|
||||
<tr>
|
||||
<td width="20%" style="vertical-align: middle">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-outline-primary" id="zoom_in">
|
||||
<i class="fas fa-search-plus"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-outline-primary" id="zoom_out">
|
||||
<i class="fas fa-search-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
<td width="60%" class="text-center"><img src="{{url("assets/logo.svg")}}" class="p-1" alt=""></td>
|
||||
<td width="20%" style="vertical-align: bottom;font-size:16px">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</header>
|
||||
<div class="flowchart" style="overflow:auto;width:100%;height:80vh;margin-top:10px">
|
||||
|
||||
<!-- Canvas to place the PDF -->
|
||||
<canvas id="canvas" class="canvas__container"></canvas>
|
||||
</div>
|
||||
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
$projects = active_projects();
|
||||
$projects[] = "General";
|
||||
|
||||
foreach($projects AS $project) {
|
||||
$id = str_slug($project);
|
||||
$appr = setting("$id-approximate-planned-wdi");
|
||||
|
||||
$totalNps = apply_welded_filter(db("weld_logs"))->where("no_of_the_joint_as_per_as_built_survey", "not like", "%R%");
|
||||
|
||||
$currentNps = apply_welded_filter(db("weld_logs"))->where("no_of_the_joint_as_per_as_built_survey", "not like", "%R%")->whereNotNull("welding_date");
|
||||
|
||||
|
||||
|
||||
$countNps = apply_welded_filter(db("weld_logs"))->where("no_of_the_joint_as_per_as_built_survey", "not like", "%R%");
|
||||
|
||||
$max = 80000;
|
||||
if($project != "General") {
|
||||
$totalNps = $totalNps->where("project", $project);
|
||||
$currentNps = $currentNps->where("project", $project);
|
||||
$countNps = $countNps->where("project", $project);
|
||||
$max = 20000;
|
||||
}
|
||||
|
||||
|
||||
$currentNps = $currentNps->sum("nps_1");
|
||||
$totalNps = $totalNps->sum("nps_1");
|
||||
$countNps = $countNps->sum("nps_1");
|
||||
|
||||
|
||||
try {
|
||||
$npsPercent = round($currentNps * 100 / $totalNps, 2);
|
||||
$apprPercent = round($appr * 100 / $totalNps, 2);
|
||||
} catch (\Throwable $th) {
|
||||
$apprPercent = 0;
|
||||
$npsPercent = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
$(() => {
|
||||
$('#gauge{{$id}}').dxLinearGauge({
|
||||
// geometry: { orientation: 'vertical' },
|
||||
scale: {
|
||||
majorTick: {
|
||||
visible: true,
|
||||
length: 10 // Specify the length of the major tick lines
|
||||
},
|
||||
|
||||
line: {
|
||||
visible: true,
|
||||
width: 5 // Set the line thickness here
|
||||
},
|
||||
startValue: 0,
|
||||
endValue: 100,
|
||||
|
||||
// customTicks: [0, {{$appr}}],
|
||||
},
|
||||
title: {
|
||||
text: '{{strtoupper($project)}}',
|
||||
font: { size: 28 },
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
customizeTooltip: function (info) {
|
||||
console.log(info);
|
||||
// Customize the tooltip text based on your logic
|
||||
var text = "";
|
||||
if(info.type == 'subvalue-indicator') {
|
||||
if(info.index == 0) {
|
||||
text = "Real Total Value: %";
|
||||
} else {
|
||||
text = "Approximate Value: %";
|
||||
}
|
||||
}
|
||||
info.valueText = text + info.valueText;
|
||||
}
|
||||
},
|
||||
value: {{$npsPercent}},
|
||||
subvalues: [{{$npsPercent}}, {{$apprPercent}}],
|
||||
subvalueIndicator: {
|
||||
|
||||
type: 'triangleMarker',
|
||||
color: 'red',
|
||||
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div id="gauge{{$id}}"></div>
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
$baseQuery = apply_welded_filter(db("weld_logs"));
|
||||
|
||||
$subcontractors = clone $baseQuery;
|
||||
$subcontractors = $subcontractors
|
||||
->select("ste_subcontractor")
|
||||
->whereNotNull("ste_subcontractor")
|
||||
->distinct()
|
||||
->pluck("ste_subcontractor")
|
||||
->toArray();
|
||||
|
||||
$monthly = apply_welded_filter(db("weld_logs"))
|
||||
->select(DB::raw('(SUM(CASE WHEN type_of_joint = "S" THEN nps_1 ELSE 0 END) + 0) as sum_S'),
|
||||
DB::raw('(SUM(CASE WHEN type_of_joint = "F" THEN nps_1 ELSE 0 END) + 0) as sum_F'))
|
||||
->selectRaw("(SUM(nps_1) + 0) AS total_nps");
|
||||
|
||||
foreach ($subcontractors as $subcontractor) {
|
||||
$safeSubcontractor = addslashes($subcontractor);
|
||||
$monthly->selectRaw(
|
||||
"(SUM(CASE WHEN ste_subcontractor = '{$safeSubcontractor}' THEN nps_1 ELSE 0 END) + 0) as " . str_slug($subcontractor, "_")
|
||||
);
|
||||
}
|
||||
|
||||
$monthly = $monthly
|
||||
->selectRaw('DATE_FORMAT(welding_date, "%m.%y") as month')
|
||||
->whereNotNull("welding_date")
|
||||
->groupByRaw('DATE_FORMAT(welding_date, "%m.%y")')
|
||||
->orderByRaw('MIN(welding_date) ASC')
|
||||
->get();
|
||||
|
||||
// String değerleri float'a dönüştür ve null değerleri 0 yap
|
||||
foreach ($monthly as $item) {
|
||||
$item->sum_S = (float) ($item->sum_S ?? 0);
|
||||
$item->sum_F = (float) ($item->sum_F ?? 0);
|
||||
$item->total_nps = (float) ($item->total_nps ?? 0);
|
||||
|
||||
foreach ($subcontractors as $subcontractor) {
|
||||
$fieldName = str_slug($subcontractor, "_");
|
||||
if (isset($item->$fieldName)) {
|
||||
$item->$fieldName = (float) ($item->$fieldName ?? 0);
|
||||
} else {
|
||||
$item->$fieldName = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Debug için veriyi kontrol et
|
||||
// dd($monthly->toArray());
|
||||
|
||||
?>
|
||||
<script>
|
||||
const dataSource = <?php echo json_encode_tr($monthly) ?>;
|
||||
|
||||
$(() => {
|
||||
$('#monthlyProgress').dxChart({
|
||||
palette: 'colored',
|
||||
dataSource: dataSource,
|
||||
commonSeriesSettings: {
|
||||
argumentField: 'month',
|
||||
},
|
||||
series: [{
|
||||
valueField: 'sum_F',
|
||||
name: 'Field',
|
||||
type: 'bar',
|
||||
color: '#008fd8',
|
||||
visible: true,
|
||||
}, {
|
||||
valueField: 'sum_S',
|
||||
name: 'Shop',
|
||||
type: 'bar',
|
||||
color: '#ff6b6b',
|
||||
visible: true,
|
||||
}, {
|
||||
type: 'spline',
|
||||
valueField: 'total_nps',
|
||||
name: 'TOTAL',
|
||||
color: '#00d084',
|
||||
point: {
|
||||
visible: true,
|
||||
size: 6,
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
@foreach($subcontractors AS $subcontractor)
|
||||
{
|
||||
type: 'spline',
|
||||
valueField: '{{str_slug($subcontractor, "_")}}',
|
||||
name: '{{$subcontractor}}',
|
||||
point: {
|
||||
visible: true,
|
||||
size: 6,
|
||||
},
|
||||
visible: true,
|
||||
},
|
||||
@endforeach
|
||||
|
||||
],
|
||||
valueAxis: {
|
||||
grid: {
|
||||
visible: true,
|
||||
},
|
||||
title: {
|
||||
text: 'NPS Values',
|
||||
},
|
||||
min: 0,
|
||||
max: function() {
|
||||
// En yüksek değeri bul ve %20 margin ekle
|
||||
let maxValue = 0;
|
||||
dataSource.forEach(function(item) {
|
||||
maxValue = Math.max(maxValue, item.sum_F || 0, item.sum_S || 0, item.total_nps || 0);
|
||||
@foreach($subcontractors AS $subcontractor)
|
||||
maxValue = Math.max(maxValue, item.{{str_slug($subcontractor, "_")}} || 0);
|
||||
@endforeach
|
||||
});
|
||||
return Math.ceil(maxValue * 1.2);
|
||||
}(),
|
||||
tickInterval: function() {
|
||||
// Tick aralığını otomatik hesapla
|
||||
let maxValue = 0;
|
||||
dataSource.forEach(function(item) {
|
||||
maxValue = Math.max(maxValue, item.sum_F || 0, item.sum_S || 0, item.total_nps || 0);
|
||||
@foreach($subcontractors AS $subcontractor)
|
||||
maxValue = Math.max(maxValue, item.{{str_slug($subcontractor, "_")}} || 0);
|
||||
@endforeach
|
||||
});
|
||||
return Math.ceil(maxValue / 10);
|
||||
}(),
|
||||
},
|
||||
argumentAxis: {
|
||||
grid: {
|
||||
visible: true,
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
shared: true,
|
||||
format: {
|
||||
type: 'largeNumber',
|
||||
precision: 2,
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
verticalAlignment: 'bottom',
|
||||
horizontalAlignment: 'center',
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
},
|
||||
title: {
|
||||
text: '{{e2("Monthly Progress")}}',
|
||||
},
|
||||
onContentReady: function(e) {
|
||||
// Chart yüklendiğinde veri kontrolü
|
||||
console.log('Chart data:', e.component.option('dataSource'));
|
||||
|
||||
// Y ekseni değerlerini düzenle
|
||||
let valueAxis = e.component.getArgumentAxis();
|
||||
let maxValue = 0;
|
||||
dataSource.forEach(function(item) {
|
||||
maxValue = Math.max(maxValue, item.sum_F || 0, item.sum_S || 0, item.total_nps || 0);
|
||||
@foreach($subcontractors AS $subcontractor)
|
||||
maxValue = Math.max(maxValue, item.{{str_slug($subcontractor, "_")}} || 0);
|
||||
@endforeach
|
||||
});
|
||||
|
||||
// Y ekseni maksimum değerini ayarla
|
||||
e.component.option('valueAxis.max', Math.ceil(maxValue * 1.2));
|
||||
e.component.option('valueAxis.tickInterval', Math.ceil(maxValue / 8));
|
||||
},
|
||||
onSeriesClick: function(e) {
|
||||
// Series tıklandığında detay bilgisi
|
||||
console.log('Series clicked:', e.seriesName, 'Value:', e.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<div id="monthlyProgress"></div>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
$data = j(setting("ndtCalculation"));
|
||||
|
||||
$stats = [];
|
||||
$statsData = [];
|
||||
|
||||
foreach($data AS $d) {
|
||||
foreach($d AS $field => $value) {
|
||||
if(strpos($field, "backlog") !== false) {
|
||||
$field = str_replace("_backlog", "", $field);
|
||||
$field = strtoupper($field);
|
||||
if(!isset($stats[$field])) {
|
||||
$stats[$field] = 0;
|
||||
}
|
||||
if($value>0) {
|
||||
$stats[$field] += $value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach($stats AS $log => $value) {
|
||||
|
||||
$statsData[] = [
|
||||
'log_name' => $log,
|
||||
'val' => $value,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$labels = implode("','",array_keys($stats));
|
||||
$datas = implode(",",array_values($stats));
|
||||
$totalCount = array_sum(array_values($stats));
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<canvas class="d-none" id="ndtBacklogStats"></canvas>
|
||||
<div id="ndtBacklogChart"></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<table class="table table-sm table-bordered table-striped">
|
||||
|
||||
<tr>
|
||||
<th>{{e2("Status")}}</th>
|
||||
<th>{{e2("Count")}}</th>
|
||||
<th>{{e2("%")}}</th>
|
||||
</tr>
|
||||
|
||||
<?php foreach($stats AS $label => $stat) {
|
||||
?>
|
||||
<tr>
|
||||
<td>{{$label}}</td>
|
||||
<td>{{$stat}}</td>
|
||||
<td>%{{round($stat * 100 / $totalCount, 0)}}</td>
|
||||
</tr>
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
<tr>
|
||||
<th>{{e2("Total")}}</th>
|
||||
<th>{{$totalCount}}</th>
|
||||
<th>%100</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
|
||||
const ndtBacklogData = <?php echo json_encode_tr($statsData) ?>;
|
||||
|
||||
$('#ndtBacklogChart').dxPieChart({
|
||||
type: 'doughnut',
|
||||
// palette: 'Pastel',
|
||||
dataSource: ndtBacklogData,
|
||||
// title: '{{e2("Spool List")}}',
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
// format: 'millions',
|
||||
customizeTooltip(arg) {
|
||||
console.log(arg);
|
||||
return {
|
||||
text: `${arg.valueText} - ${(arg.percent * 100).toFixed(2)}%`,
|
||||
};
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
horizontalAlignment: 'center',
|
||||
verticalAlignment: 'top',
|
||||
margin: 0,
|
||||
visible: true
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
},
|
||||
series: [{
|
||||
argumentField: 'log_name',
|
||||
label: {
|
||||
visible: true,
|
||||
connector: {
|
||||
visible: true,
|
||||
},
|
||||
customizeText: function (arg) {
|
||||
|
||||
return arg.percentText;
|
||||
}
|
||||
},
|
||||
}],
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<script>
|
||||
const ctx2 = document.getElementById('ndtBacklogStats');
|
||||
|
||||
var options = {
|
||||
tooltips: {
|
||||
enabled: true
|
||||
},
|
||||
plugins: {
|
||||
datalabels: {
|
||||
formatter: (value, ctx) => {
|
||||
|
||||
let sum = ctx.dataset._meta[0].total;
|
||||
let percentage = (value * 100 / sum).toFixed(2) + "%";
|
||||
return percentage;
|
||||
|
||||
|
||||
},
|
||||
color: '#fff',
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
new Chart(ctx2, {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: ['<?php echo $labels ?>'],
|
||||
datasets: [{
|
||||
label: '# {{e2("Count")}}',
|
||||
data: [<?php echo $datas ?>],
|
||||
borderWidth: 1
|
||||
}]
|
||||
},
|
||||
options: options
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php $punchLists = db("punch_lists")
|
||||
->select("status")
|
||||
->selectRaw("count(*) val")
|
||||
->groupBy("status")
|
||||
->get();
|
||||
?>
|
||||
<div id="punchStatusChart"></div>
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
|
||||
const punchStatusData = <?php echo json_encode_tr($punchLists) ?>;
|
||||
|
||||
$('#punchStatusChart').dxPieChart({
|
||||
type: 'doughnut',
|
||||
// palette: 'Bright',
|
||||
dataSource: punchStatusData,
|
||||
title: '{{e2("Punch Status Percents")}}',
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
format: 'millions',
|
||||
customizeTooltip(arg) {
|
||||
return {
|
||||
text: `${arg.valueText} - ${(arg.percent * 100).toFixed(2)}%`,
|
||||
};
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
horizontalAlignment: 'center',
|
||||
verticalAlignment: 'top',
|
||||
margin: 0,
|
||||
visible: true
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
},
|
||||
series: [{
|
||||
argumentField: 'status',
|
||||
label: {
|
||||
visible: true,
|
||||
//format: 'percent',
|
||||
connector: {
|
||||
visible: true,
|
||||
},
|
||||
customizeText: function (arg) {
|
||||
|
||||
return arg.percentText;
|
||||
}
|
||||
},
|
||||
}],
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php $testPackages = db("test_packages")
|
||||
->select("tp_general_status AS status")
|
||||
->selectRaw("count(*) val")
|
||||
->groupBy("tp_general_status")
|
||||
->get();
|
||||
?>
|
||||
<div id="testStatusChart"></div>
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
|
||||
const testStatusData = <?php echo json_encode_tr($testPackages) ?>;
|
||||
|
||||
$('#testStatusChart').dxPieChart({
|
||||
type: 'doughnut',
|
||||
// palette: 'Soft Pastel',
|
||||
dataSource: testStatusData,
|
||||
title: '{{e2("Test Status Percents")}}',
|
||||
tooltip: {
|
||||
enabled: true,
|
||||
customizeTooltip(arg) {
|
||||
return {
|
||||
text: `${arg.valueText} - ${(arg.percent * 100).toFixed(2)}%`,
|
||||
};
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
horizontalAlignment: 'center',
|
||||
verticalAlignment: 'top',
|
||||
margin: 0,
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
},
|
||||
series: [{
|
||||
argumentField: 'status',
|
||||
label: {
|
||||
visible: true,
|
||||
//format: 'percent',
|
||||
connector: {
|
||||
visible: true,
|
||||
|
||||
},
|
||||
customizeText: function (arg) {
|
||||
|
||||
return arg.percentText;
|
||||
}
|
||||
},
|
||||
}],
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
@section("title")
|
||||
{{e2("Dashboard")}}
|
||||
@endsection
|
||||
<div class="row gutters-tiny">
|
||||
<!-- Row #5 -->
|
||||
<div class="col-md-6 col-xl-3">
|
||||
<a class="block block-transparent" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full bg-primary">
|
||||
<div class="py-20 text-center">
|
||||
<div class="mb-20">
|
||||
|
||||
<i class="material-symbols-outlined text-white font-size-h1">
|
||||
preview
|
||||
</i>
|
||||
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 text-white">56</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-primary-lighter">Under Preliminary Review</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-3">
|
||||
<a class="block block-transparent" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full bg-warning">
|
||||
<div class="py-20 text-center">
|
||||
<div class="mb-20">
|
||||
<i class="si si-wallet fa-4x text-warning-light"></i>
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 text-white">56</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-warning-light">Pending
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-3">
|
||||
<a class="block block-transparent" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full bg-info">
|
||||
<div class="py-20 text-center">
|
||||
<div class="mb-20">
|
||||
<i class="si si-users fa-4x text-info-light"></i>
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 text-white">77</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-info-light">Published </div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-3">
|
||||
<a class="block block-transparent" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full bg-success">
|
||||
<div class="py-20 text-center">
|
||||
<div class="mb-20">
|
||||
<i class="si si-briefcase fa-4x text-success-light"></i>
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 text-white">7</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-warning-light">Accepted </div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<!-- END Row #5 -->
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
$k = 0;
|
||||
foreach(status() AS $s) {
|
||||
?>
|
||||
{{col("col-md-4","$s Submissions",$k)}}
|
||||
|
||||
{{_col()}}
|
||||
<?php $k++; } ?>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
@include("admin.client.new-submission")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{ e2('Dashboard') }}</h3>
|
||||
<div class="block-options">
|
||||
<div class="text-muted small">
|
||||
{{ e2('Last Updated') }}: {{ $lastUpdated }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $dashboardContent !!}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
// Fetch the cached dashboard content
|
||||
$cachedDashboardContent = Storage::get('cache/dashboard.blade.php');
|
||||
|
||||
// Display the cached dashboard content
|
||||
echo $cachedDashboardContent;
|
||||
?>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php $colSize = "col-6 col-md-6 col-xl-2 block-container"; ?>
|
||||
<style>
|
||||
.block-header {
|
||||
padding: 0px 10px;
|
||||
}
|
||||
.badges .block-container {
|
||||
flex: 0 0 14.27%;
|
||||
max-width: 14.27%;
|
||||
}
|
||||
.badges .font-size-h3 {
|
||||
font-size:20px;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.badges .block-container {
|
||||
flex: 0 0 50%;
|
||||
max-width: 50%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<div class="row js-appear-enabled animated fadeIn badges" data-toggle="appear">
|
||||
<!-- Row #1 -->
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-earth-lighter block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/18%20Test%20Packets.png" width="48" alt="">
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">{{db("test_packages")->where("test_package_number", "<>", "")->count()}} / {{db("test_packages")->whereNotNull("test_date")->count()}}</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Test Packages")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-primary-lighter block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/Manufacturing.png" width="48" alt="">
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Güncel (current) revizyonları say - her drawing_no için en yüksek revision_no
|
||||
// VE sadece Piping discipline olanları
|
||||
$currentRevisionsCount = db("document_revisions as dr1")
|
||||
->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
|
||||
)')
|
||||
->where(function($q) {
|
||||
$q->where('dr1.discipline', 'LIKE', '%Piping%')
|
||||
->orWhereNull('dr1.discipline');
|
||||
})
|
||||
->count();
|
||||
?>
|
||||
<div class="font-size-h3 font-w600"><span>
|
||||
{{$currentRevisionsCount}} /
|
||||
{{apply_welded_filter(db("weld_logs"))->distinct()->count('iso_number')}}
|
||||
</span></div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Isometry")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-elegance-lighter block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/11.8%20WPS.png" width="48" alt="">
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">{{db("w_p_s")->count()}}</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("WPS")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-gd-leaf block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/11.3%20Naks%20Welder.png" width="48" alt="">
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">{{db("naks_welders")->distinct('welder_id')->count()}}</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Welder")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-flat-lighter block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/13.3%20Weldlog.png" width="48" alt="">
|
||||
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">{{apply_welded_filter(db("weld_logs"))->count()}}</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Weld Logs")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-corporate-lighter block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/002-repair.png" width="48" alt="">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">
|
||||
{{setting("repairRateAll")}}
|
||||
%</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Repair Rate")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="{{$colSize}}">
|
||||
<a class="bg-danger-light block block-link-shadow text-right" href="javascript:void(0)">
|
||||
<div class="block-content block-content-full clearfix">
|
||||
<div class="float-left mt-10 d-none d-sm-block">
|
||||
<img src="assets/icons/002-repair.png" width="48" alt="">
|
||||
|
||||
</div>
|
||||
<div class="font-size-h3 font-w600 js-count-to-enabled">
|
||||
<?php
|
||||
$repairLogs = json_decode(setting("repairLogs"), true);
|
||||
$nullRepairDateCount = collect($repairLogs)->whereNull('repair_date')->count();
|
||||
echo $nullRepairDateCount;
|
||||
?>
|
||||
</div>
|
||||
<div class="font-size-sm font-w600 text-uppercase text-muted">{{e2("Repair QTY")}}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<!-- END Row #1 -->
|
||||
</div>
|
||||
<div class="row js-appear-enabled animated fadeIn">
|
||||
|
||||
{{col("col-md-5","General Progress", 8)}}
|
||||
<div style="height:400px; overflow:auto">
|
||||
@include("admin.dashboard.chart.general-progress")
|
||||
</div>
|
||||
{{_col()}}
|
||||
|
||||
{{col("col-md-7","Progress", 6)}}
|
||||
@include("admin.dashboard.chart.monthly-progress")
|
||||
{{_col()}}
|
||||
|
||||
{{col("col-md-6","Spool Status", 5)}}
|
||||
@include("admin.type.spool-release.spool-list-chart")
|
||||
{{_col()}}
|
||||
{{col("col-md-6","NDT Backlog", 10)}}
|
||||
@include("admin.dashboard.chart.ndt-backlog")
|
||||
{{_col()}}
|
||||
|
||||
{{col("col-md-6","Test Status", 11)}}
|
||||
@include("admin.dashboard.chart.test-status")
|
||||
{{_col()}}
|
||||
|
||||
{{col("col-md-6","Punch Status", 12)}}
|
||||
@include("admin.dashboard.chart.punch-status")
|
||||
{{_col()}}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
|
||||
<!-- pdf.js CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@2.10.377/build/pdf.min.js"></script>
|
||||
<style>
|
||||
.flowchart .page {
|
||||
zoom: 50%;
|
||||
transition:all .5s
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
var zoom = 50;
|
||||
$(".zoomin").on("click", function(){
|
||||
zoom = zoom + 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
$(".zoomout").on("click", function(){
|
||||
zoom = zoom - 10;
|
||||
$(".flowchart .page").css("zoom", zoom + "%");
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(function(){
|
||||
const $pdf = '{{url("assets/diagram.pdf")}}';
|
||||
|
||||
const $initialState = {
|
||||
pdfDoc: null,
|
||||
currentPage: 1,
|
||||
pageCount: 0,
|
||||
zoom: 0.615,
|
||||
};
|
||||
|
||||
// Render the page.
|
||||
const renderPage = () => {
|
||||
// Load the first page.
|
||||
$initialState.pdfDoc
|
||||
.getPage($initialState.currentPage)
|
||||
.then((page) => {
|
||||
console.log('page', page);
|
||||
|
||||
const canvas = $('#canvas')[0];
|
||||
const $ctx = canvas.getContext('2d');
|
||||
const $viewport = page.getViewport({
|
||||
scale: $initialState.zoom,
|
||||
});
|
||||
|
||||
canvas.height = $viewport.height;
|
||||
canvas.width = $viewport.width;
|
||||
|
||||
// Render the PDF page into the canvas context.
|
||||
const renderCtx = {
|
||||
canvasContext: $ctx,
|
||||
viewport: $viewport,
|
||||
};
|
||||
|
||||
page.render(renderCtx);
|
||||
|
||||
$('#page_num').html($initialState.currentPage);
|
||||
});
|
||||
};
|
||||
|
||||
// Load the document.
|
||||
pdfjsLib
|
||||
.getDocument($pdf)
|
||||
.promise.then((doc) => {
|
||||
$initialState.pdfDoc = doc;
|
||||
console.log('pdfDocument', $initialState.pdfDoc);
|
||||
|
||||
$('#page_count').html($initialState.pdfDoc.numPages);
|
||||
|
||||
renderPage();
|
||||
})
|
||||
.catch((err) => {
|
||||
alert(err.message);
|
||||
});
|
||||
|
||||
function showPrevPage() {
|
||||
if ($initialState.pdfDoc === null || $initialState.currentPage <= 1)
|
||||
return;
|
||||
$initialState.currentPage--;
|
||||
// Render the current page
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
renderPage();
|
||||
}
|
||||
|
||||
function showNextPage() {
|
||||
if (
|
||||
$initialState.pdfDoc === null ||
|
||||
$initialState.currentPage >=
|
||||
$initialState.pdfDoc._pdfInfo.numPages
|
||||
)
|
||||
return;
|
||||
|
||||
$initialState.currentPage++;
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
renderPage();
|
||||
}
|
||||
|
||||
// Button events.
|
||||
$('#prev-page').click(showPrevPage);
|
||||
$('#next-page').click(showNextPage);
|
||||
|
||||
// Display a specific page.
|
||||
$('#current_page').on('keypress', (event) => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
// Get the key code.
|
||||
const $keycode = event.keyCode ? event.keyCode : event.which;
|
||||
if ($keycode === 13) {
|
||||
// Get the new page number and render it.
|
||||
let desiredPage = $('#current_page')[0].valueAsNumber;
|
||||
|
||||
$initialState.currentPage = Math.min(
|
||||
Math.max(desiredPage, 1),
|
||||
$initialState.pdfDoc._pdfInfo.numPages,
|
||||
);
|
||||
renderPage();
|
||||
|
||||
$('#current_page').val($initialState.currentPage);
|
||||
}
|
||||
});
|
||||
|
||||
// Zoom functionality.
|
||||
$('#zoom_in').on('click', () => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
$initialState.zoom *= 4 / 3;
|
||||
|
||||
renderPage();
|
||||
});
|
||||
|
||||
$('#zoom_out').on('click', () => {
|
||||
if ($initialState.pdfDoc === null) return;
|
||||
$initialState.zoom *= 2 / 3;
|
||||
renderPage();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<header>
|
||||
<table class="table ">
|
||||
<tr>
|
||||
<td width="20%" style="vertical-align: middle">
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-outline-primary" id="zoom_in">
|
||||
<i class="fas fa-search-plus"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-outline-primary" id="zoom_out">
|
||||
<i class="fas fa-search-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
<td width="60%" class="text-center"><img src="{{url("assets/logo.svg")}}" class="p-1" alt=""></td>
|
||||
<td width="20%" style="vertical-align: bottom;font-size:16px">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</header>
|
||||
<div class="flowchart" style="overflow:auto;width:100%;height:80vh;margin-top:10px">
|
||||
|
||||
<!-- Canvas to place the PDF -->
|
||||
<canvas id="canvas" class="canvas__container"></canvas>
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<input type="text" name="search" id="search" placeholder="{{e2("Search Training Videos...")}}" class="form-control mb-10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row videos">
|
||||
|
||||
<?php
|
||||
$basePath = "013_Others/video";
|
||||
$videos = glob("storage/documents/$basePath/*.mp4");
|
||||
|
||||
if(count($videos)>0) {
|
||||
foreach($videos AS $video) {
|
||||
$title = str_replace("storage/documents/013_Others/video/", "", $video);
|
||||
$title = str_replace(".mp4", "", $title);
|
||||
|
||||
?>
|
||||
{{col("col-md-6 col-xl-4 video ", $title)}}
|
||||
<div class="position-relative" style="min-height:300px;">
|
||||
|
||||
<video width="100%" height="100%" class="position-absolute" controls>
|
||||
<source src="{{$video}}" type="video/mp4">
|
||||
|
||||
Your browser does not support the video tag.
|
||||
</video>
|
||||
</div>
|
||||
{{_col()}}
|
||||
|
||||
<?php }
|
||||
} else { ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-warning">
|
||||
{{e2("No training videos have been uploaded yet.")}}
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#search").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$(".video").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user