<?php
use IlluminateDatabaseCapsuleManager as Capsule;
define("CLIENTAREA", true);
require("init.php");
$ca = new WHMCS_ClientArea();
$ca->setPageTitle("Company Formation");
$ca->addToBreadCrumb('index.php', 'Home');
$ca->addToBreadCrumb('referans.php', 'Company Formation');
$ca->initPage();
// Veritabanından şirket bilgilerini çek
$companies = Capsule::table('veritablosu adı')->get();
// Eğer veri yoksa, boş bir dizi olarak tanımla
if (!$companies) {
$companies = [];
}
$smarty->assign('companies', $companies);
// Tema dosyasını yükle
$ca->setTemplate("referans");
$ca->output();
?>
buda tpl kodu
<link rel="stylesheet" href="{$WEB_ROOT}/templates/vtheme/pages/uk-server/css/main.css">
<link rel="stylesheet" href="{$WEB_ROOT}/templates/vtheme/pages/uk-server/css/v1.css">
<div class="bg-green-900 text-center py-4 px-4">
<div class="p-2 bg-green-800 items-center text-indigo-100 leading-none rounded-full flex inline-flex" role="alert">
<span class="flex rounded-full bg-green-500 animate-pulse uppercase px-2 py-1 text-xs font-bold mr-3">LIVE</span>
<span class="font-semibold mr-2 text-xs text-left flex-auto"> <a href="referanslar.html" class="hover:underline">We have established <strong>7695</strong> companies so far and are currently processing the setup of <strong>7</strong> companies. <i class="fas fa-arrow-right"></i></a></span>
</div>
</div>
</div>
</div>
</div>

<header id="hero" class="hero">
<div class="flex-container w-container">
<!-- Left Side: Text Content -->
<div class="div-block-8">
<div class="text-span-3">
<span class="text-span-new">UK Limited</span>
</div>
<h1 class="heading-8">Establish your limited company in the UK and start trading immediately.</h1>
<div class="intro-text mb-5">Get a registered address in London within 24 hours and start receiving payments in all currencies with your officially registered UK Limited company.</div>
<div class="company_name_result">
<h4 class="h4-md d-inline"></h4>
<hr>
</div>
<div>
<label for="hs-trailing-button-add-on-with-icon" class="sr-only">Label</label>
<div class="flex rounded-md shadow-sm">
<input type="text" id="searchCompanyName" placeholder="Check company name availability..." name="hs-trailing-button-add-on-with-icon" class="form-control h-12 py-3 px-4 block w-full border-gray-200 shadow-sm rounded text-sm focus:z-10 focus:border-green-500 focus:ring-green-500 dark:bg-green-800 dark:border-green-700 dark:text-gray-400">
<button href="javascript:void" onclick="searchName()" id="searchButton" type="button" class="w-12 h-12 ml-3 inline-flex flex-shrink-0 justify-center items-center h-[2.875rem] w-[2.875rem] rounded border border-transparent font-semibold bg-green-800 text-white hover:bg-green-600 focus:z-10 focusutline-none focus:ring-2 focus:ring-green-500 transition-all text-sm">
<svg class="h-4 w-4" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z" />
</svg>
</button>
</div>
</div>
</div>

<!-- Right Side: Image -->
<div class="image-container">
<img src="/theme/assets/img/Londra-Ingiltere.png" alt="UK Limited Company" class="side-image">
</div>
</div>
</header>

<section xyz="fade down ease-out delay-2" class="px-5 bg-gray-50 py-20">
<div class="container mx-auto py-10 flex justify-center h-screen">
<div class="w-full lg:w-9/12 h-full flex flex-col">
<div class="bg-white text-sm text-gray-500 font-bold px-5 py-3 shadow border-b border-gray-300 text-center">
Company Formation Table *
</div>
<input type="text" id="searchInput" class="px-4 py-2 border border-gray-300 w-full" placeholder="Search...">
<div class="w-full h-full overflow-auto shadow bg-white" id="journal-scroll">
<table class="w-full">
<thead>
<tr>
<th>Company Name</th>
<th>Status</th>
<th>Date</th>
<th>Description</th>
</tr>
</thead>
<tbody id="tableBody">
{if isset($companies) && $companies} // -->burayı cout yaptığımda hata alıyorum
{foreach from=$companies item=company}
<tr class="relative transform scale-100 text-xs py-1 border-b-2 border-blue-100 cursor-default">
<td class="pl-5 pr-3 whitespace-no-wrap">
<div class="font-medium text-gray-600">{$company.company_name}</div>
</td>
<td class="px-2 py-2 whitespace-no-wrap">
<div class="leading-5 text-gray-500 font-medium">
{if $company.status == 'Setup In Progress'}
<span class="text-yellow-500">Installation in Progress</span>
{else}
<span class="text-green-500">Installation Completed</span>
{/if}
</div>
</td>
<td class="px-2 py-2 whitespace-no-wrap">
<div class="leading-5 text-gray-500 font-medium">
{if $company.status == 'Setup In Progress'}
<i class="fas fa-spinner fa-spin text-yellow-500"></i> {$company.status_date|date_format:"%d/%m/%Y"}
{else}
<i class="fas fa-check-circle text-green-500"></i> {$company.status_date|date_format:"%d/%m/%Y"}
{/if}
</div>
</td>
<td class="px-2 py-2 whitespace-no-wrap">
<div class="leading-5 text-gray-900 mt-2">
{if $company.status == 'Setup In Progress'}
<i class="fas fa-wrench text-yellow-500"></i> The setup process is still ongoing.
{else}
<i class="fas fa-check-circle text-green-500"></i> The setup process has been successfully completed.
{/if}
</div>
</td>
</tr>
{/foreach}
<tr><td colspan="4" class="text-center">Veri bulunamadı.</td></tr>
{/if}
</tbody>
</table>
</div>
</div>
</div>
</section>
<div class="bg-green-900 text-center py-4 px-4">
<div class="p-2 bg-green-800 items-center text-indigo-100 leading-none rounded-full flex inline-flex" role="alert">
<span class="flex rounded-full bg-green-500 animate-pulse uppercase px-2 py-1 text-xs font-bold mr-3">APPLY</span>
<span class="font-semibold mr-2 text-xs text-left flex-auto"> <a href="https://#/" class="hover:underline">Take your place among thousands of our customers and become a limited company owner in the UK. <i class="fas fa-arrow-right"></i></a></span>
</div>
</div>
<style>
table {
width: 100%;
border-collapse: collapse;
}

table th, table td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}

table th {
background-color: #f4f4f4;
font-weight: bold;
}

table tr:nth-child(even) {
background-color: #f9f9f9;
}

table tr:hover {
background-color: #f1f1f1;
}


</style>