 <?php
    //include('../include/config.php');
    error_reporting(0);
    $cname='';
    $loc='';
    $address='';
    $mission='';
    $vision='';
    $cont='';
    $nhif='';
    $nssf='';
    $pension='';
    $kra='';
    $core='';
    $company_id='';
    $cstructure='';
      $query=mysqli_query($con,"select * FROM companydata");
      while($row=mysqli_fetch_array($query))
      {
        $cname=htmlentities($row['School']);
        $loc=htmlentities($row['Location']);
        $address=htmlentities($row['Addres']);
        $mission=htmlentities($row['Mission']);
        $vision=htmlentities($row['Vision']);
        $cont=htmlentities($row['Contact']);
        $email=htmlentities($row['Email']);;
      }

  ?>
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h4 class="m-0">Update School Data</h4>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item">Dashboard</li>
              <li class="breadcrumb-item ">Extra</li>
              <li class="breadcrumb-item active">School Data</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    
 
    <section class="content">
      <div class="row">
       <div class="col-md-12 col-sm-12 col-12">
            <div class="info-box">
       <!-- //Starting here -->
             <div class="col-5 col-sm-3">
                <div class="nav flex-column nav-tabs h-100" id="vert-tabs-tab" role="tablist" aria-orientation="vertical">
                  <a class="nav-link active" id="vert-tabs-home-tab" data-toggle="pill" href="#vert-tabs-home" role="tab" aria-controls="vert-tabs-home" aria-selected="true">Overview</a>
                  <a class="nav-link" id="vert-tabs-profile-tab" data-toggle="pill" href="#vert-tabs-profile" role="tab" aria-controls="vert-tabs-profile" aria-selected="false"> Company Profile</a>
                  <!--a class="nav-link" id="vert-tabs-messages-tab" data-toggle="pill" href="#tabfiles" role="tab" aria-controls="vert-tabs-messages" aria-selected="false">File Attachment</a-->
                   <a class="nav-link" id="vert-tabs-messages-tab" data-toggle="pill" href="#tabbankdata" role="tab" aria-controls="vert-tabs-messages" aria-selected="false">Bank Details</a>
                </div>
              </div>
              
               <div class="col-7 col-sm-9">
                <div class="tab-content" id="vert-tabs-tabContent">
                  <div class="tab-pane text-left fade show active" id="vert-tabs-home" role="tabpanel" aria-labelledby="vert-tabs-home-tab">
                      <h5>Overview</h5>
    
                    <div class="card card-primary">
                    <div class="card-body">
    
                  <h4 class="fst-italic"><strong><?php echo $cname;?></strong></h4>

                  <input type="hidden" id="idholder" value="<?php echo $sid;?>">
                  <table class="table">
                      <tr><td>
                  <div class="row">
                    <div class="col-lg-3 col-md-4 label ">Address</div>
                    <div class="col-lg-9 col-md-8"><?php echo $address;?></div>
                  </div>
                  </td></tr>
                  <tr><td>
                  <div class="row">
                    <div class="col-lg-3 col-md-4 label">Contact</div>
                    <div class="col-lg-9 col-md-8"><?php echo $cont;?></div>
                  </div>
                  </td></tr>
                  <tr><td>

                  <div class="row">
                    <div class="col-lg-3 col-md-4 label">Mission Statement</div>
                    <div class="col-lg-9 col-md-8"><?php echo $mission;?></div>
                  </div>
                  </td></tr>
                <tr><td>
                  <div class="row form-group">
                    <div class="col-lg-3 col-md-4 label">Vision Statement</div>
                    <div class="col-lg-9 col-md-8"><?php echo $vision;?></div>
                  </div>
                  </td></tr>
                  </table>
                  </div>
                  </div>
            
                  </div>
                  
           <div class="tab-pane fade" id="vert-tabs-profile" role="tabpanel" aria-labelledby="vert-tabs-profile-tab">
                     <h5>School Details</h5>
                     
            <form method="POST" action="" id="orgadataform" enctype="multipart/form-data" novalidate onsubmit="return false;">
              <div class="row">
                <div class="col-md-6">
                  <div class="card card-primary">
                    <div class="card-header">
                    
        
                      <div class="card-tools">
                        <button type="button" class="btn btn-tool" data-card-widget="collapse" title="Collapse">
                          <i class="fas fa-minus"></i>
                        </button>
                      </div>
                    </div>
                    <div class="card-body">
                      <div class="form-group">
                        <label for="inputName">School Name <span class="requireds">*</span></label>
                        <input type="text" id="cname" value="<?php echo $cname; ?>" class="form-control" required>
                      </div>
                      <div class="form-group">
                        <label for="inputDescription">Location</label>
                        <input type="text" id="location" value="<?php echo $loc; ?>" class="form-control" >
                      </div>
                     
                      <div class="form-group">
                        <label for="inputProjectLeader">Address <span class="requireds">*</span></label>
                        <input type="text" id="address" value="<?php echo $address; ?>" class="form-control" required />
                      </div>
                   
                      <div class="form-group">
                        <label for="inputClientCompany">Contact <span class="requireds">*</span></label>
                        <input type="text" id="contact" value="<?php echo $cont; ?>" class="form-control" required>
                      </div>
                      
                      <div class="form-group">
                        <label for="inputClientCompany">School Email <span class="requireds">*</span></label>
                        <input type="text" id="email" value="<?php echo $email; ?>" class="form-control" required>
                      </div>
                      
                      <div class="form-group">
                        <label for="inputClientCompany">Mission Statement</label>
                        <input type="text" id="mission" value="<?php echo $mission; ?>" class="form-control" >
                      </div>
                      
                      <div class="form-group">
                        <label for="inputClientCompany">Vision Statement</label>
                        <input type="text" id="vision" value="<?php echo $vision; ?>" class="form-control" >
                      </div>
                      
                       <div class="form-group">
                           <center><label id="orgasavemsg"></label></center>
                            <button class="btn btn-info pull-right btn-sm" id="saveschoolinfo">Submit <i class="fa fa-paper-plane"></i></button>
                       </div>
                      
                          </div>
                          
                          </div>
                        </div>
                    </div>  
              
            </form> 
              
           </div>
           
            <div class="tab-pane fade" id="tabfiles" role="tabpanel" aria-labelledby="vert-tabs-profile-tab">
                             <h4>Upload School Files</h4>
                             
            </div>
            
             <div class="tab-pane fade" id="tabbankdata" role="tabpanel" aria-labelledby="vert-tabs-profile-tab">
                             <h4>Bank Details</h4>
                  <form method="POST" action="" onsubmit="return false">
                <div class="row">
              
                <div class="col-md-5">
                    <div class="form-group">
                    <label for="inputProjectLeader">Bank Name</label>
                    <input type="text" class="form-control" name="" id="inputbname" required />
                    </div>
                </div>
                
                <div class="col-md-4">
                    <div class="form-group">
                    <label for="inputProjectLeader">Bank Account</label>
                    <input type="text" class="form-control" name="" id="inputact" required />
                    </div>
                </div>
                <div class="col-md-3">
                     <div class="form-group">
                         <label id="bankmessage" style="color:#FFF">.</label> <br />
                    <button style="margin-right:0px;position:relative" class="btn btn-info btn-sm pull-right" id="savebanks">Save <i class="fa fa-save"></i>
                    </button>
               </div>
                </div>
               
                </div>
                 </form>
                             
             <div class="table-responsive">
                 <table class="table table-bordered" id="tablebankdata">
                     <thead>
                         <tr>
                             <th colspan="5" class="alert-warning">Registered Banks</th>
                         </tr>
                         <tr>
                             <th>#</th>
                             <th>Bank Name</th>
                             <th>Account</th>
                             <th>Last Update</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                            <?php
                        $sql = "select * from bankdata order by Bname DESC";
                        $result = $con->query($sql);
                        if ($result->num_rows > 0) 
                        {
                            $cnt='1';
                            while($row = $result->fetch_assoc()) 
                            {
                            ?>	
                            <tr>
                        <td><?php echo $cnt; ?></td>
                        <td><?php echo $row["Bname"]; ?></td>
                        <td><?php echo $row["Account"]; ?></td>
                        <td><?php echo $row["Lastupdate"]; ?></td>
                        <td>
                            <input type="hidden" name="bid" class="bid" value="<?php echo $row["id"]; ?>" />
                            <i class="fa fa-edit text-green bankedit btn-xs" id="bed"></i> | <i class="fa fa-trash btn-xs text-danger" id="bankdelete"></i>
                        </td>
                            </tr>
                            <?php
                            $cnt=$cnt+1;
                            }
                        }
                            ?>
                     </tbody>
                 </table> 
              </div>
            </div>
          </div>
      </div>
    </section>
</div>

