<!-- index.php -->
<?php 
include ('includes/header.php');

$table_name = 'name';
$page_name = 'text_logo';
$data = ['fname' => 'NexTV','parto' => 'Nex','partt' => ' TV'];

$db->insertIfEmpty($table_name, $data);

$res = $db->select($table_name, '*', '', '');

if(isset($_POST['submit'])){
    unset($_POST['submit']);
    $updateData = $_POST;
    $db->update($table_name, $updateData, 'id = :id',[':id' => 1]);
    echo "<script>window.location.href='". $page_name.".php'</script>";
}


?>
<style>
  .responsive-logo {
    margin-top: 20px;
    width: 300px;
    height: 170px;
  }

  @media (max-width: 768px) {
    .responsive-logo {
      width: 100%;
      height: auto;
    }
  }
</style>
<!-- Form Start -->
<div class="container-fluid pt-4 px-4">
    <div class="row g-4">
        <div class="col-12">
            <div class="bg-secondary rounded h-100 p-4">
                <h2 class="mb-4">Text logo</h6>
                    <form method="post">
                        <div class="mb-3">
                            <label class="form-label">Full name of the app</label>
                            <input type="text" name="fname" class="form-control" value="<?=$res[0]['fname'] ?>">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Text Logo Part one</label>
                            <input type="text" name="parto" class="form-control" value="<?=$res[0]['parto'] ?>">
                        </div>
                        <div class="mb-3">
                            <label class="form-label">Text Logo Part two</label>
                            <input type="text" name="partt" class="form-control" value="<?=$res[0]['partt'] ?>">
                        </div>
                        <button type="submit" name="submit" class="btn btn-primary">Update Text logo</button>

                        <div class="mb-3" style="margin-top: 20px;">
                            <img src="img/text_logo.png" alt="Text Logo" class="responsive-logo">
                        </div>
                    </form>
            </div>
        </div>
    </div>
</div>
<!-- Form End -->

<!-- Footer Start -->
<?php include ('includes/footer.php');?>
<!-- Footer End -->
</body>

</html>