use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
function pot($kalimat, $maxKata = 50) {
$kata = explode(" ", $kalimat);
if (count($kata) <= $maxKata) {
return $kalimat; // Kalimat tidak perlu dipotong
}
$kalimatPotong = "";
for ($i = 0; $i < $maxKata; $i++) {
$kalimatPotong .= $kata[$i] . " ";
}
return $kalimat . "..."; // Tambahkan "..." di akhir kalimat
}
function getSOP($kode){
$sql = "SELECT `nama_sop` FROM `tb_sop` WHERE `id_sop`= '" . $kode . "'";
$results = DB::select($sql);
$hasil ="-";
if (!empty($r)) {
$hasil = $results[0]->nama_sop;
}
return $hasil;
}
function getImg($doc){
$imagePath = '/ypathfile/'.$doc;
$urlParts = asset($imagePath);
//$gab="<a href='$urlParts' target='_blank' title='$urlParts'>$doc</a>";
return $urlParts;
}
function getLNK($nm,$doc,$v){
$imagePath = '/ypathfile/'.$doc;
$urlParts = asset($imagePath);
//$gab="<a href='$urlParts' target='_blank' title='$urlParts'>$doc</a>";
$x="<a href=\"$urlParts\" title=\"$doc\" target=\"_blank\">".ucwords($nm)."</a>";
if($v==1){
$x="<a href=\"$urlParts\" title=\"$doc\" target=\"_blank\"><b>".ucwords($nm)."</b></a>";
}
return $x;
}
function getList($kode){
$sql = "SELECT `judul_dokumen`,`dokumen` FROM `tb_dokumen` WHERE `id_sop`= '" . $kode . "'";
//$results = DB::select($sql);
//$hasil = $results[0]->nama_dosen;
$dokumen = DB::select($sql);
$gab="<div align='left'><ol>";
$i=0;
foreach ($dokumen as $dokumenItem) {
$i++;
$judul= $dokumenItem->judul_dokumen ;
$doc=$dokumenItem->dokumen;
//{{ url('ypathfile/'.$sop->flowchart)}}
//<img src="{{ asset('images/gambar.jpg') }}" alt="Gambar">
$imagePath = '/ypathfile/'.$doc;
$urlParts = asset($imagePath);
$gab.="<li><a href='$urlParts' target='_blank' title='$urlParts'>$judul</a></li>";
}
$gab.="</ol></div>";
if($i==0){$gab="<i>Dokumen Pendukung belum tersedia....</i>";}
return $gab;
}
@php
$Jpositif = 0;
$Jnegatif = 0;
@endphp
@forelse ($datalatihs as $datalatih)
NO: {{$loop->iteration}}<br>
Kategori: {{$datalatih->kategori}}<hr>
@if ($datalatih->kategori == "Positif")
@php
$Jpositif++;
@endphp
@elseif ($datalatih->kategori == "Negatif")
@php
$Jnegatif++;
@endphp
@endif
@empty
<p>Tidak ada data.</p>
@endforelse
<p>Total Positif: {{$Jpositif}}</p>
<p>Total Negatif: {{$Jnegatif}}</p>
Tidak ada komentar:
Posting Komentar