<?php
include "asset/session_check.php";

$nama_pegawai = $_SESSION['nama_pegawai'];
$akses = $_SESSION['akses'];
?>
<!doctype html>
<html lang="en">

<head>
    <?php
    include "asset/head.php";
    ?>
</head>

<body>
    <!-- NAVIGASI -->
    <?php
    include "asset/navigasi.php";
    ?>
    <div class="container">
        <div class="row">
            <div class="d-flex bd-highlight mb-3">
                <div class="me-auto p-2 bd-highlight">
                    <h1>Edit Data Telp Customers Raxi</h1>
                </div>
            </div>
        </div>
        <div class="row">
            <?php
            include "koneksi.php";

            $tgl = date("Y-m-d");
            $idtelp_custraxi = $_GET["idtelp_custraxi"];

            $cariidtelp = mysqli_query($konek, "SELECT t.idtelp_custraxi,t.keperluan,t.sumber,t.ket_sumber,c.bu,c.idcustomer,c.nama_customer,c.alamat,c.kota,c.email,c.telp,t.note_telp FROM telp_custraxi t INNER JOIN customer c ON t.idcustomer=c.idcustomer WHERE t.idtelp_custraxi = '$idtelp_custraxi'");
            $data = mysqli_fetch_array($cariidtelp);
            $idcustomer = $data['idcustomer'] ?? '';
            $nama_customer = $data['nama_customer'] ?? '';
            $alamat = $data['alamat'] ?? '';
            $kota = $data['kota'] ?? '';
            $email = $data['email'] ?? '';
            $telp = $data['telp'] ?? '';
            $sumber = $data['sumber'] ?? '';
            $ketarangansumber = $data['ket_sumber'] ?? '';
            $keperluan = $data['keperluan'] ?? '';
            $note = $data['note'] ?? '';
            $note_telp = $data['note_telp'] ?? '';
            $bu = $data['bu'] ?? '';
            ?>
            <input type="text" class="form-control" name="idtelp_custraxi" value="<?= $idtelp_custraxi ?>" form="formSelesai" hidden>
            <div class="mb-3">
                <label class="form-label" hidden>Tanggal Telp Customers</label>
                <input type="date" class="form-control" name="tgl_customer" value="<?= $tgl ?>" form="formSelesai" hidden>
            </div>
            <div class="col">
                <div class="mb-3">
                    <label class="form-label">Customers</label>
                    <div class="input-group">
                        <select class="form-select" name="bu" id="bu" style="max-width: 95px;" form="formSelesai">
                            <option value="PT " <?= ($bu == 'PT ') ? 'selected' : '' ?>>PT</option>
                            <option value="CV " <?= ($bu == 'CV ') ? 'selected' : '' ?>>CV</option>
                            <option value="UD " <?= ($bu == 'UD ') ? 'selected' : '' ?>>UD</option>
                            <option value="Toko " <?= ($bu == 'Toko ') ? 'selected' : '' ?>>Toko</option>
                            <option value="Bapak " <?= ($bu == 'Bapak ') ? 'selected' : '' ?>>Bapak</option>
                            <option value="Ibu " <?= ($bu == 'Ibu ') ? 'selected' : '' ?>>Ibu</option>
                        </select>
                        <input type="text" class="form-control" autocomplete="off" name="nama_customer" id="nama_customer" value="<?= $nama_customer ?>" form="formSelesai" placeholder="Masukkan Nama Customer">
                    </div>
                    <div id="customerList"
                        class="list-group w-100"
                        style="z-index:1000; display:none;"></div>
                </div>
                <div class="mb-3">
                    <label class="form-label">Alamat</label>
                    <input type="text" id="alamat" name="alamat" class="form-control" value="<?= $alamat ?>" form="formSelesai" placeholder="Masukkan Alamat" readonly>
                    <div id="suggestion" class="list-group"></div>
                </div>
                <div class="mb-3">
                    <label class="form-label">KOTA</label>
                    <input type="text" id="kota" name="kota" class="form-control kota" value="<?= $kota ?>" form="formSelesai" placeholder="Ketik kota  /  / kabupaten" readonly>
                    <div id="suggestion" class="list-group suggestion"></div>
                </div>
                <!-- <div class="mb-3">
                        <label class="form-label">PIC</label>
                        <div class="input-group">
                            <select class="form-select" name="tt" id="tt" style="max-width: 95px;">
                                <option value="Bapak">Bapak</option>
                                <option value="Ibu">Ibu</option>
                            </select>
                            <input type="text" class="form-control" autocomplete="off" name="pic" id="pice" placeholder="Masukkan Nama PIC">
                        </div>
                    </div> -->
                <div class="mb-3">
                    <label class="form-label">Telp Perusahaan</label>
                    <input type="text" class="form-control" name="telp" id="telp" form="formSelesai" value="<?= $telp ?>" placeholder="Masukkan Nama Telp" maxlength="13" readonly>
                </div>
            </div>
            <div class="col">
                <div class="mb-3">
                    <label class="form-label">Email</label>
                    <input type="text" class="form-control" name="email" id="email" value="<?= $email ?>" placeholder="Masukkan Email" form="formSelesai">
                </div>
                <label class="form-label">Sumber</label>
                <div class="mb-3" id="selectSum">
                    <select class="form-select" id="sumber" name="sumber" form="formSelesai">
                        <option value="WA" <?= ($sumber == 'WA') ? 'selected' : '' ?>>WA</option>
                        <option value="Email" <?= ($sumber == 'Email') ? 'selected' : '' ?>>Email</option>
                        <option value="Brosur" <?= ($sumber == 'Brosur') ? 'selected' : '' ?>>Brosur</option>
                        <option value="Walk In" <?= ($sumber == 'Walk In') ? 'selected' : '' ?>>Walk In</option>
                        <option value="Telp" <?= ($sumber == 'Telp') ? 'selected' : '' ?>>Telp</option>
                        <option value="Iklan" <?= ($sumber == 'Iklan') ? 'selected' : '' ?>>Iklan</option>
                        <option value="Website" <?= ($sumber == 'Website') ? 'selected' : '' ?>>Website</option>
                        <option value="Tidak Tau" <?= ($sumber == 'Tidak tahu') ? 'selected' : '' ?>>Tidak tahu</option>
                    </select>
                    <select class="form-select" id="formWebsite" style="display:none;" name="keteranganSumberWeb" form="formSelesai">
                        <option value="anekalifting.com / anekalifting.office@gmail.com / 081228118050" <?= ($ketarangansumber == 'anekalifting.com / anekalifting.office@gmail.com / 081228118050') ? 'selected' : '' ?>>anekalifting.com / anekalifting.office@gmail.com / 081228118050</option>
                        <option value="bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238" <?= ($ketarangansumber == 'bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238') ? 'selected' : '' ?>>bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238</option>
                        <option value="forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034" <?= ($ketarangansumber == 'forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034') ? 'selected' : '' ?>>forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034</option>
                        <option value="handpallet.info / handpalletinfo@gmail.com / 081218346968" <?= ($ketarangansumber == 'handpallet.info / handpalletinfo@gmail.com / 081218346968') ? 'selected' : '' ?>>handpallet.info / handpalletinfo@gmail.com / 081218346968</option>
                        <option value="handstacker.info / stacker.office@gmail.com / 082245874443" <?= ($ketarangansumber == 'handstacker.info / stacker.office@gmail.com / 082245874443') ? 'selected' : '' ?>>handstacker.info / stacker.office@gmail.com / 082245874443</option>
                        <option value="indohandlift.com / indohandlift.office@gmail.com / 088989372934" <?= ($ketarangansumber == 'indohandlift.com / indohandlift.office@gmail.com / 088989372934') ? 'selected' : '' ?>>indohandlift.com / indohandlift.office@gmail.com / 088989372934</option>
                        <option value="indolifting.com / indolifting@gmail.com / 081288629984" <?= ($ketarangansumber == 'indolifting.com / indolifting@gmail.com / 081288629984') ? 'selected' : '' ?>>indolifting.com / indolifting@gmail.com / 081288629984</option>
                        <option value="kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841" <?= ($ketarangansumber == 'kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841') ? 'selected' : '' ?>>kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841</option>
                        <option value="materialhandling.co.id / marketing@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / marketing@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / marketing@raxi.co.id / 081231191901</option>
                        <option value="materialhandling.co.id / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / medan@raxi.co.id / 081231191901</option>
                        <option value="nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611" <?= ($ketarangansumber == 'nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611') ? 'selected' : '' ?>>nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611</option>
                        <option value="ptraxi.com / sby@raxi.co.id / (031) 5013309" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / (031) 5013309') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / (031) 5013309</option>
                        <option value="ptraxi.com / jkt@raxi.co.id / (021) 29490627" <?= ($ketarangansumber == 'ptraxi.com / jkt@raxi.co.id / (021) 29490627') ? 'selected' : '' ?>>ptraxi.com / jkt@raxi.co.id / (021) 29490627</option>
                        <option value="ptraxi.com / sby@raxi.co.id / 081330118084" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / 081330118084') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / 081330118084</option>
                        <option value="ptraxi.com / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'ptraxi.com / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>ptraxi.com / medan@raxi.co.id / 081231191901</option>
                        <option value="rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576" <?= ($ketarangansumber == 'rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576') ? 'selected' : '' ?>>rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081224302982" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081224302982') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081224302982</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081370224880</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081384457297" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081384457297') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081384457297</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081252981592" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081252981592') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081252981592</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081334108072" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081334108072') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081334108072</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081210440276" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081210440276') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081210440276</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973</option>
                    </select>
                    <select class="form-select" id="formEmail" style="display:none;" name="keteranganSumberEmail" form="formSelesai">
                        <option value="anekalifting.com / anekalifting.office@gmail.com / 081228118050" <?= ($ketarangansumber == 'anekalifting.com / anekalifting.office@gmail.com / 081228118050') ? 'selected' : '' ?>>anekalifting.com / anekalifting.office@gmail.com / 081228118050</option>
                        <option value="bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238" <?= ($ketarangansumber == 'bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238') ? 'selected' : '' ?>>bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238</option>
                        <option value="forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034" <?= ($ketarangansumber == 'forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034') ? 'selected' : '' ?>>forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034</option>
                        <option value="handpallet.info / handpalletinfo@gmail.com / 081218346968" <?= ($ketarangansumber == 'handpallet.info / handpalletinfo@gmail.com / 081218346968') ? 'selected' : '' ?>>handpallet.info / handpalletinfo@gmail.com / 081218346968</option>
                        <option value="handstacker.info / stacker.office@gmail.com / 082245874443" <?= ($ketarangansumber == 'handstacker.info / stacker.office@gmail.com / 082245874443') ? 'selected' : '' ?>>handstacker.info / stacker.office@gmail.com / 082245874443</option>
                        <option value="indohandlift.com / indohandlift.office@gmail.com / 088989372934" <?= ($ketarangansumber == 'indohandlift.com / indohandlift.office@gmail.com / 088989372934') ? 'selected' : '' ?>>indohandlift.com / indohandlift.office@gmail.com / 088989372934</option>
                        <option value="indolifting.com / indolifting@gmail.com / 081288629984" <?= ($ketarangansumber == 'indolifting.com / indolifting@gmail.com / 081288629984') ? 'selected' : '' ?>>indolifting.com / indolifting@gmail.com / 081288629984</option>
                        <option value="kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841" <?= ($ketarangansumber == 'kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841') ? 'selected' : '' ?>>kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841</option>
                        <option value="materialhandling.co.id / marketing@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / marketing@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / marketing@raxi.co.id / 081231191901</option>
                        <option value="materialhandling.co.id / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / medan@raxi.co.id / 081231191901</option>
                        <option value="nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611" <?= ($ketarangansumber == 'nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611') ? 'selected' : '' ?>>nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611</option>
                        <option value="ptraxi.com / sby@raxi.co.id / (031) 5013309" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / (031) 5013309') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / (031) 5013309</option>
                        <option value="ptraxi.com / jkt@raxi.co.id / (021) 29490627" <?= ($ketarangansumber == 'ptraxi.com / jkt@raxi.co.id / (021) 29490627') ? 'selected' : '' ?>>ptraxi.com / jkt@raxi.co.id / (021) 29490627</option>
                        <option value="ptraxi.com / sby@raxi.co.id / 081330118084" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / 081330118084') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / 081330118084</option>
                        <option value="ptraxi.com / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'ptraxi.com / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>ptraxi.com / medan@raxi.co.id / 081231191901</option>
                        <option value="rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576" <?= ($ketarangansumber == 'rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576') ? 'selected' : '' ?>>rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081224302982" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081224302982') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081224302982</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081370224880</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081384457297" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081384457297') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081384457297</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081252981592" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081252981592') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081252981592</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081334108072" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081334108072') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081334108072</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081210440276" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081210440276') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081210440276</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973</option>
                    </select>
                    <select class="form-select" id="formTelp" style="display:none;" name="keteranganSumberTelp" form="formSelesai">
                        <option value="anekalifting.com / anekalifting.office@gmail.com / 081228118050" <?= ($ketarangansumber == 'anekalifting.com / anekalifting.office@gmail.com / 081228118050') ? 'selected' : '' ?>>anekalifting.com / anekalifting.office@gmail.com / 081228118050</option>
                        <option value="bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238" <?= ($ketarangansumber == 'bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238') ? 'selected' : '' ?>>bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238</option>
                        <option value="forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034" <?= ($ketarangansumber == 'forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034') ? 'selected' : '' ?>>forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034</option>
                        <option value="handpallet.info / handpalletinfo@gmail.com / 081218346968" <?= ($ketarangansumber == 'handpallet.info / handpalletinfo@gmail.com / 081218346968') ? 'selected' : '' ?>>handpallet.info / handpalletinfo@gmail.com / 081218346968</option>
                        <option value="handstacker.info / stacker.office@gmail.com / 082245874443" <?= ($ketarangansumber == 'handstacker.info / stacker.office@gmail.com / 082245874443') ? 'selected' : '' ?>>handstacker.info / stacker.office@gmail.com / 082245874443</option>
                        <option value="indohandlift.com / indohandlift.office@gmail.com / 088989372934" <?= ($ketarangansumber == 'indohandlift.com / indohandlift.office@gmail.com / 088989372934') ? 'selected' : '' ?>>indohandlift.com / indohandlift.office@gmail.com / 088989372934</option>
                        <option value="indolifting.com / indolifting@gmail.com / 081288629984" <?= ($ketarangansumber == 'indolifting.com / indolifting@gmail.com / 081288629984') ? 'selected' : '' ?>>indolifting.com / indolifting@gmail.com / 081288629984</option>
                        <option value="kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841" <?= ($ketarangansumber == 'kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841') ? 'selected' : '' ?>>kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841</option>
                        <option value="materialhandling.co.id / marketing@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / marketing@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / marketing@raxi.co.id / 081231191901</option>
                        <option value="materialhandling.co.id / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / medan@raxi.co.id / 081231191901</option>
                        <option value="nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611" <?= ($ketarangansumber == 'nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611') ? 'selected' : '' ?>>nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611</option>
                        <option value="ptraxi.com / sby@raxi.co.id / (031) 5013309" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / (031) 5013309') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / (031) 5013309</option>
                        <option value="ptraxi.com / jkt@raxi.co.id / (021) 29490627" <?= ($ketarangansumber == 'ptraxi.com / jkt@raxi.co.id / (021) 29490627') ? 'selected' : '' ?>>ptraxi.com / jkt@raxi.co.id / (021) 29490627</option>
                        <option value="ptraxi.com / sby@raxi.co.id / 081330118084" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / 081330118084') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / 081330118084</option>
                        <option value="ptraxi.com / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'ptraxi.com / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>ptraxi.com / medan@raxi.co.id / 081231191901</option>
                        <option value="rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576" <?= ($ketarangansumber == 'rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576') ? 'selected' : '' ?>>rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081224302982" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081224302982') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081224302982</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081370224880</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081384457297" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081384457297') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081384457297</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081252981592" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081252981592') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081252981592</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081334108072" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081334108072') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081334108072</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081210440276" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081210440276') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081210440276</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973</option>
                    </select>
                    <select class="form-select" id="formWA" style="display:none;" name="keteranganSumberWA" form="formSelesai">
                        <option value="anekalifting.com / anekalifting.office@gmail.com / 081228118050" <?= ($ketarangansumber == 'anekalifting.com / anekalifting.office@gmail.com / 081228118050') ? 'selected' : '' ?>>anekalifting.com / anekalifting.office@gmail.com / 081228118050</option>
                        <option value="bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238" <?= ($ketarangansumber == 'bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238') ? 'selected' : '' ?>>bimacitranusa.com / bimacitranusa01@gmail.com / 081336758238</option>
                        <option value="forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034" <?= ($ketarangansumber == 'forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034') ? 'selected' : '' ?>>forkliftindonesia.com / forkliftindonesia999@gmail.com / 081330288034</option>
                        <option value="handpallet.info / handpalletinfo@gmail.com / 081218346968" <?= ($ketarangansumber == 'handpallet.info / handpalletinfo@gmail.com / 081218346968') ? 'selected' : '' ?>>handpallet.info / handpalletinfo@gmail.com / 081218346968</option>
                        <option value="handstacker.info / stacker.office@gmail.com / 082245874443" <?= ($ketarangansumber == 'handstacker.info / stacker.office@gmail.com / 082245874443') ? 'selected' : '' ?>>handstacker.info / stacker.office@gmail.com / 082245874443</option>
                        <option value="indohandlift.com / indohandlift.office@gmail.com / 088989372934" <?= ($ketarangansumber == 'indohandlift.com / indohandlift.office@gmail.com / 088989372934') ? 'selected' : '' ?>>indohandlift.com / indohandlift.office@gmail.com / 088989372934</option>
                        <option value="indolifting.com / indolifting@gmail.com / 081288629984" <?= ($ketarangansumber == 'indolifting.com / indolifting@gmail.com / 081288629984') ? 'selected' : '' ?>>indolifting.com / indolifting@gmail.com / 081288629984</option>
                        <option value="kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841" <?= ($ketarangansumber == 'kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841') ? 'selected' : '' ?>>kawanmultijaya.com / kawanmultijaya@gmail.com / 081334064841</option>
                        <option value="materialhandling.co.id / marketing@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / marketing@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / marketing@raxi.co.id / 081231191901</option>
                        <option value="materialhandling.co.id / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'materialhandling.co.id / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>materialhandling.co.id / medan@raxi.co.id / 081231191901</option>
                        <option value="nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611" <?= ($ketarangansumber == 'nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611') ? 'selected' : '' ?>>nagasuryateknik.com / nagasuryateknik@gmail.com / 081228811611</option>
                        <option value="ptraxi.com / sby@raxi.co.id / (031) 5013309" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / (031) 5013309') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / (031) 5013309</option>
                        <option value="ptraxi.com / jkt@raxi.co.id / (021) 29490627" <?= ($ketarangansumber == 'ptraxi.com / jkt@raxi.co.id / (021) 29490627') ? 'selected' : '' ?>>ptraxi.com / jkt@raxi.co.id / (021) 29490627</option>
                        <option value="ptraxi.com / sby@raxi.co.id / 081330118084" <?= ($ketarangansumber == 'ptraxi.com / sby@raxi.co.id / 081330118084') ? 'selected' : '' ?>>ptraxi.com / sby@raxi.co.id / 081330118084</option>
                        <option value="ptraxi.com / medan@raxi.co.id / 081231191901" <?= ($ketarangansumber == 'ptraxi.com / medan@raxi.co.id / 081231191901') ? 'selected' : '' ?>>ptraxi.com / medan@raxi.co.id / 081231191901</option>
                        <option value="rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576" <?= ($ketarangansumber == 'rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576') ? 'selected' : '' ?>>rentalhandpallet.com / rentalhandpallet@gmail.com / 081283751576</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081224302982" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081224302982') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081224302982</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081370224880</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081384457297" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081384457297') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081384457297</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081252981592" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081252981592') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081252981592</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081334108072" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081334108072') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081334108072</option>
                        <option value="servicehandpallet.com / servicehandpallet@gmail.com / 081210440276" <?= ($ketarangansumber == 'servicehandpallet.com / servicehandpallet@gmail.com / 081210440276') ? 'selected' : '' ?>>servicehandpallet.com / servicehandpallet@gmail.com / 081210440276</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302972</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081370224880</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081283579026</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081314000523</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081319301938</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081228457495</option>
                        <option value="servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973" <?= ($ketarangansumber == 'servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973') ? 'selected' : '' ?>>servicehandlift.com / servicehandpalletstacker@gmail.com / 081224302973</option>
                    </select>
                </div>
                <div class="mb-3">
                    <label class="form-label">Keperluan</label>
                    <input type="text" id="keperluan" class="form-control" name="keperluane" value="<?= $keperluan ?>" form="formSelesai" placeholder="Masukkan Keperluan">
                    <div id="keperluanItem" class="list-group"></div>
                </div>
                <div class="mb-3">
                        <label class="form-label">Note Customer</label>
                        <textarea type="text" class="form-control" name="note_telp" id="note_telp" form="formSelesai"><?= $note_telp ?></textarea>
                    </div>
            </div>
        </div>
        <button
            class="btn btnfunc"
            data-bs-toggle="modal"
            data-bs-target="#ModalTmbTelp">
            Tambah PIC
        </button>
        <!-- <button type="submit" class="btn btnfunc" name="tambah">Tambah PIC</button> -->
        <hr>
        <div class="row">
            <table class="table table-hover">
                <thead>
                    <tr style="text-align: center;">
                        <th>No</th>
                        <th>PIC</th>
                        <th>Telp PIC</th>
                        <th>Note PIC</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $no = 1;
                    $query = mysqli_query($konek, "SELECT t.idtelp_custraxi,td.iddtelp_custraxi,c.nama_customer,c.bu,c.telp,c.kota,p.idpic,p.nama_pic,p.telp_pic,p.note,t.keperluan,t.sumber,t.ket_sumber FROM telp_custraxi_detail td INNER JOIN pic p ON td.idpic = p.idpic INNER JOIN telp_custraxi t ON td.idtelp_custraxi = t.idtelp_custraxi INNER JOIN customer c ON t.idcustomer = c.idcustomer WHERE td.idtelp_custraxi = '$idtelp_custraxi'");
                    while ($row = mysqli_fetch_array($query)) {
                    ?>
                        <tr style="text-align: center;">
                            <td><?php echo $no ?></td>
                            <td><?php echo $row['nama_pic'] ?></td>
                            <td><?php echo $row['telp_pic'] ?></td>
                            <td style="text-align: left;"><?= nl2br(htmlspecialchars($row['note'])); ?></td>
                            <td>
                                <button
                                    class="btn btn-warning btn-sm"
                                    data-bs-toggle="modal"
                                    data-bs-target="#edit<?= $row['idpic']; ?>">
                                    <i class="bi bi-pencil-fill"></i>
                                </button>
                                <a href="function/function-telp.php?uedit&hps&idtelp_custraxi=<?php echo $row['idtelp_custraxi'] ?>&iddtelp_custraxi=<?php echo $row['iddtelp_custraxi'] ?>" class="btn btn-sm btn-danger"><i class="bi bi-trash3"></i></a>
                            </td>
                            <div class="modal fade" id="edit<?= $row['idpic']; ?>" tabindex="-1">
                                <div class="modal-dialog modal-lg">
                                    <div class="modal-content">
                                        <form action="function/function-telp.php?idtelp_custraxi = <?= $idtelp_custraxi ?>" method="post">
                                            <div class="modal-header">
                                                <h5 class="modal-title">Edit Data Customer</h5>
                                                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                                            </div>

                                            <div class="modal-body">
                                                <input type="text" name="idtelp_custraxi" value="<?= $idtelp_custraxi ?>" hidden>
                                                <input type="text" name="idpic" value="<?= $row['idpic']; ?>" hidden>

                                                <div class="mb-3">
                                                    <label class="form-label">PIC</label>
                                                    <?php
                                                    $pic = $row['nama_pic'];
                                                    $sapaan = 'Bapak'; // default

                                                    if (stripos($pic, 'Ibu') !== false) {
                                                        $sapaan = 'Ibu';
                                                    }

                                                    $pic = preg_replace('/\b(bapak|ibu)\b\s*/i', '', $pic);
                                                    $pic = trim($pic);
                                                    ?>
                                                    <div class="input-group">
                                                        <select class="form-select" name="tt" id="tt" style="max-width: 95px;">
                                                            <option value="Bapak" <?= $sapaan == 'Bapak' ? 'selected' : '' ?>>Bapak</option>
                                                            <option value="Ibu" <?= $sapaan == 'Ibu' ? 'selected' : '' ?>>Ibu</option>
                                                        </select>
                                                        <input type="text" class="form-control idcustomer" autocomplete="off" name="idcustomer" id="idcustomer" value="<?= $idcustomer ?>" hidden>
                                                        <input type="text" class="form-control pic" autocomplete="off" name="pic" id="pice" value="<?= $pic ?>">
                                                    </div>
                                                    <div id="picList"
                                                        class="list-group picList w-100"
                                                        style=" display:none;"></div>
                                                </div>
                                                <div class="mb-3">
                                                    <label>Telp</label>
                                                    <input type="text" name="telp" class="form-control" id="telep" value="<?= $row['telp_pic'] ?>" maxlength="50">
                                                </div>
                                                <div class="mb-3">
                                                    <label class="form-label">Note</label>
                                                    <textarea class="form-control note" name="note" id="note" style="height: 100px"><?= $note ?></textarea>
                                                    <!-- <input type="text" class="form-control" name="note" value="<?= $note ?>" placeholder="Masukkan Note"> -->
                                                </div>
                                            </div>
                                            <div class="modal-footer">
                                                <button type="submit" name="editpic" class="btn tmbdata">Update</button>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </tr>
                    <?php
                        $no++;
                    }
                    ?>
                </tbody>
            </table>
        </div>
        <div class="row">
            <form id="formSelesai" action="function/function-telp.php?idtelp_custraxi=<?php echo $idtelp_custraxi ?>" method="post">
                <button type="submit" name="selesaiedit" class="btn btn-secondary btnfunct">Selesai</button>
            </form>
        </div>
    </div>
    <div class="modal fade" id="ModalTmbTelp" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">Tambah Data PIC</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <form action="function/function-telp.php?uedit&idtelp_custraxi=<?php echo $idtelp_custraxi ?>" method="post">
                    <div class="modal-body">
                        <div class="input-group">
                            <select class="form-select" name="tt" id="tt" style="max-width: 95px;">
                                <option value="Bapak">Bapak</option>
                                <option value="Ibu">Ibu</option>
                            </select>
                            <input type="text" class="form-control idcustomer" autocomplete="off" name="idcustomer" id="idcustomer" value="<?= $idcustomer ?>" hidden>
                            <input type="text" class="form-control pic" autocomplete="off" name="pic" id="pice" placeholder="Masukkan Nama PIC">
                        </div>
                        <div id="picList"
                            class="list-group picList w-100"
                            style=" display:none;"></div>
                        <br>
                        <div class="mb-3">
                            <label class="form-label">Telp PIC</label>
                            <input type="text" class="form-control" id="telppic" autocomplete="off" name="telppic" maxlength="50" placeholder="Masukkan Telp PIC">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Note</label>
                            <textarea class="form-control note" name="note" id="note" style="height: 100px"><?= $note ?></textarea>
                            <!-- <input type="text" class="form-control" name="note" value="<?= $note ?>" placeholder="Masukkan Note"> -->
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn" name="tmbpic" style="background-color: #1E93AB;color: white;">Simpan</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <!-- customer -->
    <script src="asset/js/auto_cust.js"></script>
    <!-- pic -->
    <script src="asset/js/auto_pic.js"></script>
    <!-- wilayah -->
    <script src="asset/js/auto_wilayah.js"></script>
    <!-- keperluan -->
    <script src="asset/js/auto_keperluan.js"></script>

    <!-- <?php if ($modal === 'ModalTmbTelp'): ?>
        <script>
            document.addEventListener('DOMContentLoaded', function() {
                const modal = new bootstrap.Modal(
                    document.getElementById('ModalTmbTelp')
                );
                modal.show();
            });
        </script>
    <?php endif; ?> -->
    <script>
        function toggleChecker() {
            let nilai = document.getElementById('sumber').value;

            let formWebsite = document.getElementById('formWebsite');
            let formEmail = document.getElementById('formEmail');
            let formTelp = document.getElementById('formTelp');
            let formWA = document.getElementById('formWA');
            let selectSum = document.getElementById('selectSum');

            // sembunyikan semua dulu
            formWebsite.style.display = 'none';
            formEmail.style.display = 'none';
            formTelp.style.display = 'none';
            formWA.style.display = 'none';

            // tampilkan sesuai pilihan
            if (nilai == 'Website') {
                formWebsite.style.display = 'block';
                selectSum.style.display = 'flex';
            } else if (nilai == 'Email') {
                formEmail.style.display = 'block';
                selectSum.style.display = 'flex';
            } else if (nilai == 'Telp') {
                formTelp.style.display = 'block';
                selectSum.style.display = 'flex';
            } else if (nilai == 'WA') {
                formWA.style.display = 'block';
                selectSum.style.display = 'flex';
            }
        }

        document.getElementById('sumber').addEventListener('change', toggleChecker);
        document.addEventListener('DOMContentLoaded', toggleChecker);
    </script>
    <!-- INI FOOTER -->
    <?php
    include "asset/footer.php";
    ?>
</body>

</html>