ikinci temizlik tamamlandı
This commit is contained in:
@@ -0,0 +1,187 @@
|
||||
<?php use App\Translate; ?>
|
||||
|
||||
<?php if(!getisset("ajax")) { ?>
|
||||
|
||||
@extends('admin.master')
|
||||
@section("title")
|
||||
{{$c->title}}
|
||||
@endsection
|
||||
@section("desc")
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{url('admin/new/contents')}}"><i class="fa fa-home"></i></a></li>
|
||||
{!! $breadcrumb !!}
|
||||
<li class="breadcrumb-item active" aria-current="page">{{$c->title}}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
|
||||
<?php } else { ?>
|
||||
<style type="text/css">
|
||||
.modal #sidebar,.modal #page-header,.modal #side-overlay {
|
||||
display:none !important;
|
||||
}
|
||||
</style>
|
||||
<?php } ?>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.ana-icerik,.ceviriler,.coklu').toggleClass('hidden');
|
||||
});
|
||||
</script>
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{$c->title}} {{__('Edit Content')}}</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" onclick="$('.ana-icerik').toggleClass('hidden');">
|
||||
<i class="si si-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content block-content-full ana-icerik">
|
||||
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" class="hidden-upload" id="f{{$c->id}}" enctype="multipart/form-data" method="post">
|
||||
<input type="file" name="cover" id="c{{$c->id}}" onchange="$('#f{{$c->id}}').submit();" required />
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
|
||||
<input type="hidden" name="slug" value="{{$c->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<form action="{{url('admin-ajax/content-update?back')}}" class="serialize" method="post">
|
||||
{{csrf_field()}}
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{{__('Title')}}
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
|
||||
<input type="hidden" name="oldslug" value="{{$c->slug}}" />
|
||||
<input type="text" name="title" id="title" value="{{$c->title}}" class="form-control" />
|
||||
|
||||
{{__('ID')}} <div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$c->breadcrumb)}}'+$('#title').val(),function(d){
|
||||
$('#slug').val(d)
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
|
||||
|
||||
<input type="text" name="slug" id="slug" value="{{$c->slug}}" class="form-control" />
|
||||
{{e2("Parent")}}
|
||||
<input type="text" name="kid" class="form-control" value="{{$c->kid}}" />
|
||||
{{__('Content Type')}}
|
||||
<select name="type" data-id="{{$c->id}}" class="form-control edit" table="contents" >
|
||||
<option value="">Tip Seçiniz</option>
|
||||
@foreach(@$types AS $t)
|
||||
<option value="{{$t->title}}" @if($t->title==$c->type) selected @endif>{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
{{__('Content')}}
|
||||
<textarea class="" id="editor" name="html">{{$c->html}}</textarea>
|
||||
|
||||
@include("admin.inc.fields")
|
||||
</div>
|
||||
<div class="col-md-3 text-center">
|
||||
@if($c->cover!='')
|
||||
<div class="js-gallery">
|
||||
<a href="{{url('cache/large/'.$c->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
<img src="{{url('cache/small/'.$c->cover)}}" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
<hr />
|
||||
@else
|
||||
<i class="fa fa-image" style=" display: block;
|
||||
font-size: 150px;
|
||||
color: #f3f3f3;"></i>
|
||||
@endif
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{$c->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i> {{__('Kapak Resmi Yükle')}}</button>
|
||||
@if($c->cover!='')
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="{{__('Resmi kaldır')}}" href="{{url('admin-ajax/cover-delete?id='.$c->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$c->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
<div class="right-fixed">
|
||||
<a href="{{url($c->slug)}}" target="_blank" class="btn btn-danger"><i class="fa fa-globe"></i> {{__($c->title)}} {{__('See Your Content on the Web')}}</a>
|
||||
<button class="btn btn-primary">{{__('Save Changes')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<form action="{{url('admin-ajax/files-upload')}}" id="files{{$c->id}}" class="dropzone" id="dropzone" enctype="multipart/form-data" method="post">
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" multiple />
|
||||
|
||||
</div>
|
||||
@if($c->files!="")
|
||||
@php
|
||||
$files = explode(",",$c->files);
|
||||
@endphp
|
||||
@foreach(@$files AS $f)
|
||||
<?php $file_title = str_replace("storage/app/files/".$c->slug . "/","",$f); ?>
|
||||
<div file="{{$f}}" class="dz-preview dz-file-preview dz-processing dz-error dz-complete">
|
||||
<div class="dz-image"><img data-dz-thumbnail="" onerror='$(this).hide();' src="{{url($f)}}" width="100%"></div> <div class="dz-details">
|
||||
<div class="dz-filename"><span data-dz-name="">{{$file_title}}</span></div> </div>
|
||||
<div class="dz-success-mark">
|
||||
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Check</title>
|
||||
<defs></defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path> </g> </svg> </div>
|
||||
<div class="btn-group">
|
||||
<div class="btn btn-default delete"><i class="fa fa-times"></i></div>
|
||||
<a href="{{url($f)}}" target="_blank" class="btn btn-default "><i class="fa fa-download"></i></a>
|
||||
<?php if(strpos($f,".fbx")!==false) {
|
||||
?>
|
||||
<a href="{{url("three-js?file=".$f)}}" target="_blank" class="btn btn-default " title="{{e2("3D Önizleme")}}"><i class="fa fa-box"></i></a>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="dz-message" data-dz-message><span>{{__('You can upload files of the content by dropping or clicking here')}}</span></div>
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
<input type="hidden" name="slug" value="{{$c->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$(".dz-preview .delete").on("click",function(){
|
||||
var bu = $(this).parent().parent();
|
||||
bu.fadeTo(0.5);
|
||||
$.post("{{url('admin-ajax/delete-file')}}",{
|
||||
file:bu.attr("file"),
|
||||
slug : "{{$c->slug}}",
|
||||
id : "{{$c->id}}",
|
||||
_token : "{{csrf_token()}}"
|
||||
},function(d){
|
||||
bu.fadeOut();
|
||||
});
|
||||
$(".dz-message").html("")
|
||||
|
||||
}).css("cursor","pointer");
|
||||
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
@include("admin.inc.translate")
|
||||
@include("admin.inc.multi-content")
|
||||
-->
|
||||
@include("admin.inc.sub-content")
|
||||
</div>
|
||||
|
||||
<?php if(!getisset("ajax")) { ?>
|
||||
@endsection
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,221 @@
|
||||
<?php use App\Translate; ?>
|
||||
<?php $c = c(get("id")); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.ana-icerik,.ceviriler,.coklu').toggleClass('hidden');
|
||||
});
|
||||
</script>
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{$c->title}} {{__('İçeriğini Düzenle')}}</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" onclick="$('.ana-icerik').toggleClass('hidden');">
|
||||
<i class="si si-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content block-content-full ana-icerik">
|
||||
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" class="hidden-upload" id="f{{$c->id}}" enctype="multipart/form-data" method="post">
|
||||
<input type="file" name="cover" id="c{{$c->id}}" onchange="$('#f{{$c->id}}').submit();" required />
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
|
||||
<input type="hidden" name="slug" value="{{$c->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<form action="{{url('admin-ajax/content-update?back')}}" method="post">
|
||||
{{csrf_field()}}
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{{__('Başlık')}}
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
<input type="hidden" name="kid" value="{{$c->kid}}" />
|
||||
<input type="hidden" name="oldslug" value="{{$c->slug}}" />
|
||||
<input type="text" name="title" id="title" value="{{$c->title}}" class="form-control" />
|
||||
|
||||
{{__('URL')}} <div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$c->breadcrumb)}}'+$('#title').val(),function(d){
|
||||
$('#slug').val(d)
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
<input type="text" name="slug" id="slug" value="{{$c->slug}}" class="form-control" />
|
||||
|
||||
{{__('İçerik Tipi')}}
|
||||
<select name="type" data-id="{{$c->id}}" class="form-control edit" table="contents" >
|
||||
<option value="">Tip Seçiniz</option>
|
||||
@foreach(@$types AS $t)
|
||||
<option value="{{$t->title}}" @if($t->title==$c->type) selected @endif>{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
{{__('İçerik')}}
|
||||
<textarea class="" id="editor" name="html">{{$c->html}}</textarea>
|
||||
|
||||
@include("admin.inc.fields")
|
||||
</div>
|
||||
<div class="col-md-3 text-center">
|
||||
@if($c->cover!='')
|
||||
<div class="js-gallery">
|
||||
<a href="{{url('cache/large/'.$c->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
<img src="{{url('cache/small/'.$c->cover)}}" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
<hr />
|
||||
@else
|
||||
<i class="fa fa-image" style=" display: block;
|
||||
font-size: 150px;
|
||||
color: #f3f3f3;"></i>
|
||||
@endif
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{$c->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i> {{__('Kapak Resmi Yükle')}}</button>
|
||||
@if($c->cover!='')
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="{{__('Resmi kaldır')}}" href="{{url('admin-ajax/cover-delete?id='.$c->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$c->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
<div class="right-fixed">
|
||||
<a href="{{url($c->slug)}}" target="_blank" class="btn btn-danger"><i class="fa fa-globe"></i> {{__($c->title)}} {{__('İçeriğini Web\'de Gör')}}</a>
|
||||
<button class="btn btn-primary">{{__('Değişiklikleri Kaydet')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<form action="{{url('admin-ajax/files-upload')}}" id="files{{$c->id}}" class="dropzone" id="dropzone" enctype="multipart/form-data" method="post">
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" multiple />
|
||||
|
||||
</div>
|
||||
@if($c->files!="")
|
||||
@php
|
||||
$files = explode(",",$c->files);
|
||||
@endphp
|
||||
@foreach(@$files AS $f)
|
||||
<div file="{{$f}}" class="dz-preview dz-file-preview dz-processing dz-error dz-complete">
|
||||
<div class="dz-image"><img data-dz-thumbnail="" onerror='$(this).hide();' src="{{url($f)}}" width="100%"></div> <div class="dz-details">
|
||||
<div class="dz-filename"><span data-dz-name="">{{$f}}</span></div> </div>
|
||||
<div class="dz-success-mark">
|
||||
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Check</title>
|
||||
<defs></defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path> </g> </svg> </div>
|
||||
<div class="btn-group">
|
||||
<div class="btn btn-default delete"><i class="fa fa-times"></i></div>
|
||||
<a href="{{url($f)}}" target="_blank" class="btn btn-default "><i class="fa fa-download"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="dz-message" data-dz-message><span>{{__('İçeriğin dosyalarını buraya bırakarak veya tıklayarak yükleyebilirsiniz')}}</span></div>
|
||||
<input type="hidden" name="id" value="{{$c->id}}" />
|
||||
<input type="hidden" name="slug" value="{{$c->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".dz-preview .delete").on("click",function(){
|
||||
var bu = $(this).parent().parent();
|
||||
bu.fadeTo(0.5);
|
||||
$.post("{{url('admin-ajax/delete-file')}}",{
|
||||
file:bu.attr("file"),
|
||||
slug : "{{$c->slug}}",
|
||||
id : "{{$c->id}}",
|
||||
_token : "{{csrf_token()}}"
|
||||
},function(d){
|
||||
bu.fadeOut();
|
||||
});
|
||||
$(".dz-message").html("")
|
||||
|
||||
}).css("cursor","pointer");
|
||||
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
|
||||
</style>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block ">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Çeviriler')}}</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" onclick="$('.ceviriler').toggleClass('hidden');">
|
||||
<i class="si si-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="block-content block-content-full ceviriler">
|
||||
<?php $diller = explode(",",__('Diller')); foreach($diller AS $d) { ?>
|
||||
<?php $ceviri = Translate::where("dil",$d)->where("kr",md5($c->html))->first();
|
||||
if(!$ceviri) {
|
||||
$tr = new Translate;
|
||||
$tr->icerik = $c->html;
|
||||
$tr->kr = md5($c->html);
|
||||
$tr->dil = $d;
|
||||
$tr->ceviri = $c->html;
|
||||
$tr->save();
|
||||
$ceviri = Translate::where("dil",$d)->where("kr",md5($c->html))->first();
|
||||
}
|
||||
?>
|
||||
<form action="{{url('admin-ajax/input-edit')}}" method="post">
|
||||
@csrf
|
||||
<label>{{__($d)}}</label>
|
||||
<input type="hidden" name="id" value="{{@$ceviri->id}}" />
|
||||
<input type="hidden" name="table" value="translate" />
|
||||
<input type="hidden" name="name" value="ceviri" />
|
||||
<textarea name="value" id="" cols="30" rows="10" class="ckeditor">{{@$ceviri->ceviri}}</textarea>
|
||||
<br />
|
||||
<button class="btn btn-primary">{{__('Değişiklikleri Kaydet')}}</button> <br />
|
||||
<hr />
|
||||
<br />
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Çoklu İçerik Ekle')}}</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" onclick="$('.coklu').toggleClass('hidden');">
|
||||
<i class="si si-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="block-content block-content-full coklu">
|
||||
<form action="{{url('admin-ajax/content-multi-add?kid='.$c->slug)}}" method="post">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{{__('Bu kutuya birden fazla başlık yazarak bu alana çoklu olarak içerik ekleyebilirsiniz:')}}
|
||||
<select name="contents[]" id="" class="select2 form-control" multiple>
|
||||
<option value=""></option>
|
||||
</select>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{__('Tip Seçiniz')}}
|
||||
<select name="type" class="form-control" >
|
||||
@foreach($types AS $t)
|
||||
<option value="{{$t->title}}">{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<br />
|
||||
<button class="btn btn-primary">{{__('Ekle')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
@@ -0,0 +1,5 @@
|
||||
@extends('admin.master')
|
||||
@section("title","")
|
||||
@section("desc","")
|
||||
@section('content')
|
||||
@endsection
|
||||
@@ -0,0 +1,173 @@
|
||||
<?php
|
||||
use App\DevExtreme\LoadHelper;
|
||||
//spl_autoload_register(array("DevExtreme\LoadHelper", "LoadModule"));
|
||||
|
||||
use App\DevExtreme\DbSet;
|
||||
use App\DevExtreme\DataSourceLoader;
|
||||
use App\DevExtreme\SummaryContext;
|
||||
|
||||
class DataController {
|
||||
private $dbSet;
|
||||
public function __construct() {
|
||||
//TODO: use your database credentials
|
||||
$connection = config('database.connections.mysql');
|
||||
$host = $connection['host'];
|
||||
$username = $connection['username'];
|
||||
$password = $connection['password'];
|
||||
$database = $connection['database'];
|
||||
$mySQL = new mysqli($host, $username, $password, $database);
|
||||
mysqli_set_charset($mySQL, "utf8");
|
||||
|
||||
$table = get("table");
|
||||
if ($table === 'weld_logs' && get("module") === 'joint-release-log') {
|
||||
$table = 'joint_release_view';
|
||||
}
|
||||
$this->dbSet = new DbSet($mySQL, $table);
|
||||
}
|
||||
|
||||
public function Get($params) {
|
||||
// Store module before unsetting (needed for employer view filtering)
|
||||
$module = isset($params['module']) ? $params['module'] : null;
|
||||
unset($params['table']);
|
||||
unset($params['module']);
|
||||
$excludeMechanicalSummary = false;
|
||||
if(isset($params['excludeMechanicalSummary'])) {
|
||||
$excludeMechanicalSummary = filter_var($params['excludeMechanicalSummary'], FILTER_VALIDATE_BOOLEAN) || $params['excludeMechanicalSummary'] === '1';
|
||||
unset($params['excludeMechanicalSummary']);
|
||||
}
|
||||
if(isset($params['select'])) {
|
||||
// $params['select'] = array_unique($params['select'] );
|
||||
$uniqueArray = [];
|
||||
|
||||
foreach ($params['select'] as $value) {
|
||||
// Anahtar olarak değeri kullanarak yinelenen öğeleri kontrol et
|
||||
if (!in_array($value, $uniqueArray)) {
|
||||
// Daha önce eşleşme bulunmadıysa, bu değeri ekle
|
||||
$uniqueArray[] = $value;
|
||||
}
|
||||
}
|
||||
$params['select'] = $uniqueArray;
|
||||
}
|
||||
|
||||
if(!isset($params['sort'])) {
|
||||
|
||||
$params['sort'][] = (object) [
|
||||
'selector' => 'id',
|
||||
'desc' => true
|
||||
];
|
||||
}
|
||||
|
||||
SummaryContext::setExcludeMechanical($excludeMechanicalSummary);
|
||||
$result = DataSourceLoader::Load($this->dbSet, $params, $module);
|
||||
if (!isset($result)) {
|
||||
$result = $this->dbSet->GetLastError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function Post($values) {
|
||||
$result = $this->dbSet->Insert($values);
|
||||
if (!isset($result)) {
|
||||
$result = $this->dbSet->GetLastError();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function Put($key, $values) {
|
||||
$result = NULL;
|
||||
if (isset($key) && isset($values) && is_array($values)) {
|
||||
if (!is_array($key)) {
|
||||
$keyVal = $key;
|
||||
$key = array();
|
||||
$key["ID"] = $keyVal;
|
||||
}
|
||||
$result = $this->dbSet->Update($key, $values);
|
||||
if (!isset($result)) {
|
||||
$result = $this->dbSet->GetLastError();
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Exeption("Invalid params");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function Delete($key) {
|
||||
$result = NULL;
|
||||
if (isset($key)) {
|
||||
if (!is_array($key)) {
|
||||
$keyVal = $key;
|
||||
$key = array();
|
||||
$key["ID"] = $keyVal;
|
||||
}
|
||||
$result = $this->dbSet->Delete($key);
|
||||
if (!isset($result)) {
|
||||
$result = $this->dbSet->GetLastError();
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new Exeption("Invalid params");
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
function GetParseParams($params, $assoc = false) {
|
||||
$result = NULL;
|
||||
if (is_array($params)) {
|
||||
$result = array();
|
||||
foreach ($params as $key => $value) {
|
||||
$result[$key] = json_decode($params[$key], $assoc);
|
||||
if ($result[$key] === NULL) {
|
||||
$result[$key] = $params[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result = $params;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
function GetParamsFromInput() {
|
||||
$result = NULL;
|
||||
$content = file_get_contents("php://input");
|
||||
if ($content !== false) {
|
||||
$params = array();
|
||||
parse_str($content, $params);
|
||||
$result = GetParseParams($params, true);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
$response = NULL;
|
||||
$controller = new DataController();
|
||||
switch($_SERVER["REQUEST_METHOD"]) {
|
||||
case "GET": {
|
||||
$params = GetParseParams($_GET);
|
||||
$response = $controller->Get($params);
|
||||
break;
|
||||
}
|
||||
case "POST": {
|
||||
$params = GetParamsFromInput();
|
||||
$response = $controller->Post($params["values"]);
|
||||
break;
|
||||
}
|
||||
case "PUT": {
|
||||
$params = GetParamsFromInput();
|
||||
$response = $controller->Put($params["key"], $params["values"]);
|
||||
break;
|
||||
}
|
||||
case "DELETE": {
|
||||
$params = GetParamsFromInput();
|
||||
$response = $controller->Delete($params["key"]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($response) && !is_string($response)) {
|
||||
// $response = mb_convert_encoding($response, 'UTF-8', 'UTF-8');
|
||||
|
||||
echo json_encode_tr($response);
|
||||
}
|
||||
else {
|
||||
header("HTTP/1.1 500 Internal Server Error");
|
||||
header("Content-Type: application/json");
|
||||
$errorMessage = is_string($response) ? $response : "Unknown error";
|
||||
error_log("DevExtreme error: " . $errorMessage);
|
||||
echo json_encode(array("message" => $errorMessage, "code" => 500));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
@extends('admin.master')
|
||||
|
||||
|
||||
|
||||
@section("title",__("Alanlar"))
|
||||
@section("desc",__("Bir türe ait girilen tüm alanların yönetildiği bölüm"))
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">Mevcut Alanlar</h3>
|
||||
<div class="block-options">
|
||||
<div class="block-options-item">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
|
||||
|
||||
<table class="table table-striped table-hover table-bordered table-vcenter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__("Title")}}</th>
|
||||
<th>{{__("Form Tipi")}}</th>
|
||||
<th>{{__("İçerik Tipi")}}</th>
|
||||
<th>{{__("Ön Tanımlı Değerler")}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($fields AS $a)
|
||||
<tr>
|
||||
<td>{{$a->title}}</td>
|
||||
<td><input type="text" name="input_type" value="{{$a->input_type}}" table="fields"data-id="{{$a->id}}" class="form-control edit" /></td>
|
||||
<td>{{$a->type}}</td>
|
||||
<td>
|
||||
<input type="text" name="values" value="{{$a->values}}" table="fields" data-id="{{$a->id}}" class=" js-tags-input form-control edit" /></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php if(!isset($col)) {
|
||||
|
||||
$col = "col-6 col-md-4 col-lg-2";
|
||||
|
||||
} ?>
|
||||
|
||||
<div class="{{$col}}" id="t{{$a->id}}" id2="{{$a->id}}">
|
||||
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" id="f{{$a->id}}" class="d-none" enctype="multipart/form-data" method="post">
|
||||
|
||||
<input type="file" name="cover" id="c{{$a->id}}" onchange="$('#f{{$a->id}}').submit();" required />
|
||||
|
||||
<input type="hidden" name="id" value="{{$a->id}}" />
|
||||
|
||||
<input type="hidden" name="slug" value="{{$a->slug}}" />
|
||||
|
||||
{{csrf_field()}}
|
||||
|
||||
</form>
|
||||
|
||||
<div class="block main-block block-rounded block-bordered block-link-shadow text-center" >
|
||||
|
||||
<div class="block-header block-header-default">
|
||||
|
||||
<h3 class="block-title">
|
||||
|
||||
<input type="text" name="title" value="{{$a->title}}" placeholder="{{e2("Başlık Giriniz")}}" table="contents"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" />
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="block-options">
|
||||
<?php if(isset($a->slug)) { ?>
|
||||
<a class="btn-block-option d-none" href="{{ url($a->slug) }}" target="_blank" title="{{e2("Web'de Gör")}}">
|
||||
|
||||
<i class="fa fa-globe"></i>
|
||||
|
||||
</a>
|
||||
<?php } ?>
|
||||
<a class="btn-block-option" href="{{ url("admin/contents/".$a->id."") }}" target="_blank" title="{{$a->title}} {{e2("Düzenle")}}">
|
||||
|
||||
<i class="fa fa-pen"></i>
|
||||
|
||||
</a>
|
||||
|
||||
<a class="btn-block-option d-none" href="{{ url('admin-ajax/content-duplicate?cid='. $a->id ) }}"title="{{$a->title}} {{__('Çoğalt')}}">
|
||||
|
||||
<i class="fa fa-copy"></i>
|
||||
|
||||
</a>
|
||||
|
||||
<a class="btn-block-option" href="{{ url('admin/contents/'. $a->id .'/delete') }}" ajax="#t{{$a->id}}" teyit="{{$a->title}} {{__('içeriğini silmek istediğinizden emin misiniz?')}}" title="{{$a->title}} {{__('Silinecek!')}}">
|
||||
|
||||
<i class="fa fa-times"></i>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="block-content">
|
||||
|
||||
<p class="mt-5">
|
||||
|
||||
@if($a->cover!='')
|
||||
|
||||
<a href="{{ url('admin/contents/'. $a->id) }}" >
|
||||
|
||||
<img src="{{url('cache/small/'.$a->cover)}}" alt="" />
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
@else
|
||||
|
||||
<?php foreach($types AS $t) {
|
||||
|
||||
|
||||
|
||||
if($t->title==$a->type) {
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<a href="{{ url('admin/contents/'. $a->id) }}">
|
||||
|
||||
<i class="fa fa-{{$t->icon}} fa-4x content-icon"></i>
|
||||
|
||||
</a>
|
||||
|
||||
<?php } } ?>
|
||||
|
||||
@endif
|
||||
|
||||
</p>
|
||||
|
||||
<p class="font-size-h1">
|
||||
|
||||
<strong>
|
||||
|
||||
|
||||
|
||||
</strong>
|
||||
|
||||
</p>
|
||||
|
||||
<p class="font-w600">
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mb-10">
|
||||
|
||||
|
||||
|
||||
<div class="block-options">
|
||||
|
||||
<div class="btn-group float-left">
|
||||
|
||||
<button type="button" class="btn-block-option" onclick="$('#c{{$a->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i></button>
|
||||
|
||||
@if($a->cover!='')
|
||||
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="Resmi kaldır" href="{{url('admin-ajax/cover-delete?id='.$a->id)}}" class="btn-block-option"><i class="fa fa-times"></i></a>
|
||||
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$a->cover)}}" class="btn-block-option"><i class="fa fa-download"></i></a>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
<label class="css-control css-control-sm css-control-primary css-switch" title="{{e2("Yayınla/Yayından Kaldır")}}">
|
||||
|
||||
<input type="checkbox" class="css-control-input yayinla"data-id="{{$a->id}}" @if($a->y==1)checked=""@endif>
|
||||
|
||||
<span class="css-control-indicator"></span>
|
||||
|
||||
</label>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,73 @@
|
||||
<script src="//cdn.ckeditor.com/4.22.1/full-all/ckeditor.js"></script>
|
||||
<script>
|
||||
CKEDITOR.plugins.add('customTool', {
|
||||
icons: 'custom-tool',
|
||||
init: function (editor) {
|
||||
editor.addCommand('openDialog', new CKEDITOR.dialogCommand('customToolDialog'));
|
||||
|
||||
editor.ui.addButton('CustomTool', {
|
||||
label: 'Insert Custom Tool',
|
||||
command: 'openDialog',
|
||||
toolbar: 'insert'
|
||||
});
|
||||
|
||||
CKEDITOR.dialog.add('customToolDialog', this.path + 'dialogs/customTool.js');
|
||||
}
|
||||
});
|
||||
|
||||
CKEDITOR.dialog.add('customToolDialog', function (editor) {
|
||||
return {
|
||||
title: 'Insert Custom Tool',
|
||||
minWidth: 400,
|
||||
minHeight: 200,
|
||||
contents: [
|
||||
{
|
||||
id: 'info',
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
id: 'type',
|
||||
label: 'Type',
|
||||
validate: CKEDITOR.dialog.validate.notEmpty("Type cannot be empty.")
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
id: 'column_name',
|
||||
label: 'Column Name',
|
||||
validate: CKEDITOR.dialog.validate.notEmpty("Column Name cannot be empty.")
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
onOk: function () {
|
||||
var dialog = this,
|
||||
type = dialog.getValueOf('info', 'type'),
|
||||
columnName = dialog.getValueOf('info', 'column_name'),
|
||||
formattedText = '{' + type + '.' + columnName + '}';
|
||||
|
||||
editor.insertText(formattedText);
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
CKEDITOR.replace('html', {
|
||||
extraPlugins: 'customTool',
|
||||
height: 1000,
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
CKEDITOR.editorConfig = function( config ) {
|
||||
// Define changes to default configuration here. For example:
|
||||
// config.language = 'fr';
|
||||
// config.uiColor = '#AADC6E';
|
||||
config.extraPlugins = 'customTool';
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.cke_notifications_area {
|
||||
display:none !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!-- Feedback Modal -->
|
||||
<div class="modal fade" id="feedbackModal" tabindex="-1" role="dialog" aria-labelledby="feedbackModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-primary-dark text-white">
|
||||
<h5 class="modal-title" id="feedbackModalLabel">💬 Feeedback</h5>
|
||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="feedbackForm" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<label for="feedbackTitle">Title</label>
|
||||
<input type="text" class="form-control" id="feedbackTitle" name="title" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="feedbackDescription">Explanation</label>
|
||||
<textarea class="form-control" id="feedbackDescription" name="description" rows="4" required></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="feedbackScreenshot">Screenshot</label><br>
|
||||
<button type="button" class="btn btn-sm btn-secondary" id="takeScreenshot">📸 Take Screenshot</button>
|
||||
<input type="hidden" name="screenshot" id="screenshotInput">
|
||||
<div id="screenshotPreview" class="mt-3"></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-alt-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-alt-success" id="sendFeedback">Send</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
|
||||
$j = json_decode($c->json,true);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@if($fields!=null)
|
||||
|
||||
@foreach(@$fields AS $a => $d)
|
||||
|
||||
{{__($a)}}
|
||||
|
||||
@if($d['type']=="textarea")
|
||||
|
||||
<textarea name="{{$a}}" id="" cols="30" fields="10" class="form-control">{{json_field($j,$a)}}</textarea>
|
||||
|
||||
@elseif($d['type']=="select")
|
||||
|
||||
<select name="{{$a}}" id="" class="form-control select2">
|
||||
|
||||
<option value="">Seçiniz</option>
|
||||
|
||||
@foreach($d['values'] AS $v)
|
||||
|
||||
<option value="{{$v}}" @if($v ==json_field($j,$a)) selected @endif>{{$v}}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
@elseif($d['type']=="select-dynamic")
|
||||
|
||||
@php
|
||||
|
||||
$db_and_type = explode(":",$d['values'][0]);
|
||||
|
||||
$sorgu = DB::table($db_and_type[0])
|
||||
->where("type",$db_and_type[1])
|
||||
->get();
|
||||
|
||||
$title = explode("-",$d['values'][1]);
|
||||
|
||||
@endphp
|
||||
|
||||
<select name="{{$a}}" id="" class="form-control select2">
|
||||
|
||||
<option value="">Seçiniz</option>
|
||||
|
||||
@foreach($sorgu AS $s)
|
||||
|
||||
@php
|
||||
|
||||
$value = $s->{$d['values'][2]};
|
||||
|
||||
@endphp
|
||||
|
||||
<option value="{{ $value }}" @if($value ==json_field($j,$a)) selected @endif>
|
||||
|
||||
@foreach($title AS $t)
|
||||
|
||||
{{ $s->{$t} }}
|
||||
|
||||
@endforeach
|
||||
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
@elseif($d['type']=="select-multiple-dynamic")
|
||||
|
||||
@php
|
||||
$db_and_type = explode(":",$d['values'][0]);
|
||||
|
||||
$sorgu = DB::table($db_and_type[0])
|
||||
->where("type",$db_and_type[1])
|
||||
->get();
|
||||
|
||||
$title = explode("-",$d['values'][1]);
|
||||
|
||||
@endphp
|
||||
|
||||
<select name="{{$a}}[]" id="" class="form-control select2" multiple>
|
||||
|
||||
<option value="">Seçiniz</option>
|
||||
|
||||
@foreach($sorgu AS $s)
|
||||
|
||||
@php
|
||||
|
||||
$value = $s->{$d['values'][2]};
|
||||
|
||||
@endphp
|
||||
|
||||
<option value="{{ $value }}" @if(@in_array($value,json_field($j,$a))) selected @endif>
|
||||
|
||||
@foreach($title AS $t)
|
||||
|
||||
{{ $s->{$t} }}
|
||||
|
||||
@endforeach
|
||||
|
||||
</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
@elseif($d['type']=="select-multiple")
|
||||
|
||||
<select name="{{$a}}[]" id="" class="form-control select2" multiple>
|
||||
|
||||
<option value="">Seçiniz</option>
|
||||
|
||||
|
||||
|
||||
@foreach($d['values'] AS $v)
|
||||
|
||||
@if($v!="")
|
||||
|
||||
<option value="{{$v}}" @if(@in_array($v,json_field($j,$a))) selected @endif>{{$v}}</option>
|
||||
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
|
||||
@if(is_array(json_field($j,$a)))
|
||||
|
||||
@foreach(json_field($j,$a) AS $v)
|
||||
|
||||
<option value="{{$v}}" selected>{{$v}}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
|
||||
</select>
|
||||
|
||||
@elseif($d['type']=="radio") <br />
|
||||
|
||||
@foreach($d['values'] AS $v)
|
||||
|
||||
|
||||
|
||||
<label><input type="{{$d['type']}}" name="{{$a}}" value="{{$v}}" @if($v ==json_field($j,$a)) checked @endif id="" /> {{$v}}</label> <br />
|
||||
|
||||
@endforeach
|
||||
|
||||
@elseif($d['type']=="checkbox") <br />
|
||||
|
||||
@foreach($d['values'] AS $v)
|
||||
|
||||
<label><input type="{{$d['type']}}" name="{{$a}}[]" value="{{$v}}" @if(@in_array($v,json_field($j,$a))) checked @endif id="" /> {{$v}}</label> <br />
|
||||
|
||||
@endforeach
|
||||
|
||||
@else
|
||||
|
||||
<input type="{{$d['type']}}" step="any" class="form-control" name="{{$a}}" value="{{json_field($j,$a)}}" id="" />
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
use App\Types;
|
||||
|
||||
use App\Content;
|
||||
|
||||
use App\Fields;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<form action="{{url('admin-ajax/content-update?back')}}" method="post">
|
||||
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
{{__('Başlık')}}
|
||||
|
||||
<input type="hiddendata-id="{{"id" value="{{@$c->id}}" />
|
||||
|
||||
<input type="hidden" name="kid" value="{{@$c->kid}}" />
|
||||
|
||||
<input type="hidden" name="oldslug" value="{{@$c->slug}}" />
|
||||
|
||||
<input type="text" name="title" id="title" value="{{@$c->title}}" class="form-control" />
|
||||
|
||||
|
||||
|
||||
{{__('URL')}} <div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.@$c->breadcrumb)}}'+$('#title').val(),function(d){
|
||||
|
||||
$('#slug').val(d)
|
||||
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
|
||||
<input type="text" name="slug" id="slug" value="{{@$c->slug}}" class="form-control" />
|
||||
|
||||
|
||||
|
||||
{{__('İçerik Tipi')}}
|
||||
|
||||
<select name="type" id="{{@$c->id}}" class="form-control edit" table="contents" >
|
||||
|
||||
<option value="">Tip Seçiniz</option>
|
||||
|
||||
@foreach(@$types AS $t)
|
||||
|
||||
<option value="{{$t->title}}" @if($t->title==@$c->type) selected @endif>{{$t->title}}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
{{__('İçerik')}}
|
||||
|
||||
<textarea class="" id="editor" name="html">{{@$c->html}}</textarea>
|
||||
|
||||
|
||||
|
||||
@include("admin.inc.fields")
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 text-center">
|
||||
|
||||
@if(@$c->cover!='')
|
||||
|
||||
<div class="js-gallery">
|
||||
|
||||
<a href="{{url('cache/large/'.@$c->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
|
||||
<img src="{{url('cache/small/'.@$c->cover)}}" alt="" />
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
@else
|
||||
|
||||
<i class="fa fa-image" style=" display: block;
|
||||
|
||||
font-size: 150px;
|
||||
|
||||
color: #f3f3f3;"></i>
|
||||
|
||||
@endif
|
||||
|
||||
<div class="btn-group">
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{@$c->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i> {{__('Kapak Resmi Yükle')}}</button>
|
||||
|
||||
@if(@$c->cover!='')
|
||||
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="{{__('Resmi kaldır')}}" href="{{url('admin-ajax/cover-delete?id='.@$c->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.@$c->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="">
|
||||
|
||||
<a href="{{url(@$c->slug)}}" target="_blank" class="btn btn-danger"><i class="fa fa-globe"></i> {{__(@$c->title)}} {{__('İçeriğini Web\'de Gör')}}</a>
|
||||
|
||||
<button class="btn btn-primary">{{__('Değişiklikleri Kaydet')}}</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,366 @@
|
||||
<header id="page-header" class="{{setting("header_color")}}">
|
||||
<!-- Header Content -->
|
||||
<div class="content-header">
|
||||
<!-- Left Section -->
|
||||
<div class="content-header-section">
|
||||
<!-- Toggle Sidebar -->
|
||||
<button type="button" class="btn btn-circle btn-dual-secondary" data-toggle="layout" data-action="sidebar_toggle">
|
||||
<i class="fas fa-bars"></i>
|
||||
</button>
|
||||
<!-- END Toggle Sidebar -->
|
||||
|
||||
<!-- Open Search Section -->
|
||||
<button type="button" class="btn btn-circle btn-dual-secondary" data-toggle="layout" data-action="header_search_on">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
<!-- END Open Search Section -->
|
||||
|
||||
<!-- Project Info (Visible on large screens) -->
|
||||
<div class="d-none d-lg-inline-block ml-10">
|
||||
<span class="font-w700 text-white text-uppercase">{{setting("project_number")}}</span>
|
||||
<span class="text-white-op "
|
||||
style="max-width:30%; display:inline-block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; text-align:center; cursor:pointer;"
|
||||
data-toggle="popover"
|
||||
data-placement="bottom"
|
||||
data-html="true"
|
||||
data-original-title="{{ setting("project_name") }}"
|
||||
data-content='{{ setting("project_name_ru") }}'>
|
||||
- {{ setting("project_name") }} / {{ setting("project_name_ru") }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END Left Section -->
|
||||
|
||||
<!-- Right Section -->
|
||||
<div class="content-header-section">
|
||||
|
||||
<!-- Feedback Button -->
|
||||
<button type="button" class="btn btn-rounded btn-dual-secondary"
|
||||
id="openFeedback"
|
||||
title="Feedback">
|
||||
<i class="fas fa-comment-dots"></i>
|
||||
</button>
|
||||
|
||||
@if($u->level == "Admin")
|
||||
<!-- Admin Tools Dropdown -->
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-rounded btn-dual-secondary" id="page-header-admin-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-wrench"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right min-width-200" aria-labelledby="page-header-admin-dropdown">
|
||||
<h5 class="h6 text-center py-10 mb-5 border-b text-uppercase">Admin Tools</h5>
|
||||
|
||||
<a class="dropdown-item" href="javascript:void(0)" onclick="
|
||||
Swal.fire('', 'Cronjob is Started', 'success');
|
||||
$.get('{{url("cron")}}', function(d){
|
||||
Swal.fire('', 'Cronjob is OK', 'success')
|
||||
});">
|
||||
<i class="fa fa-cog mr-5"></i> {{e2("Run CronJOB")}}
|
||||
</a>
|
||||
|
||||
<a class="dropdown-item" href="javascript:void(0)" onclick="$.get('{{url("clear-cache")}}',function(d) {
|
||||
Swal.fire('', 'Cache is Cleared!', 'success')
|
||||
});">
|
||||
<i class="fa fa-sync mr-5"></i> {{__('Clear cache')}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Language Dropdown -->
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-rounded btn-dual-secondary" id="page-header-language-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-globe"></i>
|
||||
<span class="d-none d-sm-inline-block ml-5">{{e2(App::getLocale())}}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right min-width-200" aria-labelledby="page-header-language-dropdown">
|
||||
<h5 class="h6 text-center py-10 mb-5 border-b text-uppercase">{{ e2("Change Language") }}</h5>
|
||||
<div class="dropdown-divider"></div>
|
||||
<?php $dil = languages(); foreach($dil AS $d) { ?>
|
||||
<a class="dropdown-item" href="javascript:void(0)" onclick="$.get('?ajax=set-locale&l={{$d}}',function(){location.reload()})">
|
||||
<i class="fa fa-language mr-5"></i> {{e2($d)}}
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notifications -->
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-rounded btn-dual-secondary" id="notification-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" onclick="loadNotifications()">
|
||||
<i class="fa fa-bell"></i>
|
||||
<span class="badge badge-primary badge-pill" id="notification-count" style="display:none;">0</span>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right" style="width: 380px; padding: 0;" aria-labelledby="notification-dropdown">
|
||||
<div class="block block-rounded block-bordered mb-0" style="border: none; border-radius: 0.375rem;">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">
|
||||
<i class="fa fa-bell mr-5"></i> {{ e2("Notifications") }}
|
||||
<span class="badge badge-primary ml-5" id="notification-unread-indicator">{{ e2("Loading") }}</span>
|
||||
</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" onclick="markAllAsRead(); return false;" title="{{e2('Mark All Read')}}">
|
||||
<i class="si si-check"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-content p-0">
|
||||
<div id="notification-scroll-area" style="max-height: 400px; overflow-y: auto;">
|
||||
<ul id="notification-list" class="list-unstyled mb-0">
|
||||
<li class="text-center py-20 text-muted">
|
||||
<i class="fa fa-spinner fa-spin fa-2x mb-10"></i>
|
||||
<div>{{ e2("Loading...") }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-content block-content-full block-content-sm bg-body-light text-center">
|
||||
<a class="btn btn-sm btn-alt-primary" href="{{url('/admin/types/my-notifications')}}">
|
||||
<i class="fa fa-list mr-5"></i> {{e2("View All")}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- User Dropdown -->
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-rounded btn-dual-secondary" id="page-header-user-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-user d-sm-none"></i>
|
||||
<span class="d-none d-sm-inline-block ml-5">{{ Auth::user()->name }} {{ Auth::user()->surname }}</span>
|
||||
<i class="fa fa-angle-down ml-5"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu dropdown-menu-right min-width-200" aria-labelledby="page-header-user-dropdown">
|
||||
<h5 class="h6 text-center py-10 mb-5 border-b text-uppercase">User</h5>
|
||||
<a class="dropdown-item" href="javascript:void(0)" data-toggle="layout" data-action="side_overlay_toggle">
|
||||
<i class="si si-wrench mr-5"></i> {{e2("Account Settings")}}
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{url('logout')}}">
|
||||
<i class="si si-logout mr-5"></i> {{__('Sign Out')}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END Right Section -->
|
||||
</div>
|
||||
<!-- END Header Content -->
|
||||
|
||||
<!-- Header Search -->
|
||||
<div id="page-header-search" class="overlay-header">
|
||||
<div class="content-header content-header-fullrow">
|
||||
<form action="{{url('admin/search')}}" method="get">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<button type="button" class="btn btn-secondary" data-toggle="layout" data-action="header_search_off">
|
||||
<i class="fas fa-times"></i>
|
||||
</button>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="Search..." name="q">
|
||||
<div class="input-group-append">
|
||||
<button type="submit" class="btn btn-secondary">
|
||||
<i class="fas fa-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END Header Search -->
|
||||
|
||||
<div class="d-flex justify-content-center py-3 mini-header">
|
||||
@yield("title")
|
||||
</div>
|
||||
|
||||
<!-- Header Loader -->
|
||||
<div id="page-header-loader" class="overlay-header bg-primary">
|
||||
<div class="content-header content-header-fullrow text-center">
|
||||
<div class="content-header-item">
|
||||
<i class="fa fa-sun-o fa-spin text-white"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END Header Loader -->
|
||||
|
||||
<style>
|
||||
/* Mini Header Custom Styles */
|
||||
.mini-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 5px; /* Image ve title arası mesafe */
|
||||
transition: all 0.3s ease;
|
||||
|
||||
/* Hem mobilde hem desktopta akışı bozmaması için absolute */
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 1000; /* En üstte */
|
||||
pointer-events: none; /* Arkadaki butonlara tıklanabilsin */
|
||||
|
||||
color: white !important; /* Her durumda beyaz */
|
||||
}
|
||||
|
||||
.mini-header img {
|
||||
height: 33px;
|
||||
width: auto;
|
||||
display: block;
|
||||
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
|
||||
}
|
||||
|
||||
/* Geniş Ekran (Desktop) Ayarları */
|
||||
@media (min-width: 992px) {
|
||||
.mini-header {
|
||||
font-size: 20px;
|
||||
top: 3px; /* Özel istek */
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.mini-header img {
|
||||
height: 33px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Mobil Ekran Ayarları */
|
||||
@media (max-width: 991.98px) {
|
||||
.mini-header {
|
||||
font-size: 16px;
|
||||
/* Mobilde tam ortada kalsın */
|
||||
}
|
||||
|
||||
.mini-header img {
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print Styles */
|
||||
.yesprint { display:none; }
|
||||
@media print {
|
||||
.sidebar, .noprint { display:none; }
|
||||
body { background:white; }
|
||||
.yesprint { display:block; }
|
||||
}
|
||||
|
||||
/* Notification Item Styles */
|
||||
.notification-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 12px 15px;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.notification-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.notification-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.notification-item.unread {
|
||||
background-color: #f0f8ff;
|
||||
border-left: 3px solid #42a5f5;
|
||||
}
|
||||
|
||||
.notification-item.unread:hover {
|
||||
background-color: #e3f2fd;
|
||||
}
|
||||
|
||||
.notification-item .icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: #fff;
|
||||
margin-right: 12px;
|
||||
flex-shrink: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.notification-item.unread .icon {
|
||||
background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
|
||||
}
|
||||
|
||||
.notification-item .content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.notification-item .content .title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
margin-bottom: 4px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.notification-item .content .message {
|
||||
font-size: 13px;
|
||||
color: #6c757d;
|
||||
line-height: 1.5;
|
||||
margin-bottom: 6px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.notification-item .content .meta {
|
||||
font-size: 11px;
|
||||
color: #adb5bd;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.notification-item .content .meta i {
|
||||
margin-right: 4px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.notification-placeholder {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.notification-placeholder i {
|
||||
font-size: 48px;
|
||||
margin-bottom: 15px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.notification-placeholder .font-weight-bold {
|
||||
font-size: 16px;
|
||||
color: #495057;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.notification-placeholder .small {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Scrollbar Styling */
|
||||
#notification-scroll-area::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
#notification-scroll-area::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
|
||||
#notification-scroll-area::-webkit-scrollbar-thumb {
|
||||
background: #c1c1c1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#notification-scroll-area::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
</style>
|
||||
</header>
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php use App\Translate; ?>
|
||||
<?php use App\Types; ?>
|
||||
<?php $types = Types::whereNull("kid")->where("enabled", true)->orderBy("s","ASC")->get();
|
||||
|
||||
?>
|
||||
<div class="content-side content-side-full">
|
||||
<input type="text" name="" placeholder="{{e2("Search Module")}}" id="search-module" class="form-control">
|
||||
<script>
|
||||
$(function(){
|
||||
$("#search-module").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$(".nav-main li ul li ").hide();
|
||||
$(".nav-main li").hide().removeClass("open");
|
||||
$(".nav-main li ul li ").filter(function() {
|
||||
var result = $(this).text().toLowerCase().indexOf(value);
|
||||
//console.log(result);
|
||||
|
||||
if(result>-1) {
|
||||
|
||||
$(this).show();
|
||||
$(this).parent().parent().show().addClass("open");
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<ul class="nav-main">
|
||||
<li class="d-none">
|
||||
<a class="active" href="{{url('admin/')}}"><i class="si si-cup"></i><span
|
||||
class="sidebar-mini-hide">Dashboard</span></a>
|
||||
</li>
|
||||
<?php
|
||||
$u = u();
|
||||
$level = str_slug($u->level); ?>
|
||||
@if(View::exists("admin.inc.menu.$level"))
|
||||
@include("admin.inc.menu.$level")
|
||||
@endif
|
||||
<li class="nav-main-heading d-none"><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">{{e2('Content Types')}}</span></li>
|
||||
|
||||
@foreach($types AS $c)
|
||||
|
||||
@if(in_array($c->title, $permissions) || in_array($c->slug,$permissions))
|
||||
<li class="{{$c->slug}}">
|
||||
<?php $alt = Types::where("kid",$c->slug)->where("enabled", true)->orderBy("s", "ASC")->get(); ?>
|
||||
<a <?php if(varmi($alt)) { ?>class="nav-submenu" data-toggle="nav-submenu"<?php } ?>
|
||||
@if($c->slug == 'feedback-reports') id="feedback-link" class="d-flex align-items-center" @endif
|
||||
href="{{ url('admin/types/'. $c->slug) }}">
|
||||
<i>
|
||||
<img src="{{url("assets/icons/".$c->icon . ".png")}}" width="24" alt="">
|
||||
</i>
|
||||
@if($c->slug == 'feedback-reports')
|
||||
<span class="ml-2">{{e2($c->title)}}</span>
|
||||
@php $unreadFeedbackCount = \App\Models\FeedbackReport::where('status', 'submitted')->count(); @endphp
|
||||
<span id="feedback-badge" class="badge badge-danger ml-2 flex-shrink-0" style="{{ $unreadFeedbackCount > 0 ? '' : 'display:none;' }}">{{ $unreadFeedbackCount }}</span>
|
||||
@else
|
||||
<span class="ml-2">{{e2($c->title)}}</span>
|
||||
@endif
|
||||
</a>
|
||||
<?php if(varmi($alt)) { ?>
|
||||
|
||||
<ul>
|
||||
<?php foreach($alt AS $a) { ?>
|
||||
@if(in_array($a->title,$permissions))
|
||||
<li class="{{$a->slug}}">
|
||||
<a href="{{ url('admin/types/'. $a->slug) }}">
|
||||
<i>
|
||||
<img src="{{url("assets/icons/".$a->icon . ".png")}}" class="sub-menu-icon" width="16" alt="">
|
||||
</i>
|
||||
<span class="ml-2 sub-menu-text">{{e2($a->title)}}</span>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
@if(isAdmin())
|
||||
<li class="nav-main-heading"><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">{{e2('User Guide')}}</span></li>
|
||||
<li>
|
||||
<a href="{{url('admin/user-guide')}}"><i class="fa fa-book"></i><span
|
||||
class="sidebar-mini-hide">{{e2("User Guide")}}</span></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="nav-submenu" href="{{url('admin/users')}}"><i class="si si-users"></i><span
|
||||
class="sidebar-mini-hide">{{e2("Users")}}</span></a>
|
||||
</li>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
<?php
|
||||
$onlyShowProjectUrls = [
|
||||
'Admin',
|
||||
'Manager (Center Office)',
|
||||
'Manager (PTO)',
|
||||
'Manager (Lead)',
|
||||
];
|
||||
|
||||
if(in_array($u->level, $onlyShowProjectUrls)) {
|
||||
$projects = j(setting("project-app-urls")) ?>
|
||||
@if(!is_null($projects))
|
||||
<li class="nav-main-heading"><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">{{e2('Project Links')}}</span></li>
|
||||
|
||||
<?php foreach($projects AS $project) { ?>
|
||||
@if(isset($project['url']))
|
||||
@if($project['url']!="")
|
||||
<li>
|
||||
<a target="_blank" href="{{$project['url']}}">
|
||||
<i class="material-symbols-outlined">
|
||||
display_settings
|
||||
</i>
|
||||
<span>{{$project['project_name']}}</span></a>
|
||||
</li>
|
||||
@endif
|
||||
@endif
|
||||
<?php } ?>
|
||||
|
||||
@endif
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@if(isAdmin())
|
||||
<li class="nav-main-heading"><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">{{e2('Language Settings')}}</span></li>
|
||||
|
||||
<?php $diller = languages(); foreach($diller AS $d) { ?>
|
||||
<li>
|
||||
<a href="{{ url('admin/languages/'. $d) }}">
|
||||
<i class="material-symbols-outlined">
|
||||
language
|
||||
</i>
|
||||
<span>{{e2($d)}}</span></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
@endif
|
||||
|
||||
@if(in_array("contents",$permissions))
|
||||
<li class="nav-main-heading d-none "><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">Contents Tree</span></li>
|
||||
|
||||
<ol class="tree d-none">
|
||||
|
||||
|
||||
|
||||
|
||||
@foreach($contents AS $c)
|
||||
@if($c->title!="")
|
||||
<li>
|
||||
<label for="menu-<?php echo($c->id) ?>" ajax=".content-ajax" onclick="location.href='{{url("admin/contents/".$c->id)}}'"><?php echo e2($c->title) ?></label>
|
||||
<input type="checkbox" slug="<?php echo e2($c->slug); ?>" class="kategori-tree" id="menu-<?php echo($c->id) ?>" />
|
||||
<ol>
|
||||
|
||||
</ol>
|
||||
</li>
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
</ol>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".kategori-tree").on("click",function(){
|
||||
console.log("ok");
|
||||
var bu = $(this);
|
||||
bu.parent().children("ol").html("{{e2('Loading...')}}");
|
||||
$.get('{{url('admin-ajax/contents-tree?id=')}}'+$(this).attr("slug"),function(d){
|
||||
bu.parent().children("ol").html(d);
|
||||
});
|
||||
//return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.contents-tree * {
|
||||
cursor:pointer;
|
||||
}
|
||||
</style>
|
||||
@endif
|
||||
@if(isAdmin())
|
||||
<li class="nav-main-heading "><span class="sidebar-mini-visible">UI</span><span
|
||||
class="sidebar-mini-hidden">{{e2('Content Management')}}</span></li>
|
||||
<li class="d-none">
|
||||
<a class="nav-submenu" href="{{url('admin/new/contents')}}"><i class="si si-grid"></i><span
|
||||
class="sidebar-mini-hide">{{e2("Contents")}}</span></a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-submenu" href="{{ url('admin/new/types') }}"><i
|
||||
class="si si-layers"></i><span class="sidebar-mini-hide">{{e2('Modules')}}</span></a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-submenu" href="{{ url('admin/new/artisan') }}"><i
|
||||
class="fa fa-code"></i><span class="sidebar-mini-hide">{{e2('Artisan')}}</span></a>
|
||||
|
||||
</li>
|
||||
<li class="d-none">
|
||||
<a class="nav-submenu" href="{{url('admin/fields')}}"><i class="si si-list"></i><span
|
||||
class="sidebar-mini-hide">{{e2('Columns')}}</span></a>
|
||||
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<li>
|
||||
<a href="?t=new-submission">
|
||||
<i class="material-symbols-outlined">
|
||||
add_circle
|
||||
</i>
|
||||
<span class="sidebar-mini-hide">Start a new submission</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="?t=submissions">
|
||||
<i class="material-symbols-outlined">
|
||||
article
|
||||
</i>
|
||||
<span class="sidebar-mini-hide">Submissions</span></a>
|
||||
</li>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div class="block">
|
||||
|
||||
<div class="block-header block-header-default">
|
||||
|
||||
<h3 class="block-title">{{__('Çoklu İçerik Ekle')}}</h3>
|
||||
|
||||
<div class="block-options">
|
||||
|
||||
<button type="button" class="btn-block-option" onclick="$('.coklu').toggleClass('hidden');">
|
||||
|
||||
<i class="si si-eye"></i>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="block-content block-content-full coklu">
|
||||
|
||||
<form action="{{url('admin-ajax/content-multi-add?kid='.$c->slug)}}" method="post">
|
||||
|
||||
@csrf
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
|
||||
{{__('Bu kutuya birden fazla başlık yazarak bu alana çoklu olarak içerik ekleyebilirsiniz:')}}
|
||||
|
||||
<select name="contents[]" id="" class="select2 form-control" multiple>
|
||||
|
||||
<option value=""></option>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
<!-- Page JS Plugins CSS -->
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/bootstrap-datepicker/css/bootstrap-datepicker3.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css') }}">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.9/css/select2.min.css" rel="stylesheet" />
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/jquery-tags-input/jquery.tagsinput.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/jquery-auto-complete/jquery.auto-complete.min.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/ion-rangeslider/css/ion.rangeSlider.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/ion-rangeslider/css/ion.rangeSlider.skinHTML5.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/dropzonejs/dist/dropzone.css') }}">
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
|
||||
|
||||
<link rel="stylesheet" id="css-main" href="{{ asset('assets/admin/css/pelinom6.min.css') }}?v=1.3">
|
||||
<link rel="stylesheet" id="css-main" href="{{ asset('assets/admin/css/themes/pulse.min.css') }}">
|
||||
<link rel="stylesheet" id="css-main" href="{{ asset('assets/admin/css/stellar.css?'.rand()) }}">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Muli:300,400,400i,600,700">
|
||||
<link href="https://fonts.googleapis.com/css?family=Oswald&display=swap" rel="stylesheet">
|
||||
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Saira+Semi+Condensed:100,300,400,700,900&display=swap&subset=latin-ext" rel="stylesheet">
|
||||
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<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" />
|
||||
<style>
|
||||
/* Font Awesome 4 to 6 Compatibility Fixes */
|
||||
.fa, .fas, .far, .fab {
|
||||
font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", sans-serif;
|
||||
}
|
||||
|
||||
/* Ensure outline icons use the correct font family and weight (Regular) */
|
||||
.fa-clock-o:before,
|
||||
.fa-star-o:before,
|
||||
.fa-trash-o:before,
|
||||
.fa-file-o:before,
|
||||
.fa-check-circle-o:before,
|
||||
.fa-circle-o:before,
|
||||
.fa-square-o:before,
|
||||
.fa-bookmark-o:before,
|
||||
.fa-comment-o:before,
|
||||
.fa-envelope-o:before,
|
||||
.fa-folder-o:before,
|
||||
.fa-folder-open-o:before,
|
||||
.fa-hdd-{}o:before,
|
||||
.fa-keyboard-o:before,
|
||||
.fa-lemon-o:before,
|
||||
.fa-lightbulb-o:before,
|
||||
.fa-moon-o:before,
|
||||
.fa-paper-plane-o:before,
|
||||
.fa-play-circle-o:before,
|
||||
.fa-question-circle-o:before,
|
||||
.fa-sun-o:before,
|
||||
.fa-times-circle-o:before,
|
||||
.fa-calendar-o:before,
|
||||
.fa-check-square-o:before,
|
||||
.fa-hand-o-down:before,
|
||||
.fa-hand-o-left:before,
|
||||
.fa-hand-o-right:before,
|
||||
.fa-hand-o-up:before,
|
||||
.fa-heart-o:before,
|
||||
.fa-thumbs-o-down:before,
|
||||
.fa-thumbs-o-up:before {
|
||||
font-family: "Font Awesome 6 Free" !important;
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.modal-xl {
|
||||
max-width: 95% !important;
|
||||
}
|
||||
}
|
||||
.modal-full {
|
||||
max-width: 98% !important;
|
||||
margin: 10px auto;
|
||||
}
|
||||
iframe.pdf-preview {
|
||||
background: #eee;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.4/jquery.datetimepicker.min.css" />
|
||||
<script src="{{ asset('assets/admin/js/pelinom6.core.min.js') }}" ></script>
|
||||
|
||||
<script src="{{ asset('assets/admin/js/pelinom6.app.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('assets/admin/js/store.js') }}"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js" integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script>
|
||||
<script src="{{url("assets/datagridxl/datagridxl/datagridxl2.js")}}"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/fuse.js/dist/fuse.min.js"></script>
|
||||
|
||||
<!--
|
||||
<script src="{{ asset('assets/admin/js/resizable.js') }}"></script>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/resizable.css') }}">
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("table").resizableColumns({
|
||||
store: store
|
||||
});
|
||||
});
|
||||
</script>
|
||||
-->
|
||||
|
||||
<link href="https://cdn.datatables.net/v/bs4/dt-1.13.4/datatables.min.css" rel="stylesheet"/>
|
||||
|
||||
<script src="https://cdn.datatables.net/v/bs4/dt-1.13.4/datatables.min.js"></script>
|
||||
|
||||
<script src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/fixedcolumns/3.3.1/js/dataTables.fixedColumns.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.21/sorting/date-de.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.18.0/clusterize.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.18.0/clusterize.min.css" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.9/js/select2.full.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script src="{{ asset('assets/admin/js/plugins/dropzonejs/dropzone.min.js') }}"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/xlsx@0.15.1/dist/xlsx.full.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
|
||||
|
||||
<!--
|
||||
|
||||
|
||||
use the latest version -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
function ExportToExcel(type, fn, dl) {
|
||||
var elt = document.getElementById('excel');
|
||||
window.setTimeout(function(){
|
||||
var wb = XLSX.utils.table_to_book(elt, { sheet: "sheet1" });
|
||||
return dl ?
|
||||
XLSX.write(wb, { bookType: type, bookSST: true, type: 'base64' }) :
|
||||
XLSX.writeFile(wb, fn || ('{!! trim(strip_tags($__env->yieldContent('title'))) !!}.' + (type || 'xlsx')));
|
||||
}, 500);
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div class="script-zone">
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/slick/slick.min.js') }}"></script>
|
||||
<!-- include summernote css/js -->
|
||||
<script src="{{ asset('assets/admin/js/plugins/summernote/summernote-bs4.min.js') }}"></script>
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/summernote/summernote-bs4.css') }}">
|
||||
|
||||
<script src="{{ asset('assets/admin/js/plugins/magnific-popup/jquery.magnific-popup.min.js') }}"></script>
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/magnific-popup/magnific-popup.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/slick/slick.css') }}">
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/slick/slick.css') }}">
|
||||
|
||||
<!-- Page JS Plugins -->
|
||||
<!--<script src="{{ asset('assets/admin/js/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js') }}"></script>-->
|
||||
<script src="{{ asset('assets/admin/js/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('assets/admin/js/plugins/jquery-tags-input/jquery.tagsinput.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/jquery-auto-complete/jquery.auto-complete.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/masked-inputs/jquery.maskedinput.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/ion-rangeslider/js/ion.rangeSlider.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/admin/js/plugins/pwstrength-bootstrap/pwstrength-bootstrap.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('assets/admin/js/plugins/bootstrap-notify/bootstrap-notify.min.js') }}"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.4/build/jquery.datetimepicker.full.min.js"></script>
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>
|
||||
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
|
||||
<script src="{{url("assets/admin/js/json-to-table.js")}}"></script>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const Stellar = {
|
||||
get_welder_id(text) {
|
||||
var welder = text;
|
||||
var regex = /\[([A-Z0-9]+)\]/;
|
||||
var result = welder.match(regex);
|
||||
if(result) {
|
||||
welder = result[1];
|
||||
}
|
||||
return welder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
{{datagrid_scripts()}}
|
||||
|
||||
<style>
|
||||
.timeline {
|
||||
border-left: 3px solid rgb(245, 58, 58);
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
background: rgb(255, 255, 255);
|
||||
margin: 0 auto;
|
||||
letter-spacing: 0.2px;
|
||||
position: relative;
|
||||
line-height: 1.4em;
|
||||
font-size: 1.03em;
|
||||
padding: 50px;
|
||||
list-style: none;
|
||||
text-align: left;
|
||||
max-width: 75%;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.timeline {
|
||||
max-width: 98%;
|
||||
padding: 25px;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline h1 {
|
||||
font-weight: 300;
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
.timeline h2,
|
||||
.timeline h3 {
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.timeline .event {
|
||||
border-bottom: 1px dashed #e8ebf1;
|
||||
padding-bottom: 25px;
|
||||
margin-bottom: 25px;
|
||||
position: relative;
|
||||
background: #8080801f;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.timeline .event {
|
||||
padding-top: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline .event:last-of-type {
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.timeline .event:before,
|
||||
.timeline .event:after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.timeline .event:before {
|
||||
left: -207px;
|
||||
content: attr(data-date);
|
||||
text-align: right;
|
||||
font-weight: 100;
|
||||
font-size: 0.9em;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.timeline .event:before {
|
||||
left: 0px;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline .event:after {
|
||||
-webkit-box-shadow: 0 0 0 3px rgb(206, 10, 10);
|
||||
box-shadow: 0 0 0 3px rgb(206, 10, 10);
|
||||
left: -55.8px;
|
||||
background: #fff;
|
||||
border-radius: 50%;
|
||||
height: 9px;
|
||||
width: 9px;
|
||||
content: "";
|
||||
top: 5px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.timeline .event:after {
|
||||
left: -31.8px;
|
||||
}
|
||||
}
|
||||
|
||||
.rtl .timeline {
|
||||
border-left: 0;
|
||||
text-align: right;
|
||||
border-bottom-right-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-right: 3px solid #727cf5;
|
||||
}
|
||||
|
||||
.rtl .timeline .event::before {
|
||||
left: 0;
|
||||
right: -170px;
|
||||
}
|
||||
|
||||
.rtl .timeline .event::after {
|
||||
left: 0;
|
||||
right: -55.8px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,81 @@
|
||||
|
||||
<style>
|
||||
/*
|
||||
.profile-update .new-password, .profile-update .reemail {
|
||||
display:none;
|
||||
}
|
||||
*/
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
$(".profile-update .new-password, .profile-update .reemail").remove();
|
||||
<?php $user = u()->toArray();
|
||||
unset($user['password']);
|
||||
unset($user['json']);
|
||||
foreach($user AS $name => $value) {
|
||||
?>
|
||||
<?php if(!is_array($value)) {
|
||||
?>
|
||||
$(".profile-update [name='{{$name}}']").val("<?php echo $value ?>");
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
$(".profile-update [name='name']").attr("disabled","disabled");
|
||||
// $(".profile-update [name='prefix']").attr("disabled","disabled");
|
||||
$(".profile-update [name='surname']").attr("disabled","disabled");
|
||||
$(".profile-update [name='email']").attr("disabled","disabled");
|
||||
});
|
||||
</script>
|
||||
<div class="block-content profile-update">
|
||||
|
||||
<div class="result-ajax"></div>
|
||||
<form action="?<?php if(getisset("t")) echo "t=".get("t") . '&'; ?>ajax=profile-update" method="post" class="serialize">
|
||||
@csrf
|
||||
@include("admin.users.form")
|
||||
|
||||
<div class="form-group row border-t pt-20 mt-20">
|
||||
<div class="col-12">
|
||||
<h5 class="font-w600 text-muted mb-10">{{__('Change Password')}}</h5>
|
||||
<p class="text-muted font-size-sm mb-15">{{__("If you don't want to change it, leave it blank.")}}</p>
|
||||
</div>
|
||||
<div class="col-12 mb-10">
|
||||
<label for="password">{{__('New Password')}}</label>
|
||||
<input type="password" name="password" id="password" onblur="
|
||||
if($(this).val()!='') {
|
||||
$('#password2').attr('required','required');
|
||||
} else {
|
||||
$('#password2').removeAttr('required');
|
||||
}" class="form-control" placeholder="{{__('Enter new password')}}" value="" />
|
||||
</div>
|
||||
<div class="col-12 mb-10">
|
||||
<label for="password2">{{e2("Retype Password")}}</label>
|
||||
<input type="password" name="" onkeyup="
|
||||
if($(this).val()!='') {
|
||||
if($(this).val()!=$('#password').val()) {
|
||||
$('.submit').addClass('d-none');
|
||||
$('.notmatch').removeClass('d-none');
|
||||
} else {
|
||||
$('.submit').removeClass('d-none');
|
||||
$('.notmatch').addClass('d-none');
|
||||
}
|
||||
}
|
||||
" id="password2" class="form-control" placeholder="{{__('Confirm new password')}}" value="" />
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger d-none notmatch mb-0">{{__('Passwords do not match')}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-alt-primary btn-block submit">
|
||||
<i class="fa fa-check mr-5"></i> {{__('Update Profile')}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,519 @@
|
||||
<script>
|
||||
function copyToClipboard(text) {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
Swal.fire({
|
||||
title: '{{e2("Copied!")}}',
|
||||
text: text,
|
||||
icon: 'success',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 2000
|
||||
});
|
||||
}).catch(err => {
|
||||
console.error('Failed to copy text: ', err);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$.fn.hasAttr = function(name) {
|
||||
return this.attr(name) !== undefined;
|
||||
};
|
||||
</script>
|
||||
@foreach (glob(base_path() . '/resources/views/scripts/*.blade.php') as $file)
|
||||
@include('scripts.' . basename(str_replace('.blade.php', '', $file)))
|
||||
@endforeach
|
||||
<?php seri(); // serialize form
|
||||
?>
|
||||
<script>
|
||||
function printFrame() {
|
||||
var iframe = document.getElementById('show_pdf');
|
||||
var iframeWindow = iframe.contentWindow;
|
||||
|
||||
if (iframeWindow) {
|
||||
iframeWindow.focus();
|
||||
iframeWindow.print();
|
||||
} else {
|
||||
console.error('Could not access iframe content window');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
<?php
|
||||
if(oturumisset("full-screen-block")) {
|
||||
?>
|
||||
$("#{{oturum("full-screen-block")}}").addClass('block-mode-fullscreen');
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
$('.auto-complete').autocomplete({
|
||||
source: function( request, response ) {
|
||||
$.ajax( {
|
||||
url: "{{url("admin/autocomplete/welding_methods/ru_short_name")}}",
|
||||
dataType: "jsonp",
|
||||
data: {
|
||||
term: request.term
|
||||
},
|
||||
success: function( data ) {
|
||||
response( data );
|
||||
}
|
||||
} );
|
||||
},
|
||||
minLength: 2,
|
||||
select: function( event, ui ) {
|
||||
log( "Selected: " + ui.item.value + " aka " + ui.item.id );
|
||||
}
|
||||
} );
|
||||
$(".editable").on("click",function(){
|
||||
$(this).attr("contenteditable",true);
|
||||
$(this).prop("contenteditable",true);
|
||||
});
|
||||
|
||||
$(".cevapla-soru").on("click",function(){
|
||||
var bu = $(this);
|
||||
var id = bu.attr("data-soru");
|
||||
|
||||
bu.html("Kaydediliyor...");
|
||||
$.post("{{url("admin-ajax/cevap-soru")}}",{
|
||||
soru_id : id,
|
||||
_token : "{{csrf_token()}}",
|
||||
cevap : $("#soru"+id).val(),
|
||||
tak_duzey : $("#tak"+id).val()
|
||||
},function(d){
|
||||
console.log(d);
|
||||
bu.html("Kaydedildi");
|
||||
});
|
||||
});
|
||||
$(".serialize").unbind();
|
||||
$(".serialize").on("submit",function(){
|
||||
for (var i in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[i].updateElement();
|
||||
};
|
||||
var bu = $(this);
|
||||
var html = bu.find("[type='submit']").html();
|
||||
bu.find(".right-fixed button").html("Processing...");
|
||||
bu.find("[type='submit']").html("Processing...");
|
||||
$.ajax({
|
||||
type : $(this).attr("method"),
|
||||
url : $(this).attr("action"),
|
||||
data : $(this).serialize(),
|
||||
success: function(d){
|
||||
bu.find(".right-fixed button").html(html);
|
||||
bu.find("[type='submit']").html(html);
|
||||
$(".result-ajax").html(d);
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$( function() {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
|
||||
$(".nav-ajax a").on("click",function(){
|
||||
var id = $(this).attr("href");
|
||||
var path = $(this).parent().parent().attr("path");
|
||||
var url = id.replace("#","");
|
||||
console.log(path);
|
||||
$(id).html('<i class="fa fa-spin fa-spinner"></i>').load("?ajax2="+path+"."+url);
|
||||
});
|
||||
$(".nav-ajax li:eq(0) a").trigger("click");
|
||||
/*
|
||||
$("[type='number']").on("keypress",function(e){
|
||||
console.log(e.keyCode);
|
||||
|
||||
if(e.keyCode==48) {
|
||||
if($(this).val().length==0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(e.keyCode==46) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
*/
|
||||
$('.date').mask('9999-99-99', {reverse: true});
|
||||
// $("[name='Tonnage']").attr("type","text").prop("type","text").mask('#,0000', {reverse: true});
|
||||
$("[name='Tonnage']")
|
||||
.attr("pattern","[0-9]+([\.,][0-9]+)?")
|
||||
.prop("pattern","[0-9]+([\.,][0-9]+)?")
|
||||
.attr("min","0")
|
||||
.prop("min","0")
|
||||
.attr("step","0.0001")
|
||||
.prop("step","0.0001");
|
||||
$("[name='Tonnage']").focusout(function(){
|
||||
var inputVal = this.value;
|
||||
if(inputVal.indexOf(',') != -1){
|
||||
var num = inputVal.split(',');
|
||||
this.value = parseInt(num)+","+num[1];
|
||||
} else if(inputVal.indexOf('.') != -1){
|
||||
var num = inputVal.split('.');
|
||||
this.value = parseInt(num)+"."+num[1];
|
||||
}
|
||||
});
|
||||
|
||||
$("[name='week']").css("min-width","50px");
|
||||
$(".nav-link.active").trigger("click");
|
||||
$('form').attr('autocomplete','off');
|
||||
$( ".sortable" ).sortable({
|
||||
stop: function(evt, ui) {
|
||||
var k = 0;
|
||||
var data = [];
|
||||
$(".sortable > *").each(function(){
|
||||
//console.log($(this).attr("id2"));
|
||||
data.push([k,$(this).attr("id2")]);
|
||||
k++;
|
||||
});
|
||||
data = JSON.stringify(data);
|
||||
console.log(data);
|
||||
$.post("{{url('admin-ajax/content-sort')}}",{
|
||||
data : data,
|
||||
_token : "{{ csrf_token() }}"
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
$( ".draggable" ).draggable();
|
||||
$( "ul, li" ).disableSelection();
|
||||
} );
|
||||
</script>
|
||||
<script>jQuery(function(){ Codebase.helpers('magnific-popup','notify','datepicker', 'colorpicker', 'maxlength', 'select2', 'masked-inputs', 'rangeslider', 'tags-inputs'); });</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
|
||||
//$('.table').DataTable();
|
||||
@if (\Session::has('mesaj'))
|
||||
Codebase.helpers('notify', {
|
||||
align: 'center', // 'right', 'left', 'center'
|
||||
from: 'bottom', // 'top', 'bottom'
|
||||
type: 'info', // 'info', 'success', 'warning', 'danger'
|
||||
icon: 'fa fa-info mr-5', // Icon class
|
||||
message: '{!! __(\Session::get('mesaj')) !!}'
|
||||
});
|
||||
@endif
|
||||
@if (\Session::has('hata'))
|
||||
Codebase.helpers('notify', {
|
||||
align: 'center', // 'right', 'left', 'center'
|
||||
from: 'bottom', // 'top', 'bottom'
|
||||
type: 'danger', // 'info', 'success', 'warning', 'danger'
|
||||
icon: 'fa fa-info mr-5', // Icon class
|
||||
message: "{!! __(\Session::get('hata')) !!}"
|
||||
});
|
||||
@endif
|
||||
|
||||
$('#summernote,.editor').summernote({
|
||||
height: 200,
|
||||
width:800
|
||||
});
|
||||
function trigger() {
|
||||
$(".ajax_modal").unbind();
|
||||
$(".ajax_modal").on("click",function(){
|
||||
$("#modal-popin .modal-dialog").addClass("modal-lg");
|
||||
$("#modal-popin .block-title").html($(this).attr("title"));
|
||||
$("#modal-popin .block-content").html("{{e2("Yükleniyor...")}}").load($(this).attr("href"));
|
||||
$(".modal-footer").hide();
|
||||
$("#modal-popin").modal();
|
||||
return false;
|
||||
|
||||
});
|
||||
$("[teyit]").unbind();
|
||||
$("[teyit]").on("click",function(){
|
||||
$("#modal-popin .block-title").html($(this).attr("title"));
|
||||
$("#modal-popin .block-content").html($(this).attr("teyit"));
|
||||
$("#modal-popin .modal-dialog").removeClass("modal-lg");
|
||||
$(".modal-footer").show();
|
||||
var ajax = $(this).attr("ajax");
|
||||
var url = $(this).attr("href");
|
||||
if(ajax==undefined) {
|
||||
$("#modal-popin .tamam").prop("href",url).removeAttr("data-dismiss");
|
||||
} else {
|
||||
console.log(ajax);
|
||||
$("#modal-popin .tamam").unbind();
|
||||
$("#modal-popin .tamam").on("click",function(){
|
||||
$(ajax).fadeOut();
|
||||
$.get(url,function(){
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$("#modal-popin").modal();
|
||||
return false;
|
||||
|
||||
});
|
||||
}
|
||||
trigger();
|
||||
|
||||
/*
|
||||
$("[ajax]").on("click",function(){
|
||||
var yer = $(this).attr("ajax");
|
||||
$(yer).html("{{e2("Yükleniyor...")}}").load($(this).href("href"));
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
/*
|
||||
$("[data-ajax]").each(function(){
|
||||
var ajax = $(this).attr("data-ajax");
|
||||
// alert(ajax);
|
||||
if(ajax!="") {
|
||||
$(this).load("{{e2("Loading")}}").load("?ajax2="+ajax);
|
||||
}
|
||||
|
||||
});
|
||||
*/
|
||||
$(".yayinla").on("click",function(){
|
||||
var y;
|
||||
if($(this).is(":checked")) {
|
||||
y=1;
|
||||
} else {
|
||||
y=0;
|
||||
}
|
||||
var bu = $(this);
|
||||
bu.prop("disabled",true);
|
||||
$.post("{{ url('admin-ajax/input-edit') }}",{
|
||||
table : "contents",
|
||||
value : y,
|
||||
_token : "{{ csrf_token() }}",
|
||||
id : bu.attr("id"),
|
||||
name : "y"
|
||||
|
||||
},function(){
|
||||
bu.prop("disabled",false);
|
||||
|
||||
});
|
||||
});
|
||||
$(".edit").on("blur",function(){
|
||||
var bu = $(this);
|
||||
bu.prop("disabled",true);
|
||||
$.post("{{ url('admin-ajax/input-edit') }}",{
|
||||
table : bu.attr("table"),
|
||||
key : bu.attr("key"),
|
||||
value : bu.val(),
|
||||
_token : "{{ csrf_token() }}",
|
||||
id : bu.attr("data-id"),
|
||||
name : bu.attr("name")
|
||||
|
||||
},function(){
|
||||
bu.prop("disabled",false);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
$(".tags").tagsInput();
|
||||
$(".select2").select2({
|
||||
tags: true
|
||||
});
|
||||
/*
|
||||
$("form").on("submit",function(event){
|
||||
// Codebase.layout('header_loader_on')
|
||||
$(this).find(":submit").html("{{__('Processing...')}}").prop("disabled",true);
|
||||
|
||||
});
|
||||
*/
|
||||
$(".ajax-form").on("submit", "form", function(event)
|
||||
{
|
||||
alert("ok");
|
||||
event.preventDefault();
|
||||
|
||||
var url=$(this).attr("action");
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: $(this).attr("method"),
|
||||
dataType: "JSON",
|
||||
data: new FormData(this),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (data, status)
|
||||
{
|
||||
|
||||
},
|
||||
error: function (xhr, desc, err)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
/*
|
||||
$(".btn")
|
||||
.addClass("btn-noborder")
|
||||
.addClass("btn-rounded");
|
||||
*/
|
||||
$(".input-group-append .btn, .input-group-prepend .btn")
|
||||
.removeClass("btn-noborder")
|
||||
.removeClass("btn-rounded");
|
||||
|
||||
function loadDoc(url, cFunction) {
|
||||
var xhttp;
|
||||
xhttp=new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
|
||||
$("body").html(xhttp.responseText);
|
||||
window.history.pushState('url',Math.random() , url);
|
||||
cFunction(this);
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
||||
$("a").on("click",function(){
|
||||
/*
|
||||
loadDoc($(this).attr("href"),sonuc);
|
||||
return false;
|
||||
*/
|
||||
});
|
||||
function sonuc() {
|
||||
console.log("sonuc");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.13/cropper.min.js"></script>
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.5.13/cropper.min.css" rel="stylesheet" />
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const openFeedbackBtn = document.getElementById('openFeedback');
|
||||
const screenshotInput = document.getElementById('screenshotInput');
|
||||
const screenshotPreview = document.getElementById('screenshotPreview');
|
||||
const overlay = document.getElementById('screenshotOverlay');
|
||||
const overlayPreview = document.getElementById('overlayPreview');
|
||||
const useCroppedBtn = document.getElementById('useCropped');
|
||||
const cancelCropBtn = document.getElementById('cancelCrop');
|
||||
const sendFeedbackBtn = document.getElementById('sendFeedback');
|
||||
|
||||
let cropper = null;
|
||||
let lastScreenshot = null;
|
||||
|
||||
// Take Screenshot
|
||||
if (openFeedbackBtn) {
|
||||
openFeedbackBtn.addEventListener('click', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
try {
|
||||
if (cropper) cropper.destroy();
|
||||
|
||||
const target = document.querySelector('#main-content') || document.body;
|
||||
|
||||
// Create screenshot
|
||||
const canvas = await html2canvas(target, {
|
||||
backgroundColor: "#fff",
|
||||
scale: 0.8,
|
||||
useCORS: true
|
||||
});
|
||||
|
||||
// Convert to base64 JPEG
|
||||
const dataUrl = canvas.toDataURL("image/jpeg", 0.8);
|
||||
lastScreenshot = dataUrl;
|
||||
|
||||
// Show crop overlay
|
||||
overlay.style.display = "block";
|
||||
overlayPreview.innerHTML = `<img id="cropImage" src="${dataUrl}" style="max-width:100%;" />`;
|
||||
|
||||
const cropImage = document.getElementById("cropImage");
|
||||
|
||||
// Initialize CropperJS
|
||||
cropper = new Cropper(cropImage, {
|
||||
aspectRatio: NaN,
|
||||
viewMode: 1,
|
||||
background: false,
|
||||
autoCrop: false,
|
||||
autoCropArea: 0,
|
||||
ready() {
|
||||
cropper.clear();
|
||||
}
|
||||
});
|
||||
|
||||
} catch (err) {
|
||||
Swal.fire("Error", "Screenshot error: " + err.message, "error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Use cropped image
|
||||
useCroppedBtn.addEventListener('click', function () {
|
||||
let finalImage = lastScreenshot;
|
||||
|
||||
if (cropper) {
|
||||
finalImage = cropper.getCroppedCanvas().toDataURL("image/jpeg", 0.8);
|
||||
}
|
||||
|
||||
screenshotInput.value = finalImage;
|
||||
screenshotPreview.innerHTML = `<img src="${finalImage}" style="max-width:100%;border:1px solid #ccc" />`;
|
||||
|
||||
overlay.style.display = "none";
|
||||
$('#feedbackModal').modal('show');
|
||||
});
|
||||
|
||||
// Cancel crop
|
||||
cancelCropBtn.addEventListener('click', function () {
|
||||
overlay.style.display = "none";
|
||||
if (cropper) cropper.destroy();
|
||||
});
|
||||
|
||||
// Send Feedback
|
||||
if (sendFeedbackBtn) {
|
||||
sendFeedbackBtn.addEventListener('click', () => {
|
||||
const form = document.getElementById('feedbackForm');
|
||||
const formData = new FormData(form);
|
||||
|
||||
fetch('?ajax=save-feedback', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': document
|
||||
.querySelector('meta[name="csrf-token"]')
|
||||
.getAttribute('content')
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
if (data.status === "success") {
|
||||
const badge = document.getElementById('feedback-badge');
|
||||
if (badge) {
|
||||
let currentText = badge.textContent || badge.innerText || '0';
|
||||
let count = parseInt(currentText.trim());
|
||||
if(isNaN(count)) count = 0;
|
||||
|
||||
badge.textContent = count + 1;
|
||||
badge.style.display = 'inline-block';
|
||||
} else if (typeof $ !== 'undefined') {
|
||||
let $badge = $('#feedback-badge');
|
||||
if($badge.length) {
|
||||
let count = parseInt($badge.text().trim()) || 0;
|
||||
$badge.text(count + 1).show().css('display', 'inline-block');
|
||||
}
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Success!',
|
||||
text: data.message
|
||||
}).then(() => {
|
||||
$('#feedbackModal').modal('hide');
|
||||
form.reset();
|
||||
screenshotPreview.innerHTML = "";
|
||||
});
|
||||
} else {
|
||||
Swal.fire("Error", data.message, "error");
|
||||
}
|
||||
})
|
||||
.catch(err => Swal.fire("Error", err.message, "error"));
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="content-side">
|
||||
<div class="block pull-r-l">
|
||||
<div class="block-header bg-body-light">
|
||||
<h3 class="block-title">
|
||||
<i class="fas fa-user-edit mr-5"></i>
|
||||
{{__('Profile Settings')}}
|
||||
</h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" data-toggle="block-option" data-action="content_toggle"><i class="si si-arrow-up"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content block-content-full text-center bg-body-light">
|
||||
<img class="" src="{{asset('assets/logo.svg')}}" alt="">
|
||||
<div class="mt-10 font-w600">{{ Auth::user()->name }} {{ Auth::user()->surname }}</div>
|
||||
<div class="pt-10">
|
||||
<span class="badge badge-success">{{ Auth::user()->level }}</span>
|
||||
<span class="badge badge-info">{{ Auth::user()->subcontructer }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@include("admin.inc.profile-info")
|
||||
<div class="block-content block-content-full">
|
||||
<a class="btn btn-block btn-alt-danger" href="{{url('logout')}}">
|
||||
<i class="si si-logout mr-5"></i> {{__('Sign Out')}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,236 @@
|
||||
<div class="block">
|
||||
|
||||
<div class="block-header block-header-default">
|
||||
|
||||
<h3 class="block-title">{{$c->title}} {{__('Contents')}}</h3>
|
||||
|
||||
<div class="block-options">
|
||||
|
||||
<div class="block-options-item">
|
||||
|
||||
<a href="{{ url('admin/contents/'. $c->slug.'/add') }}" class="btn-block-option"><i class="fa fa-plus"></i></a>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="block-content">
|
||||
|
||||
<div class="js-gallery ">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<a name="alt"></a>
|
||||
|
||||
<table class="table table-striped table-hover table-bordered table-vcenter">
|
||||
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
|
||||
<th class="text-center" style="width: 50px;">{{__("Cover")}}</th>
|
||||
|
||||
<th>{{__("Title")}}</th>
|
||||
|
||||
|
||||
|
||||
<th>{{__("ID")}}</th>
|
||||
|
||||
<th>{{__("Category")}}</th>
|
||||
|
||||
<th class="d-none d-sm-table-cell" style="width: 15%;">{{__("Type")}}</th>
|
||||
|
||||
<th class="d-none d-sm-table-cell" style="width: 15%;">{{__("Columns")}}</th>
|
||||
|
||||
<th>{{__("Status")}}</th>
|
||||
|
||||
|
||||
<th>{{__("Order")}}</th>
|
||||
|
||||
<th class="text-center" style="width: 100px;">{{__("Transactions")}}</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php if($alt->count()==0) {
|
||||
?>
|
||||
<script>
|
||||
$(function(){
|
||||
$('.ana-icerik').removeClass("hidden");
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
@foreach($alt AS $a)
|
||||
|
||||
<tr class="" id="t{{$a->id}}">
|
||||
|
||||
<th class="text-center cover" scope="row">
|
||||
|
||||
@if($a->cover!='')
|
||||
|
||||
<a href="{{url('cache/large/'.$a->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
|
||||
<img src="{{url('cache/small/'.$a->cover)}}" alt="" />
|
||||
|
||||
</a>
|
||||
|
||||
<hr />
|
||||
|
||||
@endif
|
||||
|
||||
<div class="btn-group">
|
||||
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{$a->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i></button>
|
||||
|
||||
@if($a->cover!='')
|
||||
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="Resmi kaldır" href="{{url('admin-ajax/cover-delete?id='.$a->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$a->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" id="f{{$a->id}}" class="hidden-upload" enctype="multipart/form-data" method="post">
|
||||
|
||||
<input type="file" name="cover" id="c{{$a->id}}" onchange="$('#f{{$a->id}}').submit();" required />
|
||||
|
||||
<input type="hidden" name="id" value="{{$a->id}}" />
|
||||
|
||||
<input type="hidden" name="slug" value="{{$a->slug}}" />
|
||||
|
||||
{{csrf_field()}}
|
||||
|
||||
</form>
|
||||
|
||||
</th>
|
||||
|
||||
<td><input type="text" name="title" value="{{$a->title}}" table="contents"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
|
||||
<td>
|
||||
|
||||
<div class="input-group">
|
||||
|
||||
<div class="input-group-prepend">
|
||||
|
||||
<div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$a->breadcrumb)}}'+encodeURI($('.title{{$a->id}}').val()),function(d){
|
||||
|
||||
$('.slug{{$a->id}}').val(d).blur();
|
||||
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
|
||||
</div>
|
||||
|
||||
<input type="text" name="slug" value="{{$a->slug}}" table="contents"data-id="{{$a->id}}" class="slug{{$a->id}} form-control edit" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td><input type="text" name="kid" value="{{$a->kid}}" table="contents" data-id="{{$a->id}}" class="form-control edit" /></td>
|
||||
|
||||
<td class="d-none d-sm-table-cell">
|
||||
|
||||
|
||||
|
||||
<select name="type" data-id="{{$a->id}}" class="form-control edit" table="contents" >
|
||||
|
||||
@foreach(@$types AS $t)
|
||||
|
||||
<option value="{{$t->title}}" @if($t->title==$a->type) selected @endif>{{$t->title}}</option>
|
||||
|
||||
@endforeach
|
||||
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<input type="text" name="fields" value="{{$a->fields}}" table="contents" data-id="{{$a->id}}" class="form-control edit" />
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<select name="y" data-id="{{$a->id}}" class="form-control edit" table="contents" >
|
||||
|
||||
<option value="0" @if($a->y==0) selected @endif>{{__("Disabled")}}</option>
|
||||
|
||||
<option value="1" @if($a->y==1) selected @endif>{{__("Enabled")}}</option>
|
||||
|
||||
</select>
|
||||
|
||||
</td>
|
||||
|
||||
<td><input type="number" name="s" value="{{$a->s}}" table="contents" data-id="{{$a->id}}" class="form-control edit" /></td>
|
||||
|
||||
<td class="text-center">
|
||||
|
||||
<div class="btn-group">
|
||||
|
||||
<a href="{{ url('admin/contents/'. $a->id) }}" class="btn btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Edit">
|
||||
|
||||
<i class="fa fa-edit"></i>
|
||||
|
||||
</a>
|
||||
<?php if($a->slug!="") { ?>
|
||||
<a title="{{$a->title}} preview its content" href="{{ url($a->slug) }}" target="_blank" class="btn btn-secondary js-tooltip-enabled d-none" data-toggle="tooltip" title="" data-original-title="Edit">
|
||||
|
||||
<i class="fa fa-eye"></i>
|
||||
|
||||
</a>
|
||||
<?php } ?>
|
||||
|
||||
<a href="{{ url('admin/contents/'. $a->id .'/delete') }}" ajax="#t{{$a->id}}" teyit="{{$a->title}} Are you sure you want to delete its content?" title="{{$a->title}} {{__('To be deleted!')}}" class=" btn btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Delete">
|
||||
|
||||
<i class="fa fa-times"></i>
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
{{$alt->fragment('alt')->links() }}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,199 @@
|
||||
|
||||
|
||||
<div class="block-content">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<?php if(count($query['col'])>0) { ?>
|
||||
|
||||
<table class="table table-striped table-bordered table-hover">
|
||||
|
||||
<thead>
|
||||
|
||||
<?php if(in_array("setupTime",$query['col'])) { ?>
|
||||
|
||||
<tr>
|
||||
|
||||
<td></td>
|
||||
|
||||
<th colspan="2" class="text-center" width="20%"><?php e2("Rüst") ?></th>
|
||||
|
||||
<th colspan="2" class="text-center" width="20%"><?php e2("Ausfallzeiten") ?></th>
|
||||
|
||||
<td colspan="2"></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<tr>
|
||||
|
||||
<?php foreach($query['col'] AS $a) {
|
||||
|
||||
if($a!="id") {
|
||||
|
||||
if($a=="setupTime" || $a=="downTime") {
|
||||
|
||||
$a = "Von";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<th class="text-center">{{e2($a)}}</th>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<th>{{e2("Process")}}</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php foreach($query['row'] AS $r) {
|
||||
|
||||
$id = $r->id;
|
||||
|
||||
unset($r->id);
|
||||
|
||||
$class="";
|
||||
|
||||
if(isset($r->setupTime)) {
|
||||
|
||||
if($r->setupTime!="") {
|
||||
|
||||
$class="table-success";
|
||||
|
||||
} else {
|
||||
|
||||
$class="table-danger";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr id="t{{$id}}" class="{{$class}}">
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
foreach($r AS $a) { ?>
|
||||
|
||||
<td>{{$a}}</td>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<td><a href="{{url('admin-ajax/delete-row?id='.$id.'&table='.$query['table'])}}" teyit="{{e2("Are you sure delete this item?")}}" ajax="#t{{$id}}" class="btn btn-primary"><i class="fa fa-times"></i></a></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
{{$query['links']}}
|
||||
|
||||
<?php } else {
|
||||
|
||||
bilgi("No results found");
|
||||
|
||||
} ?>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$("[rel='next'],[rel='prev']").on("click",function(){
|
||||
|
||||
var parent = $(this).parent().parent().parent().parent().parent().parent();
|
||||
|
||||
var ajax = parent.attr("ajax2");
|
||||
|
||||
var url = $(this).attr("href").split("?");
|
||||
|
||||
console.log(url);
|
||||
|
||||
if(ajax!=undefined) {
|
||||
|
||||
console.log(ajax);
|
||||
|
||||
parent.load("{{url('admin?ajax2=')}}"+ajax+"&"+url[1]);
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
});
|
||||
|
||||
$("[teyit]").on("click",function(){
|
||||
|
||||
$("#modal-popin .block-title").html($(this).attr("title"));
|
||||
|
||||
$("#modal-popin .block-content").html($(this).attr("teyit"));
|
||||
|
||||
$("#modal-popin .modal-dialog").removeClass("modal-lg");
|
||||
|
||||
$(".modal-footer").show();
|
||||
|
||||
var ajax = $(this).attr("ajax");
|
||||
|
||||
var url = $(this).attr("href");
|
||||
|
||||
if(ajax==undefined) {
|
||||
|
||||
$("#modal-popin .tamam").prop("href",url).removeAttr("data-dismiss");
|
||||
|
||||
} else {
|
||||
|
||||
console.log(ajax);
|
||||
|
||||
$("#modal-popin .tamam").on("click",function(){
|
||||
|
||||
$(ajax).fadeOut();
|
||||
|
||||
$.get(url,function(){
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#modal-popin").modal();
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2">
|
||||
|
||||
<?php $dizi = array(5,10,15,20,25,30,50,100) ?>
|
||||
|
||||
<select onchange="location.href='?m='+$(this).val();" name="" id="" class="form-control ">
|
||||
|
||||
<?php foreach($dizi AS $d) { ?>
|
||||
<option value="<?php echo $d ?>" <?php if($miktar==$d) echo("selected"); ?>>{{__('On every page')}} <?php echo $d ?> {{__('Row')}}</option>
|
||||
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 ml-auto">
|
||||
|
||||
<form action="" method="get">
|
||||
|
||||
<input type="text" name="q" id="" placeholder="Search..." value="<?php echo get("q") ?>" class="form-control" />
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
|
||||
<?php use App\Translate ?><div class="block ">
|
||||
|
||||
<div class="block-header block-header-default">
|
||||
|
||||
<h3 class="block-title">{{__('Çeviriler')}}</h3>
|
||||
|
||||
<div class="block-options">
|
||||
|
||||
<button type="button" class="btn-block-option" onclick="$('.ceviriler').toggleClass('hidden');">
|
||||
|
||||
<i class="si si-eye"></i>
|
||||
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="block-content block-content-full ceviriler">
|
||||
|
||||
<?php $diller = explode(",",__('Diller')); foreach($diller AS $d) { ?>
|
||||
|
||||
<?php $ceviri = Translate::where("dil",$d)->where("kr",md5($c->html))->first();
|
||||
|
||||
if(!$ceviri) {
|
||||
|
||||
$tr = new Translate;
|
||||
|
||||
$tr->icerik = $c->html;
|
||||
|
||||
$tr->kr = md5($c->html);
|
||||
|
||||
$tr->dil = $d;
|
||||
|
||||
$tr->ceviri = $c->html;
|
||||
@@ -0,0 +1,33 @@
|
||||
@extends('admin.master')
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<?php
|
||||
$u = u();
|
||||
$level = str_slug($u->level); ?>
|
||||
<?php if(getisset("t")) {
|
||||
|
||||
$t = get("t");
|
||||
?>
|
||||
|
||||
@if(View::exists("admin.$level.$t"))
|
||||
@include("admin.$level.$t")
|
||||
@endif
|
||||
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
@if(View::exists("admin.dashboard.$level"))
|
||||
@include("admin.dashboard.$level")
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,151 @@
|
||||
@extends('admin.master')
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
<?php
|
||||
$tabs = [
|
||||
'Dashboard Summary' => '📊',
|
||||
'Training Videos' => '👩🏫',
|
||||
'Module Relationships' => '🏬',
|
||||
];
|
||||
?>
|
||||
|
||||
<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" data-id="{{$id}}" href="#{{$id}}" data-toggle="tab">
|
||||
{{$icon}}
|
||||
{{e2($tab)}}</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<li class="nav-item ml-auto p-1">
|
||||
<button type="button" class="btn btn-alt-danger" id="download-pdf-btn" onclick="downloadPDF()" style="display:none">
|
||||
<i class="fa fa-file-pdf"></i> {{e2("Download PDF")}}
|
||||
</button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="block-content tab-content">
|
||||
<?php
|
||||
$k = 0;
|
||||
foreach($tabs AS $tab => $icon) {
|
||||
$id = str_slug($tab);
|
||||
?>
|
||||
<div class="tab-pane @if($k == 0) active @endif" id="{{$id}}" role="tabpanel">
|
||||
@if($k == 0)
|
||||
<div class="btn btn-outline-primary load-stats">{{e2("Load Stats")}}</div>
|
||||
@endif
|
||||
</div>
|
||||
<?php $k++; } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js"></script>
|
||||
<script>
|
||||
function downloadPDF() {
|
||||
const element = document.getElementById('dashboard-summary');
|
||||
|
||||
// Geçici olarak scroll alanlarını genişlet
|
||||
const scrollables = $(element).find('div[style*="overflow"]');
|
||||
const originalStyles = [];
|
||||
|
||||
scrollables.each(function() {
|
||||
originalStyles.push({
|
||||
element: this,
|
||||
height: this.style.height,
|
||||
overflow: this.style.overflow
|
||||
});
|
||||
$(this).css({
|
||||
'height': 'auto',
|
||||
'overflow': 'visible'
|
||||
});
|
||||
});
|
||||
|
||||
const opt = {
|
||||
margin: 0.2,
|
||||
filename: 'dashboard-summary.pdf',
|
||||
image: { type: 'jpeg', quality: 0.98 },
|
||||
html2canvas: { scale: 2, useCORS: true },
|
||||
jsPDF: { unit: 'in', format: 'a4', orientation: 'landscape' },
|
||||
pagebreak: { mode: ['avoid-all', 'css', 'legacy'] }
|
||||
};
|
||||
|
||||
var btn = $('#download-pdf-btn');
|
||||
var originalText = btn.html();
|
||||
btn.html('<i class="fa fa-cog fa-spin"></i> Processing...');
|
||||
btn.prop('disabled', true);
|
||||
|
||||
html2pdf().set(opt).from(element).save().then(function(){
|
||||
// Stilleri geri yükle
|
||||
originalStyles.forEach(item => {
|
||||
$(item.element).css({
|
||||
'height': item.height,
|
||||
'overflow': item.overflow
|
||||
});
|
||||
});
|
||||
|
||||
btn.html(originalText);
|
||||
btn.prop('disabled', false);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
// İlk sekmeyi otomatik yükle
|
||||
$('.nav-link:eq(0)').click();
|
||||
// Tab tıklama olayı
|
||||
$('.load-stats').on('click', function() {
|
||||
$('.nav-link:eq(0)').click();
|
||||
});
|
||||
var ajaxRequest;
|
||||
$('.nav-link').off('click').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var tabId = $(this).data('id');
|
||||
|
||||
if(tabId === 'dashboard-summary') {
|
||||
$('#download-pdf-btn').show();
|
||||
} else {
|
||||
$('#download-pdf-btn').hide();
|
||||
}
|
||||
|
||||
var tabPane = $('#' + tabId);
|
||||
tabPane.html('<i class="fa fa-4x fa-cog fa-spin text-success"></i>');
|
||||
|
||||
// Önceki ajax isteği ve service worker'ı iptal et
|
||||
if(ajaxRequest) {
|
||||
ajaxRequest.abort();
|
||||
if('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||
registrations.forEach(function(registration) {
|
||||
registration.unregister();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ajaxRequest = $.ajax({
|
||||
url: `?ajax2=admin.dashboard.module.${tabId}&cache`,
|
||||
method: 'GET',
|
||||
success: function(html) {
|
||||
tabPane.html(html);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
if(status === 'abort') {
|
||||
return;
|
||||
}
|
||||
console.error('Error loading tab content');
|
||||
tabPane.html('Error loading tab content');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Body'e tıklandığında ajax isteği ve service worker'ı iptal et
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php use App\Translate;
|
||||
if(getisset("cache")) {
|
||||
$sorgu = db("translate")->where("dil", $id)->get();
|
||||
$dizi = [];
|
||||
foreach($sorgu AS $s) {
|
||||
$dizi[$s->icerik] = $s->ceviri;
|
||||
}
|
||||
$content = json_encode_tr($dizi);
|
||||
//dump($dizi);
|
||||
file_put_contents("resources/lang/$id.json",$content);
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
@extends('admin.master')
|
||||
@section("title",__($id)." ".__("Translate Table"))
|
||||
@section("desc",__($id)." ".__(" "))
|
||||
@section('content')
|
||||
<script src="https://cdn.jsdelivr.net/npm/@@json-editor/json-editor@latest/dist/jsoneditor.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#ceviri-ara").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#ceviri-table tbody tr").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.tek-satir {
|
||||
white-space:nowrap;
|
||||
max-width:250px;
|
||||
text-overflow:ellipsis;
|
||||
overflow:hidden
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__($id)}}</h3>
|
||||
<div class="block-options">
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$(".satir-olustur").on("click",function(){
|
||||
var bu = $(this); bu.html('İşlem yapılıyor. Bu işlem biraz sürebilir...');
|
||||
$.get('?cache',function(d){
|
||||
bu.html('Tüm içeriklerin satırları oluşturuldu');
|
||||
window.setTimeout(function(){
|
||||
location.reload();
|
||||
},1000);
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php $isim = explode(".",$id); ?>
|
||||
<div class="block-options-item">
|
||||
<a href="?new" class="btn btn-success"><i class="fa fa-plus"></i> {{e2("New")}}</a>
|
||||
<div class="btn btn-primary satir-olustur" onclick="">{{__('Store Cache')}}</div>
|
||||
<div class="btn btn-info" onclick="$.get('{{url('ajax/set-locale?l='.$isim[0])}}',function(){location.reload();})">{{__('Change language for this:')}} {{e2($isim[0])}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if(getisset("new")) {
|
||||
$array = [
|
||||
'dil' => $id,
|
||||
'icerik' => '',
|
||||
'ceviri' => ''
|
||||
];
|
||||
//dump($array);
|
||||
ekle2($array,"translate");
|
||||
|
||||
}
|
||||
$diller = Translate::where("dil",$id)->whereRaw("LENGTH(icerik) < 1000");
|
||||
if(getisset("q")) {
|
||||
$diller = $diller -> where("icerik","like","%{$_GET['q']}%");
|
||||
}
|
||||
|
||||
$diller =$diller->orderBy("id","DESC")->simplePaginate(10);
|
||||
?>
|
||||
<div class="block-content">
|
||||
<form action="" method="get">
|
||||
<input type="text" name="q" class="form-control" value="{{get("q")}}" placeholder="{{e2("Search")}}..." /> <br />
|
||||
</form>
|
||||
@csrf
|
||||
<input type="hidden" name="{{base64_encode('json')}}" value="{{$id}}" />
|
||||
|
||||
<table class="table table-bordered table-hover table-striped " id="ceviri-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__("Key")}}</th>
|
||||
<th>{{__("Value")}}</th>
|
||||
<th>{{__("Opt.")}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($diller AS $d)
|
||||
|
||||
@if(is_html($d->icerik))
|
||||
<tr>
|
||||
<td>
|
||||
<div style="width:500px;height:150px;overflow:auto">
|
||||
{!! $d->icerik !!}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{url('admin-ajax/input-edit')}}" class="ajax-form" method="post">
|
||||
@csrf
|
||||
<input type="hidden" name="id" value="{{$d->id}}" />
|
||||
<input type="hidden" name="table" value="translate" />
|
||||
<input type="hidden" name="name" value="ceviri" />
|
||||
<?php //{{base64_encode($d->icerik)}} ?>
|
||||
<textarea name="value" class="form-control ckeditor" id="editor" cols="30" rows="10">{!! $d->ceviri !!}</textarea>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
|
||||
@else
|
||||
<tr>
|
||||
<td>
|
||||
<textarea name="icerik" table="translate"data-id="{{$d->id}}" cols="30" rows="1" class="edit form-control">{{$d->icerik}}</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="ceviri" table="translate"data-id="{{$d->id}}" cols="30" rows="1" class="edit form-control">{{$d->ceviri}}</textarea>
|
||||
</td>
|
||||
|
||||
@endif
|
||||
<td>
|
||||
<a href="" onclick="$.get('?ajax=translate-sil&id={{$d->id}}');
|
||||
$(this).parent().parent().remove(); return false" class="btn btn-danger" title="{{__('Bu satırı sil')}}"><i class="fa fa-times"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{$diller->appends($_GET)->links()}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("textarea.ckeditor_textarea").each(function(){
|
||||
var textarea_id = $(this).attr("id");
|
||||
CKEDITOR.instances[textarea_id].updateElement();
|
||||
ckeditor_blur_event(textarea_id)
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
||||
@@ -0,0 +1,635 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if(getisset("ajax")) {
|
||||
?>
|
||||
@include("admin-ajax.{$_GET['ajax']}")
|
||||
<?php
|
||||
exit();
|
||||
} ?>
|
||||
<?php if(getisset("ajax2")) { //blade ajax system
|
||||
?>
|
||||
@if(getisset("cache"))
|
||||
@includeCache("{$_GET['ajax2']}")
|
||||
@else
|
||||
@include("{$_GET['ajax2']}")
|
||||
@endif
|
||||
|
||||
<?php
|
||||
exit();
|
||||
} ?>
|
||||
@php
|
||||
$permissions = userPermissions();
|
||||
@endphp
|
||||
<?php $u = u(); ?>
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="{{App::getLocale()}}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||
<title>{!! strip_tags($__env->yieldContent('title','')) !!}</title>
|
||||
<link rel="manifest" href="/assets/manifest.json">
|
||||
<meta name="author" content="Truncgil Technology">
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:site_name" content="https://www.truncgil.com.tr/">
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:type" content="app">
|
||||
<meta property="og:url" content>
|
||||
<meta property="og:image" content>
|
||||
<div class="header-zone">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{url("assets/favicon.png")}}">
|
||||
<link rel="shortcut icon" href="{{url("assets/favicon.png")}}" type="image/png">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta name="theme-color" content="#fff"/>
|
||||
<meta name="description" content="{!! strip_tags($__env->yieldContent('title','')) !!}">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" href="/assets/favicon.png" type="image/png">
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/service-worker.js')
|
||||
.then(function(registration) {
|
||||
console.log('Service Worker registered with scope:', registration.scope);
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.log('Service Worker registration failed:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@include("admin.inc.plugins")
|
||||
|
||||
@yield('scripts')
|
||||
|
||||
</div>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@guest
|
||||
@yield("content")
|
||||
@else
|
||||
<div id="page-container"
|
||||
@if(isset($contents))
|
||||
class="sidebar-o enable-page-overlay side-scroll page-header-fixed page-header-glass side-trans-enabled sidebar-inverse"
|
||||
@endif
|
||||
>
|
||||
|
||||
|
||||
<aside id="side-overlay">
|
||||
<div class="content-header content-header-fullrow">
|
||||
<div class="content-header-section align-parent">
|
||||
<button type="button" class="btn btn-circle btn-dual-secondary align-v-r" data-toggle="layout" data-action="side_overlay_close">
|
||||
<i class="fa fa-times text-danger"></i>
|
||||
</button>
|
||||
<div class="content-header-item">
|
||||
<a class="align-middle text-primary-dark font-w600" href="#">
|
||||
{{ Auth::user()->name }} {{ Auth::user()->surname }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include("admin.inc.side-overlay")
|
||||
</aside>
|
||||
|
||||
@if(isset($contents))
|
||||
<nav id="sidebar">
|
||||
<div class="sidebar-content">
|
||||
|
||||
<div class="content-side content-side-full content-side-user px-10 align-parent">
|
||||
<!-- Visible only in mini mode -->
|
||||
<div class="sidebar-mini-visible-b align-v animated fadeIn">
|
||||
<a href="{{url("admin")}}">
|
||||
<img class="img-fluid" src="{{ url("assets/logo.svg") }}" alt="">
|
||||
</a>
|
||||
</div>
|
||||
<!-- END Visible only in mini mode -->
|
||||
|
||||
<!-- Visible only in normal mode -->
|
||||
<div class="sidebar-mini-hidden-b text-center">
|
||||
<a class="img-link" href="{{url("admin")}}">
|
||||
<img class="img-fluid" src="{{ url("assets/logo.svg") }}" alt="">
|
||||
</a>
|
||||
<a class="text-center text-dual-primary-dark font-size-xs font-w600"
|
||||
href="#">{{ Auth::user()->name }} {{ Auth::user()->surname }}</a>
|
||||
|
||||
<div class="text-center badge badge-success">{{ Auth::user()->level }}</div>
|
||||
<div class="text-center badge badge-info">{{ Auth::user()->subcontructer }}</div>
|
||||
|
||||
<ul class="list-inline mt-10">
|
||||
<li class="list-inline-item">
|
||||
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<!-- Layout API, functionality initialized in Template._uiApiLayout() -->
|
||||
<a class="text-dual-primary-dark" data-toggle="layout"
|
||||
data-action="sidebar_style_inverse_toggle" href="javascript:void(0)">
|
||||
<i class="si si-drop"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
<a class="text-dual-primary-dark" href="{{url("logout")}}">
|
||||
<i class="si si-logout"></i>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li class="list-inline-item">
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- END Visible only in normal mode -->
|
||||
</div>
|
||||
|
||||
|
||||
@include("admin.inc.menu")
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
@include("admin.inc.header")
|
||||
@endif
|
||||
|
||||
<div class="main-container">
|
||||
<div class="">
|
||||
|
||||
@if (View::hasSection('title'))
|
||||
<div class="bg-image d-none" >
|
||||
<div class="bg-white-op-90">
|
||||
<div class="content content-full content-top">
|
||||
<h1 class="text-center">@yield("title")<br /> </h1>
|
||||
<div class="text-center d-none">@yield("desc")</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="content-ajax" style="margin-top:70px">
|
||||
@yield("content")
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@include('admin.inc.feedback-modal')
|
||||
<footer id="page-footer" class="t-center" style=" background: gray;
|
||||
color: white;
|
||||
padding: 5px 10px;
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
font-size: 12px;">
|
||||
<div class="footer-status"></div>
|
||||
</footer>
|
||||
</div>
|
||||
@endguest
|
||||
|
||||
<!--
|
||||
<link rel="stylesheet" href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css" />
|
||||
<script type="text/javascript" src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
|
||||
-->
|
||||
|
||||
@include("admin.inc.script")
|
||||
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
.hidden {
|
||||
display:none !important;
|
||||
}
|
||||
.visible {
|
||||
display:block !important;
|
||||
}
|
||||
.hidden-upload {
|
||||
display:none;
|
||||
|
||||
}
|
||||
.table-responsive {
|
||||
/* background: url(back.png) white center center / contain no-repeat !important; */
|
||||
/* background-attachment: fixed !important; */
|
||||
background-size: 20% !important;
|
||||
background-position: center !important;
|
||||
}
|
||||
.dz-filename {
|
||||
white-space:normal !important;
|
||||
height: 74px;
|
||||
|
||||
}
|
||||
</style>
|
||||
<div class="modal fade" id="modal-popin" tabindex="-1" role="dialog" aria-labelledby="modal-popin" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg modal-dialog-popin" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="block block-themed block-transparent mb-0">
|
||||
<div class="block-header bg-primary-dark">
|
||||
<h3 class="block-title"></h3>
|
||||
<div class="block-options">
|
||||
<button type="button" class="btn-block-option" data-dismiss="modal" aria-label="Close">
|
||||
<i class="si si-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-alt-secondary" data-dismiss="modal">{{__('Hayır')}}</button>
|
||||
<a href="#" class="btn btn-alt-success tamam" data-dismiss="modal">
|
||||
<i class="fa fa-check"></i> {{__('Evet')}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notification System CSS -->
|
||||
<style>
|
||||
.notification-dropdown .notification-badge {
|
||||
min-width: 18px;
|
||||
height: 18px;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.notification-menu {
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.notification-list {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.notification-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
padding: 14px 18px;
|
||||
border-bottom: 1px solid rgba(17, 25, 40, 0.08);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
background: #ffffff;
|
||||
transition: background 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.notification-item:hover {
|
||||
background: #e8f1ff;
|
||||
}
|
||||
|
||||
.notification-item.unread {
|
||||
background: #eef6ff;
|
||||
}
|
||||
|
||||
.notification-item.unread::after {
|
||||
content: '';
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #3a7bd5;
|
||||
position: absolute;
|
||||
top: 18px;
|
||||
right: 18px;
|
||||
box-shadow: 0 0 0 2px rgba(58, 123, 213, 0.15);
|
||||
}
|
||||
|
||||
.notification-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.notification-item .icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(58, 123, 213, 0.1);
|
||||
color: #3a7bd5;
|
||||
margin-right: 12px;
|
||||
font-size: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.notification-item .icon i {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.notification-item .content {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.notification-item .content .title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #111928;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.notification-item .content .message {
|
||||
font-size: 13px;
|
||||
color: #4a5568;
|
||||
margin-bottom: 6px;
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.notification-item .content .meta {
|
||||
font-size: 12px;
|
||||
color: #6c757d;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.notification-item .content .meta i {
|
||||
font-size: 11px;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.notification-empty {
|
||||
padding: 48px 24px;
|
||||
text-align: center;
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.notification-empty i {
|
||||
font-size: 36px;
|
||||
margin-bottom: 12px;
|
||||
color: rgba(58, 123, 213, 0.55);
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Notification System JavaScript -->
|
||||
<script>
|
||||
// Performance: Debounce function to limit API calls
|
||||
function debounce(func, wait) {
|
||||
let timeout;
|
||||
return function executedFunction(...args) {
|
||||
const later = () => {
|
||||
clearTimeout(timeout);
|
||||
func(...args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
}
|
||||
|
||||
// Performance: Cache for notification count to avoid repeated API calls
|
||||
let notificationCountCache = null;
|
||||
let notificationCountCacheTime = 0;
|
||||
const CACHE_DURATION = 30000; // 30 seconds
|
||||
|
||||
// Load notifications for dropdown
|
||||
function loadNotifications() {
|
||||
$.ajax({
|
||||
url: '/api/notifications/recent',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
displayNotifications(response.notifications);
|
||||
updateNotificationCount(response.unread_count);
|
||||
},
|
||||
error: function() {
|
||||
$('#notification-list').html(`
|
||||
<li class="notification-placeholder">
|
||||
<i class="fa fa-exclamation-triangle text-danger"></i>
|
||||
<div class="font-weight-bold">{{e2("Unable to load notifications")}}</div>
|
||||
<div class="small">{{e2("Please try again shortly")}}</div>
|
||||
</li>
|
||||
`);
|
||||
$('#notification-unread-indicator').text('{{e2("Error")}}');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getNotificationIcon(notificationCode, isRead) {
|
||||
if (!isRead) {
|
||||
return 'fa-bell';
|
||||
}
|
||||
|
||||
if (!notificationCode) return 'fa-bell';
|
||||
|
||||
const code = notificationCode.toLowerCase();
|
||||
if (code.includes('success') || code.includes('complete') || code.includes('created')) return 'fa-check-circle';
|
||||
if (code.includes('error') || code.includes('fail')) return 'fa-exclamation-circle';
|
||||
if (code.includes('warning') || code.includes('alert')) return 'fa-exclamation-triangle';
|
||||
if (code.includes('info') || code.includes('update')) return 'fa-info-circle';
|
||||
if (code.includes('test') || code.includes('inspection')) return 'fa-clipboard-check';
|
||||
if (code.includes('document') || code.includes('file')) return 'fa-file-alt';
|
||||
if (code.includes('user') || code.includes('account')) return 'fa-user';
|
||||
if (code.includes('system') || code.includes('maintenance')) return 'fa-cog';
|
||||
|
||||
return 'fa-bell';
|
||||
}
|
||||
|
||||
// Display notifications in dropdown
|
||||
function displayNotifications(notifications) {
|
||||
const listContainer = $('#notification-list');
|
||||
const defaultTitle = '{{e2("Notification")}}';
|
||||
const defaultMessage = '{{e2("No additional details")}}';
|
||||
|
||||
if (!notifications || notifications.length === 0) {
|
||||
listContainer.html(`
|
||||
<li class="notification-placeholder">
|
||||
<i class="fa fa-bell-slash"></i>
|
||||
<div class="font-weight-bold">{{e2("No notifications")}}</div>
|
||||
<div class="small">{{e2("You are all caught up")}}</div>
|
||||
</li>
|
||||
`);
|
||||
return;
|
||||
}
|
||||
|
||||
let html = '';
|
||||
notifications.forEach(function(notif) {
|
||||
const isUnread = !notif.is_read;
|
||||
const unreadClass = isUnread ? 'unread' : '';
|
||||
const timeAgo = formatTimeAgo(notif.created_at);
|
||||
const link = notif.link || '#';
|
||||
const safeTitle = notif.title ? escapeHtml(notif.title) : defaultTitle;
|
||||
const safeMessage = notif.message ? escapeHtml(notif.message) : defaultMessage;
|
||||
const iconClass = getNotificationIcon(notif.notification_code, !isUnread);
|
||||
|
||||
const truncatedMessage = safeMessage.length > 100
|
||||
? safeMessage.substring(0, 100) + '...'
|
||||
: safeMessage;
|
||||
|
||||
html += `
|
||||
<li class="notification-item ${unreadClass}"
|
||||
data-id="${notif.id}"
|
||||
onclick="handleNotificationClick(${notif.id}, '${escapeHtml(link)}')"
|
||||
title="${safeMessage}">
|
||||
<div class="icon">
|
||||
<i class="fa ${iconClass}"></i>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="title">${safeTitle}</div>
|
||||
<div class="message">${truncatedMessage}</div>
|
||||
<div class="meta">
|
||||
<i class="fa fa-clock"></i>
|
||||
${timeAgo}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
`;
|
||||
});
|
||||
|
||||
listContainer.html(html);
|
||||
}
|
||||
|
||||
// Handle notification click
|
||||
function handleNotificationClick(notificationId, link) {
|
||||
// Mark as read and wait for response before navigation
|
||||
$.ajax({
|
||||
url: '/api/notifications/mark-read/' + notificationId,
|
||||
method: 'POST',
|
||||
data: { _token: '{{ csrf_token() }}' },
|
||||
async: false, // Wait for mark-read to complete
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
updateNotificationCount(response.unread_count);
|
||||
$('[data-id="' + notificationId + '"]').removeClass('unread');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Navigate to link if provided
|
||||
if (link && link !== '#') {
|
||||
window.location.href = link;
|
||||
}
|
||||
}
|
||||
|
||||
// Mark all notifications as read
|
||||
function markAllAsRead() {
|
||||
$.ajax({
|
||||
url: '/api/notifications/mark-all-read',
|
||||
method: 'POST',
|
||||
data: { _token: '{{ csrf_token() }}' },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
updateNotificationCount(0);
|
||||
$('.notification-item').removeClass('unread');
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '{{e2("Success")}}',
|
||||
text: '{{e2("All notifications marked as read")}}',
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Update notification count badge
|
||||
function updateNotificationCount(count) {
|
||||
notificationCountCache = count;
|
||||
notificationCountCacheTime = Date.now();
|
||||
|
||||
const badge = $('#notification-count');
|
||||
const indicator = $('#notification-unread-indicator');
|
||||
if (count > 0) {
|
||||
const displayCount = count > 99 ? '99+' : count;
|
||||
badge.text(displayCount).show();
|
||||
if (indicator.length) {
|
||||
indicator.text(`${displayCount} {{e2("new")}}`).removeClass('badge-secondary').addClass('badge-primary');
|
||||
}
|
||||
} else {
|
||||
badge.hide();
|
||||
if (indicator.length) {
|
||||
indicator.text('{{e2("All caught up")}}').removeClass('badge-primary').addClass('badge-success');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch notification count (with caching)
|
||||
function fetchNotificationCount() {
|
||||
// Use cache if valid
|
||||
if (notificationCountCache !== null &&
|
||||
(Date.now() - notificationCountCacheTime) < CACHE_DURATION) {
|
||||
updateNotificationCount(notificationCountCache);
|
||||
return;
|
||||
}
|
||||
|
||||
// Performance: Only fetch count, not full notifications
|
||||
$.ajax({
|
||||
url: '/api/notifications/unread-count',
|
||||
method: 'GET',
|
||||
success: function(response) {
|
||||
updateNotificationCount(response.unread_count);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Format time ago
|
||||
function formatTimeAgo(dateString) {
|
||||
const date = new Date(dateString);
|
||||
const now = new Date();
|
||||
const seconds = Math.floor((now - date) / 1000);
|
||||
|
||||
if (seconds < 60) return '{{e2("Just now")}}';
|
||||
if (seconds < 3600) return Math.floor(seconds / 60) + ' {{e2("min ago")}}';
|
||||
if (seconds < 86400) return Math.floor(seconds / 3600) + ' {{e2("h ago")}}';
|
||||
if (seconds < 604800) return Math.floor(seconds / 86400) + ' {{e2("d ago")}}';
|
||||
return date.toLocaleDateString();
|
||||
}
|
||||
|
||||
// Escape HTML to prevent XSS
|
||||
function escapeHtml(text) {
|
||||
const map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": '''
|
||||
};
|
||||
return text.replace(/[&<>"']/g, function(m) { return map[m]; });
|
||||
}
|
||||
|
||||
// Initialize notification system on page load
|
||||
$(document).ready(function() {
|
||||
// Fetch initial count
|
||||
fetchNotificationCount();
|
||||
|
||||
// Poll for new notifications every 15 seconds (for testing - can be increased to 60s in production)
|
||||
setInterval(fetchNotificationCount, 15000);
|
||||
|
||||
// Prevent dropdown from closing when clicking inside
|
||||
$('.notification-menu').on('click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="screenshotOverlay" style="
|
||||
display:none;
|
||||
position:fixed;
|
||||
inset:0;
|
||||
background:rgba(0,0,0,.7);
|
||||
z-index:9999;
|
||||
padding:20px;
|
||||
overflow:auto;">
|
||||
<div style="background:#fff; padding:10px; max-width:90%; margin:0 auto;">
|
||||
<h5 style="margin-bottom:10px">Crop your screenshot</h5>
|
||||
<div id="overlayPreview"></div>
|
||||
<button id="useCropped" class="btn btn-sm btn-primary mt-2">Use this & open feedback</button>
|
||||
<button id="cancelCrop" class="btn btn-sm btn-secondary mt-2">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<style type="text/css">
|
||||
.cke_button__easyimageupload {
|
||||
display:none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,203 @@
|
||||
@extends('admin.master')
|
||||
@section("title","Artisan")
|
||||
@section("desc","")
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
{{col("col-md-6","Schema Generator")}}
|
||||
<?php if(getisset("columns")) {
|
||||
|
||||
$columns = explode("\n", get("columns"));
|
||||
$tableName = str_slug(get("table_name"),"_");
|
||||
?>
|
||||
<pre>
|
||||
Schema::create('{{$tableName}}', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
<?php foreach($columns AS $column) {
|
||||
$column = trim($column);
|
||||
$column = str_slug($column, '_');
|
||||
if(strpos($column, "date") !== false) {
|
||||
$type = "date";
|
||||
} else {
|
||||
$type = "string";
|
||||
}
|
||||
if($type == "string") {
|
||||
|
||||
?>$table->string('{{$column}}', 100)->nullable()->default(null);
|
||||
<?php } else {
|
||||
?>$table->date('{{$column}}')->nullable()->default(null);
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
});
|
||||
</pre>
|
||||
|
||||
<?php
|
||||
|
||||
} ?>
|
||||
<form action="?testa" method="get">
|
||||
@csrf
|
||||
Table Name:
|
||||
<input type="text" name="table_name" id="" class="form-control">
|
||||
Column List:
|
||||
<textarea name="columns" id="" cols="30" rows="10" class="form-control"></textarea>
|
||||
<button class="btn btn-primary">Generate Migration Schema</button>
|
||||
</form>
|
||||
|
||||
{{_col()}}
|
||||
{{col("col-md-6","Table Column To Array")}}
|
||||
<?php if(getisset("table_name")) {
|
||||
|
||||
$columns = table_columns(get("table_name"));
|
||||
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label>Generated Array:</label>
|
||||
<textarea class="form-control" rows="7" readonly >[
|
||||
<?php foreach($columns AS $column) {
|
||||
$column = trim($column);
|
||||
$column = str_slug($column, '_');
|
||||
?>'{{$column}}',
|
||||
<?php
|
||||
} ?>
|
||||
]</textarea>
|
||||
<small class="text-muted">Click to select all</small>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
} ?>
|
||||
<form action="?array" method="get">
|
||||
@csrf
|
||||
Table Name:
|
||||
<select name="table_name" id="tableSelect" class="form-control select2">
|
||||
<option value="">Select a table</option>
|
||||
@foreach(DB::select('SHOW TABLES') as $table)
|
||||
@php
|
||||
$tableName = array_values((array)$table)[0];
|
||||
@endphp
|
||||
<option value="{{ $tableName }}" {{ get("table_name") == $tableName ? 'selected' : '' }}>
|
||||
{{ $tableName }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<button class="btn btn-primary">Generate Table Column To Array</button>
|
||||
</form>
|
||||
|
||||
{{_col()}}
|
||||
{{col("col-md-6","Array")}}
|
||||
<?php if(getisset("columns2")) {
|
||||
|
||||
$columns = explode("\n", get("columns2"));
|
||||
|
||||
?>
|
||||
<pre>
|
||||
[
|
||||
<?php foreach($columns AS $column) {
|
||||
$column = trim($column);
|
||||
$column = str_slug($column, '_');
|
||||
?>'{{$column}}',
|
||||
<?php
|
||||
} ?>
|
||||
]
|
||||
</pre>
|
||||
|
||||
<?php
|
||||
|
||||
} ?>
|
||||
<form action="?array" method="get">
|
||||
@csrf
|
||||
Column List:
|
||||
<textarea name="columns2" id="" cols="30" rows="10" class="form-control"></textarea>
|
||||
<button class="btn btn-primary">Generate Array</button>
|
||||
</form>
|
||||
|
||||
{{_col()}}
|
||||
</div>
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Artisan Command Panel')}}</h3>
|
||||
<div class="block-options">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<?php if(getisset("command")) {
|
||||
try {
|
||||
dump(get("command"));
|
||||
$command = str_replace("\\","/",get("command"));
|
||||
Artisan::call($command);
|
||||
$output = Artisan::output();
|
||||
|
||||
ekle2([
|
||||
'title' => $command,
|
||||
'html' => $output,
|
||||
'type' => 'ARTISAN',
|
||||
'kid' => 'ARTISAN'
|
||||
],"contents");
|
||||
|
||||
dump($output);
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
dump($th);
|
||||
}
|
||||
|
||||
} ?>
|
||||
<form action="" method="get">
|
||||
<?php $macros = [
|
||||
'make:migration MigrationName',
|
||||
'migrate:refresh --path=',
|
||||
'make:model ModelName -a',
|
||||
'cache:clear',
|
||||
];
|
||||
foreach($macros AS $macro) {
|
||||
|
||||
?>
|
||||
<div class="btn btn-outline-success" onclick="$('#command').val($(this).text().trim()).focus()">{{$macro}}</div>
|
||||
<?php } ?>
|
||||
<div class="input-group">
|
||||
|
||||
<input type="text" name="command" value="{{get("command")}}" required id="command" class="form-control">
|
||||
<button class="btn btn-primary"><i class="fa fa-cog"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th style="width:50%">Command</th>
|
||||
<th>Output</th>
|
||||
</tr>
|
||||
<?php $query = db("contents")->where("type","ARTISAN")->orderBy("id","DESC")->simplePaginate(100);
|
||||
foreach($query AS $q) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $q->title ?></td>
|
||||
<td><textarea name="" id="" cols="30" rows="1" class="form-control"><?php echo $q->html ?></textarea></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
{{$query->links()}}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#tableSelect').select2({
|
||||
placeholder: "Select a table",
|
||||
allowClear: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,34 @@
|
||||
@extends('admin.master')
|
||||
@section("title",__('Ana İçerikler'))
|
||||
@section("desc",__('Bu sayfada ana içerikler yer almakta'))
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Ana İçerikler')}}</h3>
|
||||
<div class="block-options">
|
||||
<div class="block-options-item">
|
||||
<div class="input-group">
|
||||
|
||||
<select name="" id="" class="types_select form-control">
|
||||
@foreach($types AS $t)
|
||||
<option value="{{$t->title}}">{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div onclick="location.href='{{ url('admin-ajax/content-add?id=main&type=') }}'+$('.types_select').val()" class="input-group-append">
|
||||
<button type="button" class="btn btn-secondary">{{__('Ekle')}}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row gutters-tiny draggable sortable">
|
||||
@foreach($contents AS $a)
|
||||
@include("admin.inc.block")
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php redirect("admin/new/types2")->send(); ?>
|
||||
@extends('admin.master')
|
||||
@section("title","Modules")
|
||||
@section("desc","Bu sayfada içerik türlerini yönetebilirsiniz")
|
||||
@section('content')
|
||||
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Modules')}}</h3>
|
||||
<div class="block-options">
|
||||
<div class="block-options-item">
|
||||
<a href="{{ url('admin/action/add/types') }}" class="btn btn-default"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-content">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover">
|
||||
<tr>
|
||||
<th>{{e2("User No")}}</th>
|
||||
<th>{{e2("Level")}}</th>
|
||||
<th>{{e2("Delete")}}</th>
|
||||
<th>{{e2("Write")}}</th>
|
||||
<th>{{e2("Read")}}</th>
|
||||
<th>{{e2("Modify")}}</th>
|
||||
</tr>
|
||||
<?php $levels = levels();
|
||||
foreach($levels AS $level => $detail) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>{{$detail[0]}}</td>
|
||||
<td>{{$level}}</td>
|
||||
<td>{{$detail[1]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[2]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[3]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[4]==1 ? "✅" : "❌"}}</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#search").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#types tr").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<input type="text" name="search" id="search" placeholder="{{e2("Search Module...")}}" class="form-control">
|
||||
<table class="table table-striped table-hover table-bordered table-vcenter table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__("Enabled")}}</th>
|
||||
<th>{{__("Icon")}}</th>
|
||||
<th>{{__("Icon Name")}}</th>
|
||||
<th>{{__("Title")}}</th>
|
||||
<th>{{__("Parent")}}</th>
|
||||
<th>{{__("ID")}}</th>
|
||||
<th>{{__("Order")}}</th>
|
||||
<th>{{__("Delete")}} </th>
|
||||
<th>{{__("Write")}} </th>
|
||||
<th>{{__("Read")}} </th>
|
||||
<th>{{__("Modify")}} </th>
|
||||
<th class="text-center" style="width: 100px;">{{__("İşlemler")}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="types">
|
||||
@foreach($types AS $a)
|
||||
<tr>
|
||||
<td>
|
||||
<select name="enabled" table="types" data-id="{{$a->id}}" class="form-control edit">
|
||||
<option value="1" @if($a->enabled) selected @endif>✅</option>
|
||||
<option value="0" @if(!$a->enabled) selected @endif>🟥</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="d-none"><?php echo json_encode_tr($a); ?></div>
|
||||
<img src="{{url("assets/icons/". $a->icon .".png")}}" width="24" alt="">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<input type="text" name="icon" value="{{$a->icon}}" table="types"data-id="{{$a->id}}" class="icon form-control edit" /></td>
|
||||
<td><input type="text" name="title" value="{{$a->title}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
<td><input type="text" name="kid" value="{{$a->kid}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$a->breadcrumb)}}'+$('.title{{$a->id}}').val(),function(d){
|
||||
$('.slug{{$a->id}}').val(d).blur();
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
</div>
|
||||
<input type="text" name="slug" value="{{$a->slug}}" table="types"data-id="{{$a->id}}" class="slug{{$a->id}} form-control edit" />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td><input type="number" name="s" value="{{$a->s}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
|
||||
<td>
|
||||
<textarea name="full_control" table="types" data-id="{{$a->id}}" class="form-control edit" cols="30" rows="2">{{$a->full_control}}</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="write" table="types" data-id="{{$a->id}}" class="form-control edit" cols="30" rows="2">{{$a->write}}</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="read" table="types" data-id="{{$a->id}}" class="form-control edit" cols="30" rows="2">{{$a->read}}</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="modify" table="types" data-id="{{$a->id}}" class="form-control edit" cols="30" rows="2">{{$a->modify}}</textarea>
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="{{ url('admin/types/'. $a->slug) }}" type="button" class="btn btn-sm btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Edit">
|
||||
<i class="fa fa-link"></i>
|
||||
</a>
|
||||
<a href="{{ url('admin/types/'. $a->id.'/delete') }}" type="button" teyit="{{$a->title}} tipini silmek istediğinizden emin misiniz?" title="{{$a->title}} Silinecek!" class=" btn btn-sm btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Delete">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,828 @@
|
||||
@extends('admin.master')
|
||||
@section("title","Modules")
|
||||
@section("desc","Bu sayfada içerik türlerini yönetebilirsiniz")
|
||||
@section('content')
|
||||
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{__('Modules')}}</h3>
|
||||
<div class="block-options">
|
||||
<div class="block-options-item">
|
||||
<a href="{{ url('admin/action/add/types') }}" class="btn btn-default"><i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="block-content">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-hover">
|
||||
<tr>
|
||||
<th>{{e2("User No")}}</th>
|
||||
<th>{{e2("Level")}}</th>
|
||||
<th>{{e2("Full Control")}}</th>
|
||||
<th>{{e2("Write")}}</th>
|
||||
<th>{{e2("Read")}}</th>
|
||||
<th>{{e2("Modify")}}</th>
|
||||
</tr>
|
||||
<?php
|
||||
// Specific Permissions List
|
||||
$specificPermissionsList = [
|
||||
'Right Click Menu' => [
|
||||
'Copy Paste Permission' => 'copy_paste_permission',
|
||||
'Copy Start Until Paste Permission' => 'copy_start_until_paste_permission',
|
||||
'Row Column History Permission' => 'row_column_history_permission',
|
||||
'Clear Value Permission' => 'clear_value_permission',
|
||||
'Inspection Photo Upload Permission' => 'inspection_photo_upload_permission',
|
||||
],
|
||||
'Toolbar Actions' => [
|
||||
'Add Row Permission' => 'add_row_permission',
|
||||
'Apply Filter Permission' => 'apply_filter_permission',
|
||||
'Column Chooser Permission' => 'column_chooser_permission',
|
||||
'Revert Permission' => 'revert_permission',
|
||||
'Save Permission' => 'save_permission',
|
||||
'Search Panel Permission' => 'search_panel_permission',
|
||||
'Export Permission' => 'export_permission',
|
||||
'Group Panel Permission' => 'group_panel_permission',
|
||||
'Clear Filter Permission' => 'clear_filter_permission',
|
||||
'Select All Permission' => 'select_all_permission',
|
||||
'Deselect All Permission' => 'deselect_all_permission',
|
||||
'Refresh Permission' => 'refresh_permission',
|
||||
'Delete Selected Permission' => 'delete_selected_permission',
|
||||
'MTO Sync Permission' => 'mto_sync_permission',
|
||||
],
|
||||
];
|
||||
|
||||
$levels = levels();
|
||||
foreach($levels AS $level => $detail) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>{{$detail[0]}}</td>
|
||||
<td>{{$level}}</td>
|
||||
<td>{{$detail[1]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[2]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[3]==1 ? "✅" : "❌"}}</td>
|
||||
<td>{{$detail[4]==1 ? "✅" : "❌"}}</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#search").on("keyup", function() {
|
||||
var value = $(this).val().toLowerCase();
|
||||
$("#types tr").filter(function() {
|
||||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<input type="text" name="search" id="search" placeholder="{{e2("Search Module...")}}" class="form-control">
|
||||
<table class="table table-striped table-hover table-bordered table-vcenter table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__("Enabled")}}</th>
|
||||
<th>{{__("Mobile")}}</th>
|
||||
<th>{{__("Icon")}}</th>
|
||||
<th>{{__("Icon Name")}}</th>
|
||||
<th>{{__("Title")}}</th>
|
||||
<th>{{__("Parent")}}</th>
|
||||
<th>{{__("ID")}}</th>
|
||||
<th>{{__("Order")}}</th>
|
||||
<th>{{__("Full Control")}} </th>
|
||||
<th>{{__("Write")}} </th>
|
||||
<th>{{__("Read")}} </th>
|
||||
<th>{{__("Modify")}} </th>
|
||||
<th class="text-center" style="width: 100px;"><i class="fa fa-cog"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="types">
|
||||
@foreach($types AS $a)
|
||||
<tr>
|
||||
<td>
|
||||
<select name="enabled" table="types" data-id="{{$a->id}}" class="form-control edit">
|
||||
<option value="1" @if($a->enabled) selected @endif>✅</option>
|
||||
<option value="0" @if(!$a->enabled) selected @endif>🟥</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="is_mobile" table="types" data-id="{{$a->id}}" class="form-control edit">
|
||||
<option value="1" @if($a->is_mobile) selected @endif>✅</option>
|
||||
<option value="0" @if(!$a->is_mobile) selected @endif>🟥</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<img src="{{url("assets/icons/". $a->icon .".png")}}" width="24" alt="">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<input type="text" name="icon" value="{{$a->icon}}" table="types"data-id="{{$a->id}}" class="icon form-control edit" /></td>
|
||||
<td><input type="text" name="title" value="{{$a->title}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
<td><input type="text" name="kid" value="{{$a->kid}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$a->breadcrumb)}}'+$('.title{{$a->id}}').val(),function(d){
|
||||
$('.slug{{$a->id}}').val(d).blur();
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
</div>
|
||||
<input type="text" name="slug" value="{{$a->slug}}" table="types"data-id="{{$a->id}}" class="slug{{$a->id}} form-control edit" />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td><input type="number" name="s" value="{{$a->s}}" table="types"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" /></td>
|
||||
|
||||
<td>
|
||||
<div class="level-input">
|
||||
<div class="level-tags">
|
||||
@foreach(explode(',', $a->full_control) as $level)
|
||||
@if($level)
|
||||
<span class="badge badge-pill badge-{{ levelColor($level) }}">{{ intval($level) }}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="btn btn-sm btn-light edit-levels"
|
||||
data-target="full_control_{{ $a->id }}"
|
||||
data-type="full_control">
|
||||
<i class="fa fa-cog"></i>
|
||||
</button>
|
||||
<input type="hidden"
|
||||
name="full_control"
|
||||
table="types"
|
||||
data-id="{{ $a->id }}"
|
||||
value="{{ $a->full_control }}"
|
||||
class="edit"
|
||||
id="full_control_{{ $a->id }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="level-input">
|
||||
<div class="level-tags">
|
||||
@foreach(explode(',', $a->write) as $level)
|
||||
@if($level)
|
||||
<span class="badge badge-pill badge-{{ levelColor($level) }}">{{ $level }}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="btn btn-sm btn-light edit-levels"
|
||||
data-target="write_{{ $a->id }}"
|
||||
data-type="write">
|
||||
<i class="fa fa-cog"></i>
|
||||
</button>
|
||||
<input type="hidden"
|
||||
name="write"
|
||||
table="types"
|
||||
data-id="{{ $a->id }}"
|
||||
value="{{ $a->write }}"
|
||||
class="edit"
|
||||
id="write_{{ $a->id }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="level-input">
|
||||
<div class="level-tags">
|
||||
@foreach(explode(',', $a->read) as $level)
|
||||
@if($level)
|
||||
<span class="badge badge-pill badge-{{ levelColor($level) }}">{{ $level }}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="btn btn-sm btn-light edit-levels"
|
||||
data-target="read_{{ $a->id }}"
|
||||
data-type="read">
|
||||
<i class="fa fa-cog"></i>
|
||||
</button>
|
||||
<input type="hidden"
|
||||
name="read"
|
||||
table="types"
|
||||
data-id="{{ $a->id }}"
|
||||
value="{{ $a->read }}"
|
||||
class="edit"
|
||||
id="read_{{ $a->id }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="level-input">
|
||||
<div class="level-tags">
|
||||
@foreach(explode(',', $a->modify) as $level)
|
||||
@if($level)
|
||||
<span class="badge badge-pill badge-{{ levelColor($level) }}">{{ $level }}</span>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<button class="btn btn-sm btn-light edit-levels"
|
||||
data-target="modify_{{ $a->id }}"
|
||||
data-type="modify">
|
||||
<i class="fa fa-cog"></i>
|
||||
</button>
|
||||
<input type="hidden"
|
||||
name="modify"
|
||||
table="types"
|
||||
data-id="{{ $a->id }}"
|
||||
value="{{ $a->modify }}"
|
||||
class="edit"
|
||||
id="modify_{{ $a->id }}">
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="{{ url('admin/types/'. $a->slug) }}" class="btn btn-sm btn-secondary">
|
||||
<i class="fa fa-link"></i>
|
||||
</a>
|
||||
<a href="{{ url('admin/types/'. $a->id.'/delete') }}" class="btn btn-sm btn-secondary delete-confirm">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-info open-specific-permissions"
|
||||
data-id="{{ $a->id }}"
|
||||
data-title="{{ $a->title }}"
|
||||
data-slug="{{ $a->slug }}"
|
||||
data-permissions='{{ setting("type_{$a->id}_specific_permissions") }}'
|
||||
data-mobile-columns='{{ setting("type_{$a->id}_mobile_columns") }}'>
|
||||
<i class="fa fa-cogs"></i>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
<td style="display: none;" class="module-data">
|
||||
<?php echo json_encode_tr([
|
||||
'icon' => $a->icon,
|
||||
'title' => $a->title
|
||||
]); ?>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="levelModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
<i class="fa fa-cog"></i>
|
||||
<span class="modal-module-title"></span> -
|
||||
<span class="modal-permission-title"></span>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Level No</th>
|
||||
<th>Level Name</th>
|
||||
<th class="text-center">Select</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $levels = levels(); ?>
|
||||
@foreach($levels as $level => $detail)
|
||||
<tr>
|
||||
<td>
|
||||
<span class="badge badge-pill badge-{{levelColor($detail[0])}}">
|
||||
{{$detail[0]}}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{$level}}</td>
|
||||
<td class="text-center">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input type="checkbox"
|
||||
class="custom-control-input level-checkbox"
|
||||
id="level_{{$detail[0]}}"
|
||||
value="{{$detail[0]}}">
|
||||
<label class="custom-control-label"
|
||||
for="level_{{$detail[0]}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="saveLevels">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function levelColor(level) {
|
||||
const colors = {1: 'success', 2: 'primary', 3: 'warning', 4: 'danger'};
|
||||
return colors[level] || 'secondary';
|
||||
}
|
||||
|
||||
let currentTarget = null;
|
||||
let currentType = null;
|
||||
let currentModuleData = null;
|
||||
|
||||
// Level edit button click handler
|
||||
$(document).on('click', '.edit-levels', function(e) {
|
||||
e.preventDefault();
|
||||
currentTarget = $(this).data('target');
|
||||
currentType = $(this).data('type');
|
||||
|
||||
try {
|
||||
// If button is inside the main table (has module-data)
|
||||
const $moduleData = $(this).closest('tr').find('.module-data');
|
||||
if ($moduleData.length) {
|
||||
currentModuleData = JSON.parse($moduleData.text().trim());
|
||||
|
||||
// Update modal title and icon
|
||||
$('.modal-icon').attr('src', `{{url("assets/icons")}}/${currentModuleData.icon}.png`);
|
||||
$('.modal-module-title').text(currentModuleData.title);
|
||||
$('.modal-permission-title').text(getPermissionTitle(currentType));
|
||||
} else {
|
||||
// If button is inside Specific Permissions modal
|
||||
$('.modal-icon').attr('src', ''); // Or default icon
|
||||
$('.modal-module-title').text($('#spModalTitle').text());
|
||||
$('.modal-permission-title').text(currentType); // Directly use the permission name
|
||||
}
|
||||
|
||||
// Check current levels from the target input
|
||||
const currentVal = $('#' + currentTarget).val();
|
||||
const currentLevels = currentVal ? currentVal.toString().split(',').filter(l => l) : [];
|
||||
|
||||
$('.level-checkbox').prop('checked', false);
|
||||
|
||||
currentLevels.forEach(level => {
|
||||
$('#level_' + parseInt(level)).prop('checked', true);
|
||||
});
|
||||
|
||||
$('#levelModal').modal('show');
|
||||
} catch (error) {
|
||||
console.error('Error opening level modal:', error);
|
||||
$('#levelModal').modal('show');
|
||||
}
|
||||
});
|
||||
|
||||
function getPermissionTitle(type) {
|
||||
const titles = {
|
||||
'full_control': 'Full Control',
|
||||
'write': 'Write Permission',
|
||||
'read': 'Read Permission',
|
||||
'modify': 'Modify Permission'
|
||||
};
|
||||
return titles[type] || type;
|
||||
}
|
||||
|
||||
// Save button click handler
|
||||
$('#saveLevels').click(function() {
|
||||
if (!currentTarget) return;
|
||||
|
||||
const selectedLevels = [];
|
||||
$('.level-checkbox:checked').each(function() {
|
||||
selectedLevels.push(parseInt($(this).val()));
|
||||
});
|
||||
|
||||
const $target = $('#' + currentTarget);
|
||||
const $container = $target.closest('.level-input');
|
||||
const $tags = $container.find('.level-tags');
|
||||
|
||||
// Update hidden input
|
||||
$target.val(selectedLevels.join(',')).trigger('change');
|
||||
|
||||
// Update badges
|
||||
$tags.empty();
|
||||
selectedLevels.forEach(level => {
|
||||
$tags.append(
|
||||
`<span class="badge badge-pill badge-${levelColor(level)}">${level}</span>`
|
||||
);
|
||||
});
|
||||
|
||||
$('#levelModal').modal('hide');
|
||||
});
|
||||
|
||||
// AJAX setup
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
// Edit sınıfına sahip elementlerin değişikliklerini izle
|
||||
$(document).on('change', '.edit', function() {
|
||||
$.post('{{url("admin-ajax/input-edit")}}', {
|
||||
table: $(this).attr("table"),
|
||||
value: $(this).val(),
|
||||
id: $(this).data("id"),
|
||||
name: $(this).attr("name"),
|
||||
_token: '{{ csrf_token() }}'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.level-tags {
|
||||
min-height: 38px;
|
||||
padding: 5px;
|
||||
border: 1px solid #eee;
|
||||
margin-bottom: 5px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
.level-tags .badge {
|
||||
margin: 2px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
.level-input {
|
||||
position: relative;
|
||||
width: 120px;
|
||||
}
|
||||
.level-input .edit-levels {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
z-index: 2;
|
||||
padding: 2px 6px;
|
||||
display: none;
|
||||
}
|
||||
.level-input:hover .edit-levels {
|
||||
display: block;
|
||||
}
|
||||
.level-list {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.form-check-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.form-check-label .badge {
|
||||
min-width: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.modal-dialog {
|
||||
max-width: 700px;
|
||||
}
|
||||
.table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.custom-control {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
<!-- Specific Permissions Modal -->
|
||||
<div class="modal fade" id="specificPermissionsModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
<i class="fa fa-cogs mr-2"></i>
|
||||
<span id="spModalTitle"></span> - Specific Permissions
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span>×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="specificPermissionsForm">
|
||||
<input type="hidden" id="spTypeId" name="id">
|
||||
<input type="hidden" id="spTypeSlug" name="slug">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<ul class="nav nav-tabs nav-tabs-alt" role="tablist">
|
||||
@foreach($specificPermissionsList as $groupName => $perms)
|
||||
<li class="nav-item">
|
||||
<a class="nav-link @if($loop->first) active @endif" href="#sp-tab-{{Str::slug($groupName)}}" data-toggle="tab">
|
||||
{{$groupName}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#sp-tab-mobile-columns" data-toggle="tab">
|
||||
Mobile Columns
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="block-content tab-content">
|
||||
@foreach($specificPermissionsList as $groupName => $perms)
|
||||
<div class="tab-pane @if($loop->first) active @endif" id="sp-tab-{{Str::slug($groupName)}}" role="tabpanel">
|
||||
<table class="table table-vcenter table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Permission Name</th>
|
||||
<th>Allowed Levels (e.g. 1,2)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($perms as $label => $key)
|
||||
<tr>
|
||||
<td>{{$label}}</td>
|
||||
<td>
|
||||
<div class="level-input" style="width: 100%;">
|
||||
<div class="level-tags" id="tags_{{$key}}">
|
||||
<!-- Badges will be inserted here via JS -->
|
||||
</div>
|
||||
<button type="button" class="btn btn-sm btn-light edit-levels"
|
||||
data-target="sp_{{$key}}"
|
||||
data-type="{{$label}}">
|
||||
<i class="fa fa-cog"></i>
|
||||
</button>
|
||||
<input type="hidden"
|
||||
name="permissions[{{$key}}]"
|
||||
id="sp_{{$key}}"
|
||||
class="sp-input">
|
||||
</div>
|
||||
<small class="text-muted d-none">{{$key}}</small>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endforeach
|
||||
<div class="tab-pane" id="sp-tab-mobile-columns" role="tabpanel">
|
||||
<div id="mobileColumnsLoading" class="text-center py-4">
|
||||
<i class="fa fa-spinner fa-spin fa-2x"></i>
|
||||
<p class="mt-2">Loading columns...</p>
|
||||
</div>
|
||||
<div id="mobileColumnsContainer" style="display:none;">
|
||||
<div class="mb-2">
|
||||
<button type="button" class="btn btn-sm btn-outline-primary" id="mcSelectAll">Select All</button>
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" id="mcDeselectAll">Deselect All</button>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-vcenter table-hover mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:30px;"></th>
|
||||
<th style="width:50px;">Select</th>
|
||||
<th>Column Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="mobileColumnsList"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mobileColumnsEmpty" style="display:none;" class="text-center py-4 text-muted">
|
||||
<i class="fa fa-exclamation-circle fa-2x"></i>
|
||||
<p class="mt-2">No columns found for this module.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="saveSpecificPermissions">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
// Open Modal
|
||||
$(document).on('click', '.open-specific-permissions', function() {
|
||||
var id = $(this).data('id');
|
||||
var title = $(this).data('title');
|
||||
var slug = $(this).data('slug');
|
||||
var currentPerms = $(this).data('permissions'); // JSON object or string
|
||||
var currentMobileColumns = $(this).data('mobile-columns'); // JSON string
|
||||
|
||||
$('#spModalTitle').text(title);
|
||||
$('#spTypeId').val(id);
|
||||
$('#spTypeSlug').val(slug);
|
||||
|
||||
// Reset form and tags
|
||||
$('.sp-input').val('');
|
||||
$('.level-tags').empty();
|
||||
|
||||
// Fill existing values
|
||||
if (currentPerms) {
|
||||
if (typeof currentPerms === 'string') {
|
||||
try {
|
||||
currentPerms = JSON.parse(currentPerms);
|
||||
} catch(e) {
|
||||
console.error("JSON parse error", e);
|
||||
currentPerms = {};
|
||||
}
|
||||
}
|
||||
|
||||
$.each(currentPerms, function(key, value) {
|
||||
// Set hidden input value
|
||||
var $input = $('input[name="permissions[' + key + ']"]');
|
||||
$input.val(value);
|
||||
|
||||
// Create badges
|
||||
if(value) {
|
||||
var levels = value.toString().split(',');
|
||||
var $tagsContainer = $input.closest('.level-input').find('.level-tags');
|
||||
|
||||
levels.forEach(function(level) {
|
||||
if(level.trim() !== '') {
|
||||
$tagsContainer.append(
|
||||
`<span class="badge badge-pill badge-${levelColor(parseInt(level))}">${level}</span>`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Parse saved mobile columns
|
||||
var savedMobileColumns = [];
|
||||
if (currentMobileColumns) {
|
||||
if (typeof currentMobileColumns === 'string') {
|
||||
try {
|
||||
savedMobileColumns = JSON.parse(currentMobileColumns);
|
||||
} catch(e) {
|
||||
savedMobileColumns = [];
|
||||
}
|
||||
} else if (Array.isArray(currentMobileColumns)) {
|
||||
savedMobileColumns = currentMobileColumns;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset mobile columns tab
|
||||
$('#mobileColumnsLoading').show();
|
||||
$('#mobileColumnsContainer').hide();
|
||||
$('#mobileColumnsEmpty').hide();
|
||||
$('#mobileColumnsList').empty();
|
||||
|
||||
// Fetch columns via AJAX
|
||||
$.ajax({
|
||||
url: '{{url("admin-ajax/get-module-columns")}}',
|
||||
type: 'GET',
|
||||
data: { slug: slug },
|
||||
success: function(response) {
|
||||
$('#mobileColumnsLoading').hide();
|
||||
try {
|
||||
var res = typeof response === 'string' ? JSON.parse(response) : response;
|
||||
if (res.status === 'success' && res.columns && res.columns.length > 0) {
|
||||
// All columns from database
|
||||
var allDbColumns = res.columns;
|
||||
|
||||
// Reorder: Saved columns first (in their saved order), then others
|
||||
var finalOrder = [];
|
||||
|
||||
// Add saved ones first
|
||||
savedMobileColumns.forEach(function(col) {
|
||||
if (allDbColumns.indexOf(col) !== -1) {
|
||||
finalOrder.push(col);
|
||||
}
|
||||
});
|
||||
|
||||
// Add remaining ones
|
||||
allDbColumns.forEach(function(col) {
|
||||
if (finalOrder.indexOf(col) === -1) {
|
||||
finalOrder.push(col);
|
||||
}
|
||||
});
|
||||
|
||||
var html = '';
|
||||
finalOrder.forEach(function(col) {
|
||||
var checked = savedMobileColumns.indexOf(col) !== -1 ? 'checked' : '';
|
||||
html += '<tr class="mc-item" data-col="' + col + '">' +
|
||||
'<td class="text-center mc-handle" style="cursor:move;"><i class="fa fa-arrows-alt text-muted"></i></td>' +
|
||||
'<td class="text-center">' +
|
||||
'<div class="custom-control custom-checkbox">' +
|
||||
'<input type="checkbox" class="custom-control-input mc-checkbox" id="mc_' + col + '" value="' + col + '" ' + checked + '>' +
|
||||
'<label class="custom-control-label" for="mc_' + col + '"></label>' +
|
||||
'</div>' +
|
||||
'</td>' +
|
||||
'<td><code>' + col + '</code></td>' +
|
||||
'</tr>';
|
||||
});
|
||||
$('#mobileColumnsList').html(html);
|
||||
|
||||
// Initialize Sortable
|
||||
$('#mobileColumnsList').sortable({
|
||||
handle: '.mc-handle',
|
||||
axis: 'y',
|
||||
containment: 'parent',
|
||||
helper: function(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function(index) {
|
||||
$(this).width($originals.eq(index).width());
|
||||
});
|
||||
return $helper;
|
||||
}
|
||||
}).disableSelection();
|
||||
|
||||
$('#mobileColumnsContainer').show();
|
||||
} else {
|
||||
$('#mobileColumnsEmpty').show();
|
||||
}
|
||||
} catch(e) {
|
||||
console.error('Column parse error', e);
|
||||
$('#mobileColumnsEmpty').show();
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('#mobileColumnsLoading').hide();
|
||||
$('#mobileColumnsEmpty').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('#specificPermissionsModal').modal('show');
|
||||
});
|
||||
|
||||
// Select All / Deselect All for Mobile Columns
|
||||
$('#mcSelectAll').click(function() {
|
||||
$('.mc-checkbox').prop('checked', true);
|
||||
});
|
||||
$('#mcDeselectAll').click(function() {
|
||||
$('.mc-checkbox').prop('checked', false);
|
||||
});
|
||||
|
||||
// Save
|
||||
$('#saveSpecificPermissions').click(function() {
|
||||
var formData = {};
|
||||
|
||||
// Only take filled inputs
|
||||
$('.sp-input').each(function() {
|
||||
var val = $(this).val();
|
||||
var name = $(this).attr('name').replace('permissions[', '').replace(']', '');
|
||||
if(val && val.trim() !== '') {
|
||||
formData[name] = val;
|
||||
}
|
||||
});
|
||||
|
||||
// Collect selected mobile columns in UI order
|
||||
var selectedColumns = [];
|
||||
$('.mc-item').each(function() {
|
||||
var $item = $(this);
|
||||
var isChecked = $item.find('.mc-checkbox').is(':checked');
|
||||
if (isChecked) {
|
||||
selectedColumns.push($item.data('col'));
|
||||
}
|
||||
});
|
||||
|
||||
var typeId = $('#spTypeId').val();
|
||||
|
||||
$.ajax({
|
||||
url: '{{url("admin-ajax/save-module-permissions")}}',
|
||||
type: 'POST',
|
||||
data: {
|
||||
type_id: typeId,
|
||||
permissions: JSON.stringify(formData),
|
||||
mobile_columns: JSON.stringify(selectedColumns),
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
try {
|
||||
var res = typeof response === 'string' ? JSON.parse(response) : response;
|
||||
if(res.status === 'success') {
|
||||
$('#specificPermissionsModal').modal('hide');
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Error: ' + (res.message || 'Unknown error'));
|
||||
}
|
||||
} catch(e) {
|
||||
console.error("Response parse error", e);
|
||||
location.reload(); // Assume success if parse fails but request worked
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
alert('An error occurred while saving.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Delete confirmation
|
||||
$(document).on('click', '.delete-confirm', function(e) {
|
||||
e.preventDefault();
|
||||
var url = $(this).attr('href');
|
||||
|
||||
Swal.fire({
|
||||
title: '{{__("Are you sure?")}}',
|
||||
text: '{{__("This module and all its settings will be deleted!")}}',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: '{{__("Yes, delete it!")}}',
|
||||
cancelButtonText: '{{__("Cancel")}}'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,133 @@
|
||||
@extends('admin.master')
|
||||
@section("title")
|
||||
{{$q}} {{__('Arama Sonuçları')}}
|
||||
@endsection
|
||||
@section("desc")
|
||||
<div class="container">
|
||||
<form action="{{url("admin/search")}}" method="get">
|
||||
<div class="form-group row">
|
||||
<div class="col-lg-12">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="fa fa-search"></i> Ara
|
||||
</button>
|
||||
</div>
|
||||
<input type="text" required class="form-control" value="{{$q}}" id="" name="q" placeholder="Ara...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@section('content')
|
||||
<div class="content">
|
||||
<div class="block">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{$q}} {{__('Arama Sonuçları')}}</h3>
|
||||
<div class="block-options">
|
||||
<div class="block-options-item">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="block-content">
|
||||
<div class="js-gallery ">
|
||||
@if($search_contents->isEmpty())
|
||||
<div class="alert alert-info">Herhangi bir şey bulunamadı</div>
|
||||
@else
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-hover table-bordered table-vcenter">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center" style="width: 50px;">{{__("Resim")}}</th>
|
||||
<th>{{__("Başlık")}}</th>
|
||||
<th>{{__("URL")}}</th>
|
||||
<th>{{__("Kategorisi")}}</th>
|
||||
<th class="d-none d-sm-table-cell" style="width: 15%;">{{__("Tip")}}</th>
|
||||
<th>{{__("Durum")}}</th>
|
||||
<th>{{__("Sıra")}}</th>
|
||||
<th class="text-center" style="width: 100px;">{{__("İşlemler")}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach($search_contents AS $a)
|
||||
<tr class="">
|
||||
<th class="text-center cover" scope="row">
|
||||
@if($a->cover!='')
|
||||
<a href="{{url('cache/large/'.$a->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
<img src="{{url('cache/small/'.$a->cover)}}" alt="" />
|
||||
</a>
|
||||
<hr />
|
||||
@endif
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{$a->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i></button>
|
||||
@if($a->cover!='')
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="Resmi kaldır" href="{{url('admin-ajax/cover-delete?id='.$a->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$a->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" id="f{{$a->id}}" class="hidden-upload" enctype="multipart/form-data" method="post">
|
||||
<input type="file" name="cover" id="c{{$a->id}}" onchange="$('#f{{$a->id}}').submit();" required />
|
||||
<input type="hidden" name="id" value="{{$a->id}}" />
|
||||
<input type="hidden" name="slug" value="{{$a->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</th>
|
||||
<td class="text-center">
|
||||
<input type="text" name="title" value="{{$a->title}}" table="contents"data-id="{{$a->id}}" class="title{{$a->id}} form-control edit" />
|
||||
<small>{{$a->breadcrumb}}</small>
|
||||
</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title=')}}'+$('.title{{$a->id}}').val(),function(d){
|
||||
$('.slug{{$a->id}}').val(d).blur(); location.reload();
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
</div>
|
||||
<input type="text" name="slug" value="{{$a->slug}}" table="contents"data-id="{{$a->id}}" class="slug{{$a->id}} form-control edit" />
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td><input type="text" name="kid" value="{{$a->kid}}" table="contents" data-id="{{$a->id}}" class="form-control edit" /></td>
|
||||
<td class="d-none d-sm-table-cell">
|
||||
|
||||
<select name="type"data-id="{{$a->id}}" class="select2 form-control edit" table="contents" >
|
||||
@foreach($types AS $t)
|
||||
<option value="{{$t->title}}" @if($t->title==$a->type) selected @endif>{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="y"data-id="{{$a->id}}" class="select2 form-control edit" table="contents" >
|
||||
<option value="0" @if($a->y==0) selected @endif>{{__("Yayında Değil")}}</option>
|
||||
<option value="1" @if($a->y==1) selected @endif>{{__("Yayında")}}</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="number" name="s" value="{{$a->s}}" table="contents" data-id="{{$a->id}}" class="form-control edit" /></td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<a href="{{ url('admin/contents/'. $a->slug) }}" class="btn btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Edit">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
<a href="{{ url('admin/contents/'. $a->slug .'/delete') }}" teyit="{{$a->title}} içeriğini silmek istediğinizden emin misiniz?" title="{{$a->title}} Silinecek!" class=" btn btn-secondary js-tooltip-enabled" data-toggle="tooltip" title="" data-original-title="Delete">
|
||||
<i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,295 @@
|
||||
<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">
|
||||
<!-- Table Selection -->
|
||||
<div class="card border mb-3">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Select Tables</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="tableSelect">Select tables to include in the query:</label>
|
||||
<?php
|
||||
$tables = DB::select('SHOW TABLES');
|
||||
$tableNames = array_map(function($table) {
|
||||
return reset($table); // Get the first value from the object
|
||||
}, $tables);
|
||||
?>
|
||||
<select id="tableSelect" class="form-control select2" multiple="multiple">
|
||||
@foreach($tableNames as $table)
|
||||
<option value="{{ $table }}">{{ $table }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Gemini Prompt Interface -->
|
||||
<div class="card border mb-3">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">AI SQL Builder</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label for="aiPrompt">Describe what you want to query:</label>
|
||||
<textarea id="aiPrompt" class="form-control" rows="3" placeholder="Example: Show me all welds that were tested in the last month with their test results..."></textarea>
|
||||
</div>
|
||||
<button id="generateSQL" class="btn btn-primary">
|
||||
<i class="fa fa-magic"></i> Generate SQL
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SQL Editor -->
|
||||
<div class="card border mb-3">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">SQL Query</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="sql-editor" style="height: 200px; width: 100%; font-size: 16px;"></div>
|
||||
<div class="d-flex align-items-center mt-3">
|
||||
<button id="run-sql" class="btn btn-success">
|
||||
<i class="fa fa-play"></i> Run SQL
|
||||
</button>
|
||||
<div id="execution-time" class="ml-3 text-muted" style="display: none;">
|
||||
<i class="fa fa-clock"></i> <span class="time-value">0</span> ms
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Results Grid -->
|
||||
<div class="card border">
|
||||
<div class="card-header bg-light">
|
||||
<h5 class="mb-0">Query Results</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="resultsGrid"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.9.6/ace.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.9.6/ext-language_tools.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.9.6/ext-settings_menu.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
// Initialize Ace Editor
|
||||
var editor = ace.edit("sql-editor");
|
||||
editor.setTheme("ace/theme/terminal");
|
||||
editor.session.setMode("ace/mode/mysql");
|
||||
editor.setOptions({
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: true,
|
||||
enableSnippets: true
|
||||
});
|
||||
|
||||
// Load last SQL query from localStorage
|
||||
var lastSqlQuery = localStorage.getItem('ai-sql-builder-last-query');
|
||||
if (lastSqlQuery) {
|
||||
editor.setValue(lastSqlQuery);
|
||||
editor.clearSelection();
|
||||
}
|
||||
|
||||
// Generate SQL button click handler
|
||||
$('#generateSQL').click(function() {
|
||||
var prompt = $('#aiPrompt').val();
|
||||
var selectedTables = $('#tableSelect').val();
|
||||
|
||||
if (!prompt) {
|
||||
Swal.fire('Error', 'Please enter a prompt', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!selectedTables || selectedTables.length === 0) {
|
||||
Swal.fire('Error', 'Please select at least one table', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
var button = $(this);
|
||||
var originalText = button.html();
|
||||
button.html('<i class="fa fa-spinner fa-spin"></i> Generating...');
|
||||
button.prop('disabled', true);
|
||||
|
||||
$.ajax({
|
||||
url: '?ajax=ai-sql-builder',
|
||||
method: 'POST',
|
||||
data: {
|
||||
prompt: prompt,
|
||||
tables: selectedTables,
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
response = JSON.parse(response);
|
||||
if (response.success) {
|
||||
editor.setValue(response.sql);
|
||||
editor.clearSelection();
|
||||
// Save to localStorage
|
||||
localStorage.setItem('ai-sql-builder-last-query', response.sql);
|
||||
} else {
|
||||
Swal.fire('Error', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
Swal.fire('Error', 'Failed to generate SQL', 'error');
|
||||
},
|
||||
complete: function() {
|
||||
button.html(originalText);
|
||||
button.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Run SQL button click handler
|
||||
$('#run-sql').click(function() {
|
||||
var button = $(this);
|
||||
var originalText = button.html();
|
||||
button.html('<i class="fa fa-spinner fa-spin"></i> Running...');
|
||||
button.prop('disabled', true);
|
||||
$('#execution-time').hide();
|
||||
|
||||
var sqlCode = editor.getValue();
|
||||
if (!sqlCode) {
|
||||
Swal.fire('Error', 'Please generate or enter a SQL query first', 'error');
|
||||
button.html(originalText);
|
||||
button.prop('disabled', false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Save current SQL to localStorage
|
||||
localStorage.setItem('ai-sql-builder-last-query', sqlCode);
|
||||
|
||||
// Show loading message
|
||||
Swal.fire({
|
||||
title: 'Running SQL Query',
|
||||
text: 'Please wait while the query is being executed...',
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
showConfirmButton: false,
|
||||
showCancelButton: true,
|
||||
cancelButtonText: 'Cancel Query',
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
var startTime = performance.now();
|
||||
|
||||
$.ajax({
|
||||
url: '?ajax=report-builder-sql',
|
||||
method: 'POST',
|
||||
data: {
|
||||
sqlCodeMaster: sqlCode,
|
||||
sqlCodeDetail: '',
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
var endTime = performance.now();
|
||||
var executionTime = Math.round(endTime - startTime);
|
||||
|
||||
Swal.close();
|
||||
response = JSON.parse(response);
|
||||
|
||||
if (response.success) {
|
||||
var data = response.resultMaster;
|
||||
if (data && data.length > 0) {
|
||||
$("#resultsGrid").dxDataGrid({
|
||||
dataSource: data,
|
||||
columns: Object.keys(data[0]).map(function(column) {
|
||||
if (column.toLowerCase().includes('date')) {
|
||||
return {
|
||||
dataField: column,
|
||||
caption: column,
|
||||
dataType: 'date',
|
||||
format: 'dd.MM.yyyy',
|
||||
allowAutoResizing: true,
|
||||
width: 'auto'
|
||||
};
|
||||
}
|
||||
return {
|
||||
dataField: column,
|
||||
caption: column,
|
||||
allowAutoResizing: true,
|
||||
width: 'auto'
|
||||
};
|
||||
}),
|
||||
width: '100%',
|
||||
showBorders: true,
|
||||
columnAutoWidth: true,
|
||||
wordWrapEnabled: true,
|
||||
paging: {
|
||||
pageSize: 10
|
||||
},
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [5, 10, 20, 50],
|
||||
showInfo: true
|
||||
},
|
||||
filterRow: {
|
||||
visible: true
|
||||
},
|
||||
searchPanel: {
|
||||
visible: true
|
||||
},
|
||||
headerFilter: {
|
||||
visible: true,
|
||||
search: {
|
||||
enabled: true,
|
||||
placeholder: "{{e2('Filter...')}}"
|
||||
}
|
||||
},
|
||||
@include("components.table.datagrid.partials.js-excel")
|
||||
});
|
||||
|
||||
// Show execution time
|
||||
$('#execution-time .time-value').text(executionTime);
|
||||
$('#execution-time').show();
|
||||
} else {
|
||||
Swal.fire('Info', 'Query executed successfully but returned no data', 'info');
|
||||
}
|
||||
} else {
|
||||
Swal.fire('Error', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
Swal.close();
|
||||
Swal.fire('Error', 'Failed to execute query', 'error');
|
||||
},
|
||||
complete: function() {
|
||||
button.html(originalText);
|
||||
button.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.select2-container--bootstrap4 .select2-selection {
|
||||
min-height: 38px;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
|
||||
background-color: #007bff;
|
||||
border: 1px solid #006fe6;
|
||||
color: #fff;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
|
||||
color: #fff;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
|
||||
color: #fff;
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?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>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,170 @@
|
||||
<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>
|
||||
@@ -0,0 +1,33 @@
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
var isDrawing = false;
|
||||
var points = [];
|
||||
|
||||
stage.on('mousedown', function (e) {
|
||||
isDrawing = true;
|
||||
points = [stage.getPointerPosition().x, stage.getPointerPosition().y];
|
||||
});
|
||||
|
||||
stage.on('mouseup', function () {
|
||||
if (!isDrawing) {
|
||||
return;
|
||||
}
|
||||
|
||||
var currentPos = stage.getPointerPosition();
|
||||
points = points.concat([currentPos.x, currentPos.y]);
|
||||
|
||||
var line = new Konva.Line({
|
||||
points: points,
|
||||
stroke: 'black',
|
||||
strokeWidth: 2
|
||||
});
|
||||
|
||||
// layer.destroyChildren();
|
||||
layer.add(line);
|
||||
layer.draw();
|
||||
});
|
||||
|
||||
stage.on('mouseup', function () {
|
||||
isDrawing = false;
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
// Create a line
|
||||
var rect = new Konva.Rect({
|
||||
x: 20,
|
||||
y: 20,
|
||||
width: 100,
|
||||
height: 50,
|
||||
stroke: 'black',
|
||||
strokeWidth: 1,
|
||||
draggable: true
|
||||
});
|
||||
|
||||
var tr = new Konva.Transformer({
|
||||
node: rect,
|
||||
|
||||
});
|
||||
|
||||
layer.add(tr);
|
||||
|
||||
// Add the line to the layer
|
||||
layer.add(rect);
|
||||
|
||||
// Draw the layer
|
||||
layer.draw();
|
||||
|
||||
// Add dragstart event listener
|
||||
rect.on('dragstart', function () {
|
||||
// You can perform additional actions when dragging starts if needed
|
||||
console.log('Drag Start');
|
||||
});
|
||||
|
||||
// Add dragend event listener
|
||||
rect.on('dragend', function () {
|
||||
// You can perform additional actions when dragging ends if needed
|
||||
console.log('Drag End');
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
var userInput = prompt("{{e2("Please enter some text:")}}");
|
||||
if (userInput !== null) {
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
var textNode = new Konva.Text({
|
||||
text: userInput,
|
||||
x: 10,
|
||||
y: 10,
|
||||
fontSize: 20,
|
||||
draggable: true,
|
||||
width: 200,
|
||||
});
|
||||
var tr = new Konva.Transformer({
|
||||
node: textNode,
|
||||
enabledAnchors: ['middle-left', 'middle-right'],
|
||||
// set minimum width of text
|
||||
boundBoxFunc: function (oldBox, newBox) {
|
||||
newBox.width = Math.max(30, newBox.width);
|
||||
return newBox;
|
||||
},
|
||||
});
|
||||
|
||||
textNode.on('transform', function () {
|
||||
// reset scale, so only with is changing by transformer
|
||||
textNode.setAttrs({
|
||||
width: textNode.width() * textNode.scaleX(),
|
||||
scaleX: 1,
|
||||
});
|
||||
});
|
||||
|
||||
layer.add(tr);
|
||||
|
||||
layer.add(textNode);
|
||||
stage.add(layer);
|
||||
} else {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pqGrid/3.5.1/pqgrid.min.js" integrity="sha512-wLHNqMKhRZVOG1rL7Q+RnEQFGX5HvF06zdz0/2yRrhSxFUJ8auGnwP7qR6wYS/4eCuGwtCCileekUlTiy6ml2A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pqGrid/3.5.1/pqgrid.min.css" integrity="sha512-Cgrp/uulAKlTOm5ngIhC3gqKTLtBgSkLprw3NCPuLlZzUeE7rH0+FVX2bgeTt2CsDdNgvrhXywRAS7Mxd3bybQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pqGrid/3.5.1/pqgrid.ui.min.css" integrity="sha512-IutWYxF1ZeEuHGL8LUKTPbfAABVhLxXZWJ+4B4kEs2eNXde3BnxZCMustkqjKQbZFMWBJoQAJKEUIJTroBfBTA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/dot-luv/theme.min.css" integrity="sha512-DBOXJJIO/SsHuebZsr21dAAe8g4/7bJKQoPjeehY9MW1bZ1DAqoP9b/l+jCqYfTk+xqN0HksTk0HM0SL2qwbcw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<?php
|
||||
$tableName = "weld_logs"; ?>
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
//called when save changes button is clicked.
|
||||
function saveChanges() {
|
||||
var grid = $grid.pqGrid('getInstance').grid;
|
||||
|
||||
//attempt to save editing cell.
|
||||
if (grid.saveEditCell() === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (grid.isDirty() && grid.isValidChange({ focusInvalid: true }).valid) {
|
||||
|
||||
var changes = grid.getChanges({ format: "byVal" });
|
||||
|
||||
//post changes to server
|
||||
$.ajax({
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
async: true,
|
||||
beforeSend: function (jqXHR, settings) {
|
||||
grid.showLoading();
|
||||
},
|
||||
url: "/pro/products/batch", //for ASP.NET, java
|
||||
//url:
|
||||
data: { list: JSON.stringify(changes) },
|
||||
success: function (changes) {
|
||||
//debugger;
|
||||
grid.commit({ type: 'add', rows: changes.addList });
|
||||
grid.commit({ type: 'update', rows: changes.updateList });
|
||||
grid.commit({ type: 'delete', rows: changes.deleteList });
|
||||
|
||||
grid.history({ method: 'reset' });
|
||||
},
|
||||
complete: function () {
|
||||
grid.hideLoading();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
<?php $columns = table_columns($tableName);
|
||||
$width = count($columns) * 10;
|
||||
?>
|
||||
var obj = {
|
||||
hwrap: false,
|
||||
resizable: true,
|
||||
rowBorders: false,
|
||||
virtualX: false,
|
||||
filterModel: { header: true, type: 'local' },
|
||||
trackModel: { on: true }, //to turn on the track changes.
|
||||
colModel: [
|
||||
<?php
|
||||
$k = 0;
|
||||
foreach($columns AS $column) {
|
||||
|
||||
?>
|
||||
{ title: "{{$column}}", dataType: "string", dataIndx: "{{$column}}", editable: true },
|
||||
<?php
|
||||
$k++; } ?>
|
||||
],
|
||||
toolbar: {
|
||||
items: [
|
||||
|
||||
{ type: 'button', icon: 'ui-icon-disk', label: 'Save Changes', cls: 'changes', listener: function () {
|
||||
saveChanges();
|
||||
},
|
||||
options: { disabled: true }
|
||||
},
|
||||
{ type: 'button', icon: 'ui-icon-cancel', label: 'Reject Changes', cls: 'changes', listener: function () {
|
||||
$grid.pqGrid("rollback");
|
||||
$grid.pqGrid("history", { method: 'resetUndo' });
|
||||
},
|
||||
options: { disabled: true }
|
||||
},
|
||||
{ type: 'separator' },
|
||||
{ type: 'button', icon: 'ui-icon-arrowreturn-1-s', label: 'Undo', cls: 'changes', listener: function () {
|
||||
$grid.pqGrid("history", { method: 'undo' });
|
||||
},
|
||||
options: { disabled: true }
|
||||
},
|
||||
{ type: 'button', icon: 'ui-icon-arrowrefresh-1-s', label: 'Redo', listener: function () {
|
||||
$grid.pqGrid("history", { method: 'redo' });
|
||||
},
|
||||
options: { disabled: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
scrollModel: { autoFit: true },
|
||||
swipeModel: { on: false },
|
||||
editModel: {
|
||||
saveKey: $.ui.keyCode.ENTER
|
||||
},
|
||||
editor: { select: true },
|
||||
title: "<b>{{$tableName}}</b>",
|
||||
history: function (evt, ui) {
|
||||
var $grid = this.widget();
|
||||
if (ui.canUndo != null) {
|
||||
$("button.changes", $grid).button("option", { disabled: !ui.canUndo });
|
||||
}
|
||||
if (ui.canRedo != null) {
|
||||
$("button:contains('Redo')", $grid).button("option", "disabled", !ui.canRedo);
|
||||
}
|
||||
$("button:contains('Undo')", $grid).button("option", { label: 'Undo (' + ui.num_undo + ')' });
|
||||
$("button:contains('Redo')", $grid).button("option", { label: 'Redo (' + ui.num_redo + ')' });
|
||||
},
|
||||
|
||||
postRenderInterval: -1, //call postRender synchronously.
|
||||
pageModel: { type: "local", rPP: 100 },
|
||||
dataModel: {
|
||||
dataType: "JSON",
|
||||
location: "remote",
|
||||
recIndx: "id",
|
||||
url: "{{url("admin/to-json/". $tableName)}}?take=100&with-column&module=batch-excel",
|
||||
getData: function (response) {
|
||||
return { data: response.data };
|
||||
}
|
||||
}
|
||||
};
|
||||
var $grid = $("#grid_editing").pqGrid(obj);
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
{{col("col-md-12","Edit Table")}}
|
||||
<div class="table-responsive">
|
||||
<div id="grid_editing" >
|
||||
</div>
|
||||
</div>
|
||||
{{_col()}}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
|
||||
<link rel="stylesheet" href="{{url("assets/param-query/pqgrid.min.css")}}" />
|
||||
<script src="{{url("assets/param-query/pqgrid.min.js")}}"></script>
|
||||
<link rel="stylesheet" href="{{url("assets/param-query/bootstrap/pqgrid.css")}}" />
|
||||
<script>
|
||||
$(function () {
|
||||
var colM = [
|
||||
{ title: "Order ID", width: 100, dataIndx: "OrderID" },
|
||||
{ title: "Customer Name", width: 130, dataIndx: "CustomerName" },
|
||||
{ title: "Product Name", width: 190, dataIndx: "ProductName" },
|
||||
{ title: "Unit Price", width: 100, dataIndx: "UnitPrice", align: "right" },
|
||||
{ title: "Quantity", width: 100, dataIndx: "Quantity", align:"right" },
|
||||
{ title: "Order Date", width: 100, dataIndx: "OrderDate"},
|
||||
{ title: "Required Date", width: 100, dataIndx: "RequiredDate" },
|
||||
{ title: "Shipped Date", width: 100, dataIndx: "ShippedDate" },
|
||||
{ title: "ShipCountry", width: 100, dataIndx: "ShipCountry" },
|
||||
{ title: "Freight", width: 100, align: "right", dataIndx: "Freight" },
|
||||
{ title: "Shipping Name", width: 120, dataIndx: "ShipName" },
|
||||
{ title: "Shipping Address", width: 180, dataIndx: "ShipAddress" },
|
||||
{ title: "Shipping City", width: 100, dataIndx: "ShipCity" },
|
||||
{ title: "Shipping Region", width: 110, dataIndx: "ShipRegion" },
|
||||
{ title: "Shipping Postal Code", width: 130, dataIndx: "ShipPostalCode" }
|
||||
];
|
||||
var dataModel = {
|
||||
location: "remote",
|
||||
dataType: "JSON",
|
||||
method: "GET",
|
||||
getUrl : function () {
|
||||
return { url: '?ajax=excel-json&table=line_lists'};
|
||||
},
|
||||
getData: function ( response ) {
|
||||
console.log(response)
|
||||
return { data : response};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var obj = {
|
||||
width: "100%",
|
||||
height: "600",
|
||||
title: "ParamQuery Grid Example",
|
||||
resizable:false,
|
||||
draggable:false
|
||||
};
|
||||
|
||||
obj.colModel = [{ title: "Rank", width: 100, dataType: "integer" },
|
||||
{ title: "Company", width: 200, dataType: "string" },
|
||||
{ title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
|
||||
{ title: "Profits ($ millions)", width: 150, dataType: "float", align: "right"}];
|
||||
|
||||
obj.dataModel = dataModel;
|
||||
obj.colModel = colM;
|
||||
$("#grid_array").pqGrid(obj);
|
||||
|
||||
});
|
||||
|
||||
</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)}}</h3>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<div id="grid_array"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,318 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
use App\Models\ColumnDescription;
|
||||
|
||||
|
||||
$title = "Column Description";
|
||||
$tableWidth="100%";
|
||||
$listDatas = ColumnDescription::orderBy("id","DESC")->paginate(setting('row_count'));
|
||||
$tableName = "column_descriptions";
|
||||
//$noRemoteOperations = true;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$blockGroup = [
|
||||
'General Informations' => [
|
||||
'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']
|
||||
];
|
||||
*/
|
||||
?>
|
||||
<script>
|
||||
function contentReady(e) {
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
@include("components.blocks.module-block")
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,749 @@
|
||||
<?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">×</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')
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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')
|
||||
@@ -0,0 +1,24 @@
|
||||
<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">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<div class="hero-inner">
|
||||
<div class="content content-full">
|
||||
<div class="py-30 text-center">
|
||||
<i class="si si-chemistry text-primary display-3"></i>
|
||||
<h1 class="h2 font-w700 mt-30 mb-10">We’ll be back soon!</h1>
|
||||
<h2 class="h3 font-w400 text-muted mb-50">We’re currently down for maintenance..</h2>
|
||||
<a class="btn btn-hero btn-noborder btn-rounded btn-alt-primary" href="{{url("admin")}}">
|
||||
<i class="fa fa-arrow-left mr-10"></i> Go Back to Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,137 @@
|
||||
<?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>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<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 style="height: calc(90vh - 100px);">
|
||||
<div id="fm"></div>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('vendor/alexusmai/laravel-file-manager/resources/assets/css/file-manager.css') }}">
|
||||
<script src="{{ asset('vendor/alexusmai/laravel-file-manager/resources/assets/js/file-manager.js' ) }}"></script>
|
||||
<style>
|
||||
.fa-spinner {
|
||||
position: fixed;
|
||||
top: calc(50vh);
|
||||
left: calc(50vw);
|
||||
font-size: 100px;
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,69 @@
|
||||
@extends('admin.master')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
use App\Models\DocumentManagerPermission;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
$user = Auth::user();
|
||||
$permissionLevel = 'read_only'; // Default to read_only
|
||||
|
||||
if ($user) {
|
||||
if ($user->level === 'Admin') {
|
||||
$permissionLevel = 'full_control';
|
||||
// Admin users get full permissions for all folders
|
||||
$userFolderPermissions = [];
|
||||
} else {
|
||||
// Fetch user's permissions for all folders
|
||||
$userFolderPermissions = DocumentManagerPermission::where('user_level', $user->level)
|
||||
->where('is_allowed', true)
|
||||
->get()
|
||||
->groupBy('folder_path')
|
||||
->map(function ($permissions) {
|
||||
return $permissions->pluck('permission_type')->toArray();
|
||||
})
|
||||
->toArray();
|
||||
|
||||
// Determine the highest permission level for the user across all folders
|
||||
$hasWrite = false;
|
||||
$hasRead = false;
|
||||
|
||||
foreach ($userFolderPermissions as $folder => $perms) {
|
||||
if (in_array('write', $perms)) {
|
||||
$hasWrite = true;
|
||||
}
|
||||
if (in_array('read', $perms)) {
|
||||
$hasRead = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($hasWrite) {
|
||||
$permissionLevel = 'write';
|
||||
} elseif ($hasRead) {
|
||||
$permissionLevel = 'read';
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
|
||||
<div class="card-body">
|
||||
<!-- Elfinder iframe with permission-based configuration -->
|
||||
<iframe
|
||||
src="{{ url('app/elfinder') }}"
|
||||
style="width:100%;height:90vh"
|
||||
frameborder="0"
|
||||
id="elfinder-iframe"
|
||||
data-permission-level="{{ $permissionLevel }}"
|
||||
data-user-folders="{!! json_encode($userFolderPermissions ?? []) !!}"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,115 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,242 @@
|
||||
<?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")
|
||||
|
||||
|
||||
@@ -0,0 +1,318 @@
|
||||
<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
|
||||
use App\Models\ColumnComment;
|
||||
if(getisset("add")) {
|
||||
ekle2(['title'=> ''],"document_templates");
|
||||
} ?>
|
||||
|
||||
<!-- Tab Navigation -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#list-tab" role="tab">
|
||||
<i class="fa fa-list"></i> {{e2("List")}}
|
||||
</a>
|
||||
</li>
|
||||
<?php if(getisset("edit")) { ?>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#edit-tab" role="tab">
|
||||
<i class="fa fa-edit"></i> {{e2("Edit")}}
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content">
|
||||
<!-- List Tab -->
|
||||
<div class="tab-pane fade show active" id="list-tab" role="tabpanel">
|
||||
<div class="col-12">
|
||||
@include("admin.type.document-templates.list")
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if(getisset("edit")) {
|
||||
if(getisset("update")) {
|
||||
// Fetch old data BEFORE update
|
||||
$oldData = db("document_templates")->where("id", get("edit"))->first();
|
||||
$oldJson = json_decode($oldData->json, true) ?? [];
|
||||
|
||||
$post = $_POST;
|
||||
unset($post['_token']);
|
||||
unset($post['html']);
|
||||
|
||||
$title = post("title");
|
||||
|
||||
$updateData = [
|
||||
'html' => post("html"),
|
||||
'json' => json_encode_tr($post)
|
||||
];
|
||||
|
||||
if($_FILES['file']['name'] != "") {
|
||||
$fileName = str_slug($_FILES['file']['name'] . "-" . date("YmdHis"));
|
||||
|
||||
// Excel dosyasını analiz et
|
||||
$excelAnalysis = analyzeExcelFile($_FILES['file']['tmp_name']);
|
||||
|
||||
// Dosyayı yükle
|
||||
$file = uploadDocument("file", "013_Others/document-templates/", $fileName);
|
||||
$updateData['files'] = $file;
|
||||
|
||||
// Analiz sonuçlarını kaydet
|
||||
$updateData['excel_analysis'] = json_encode($excelAnalysis);
|
||||
}
|
||||
|
||||
db("document_templates")
|
||||
->where("id", get("edit"))
|
||||
->update($updateData);
|
||||
|
||||
// --- HISTORY TRACKING START ---
|
||||
$rowId = get("edit");
|
||||
$tableName = "document_templates";
|
||||
$userId = u()->id;
|
||||
$userIp = request()->ip();
|
||||
|
||||
// 1. Check for HTML changes
|
||||
if ($oldData->html != $updateData['html']) {
|
||||
ColumnComment::create([
|
||||
'table_name' => $tableName,
|
||||
'record_id' => $rowId,
|
||||
'column_name' => 'html',
|
||||
'comment' => 'HTML content updated',
|
||||
'column_value' => 'Size: ' . strlen($updateData['html']) . ' bytes', // Too large to store full content usually
|
||||
'user_id' => $userId,
|
||||
'ip_address' => $userIp
|
||||
]);
|
||||
}
|
||||
|
||||
// 2. Check for JSON field changes (Title, etc.)
|
||||
$newJson = json_decode($updateData['json'], true);
|
||||
foreach ($newJson as $key => $newValue) {
|
||||
$oldValue = $oldJson[$key] ?? null;
|
||||
if ($oldValue != $newValue) {
|
||||
ColumnComment::create([
|
||||
'table_name' => $tableName,
|
||||
'record_id' => $rowId,
|
||||
'column_name' => $key,
|
||||
'comment' => "Changed from '$oldValue' to '$newValue'",
|
||||
'column_value' => $newValue,
|
||||
'user_id' => $userId,
|
||||
'ip_address' => $userIp
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Check for File changes
|
||||
if (isset($updateData['files']) && $updateData['files'] != $oldData->files) {
|
||||
ColumnComment::create([
|
||||
'table_name' => $tableName,
|
||||
'record_id' => $rowId,
|
||||
'column_name' => 'file',
|
||||
'comment' => "File updated from '{$oldData->files}' to '{$updateData['files']}'",
|
||||
'column_value' => $updateData['files'],
|
||||
'user_id' => $userId,
|
||||
'ip_address' => $userIp
|
||||
]);
|
||||
}
|
||||
// --- HISTORY TRACKING END ---
|
||||
|
||||
bilgi("Document is updated!");
|
||||
}
|
||||
$edit = db("document_templates")->where("id", get("edit"))->first();
|
||||
$j = j($edit->json);
|
||||
?>
|
||||
<!-- Edit Tab -->
|
||||
<div class="tab-pane fade" id="edit-tab" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h4>{{$edit->title}} {{e2("Edit Template Content")}}</h4>
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="showHistory({{get('edit')}})">
|
||||
<i class="fa fa-history"></i> {{e2("History")}}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{e2("ID")}}
|
||||
<input type="text" name="" class="form-control" readonly value="{{$edit->slug}}" id="">
|
||||
<img src="{{url("storage/documents/".$edit->files)}}" class="img-fluid" alt="">
|
||||
<form action="?edit={{get("edit")}}&update" enctype="multipart/form-data" method="post">
|
||||
{{e2("Path")}}
|
||||
<input type="text" name="kid" class="form-control" value="{{$edit->kid}}" id="">
|
||||
{{e2("File")}}
|
||||
<input type="hidden" name="title" value="{{$edit->title}}">
|
||||
<input type="file" name="file" class="form-control mb-10" id="" accept=".xlsx">
|
||||
<a href="{{url("storage/documents/" . $edit->files)}}" class="btn btn-outline-primary">{{$edit->files}}</a>
|
||||
|
||||
@if(isset($edit->excel_analysis))
|
||||
<div class="excel-analysis mt-3 mb-3">
|
||||
<h5>Excel Dosyası Analizi</h5>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<?php $analysis = json_decode($edit->excel_analysis, true); ?>
|
||||
|
||||
<div class="alert {{ $analysis['memory_warning'] ? 'alert-danger' : 'alert-success' }}">
|
||||
<strong>Dosya Boyutu:</strong> {{ $analysis['file_size_formatted'] }}
|
||||
@if($analysis['memory_warning'])
|
||||
<span class="badge badge-danger ml-2">Yüksek Bellek Kullanımı!</span>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@if(count($analysis['problematic_formulas']) > 0)
|
||||
<div class="alert alert-warning">
|
||||
<strong>Sorunlu Formüller Bulundu:</strong>
|
||||
<ul>
|
||||
@foreach($analysis['problematic_formulas'] as $formula)
|
||||
<li>
|
||||
<strong>Hücre:</strong> {{ $formula['cell'] }} |
|
||||
<strong>Formül:</strong> {{ $formula['formula'] }} |
|
||||
<strong>Sorun:</strong> {{ $formula['issue'] }}
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-success">
|
||||
<strong>Sorunlu formül bulunamadı.</strong>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@csrf
|
||||
|
||||
<?php
|
||||
$storagePath = "storage/documents/013_Others/pdf";
|
||||
$fileName = basename(xlsx_to_pdf_legacy('storage/documents/' . $edit->files, $storagePath));
|
||||
$pdfPath = "$storagePath/$fileName";
|
||||
?>
|
||||
<iframe src="{{ url($pdfPath) }}" width="100%" style="height:100vh" frameborder="0"></iframe>
|
||||
|
||||
<div class="d-none" style="overflow:auto;height:200px">
|
||||
<?php
|
||||
if(file_exists($edit->files)) {
|
||||
$file = file_get_contents($edit->files);
|
||||
echo $file;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
<?php
|
||||
if(is_array($j)) {
|
||||
unset($j['kid']);
|
||||
foreach($j AS $column => $value) {
|
||||
?>
|
||||
$("[name='{{$column}}']").val("{{$value}}");
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$pattern = '/{([^}]+)}/';
|
||||
preg_match_all($pattern, $edit->html, $matches);
|
||||
$variables = $matches[1];
|
||||
?>
|
||||
<div style="overflow:auto;height:200px">
|
||||
<code>
|
||||
<?php foreach($variables AS $variable) { ?>
|
||||
${{$variable}} = ""; <br>
|
||||
<?php } ?>
|
||||
<?php foreach($variables AS $variable) { ?>
|
||||
$string = str_replace("{<?php echo $variable ?>}", $<?php echo $variable ?>, $string); <br>
|
||||
<?php } ?>
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<div class="toolbar" style="position: fixed; bottom: 10px; width: 100%; background: white; padding: 10px; z-index:10;">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<select name="page" id="" class="form-control">
|
||||
<option value="A4">A4</option>
|
||||
<option value="A3">A3</option>
|
||||
<option value="A5">A5</option>
|
||||
<option value="A6">A6</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<select name="paper" placeholder="{{e2("Paper Type")}}" id="" class="form-control">
|
||||
<option value="portrait">Portrait</option>
|
||||
<option value="landscape">Landscape</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="number" placeholder="{{e2("DPI")}}" class="form-control" name="dpi" value="110" id="">
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="block-group mt-10">
|
||||
<button class="btn btn-primary">{{e2("Save")}}</button>
|
||||
<a href="#" class="btn btn-info generate-btn"><i class="fa fa-file-pdf"></i> {{e2("Generate Test PDF")}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-3 d-none">
|
||||
<?php $weldLogColumns = table_columns("weld_logs");
|
||||
foreach($weldLogColumns AS $weldLogColumn) { ?>
|
||||
<div class="badge badge-success">{<?php echo $weldLogColumn ?>}</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
@include("admin.inc.document-editor")
|
||||
<div class="col-md-12">
|
||||
<script>
|
||||
$(function(){
|
||||
$(".generate-btn").on("click", function(){
|
||||
$("#generate-iframe").attr("src", "?ajax=generate-pdf-test&id={{get("edit")}}&title={{$edit->title}}");
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<iframe src="" id="generate-iframe" width="100%" style="height:90vh" height="600" frameborder="0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
<?php if(getisset("edit")) { ?>
|
||||
// Edit parametresi varsa düzenleme sekmesini aç
|
||||
$('a[href="#edit-tab"]').tab('show');
|
||||
<?php } ?>
|
||||
});
|
||||
|
||||
function showHistory(id) {
|
||||
// Reuse the existing admin-ajax/row-history logic
|
||||
// We open it in a modal or a sidebar.
|
||||
// Assuming there is a generic modal function or we can use the one from the context menu logic.
|
||||
// For now, let's use the 'modal-popin' if available, otherwise just a basic AJAX load.
|
||||
|
||||
// We'll borrow the logic from standard row-history loading
|
||||
$('#modal-popin').modal('show');
|
||||
$('#modal-popin .block-title').text('{{e2("History")}}');
|
||||
$('#modal-popin .block-content').html('<div class="text-center"><i class="fa fa-spinner fa-spin fa-3x"></i></div>');
|
||||
|
||||
$.get('{{url("admin-ajax/row-history")}}', {
|
||||
table: 'document_templates',
|
||||
row_id: id
|
||||
}, function(response) {
|
||||
$('#modal-popin .block-content').html(response);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
|
||||
<div id="gridSummary" class="mb-2 p-2 bg-light border rounded" style="display:none;"></div>
|
||||
<div id="dataGrid"></div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
var dataSource = new DevExpress.data.CustomStore({
|
||||
key: "id",
|
||||
load(loadOptions) {
|
||||
const deferred = $.Deferred();
|
||||
const args = {};
|
||||
|
||||
[
|
||||
'skip',
|
||||
'take',
|
||||
'requireTotalCount',
|
||||
'requireGroupCount',
|
||||
'sort',
|
||||
'filter',
|
||||
'totalSummary',
|
||||
'group',
|
||||
'groupSummary',
|
||||
].forEach((i) => {
|
||||
if (i in loadOptions && isNotEmpty(loadOptions[i])) {
|
||||
args[i] = JSON.stringify(loadOptions[i]);
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '{{url("admin/devextreme?table=document_templates")}}',
|
||||
dataType: 'json',
|
||||
method: 'GET',
|
||||
cache: false,
|
||||
data: args,
|
||||
success(result) {
|
||||
deferred.resolve(result.data, {
|
||||
totalCount: result.totalCount,
|
||||
summary: result.summary,
|
||||
groupCount: result.groupCount,
|
||||
});
|
||||
},
|
||||
error(e) {
|
||||
deferred.reject('{{e2("Data Loading Error")}}');
|
||||
}
|
||||
});
|
||||
|
||||
return deferred.promise();
|
||||
},
|
||||
insert: function(values) {
|
||||
var deferred = $.Deferred();
|
||||
values['_token'] = "{{ csrf_token() }}";
|
||||
$.ajax({
|
||||
url: "{{url("admin/insert/document_templates")}}",
|
||||
method: "POST",
|
||||
data: values,
|
||||
success: function(response) {
|
||||
deferred.resolve(response);
|
||||
},
|
||||
error: function(e) {
|
||||
deferred.reject("{{e2("Insertion failed")}}");
|
||||
}
|
||||
});
|
||||
return deferred.promise();
|
||||
},
|
||||
remove: function(key) {
|
||||
var deferred = $.Deferred();
|
||||
$.ajax({
|
||||
url: "{{url("admin/remove/document_templates")}}",
|
||||
data: {
|
||||
'_token': "{{ csrf_token() }}",
|
||||
'key': key
|
||||
},
|
||||
method: "DELETE"
|
||||
})
|
||||
.done(deferred.resolve)
|
||||
.fail(function(e){
|
||||
deferred.reject("{{e2("Deletion failed")}}");
|
||||
});
|
||||
return deferred.promise();
|
||||
},
|
||||
update: function(key, values) {
|
||||
var deferred = $.Deferred();
|
||||
$.ajax({
|
||||
url: "{{url("admin/save-json/document_templates")}}",
|
||||
method: "PUT",
|
||||
data: {
|
||||
'_token': "{{ csrf_token() }}",
|
||||
'values': values,
|
||||
'key': key
|
||||
}
|
||||
})
|
||||
.done(deferred.resolve)
|
||||
.fail(function(e){
|
||||
deferred.reject("{{e2("Update failed")}}");
|
||||
});
|
||||
return deferred.promise();
|
||||
}
|
||||
});
|
||||
|
||||
var dataGrid = $("#dataGrid").dxDataGrid({
|
||||
dataSource: dataSource,
|
||||
showBorders: true,
|
||||
allowColumnResizing: true,
|
||||
columnAutoWidth: true,
|
||||
allowColumnReordering: true,
|
||||
stateStoring: {
|
||||
enabled: true,
|
||||
type: "localStorage",
|
||||
storageKey: "document_templates_grid_state"
|
||||
},
|
||||
headerFilter: {
|
||||
visible: true
|
||||
},
|
||||
onContentReady: function(e) {
|
||||
var items = e.component.getDataSource().items();
|
||||
var activeCount = 0;
|
||||
var passiveCount = 0;
|
||||
|
||||
if(items) {
|
||||
items.forEach(function(item) {
|
||||
if(item.y == 1) activeCount++;
|
||||
else passiveCount++;
|
||||
});
|
||||
|
||||
var summaryHtml = '<span class="mr-3"><i class="fa fa-info-circle"></i> <strong>{{e2("Status Summary")}}</strong></span>' +
|
||||
'<span class="badge badge-success mr-2" style="font-size: 100%;">{{e2("Active")}}: ' + activeCount + '</span>' +
|
||||
'<span class="badge badge-secondary" style="font-size: 100%;">{{e2("Passive")}}: ' + passiveCount + '</span>';
|
||||
|
||||
$("#gridSummary").html(summaryHtml).show();
|
||||
}
|
||||
},
|
||||
|
||||
paging: {
|
||||
enabled: false
|
||||
},
|
||||
filterRow: {
|
||||
visible: true
|
||||
},
|
||||
searchPanel: {
|
||||
visible: true
|
||||
},
|
||||
editing: {
|
||||
mode: "batch",
|
||||
allowUpdating: true,
|
||||
allowDeleting: true,
|
||||
allowAdding: true,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
dataField: "y",
|
||||
caption: "{{e2('Status')}}",
|
||||
width: 80,
|
||||
allowEditing: false,
|
||||
cellTemplate: function(container, options) {
|
||||
var checked = options.value == 1;
|
||||
$("<div>").dxCheckBox({
|
||||
value: checked,
|
||||
onValueChanged: function(e) {
|
||||
var id = options.data.id;
|
||||
var newValue = e.value ? 1 : 0;
|
||||
$.post("{{url("admin-ajax/input-edit")}}", {
|
||||
id: id,
|
||||
table: "document_templates",
|
||||
name: "y",
|
||||
_token: "{{csrf_token()}}",
|
||||
value: newValue
|
||||
}, function(response) {
|
||||
DevExpress.ui.notify("Status updated", "success", 3000);
|
||||
// Update local store to reflect change immediately and persist through client-side operations
|
||||
var store = options.component.getDataSource().store();
|
||||
if (store.push) {
|
||||
store.push([{ type: "update", key: id, data: { y: newValue } }]);
|
||||
} else {
|
||||
options.component.refresh();
|
||||
}
|
||||
}).fail(function() {
|
||||
DevExpress.ui.notify("Status update failed", "error", 3000);
|
||||
e.component.option("value", !e.value);
|
||||
});
|
||||
}
|
||||
}).appendTo(container);
|
||||
}
|
||||
},
|
||||
{
|
||||
dataField: "id",
|
||||
caption: "{{e2('ID')}}",
|
||||
allowEditing: false,
|
||||
dataType: "number"
|
||||
},
|
||||
{
|
||||
dataField: "title",
|
||||
caption: "{{e2('Document Title')}}"
|
||||
},
|
||||
{
|
||||
dataField: "title2",
|
||||
caption: "{{e2('Document Title (RU)')}}"
|
||||
},
|
||||
{
|
||||
dataField: "title3",
|
||||
caption: "{{e2('Document Register Title')}}"
|
||||
},
|
||||
{
|
||||
dataField: "slug",
|
||||
caption: "{{e2('Document ID')}}"
|
||||
},
|
||||
{
|
||||
dataField: "kid",
|
||||
caption: "{{e2('Path')}}"
|
||||
},
|
||||
{
|
||||
dataField: "type",
|
||||
caption: "{{e2('Type')}}"
|
||||
},
|
||||
{
|
||||
dataField: "lang",
|
||||
caption: "{{e2('Language')}}"
|
||||
},
|
||||
{
|
||||
type: "buttons",
|
||||
width: 110,
|
||||
buttons: [
|
||||
{
|
||||
hint: "{{e2('Generate PDF')}}",
|
||||
icon: "file-pdf",
|
||||
visible: function(e) {
|
||||
return e.row.data.kid !== "";
|
||||
},
|
||||
onClick: function(e) {
|
||||
var folder = e.row.data.kid;
|
||||
$("#modal-popin").modal({
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
});
|
||||
$("#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
|
||||
}, function(d) {
|
||||
$("#modal-popin .block-content").html(d);
|
||||
}).fail(function(jqXHR, textStatus, errorThrow) {
|
||||
$("#modal-popin .block-content").html(jqXHR.responseJSON.message);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
hint: "{{e2('Edit')}}",
|
||||
icon: "edit",
|
||||
onClick: function(e) {
|
||||
window.location.href = "?edit=" + e.row.data.id;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}).dxDataGrid("instance");
|
||||
|
||||
$("#addButton").dxButton({
|
||||
text: "{{e2('Add Template')}}",
|
||||
onClick: function() {
|
||||
dataGrid.addRow();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,411 @@
|
||||
<?php
|
||||
// Permission control for upload functionality
|
||||
$uploadPermissionKey = isset($uploadPermissionKey) ? $uploadPermissionKey : null;
|
||||
$hasUploadPermission = true;
|
||||
|
||||
if($uploadPermissionKey) {
|
||||
$allowedLevels = j(setting($uploadPermissionKey));
|
||||
$userLevel = u()->level ?? null;
|
||||
|
||||
if(is_array($allowedLevels) && !in_array($userLevel, $allowedLevels)) {
|
||||
$hasUploadPermission = false;
|
||||
}
|
||||
}
|
||||
|
||||
// First upload section visibility control
|
||||
if(!isset($firstUploadFolder)) {
|
||||
?>
|
||||
<style>
|
||||
.first-upload {
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Second upload section visibility control
|
||||
if(!isset($secondUploadTitle)) {
|
||||
?>
|
||||
<style>
|
||||
.second-upload {
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
$(".first-upload").removeClass("col-md-6").addClass("col-md-12");
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Third upload section visibility control
|
||||
if(!isset($thirdUploadTitle)) {
|
||||
?>
|
||||
<style>
|
||||
.third-upload {
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function(){
|
||||
// If third upload is hidden, adjust column widths for remaining uploads
|
||||
if ($(".first-upload").is(":visible") && $(".second-upload").is(":visible")) {
|
||||
$(".first-upload").removeClass("col-md-4").addClass("col-md-6");
|
||||
$(".second-upload").removeClass("col-md-4").addClass("col-md-6");
|
||||
} else if ($(".first-upload").is(":visible") || $(".second-upload").is(":visible")) {
|
||||
$(".first-upload, .second-upload").removeClass("col-md-4").addClass("col-md-12");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
} ?>
|
||||
<?php
|
||||
$firstUploadFolder = isset($firstUploadFolder) ? $firstUploadFolder : "001_Drawings/001_Engineering";
|
||||
$secondUploadFolder = isset($secondUploadFolder) ? $secondUploadFolder : "001_Drawings/002_Iso";
|
||||
$thirdUploadFolder = isset($thirdUploadFolder) ? $thirdUploadFolder : "001_Drawings/003_As_Build(ID)";
|
||||
$firstUploadTitle = isset($firstUploadTitle) ? $firstUploadTitle : "Upload Engineering PDF";
|
||||
$secondUploadTitle = isset($secondUploadTitle) ? $secondUploadTitle : "Upload ISO PDF";
|
||||
$thirdUploadTitle = isset($thirdUploadTitle) ? $thirdUploadTitle : "Upload As Build PDF";
|
||||
$firstUploadDescription = isset($firstUploadDescription) ? $firstUploadDescription : "Drop the $firstUploadTitle files here or upload them selectively.";
|
||||
$secondUploadDescription = isset($secondUploadDescription) ? $secondUploadDescription : "Drop the $secondUploadTitle files here or upload them selectively.";
|
||||
$thirdUploadDescription = isset($thirdUploadDescription) ? $thirdUploadDescription : "Drop the $thirdUploadTitle files here or upload them selectively.";
|
||||
$firstUploadAccepted = isset($firstUploadAccepted) ? $firstUploadAccepted : '.pdf';
|
||||
$secondUploadAccepted = isset($secondUploadAccepted) ? $secondUploadAccepted : '.pdf';
|
||||
$thirdUploadAccepted = isset($thirdUploadAccepted) ? $thirdUploadAccepted : '.pdf';
|
||||
$fourthUploadTitle = isset($fourthUploadTitle) ? $fourthUploadTitle : null;
|
||||
if($fourthUploadTitle) {
|
||||
$fourthUploadFolder = isset($fourthUploadFolder) ? $fourthUploadFolder : "";
|
||||
$fourthUploadDescription = isset($fourthUploadDescription) ? $fourthUploadDescription : "Drop the $fourthUploadTitle files here or upload them selectively.";
|
||||
$fourthUploadAccepted = isset($fourthUploadAccepted) ? $fourthUploadAccepted : '.pdf';
|
||||
}
|
||||
$fifthUploadTitle = isset($fifthUploadTitle) ? $fifthUploadTitle : null;
|
||||
if($fifthUploadTitle) {
|
||||
$fifthUploadFolder = isset($fifthUploadFolder) ? $fifthUploadFolder : "";
|
||||
$fifthUploadDescription = isset($fifthUploadDescription) ? $fifthUploadDescription : "Drop the $fifthUploadTitle files here or upload them selectively.";
|
||||
$fifthUploadAccepted = isset($fifthUploadAccepted) ? $fifthUploadAccepted : '.pdf';
|
||||
}
|
||||
?>
|
||||
|
||||
<style>
|
||||
/* Modal için özel stiller - çok spesifik tutulmuştur */
|
||||
#uploadModal.modal .modal-dialog {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
/* Upload modal body styling */
|
||||
#uploadModal .modal-body.upload-modal-body {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<!-- Upload buttons for fixed-toolbar -->
|
||||
<?php if($hasUploadPermission): ?>
|
||||
<script>
|
||||
$(function() {
|
||||
// Önce eski butonları temizleyelim (eğer varsa)
|
||||
$(".pdf-upload-btn").remove();
|
||||
|
||||
// PDF yükleme butonu için benzersiz bir sınıf kullanalım
|
||||
var uploadButton = `
|
||||
<button class="btn btn-sm btn-primary mr-2 pdf-upload-btn" data-toggle="modal" data-target="#uploadModal">
|
||||
<i class="fa fa-upload"></i> {{e2("Upload PDF(s)")}}
|
||||
</button>
|
||||
`;
|
||||
|
||||
// Butonu body'e ekleyelim
|
||||
$("body").append(uploadButton);
|
||||
|
||||
// Mevcut fixed-toolbar varsa ve bulunabiliyorsa butonu oraya taşıyalım
|
||||
setTimeout(function() {
|
||||
if ($(".fixed-toolbar").length > 0) {
|
||||
var $button = $(".pdf-upload-btn").detach();
|
||||
$button.removeClass("pdf-upload-btn").addClass("pdf-upload-toolbar-btn");
|
||||
$(".fixed-toolbar").append($button);
|
||||
}
|
||||
}, 500); // Sayfanın yüklenmesi için biraz bekleyelim
|
||||
});
|
||||
</script>
|
||||
<?php else: ?>
|
||||
<style>
|
||||
/* Hide upload button if user doesn't have permission */
|
||||
.pdf-upload-btn,
|
||||
.pdf-upload-toolbar-btn {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Upload Modal -->
|
||||
<div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="uploadModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="uploadModalLabel">{{e2("Upload PDF(s)")}}</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body upload-modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-10 text-center first-upload">
|
||||
<button class="btn btn-primary mb-5" type="button" data-toggle="collapse" data-target="#engineeringCollapse" aria-expanded="false" aria-controls="collapseExample">
|
||||
{{e2($firstUploadTitle)}}
|
||||
</button>
|
||||
<div class="collapse" id="engineeringCollapse">
|
||||
<form action="{{url("admin-ajax/document-upload?module=$id")}}" id="files" class="dropzone" id="dropzone" data-upload-label="{{e2($firstUploadTitle)}}" enctype="multipart/form-data" method="post">
|
||||
@if(isset($tableName))
|
||||
<input type="hidden" name="table_name" value="{{$tableName}}">
|
||||
@endif
|
||||
<?php if($id == "document-revision") { ?>
|
||||
<div class="border rounded p-10 mb-5 bg-gray text-left">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
{{e2("Transmittal No")}}
|
||||
<input type="text" name="transmittal_document" id="transmittal_document" class="form-control" placeholder="">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{e2("Publish Date")}}
|
||||
<input type="date" name="publish_date" id="publish_date" class="form-control" placeholder="">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{e2("Zone")}}
|
||||
<input type="text" name="zone" id="zone" class="form-control" placeholder="">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
{{e2("Subcontructer")}}
|
||||
<select name="subcontractor" id="" class="form-control">
|
||||
<option value="">{{e2("Select")}}</option>
|
||||
<?php foreach(db("subcontractors")->get() AS $s) {
|
||||
?>
|
||||
<option value="{{$s->company_name_en}}">{{$s->company_name_en}}</option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 d-none">
|
||||
{{e2("Test String")}}
|
||||
<textarea name="string" id="string" cols="30" rows="10" placeholder="{{e2("Ex. 30-CBS-700067-3-BG3-TLH-U01 Sh-01-Rev01_Sh-02-Rev01_F01")}}" class="form-control"></textarea>
|
||||
|
||||
</div>
|
||||
<div class="col-md-12 d-none">
|
||||
{{e2("Regex Pattern")}} <br>
|
||||
|
||||
<?php $columns = table_columns("document_revisions") ?>
|
||||
<?php foreach($columns AS $column) {
|
||||
?>
|
||||
<div class="badge badge-success select-column" data-value="(?P<{{$column}}>\w+)">{{$column}}</div>
|
||||
<?php
|
||||
} ?>
|
||||
|
||||
<?php $otherCols = [
|
||||
'fluid_code',
|
||||
'line_no',
|
||||
'dn',
|
||||
'line_spec',
|
||||
'external_finish_type',
|
||||
'structure'
|
||||
];
|
||||
foreach($otherCols AS $otherCol) {
|
||||
|
||||
?>
|
||||
<div class="badge badge-success select-column" data-value="(?P<{{$otherCol}}>\w+)">{{e2($otherCol)}}</div>
|
||||
<?php } ?>
|
||||
<br>
|
||||
<div class="badge badge-info select-column" data-value="\s">{{e2("space")}}</div>
|
||||
<div class="badge badge-info select-column" data-value="[_-]">{{e2("_ or -")}}</div>
|
||||
<div class="badge badge-info select-column" data-value="[.,]">{{e2(". or ,")}}</div>
|
||||
|
||||
<textarea name="regex" id="regex" cols="30" rows="10" class="form-control"></textarea>
|
||||
|
||||
</div>
|
||||
<div class="col-12 text-center mt-5 d-none">
|
||||
<div class="btn btn-info btn-test">{{e2("Test")}}</div>
|
||||
<div class="test-result m-10"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$("#string").val(localStorage.getItem("string"));
|
||||
$("#regex").val(localStorage.getItem("regex"));
|
||||
|
||||
$(".btn-test").on("click", function(){
|
||||
var string = encodeURIComponent($("#string").val());
|
||||
var regex = encodeURIComponent($("#regex").val());
|
||||
$(".test-result").html("Loading...").load("?ajax=document-revision-test&string="+ string + '®ex=' + regex);
|
||||
});
|
||||
$(".select-column").on("click", function(){
|
||||
$("#regex").val($("#regex").val() + $(this).attr("data-value"));
|
||||
});
|
||||
$("#string, #regex").on("keyup", function(){
|
||||
localStorage.setItem($(this).attr("id"), $(this).val());
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
<input type="hidden" name="folder" value="{{$firstUploadFolder}}" >
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" accept="{{$firstUploadAccepted}}" multiple />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="dz-message" data-dz-message><span>{{__($firstUploadDescription)}}</span></div>
|
||||
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-10 text-center second-upload">
|
||||
<button class="btn btn-primary mb-5" type="button" data-toggle="collapse" data-target="#isoCollapse" aria-expanded="false" aria-controls="collapseExample">
|
||||
{{e2($secondUploadTitle)}}
|
||||
</button>
|
||||
<div class="collapse" id="isoCollapse">
|
||||
<form action="{{url("admin-ajax/document-upload?module=$id")}}" id="files" class="dropzone dropzone2" id="dropzone2" data-upload-label="{{e2($secondUploadTitle)}}" enctype="multipart/form-data" method="post">
|
||||
@if(isset($tableName))
|
||||
<input type="hidden" name="table_name" value="{{$tableName}}">
|
||||
@endif
|
||||
<input type="hidden" name="folder" value="{{$secondUploadFolder}}" >
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" accept="{{$firstUploadAccepted}}" multiple />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="dz-message" data-dz-message><span>{{__($secondUploadDescription)}}</span></div>
|
||||
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-10 text-center third-upload">
|
||||
<button class="btn btn-primary mb-5" type="button" data-toggle="collapse" data-target="#asbuildCollapse" aria-expanded="false" aria-controls="collapseExample">
|
||||
{{e2($thirdUploadTitle)}}
|
||||
</button>
|
||||
<div class="collapse" id="asbuildCollapse">
|
||||
<form action="{{url("admin-ajax/document-upload?module=$id")}}" id="files" class="dropzone dropzone3" id="dropzone3" data-upload-label="{{e2($thirdUploadTitle)}}" enctype="multipart/form-data" method="post">
|
||||
@if(isset($tableName))
|
||||
<input type="hidden" name="table_name" value="{{$tableName}}">
|
||||
@endif
|
||||
<input type="hidden" name="folder" value="{{$thirdUploadFolder}}" >
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" accept="{{$firstUploadAccepted}}" multiple />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="dz-message" data-dz-message><span>{{__($thirdUploadDescription)}}</span></div>
|
||||
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!empty($fourthUploadTitle)) { ?>
|
||||
<div class="col-md-4 mb-10 text-center fourth-upload">
|
||||
<button class="btn btn-primary mb-5" type="button" data-toggle="collapse" data-target="#fourthCollapse" aria-expanded="false" aria-controls="collapseExample">
|
||||
{{e2($fourthUploadTitle)}}
|
||||
</button>
|
||||
<div class="collapse" id="fourthCollapse">
|
||||
<form action="{{url("admin-ajax/document-upload?module=$id")}}" class="dropzone dropzone4" data-upload-label="{{e2($fourthUploadTitle)}}" enctype="multipart/form-data" method="post">
|
||||
@if(isset($tableName))
|
||||
<input type="hidden" name="table_name" value="{{$tableName}}">
|
||||
@endif
|
||||
<input type="hidden" name="folder" value="{{$fourthUploadFolder}}" >
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" accept="{{$fourthUploadAccepted}}" multiple />
|
||||
</div>
|
||||
<div class="dz-message" data-dz-message><span>{{__($fourthUploadDescription)}}</span></div>
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if(!empty($fifthUploadTitle)) { ?>
|
||||
<div class="col-md-4 mb-10 text-center fifth-upload">
|
||||
<button class="btn btn-primary mb-5" type="button" data-toggle="collapse" data-target="#fifthCollapse" aria-expanded="false" aria-controls="collapseExample">
|
||||
{{e2($fifthUploadTitle)}}
|
||||
</button>
|
||||
<div class="collapse" id="fifthCollapse">
|
||||
<form action="{{url("admin-ajax/document-upload?module=$id")}}" class="dropzone dropzone5" data-upload-label="{{e2($fifthUploadTitle)}}" enctype="multipart/form-data" method="post">
|
||||
@if(isset($tableName))
|
||||
<input type="hidden" name="table_name" value="{{$tableName}}">
|
||||
@endif
|
||||
<input type="hidden" name="folder" value="{{$fifthUploadFolder}}" >
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" accept="{{$fifthUploadAccepted}}" multiple />
|
||||
</div>
|
||||
<div class="dz-message" data-dz-message><span>{{__($fifthUploadDescription)}}</span></div>
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
// Expand first section by default when modal opens
|
||||
$('#uploadModal').on('shown.bs.modal', function () {
|
||||
if (!$('#engineeringCollapse').hasClass('show')) {
|
||||
$('#engineeringCollapse').collapse('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
Dropzone.autoDiscover = false;
|
||||
|
||||
(function(){
|
||||
var dropzoneConfigs = [
|
||||
{ selector: ".dropzone", accepted: "{{$firstUploadAccepted}}", title: "{{e2($firstUploadTitle)}}"},
|
||||
{ selector: ".dropzone2", accepted: "{{$secondUploadAccepted}}", title: "{{e2($secondUploadTitle)}}"},
|
||||
{ selector: ".dropzone3", accepted: "{{$thirdUploadAccepted}}", title: "{{e2($thirdUploadTitle)}}"},
|
||||
@if(!empty($fourthUploadTitle))
|
||||
{ selector: ".dropzone4", accepted: "{{$fourthUploadAccepted}}", title: "{{e2($fourthUploadTitle)}}" },
|
||||
@endif
|
||||
@if(!empty($fifthUploadTitle))
|
||||
{ selector: ".dropzone5", accepted: "{{$fifthUploadAccepted}}", title: "{{e2($fifthUploadTitle)}}" },
|
||||
@endif
|
||||
];
|
||||
|
||||
dropzoneConfigs.forEach(function(config) {
|
||||
if($(config.selector).length > 0) {
|
||||
var dropzone = new Dropzone(config.selector, {
|
||||
acceptedFiles: config.accepted,
|
||||
success: function(file, response) {
|
||||
var result = response.trim();
|
||||
var uploadLabel = $(this.element).attr('data-upload-label') || config.title;
|
||||
|
||||
// SweetAlert ile path göster
|
||||
if(window.Swal) {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '{{e2("Upload Successful")}}',
|
||||
html: '<textarea class="form-control" rows="3" readonly style="font-family: monospace; font-size: 12px;">' + result + '</textarea><button class="btn btn-primary mt-2" onclick="navigator.clipboard.writeText(\'' + result + '\').then(() => Swal.fire({icon: \'success\', title: \'{{e2("Copied!")}}\', timer: 1500, showConfirmButton: false}))">{{e2("Copy to clipboard")}}</button>',
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false
|
||||
});
|
||||
} else {
|
||||
alert('{{e2("Upload successful")}}: ' + result);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,97 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,226 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,355 @@
|
||||
@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">×</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">×</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
|
||||
@@ -0,0 +1,141 @@
|
||||
<?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' => db("results")->get(),
|
||||
'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>
|
||||
@@ -0,0 +1,237 @@
|
||||
<?php
|
||||
/**
|
||||
* General Inspection View - Listing "Other" Module Uploads
|
||||
*/
|
||||
$mainPath = setting('inspection_history_main_path', false, '014_Inspection_Photos');
|
||||
?>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
{{col("col-12", "General Inspection Photos", 0, ['no-options' => true])}}
|
||||
|
||||
<div class="alert alert-info alert-dismissible fade show" role="alert" style="margin-bottom: 20px;">
|
||||
<h5 style="margin-bottom: 10px;"><i class="icon fas fa-info-circle"></i> {{e2('Storage Information')}}</h5>
|
||||
{!! str_replace('[path]', '<strong>storage/app/documents/' . $mainPath . '/Other/YYYY-MM-DD/</strong>', e2('New photos uploaded via the "Other" module are stored in date-organized folders: [path]')) !!}
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="generalInspectionGrid"></div>
|
||||
{{_col()}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.inspection-thumbnail {
|
||||
max-width: 80px;
|
||||
max-height: 80px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
padding: 2px;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.inspection-thumbnail:hover {
|
||||
transform: scale(1.1);
|
||||
border-color: #3498db;
|
||||
}
|
||||
.mfp-bg, .mfp-wrap {
|
||||
z-index: 2000 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="{{ asset('assets/admin/js/plugins/magnific-popup/magnific-popup.css') }}">
|
||||
<script src="{{ asset('assets/admin/js/plugins/magnific-popup/jquery.magnific-popup.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
const grid = $("#generalInspectionGrid").dxDataGrid({
|
||||
dataSource: new DevExpress.data.CustomStore({
|
||||
key: "id",
|
||||
load: function(loadOptions) {
|
||||
const d = $.Deferred();
|
||||
$.getJSON("?ajax=general-inspection-list", function(res) {
|
||||
d.resolve(res.data, { totalCount: res.totalCount });
|
||||
}).fail(function() {
|
||||
d.reject("Data Load Error");
|
||||
});
|
||||
return d.promise();
|
||||
}
|
||||
}),
|
||||
remoteOperations: false, // Since we fetch all and let DevExtreme handle it client-side for this specific view
|
||||
filterRow: { visible: true },
|
||||
headerFilter: { visible: true },
|
||||
searchPanel: { visible: true, width: 240 },
|
||||
paging: { pageSize: 20 },
|
||||
pager: {
|
||||
showPageSizeSelector: true,
|
||||
allowedPageSizes: [10, 20, 50, 100],
|
||||
showInfo: true
|
||||
},
|
||||
columnAutoWidth: true,
|
||||
showBorders: true,
|
||||
allowColumnResizing: true,
|
||||
sorting: { mode: "multiple" },
|
||||
columns: [
|
||||
{
|
||||
dataField: "id",
|
||||
caption: "ID",
|
||||
sortOrder: "desc",
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
dataField: "user_name",
|
||||
caption: "{{e2('User')}}",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
dataField: "date",
|
||||
caption: "{{e2('Date')}}",
|
||||
dataType: "datetime",
|
||||
format: "dd.MM.yyyy HH:mm",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
dataField: "ip_address",
|
||||
caption: "{{e2('IP')}}",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
dataField: "comment",
|
||||
caption: "{{e2('Comment')}}",
|
||||
cellTemplate: function(container, options) {
|
||||
container.text(options.value || '-');
|
||||
}
|
||||
},
|
||||
{
|
||||
dataField: "file_path",
|
||||
caption: "{{e2('Photo')}}",
|
||||
width: 120,
|
||||
allowFiltering: false,
|
||||
allowSorting: false,
|
||||
cellTemplate: function(container, options) {
|
||||
if (options.value) {
|
||||
let photoUrl;
|
||||
if (options.value.startsWith('storage/')) {
|
||||
photoUrl = '{{ url("") }}/' + options.value;
|
||||
} else if (options.value.startsWith('documents/')) {
|
||||
photoUrl = '{{ url("storage") }}/' + options.value;
|
||||
} else {
|
||||
photoUrl = '{{ url("storage/documents") }}/' + options.value;
|
||||
}
|
||||
|
||||
const link = $('<a>')
|
||||
.attr('href', photoUrl)
|
||||
.addClass('inspection-popup')
|
||||
.attr('title', options.data.file_name || 'Photo');
|
||||
|
||||
const img = $('<img>')
|
||||
.attr('src', photoUrl)
|
||||
.addClass('inspection-thumbnail');
|
||||
|
||||
link.append(img);
|
||||
container.append(link);
|
||||
} else {
|
||||
container.append('<span class="text-muted">-</span>');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
dataField: "file_path",
|
||||
caption: "{{e2('Download')}}",
|
||||
width: 100,
|
||||
alignment: "center",
|
||||
allowFiltering: false,
|
||||
allowSorting: false,
|
||||
cellTemplate: function(container, options) {
|
||||
if (options.value) {
|
||||
let photoUrl;
|
||||
if (options.value.startsWith('storage/')) {
|
||||
photoUrl = '{{ url("") }}/' + options.value;
|
||||
} else if (options.value.startsWith('documents/')) {
|
||||
photoUrl = '{{ url("storage") }}/' + options.value;
|
||||
} else {
|
||||
photoUrl = '{{ url("storage/documents") }}/' + options.value;
|
||||
}
|
||||
|
||||
const downloadLink = $('<a>')
|
||||
.attr('href', photoUrl)
|
||||
.attr('download', options.data.file_name || 'photo.jpg')
|
||||
.addClass('btn btn-sm btn-primary')
|
||||
.html('<i class="fas fa-download"></i>');
|
||||
container.append(downloadLink);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
dataField: "id",
|
||||
caption: "{{e2('Delete')}}",
|
||||
width: 100,
|
||||
alignment: "center",
|
||||
allowFiltering: false,
|
||||
allowSorting: false,
|
||||
cellTemplate: function(container, options) {
|
||||
const deleteBtn = $('<button>')
|
||||
.addClass('btn btn-sm btn-danger')
|
||||
.html('<i class="fas fa-trash"></i>')
|
||||
.on('click', function() {
|
||||
Swal.fire({
|
||||
title: '{{e2("Are you sure?")}}',
|
||||
text: '{{e2("Are you sure you want to delete this record and its photo?")}}',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: '{{e2("Yes, delete it!")}}',
|
||||
cancelButtonText: '{{e2("Cancel")}}'
|
||||
}).then((result) => {
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: '{{ url("ajax/inspection-history/delete") }}/' + options.data.id,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(res) {
|
||||
if (res.success) {
|
||||
grid.refresh();
|
||||
Swal.fire('{{e2("Deleted!")}}', res.message, 'success');
|
||||
} else {
|
||||
Swal.fire('{{e2("Error!")}}', res.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
Swal.fire('{{e2("Error!")}}', '{{e2("Failed to delete record")}}', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
container.append(deleteBtn);
|
||||
}
|
||||
}
|
||||
],
|
||||
onContentReady: function(e) {
|
||||
$('.inspection-popup').magnificPopup({
|
||||
type: 'image',
|
||||
closeOnContentClick: true,
|
||||
mainClass: 'mfp-img-mobile',
|
||||
image: {
|
||||
verticalFit: true,
|
||||
titleSrc: function(item) {
|
||||
const downloadUrl = item.el.attr('href');
|
||||
const fileName = item.el.attr('title');
|
||||
return '<div style="display: flex; justify-content: space-between; align-items: center; width: 100%;">' +
|
||||
'<span>' + fileName + '</span>' +
|
||||
'<a class="btn btn-sm btn-outline-light" href="' + downloadUrl + '" download="' + fileName + '" style="margin-right: 20px;">' +
|
||||
'<i class="fas fa-download"></i> {{e2("Download")}}' +
|
||||
'</a>' +
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
gallery: { enabled: true }
|
||||
});
|
||||
}
|
||||
}).dxDataGrid("instance");
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
$tabs = [
|
||||
'Common Settings' => '⚙️',
|
||||
'Module Patterns' => '🔢',
|
||||
'Temperatures' => '🌡️',
|
||||
'Predefined Variables' => '✍️',
|
||||
'Project App Urls' => '🛜',
|
||||
'Ral Codes' => '🎨',
|
||||
'Converter Map' => '🔄',
|
||||
'Specific Permissions' => '🔒',
|
||||
'Document Manager Permissions' => '📁',
|
||||
'Inspection History Management' => '📸',
|
||||
'NAKS Sync' => '🔄',
|
||||
];
|
||||
|
||||
// Aktif tab'ı belirle
|
||||
$currentTab = get("t");
|
||||
$currentTitle = "";
|
||||
|
||||
// Eğer aktif bir tab varsa başlığını bulalım
|
||||
if($currentTab) {
|
||||
foreach($tabs as $tabName => $val) {
|
||||
if(str_slug($tabName) == $currentTab) {
|
||||
$currentTitle = $tabName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
<!-- Sol Sidebar: Arama ve Menü -->
|
||||
<div class="col-md-3">
|
||||
<div class="block block-rounded block-bordered">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">
|
||||
<i class="fa fa-cogs"></i> {{e2("General Settings")}}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="block-content">
|
||||
<!-- Arama Kutusu -->
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
<input type="text"
|
||||
class="form-control"
|
||||
id="settingSearch"
|
||||
placeholder="{{e2('Search settings...')}}"
|
||||
autocomplete="off">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">
|
||||
<i class="fa fa-search"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Menü Listesi -->
|
||||
<div class="list-group list-group-flush" id="settingsList" style="max-height: 78vh; overflow-y: auto;">
|
||||
<?php foreach($tabs AS $tab => $icon) {
|
||||
$id = str_slug($tab);
|
||||
$isActive = ($currentTab == $id);
|
||||
?>
|
||||
<a class="list-group-item list-group-item-action setting-link {{$isActive ? 'active' : ''}}"
|
||||
href="?t={{$id}}"
|
||||
data-title="{{strtolower($tab)}}"
|
||||
style="display: block; width: 100%;">
|
||||
<span class="mr-2">{{$icon}}</span>
|
||||
{{e2($tab)}}
|
||||
</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sağ Taraf: İçerik -->
|
||||
<div class="col-md-9">
|
||||
<?php if(getisset("t")) { ?>
|
||||
<div class="block block-rounded block-bordered">
|
||||
<div class="block-header block-header-default">
|
||||
<h3 class="block-title">{{e2($currentTitle)}}</h3>
|
||||
</div>
|
||||
<div class="block-content p-20">
|
||||
@include("admin.type.settings." . get("t"))
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="block block-rounded block-bordered">
|
||||
<div class="block-content block-content-full">
|
||||
<div class="py-50 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 from the list to configure")}}</h2>
|
||||
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle mr-1"></i>
|
||||
{{e2("You can use the search box on the left to quickly find the setting you are looking for.")}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Sidebar Link Stilleri */
|
||||
.setting-link {
|
||||
border: none;
|
||||
border-left: 3px solid transparent;
|
||||
transition: all 0.2s ease;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.setting-link:hover {
|
||||
background-color: #f8f9fa;
|
||||
text-decoration: none;
|
||||
padding-left: 20px;
|
||||
border-left-color: #dee2e6;
|
||||
}
|
||||
|
||||
.setting-link.active {
|
||||
background-color: #007bff;
|
||||
color: white;
|
||||
border-left-color: #0056b3;
|
||||
}
|
||||
|
||||
.setting-link.active:hover {
|
||||
background-color: #0069d9;
|
||||
}
|
||||
|
||||
/* Scrollbar düzenlemesi */
|
||||
#settingsList::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
#settingsList::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
#settingsList::-webkit-scrollbar-thumb {
|
||||
background: #ccc;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#settingsList::-webkit-scrollbar-thumb:hover {
|
||||
background: #bbb;
|
||||
}
|
||||
.block-content .content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
/* Arama kutusu odaklanma efekti */
|
||||
.input-group-focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
|
||||
border-radius: 0.25rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const searchInput = document.getElementById('settingSearch');
|
||||
|
||||
if (searchInput) {
|
||||
// Arama fonksiyonu
|
||||
searchInput.addEventListener('input', function(e) {
|
||||
const searchTerm = e.target.value.toLowerCase();
|
||||
const links = document.querySelectorAll('.setting-link');
|
||||
|
||||
links.forEach(link => {
|
||||
const title = link.getAttribute('data-title') || '';
|
||||
if (title.includes(searchTerm)) {
|
||||
link.style.display = 'block';
|
||||
} else {
|
||||
link.style.display = 'none';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Input focus efektleri
|
||||
searchInput.addEventListener('focus', function() {
|
||||
this.closest('.input-group').classList.add('input-group-focus');
|
||||
});
|
||||
|
||||
searchInput.addEventListener('blur', function() {
|
||||
this.closest('.input-group').classList.remove('input-group-focus');
|
||||
});
|
||||
|
||||
// Eğer aktif link varsa, scroll'u oraya kaydır
|
||||
const activeLink = document.querySelector('.setting-link.active');
|
||||
if (activeLink) {
|
||||
activeLink.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,746 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,139 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,50 @@
|
||||
<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>
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php if(getisset("update")) {
|
||||
$p = $_POST;
|
||||
db($table_name)->where("id",get("edit"))->update([
|
||||
"title" => $p['title'],
|
||||
"title2" => $p['title2'],
|
||||
"kid" => $p['kid'],
|
||||
"slug" => $p['slug'],
|
||||
"type" => $p['type'],
|
||||
"html" => $p['html'],
|
||||
"json" => json_encode_tr($p)
|
||||
]);
|
||||
echo "update ok";
|
||||
exit();
|
||||
} ?>
|
||||
{{col("col-12","Edit Form")}}
|
||||
<form action="{{url('admin-ajax/cover-upload')}}" class="hidden-upload" id="f{{$edit->id}}" enctype="multipart/form-data" method="post">
|
||||
<input type="file" name="cover" id="c{{$edit->id}}" onchange="$('#f{{$edit->id}}').submit();" required />
|
||||
<input type="hidden" name="id" value="{{$edit->id}}" />
|
||||
|
||||
<input type="hidden" name="slug" value="{{$edit->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<form action="?edit={{get("edit")}}&update" class="serialize" method="post">
|
||||
{{csrf_field()}}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{{__('Title')}}
|
||||
<input type="hidden" name="id" value="{{$edit->id}}" />
|
||||
|
||||
<input type="hidden" name="oldslug" value="{{$edit->slug}}" />
|
||||
<input type="text" name="title" id="title" value="{{$edit->title}}" class="form-control" />
|
||||
{{__('Title 2')}}
|
||||
<input type="text" name="title2" id="title2" value="{{$edit->title2}}" class="form-control" />
|
||||
<div class="d-none">
|
||||
{{__('ID')}} <div class="btn btn-default" onclick="$.get('{{url('admin-ajax/slug?title='.$edit->breadcrumb)}}'+$('#title').val(),function(d){
|
||||
$('#slug').val(d)
|
||||
})"><i class="si si-refresh"></i></div>
|
||||
|
||||
|
||||
<input type="text" name="slug" id="slug" value="{{$edit->slug}}" class="form-control" />
|
||||
{{e2("Parent")}}
|
||||
<input type="text" name="kid" class="form-control" value="{{$edit->kid}}" />
|
||||
{{__('Content Type')}}
|
||||
<select name="type"data-id="{{$edit->id}}" class="form-control edit" table="contents" >
|
||||
<option value="">Tip Seçiniz</option>
|
||||
@foreach(@$types AS $t)
|
||||
<option value="{{$t->title}}" @if($t->title==$edit->type) selected @endif>{{$t->title}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
{{__('Content')}}
|
||||
<textarea class="" id="editor" name="html">{{$edit->html}}</textarea>
|
||||
|
||||
@include("admin.inc.fields")
|
||||
</div>
|
||||
<div class="col-md-3 text-center d-none">
|
||||
@if($edit->cover!='')
|
||||
<div class="js-gallery">
|
||||
<a href="{{url('cache/large/'.$edit->cover)}}" class="img-link img-link-zoom-in img-thumb img-lightbox" target="_blank" >
|
||||
<img src="{{url('cache/small/'.$edit->cover)}}" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
<hr />
|
||||
@else
|
||||
<i class="fa fa-image" style=" display: block;
|
||||
font-size: 150px;
|
||||
color: #f3f3f3;"></i>
|
||||
@endif
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-secondary btn-sm" onclick="$('#c{{$edit->id}}').trigger('click');" title="{{__('Resim Yükle')}}"><i class="fa fa-upload"></i> {{__('Kapak Resmi Yükle')}}</button>
|
||||
@if($edit->cover!='')
|
||||
<a teyit="{{__('Resmi kaldırmak istediğinizden emin misiniz')}}" title="{{__('Resmi kaldır')}}" href="{{url('admin-ajax/cover-delete?id='.$edit->id)}}" class="btn btn-secondary btn-sm "><i class="fa fa-times"></i></a>
|
||||
<a title="{{__('Resmi indir')}}" href="{{url('cache/download/'.$edit->cover)}}" class="btn btn-secondary btn-sm"><i class="fa fa-download"></i></a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
<div class="">
|
||||
<button type="submit" class="save-button btn btn-primary">{{__('Save Changes')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form action="{{url('admin-ajax/files-upload')}}" id="files{{$edit->id}}" class="dropzone d-none" id="dropzone" enctype="multipart/form-data" method="post">
|
||||
<div class="fallback">
|
||||
<input name="file" type="file" multiple />
|
||||
|
||||
</div>
|
||||
@if($edit->files!="")
|
||||
@php
|
||||
$files = explode(",",$edit->files);
|
||||
@endphp
|
||||
@foreach(@$files AS $f)
|
||||
<?php $file_title = str_replace("storage/app/files/".$edit->slug . "/","",$f); ?>
|
||||
<div file="{{$f}}" class="dz-preview dz-file-preview dz-processing dz-error dz-complete">
|
||||
<div class="dz-image"><img data-dz-thumbnail="" onerror='$(this).hide();' src="{{url($f)}}" width="100%"></div> <div class="dz-details">
|
||||
<div class="dz-filename"><span data-dz-name="">{{$file_title}}</span></div> </div>
|
||||
<div class="dz-success-mark">
|
||||
<svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<title>Check</title>
|
||||
<defs></defs> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path> </g> </svg> </div>
|
||||
<div class="btn-group">
|
||||
<div class="btn btn-default delete"><i class="fa fa-times"></i></div>
|
||||
<a href="{{url($f)}}" target="_blank" class="btn btn-default "><i class="fa fa-download"></i></a>
|
||||
<?php if(strpos($f,".fbx")!==false) {
|
||||
?>
|
||||
<a href="{{url("three-js?file=".$f)}}" target="_blank" class="btn btn-default " title="{{e2("3D Önizleme")}}"><i class="fa fa-box"></i></a>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endif
|
||||
<div class="dz-message" data-dz-message><span>{{__('You can upload files of the content by dropping or clicking here')}}</span></div>
|
||||
<input type="hidden" name="id" value="{{$edit->id}}" />
|
||||
<input type="hidden" name="slug" value="{{$edit->slug}}" />
|
||||
{{csrf_field()}}
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$(".dz-preview .delete").on("click",function(){
|
||||
var bu = $(this).parent().parent();
|
||||
bu.fadeTo(0.5);
|
||||
$.post("{{url('admin-ajax/delete-file')}}",{
|
||||
file:bu.attr("file"),
|
||||
slug : "{{$edit->slug}}",
|
||||
id : "{{$edit->id}}",
|
||||
_token : "{{csrf_token()}}"
|
||||
},function(d){
|
||||
bu.fadeOut();
|
||||
});
|
||||
$(".dz-message").html("")
|
||||
|
||||
}).css("cursor","pointer");
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
{{_col()}}
|
||||
@@ -0,0 +1,386 @@
|
||||
<?php
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Html;
|
||||
use Mpdf\Mpdf;
|
||||
|
||||
|
||||
$templatePath = "storage/documents/";
|
||||
$filePath = "$templatePath/$templateName";
|
||||
|
||||
preg_match('/\.(\w+)$/', $filePath, $extensions);
|
||||
|
||||
$storagePath = "storage/documents/$outputFilePath";
|
||||
if (!is_dir($storagePath)) {
|
||||
mkdir($storagePath, 0777, true);
|
||||
}
|
||||
|
||||
$isExcel = true;
|
||||
/*
|
||||
if($extensions[1] == "docx")
|
||||
{
|
||||
$isExcel = false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if(getisset("save")) {
|
||||
$post = $_POST;
|
||||
unset($post['_token']);
|
||||
unset($post['document_id']);
|
||||
unset($post['html']);
|
||||
|
||||
$replacements = $post;
|
||||
$pageNumber = @$post['page'];
|
||||
unset($post['page']);
|
||||
|
||||
unset($post['custom']);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$formTypes = ['date', 'time', 'text', 'textarea', 'radio', 'checkbox', 'select'];
|
||||
|
||||
if($isExcel)
|
||||
{
|
||||
$spreadsheet = IOFactory::load($filePath);
|
||||
|
||||
$sheet = $spreadsheet->getActiveSheet();
|
||||
// Tüm hücreleri döngüyle gezerek joker alanları değiştir
|
||||
foreach ($sheet->getRowIterator() as $row) {
|
||||
foreach ($row->getCellIterator() as $cell) {
|
||||
$cellValue = $cell->getValue();
|
||||
if (is_string($cellValue)) {
|
||||
foreach ($replacements as $search => $replace) {
|
||||
if (strpos($cellValue, $search) !== false) {
|
||||
foreach($formTypes AS $formType)
|
||||
{
|
||||
|
||||
$isValidDate = false;
|
||||
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $replace)) {
|
||||
// YYYY-MM-DD formatında tarih
|
||||
$isValidDate = true;
|
||||
} elseif (preg_match('/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/', $replace)) {
|
||||
// YYYY-MM-DD HH:MM:SS formatında tarih ve saat
|
||||
$isValidDate = true;
|
||||
} elseif (preg_match('/^\d{2}.\d{2}.\d{4}$/', $replace)) {
|
||||
// DD.MM.YYYY formatında tarih
|
||||
$isValidDate = true;
|
||||
} elseif (preg_match('/^\d{2}.\d{2}.\d{4} \d{2}:\d{2}:\d{2}$/', $replace)) {
|
||||
// DD.MM.YYYY HH:MM:SS formatında tarih ve saat
|
||||
$isValidDate = true;
|
||||
}
|
||||
|
||||
if($isValidDate)
|
||||
{
|
||||
if (strtotime($replace)) {
|
||||
$dateTime = new DateTime($replace);
|
||||
|
||||
// Eğer $replace saati de içeriyorsa
|
||||
if ($dateTime->format('H:i:s') !== '00:00:00') {
|
||||
$replace = $dateTime->format('H:i');
|
||||
} else {
|
||||
$replace = $dateTime->format('d.m.Y');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(in_array($formType, ['radio', 'checkbox']))
|
||||
{
|
||||
|
||||
|
||||
$replacePlaceHolder ='{' . $formType . '.' . $search . '.' . $replace . '}';
|
||||
$okValue = '✓';
|
||||
$cellValue = str_replace($replacePlaceHolder, $okValue, $cellValue);
|
||||
$cell->setValue($cellValue);
|
||||
|
||||
$otherPattern = "/\{$formType\.$search\.[^}]*\}/";
|
||||
$cellValue = preg_replace($otherPattern, "", $cellValue);
|
||||
$cell->setValue($cellValue);
|
||||
|
||||
|
||||
} else {
|
||||
$replacePlaceHolder = '{' . $formType . '.' . $search . '}';
|
||||
|
||||
$cellValue = str_replace($replacePlaceHolder, $replace, $cellValue);
|
||||
$cellValue = str_replace("{page}", $pageNumber, $cellValue);
|
||||
$cell->setValue($cellValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mainContractor = db("subcontractors")->where("operation_type", "MAIN CONTRACTOR")->first();
|
||||
|
||||
if($mainContractor) {
|
||||
$cellValue = str_replace("{project_address}", $mainContractor->address_ru . " / " . $mainContractor->address_en, $cellValue);
|
||||
}
|
||||
$cellValue = str_replace("{project_name}", setting("project_name_ru") . " / " . setting("project_name"), $cellValue);
|
||||
$cell->setValue($cellValue);
|
||||
}
|
||||
}
|
||||
|
||||
$fileName = $outputFileName;
|
||||
|
||||
if(isset($post[$outputFileName]))
|
||||
{
|
||||
$fileName = $post[$outputFileName];
|
||||
}
|
||||
|
||||
$outputFilePath = "$storagePath/$fileName.xlsx";
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer->save($outputFilePath);
|
||||
|
||||
} else {
|
||||
$outputFilePath = "$storagePath/{$post[$outputFileName]}.docx";
|
||||
replacePlaceholdersInDocx($filePath, $outputFilePath, $replacements);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
xlsx_to_pdf($outputFilePath, $storagePath);
|
||||
$pdfPath = "$storagePath/{$post[$outputFileName]}.pdf";
|
||||
echo "File successfully saved at: $pdfPath <br>";
|
||||
|
||||
try {
|
||||
db($tableName)->updateOrInsert([
|
||||
$outputFileName => $post[$outputFileName]
|
||||
], $post);
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
dump($th->getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$fullPath = url($pdfPath);
|
||||
$outputFilePath = url($outputFilePath);
|
||||
echo "<a href='$fullPath' target='_blank' class='btn btn-primary'>Download PDF File</a>";
|
||||
echo "<a href='$outputFilePath' target='_blank' class='btn btn-success'>Download XLSX File</a>";
|
||||
|
||||
exit();
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
.creator-form {
|
||||
width: 320mm;
|
||||
display:block;
|
||||
margin:0 auto;
|
||||
}
|
||||
.creator-form td {
|
||||
border-width: 1px !important;
|
||||
padding:3px !important;
|
||||
}
|
||||
.form-control {
|
||||
min-width:100px !important;
|
||||
}
|
||||
.print-pdf input, .print-pdf select, .print-pdf textarea {
|
||||
background:none;
|
||||
border:none;
|
||||
|
||||
|
||||
}
|
||||
.print-pdf * {
|
||||
font-size:14px;
|
||||
font-family: sans-serif !important;
|
||||
}
|
||||
.print-pdf td {
|
||||
/* border:none !important;*/
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
}
|
||||
.print-pdf table {
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.print-pdf {
|
||||
/* Sayfa boyutu için A4 standardı */
|
||||
margin: 0 auto; /* Ortalamak için */
|
||||
padding: 20mm; /* İçerik için kenar boşluğu */
|
||||
box-sizing: border-box;
|
||||
|
||||
/* Arka plan ve renk düzeni */
|
||||
background: white;
|
||||
color: #000;
|
||||
font-family: Arial, Helvetica, sans-serif; /* PDF için yaygın kullanılan fontlar */
|
||||
font-size: 14pt; /* Standart font boyutu */
|
||||
line-height: 1.5; /* Okunaklılık için satır yüksekliği */
|
||||
}
|
||||
|
||||
.print-pdf h1,
|
||||
.print-pdf h2,
|
||||
.print-pdf h3,
|
||||
.print-pdf h4,
|
||||
.print-pdf h5,
|
||||
.print-pdf h6 {
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.print-pdf p {
|
||||
margin: 0 0 10px;
|
||||
text-align: justify; /* Yazıyı PDF'deki gibi hizalamak için */
|
||||
}
|
||||
|
||||
.print-pdf table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
|
||||
.print-pdf ul,
|
||||
.print-pdf ol {
|
||||
margin: 10px 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.print-pdf ul li,
|
||||
.print-pdf ol li {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.print-pdf td img {
|
||||
width: 85%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Sayfa kırılması */
|
||||
@media print {
|
||||
.print-pdf {
|
||||
page-break-after: always;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
|
||||
<?php
|
||||
if($isExcel)
|
||||
{
|
||||
$htmlPath = xlsx_to_html("$templatePath/$templateName", "storage/documents/Excel Form Templates/html");
|
||||
|
||||
} else {
|
||||
$htmlPath = docx_to_html("$templatePath/$templateName", "storage/documents/Excel Form Templates/html");
|
||||
}
|
||||
$htmlContent = file_get_contents($htmlPath);
|
||||
$htmlContent = preg_replace('/<style\b[^>]*>(.*?)<\/style>/is', '', $htmlContent);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$formHtml = replacePlaceholdersWithInputs($htmlContent, $relationDatas);
|
||||
?>
|
||||
{{col("col-12", $title)}}
|
||||
|
||||
<form action="?save<?php if(getisset("type")) echo "&type=" . get("type"); ?>" method="post" class="creator-form">
|
||||
<input type="hidden" name="document_id" value="{{$templateInfo->slug}}">
|
||||
@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='{{$numberColumn}}']").on("blur", function() {
|
||||
$.getJSON('{{row_detail_url($tableName, $numberColumn)}}?value=' + $(this).val(), function(data) {
|
||||
// Form alanlarına JSON verilerini yaz
|
||||
$.each(data, function(key, value) {
|
||||
var $input = $('[name="' + key + '"]');
|
||||
if($input.is(':checkbox') || $input.is(':radio')) {
|
||||
$('[name="' + key + '"][value="' + value + '"]').prop('checked', true);
|
||||
} else {
|
||||
$input.val(value);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(".print-pdf table").addClass("table");
|
||||
// $(".print-pdf table").addClass("table-bordered");
|
||||
|
||||
$('#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 = "";
|
||||
}
|
||||
}
|
||||
|
||||
console.log(element);
|
||||
console.log(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');
|
||||
|
||||
updateSuccess();
|
||||
/*
|
||||
|
||||
*/
|
||||
// location.reload();
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
// Hata işlemleri
|
||||
console.log('Form gönderme hatası', textStatus, errorThrown);
|
||||
Swal.fire('Error', errorThrown, 'error');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
{{_col()}}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#dataGridManageCalc").dxDataGrid({
|
||||
dataSource: "{{url("admin-ajax/ndt-calculation?iso_number=" . get("iso_number"))}}",
|
||||
/*
|
||||
export: {
|
||||
enabled: false,
|
||||
formats: ['xlsx'],
|
||||
},
|
||||
*/
|
||||
|
||||
|
||||
showBorders: true,
|
||||
allowColumnResizing: false,
|
||||
columnAutoWidth: true,
|
||||
allowColumnReordering: true,
|
||||
showColumnLines: true,
|
||||
columnFixing: {
|
||||
enabled: true
|
||||
},
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div class="dx-viewport">
|
||||
<div id="dataGridManageCalc"></div>
|
||||
</div>
|
||||
<style>
|
||||
#dataGridManageCalc td {
|
||||
padding:3px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,446 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$title = "NDT Calculation";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
var cellColors = [
|
||||
'#ccc1c0',
|
||||
'#f2eabb',
|
||||
'#ccf2bb',
|
||||
'#bbf2cd',
|
||||
'#bbeff2',
|
||||
'#d9dafa',
|
||||
'#e7bbf2',
|
||||
'#f2bbbc',
|
||||
'#f2d8bb',
|
||||
'#d7f2bb',
|
||||
'#9cd6d0',
|
||||
'#d6c59c',
|
||||
'#b39cd6',
|
||||
'#bf9cd6',
|
||||
'#f7c6c6',
|
||||
'#d69cbe',
|
||||
'#d6c59c',
|
||||
'#a1e6e2',
|
||||
'#e2dd8f',
|
||||
'#8fe2dd',
|
||||
'#8fa0e2',
|
||||
'#e28f9c',
|
||||
'#e28fc5',
|
||||
'#9c8fe2',
|
||||
'#e28fa3',
|
||||
'#a3e28f',
|
||||
'#e2c98f',
|
||||
'#8fe2c9',
|
||||
'#c98fe2',
|
||||
'#e28fa6',
|
||||
'#a6e28f',
|
||||
'#8fe2a8',
|
||||
'#a8e28f',
|
||||
'#e28fb9',
|
||||
'#b9e28f',
|
||||
'#8fabe2',
|
||||
'#abe28f',
|
||||
'#8fdbe2',
|
||||
'#dbe28f',
|
||||
'#a4e28f',
|
||||
'#8fe2a4',
|
||||
'#e28fa4'
|
||||
];
|
||||
$.getJSON("{{url("admin-ajax/ndt-calculation?type=test_packs")}}")
|
||||
.then(function(data) {
|
||||
var ndtCalculation = $("#ndtCalculationTP").dxDataGrid({
|
||||
onToolbarPreparing: function(e) {
|
||||
e.toolbarOptions.items.unshift({
|
||||
location: "before",
|
||||
widget: "dxButton",
|
||||
options: {
|
||||
icon: "filter",
|
||||
text: "CLEAR FILTER",
|
||||
hint: "Clear Filters",
|
||||
onClick: function() {
|
||||
e.component.clearFilter();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
selection: {
|
||||
mode: 'single',
|
||||
},
|
||||
onRowClick: function(e) {
|
||||
if(e.rowType === "data") {
|
||||
var tp = e.data.test_package_no;
|
||||
try {
|
||||
$("#ndtCalculationTPISO").dxDataGrid("instance").filter(["test_package_no", "=", tp]);
|
||||
// DevExpress.ui.notify("Filtre Uygulandı: " + tp, "success", 1000);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
},
|
||||
dataSource: data.tp_base,
|
||||
filterRow: { visible: true },
|
||||
searchPanel: { visible: true },
|
||||
headerFilter: { visible: true },
|
||||
@include("components.table.datagrid.partials.js-excel")
|
||||
summary: {
|
||||
groupItems: [{
|
||||
summaryType: "count"
|
||||
}]
|
||||
},
|
||||
selection: {
|
||||
mode: 'single',
|
||||
},
|
||||
paging: {
|
||||
pageSize: 20,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
caption: "General Info",
|
||||
columns: [
|
||||
"test_package_no",
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
caption: "Backlog Info",
|
||||
columns: [
|
||||
{
|
||||
caption: "VT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("VT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "vt", caption: "Backlog" },
|
||||
// { dataField: "vt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "RT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-info text-center");
|
||||
container.html("RT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "rt", caption: "Backlog" },
|
||||
// { dataField: "rt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "UT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-warning text-center");
|
||||
container.html("UT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ut", caption: "Backlog" },
|
||||
// { dataField: "ut_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-danger text-center");
|
||||
container.html("PT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pt", caption: "Backlog" },
|
||||
// { dataField: "pt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "MT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-primary text-center");
|
||||
container.html("MT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "mt", caption: "Backlog" },
|
||||
// { dataField: "mt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "HT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-secondary text-center");
|
||||
container.html("HT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ht", caption: "Backlog" },
|
||||
// { dataField: "ht_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PMI Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-light text-center");
|
||||
container.html("PMI Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pmi", caption: "Backlog" },
|
||||
// { dataField: "pmi_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Ferrite Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-dark text-center");
|
||||
container.html("Ferrite Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ferrite", caption: "Backlog" },
|
||||
// { dataField: "ferrite_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PWHT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("PWHT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pwht", caption: "Backlog" },
|
||||
// { dataField: "pwht_rq", caption: "RQ" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
],
|
||||
showBorders: true,
|
||||
allowColumnResizing: true,
|
||||
columnAutoWidth: true,
|
||||
allowColumnReordering: true,
|
||||
showColumnLines: true,
|
||||
columnFixing: {
|
||||
enabled: true
|
||||
},
|
||||
onCellPrepared: function(e) {
|
||||
if(e.rowType === 'header') {
|
||||
/*
|
||||
e.cellElement.css("backgroundColor", cellColors[e.columnIndex]);
|
||||
e.cellElement.css("text-align", "center");
|
||||
e.cellElement.css("border", "solid 1px #a1a1a1");
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
groupPanel: { visible: true },
|
||||
});
|
||||
|
||||
var ndtCalculation = $("#ndtCalculationTPISO").dxDataGrid({
|
||||
onToolbarPreparing: function(e) {
|
||||
e.toolbarOptions.items.unshift({
|
||||
location: "before",
|
||||
widget: "dxButton",
|
||||
options: {
|
||||
icon: "filter",
|
||||
text: "CLEAR FILTER",
|
||||
hint: "Clear Filters",
|
||||
onClick: function() {
|
||||
e.component.clearFilter();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
selection: {
|
||||
mode: 'single',
|
||||
},
|
||||
onRowClick: function(e) {
|
||||
if(e.rowType === "data") {
|
||||
var tp = e.data.test_package_no;
|
||||
try {
|
||||
$("#ndtCalculationTP").dxDataGrid("instance").filter(["test_package_no", "=", tp]);
|
||||
// DevExpress.ui.notify("Filtre Uygulandı: " + tp, "success", 1000);
|
||||
} catch(err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
},
|
||||
dataSource: data.tp_base_iso,
|
||||
filterRow: { visible: true },
|
||||
searchPanel: { visible: true },
|
||||
headerFilter: { visible: true },
|
||||
@include("components.table.datagrid.partials.js-excel")
|
||||
summary: {
|
||||
groupItems: [{
|
||||
summaryType: "count"
|
||||
}]
|
||||
},
|
||||
paging: {
|
||||
pageSize: 20,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
caption: "General Info",
|
||||
columns: [
|
||||
"test_package_no",
|
||||
"iso_number",
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
caption: "Backlog Info",
|
||||
columns: [
|
||||
{
|
||||
caption: "VT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("VT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "vt", caption: "Backlog" },
|
||||
// { dataField: "vt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "RT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-info text-center");
|
||||
container.html("RT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "rt", caption: "Backlog" },
|
||||
// { dataField: "rt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "UT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-warning text-center");
|
||||
container.html("UT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ut", caption: "Backlog" },
|
||||
// { dataField: "ut_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-danger text-center");
|
||||
container.html("PT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pt", caption: "Backlog" },
|
||||
// { dataField: "pt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "MT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-primary text-center");
|
||||
container.html("MT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "mt", caption: "Backlog" },
|
||||
// { dataField: "mt_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "HT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-secondary text-center");
|
||||
container.html("HT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ht", caption: "Backlog" },
|
||||
// { dataField: "ht_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PMI Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-light text-center");
|
||||
container.html("PMI Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pmi", caption: "Backlog" },
|
||||
// { dataField: "pmi_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Ferrite Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-dark text-center");
|
||||
container.html("Ferrite Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ferrite", caption: "Backlog" },
|
||||
// { dataField: "ferrite_rq", caption: "RQ" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PWHT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("PWHT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pwht", caption: "Backlog" },
|
||||
// { dataField: "pwht_rq", caption: "RQ" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
],
|
||||
showBorders: true,
|
||||
allowColumnResizing: true,
|
||||
columnAutoWidth: true,
|
||||
allowColumnReordering: true,
|
||||
showColumnLines: true,
|
||||
columnFixing: {
|
||||
enabled: true
|
||||
},
|
||||
onCellPrepared: function(e) {
|
||||
if(e.rowType === 'header') {
|
||||
/*
|
||||
e.cellElement.css("backgroundColor", cellColors[e.columnIndex]);
|
||||
e.cellElement.css("text-align", "center");
|
||||
e.cellElement.css("border", "solid 1px #a1a1a1");
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
groupPanel: { visible: true },
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function editorPreparing(e, dataRow) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
{{col("col-12","Test Package Base")}}
|
||||
<div id="ndtCalculationTP"></div>
|
||||
{{_col()}}
|
||||
{{col("col-12","Test Package ISO Base")}}
|
||||
<div id="ndtCalculationTPISO"></div>
|
||||
{{_col()}}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
$title = "NDT Calculation";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
var cellColors = [
|
||||
'#ccc1c0',
|
||||
'#f2eabb',
|
||||
'#ccf2bb',
|
||||
'#bbf2cd',
|
||||
'#bbeff2',
|
||||
'#d9dafa',
|
||||
'#e7bbf2',
|
||||
'#f2bbbc',
|
||||
'#f2d8bb',
|
||||
'#d7f2bb',
|
||||
'#9cd6d0',
|
||||
'#d6c59c',
|
||||
'#b39cd6',
|
||||
'#bf9cd6',
|
||||
'#f7c6c6',
|
||||
'#d69cbe',
|
||||
'#d6c59c',
|
||||
'#a1e6e2',
|
||||
'#e2dd8f',
|
||||
'#8fe2dd',
|
||||
'#8fa0e2',
|
||||
'#e28f9c',
|
||||
'#e28fc5',
|
||||
'#9c8fe2',
|
||||
'#e28fa3',
|
||||
'#a3e28f',
|
||||
'#e2c98f',
|
||||
'#8fe2c9',
|
||||
'#c98fe2',
|
||||
'#e28fa6',
|
||||
'#a6e28f',
|
||||
'#8fe2a8',
|
||||
'#a8e28f',
|
||||
'#e28fb9',
|
||||
'#b9e28f',
|
||||
'#8fabe2',
|
||||
'#abe28f',
|
||||
'#8fdbe2',
|
||||
'#dbe28f',
|
||||
'#a4e28f',
|
||||
'#8fe2a4',
|
||||
'#e28fa4'
|
||||
];
|
||||
var ndtCalculation = $("#ndtCalculation").dxDataGrid({
|
||||
dataSource: "?ajax=ndt-calculation",
|
||||
filterRow: { visible: true },
|
||||
searchPanel: { visible: true },
|
||||
headerFilter: { visible: true },
|
||||
@include("components.table.datagrid.partials.js-excel")
|
||||
summary: {
|
||||
groupItems: [{
|
||||
summaryType: "count"
|
||||
}]
|
||||
},
|
||||
paging: {
|
||||
pageSize: 20,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
caption: "General Info",
|
||||
columns: [
|
||||
"welder",
|
||||
"project",
|
||||
"design_area",
|
||||
"iso_number",
|
||||
"line_number",
|
||||
"weld_name",
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Scope Info",
|
||||
columns: [
|
||||
"vt_scope",
|
||||
"rt_scope",
|
||||
"ut_scope",
|
||||
"pt_scope",
|
||||
"mt_scope",
|
||||
"pmi_scope",
|
||||
"pwht",
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Backlog Info",
|
||||
columns: [
|
||||
{
|
||||
caption: "VT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("VT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "vt_backlog", caption: "Backlog" },
|
||||
{ dataField: "vt_rq", caption: "RQ" },
|
||||
{ dataField: "vt_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "RT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-info text-center");
|
||||
container.html("RT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "rt_backlog", caption: "Backlog" },
|
||||
{ dataField: "rt_rq", caption: "RQ" },
|
||||
{ dataField: "rt_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "UT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-warning text-center");
|
||||
container.html("UT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ut_backlog", caption: "Backlog" },
|
||||
{ dataField: "ut_rq", caption: "RQ" },
|
||||
{ dataField: "ut_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-danger text-center");
|
||||
container.html("PT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pt_backlog", caption: "Backlog" },
|
||||
{ dataField: "pt_rq", caption: "RQ" },
|
||||
{ dataField: "pt_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "MT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-primary text-center");
|
||||
container.html("MT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "mt_backlog", caption: "Backlog" },
|
||||
{ dataField: "mt_rq", caption: "RQ" },
|
||||
{ dataField: "mt_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "HT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-secondary text-center");
|
||||
container.html("HT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ht_backlog", caption: "Backlog" },
|
||||
{ dataField: "ht_rq", caption: "RQ" },
|
||||
{ dataField: "ht_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PMI Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-light text-center");
|
||||
container.html("PMI Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pmi_backlog", caption: "Backlog" },
|
||||
{ dataField: "pmi_rq", caption: "RQ" },
|
||||
{ dataField: "pmi_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Ferrite Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-dark text-center");
|
||||
container.html("Ferrite Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "ferrite_backlog", caption: "Backlog" },
|
||||
{ dataField: "ferrite_rq", caption: "RQ" },
|
||||
{ dataField: "ferrite_balance", caption: "Balance" }
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "PWHT Laboratory",
|
||||
headerCellTemplate: function(container) {
|
||||
container.parent().addClass("table-success text-center");
|
||||
container.html("PWHT Laboratory");
|
||||
},
|
||||
columns: [
|
||||
{ dataField: "pwht_backlog", caption: "Backlog" },
|
||||
{ dataField: "pwht_rq", caption: "RQ" },
|
||||
{ dataField: "pwht_balance", caption: "Balance" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
caption: "Summary",
|
||||
columns: [
|
||||
"remaining_repair",
|
||||
"grand_total",
|
||||
"joints_total",
|
||||
"total_without_rej_cut",
|
||||
"total_acc",
|
||||
"total_by_weld",
|
||||
|
||||
]
|
||||
},
|
||||
],
|
||||
showBorders: true,
|
||||
allowColumnResizing: true,
|
||||
columnAutoWidth: true,
|
||||
allowColumnReordering: true,
|
||||
showColumnLines: true,
|
||||
columnFixing: {
|
||||
enabled: true
|
||||
},
|
||||
selection: {
|
||||
mode: 'single',
|
||||
},
|
||||
onCellPrepared: function(e) {
|
||||
if(e.rowType === 'header') {
|
||||
/*
|
||||
e.cellElement.css("backgroundColor", cellColors[e.columnIndex]);
|
||||
e.cellElement.css("text-align", "center");
|
||||
e.cellElement.css("border", "solid 1px #a1a1a1");
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
onToolbarPreparing: function(e) {
|
||||
e.toolbarOptions.items.unshift({
|
||||
location: "before",
|
||||
widget: "dxButton",
|
||||
options: {
|
||||
icon: "filter",
|
||||
text: "{{e2("Clear Filter")}}",
|
||||
onClick: function() {
|
||||
e.component.clearFilter();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onRowClick: function(e) {
|
||||
if(e.rowType === "data") {
|
||||
$("#ndtCalculationTPISO").dxDataGrid("instance").filter(["iso_number", "=", e.data.iso_number]);
|
||||
}
|
||||
},
|
||||
groupPanel: { visible: true },
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function editorPreparing(e, dataRow) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<div class="dx-viewport">
|
||||
<div id="ndtCalculation"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,514 @@
|
||||
{{-- Register Item Detail Handlers - JavaScript Functions for Managing Dynamic Items --}}
|
||||
|
||||
<script>
|
||||
/**
|
||||
* Register Item Detail API Functions
|
||||
*
|
||||
* These functions handle CRUD operations for dynamic document items in Register Creator.
|
||||
* Only users with write permission can access these endpoints.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Check write permission once
|
||||
@if(isAuth($id, "write"))
|
||||
window.hasRegisterWritePermission = true;
|
||||
@else
|
||||
window.hasRegisterWritePermission = false;
|
||||
@endif
|
||||
|
||||
/**
|
||||
* Attach event handlers for dynamic item edit/delete buttons
|
||||
*/
|
||||
window.attachDynamicItemHandlers = function() {
|
||||
// Remove existing handlers to prevent duplicates
|
||||
$(document).off('click', '.edit-dynamic-item');
|
||||
$(document).off('click', '.delete-dynamic-item');
|
||||
|
||||
// Edit button handler
|
||||
$(document).on('click', '.edit-dynamic-item', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const itemId = $(this).data('item-id');
|
||||
const itemName = $(this).data('item-name');
|
||||
|
||||
console.log('Edit button clicked for item:', itemId, itemName);
|
||||
showEditDynamicItemModal(itemId);
|
||||
});
|
||||
|
||||
// Delete button handler
|
||||
$(document).on('click', '.delete-dynamic-item', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const itemId = $(this).data('item-id');
|
||||
const itemName = $(this).data('item-name');
|
||||
|
||||
console.log('Delete button clicked for item:', itemId, itemName);
|
||||
confirmDeleteDynamicItem(itemId, itemName);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* GET - Retrieve dynamic item details
|
||||
* @param {number} itemId - The ID of the dynamic item
|
||||
* @returns {Promise} Promise resolving to item data
|
||||
*/
|
||||
window.getDynamicItemDetail = function(itemId) {
|
||||
return $.ajax({
|
||||
url: '{{ url("/admin-ajax/register-item-detail") }}',
|
||||
type: 'GET',
|
||||
data: { item_id: itemId },
|
||||
dataType: 'json'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Ace Editor instance for Register Creator modal
|
||||
*/
|
||||
var rcEditSqlEditor = null;
|
||||
|
||||
/**
|
||||
* Show edit modal for dynamic item using Bootstrap modal
|
||||
*/
|
||||
window.showEditDynamicItemModal = async function(itemId) {
|
||||
console.log('Opening edit modal for item:', itemId);
|
||||
|
||||
// Show modal with loading state
|
||||
$('#editDynamicItemModalRegisterCreator').modal('show');
|
||||
$('#editDynamicItemFormRegisterCreator')[0].reset();
|
||||
$('#rc_edit_item_id').val(itemId);
|
||||
|
||||
// Show loading indicator
|
||||
Swal.fire({
|
||||
title: '{{e2("Loading...")}}',
|
||||
html: '{{e2("Please wait while we load the item data")}}',
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
// Get item details
|
||||
const response = await $.get('{{ url("/admin-ajax/register-item-detail") }}', { item_id: itemId });
|
||||
|
||||
Swal.close();
|
||||
|
||||
if (!response.success) {
|
||||
Swal.fire('{{e2("Error")}}', response.message, 'error');
|
||||
$('#editDynamicItemModalRegisterCreator').modal('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
const item = response.item;
|
||||
|
||||
// Fill form fields
|
||||
$('#rc_edit_name').val(item.name);
|
||||
$('#rc_edit_description').val(item.description);
|
||||
$('#rc_edit_icon').val(item.icon);
|
||||
$('#rc_edit_badge_text').val(item.badge_text);
|
||||
$('#rc_edit_color').val(item.color);
|
||||
$('#rc_edit_is_active').val(item.is_active);
|
||||
$('#rc_edit_search_folder').val(item.search_folder);
|
||||
$('#rc_edit_identifier_field').val(item.identifier_field);
|
||||
$('#rc_edit_date_field').val(item.date_field);
|
||||
$('#rc_edit_file_search_pattern').val(item.file_search_pattern);
|
||||
$('#rc_edit_title2_pattern').val(item.title2_pattern);
|
||||
$('#rc_edit_title4_pattern').val(item.title4_pattern);
|
||||
|
||||
// Initialize Ace Editor for SQL if not already initialized
|
||||
if (!rcEditSqlEditor) {
|
||||
rcEditSqlEditor = ace.edit("rc-edit-sql-editor-container");
|
||||
rcEditSqlEditor.session.setMode("ace/mode/mysql");
|
||||
rcEditSqlEditor.setTheme("ace/theme/terminal");
|
||||
rcEditSqlEditor.setOptions({
|
||||
enableBasicAutocompletion: true,
|
||||
enableLiveAutocompletion: true,
|
||||
enableSnippets: true
|
||||
});
|
||||
|
||||
// Sync with hidden textarea
|
||||
rcEditSqlEditor.session.on('change', function() {
|
||||
$('#rc_edit_sql_query').val(rcEditSqlEditor.getValue());
|
||||
// Regenerate test inputs when SQL changes
|
||||
generateRcEditTestInputs();
|
||||
});
|
||||
}
|
||||
|
||||
// Set SQL query in editor
|
||||
rcEditSqlEditor.setValue(item.sql_query || '', -1);
|
||||
$('#rc_edit_sql_query').val(item.sql_query);
|
||||
|
||||
// Generate test inputs for register creator edit modal
|
||||
generateRcEditTestInputs();
|
||||
|
||||
} catch (error) {
|
||||
Swal.close();
|
||||
console.error('Failed to load item data:', error);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '{{e2("Error")}}',
|
||||
text: '{{e2("Failed to load item data")}}: ' + error
|
||||
});
|
||||
$('#editDynamicItemModalRegisterCreator').modal('hide');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Confirm and delete dynamic item
|
||||
*/
|
||||
window.confirmDeleteDynamicItem = async function(itemId, itemName) {
|
||||
const result = await Swal.fire({
|
||||
title: '{{e2("Are you sure?")}}',
|
||||
html: `{{e2("Do you want to deactivate the dynamic item")}}: <strong>${itemName}</strong>?<br><small>{{e2("This will set the item as inactive")}}</small>`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#d33',
|
||||
cancelButtonColor: '#3085d6',
|
||||
confirmButtonText: '{{e2("Yes, deactivate it")}}',
|
||||
cancelButtonText: '{{e2("Cancel")}}'
|
||||
});
|
||||
|
||||
if (result.isConfirmed) {
|
||||
// Show loading
|
||||
Swal.fire({
|
||||
title: '{{e2("Deactivating")}}...',
|
||||
text: '{{e2("Please wait")}}',
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("/admin-ajax/register-item-detail") }}',
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
_method: 'DELETE',
|
||||
item_id: itemId,
|
||||
_token: '{{csrf_token()}}'
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
Swal.fire('{{e2("Success")}}', response.message, 'success');
|
||||
// Reload dynamic items
|
||||
loadDynamicItems();
|
||||
} else {
|
||||
Swal.fire('{{e2("Error")}}', response.message, 'error');
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('Delete failed:', xhr.responseText);
|
||||
Swal.fire('{{e2("Error")}}', '{{e2("Delete failed")}}', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// Save button handler for Register Creator modal
|
||||
$('#rcSaveDynamicItemBtn').on('click', function() {
|
||||
const $btn = $(this);
|
||||
const originalBtnText = $btn.html();
|
||||
|
||||
// Validate form
|
||||
const form = $('#editDynamicItemFormRegisterCreator')[0];
|
||||
if (!form.checkValidity()) {
|
||||
form.reportValidity();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get form data
|
||||
const formData = {
|
||||
item_id: $('#rc_edit_item_id').val(),
|
||||
name: $('#rc_edit_name').val(),
|
||||
description: $('#rc_edit_description').val(),
|
||||
icon: $('#rc_edit_icon').val(),
|
||||
badge_text: $('#rc_edit_badge_text').val(),
|
||||
color: $('#rc_edit_color').val(),
|
||||
is_active: $('#rc_edit_is_active').val(),
|
||||
search_folder: $('#rc_edit_search_folder').val(),
|
||||
sql_query: rcEditSqlEditor ? rcEditSqlEditor.getValue() : $('#rc_edit_sql_query').val(),
|
||||
identifier_field: $('#rc_edit_identifier_field').val(),
|
||||
date_field: $('#rc_edit_date_field').val(),
|
||||
file_search_pattern: $('#rc_edit_file_search_pattern').val(),
|
||||
title2_pattern: $('#rc_edit_title2_pattern').val(),
|
||||
title4_pattern: $('#rc_edit_title4_pattern').val(),
|
||||
_token: '{{csrf_token()}}'
|
||||
};
|
||||
|
||||
// Show loading
|
||||
$btn.html('<i class="fa fa-spinner fa-spin"></i> {{e2("Saving...")}}').prop('disabled', true);
|
||||
|
||||
// Send AJAX request
|
||||
$.ajax({
|
||||
url: '{{ url("/admin-ajax/register-item-detail") }}',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
// Show success message
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '{{e2("Success")}}',
|
||||
text: '{{e2("Dynamic item updated successfully")}}',
|
||||
timer: 2000,
|
||||
showConfirmButton: false
|
||||
});
|
||||
|
||||
// Close modal
|
||||
$('#editDynamicItemModalRegisterCreator').modal('hide');
|
||||
|
||||
// Reload dynamic items
|
||||
if (typeof loadDynamicItems === 'function') {
|
||||
loadDynamicItems();
|
||||
}
|
||||
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '{{e2("Error")}}',
|
||||
text: response.message || '{{e2("Failed to update item")}}'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error('AJAX Error:', {xhr, status, error});
|
||||
|
||||
try {
|
||||
const response = JSON.parse(xhr.responseText);
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '{{e2("Error")}}',
|
||||
html: '<strong>{{e2("Message")}}:</strong> ' + response.message +
|
||||
(response.error_details ? '<br><br><small>' + JSON.stringify(response.error_details) + '</small>' : '')
|
||||
});
|
||||
} catch (e) {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '{{e2("Error")}}',
|
||||
text: '{{e2("Failed to update item")}}: ' + error
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$btn.html(originalBtnText).prop('disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Clean up editor when modal is hidden
|
||||
$('#editDynamicItemModalRegisterCreator').on('hidden.bs.modal', function () {
|
||||
if (rcEditSqlEditor) {
|
||||
rcEditSqlEditor.setValue('', -1);
|
||||
}
|
||||
$('#editDynamicItemFormRegisterCreator')[0].reset();
|
||||
$('#rcEditTestInputsContainer').empty();
|
||||
$('#rcEditTestResults').hide().empty();
|
||||
});
|
||||
|
||||
// ===============================
|
||||
// REGISTER CREATOR EDIT MODAL TEST FUNCTIONS
|
||||
// ===============================
|
||||
|
||||
// Function to generate test inputs for RC edit modal
|
||||
window.generateRcEditTestInputs = function() {
|
||||
if (!rcEditSqlEditor) return;
|
||||
|
||||
const sqlQuery = rcEditSqlEditor.getValue();
|
||||
const placeholderMatches = sqlQuery.match(/:(\w+)/g);
|
||||
const container = $('#rcEditTestInputsContainer');
|
||||
|
||||
if (!placeholderMatches || placeholderMatches.length === 0) {
|
||||
container.html('<div class="alert alert-info"><i class="fa fa-info-circle"></i> {{e2("No placeholders found in SQL query")}}</div>');
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove duplicates and sort
|
||||
const uniquePlaceholders = [...new Set(placeholderMatches.map(p => p.substring(1)))].sort();
|
||||
|
||||
let html = '<div class="row">';
|
||||
|
||||
uniquePlaceholders.forEach(function(placeholder, index) {
|
||||
const colClass = uniquePlaceholders.length <= 3 ? 'col-md-4' :
|
||||
uniquePlaceholders.length <= 6 ? 'col-md-6' : 'col-md-4';
|
||||
|
||||
// Get saved value from localStorage
|
||||
const savedValue = localStorage.getItem('rc_edit_test_' + placeholder) || '';
|
||||
|
||||
html += `
|
||||
<div class="${colClass}">
|
||||
<label><small>Test ${placeholder}</small></label>
|
||||
<input type="text" id="rc_edit_test_${placeholder}" class="form-control form-control-sm rc-edit-test-input"
|
||||
placeholder="${placeholder}" value="${savedValue}">
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
|
||||
html += '</div>';
|
||||
|
||||
// Add placeholder info
|
||||
html += `
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
{{e2("Found")}} ${uniquePlaceholders.length} {{e2("placeholder(s)")}}:
|
||||
${uniquePlaceholders.map(p => '<code>:' + p + '</code>').join(', ')}
|
||||
</small>
|
||||
</div>
|
||||
`;
|
||||
|
||||
container.html(html);
|
||||
|
||||
// Add event listeners to save values
|
||||
$('.rc-edit-test-input').on('input', function() {
|
||||
const fieldName = $(this).attr('id').replace('rc_edit_test_', '');
|
||||
localStorage.setItem('rc_edit_test_' + fieldName, $(this).val());
|
||||
});
|
||||
};
|
||||
|
||||
// Remove validation error when user starts typing (RC edit modal)
|
||||
$(document).on('input', '.rc-edit-test-input', function() {
|
||||
$(this).removeClass('is-invalid');
|
||||
});
|
||||
|
||||
// RC Edit modal test configuration button
|
||||
$('#rcEditTestConfigBtn').on('click', function() {
|
||||
const btn = $(this);
|
||||
|
||||
// Clear previous validation
|
||||
$('.rc-edit-test-input').removeClass('is-invalid');
|
||||
|
||||
// Get SQL and find placeholders
|
||||
const sqlQuery = rcEditSqlEditor ? rcEditSqlEditor.getValue() : $('#rc_edit_sql_query').val();
|
||||
const placeholderMatches = sqlQuery.match(/:(\w+)/g);
|
||||
|
||||
if (placeholderMatches && placeholderMatches.length > 0) {
|
||||
// Remove duplicates
|
||||
const uniquePlaceholders = [...new Set(placeholderMatches.map(p => p.substring(1)))];
|
||||
|
||||
// Check if test inputs are filled
|
||||
let hasEmptyRequired = false;
|
||||
uniquePlaceholders.forEach(function(fieldName) {
|
||||
const $testInput = $('#rc_edit_test_' + fieldName);
|
||||
|
||||
if ($testInput.length > 0 && !$testInput.val()) {
|
||||
$testInput.addClass('is-invalid');
|
||||
hasEmptyRequired = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (hasEmptyRequired) {
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: '{{e2("Missing Test Values")}}',
|
||||
html: '{{e2("Please fill in all test input fields for the placeholders used in your SQL query")}}<br><br>' +
|
||||
'<strong>Required:</strong> ' + uniquePlaceholders.map(p => ':' + p).join(', '),
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
btn.html('<i class="fa fa-spinner fa-spin"></i> {{e2("Testing...")}}').prop('disabled', true);
|
||||
|
||||
const testData = {
|
||||
sql_query: sqlQuery,
|
||||
search_folder: $('#rc_edit_search_folder').val(),
|
||||
identifier_field: $('#rc_edit_identifier_field').val(),
|
||||
date_field: $('#rc_edit_date_field').val(),
|
||||
file_search_pattern: $('#rc_edit_file_search_pattern').val(),
|
||||
title4_pattern: $('#rc_edit_title4_pattern').val(),
|
||||
_token: '{{csrf_token()}}'
|
||||
};
|
||||
|
||||
// Add test values
|
||||
$('.rc-edit-test-input').each(function() {
|
||||
const fieldId = $(this).attr('id').replace('rc_edit_', ''); // Convert rc_edit_test_X to test_X
|
||||
const fieldValue = $(this).val();
|
||||
testData[fieldId] = fieldValue;
|
||||
});
|
||||
|
||||
$.post('{{ url("/admin-ajax/test-dynamic-document-item") }}', testData, function(response) {
|
||||
displayRcEditTestResults(response);
|
||||
}).fail(function(xhr) {
|
||||
displayRcEditTestResults({
|
||||
success: false,
|
||||
message: 'Request failed',
|
||||
error: xhr.responseText
|
||||
});
|
||||
}).always(function() {
|
||||
btn.html('<i class="fa fa-play"></i> {{e2("Run Test")}}').prop('disabled', false);
|
||||
});
|
||||
});
|
||||
|
||||
// Display test results for RC edit modal
|
||||
function displayRcEditTestResults(response) {
|
||||
const $results = $('#rcEditTestResults');
|
||||
$results.show();
|
||||
|
||||
try {
|
||||
response = typeof response === 'string' ? JSON.parse(response) : response;
|
||||
} catch (e) {
|
||||
console.error('Parse error:', e);
|
||||
}
|
||||
|
||||
if (response.success) {
|
||||
let html = `
|
||||
<div class="alert alert-success">
|
||||
<h6><i class="fa fa-check-circle"></i> {{e2("Test Successful")}}</h6>
|
||||
<p>{{e2("Found")}} ${response.record_count} {{e2("records")}} (${response.execution_time}ms)</p>
|
||||
${response.placeholders_replaced ? `<small><strong>Replaced placeholders:</strong> ${response.placeholders_replaced.map(p => ':' + p).join(', ')}</small>` : ''}
|
||||
</div>
|
||||
`;
|
||||
|
||||
if (response.preview && response.preview.length > 0) {
|
||||
html += '<div class="table-responsive"><table class="table table-sm table-bordered">';
|
||||
html += '<thead class="thead-light"><tr>';
|
||||
html += '<th>Identifier</th><th>Date</th><th>Row Title</th><th>Search Pattern</th><th>Files Found</th>';
|
||||
html += '</tr></thead><tbody>';
|
||||
|
||||
response.preview.forEach((item, index) => {
|
||||
const badgeClass = item.files_found > 0 ? 'success' : 'warning';
|
||||
html += `<tr>
|
||||
<td><code>${item.identifier}</code></td>
|
||||
<td>${item.date || '-'}</td>
|
||||
<td>${item.row_title}</td>
|
||||
<td><small>${item.search_pattern}</small></td>
|
||||
<td><span class="badge badge-${badgeClass}">${item.files_found}</span></td>
|
||||
</tr>`;
|
||||
});
|
||||
|
||||
html += '</tbody></table></div>';
|
||||
}
|
||||
|
||||
$results.html(html);
|
||||
} else {
|
||||
// Format error message with line breaks
|
||||
const errorMessage = response.message ? response.message.replace(/\n/g, '<br>') : 'Unknown error';
|
||||
|
||||
$results.html(`
|
||||
<div class="alert alert-danger">
|
||||
<h6><i class="fa fa-exclamation-triangle"></i> {{e2("Test Failed")}}</h6>
|
||||
<div style="white-space: pre-line;">${errorMessage}</div>
|
||||
${response.error ? '<hr><small><strong>Debug Info:</strong><br>' + response.error + '</small>' : ''}
|
||||
</div>
|
||||
`);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize handlers when document is ready
|
||||
$(document).ready(function() {
|
||||
if (window.hasRegisterWritePermission) {
|
||||
console.log('Register item detail handlers initialized with write permission');
|
||||
} else {
|
||||
console.log('Register item detail handlers: No write permission');
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
<?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>
|
||||
|
||||
@@ -0,0 +1,427 @@
|
||||
<?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>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<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>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,275 @@
|
||||
<?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")
|
||||
@@ -0,0 +1,472 @@
|
||||
<?php
|
||||
|
||||
use App\Translate;
|
||||
|
||||
$title = "Languages";
|
||||
$tableWidth="100%";
|
||||
$path = "admin.type.languages";
|
||||
$listDatas = Translate::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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if(getisset("q")) {
|
||||
$q = "%" . get("q") . "%";
|
||||
$listDatas = $listDatas->orWhere("icerik", "like", $q);
|
||||
$listDatas = $listDatas->orWhere("ceviri", "like", $q);
|
||||
}
|
||||
|
||||
$listDatas = $listDatas->paginate(setting('row_count'));
|
||||
$tableName = "translate";
|
||||
|
||||
$relationDatas = [
|
||||
'dil' => [
|
||||
'values' => languages(),
|
||||
'type' => 'manuel-select'
|
||||
],
|
||||
];
|
||||
|
||||
?>
|
||||
<div class="content">
|
||||
<div class="row">
|
||||
{{col("col-12","")}}
|
||||
<?php if(getisset("store-content-start")) {
|
||||
$_SESSION['create-translate'] = "ok";
|
||||
bilgi("Store contents is started!");
|
||||
|
||||
}
|
||||
|
||||
if(getisset("store-content-stop")) {
|
||||
unset($_SESSION['create-translate']);
|
||||
bilgi("Store contents is stopped!");
|
||||
}
|
||||
|
||||
if(getisset("refresh-cache")) {
|
||||
$languages = languages();
|
||||
|
||||
foreach($languages AS $language) {
|
||||
$sorgu = db("translate")->where("dil", $language)->get();
|
||||
$dizi = [];
|
||||
foreach($sorgu AS $s) {
|
||||
$dizi[$s->icerik] = $s->ceviri;
|
||||
}
|
||||
$content = json_encode_tr($dizi);
|
||||
@mkdir("resources/lang", 0755, true);
|
||||
file_put_contents("resources/lang/$language.json",$content);
|
||||
bilgi("$language.json has been created!");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<div class="btn-group mr-5" role="group" aria-label="First group">
|
||||
<a href="?refresh-cache" type="button" title="{{e2("Refresh Cache")}}" class="btn btn-outline-secondary">
|
||||
<i class="fa fa-database"></i> {{e2("Refresh JSON Cache")}}
|
||||
</a>
|
||||
<a href="?store-content-start" type="button" title="{{e2("Store Contents")}}" class="btn btn-outline-success">
|
||||
<i class="fa fa-database"></i> {{e2("Start Store Contents")}}
|
||||
</a>
|
||||
<a href="?store-content-stop" type="button" title="{{e2("Store Contents")}}" class="btn btn-outline-danger">
|
||||
<i class="fa fa-database"></i> {{e2("Stop Store Contents")}}
|
||||
</a>
|
||||
<button type="button" onclick="fullContentScanner()" title="{{e2("Scan all modules and discover translations")}}" class="btn btn-outline-info">
|
||||
<i class="fa fa-search-plus"></i> {{e2("Full Content Scanner")}}
|
||||
</button>
|
||||
</div>
|
||||
<form action="" method="get">
|
||||
<div class="input-group" data-toggle="buttons" role="group" aria-label="Second group">
|
||||
<input type="text" class="form-control" placeholder="{{e2("Search...")}}" name="q" id="">
|
||||
<div class="btn btn-outline-primary"><i class="fa fa-search"></i></div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
{{_col()}}
|
||||
@include("components.blocks.module-block")
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var rowStatusFilterAdded = false;
|
||||
var isTranslating = false;
|
||||
|
||||
function contentReady(e) {
|
||||
// Add toolbar dropdown only once
|
||||
if (rowStatusFilterAdded) return;
|
||||
rowStatusFilterAdded = true;
|
||||
|
||||
var grid = e.component;
|
||||
var toolbar = grid.getView('headerPanel')._toolbar;
|
||||
|
||||
if (toolbar) {
|
||||
// Add Row Status Filter
|
||||
toolbar.option('items').push({
|
||||
location: 'after',
|
||||
widget: 'dxSelectBox',
|
||||
options: {
|
||||
width: 180,
|
||||
items: [
|
||||
{ value: 'all', text: '{{e2("All Rows")}}', icon: 'fa fa-list' },
|
||||
{ value: 'empty', text: '{{e2("Empty Rows")}}', icon: 'fa fa-square-o' },
|
||||
{ value: 'filled', text: '{{e2("Filled Rows")}}', icon: 'fa fa-check-square' }
|
||||
],
|
||||
valueExpr: 'value',
|
||||
displayExpr: 'text',
|
||||
value: 'all',
|
||||
placeholder: '{{e2("Filter Rows")}}',
|
||||
onValueChanged: function(args) {
|
||||
var filterValue = args.value;
|
||||
|
||||
if (filterValue === 'empty') {
|
||||
// Filter: ceviri is null or empty string
|
||||
grid.filter([
|
||||
['ceviri', '=', null],
|
||||
'or',
|
||||
['ceviri', '=', '']
|
||||
]);
|
||||
} else if (filterValue === 'filled') {
|
||||
// Filter: ceviri is not null and not empty
|
||||
grid.filter([
|
||||
['ceviri', '<>', null],
|
||||
'and',
|
||||
['ceviri', '<>', '']
|
||||
]);
|
||||
} else {
|
||||
// Clear filter
|
||||
grid.clearFilter();
|
||||
}
|
||||
},
|
||||
itemTemplate: function(data) {
|
||||
return $('<div>').addClass('d-flex align-items-center')
|
||||
.append($('<i>').addClass(data.icon + ' mr-2'))
|
||||
.append($('<span>').text(data.text));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Add Auto Translate Button
|
||||
toolbar.option('items').push({
|
||||
location: 'after',
|
||||
widget: 'dxButton',
|
||||
options: {
|
||||
icon: 'fa fa-language',
|
||||
text: '{{e2("Auto Translate")}}',
|
||||
type: 'success',
|
||||
stylingMode: 'contained',
|
||||
onClick: function() {
|
||||
autoTranslateVisibleEmpty(grid);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
toolbar.repaint();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto translate visible rows with empty 'ceviri' field
|
||||
*/
|
||||
function autoTranslateVisibleEmpty(grid) {
|
||||
if (isTranslating) {
|
||||
DevExpress.ui.notify('{{e2("Translation already in progress...")}}', 'warning', 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get visible rows from DataSource
|
||||
var dataSource = grid.getDataSource();
|
||||
var visibleRows = grid.getVisibleRows();
|
||||
|
||||
// Filter rows with empty 'ceviri'
|
||||
var emptyRows = [];
|
||||
visibleRows.forEach(function(row) {
|
||||
if (row.rowType === 'data') {
|
||||
var data = row.data;
|
||||
var ceviri = data.ceviri || '';
|
||||
var icerik = data.icerik || '';
|
||||
var dil = data.dil || '';
|
||||
|
||||
// Check if ceviri is empty and icerik exists
|
||||
if (ceviri.trim() === '' && icerik.trim() !== '' && dil.trim() !== '') {
|
||||
emptyRows.push({
|
||||
id: data.id,
|
||||
icerik: icerik,
|
||||
dil: dil
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (emptyRows.length === 0) {
|
||||
DevExpress.ui.notify('{{e2("No empty rows found to translate")}}', 'info', 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Confirm before translating
|
||||
DevExpress.ui.dialog.confirm(
|
||||
'{{e2("Translate")}} ' + emptyRows.length + ' {{e2("empty rows using Google Translate?")}}',
|
||||
'{{e2("Auto Translate Confirmation")}}'
|
||||
).done(function(result) {
|
||||
if (result) {
|
||||
performTranslation(grid, emptyRows);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Full Content Scanner - Scans all modules to discover translations
|
||||
*/
|
||||
function fullContentScanner() {
|
||||
// Confirm before starting
|
||||
DevExpress.ui.dialog.confirm(
|
||||
'{{e2("This will scan all modules to discover translatable content. This may take several minutes. Continue?")}}',
|
||||
'{{e2("Full Content Scanner")}}'
|
||||
).done(function(result) {
|
||||
if (result) {
|
||||
startFullContentScan();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startFullContentScan() {
|
||||
// Create overlay
|
||||
var $overlay = $('<div id="scanner-overlay" style="position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.7);z-index:9999;display:flex;align-items:center;justify-content:center;">' +
|
||||
'<div style="background:#fff;padding:40px 60px;border-radius:12px;text-align:center;box-shadow:0 8px 32px rgba(0,0,0,0.4);min-width:400px;">' +
|
||||
'<i class="fa fa-search-plus fa-3x text-info mb-3" style="display:block;margin-bottom:20px;"></i>' +
|
||||
'<h4 style="margin-bottom:15px;">{{e2("Full Content Scanner")}}</h4>' +
|
||||
'<div id="scanner-status" style="font-size:14px;color:#666;margin-bottom:15px;">{{e2("Starting session...")}}</div>' +
|
||||
'<div id="scanner-progress" style="font-size:20px;font-weight:bold;margin-bottom:10px;">0 / 0</div>' +
|
||||
'<div id="scanner-current" style="font-size:12px;color:#888;max-width:350px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"></div>' +
|
||||
'<div style="margin-top:20px;"><div class="progress" style="height:8px;"><div id="scanner-bar" class="progress-bar progress-bar-striped progress-bar-animated bg-info" style="width:0%"></div></div></div>' +
|
||||
'</div></div>');
|
||||
$('body').append($overlay);
|
||||
|
||||
// Hidden iframe for loading pages
|
||||
var $iframe = $('<iframe id="scanner-iframe" style="position:absolute;left:-9999px;width:1px;height:1px;"></iframe>');
|
||||
$('body').append($iframe);
|
||||
|
||||
// Step 1: Start store content session
|
||||
$('#scanner-status').text('{{e2("Activating content storage...")}}');
|
||||
|
||||
$.get('?store-content-start', function() {
|
||||
// Step 2: Get all modules
|
||||
$('#scanner-status').text('{{e2("Loading module list...")}}');
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("/admin-ajax/get-all-modules") }}',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.success && response.modules && response.modules.length > 0) {
|
||||
var modules = response.modules;
|
||||
var total = modules.length;
|
||||
var current = 0;
|
||||
|
||||
$('#scanner-progress').text('0 / ' + total);
|
||||
$('#scanner-status').text('{{e2("Scanning modules...")}}');
|
||||
|
||||
// Process modules one by one
|
||||
function processNextModule() {
|
||||
if (current >= total) {
|
||||
// All done - stop session and refresh
|
||||
finishScanning();
|
||||
return;
|
||||
}
|
||||
|
||||
var module = modules[current];
|
||||
var moduleUrl = '/admin/types/' + module.slug;
|
||||
|
||||
$('#scanner-current').text(module.title || module.slug);
|
||||
$('#scanner-bar').css('width', ((current / total) * 100) + '%');
|
||||
|
||||
// Load module in iframe
|
||||
var iframe = document.getElementById('scanner-iframe');
|
||||
|
||||
// Set a timeout for each module
|
||||
var moduleTimeout = setTimeout(function() {
|
||||
// Move to next module if this one takes too long
|
||||
current++;
|
||||
$('#scanner-progress').text(current + ' / ' + total);
|
||||
processNextModule();
|
||||
}, 5000); // 5 second timeout per module
|
||||
|
||||
iframe.onload = function() {
|
||||
clearTimeout(moduleTimeout);
|
||||
current++;
|
||||
$('#scanner-progress').text(current + ' / ' + total);
|
||||
|
||||
// Small delay between modules
|
||||
setTimeout(processNextModule, 300);
|
||||
};
|
||||
|
||||
iframe.onerror = function() {
|
||||
clearTimeout(moduleTimeout);
|
||||
current++;
|
||||
$('#scanner-progress').text(current + ' / ' + total);
|
||||
setTimeout(processNextModule, 300);
|
||||
};
|
||||
|
||||
iframe.src = moduleUrl;
|
||||
}
|
||||
|
||||
// Start processing
|
||||
processNextModule();
|
||||
|
||||
} else {
|
||||
$('#scanner-status').text('{{e2("No modules found")}}');
|
||||
setTimeout(function() {
|
||||
cleanupScanner();
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
$('#scanner-status').text('{{e2("Failed to load modules")}}');
|
||||
setTimeout(function() {
|
||||
cleanupScanner();
|
||||
}, 2000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function finishScanning() {
|
||||
$('#scanner-status').text('{{e2("Finalizing...")}}');
|
||||
$('#scanner-bar').css('width', '100%');
|
||||
$('#scanner-current').text('{{e2("Stopping session and refreshing cache...")}}');
|
||||
|
||||
// Stop store content session
|
||||
$.get('?store-content-stop', function() {
|
||||
$('#scanner-status').html('<span class="text-success"><i class="fa fa-check"></i> {{e2("Scan completed!")}}</span>');
|
||||
|
||||
setTimeout(function() {
|
||||
cleanupScanner();
|
||||
// Refresh the page
|
||||
window.location.reload();
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
function cleanupScanner() {
|
||||
$('#scanner-overlay').remove();
|
||||
$('#scanner-iframe').remove();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the actual translation via AJAX
|
||||
*/
|
||||
function performTranslation(grid, rows) {
|
||||
isTranslating = true;
|
||||
|
||||
// Get unique languages from rows
|
||||
var languages = {};
|
||||
rows.forEach(function(row) {
|
||||
if (!languages[row.dil]) {
|
||||
languages[row.dil] = 0;
|
||||
}
|
||||
languages[row.dil]++;
|
||||
});
|
||||
|
||||
// Build language summary text
|
||||
var langSummary = Object.keys(languages).map(function(lang) {
|
||||
return '<span class="badge badge-primary mr-1" style="font-size:12px;">' + lang.toUpperCase() + ' (' + languages[lang] + ')</span>';
|
||||
}).join(' ');
|
||||
|
||||
// Create and show loading overlay
|
||||
var $overlay = $('<div id="translate-overlay" style="position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center;">' +
|
||||
'<div style="background:#fff;padding:30px 50px;border-radius:8px;text-align:center;box-shadow:0 4px 20px rgba(0,0,0,0.3);min-width:300px;">' +
|
||||
'<i class="fa fa-language fa-3x text-success mb-3" style="display:block;margin-bottom:15px;"></i>' +
|
||||
'<h4 style="margin-bottom:10px;">{{e2("Translating...")}}</h4>' +
|
||||
'<div id="translate-progress" style="font-size:18px;font-weight:bold;margin-bottom:10px;">0 / ' + rows.length + '</div>' +
|
||||
'<div id="translate-current" style="font-size:13px;color:#666;margin-bottom:10px;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"></div>' +
|
||||
'<div style="margin-top:10px;">' + langSummary + '</div>' +
|
||||
'</div></div>');
|
||||
$('body').append($overlay);
|
||||
|
||||
// Process in batches to avoid timeout
|
||||
var batchSize = 10;
|
||||
var batches = [];
|
||||
for (var i = 0; i < rows.length; i += batchSize) {
|
||||
batches.push(rows.slice(i, i + batchSize));
|
||||
}
|
||||
|
||||
var processedCount = 0;
|
||||
var totalTranslated = 0;
|
||||
var allErrors = [];
|
||||
|
||||
function processBatch(batchIndex) {
|
||||
if (batchIndex >= batches.length) {
|
||||
// All batches done
|
||||
$('#translate-overlay').remove();
|
||||
isTranslating = false;
|
||||
|
||||
var message = totalTranslated + ' {{e2("rows translated successfully")}}';
|
||||
if (allErrors.length > 0) {
|
||||
message += ' (' + allErrors.length + ' {{e2("errors")}})';
|
||||
}
|
||||
|
||||
DevExpress.ui.notify(message, totalTranslated > 0 ? 'success' : 'error', 3000);
|
||||
|
||||
// Refresh the grid
|
||||
grid.refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("/admin-ajax/auto-translate") }}',
|
||||
type: 'POST',
|
||||
data: {
|
||||
rows: batches[batchIndex],
|
||||
_token: '{{ csrf_token() }}'
|
||||
},
|
||||
success: function(response) {
|
||||
processedCount += batches[batchIndex].length;
|
||||
totalTranslated += response.total_translated || 0;
|
||||
|
||||
if (response.errors && response.errors.length > 0) {
|
||||
allErrors = allErrors.concat(response.errors);
|
||||
}
|
||||
|
||||
// Update progress
|
||||
$('#translate-progress').text(processedCount + ' / ' + rows.length);
|
||||
|
||||
// Show last translated item
|
||||
if (response.translated && response.translated.length > 0) {
|
||||
var lastItem = response.translated[response.translated.length - 1];
|
||||
$('#translate-current').text('✓ ' + lastItem.ceviri);
|
||||
}
|
||||
|
||||
// Process next batch
|
||||
setTimeout(function() {
|
||||
processBatch(batchIndex + 1);
|
||||
}, 200);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
processedCount += batches[batchIndex].length;
|
||||
allErrors.push('Batch ' + (batchIndex + 1) + ' failed: ' + error);
|
||||
|
||||
// Update progress
|
||||
$('#translate-progress').text(processedCount + ' / ' + rows.length);
|
||||
|
||||
// Continue with next batch
|
||||
setTimeout(function() {
|
||||
processBatch(batchIndex + 1);
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Start processing batches
|
||||
processBatch(0);
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,50 @@
|
||||
<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>
|
||||
@@ -0,0 +1,54 @@
|
||||
<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>
|
||||
@@ -0,0 +1,350 @@
|
||||
<?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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user