<?php 
    require("header.php")
?>


    <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <!-- <h1>Panel Setting</h1> -->
          </div>
          <div class="col-sm-6">
      
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
       
        <div class="col-md-12">
        
            <!-- general form elements -->
            <div class="card card-secondary">
              <div class="card-header">
                <h3 class="card-title">Panel Setting</h3>
                <ol class="breadcrumb float-sm-right">
                  <li class="breadcrumb-item"><a href="#">Home</a></li>
                  <li class="breadcrumb-item">Setting</li>
                  <li class="breadcrumb-item active">Panel Setting</li>
                </ol>
              </div>
              <!-- /.card-header -->
              <!-- form start -->
              
              <div class="card-body">
                
              <?php if (isset($_GET['error'])) { ?>
                        <div class="alert alert-denger  col-12" >
                                <p class="error"><?php echo $_GET['error']; ?></p>
                          </div>
                        
                      

                        <?php } ?>
                        <?php if (isset($_GET['success'])) { ?>
                          <div class="alert alert-success  col-12" >
                              <p class="success"><?php echo $_GET['success']; ?></p>
                              </div>
                          
                      
                        <?php } ?>
                      <form action="panel_setting_code.php" method="post" enctype="multipart/form-data">
                        <?php 
                        include("connection.php");
                        $username=$_SESSION['username'];
                        $sql="SELECT * FROM user_admin WHERE username='$username' ";
                        $res=mysqli_query($conn,$sql);
                        while($row=mysqli_fetch_array($res))
                        {
                          
                        ?>
                        <div class="row">
                          <div class="col-sm-6">
                            <!-- text input -->
                            <div class="form-group">
                              <label>Title<span style="color:blue; font-size:25px;">*</span> </label>
                              <input type="text" name="title" value="<?php echo $row['title']; ?>" class="form-control" placeholder="Enter ...">
                            </div>
                          </div>
                          <div class="col-sm-6">
                    
                          <div class="form-group">
                              <label for="exampleInputFile">Logo<span style="color:blue; font-size:25px;">*</span> </label>
                              <div class="input-group">
                              <div class="custom-file">
                                  <input type="file" class="custom-file-input" id="exampleInputFile"  name="logo"  accept="img/*" onchange="loadFile(event)">
                                  <label class="custom-file-label" for="exampleInputFile"><?php echo $row['logo']; ?></label>
                              </div>
                          
                              </div>
                            </div>
                          </div>
                        </div>
                  
                        <div class="row">
                          <div class="col-sm-6">
                            <div class="form-group">
                              <label>Support Number<span style="color:blue; font-size:25px;">*</span> </label>
                              <input type="text" class="form-control" name="number" value="<?php echo $row['number']; ?>"  placeholder="Enter ...">
                            </div>
                          </div>
                        
                      
                          <div class="col-sm-6">
                            <div class="form-group">
                              <label>Support Email<span style="color:blue; font-size:25px;">*</span> </label>
                              <input type="text" class="form-control" name="support_email" value="<?php echo $row['support_email']; ?>"  placeholder="Enter ...">
                            </div>
                          </div>
                          
                        </div>
                    
                        <div class="row">
                        <div class="col-12">
                          
                              <div class="col-2  float-right">
                                <button  type="submit" name="update" class="btn btn-dark  btn-lg btn-block" style="font-size: 16px; height: 40px;"><span >Update</span></button>
                              </div>
                              <div class="col-2  float-right" >

                              <button  type="reset" class="btn btn-dark  btn-lg btn-block" style="font-size: 16px; height: 40px;">Clear</button>
                              </div>
                
          
                          </div>
                          </div>
                    
                      
                  <?php  } ?>
                    <!-- /.card-body -->
                    </form>
              </div>
            </div>
            </div>
            
            </div>
            <!-- /.card -->

          


          </div>
          
     
     
        <!-- /.row -->
       
      <!-- /.container-fluid -->
    </section>
    <!-- /.content -->

    
  </div>
  <!-- for searching -->
  <script>
          var loadFile = function(event) {
              var image = document.getElementById('output');
              image.src=URL.createObjectURL(event.target.files[0]);
          };
      </script>
 <!-- searching end -->

 <!-- pagination -->
 
<?php 
    require("footer.php")
?>