<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">
            <h5 class="m-0">Tours</h5>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item">Dashboard</li>
              <li class="breadcrumb-item ">Income</li>
              <li class="breadcrumb-item ">Other Earnings</li>
              <li class="breadcrumb-item ">Tour Payment</li>
              <li class="breadcrumb-item active">Tours</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-5 col-sm-5 col-5">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="far fa-dollar"></i></span>
              <?php
                include('../include/config.php');
                $result = mysqli_query($con,"SELECT SUM(Amount) as ama FROM TourPayment where Year='$year'");
                while($row = $result->fetch_assoc()) 
                {
                  $totincome=$row["ama"];
                }
                ?>
              <div class="info-box-content">
                <span class="info-box-text">Tour Income Year -   (<small><?php echo $year;?></small>)</span>
            <h4 class="info-box-number budge"><?php echo $totincome.' Ksh'; ?></h4>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
           <div class="col-md-3 col-sm-3 col-6">
            <div class="info-box">
              <div class="info-box-content">
                 <a href="index.php?page=Other_Earning" class="btn btn-success"> <i class="fa fa-arrow-left"></i> Other Income </a>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          
           <div class="col-md-3 col-sm-3 col-6">
            <div class="info-box">
              <div class="info-box-content">
                 <a href="index.php?page=Tour_Payment" class="btn btn-info" id=""> <i class="fa fa-arrow-left"></i> Tour Payment </a>
              </div>
              <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
          </div>
          </div>
         </div>
    </section>
          
    
    <section class="content" style="text-decoration:none;font-weight:normal;font-family:Times;font-size:12px">
           <div class="row">
              <div class="col-md-4"> 
              <h5 class="m-0 alert-success">Add New Tour Data</h5>
                <div class="modal-body panel-primary">
                  <form action="" method="POST" onsubmit="return false">
                   
                      <div class="form-group">
                      <label for="inputProjectLeader">Tour Title <span class="requireds">*</span></label>
                      <input type="text" class="form-control" name="" id="tourtit" required />
                      </div>
                      
                      <div class="form-group">
                      <label for="inputProjectLeader">From (Date)  <span class="requireds">*</span></label>
                      <input type="date"  class="form-control" name="" id="tourdate" required />
                      </div>
                      
                      <div class="form-group">
                      <label for="inputProjectLeader">To (Date) </span></label>
                      <input type="date"  class="form-control" name="" id="tourdate2" required />
                      </div>
                     
                     <div class="form-group">
                      <label for="inputProjectLeader">Any other info? </label>
                      <textarea class="form-control" id="tourdesc"></textarea>
                     </div>
                    
                     <div class="form-group">
                         <label id="otherincomemsg" style="color:#FFF">.</label> <br />
                         <button style="margin-right:0px;position:relative" class="btn btn-info btn-sm pull-right" id="submittourdata">Submit <i class="fa fa-paper-plane"></i>
                        </button>
                     </div>
                  </form>
                </div>
              </div>
               
             <div class="col-md-8">  
             <div class="table-responsive" id="divbus">
                 <table class="table table-bordered table-secondary" id="tabletour" >
                     <thead>
                         <tr>
                             <th>#</th>
                             <th>Tour Title</th>
                             <th>Tour Date</th>
                             <th>Description</th>
                             <th>Entry Date</th>
                             <th>Action</th>
                         </tr>
                     </thead>
                     <tbody>
                        <?php
                        //include('../include/config.php');
                        $sql = "select * from Tours order by id 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["Title"]; ?></td>
                        <td class="alert-success">
                            <?php
                            $d1=$row["Dat1"];
                            $d2=$row["Dat2"];
                            
                            if($d2=='')
                            {
                            echo $row["Dat1"];
                            }else
                            {
                            echo $d1.' to '.$d2;
                            }
                            ?>
                        </td>
                        <td><?php echo $row["TDes"]; ?></td>
                        <td> <?php echo $row["EntryDate"]; ?></td>
                        <td>
                        <input type="hidden" name="otid" class="tid" value="<?php echo $row["id"]; ?>" />
                        <i class="fa fa-trash btn-xs text-danger deletetourdata btn" id="otherdelete">
                        </i>
                        </td>
                            </tr>
                            <?php
                            $cnt=$cnt+1;
                            }
                        }
                            ?>
                     </tbody>
                 </table> 
              </div>
              </div>
              
            </div>
    </section>
</div>

