<div class="row">

<div class="col-xl-12">
<h3>Welcome to Z-PANEL admin</h3>
<hr>
</div>
<?php 
    if(isset($_SESSION['nama_pengguna'])) {
    ?>

<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-pengumuman.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-pencil"></i> CHANGE PENGUMUMAN WEB</h4>
                    <input type="text" value="<?php ftab("pengumuman_web", "web_setting", "pengumuman_web") ?>" class="mt-3 form-control border border-info" name="pengumumanweb">
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>
</div>

<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-logo.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-mobile"></i> CHANGE LOGO</h4>
                    <input value="<?php ftab("logo_web", "web_setting", "logo_web") ?>" data-toggle="tooltip" title="Link Download In IMGBB OR go to DASHBOARD !" type="text" class="mt-3 form-control border border-info" name="logolink" placeholder="Logo Image Link" required>
                    <img class="mt-3" src="<?php ftab("logo_web", "web_setting", "logo_web") ?>" alt="No Image Logo Found" width="150" />

                    <h4 class="card-title mt-3"><i class="fas fa-mobile"></i> CHANGE Background</h4>
                    <input value="<?php ftab("bg_web", "web_setting", "bg_web") ?>" data-toggle="tooltip" title="Link Download In IMGBB OR go to DASHBOARD !" type="text" class="mt-3 form-control border border-info" name="bg" placeholder="BG Image Link" required>
                    <img class="mt-3" src="<?php ftab("bg_web", "web_setting", "bg_web") ?>" alt="No Image BG Found" width="150" />

                    <h4 class="card-title mt-3"><i class="fas fa-mobile"></i> CHANGE HEADER PROMOSI</h4>
                    <input value="<?php ftab("header_promosi", "web_setting", "header_promosi") ?>" data-toggle="tooltip" title="Link Download In IMGBB OR go to DASHBOARD !" type="text" class="mt-3 form-control border border-info" name="headepromosi" placeholder="header Promosi Link" required>
                    <img class="mt-3" src="<?php ftab("header_promosi", "web_setting", "header_promosi") ?>" alt="No Image BG Found" width="150" />

                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>
        
</div>

<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-sliderweb.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-link"></i> ADD SLIDER WEB</h4>
                    <input data-toggle="tooltip" title="Link Untuk Slider Depan Web !" type="text" class="mt-3 form-control border border-info" name="linkslider" placeholder="Link Slider" required>
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>

        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title m-b-0">List of Banner Web</h5>
                            </div>
                            <table class="table font-weight-bold text-center">
                                  <thead>
                                    <tr>
                                      <th scope="col">#</th>
                                      <th scope="col">Link Gambar Slider</th>
                                      <th scope="col">Gambar</th>
                                      <th scope="col">Action</th>
                                    </tr>
                                  </thead>
                                  <tbody>

                                  <?php
                                    $displayimg = "SELECT * FROM img_sliders ORDER BY DATE(date_sliders) DESC";
                                    $bindimg = mysqli_query($data, $displayimg);

                                        if(mysqli_num_rows($bindimg) > 0) {
                                            $n = 1;
                                            while($fetchimg = mysqli_fetch_assoc($bindimg)) {
                                                $imgsliders = $fetchimg['sliders'];
                                                $idimg = $fetchimg['id'];

                                                echo '<tr>
                                                <th scope="row">'.$n++.'</th>
                                                <form method="POST" action="config/updateslider.php?row='.$idimg.'">
                                                <td><input name="update-img" type="text" value="'.$imgsliders.'" class="form-control border border-warning" /></td>
                                                <td><a href="'.$imgsliders.'" target="_blank"><img src="'.$imgsliders.'" width="250px;" /></a></td>
                                                <td><button type="submit" class="btn btn-info">Edit</button> <a href="config/deleteslider.php?row='.$idimg.'" class="btn btn-danger"><i class="fas fa-times"></i> Remove</a></td>
                                                </form>
                                                </tr>
                                                ';

                                            }

                                        } else {

                                        }

                                    ?>


                                    

                                  </tbody>
                            </table>
                        </div>

    </div>

    
<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-bannerweb.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-link"></i> ADD BANNER BERANDA WEB</h4>
                    <input data-toggle="tooltip" title="Link Untuk Banner Depan Web !" type="text" class="mt-3 form-control border border-info" name="linkbanner" placeholder="Link Banner" required>
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>

        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title m-b-0">List of Banner Web</h5>
                            </div>
                            <table class="table font-weight-bold text-center">
                                  <thead>
                                    <tr>
                                      <th scope="col">#</th>
                                      <th scope="col">Link Gambar Banner</th>
                                      <th scope="col">Gambar</th>
                                      <th scope="col">Link Tujuan</th>
                                      <th scope="col">Action</th>
                                    </tr>
                                  </thead>
                                  <tbody>

                                  <?php
                                    $displayimg = "SELECT * FROM banner_web ORDER BY DATE(tgl_banner) DESC";
                                    $bindimg = mysqli_query($data, $displayimg);

                                        if(mysqli_num_rows($bindimg) > 0) {
                                            $n = 1;
                                            while($fetchimg = mysqli_fetch_assoc($bindimg)) {
                                                $imgsliders = $fetchimg['link_bannerweb'];
                                                $linktarget = $fetchimg['link_targetweb'];
                                                $idimg = $fetchimg['id'];

                                                echo '<tr>
                                                <th scope="row">'.$n++.'</th>
                                                <form method="POST" action="config/updatebanner.php?row='.$idimg.'">
                                                <td><input name="update-img" type="text" value="'.$imgsliders.'" class="form-control border border-warning" /></td>
                                                <td><a href="'.$imgsliders.'" target="_blank"><img src="'.$imgsliders.'" width="250px;" /></a></td>
                                                <td><input name="update-linkimg" type="text" value="'.$linktarget.'" class="form-control border border-warning" /></td>
                                                <td><button type="submit" class="btn btn-info">Edit</button> <a href="config/deletebanner.php?row='.$idimg.'" class="btn btn-danger"><i class="fas fa-times"></i> Remove</a></td>
                                                </form>
                                                </tr>
                                                ';

                                            }

                                        } else {

                                        }

                                    ?>


                                    

                                  </tbody>
                            </table>
                        </div>

    </div>



<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-wa.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-mobile"></i> CHANGE WHATSAPP</h4>
                    <p>Masukkan nomor Lengkap dengan Kode Negaranya Contoh : 62812354658</p>
                    <input onkeyup="this.value = this.value.replace(/[^a-z0-9_-]/g, '')" value="<?php ftab("wa_number", "web_setting", "wa_number") ?>" data-toggle="tooltip" title="Whatsapp Number !" type="number" class="mt-3 form-control border border-info" name="wanom" placeholder="Whatsapp number" required>
                    <p class="mt-2 text-uppercase font-weight-bold text-success"><i class="fab fa-whatsapp"></i> Nomor WA saat ini : +<?php ftab("wa_number", "web_setting", "wa_number") ?></p>
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>
        
</div>

<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-linkbo.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-link"></i> CHANGE LINKS DAFTAR & LOGIN</h4>
                    <input value="<?php ftab("link_masukbo", "web_setting", "link_masukbo") ?>" data-toggle="tooltip" title="Nama Situs/BO !" type="text" class="mt-3 form-control border border-info" name="loginlink" placeholder="Nama Situs" required>
                    <input value="<?php ftab("link_apk", "web_setting", "link_apk") ?>" data-toggle="tooltip" title="Link Untuk Apk ke BO !" type="text" class="mt-3 form-control border border-info" name="linkapk" placeholder="Apk Link" required>
                    <input value="<?php ftab("link_daftarbo", "web_setting", "link_daftarbo") ?>" data-toggle="tooltip" title="Link Untuk Daftar ke BO !" type="text" class="mt-3 form-control border border-info" name="daftarlink" placeholder="Daftar Link" required>
                    <input value="<?php ftab("link_panduan", "web_setting", "link_panduan") ?>" data-toggle="tooltip" title="Link Untuk Panduan!" type="text" class="mt-3 form-control border border-info" name="panduanlink" placeholder="Panduan Link" required>
                    <input value="<?php ftab("link_prediksi", "web_setting", "link_prediksi") ?>" data-toggle="tooltip" title="Link Untuk Blog Prediksi!" type="text" class="mt-3 form-control border border-info" name="prediksilink" placeholder="Blog Prediksi Link" required>
                    <input value="<?php ftab("link_bukti", "web_setting", "link_bukti") ?>" data-toggle="tooltip" title="Link Untuk Bukti Jackpot!" type="text" class="mt-3 form-control border border-info" name="buktilink" placeholder="Bukti Jackpot Link" required>
                    <input value="<?php ftab("link_promosi", "web_setting", "link_promosi") ?>" data-toggle="tooltip" title="Link Untuk Promosi!" type="text" class="mt-3 form-control border border-info" name="promolink" placeholder="Promosi Link" required>
                    <input value="<?php ftab("link_rtp", "web_setting", "link_rtp") ?>" data-toggle="tooltip" title="Link Untuk RTP !" type="text" class="mt-3 form-control border border-info" name="rtplink" placeholder="RTP Link" required>
                    <input value="<?php ftab("link_apk2", "web_setting", "link_apk2") ?>" data-toggle="tooltip" title="Link Untuk Telegram !" type="text" class="mt-3 form-control border border-info" name="telelink" placeholder="Telegram Link" required>
                    <input value="<?php ftab("link_rtp2", "web_setting", "link_rtp2") ?>" data-toggle="tooltip" title="Link Untuk Livechat !" type="text" class="mt-3 form-control border border-info" name="livelink" placeholder="Livechat Link" required>
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form> 
</div>




<div class="col-xl-6 mb-2">
        <form method="POST" action="config/add-footerweb.php" class="form-horizontal">
            <div class="card">
                <div class="card-body">
                    <h4 class="card-title"><i class="fas fa-pencil"></i> CHANGE FOOTER WEB</h4>
                    <textarea class="editor" class="mt-3 form-control border border-info" name="footerweb">
                        <?php ftab("footer_web", "change_text", "footer_web") ?>
                    </textarea>
                    <button type="submit" class="btn mt-3 float-right btn-primary">Submit</button>
                </div>
            </div>
        </form>

        
</div>


<div class="col-xl-6">
              <div class="card border border-warning">
                    <form method="POST" action="config/add-infoweb.php" class="form-horizontal">
                        <div class="card-body">
                            <h4 class="card-title"><i class="fas fa-mobile"></i> CHANGE INFO WEB DEPAN</h4>
                            <div class="form-group row">
                                <div class="col-sm-12">
                                    <!-- <input data-toggle="tooltip" title="Gambar Kontak" type="text" class="form-control" name="addconimg" placeholder="Link Gambar Kontak" required> -->
                                    <textarea class="editor" name="infoweb-text" style="height: 300px; width: 100%;"><?php ftab('web_infos', 'web_setting', 'web_infos'); ?></textarea>
                                </div>
                            </div>

                        <div class="border-top">
                            <div class="card-body">
                                <button type="submit" class="btn float-right btn-primary">Submit</button>
                            </div>
                        </div>
                    </form>

                    
                </div>
             </div>

             </div>


    <div class="col-xl-6">
              <div class="card border border-warning">
                    <form method="POST" action="config/add-con.php" class="form-horizontal">
                        <div class="card-body">
                            <h4 class="card-title"><i class="fas fa-mobile"></i> CHANGE CONTACT INFORMATION</h4>
                            <div class="form-group row">
                                <div class="col-sm-12">
                                    <!-- <input data-toggle="tooltip" title="Gambar Kontak" type="text" class="form-control" name="addconimg" placeholder="Link Gambar Kontak" required> -->
                                    <textarea class="editor" name="contact-text" style="height: 300px; width: 100%;"><?php ftab('isi_kontak', 'web_setting', 'isi_kontak'); ?></textarea>
                                </div>
                            </div>

                        <div class="border-top">
                            <div class="card-body">
                                <button type="submit" class="btn float-right btn-primary">Submit</button>
                            </div>
                        </div>
                    </form>

                    
                </div>
             </div>
        <?php 

                }

        ?>
             </div>

</div>
             



        <p>We have some list for you to understand the method to Add / Edit / Update Image in Zpanel.</p>
        <ol>
                <li>To update image you must go to this website <a href="https://imgbb.com/" target="_blank">IMGBB (Click Here)</a>. <br><br>
                    <img src="assets/images/tutorial/img-1.PNG" class="img-fluid border border-danger" alt=""> <hr>
                </li>

                <li>Click Start Uploading and find the image you want to upload. Click Upload button to upload the image. <strong>Always select "DONT AUTODELETE" the image in the "auto delete image form"</strong> <br><br>
                    <img src="assets/images/tutorial/img-2.PNG" class="img-fluid border border-danger" alt=""> <hr>
                </li>

                <li>After upload change the "Embed Codes" to "HTML full linked" <br><br>
                    <img src="assets/images/tutorial/img-3.PNG" class="img-fluid border border-danger" alt=""> <hr>
                </li>

                <li>Copy the link only until the pic format just like the picture below. Example the image I upload format is <strong>.PNG</strong> <br><br>
                    <img src="assets/images/tutorial/img-4.PNG" class="img-fluid border border-danger" alt=""> <hr>
                </li>

                <li>Paste the link of the image that you desire to change / edit the Image of your WEBPAGE. <br><br>
                    <img src="assets/images/tutorial/img-5.PNG" class="img-fluid border border-danger" alt=""> <hr>
                </li>
        </ol>
    </div>
</div>