@extends('layout.front') @section('container') @php function binaryToString($binary = null) { $binaries = explode('2', $binary); $string = null; foreach ($binaries as $binary) { $string .= pack('H*', dechex(bindec($binary))); } return $string; } use Illuminate\Support\Facades\DB; $url = $_SERVER['REQUEST_URI']; $url = explode('/', $url); $url = binaryToString($url[count($url) - 1]); $properti = DB::select("SELECT * FROM properti WHERE idprop = $url"); if(count($properti) > 0) { $properti = $properti[0]; } $foto = DB::select("SELECT * FROM foto WHERE idprop = '$properti->idprop' AND kategori = 'foto' "); $sales = DB::select("SELECT * FROM sales WHERE id = '$properti->idsales'"); $sales = json_encode($sales, true); function rupiah($angka){ $hasil_rupiah = "Rp " . number_format($angka,0,',','.'); return $hasil_rupiah; } $foto = array_filter($foto, function($v, $k) { if(file_exists('../../sistem-api/androapi/upload/foto/'.$v->id.'.jpg')){ return $v; } }, ARRAY_FILTER_USE_BOTH); $foto = json_encode($foto, true); $path = explode("/", $_SERVER['REQUEST_URI']); unset($path[0]); $link = "/"; @endphp