<?php
$pageNum = @$_GET['page'];
if ($pageNum == NULL || $pageNum =='0') {$pageNum = 1;   }
$resultsPerPage='50';
$limit1 = $pageNum * $resultsPerPage - $resultsPerPage;
$limit2 =  $resultsPerPage;

$thecats=$this->db->query("select * from site_catagory");
$thsersftsy=$thecats->result_array();
  foreach($thsersftsy as $thedats_0 ){
    $categories[] = array("id" => $thedats_0['ctid'], "val" => $thedats_0['name']);
  }

  $thecats2=$this->db->query("select * from site_sub_cat");
$thsersftsy2=$thecats2->result_array();
  foreach($thsersftsy2 as $thedats_2 ){
    $subcats[$thedats_2['sc_ctid']][] = array("id" => $thedats_2['sc_id'], "val" => $thedats_2['sc_name']);
  }

  $thecats23=$this->db->query("select * from mr_sub2");
$thsersftsys2=$thecats23->result_array();
  foreach($thsersftsys2 as $thedats_2s ){
    $subcatss[$thedats_2s['mr_sub2_sid']][] = array("id" => $thedats_2s['mr_sub2_id'], "val" => $thedats_2s['mr_sub2_name']);
  }

  @$jsonCats = json_encode($categories);
  @$jsonSubCats = json_encode(@$subcats);
  @$jsonSubCats2 = json_encode(@$subcatss);
?>

          <div class="row ml-0">
            <?php
              $sub_perform = $this->uri->segment(4);
                switch($sub_perform){
                  case 'add-admin': 
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $getalladmins=$this->db->query("select * from admin where aid='$aid'");
                    $atheadmins=$getalladmins->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                  <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Add Admin users</h5>
                                                <div>
                                                  <div style="height: 200px;overflow: hidden;"><img src="https://images.pexels.com/photos/1714208/pexels-photo-1714208.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" class="img-fluid"></div>
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/admin',this,'error_div','loder_div','#','1','success');">
                                                      <input type="hidden" name="todo" value="<?=$todoedit?>">
                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-user mr-2"></span> Name</span> </div>
                                                        <input type="text" class="form-control" name="name" placeholder="Name of Admin" value="<?=@$atheadmins['name']?>">
                                                      </div>

                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-user-o mr-2"></span> User Name*</span> </div>
                                                        <input type="text" class="form-control" name="u" placeholder="This will be used to login" value="<?=@$atheadmins['user']?>">
                                                      </div>
                                                    
                                                    <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-lock mr-2"></span> Password*</span> </div>
                                                        <input type="password" class="form-control" name="pass" placeholder="Password" value="">
                                                      </div>
                                                    
                                                    <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-envelope mr-2"></span> Email</span> </div>
                                                        <input type="text" class="form-control" name="email" placeholder="Email for refrance only" value="<?=@$atheadmins['email']?>">
                                                      </div>
                                                      <div class="input-group mt-3 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><input aria-label="Checkbox for following text input" type="checkbox" class="" value="2" name="rights" <?php if(@$atheadmins['rights'] =='2'){echo "checked";}?> ></span></div>
                                                          <span class="form-control">
                                                          Do you want to give this user edit rights?</span>
                                                        </div>
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                    </form>

                                                </div>
                                            </div>
                                        </div>
                                        <?php 
                                        $getalladmins=$this->db->query("select * from admin");
                                        $atheadmins=$getalladmins->result_array();
                                        $sr=1;
                                        ?>
                                        <div class="col-sm-5 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Admins</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Email</th>
                                                <th>Username</th>
                                                <th>Rights</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($atheadmins as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$mess['name']?></td>
                                                <td><?=$mess['email']?></td>
                                                <td><?=$mess['user']?></td>
                                                <td><?=$mess['rights']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['aid']?>&what=adm" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php 
                  break;
                  case 'admins':
                        $getalladmins=$this->db->query("select * from admin");
                        $atheadmins=$getalladmins->result_array();
                        $sr=1;
                        ?>
                                        <div class="col-sm-8 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Admins</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Email</th>
                                                <th>Username</th>
                                                <th>Rights</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($atheadmins as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$mess['name']?></td>
                                                <td><?=$mess['email']?></td>
                                                <td><?=$mess['user']?></td>
                                                <td><?=$mess['rights']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action_custom/delete')?>?id=<?=$mess['aid']?>&what=adm" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/add-admin?edit=')?><?=$mess['aid']?>">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                 <?php
                  break;

                  case 'contact-details': 
            $getalladats_amin=$this->db->query("select * from admin_files where asid='1' ");
            $thedata=$getalladats_amin->row_array();
                  ?>
                    <div class="main-card mb-3 card col-sm-6 ml-3">
                                            <div class="card-body"><h5 class="card-title">Contact Details</h5>
                                                <div>
                                                  <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/google',this,'error_div','loder_div','#','1','success');">
                                                    <input type='hidden' name='step' value='1'>
                                                    <div class="input-group mb-2">
                                                      <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-globe mr-2"></span> Website Name</span></div>
                                                        <input placeholder="Website Name" type="text" class="form-control" name="web" value="<?=$thedata['name']?>"></div>

                                                        <div class="input-group mb-2">
                                                      <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-user mr-2"></span> YOUR NAME</span></div>
                                                        <input placeholder="Your Name" type="text" class="form-control" name="name" value="<?=$thedata['founder']?>"></div>

                                                        <div class="input-group mb-2">
                                                        <div class="input-group-prepend"><span class="input-group-text">@ YOUR EMAIL</span></div>
                                                        <input placeholder="Email to be shown on website" name="email" type="text" class="form-control" value="<?=$thedata['email']?>" ></div>
                                                    
                                                    <div class="input-group mb-2">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-phone mr-2"></span> Phone Number</span></div>
                                                        <input placeholder="Phone Number" type="text" name="phone" class="form-control" value="<?=$thedata['phone']?>" ></div>
                                                    
                                                    <div class="input-group mb-2">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-map-marker mr-2" ></span> Address </span></div>
                                                        <!-- <input placeholder="Address" step="1" type="text" class="form-control"> -->
                                                        <textarea name="add" placeholder="address" required="" class="form-control"><?=$thedata['address']?></textarea>
                                                        
                                                    </div>

                                                    <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                  </form>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="main-card mb-3 card col-sm-4 ml-4">
                                            <div class="card-body"><h5 class="card-title">Google Map</h5>
                                              <small>You can get a map for free from here: <a href="https://www.embedgooglemap.net/"> Map Link </a></small>
                                                <div>
                                                  <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/google',this,'error_div','loder_div','#','1','success');">
                                                    <input type='hidden' name='step' value='1.1'>
                                                      <textarea name="map" placeholder="Google Map" class="form-control" style="height: 200px;"><?=$thedata['map']?></textarea>
                                                    <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                  </form>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="main-card mb-3 card col-sm-5 p-2 pt-0 ml-3">
                                          <div style="overflow: hidden;">
                                                  <?=$thedata['map']?>
                                                </div>
                                        </div>
                  <?php 
                  break;

                  case 'social-media': 
                  $sm=$this->db->query("select * from admin_socialm");
                        $social=$sm->row_array();
                  ?>
                     <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Add your social Media</h5>
                                                <div>
                                                  <div style="height: 200px;overflow: hidden;"><img src="https://images.pexels.com/photos/147413/twitter-facebook-together-exchange-of-information-147413.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" class="img-fluid"></div>
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/sm',this,'error_div','loder_div','#','1','success');">

                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-facebook mr-2"></span> Facebook</span> </div>
                                                        <input type="text" class="form-control" name="fb" placeholder="your Facebook link" value="<?=$social['fb']?>">
                                                      </div>

                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-twitter mr-2"></span> Twitter</span> </div>
                                                        <input type="text" class="form-control" name="tw" placeholder="your twitter link" value="<?=$social['tw']?>">
                                                      </div>
                                                    
                                                    <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-instagram mr-2"></span> Instagram</span> </div>
                                                        <input type="text" class="form-control" name="insta" placeholder="Instagram Link" value="<?=$social['insta']?>">
                                                      </div>
                                                    
                                                    <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-globe mr-2"></span> Blog</span> </div>
                                                        <input type="text" class="form-control" name="blog" placeholder="Blog link" placeholder="" value="<?=$social['blog']?>">
                                                      </div> <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-globe mr-2"></span> Linked In</span> </div>
                                                        <input type="text" class="form-control" name="linkedin" placeholder="linkedin link" placeholder="" value="<?=$social['linkedin']?>">
                                                      </div>
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                    </form>

                                                </div>
                                            </div>
                                        </div>

                                        

                  <?php break;

                  case 'APP': 
                  $sm=$this->db->query("select * from admin_socialm");
                        $social=$sm->row_array();
                  ?>
                     <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Add your APPs</h5>
                                                <div>
                                                  <div style="height: 200px;overflow: hidden;"><img src="https://images.pexels.com/photos/356056/pexels-photo-356056.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" class="img-fluid"></div>
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/app',this,'error_div','loder_div','#','1','success');">

                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-android mr-2"></span> Android APP</span> </div>
                                                        <input type="text" class="form-control" name="and" placeholder="your Android APP link" value="<?=$social['app_and']?>">
                                                      </div>

                                                      <div class="input-group mt-3 col-12 p-0">
                                                        <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-apple mr-2"></span> IOS APP Link</span> </div>
                                                        <input type="text" class="form-control" name="ios" placeholder="your IOS APP Link" value="<?=$social['app_ios']?>">
                                                      </div>
                                                      <div class="col-12"><input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold px-4 pull-right" value="SAVE DATA">
                                                      </div>
                                                </div>
                                            </div>
                                        </div>

                                        

                  <?php break;

                  case 'about':
                  $getbrief=$this->db->query("select * from admin_files where asid='1' ");
                  $getbrief_data=$getbrief->row_array();

                  $page_data=get_page_data('about','na');
                  ?>
                    <div class="main-card mb-3 card col-12">
                                            <div class="card-body"><h5 class="card-title">About your company</h5>
                                                <div>
                                                  <!-- <img src="https://cdn.pixabay.com/photo/2016/05/04/07/56/businessman-1370983_960_720.jpg" class="img-fluid"> -->
                                                    <form class="form-horizontal row form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/google',this,'error_div','loder_div','#','1','success');">
                                                      <input type="hidden" name="step" value="2">
                                                    <div class="form-group mt-3 col-sm-6">
                                                      <label>Brief about your company. This may be shown at <b>footer and emails.</b><br/>
                                                        <small>220 charecors would be perfect.</small>
                                                      </label>
                                                      <textarea name="brief" placeholder="Brief about your company." class="form-control" style="height: 150px;"><?=$getbrief_data['brief']?></textarea>
                                                    </div>

                                                    <div class="form-group col-sm-6">
                                                      <label>About us page of your website.<br/>
                                                      </label>
                                                      <textarea name="about" placeholder="About your business." class="form-control rich_text" id='rich_text12_90' style="height:900px;" ><?=$page_data['content']?></textarea>
                                                    </div>
                                                        
                                                      <div class="col-12"><input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold px-4 pull-right" value="SAVE DATA">
                                                      </div>

                                                    </form>

                                                </div>
                                            </div>
                                        </div>
                  <?php 
                  break;

                  case 'scripts':
                  $getbrief=$this->db->query("select * from admin_files where asid='1' ");
                  $getbrief_data=$getbrief->row_array();
                  ?>
                    <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Scripts</h5>
                                                <div>
                                                  <div style="height: 200px;overflow: hidden;"><img src="https://images.pexels.com/photos/270404/pexels-photo-270404.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260" class="img-fluid"></div>
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/google',this,'error_div','loder_div','#','1','success');">
                                                      <input type="hidden" name="step" value="3">
                                                    <div class="form-group mt-3">
                                                      <label><b>All the codes you can to add in head section</b></label>
                                                      <textarea name="f" placeholder="All Html Codes in Head" class="form-control" style="height: 100px;"><?=$getbrief_data['f']?></textarea>
                                                    </div><div class="form-group mt-3">
                                                      <label><b>Google Analytics</b></label>
                                                      <textarea name="ga" placeholder="GA" class="form-control" style="height: 100px;"><?=$getbrief_data['ga']?></textarea>
                                                    </div><div class="form-group mt-3">
                                                      <label><b>Live Chat</b></label>
                                                      <textarea name="chat" placeholder="Live chat" class="form-control" style="height: 100px;"><?=$getbrief_data['chat']?></textarea>
                                                    </div><div class="form-group mt-3">
                                                      <label><b>Javascript funnctions</b></label>
                                                      <textarea name="f2" placeholder="JS codes" class="form-control" style="height: 100px;"><?=$getbrief_data['f2']?></textarea>
                                                    </div>

                                                    
                                                        
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                    </form>

                                                </div>
                                            </div>
                                        </div>
                  <?php 
                  break;

                  case 'users':
                  if(isset($_GET['utp']) && $_GET['utp'] !=''){
                    $theusrt=xss_clean($_GET['utp']);
                    $getall_mems=$this->db->query("select * from site_mem where user_type='$theusrt' order by mid desc limit $limit1, $limit2");
                  }else{
                  $getall_mems=$this->db->query("select * from site_mem order by mid desc limit $limit1, $limit2");
                  }
                  $members_are=$getall_mems->result_array();
                  $sr=1;
                  ?>

                            <div class="col-12 pl-0">
                                <div class="main-card mb-3 card">
                                  <div class="text-right m-2 pr-5"><a href="<?=base_url('index.php/admin_action_custom/download_data?what=users')?>" download><h5 class="card-title">Download Data</h5></a> </div>
                                    <div class="card-header">All Users
                                        <!-- <div class="btn-actions-pane-right">
                                            <div role="group" class="btn-group-sm btn-group">
                                                <button class="active btn btn-focus">Last Week</button>
                                                <button class="btn btn-focus">All Month</button>
                                            </div>
                                        </div> -->
                                    </div>
                                    <div class="table-responsive">
                                        <table class="align-middle mb-0 table table-borderless table-striped table-hover">
                                            <thead>
                                            <tr>
                                                <th class="text-left">#</th>
                                                <th>Name</th>
                                                <th class="text-left">Phone</th>
                                                <th class="text-left">Address</th>
                                                <th class="text-left">Date Created / Last Seen </th>
                                                <th class="text-left">Gender / DOB</th>
                                                <!-- <th class="text-left">Refer Code / Refer By</th>
                                                <th class="text-left">User Type</th> -->
                                                <th class="text-left">Status</th>
                                                <th class="text-left">Type</th>
                                                <th class="text-left">Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($members_are as $members){ ?>
                                            <tr>
                                                <td class="text-left text-muted">#<?=$sr?></td>
                                                <td>
                                                    <div class="widget-content p-0">
                                                        <div class="widget-content-wrapper">
                                                            <div class="widget-content-left mr-3">
                                                                <div class="widget-content-left">
                                                                    <img width="40" class="rounded-circle" src="<?=base_url('assets/mem/')?><?=$members['mid']?>/img/<?=$members['photo']?>" alt="">
                                                                </div>
                                                            </div>
                                                            <div class="widget-content-left flex2">
                                                                <div class="widget-heading"><?=$members['name']?></div>
                                                                <div class="widget-subheading opacity-7"><?=$members['email']?><br/><?php if($members['pass_nc'] !=''){?>Password: <?=$members['pass_nc']?> <?php } ?></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="text-left"> +91 <?=$members['contact']?><br/>
                                                  <a href="tel:<?=$members['contact']?>"><span class="fa fa-phone mr-3"></span></a>
                                                  <a target="_blank" href="http://wa.me/91<?=$members['contact']?>"><span class="fa fa-whatsapp"></span></a>
                                                </td>
                                                <td class="text-left"><?=$members['address']?> <?=$members['user_city_name']?> <?=$members['user_state_name']?> </td>
                                                <td class="text-left"><?=date_format_1($members['date'],'1')?><br/>
                                                  <?=date_format_1($members['last_seen'],'1')?></td>
                                                <td class="text-left"><?=$members['gender']?> <br/> <?=date_format_1($members['user_dob'],'1')?></td>
                                                <!-- <td class="text-left"><?=$members['user_reffer']?> <br/> <?=$members['user_reffer_by']?> </td>
                                                <td class="text-left"><a href="<?=base_url('admin/perform/web/users?utp=')?><?=$members['user_type']?>"><?=read_me_user('user_type',$members['user_type'])?></a></td> -->
                                                <td class="text-left"><?=read_me_user('user_status',$members['user_status'])?></td>
                                                <td class="text-left"><?=read_me_user('user_type_status',$members['user_type'])?></td>
                                                <td class="text-left">
                                                  <div class="mr-2 btn-group">
                                            <button class="btn btn-outline-secondary">Options</button>
                                            <button type="button" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" class="dropdown-toggle-split dropdown-toggle btn btn-outline-secondary"><span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                          <div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu">

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=active_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Enable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=ban_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Disable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=reset_pass" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Reset Password</button></a>

                                                <div tabindex="-1" class="dropdown-divider"></div>
                                                <a onclick="return confirm('Do you really want to delete this user, you can ban the user as well.');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$members['mid']?>&what=user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Delete</button></a>
                                            </div>
                                        </div>
                                                </td>
                                                
                                            </tr>
                                            <?php $sr++; } ?>
                                            </tbody>
                                        </table>
                                          <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>
                                    </div>
                                    <div class="d-block text-center card-footer">
                                        <!-- <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button>
                                        <button class="btn-wide btn btn-success">Save</button> -->
                                    </div>
                                </div>
                            </div>
                        
                  <?php 
                  break;
                  case 'contacts': 
              if(isset($_GET['con_type'])&&$_GET['con_type']>0){
                $con_type=$_GET['con_type'];
                $getallmesgaes=$this->db->query("select * from site_contact where con_type='$con_type' order by msid desc limit $limit1, $limit2");
              }else{
              $getallmesgaes=$this->db->query("select * from site_contact order by msid desc limit $limit1, $limit2");
              }$theallamesages=$getallmesgaes->result_array();
              $sr=1;
                  ?>
                    <div class="col-12 pl-0">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Contact Requests</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Email</th>
                                                <th>Phone</th>
                                                <th style="max-width: 450px;">Message</th>
                                                <!-- <th>Details</th> -->
                                                <th>Date</th>
                                                <th>IP</th>
                                                <th>Document/Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($theallamesages as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$mess['name']?></td>
                                                <td><a href="mailto: <?=$mess['email']?>"><?=$mess['email']?></a></td>
                                                <td><?=$mess['phone']?></td>
                                                <td style="max-width: 450px;"><?=trim_text($mess['msg'],200,'...')?>
                                                  <a href="<?=base_url('admin/perform/web/contacts_det?id=')?><?=$mess['msid']?>"> Read More </a>
                                                </td>
                                                <td><?=date_format_1($mess['date'],1)?></td>
                                                <td><?=$mess['ip']?></td>
                                                <td><?php if($mess['document']!=''){ ?><a href="<?=base_url('assets/avator/upload/')?><?=$mess['document']?>" download>Document</a><br><?php } ?>
                                                  <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['msid']?>&what=msg" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;

                  case 'contacts_det':
                  $msid=$_GET['id'];
                  $getallmesgaes=$this->db->query("select * from site_contact where msid='$msid'"); 
                  $mess=$getallmesgaes->row_array();
                  ?>

                  <div class="main-card mb-3 card col-sm-8">
                      <div class="card-body"><h5 class="card-title">Message</h5> 
                        <b><?=$mess['name']?></b><br/>
                        <a href="mailto: <?=$mess['email']?>"><?=$mess['email']?></a><br/>
                        <?=$mess['phone']?><br/>
                        <hr/>
                        <br/><br/><?=$mess['msg']?><br/><br/>
                        <hr/>
                        <td><?=date_format_1($mess['date'],1)?></td>
                        <br/><?=$mess['ip']?><br/>
                        <br/><?php if($mess['document']!=''){ ?><a href="<?=base_url('assets/avator/upload/')?><?=$mess['document']?>" download>Document</a><br><?php } ?>
                        <br/>  <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['msid']?>&what=msg" >
                          <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                      </div>
                  </div>

                  <?php 
                  break;

                  case 'call-backs': 
              $getallmesgaes=$this->db->query("select * from site_callback order by clid desc limit $limit1, $limit2");
              $theallamesages=$getallmesgaes->result_array();
                  ?>
                    <div class="col-sm-7 pl-0">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Call Backs</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Mobile</th>
                                                <th>Date</th>
                                                <th>Name</th>
                                                <th>IP</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($theallamesages as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$mess['clid']?></th>
                                                <td><?=$mess['cl_mobile']?></td>
                                                <td><?=date_format_1($mess['cl_date'],1)?></td>
                                                <td><?=$mess['cl_name']?></td>
                                                <td><?=$mess['cl_ip']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['clid']?>&what=clb" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;
            case 'subscribe': 
              $getallmesgaes=$this->db->query("select * from site_subscribe order by sbc_id desc limit $limit1, $limit2");
              $theallamesages=$getallmesgaes->result_array();
              $sr=1;
                  ?>
                    <div class="col-sm-6 pl-0">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Subscribers</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Email</th>
                                                <th>Date</th>
                                                <th>IP</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($theallamesages as $mess){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$mess['sbc_email']?></td>
                                                <td><?=date_format_1($mess['sbc_date'],1)?></td>
                                                <td><?=$mess['sbc_ip']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$mess['sbc_id']?>&what=subs" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;
                  case 'testimonials': ?>
                    <?php 
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $gettex=$this->db->query("select * from admin_testimonials where tid='$aid' ");
                    $atheadmins=$gettex->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                  <div class="main-card mb-3 card col-sm-6">
                      <div class="card-body"><h5 class="card-title">Testimonials</h5>
                          <div>
                            <img src="https://cdn.pixabay.com/photo/2019/03/18/09/38/feedback-4062738_960_720.jpg" class="img-fluid">
                              <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_testimonials')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_testimonials')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_proile22w'>

                                <input type="hidden" name="todo" value="<?=$todoedit?>">
                                <div class="input-group mt-3 col-12 p-0">
                                  <div class="input-group-prepend"><span class="input-group-text"><span class="fa fa-user mr-2"></span> Name</span> </div>
                                  <input type="text" class="form-control" name="name" placeholder="Name" value="<?=@$atheadmins['name']?>">
                                </div>

                                <div class="input-group mt-3 col-12 p-0">
                                  <div class="input-group-prepend"><span class="input-group-text"> Company</span> </div>
                                  <input type="text" class="form-control" name="company" placeholder="Company" value="<?=@$atheadmins['company']?>">
                                </div>
                              
                              <div class="input-group mt-3 col-12 p-0">
                                  <div class="input-group-prepend"><span class="input-group-text"> Profile*</span> </div>
                                  <input type="text" class="form-control" name="desi" placeholder="Role" value="<?=@$atheadmins['role']?>">
                                </div>

                                <div class="input-group mt-3 col-12 p-0">
                                  <div class="input-group-prepend"><span class="input-group-text"> Order to show</span> </div>
                                  <input type="text" class="form-control" name="order" placeholder="order" value="<?=@$atheadmins['li']?>">
                                </div>
                              
                              <div class="input-group mt-3 col-12 p-0">
                                  <div class="input-group-prepend"><span class="input-group-text">Text</span> </div>
                                  <textarea class="form-control" name="text"><?=@$atheadmins['text']?></textarea>
                                </div>
                                <div class="input-group mt-3 p-0">
                                    <span class="form-control">
                                    <input type="file" name="image_name" id="image_name">
                                  </div>
                                <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                              </form>

                          </div>
                      </div>
                  </div>
                  <?php 
                  $gettex=$this->db->query("select * from admin_testimonials order by li asc");
                  $thedatss=$gettex->result_array();
                  $sr=1;
                  ?>
                  <div class="col-sm-12 pl-2">
                      <div class="main-card mb-3 card">
                          <div class="card-body"><h5 class="card-title">Testimonials</h5>
                              <table class="mb-0 table">
                                  <thead>
                                  <tr>
                                      <th>#</th>
                                      <th>Photo</th>
                                      <th>Name</th>
                                      <th>Message</th>
                                      <th>Status</th>
                                      <th>Action</th>
                                  </tr>
                                  </thead>
                                  <tbody>
                                    <?php foreach($thedatss as $testimonials){ ?>
                                  <tr>
                                      <th scope="row"><?=$sr?></th>
                                      <td><img width="40" class="rounded-circle" src="<?=base_url('assets/avator/webimg/t/')?><?=$testimonials['image']?>" alt=""></td>

                                      <td style="min-width: 130px;"><?=$testimonials['name']?> <br/>
                                      <small><?=$testimonials['company']?><br/><?=$testimonials['role']?></small></td>
                                      <td><?=$testimonials['text']?></td>
                                      <td><?=read_me_user('test_status',$testimonials['status'])?></td>
                                      <td>
                                      <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['tid']?>&what=tst" >
                                        <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                        <a href="<?=base_url('index.php/admin/perform/web/testimonials?edit=')?><?=$testimonials['tid']?>">
                                        <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                        <!-- <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$testimonials['tid']?>&what=pending_tm">
                                        <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="fas fa-thumbs-down"></i></button></a>
                                        <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$testimonials['tid']?>&what=approve_tm">
                                        <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="fas fa-thumbs-up"></i></button></a> -->
                                      </td>
                                  </tr>
                                <?php $sr++; } ?>
                                  </tbody>
                              </table>

                               <div class="col-12">
                                  <nav class="mt-4" aria-label="Page navigation example">
                                  <ul class="pagination">
                                      <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                      <?php
                                      $pagesare=$pageNum;
                                      for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                      $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                      ?>
                                      <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                      <?php } } ?>
                                      <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                  </ul>
                              </nav>
                                </div>

                          </div>
                      </div>
                  </div>
                  <?php break;
                  case 'page-about':
                  $page_data=get_page_data('about','na');
                  ?>
                    <div class="main-card mb-3 card col-sm-6">
                        <div class="card-body"><h5 class="card-title">About your company</h5>
                            <div>
                              <img src="https://cdn.pixabay.com/photo/2016/05/04/07/56/businessman-1370983_960_720.jpg" class="img-fluid">
                                <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/page_data',this,'error_div','loder_div','#','1','success');">
                                  <input type="hidden" name="page" value="about">
                                <div class="form-group mt-3">
                                  <hr/>
                                  <label>About us page of your website.<br/>
                                  </label>
                                  <textarea name="text" placeholder="About your business." class="form-control rich_text" id='rich_text12_90'><?=$page_data['content']?></textarea>
                                </div>
                                    
                                  <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                </form>

                            </div>
                        </div>
                    </div>
                  <?php 
                  break; 
                  case 'c-blocks':
                  @$the_block=xss_clean($_GET['block']);
                  $page_data=get_page_data($the_block,$the_block);
                  if(@$_GET['block'] !=''){$send_meher='page_data';}else{$send_meher='add_page_data';}
                  ?>
                    <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Website Content Blocks </h5>
                                                <div>
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/<?=$send_meher?>',this,'error_div','loder_div','#','1','success');">
                                                      <label>Unique Name of the block</label>
                                                      <input type="text" name="page" value="<?=@$page_data['name']?>" class="form-control" placeholder="Block Name">
                                                      <input type="hidden" name="page_id" value="<?=@$page_data['pid']?>">
                                                      <select class="form-control my-2" name="type2" >
                                                        <option>Select Content type</option>
                                                        <option value="a">Series A</option>
                                                        <option value="b">Series B</option>
                                                        <option value="c">Series C</option>
                                                        <option value="d">Series D</option>
                                                        <option value="e">Series E</option>
                                                        <option value="f">Series F</option>
                                                      </select>

                                                    <div class="form-group mt-3">
                                                      <hr/>
                                                      <label>Content.<br/>
                                                      </label>
                                                      <textarea name="text" placeholder="About your business." class="form-control rich_text" id='rich_text12_90'><?=$page_data['content']?></textarea>
                                                    </div>
                                                        
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold px-5" value="SAVE DATA">
                                                    </form>
                                                </div>
                                                  <div class="mt-3 pull-right">
                                                    <a onclick="return confirm('are you sure you want to delete this?');" href="<?=base_url('admin_action/delete')?>?id=<?=$the_block?>&what=block_co">
                                                      <i class="fa fa-trash mr-1"></i> Delete
                                                    </a>
                                                  </div>
                                            </div>
                                        </div>

                                        <?php 
                                        $get_all_blocks=$this->db->query("select * from admin_pages where name !='' ");
                                        $the_pages_data=$get_all_blocks->result_array();
                                        ?>
                                        <div class="col-sm-4 pl-2">
                                          <div class="main-card mb-3 card">
                                            <div class="card-body">
                                              <h5 class="card-title">Block</h5>
                                              <div class="row">
                                                <?php 
                                                foreach($the_pages_data as $bloks_data){ ?>
                                                    <div class="col-sm-6 text-uppercase py-1" style="border-bottom: 1px solid #eee;">
                                                      <a href="<?=base_url('admin/perform/web/c-blocks?block=')?><?=$bloks_data['pid']?>"><i class="fa fa-file mr-2"> </i><?=$bloks_data['name']?> <?=$bloks_data['type']?></a>
                                                    </div>
                                                <?php } ?>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                  <?php 
                  break; case 'page-terms':
                  $page_data=get_page_data('terms','na');
                  ?>
                    <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Terms</h5>
                                                <div>
                                                  <img src="https://cdn.pixabay.com/photo/2017/02/18/02/59/application-2076445_960_720.png" class="img-fluid">
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/page_data',this,'error_div','loder_div','#','1','success');">
                                                      <input type="hidden" name="page" value="terms">
                                                    <div class="form-group mt-3">
                                                      <hr/>
                                                      <label>About us page of your website.<br/>
                                                      </label>
                                                      <textarea name="text" placeholder="About your business." class="form-control rich_text" id='rich_text12_90'><?=$page_data['content']?></textarea>
                                                    </div>
                                                        
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                    </form>

                                                </div>
                                            </div>
                                        </div>
                  <?php 
                  break;case 'page-privacy':
                  $page_data=get_page_data('privacy','na');
                  ?>
                    <div class="main-card mb-3 card col-sm-6">
                                            <div class="card-body"><h5 class="card-title">Privacy</h5>
                                                <div>
                                                  <img src="https://cdn.pixabay.com/photo/2017/02/18/02/59/application-2076445_960_720.png" class="img-fluid">
                                                    <form class="form-horizontal form-label-left" onsubmit="return ajaxsubmitform('<?=base_url()?>index.php/admin_action/page_data',this,'error_div','loder_div','#','1','success');">
                                                      <input type="hidden" name="page" value="privacy">
                                                    <div class="form-group mt-3">
                                                      <hr/>
                                                      <label>About us page of your website.<br/>
                                                      </label>
                                                      <textarea name="text" placeholder="About your business." class="form-control rich_text" id='rich_text12_90'><?=$page_data['content']?></textarea>
                                                    </div>
                                                        
                                                      <input type="submit" name="" class="mt-2 btn-warning active btn py-2 text-white text-bold btn-block" value="SAVE DATA">
                                                    </form>

                                                </div>
                                            </div>
                                        </div>
                  <?php 
                  break;
                  case 'search':
                  $q=$_GET['q'];
                  
                  $getall_flav=$this->db->query("select * from site_mem where (name like '%$q%' || email like '%$q%' || mid like '%$q%' || contact='$q' ) order by mid desc limit 30");
                  $theflav_data=$getall_flav->result_array();
                  ?>

<!--<div class="col-sm-12">
    <div class="main-card mb-3 card">
        <div class="card-body"><h5 class="card-title">All Courses</h5>   
        <div class="pull-right" style="width: 130px;"><a href="<?=base_url('index.php/admin_action_custom/download_data?what=cou')?>" download><h5 class="card-title">Download Data</h5></a> </div>     
            <div class="table-responsive">
                <table class="mb-0 table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>Course Name</th>
                        <th>Image</th>
                        <th><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>">Category Name</a></th>
                        <th><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>">Merchant Name</a></th>
                        <th>Price</th>
                        <th>Date</th>
                        <th>Modified On</th>
                        <th>Featured</th>
                        <th>Source<br><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>">Code</a></th>
                        <th>Status</th>
                        <th style="width: 30px;">Action </th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($theflav_data as $flav_details){ 
                      if($flav_details['cou_feat']==0){
                        $fea="Featured";
                      }
                      else {
                        $fea="Non-Featured";
                      }
                      ?>
                    <tr>
                        <th scope="row"><?=$flav_details['cou_id']?></th>                                
                        <td><?=$flav_details['cou_name']?></td>
                        <td><img src="<?=$flav_details['cou_img']?>" style="height: 40px;"></td>
                        <td><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>?cat=<?=url_smart($flav_details['cou_cat'])?>"><?=$flav_details['cou_cat']?></td>
                        <td><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>?mer=<?=url_smart($flav_details['cou_merchant_name'])?>"><?=@$flav_details['cou_merchant_name']?></a></td>
                        <td><?=@$flav_details['cou_price']?></td>
                        <td><?=date("d-m-Y",strtotime($flav_details['cou_date']));?></td>
                        <td><?=date("d-m-Y",strtotime($flav_details['cou_edit_date']));?></td>
                        <td class="text-left"><?=read_me_user('cou_feat',$flav_details['cou_feat'])?></td>
                        <td><?=@$flav_details['cou_source']?><br><a href="<?=base_url('index.php/admin/perform/custom/all-course')?>?code=<?=$flav_details['cou_xls_code']?>"><?=@$flav_details['cou_xls_code']?></a></td>
                        <td class="text-left"><?=read_me_user('cou_status',$flav_details['cou_status'])?></td>
                        <td> 
                          <div class="mr-2 btn-group">
                          <button class="btn btn-outline-secondary">View</button>
                          <button type="button" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" class="dropdown-toggle-split dropdown-toggle btn btn-outline-secondary"><span class="sr-only">Toggle Dropdown</span>
                          </button>
                        <div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu">
                              <a href="<?=base_url('index.php/admin_action_custom/modify')?>?id=<?=$flav_details['cou_id']?>&what=<?=$fea?>"><button type="button" tabindex="0" class="dropdown-item"><?=$fea?></button></a>
                              <a href="<?=base_url('index.php/admin_action_custom/modify')?>?id=<?=$flav_details['cou_id']?>&what=enable_cou"><button type="button" tabindex="0" class="dropdown-item">Enable</button></a>
                              <a href="<?=base_url('index.php/admin_action_custom/modify')?>?id=<?=$flav_details['cou_id']?>&what=disable_cou"><button type="button" tabindex="0" class="dropdown-item">Disable</button></a>
                              <div tabindex="-1" class="dropdown-divider"></div>
                              <a href="<?=base_url('index.php/admin/perform/custom/edit-course?couID=')?><?=$flav_details['cou_id']?>"><button type="button" tabindex="0" class="dropdown-item">Edit Course</button></a>
                              <a href="<?=base_url('course/')?><?=$flav_details['cou_id']?>/<?=url_smart($flav_details['cou_name'])?>" target="_blank"><button type="button" tabindex="0" class="dropdown-item">View Course</button></a>                  
                              <a onclick="return confirm('are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action_custom/delete')?>?id=<?=$flav_details['cou_id']?>&what=course" >
                                <button type="button" tabindex="0" class="dropdown-item">Delete</button></a>
                          </div>
                      </div>
                        </td>
                    </tr>
                      <?php }//foreach ?>
                    </tbody>
                </table>
            </div>
            <nav class="mt-4" aria-label="Page navigation example">
                <ul class="pagination">
                    <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                    <?php
                    $pagesare=$pageNum;
                    for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                    $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                    ?>
                    <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                    <?php } } ?>
                    <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                </ul>
            </nav>
        </div>
    </div>
  </div>-->   
        <?php
                  $getall_mems=$this->db->query("select * from site_mem order by mid desc limit $limit1, $limit2");
                  $members_are=$getall_mems->result_array();
                  $sr=1;
                  ?>

                            <div class="col-12 pl-0">
                                <div class="main-card mb-3 card">
                                  <div class="text-right m-2 pr-5"><a href="<?=base_url('index.php/admin_action_custom/download_data?what=users')?>" download><h5 class="card-title">Download Data</h5></a> </div>
                                    <div class="card-header">All Users
                                        <!-- <div class="btn-actions-pane-right">
                                            <div role="group" class="btn-group-sm btn-group">
                                                <button class="active btn btn-focus">Last Week</button>
                                                <button class="btn btn-focus">All Month</button>
                                            </div>
                                        </div> -->
                                    </div>
                                    <div class="table-responsive">
                                        <table class="align-middle mb-0 table table-borderless table-striped table-hover">
                                            <thead>
                                            <tr>
                                                <th class="text-left">#</th>
                                                <th>Name</th>
                                                <th class="text-left">Phone</th>
                                                <th class="text-left">Address</th>
                                                <th class="text-left">Date Created / Last Seen </th>
                                                <th class="text-left">Gender / DOB</th>
                                                <!-- <th class="text-left">Refer Code / Refer By</th>
                                                <th class="text-left">User Type</th> -->
                                                <th class="text-left">Status</th>
                                                <th class="text-left">Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($members_are as $members){ ?>
                                            <tr>
                                                <td class="text-left text-muted">#<?=$sr?></td>
                                                <td>
                                                    <div class="widget-content p-0">
                                                        <div class="widget-content-wrapper">
                                                            <div class="widget-content-left mr-3">
                                                                <div class="widget-content-left">
                                                                    <img width="40" class="rounded-circle" src="<?=base_url('assets/mem/')?><?=$members['mid']?>/img/<?=$members['photo']?>" alt="">
                                                                </div>
                                                            </div>
                                                            <div class="widget-content-left flex2">
                                                                <div class="widget-heading"><?=$members['name']?></div>
                                                                <div class="widget-subheading opacity-7"><?=$members['email']?><br/><?php if($members['pass_nc'] !=''){?>Password: <?=$members['pass_nc']?> <?php } ?></div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </td>
                                                <td class="text-left"> +91 <?=$members['contact']?><br/>
                                                  <a href="tel:<?=$members['contact']?>"><span class="fa fa-phone mr-3"></span></a>
                                                  <a target="_blank" href="http://wa.me/91<?=$members['contact']?>"><span class="fa fa-whatsapp"></span></a>
                                                </td>
                                                <td class="text-left"><?=$members['address']?> <?=$members['user_city_name']?> <?=$members['user_state_name']?>  </td>
                                                <td class="text-left"><?=date_format_1($members['date'],'1')?><br/>
                                                  <?=date_format_1($members['last_seen'],'1')?></td>
                                                <td class="text-left"><?=$members['gender']?> <br/> <?=date_format_1($members['user_dob'],'1')?></td>
                                                <!-- <td class="text-left"><?=$members['user_reffer']?> <br/> <?=$members['user_reffer_by']?> </td>
                                                <td class="text-left"><a href="<?=base_url('admin/perform/web/users?utp=')?><?=$members['user_type']?>"><?=read_me_user('user_type',$members['user_type'])?></a></td> -->
                                                <td class="text-left"><?=read_me_user('user_status',$members['user_status'])?></td>
                                                <td class="text-left">
                                                  <div class="mr-2 btn-group">
                                            <button class="btn btn-outline-secondary">Options</button>
                                            <button type="button" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" class="dropdown-toggle-split dropdown-toggle btn btn-outline-secondary"><span class="sr-only">Toggle Dropdown</span>
                                            </button>
                                          <div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu">

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=active_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Enable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=ban_user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Disable User</button></a>

                                                  <a href="<?=base_url('index.php/admin_action/user_modify')?>?id=<?=$members['mid']?>&what=reset_pass" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Reset Password</button></a>

                                                <div tabindex="-1" class="dropdown-divider"></div>
                                                <a onclick="return confirm('Do you really want to delete this user, you can ban the user as well.');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$members['mid']?>&what=user" >
                                                  <button type="button" tabindex="0" class="dropdown-item">Delete</button></a>
                                            </div>
                                        </div>
                                                </td>
                                                
                                            </tr>
                                            <?php $sr++; } ?>
                                            </tbody>
                                        </table>
                                          <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+10; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>
                                    </div>
                                    <div class="d-block text-center card-footer">
                                        <!-- <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button>
                                        <button class="btn-wide btn btn-success">Save</button> -->
                                    </div>
                                </div>
                            </div>


                  <?php
                  break;
                  case 'img-logo': 
                   $getaction='add_image';
                    $theidval='';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $id=$_GET['edit'];
                    $getslider_details=$this->db->query("select * from site_img where img_id='$id' ");
                    $theimage_details3=$getslider_details->row_array();
                    $getaction='edit_image';
                    $theidval=$_GET['edit'];
                  }
                  ?>
                   <div class="main-card mb-3 card">
                      <div class="card-header">Change Your Logo</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;background:#333;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new logo.</h5>
                          Because of cache you may not see new logo updated instant so you <br/> need to use a private mode or clear your cache to see your updated logo.<br/>

                          <p> Make sure you are adding horizontal image in the size of <b>220px width Maximum</b> and hight as per your image.</p>
                          <form method="post" action="<?=base_url('index.php/admin_action/')?><?=$getaction?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/')?><?=$getaction?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data">
                            <input type="hidden" name="what" value="logo">
                            <input type="hidden" name="imageid" value="<?=$theidval?>">
                            
                            <select name="ex" class="form-control col-sm-6 mb-2">
                              <option value="w">Dark Logo</option>
                              <option value="b">Light Logo</option>
                            </select>
                            <?php if(isset($_GET['edit']) && $_GET['edit'] !=''){ echo "You are editing the logo now. <br/>Please select a new logo. <br/>"; } ?>
                              <input type="file" name="file_name"><br/>
                            <button class="btn mt-2 btn-warning">Change Logo</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php $get_sliders=$this->db->query("select * from site_img where img_place='logo' and img_status='1' order by img_sort asc limit 10");
                    $allsliedsrss=$get_sliders->result_array(); ?>
                    <div class="col-sm-6">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">All Sliders</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Image</th>
                                                <th>Text</th>
                                                <th>Link</th>
                                                <th>Status</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php 
                                              foreach($allsliedsrss as $slider2){ ?>
                                            <tr>
                                                <th scope="row"><?=$slider2['img_sort']?></th>
                                                <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['img_name']?>" style='height:40px;'></td>
                                                <td><?=$slider2['img_text']?></td>
                                                <td><?=$slider2['img_link']?></td>
                                                <td><?=$slider2['img_status']?></td>
                                                <td style="min-width: 120px;">
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['img_id']?>&what=img" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/img-logo')?>?edit=<?=$slider2['img_id']?>">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                  <?php 
                  break;

                  case 'img-slider': 
                    $getaction='add_image';
                    $theidval='';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $id=$_GET['edit'];
                    $getslider_details=$this->db->query("select * from site_img where img_id='$id' ");
                    $theimage_details3=$getslider_details->row_array();
                    $getaction='edit_image';
                    $theidval=$_GET['edit'];
                  }
                  ?>
                   <div class="main-card mb-3 card">
                      <div class="card-header">Add / Remove sliders</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          Because of cache you may not see new Image updated instant so you <br/> need to use a private mode or clear your cache to see your updated Image.<br/>

                          <p> Make sure you are adding horizontal image in the size of <b>1200px width Minimum</b> and hight as per your image.<br/> <b> Also please make sure all the images are of same height</b></p>
                          <form method="post" action="<?=base_url('index.php/admin_action/');?><?=$getaction?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/')?><?=$getaction?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data">
                            <input type="hidden" name="what" value="slider1">
                            <input type="hidden" name="imageid" value="<?=$theidval?>">
                            <input type="text" name="text" placeholder="Text" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_text']?>" >
                            <input type="text" name="sort" placeholder="Order" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_sort']?>" >
                            <input type="text" name="link" placeholder="link" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_link']?>" >
                              <input type="file" name="file_name"><br/>
                            <button class="btn mt-2 btn-warning">Add Slider</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    $get_sliders=$this->db->query("select * from site_img where img_place='slider1' and img_status='1' order by img_sort asc limit 10");
                    $allsliedsrs=$get_sliders->result_array();
                    $sr=1;
                     ?>
                    <div class="col-md-6">
                                <div class="main-card mb-3 card">
                                    <div class="card-body">
                                        <h5 class="card-title">Slider Images</h5>
                                        <div id="carouselExampleControls2" class="carousel slide carousel-fade" data-ride="carousel">
                                            <div class="carousel-inner">
                                                <?php $i='active'; foreach($allsliedsrs as $slidersr){ ?>
                                                <div class="carousel-item <?=$i?>">
                                                    <img class="d-block w-100" src="<?=base_url('assets/avator/upload/')?><?=$slidersr['img_name']?>" alt="First slide">
                                                    <div class="carousel-caption d-none d-md-block">
                                                        <!-- <h5>First Slide</h5> -->
                                                        <p><?=$slidersr['img_text']?></p>
                                                    </div>
                                                </div>
                                                <?php $i=''; } ?>
                                            </div>
                                            <a class="carousel-control-prev" href="#carouselExampleControls2" role="button" data-slide="prev">
                                                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                                                <span class="sr-only">Previous</span>
                                            </a>
                                            <a class="carousel-control-next" href="#carouselExampleControls2" role="button" data-slide="next">
                                                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                                                <span class="sr-only">Next</span>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            
                            <div class="col-12 pl-0">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">All Sliders</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Image</th>
                                                <th>Text</th>
                                                <th>Link</th>
                                                <th>Status</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php 
                                              foreach($allsliedsrs as $slider2){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['img_name']?>" style='height:40px;'></td>
                                                <td><?=$slider2['img_text']?></td>
                                                <td><?=$slider2['img_link']?></td>
                                                <td><?=$slider2['img_status']?></td>
                                                <td style="min-width: 120px;">
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['img_id']?>&what=img" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/img-slider')?>?edit=<?=$slider2['img_id']?>">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                  <?php 
                  break;

                  case 'img-about': 
                    $getaction='add_image';
                    $theidval='';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $id=$_GET['edit'];
                    $getslider_details=$this->db->query("select * from site_img where img_id='$id' ");
                    $theimage_details3=$getslider_details->row_array();
                    $getaction='edit_image';
                    $theidval=$_GET['edit'];
                  }
                  ?>
                   <div class="main-card mb-3 card">
                      <div class="card-header">Add / Remove about</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo-b.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          Because of cache you may not see new Image updated instant so you <br/> need to use a private mode or clear your cache to see your updated Image.<br/>

                          <p> Make sure you are adding horizontal image in the size of <b>1200px width Minimum</b> and hight as per your image.<br/> <b> Also please make sure all the images are of same height</b></p>
                          <form method="post" action="<?=base_url('index.php/admin_action/');?><?=$getaction?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/')?><?=$getaction?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data">
                            <input type="hidden" name="what" value="about">
                            <input type="hidden" name="imageid" value="<?=$theidval?>">
                            <input type="text" name="text" placeholder="Text" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_text']?>" >
                            <input type="text" name="sort" placeholder="Order" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_sort']?>" >
                            <input type="text" name="link" placeholder="link" class="form-control mb-2 col-sm-6" value="<?=@$theimage_details3['img_link']?>" >
                              <input type="file" name="file_name"><br/>
                            <button class="btn mt-2 btn-warning">Add about</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    $get_sliders=$this->db->query("select * from site_img where img_place='about' and img_status='1' order by img_sort asc limit 10");
                    $allsliedsrs=$get_sliders->result_array();
                     ?>
                            
                            <div class="col-sm-6">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">All About</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Image</th>
                                                <th>Text</th>
                                                <th>Link</th>
                                                <th>Status</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php 
                                              foreach($allsliedsrs as $slider2){ ?>
                                            <tr>
                                                <th scope="row"><?=$slider2['img_sort']?></th>
                                                <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['img_name']?>" style='height:40px;'></td>
                                                <td><?=$slider2['img_text']?></td>
                                                <td><?=$slider2['img_link']?></td>
                                                <td><?=$slider2['img_status']?></td>
                                                <td style="min-width: 120px;">
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['img_id']?>&what=img" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/img-about')?>?edit=<?=$slider2['img_id']?>">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                  <?php 
                  break;

                  case 'img-others': 
                    $getaction='add_image';
                    $theidval='';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $id=$_GET['edit'];
                    $getslider_details=$this->db->query("select * from site_img where img_id='$id' ");
                    $theimage_details3=$getslider_details->row_array();
                    $getaction='edit_image';
                    $theidval=$_GET['edit'];
                  }
                  ?>
                   <div class="main-card mb-3 card">
                      <div class="card-header">Add / Remove Image</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          Because of cache you may not see new Image updated instant so you <br/> need to use a private mode or clear your cache to see your updated Image.<br/>

                          <p> Make sure you are adding horizontal image in the size of <b>1200px width Minimum</b> and hight as per your image.<br/> <b> Also please make sure all the images are of same height</b></p>
                          <form method="post" action="<?=base_url('index.php/admin_action/');?><?=$getaction?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/')?><?=$getaction?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data" >
                            <input type="hidden" name="what" value="others">
                            <input type="hidden" name="imageid" value="<?=$theidval?>">
                            <textarea class="form-control mb-2 rich_text" id="s_s9iskls90s" placeholder="text" name="text"><?=@$theimage_details3['img_text']?></textarea>
                          <div class="row my-2">
                            <div class="col-sm-6"><input type="text" name="sort" placeholder="Order" class="form-control col-12" value="<?=@$theimage_details3['img_sort']?>" ></div>
                            <div class="col-sm-6"><input type="text" name="link" placeholder="link" class="form-control col-12" value="<?=@$theimage_details3['img_link']?>" ></div>
                          </div>

                          <div class="row my-2">
                            <div class="col-sm-6"><input type="text" name="head" placeholder="Heading" class="form-control col-12" value="<?=@$theimage_details3['img_head']?>" ></div>
                            <div class="col-sm-6"><select class="form-control" name="typename">
                                <!-- <option value="logow">logo Light BG</option>
                                <option value="logob">logo Dark BG</option> -->
                                <option value="sli" <?php if(@$_GET['pag_d']=='sli'){echo "selected";} ?>  >Slider</option>
                                <option value="sli2" <?php if(@$_GET['pag_d']=='sli2'){echo "selected";} ?> >Slider 2</option>
                                <option value="v1" <?php if(@$_GET['pag_d']=='v1'){echo "selected";} ?>  > Video 1</option>
                                <option value="v2" <?php if(@$_GET['pag_d']=='v2'){echo "selected";} ?>  >Video 2</option>
                                <option value="team_p" <?php if(@$_GET['pag_d']=='team_p'){echo "selected";} ?>  >Team Page</option>
                                <option value="team" <?php if(@$_GET['pag_d']=='team'){echo "selected";} ?>  >Team Members</option>
                                <option value="AB" <?php if(@$_GET['pag_d']=='AB'){echo "selected";} ?>  >Advisory Board</option>
                                <option value="home" <?php if(@$_GET['pag_d']=='home'){echo "selected";} ?>  >Home Page</option>
                                <option value="inv" <?php if(@$_GET['pag_d']=='inv'){echo "selected";} ?>  >Invest Page</option>
                                <option value="brandl" <?php if(@$_GET['pag_d']=='brandl'){echo "selected";} ?>  >Brand Logo</option>
                                <option value="rfnd" <?php if(@$_GET['pag_d']=='rfnd'){echo "selected";} ?>  >Raise Funds Page</option>
                                <option value="acc" <?php if(@$_GET['pag_d']=='acc'){echo "selected";} ?>  >Accelerator Page</option>
                                <option value="prt" <?php if(@$_GET['pag_d']=='prt'){echo "selected";} ?>  >Partner Page</option>
                                <option value="about"<?php if(@$_GET['pag_d']=='about'){echo "selected";} ?>  >About Page</option>
                                <option value="log"<?php if(@$_GET['pag_d']=='log'){echo "selected";} ?>  >Login Page</option>
                                <option value="signu"<?php if(@$_GET['pag_d']=='signu'){echo "selected";} ?>  >Signup Page</option>
                                <option value="porta"<?php if(@$_GET['pag_d']=='porta'){echo "selected";} ?>  >Portfolio Page</option>
                                <option value="others" <?php if(@$_GET['pag_d']=='others'){echo "selected";} ?>  >Other</option>
                            </select></div>
                          </div>

                          <div class="col-12 my-1 px-0">
                            <textarea class="form-control" placeholder="Other content block" name="img_text2"><?=@$theimage_details3['img_text2']?></textarea>
                          </div>
                            
                              <input type="file" name="file_name"><br/>
                            <button class="btn mt-2 btn-warning btn-block py-2">Add / Edit Images</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    if(@$_GET['pag_d']!=''){
                      $thetypes=xss_clean($_GET['pag_d']);
                    $get_sliders=$this->db->query("select * from site_img where img_place ='$thetypes' and img_status='1' order by img_id desc limit 10");
                    }else{
                      $get_sliders=$this->db->query("select * from site_img where img_place !='' and img_status='1' order by img_id desc limit 10");
                    }
                    $allsliedsrs=$get_sliders->result_array();
                     ?>
                            
                            <div class="col-sm-6">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">All Contents</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Image</th>
                                                <th>Text</th>
                                                <th>Type</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php 
                                              foreach($allsliedsrs as $slider2){ ?>
                                            <tr>
                                                <th scope="row"><?=$slider2['img_id']?></th>
                                                <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['img_name']?>" style='height:40px;'></td>
                                                <td>
                                                  <b><a href="<?=$slider2['img_link']?>" target='_blank'><?=$slider2['img_head']?></a></b><br/>
                                                  <?=trim_text(strip_tags($slider2['img_text']),'90')?>
                                                  </td>
                                                <td><a href="<?=base_url('admin/perform/web/img-others?pag_d=')?><?=$slider2['img_place']?>"><?=$slider2['img_place']?></a></td>
                                                <td style="min-width: 120px;">
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['img_id']?>&what=img" >
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/img-others')?>?edit=<?=$slider2['img_id']?>">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                            </div>
                  <?php 
                  break;
                  
                  case 'tags':
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $gettex=$this->db->query("select * from site_tags_skills where stg_tgid='$aid' ");
                    $atheadmins=$gettex->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                        <div class="main-card mb-3 card col-3">
                                            <div class="card-body"><h5 class="card-title">Tags</h5>
                                                <div>
                                                    <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_tags')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_tags')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_proile22w'>

                                                      <div class="form-group has-feedback">
                                                        <!-- <input type="hidden" name="stg_type" value="t"> -->
                                                        <input type="text" class="form-control has-feedback-left" id="inputSuccess2" placeholder="Keyword" name='name' value="<?=@$atheadmins['stg_name']?>" >
                                                      </div>

                                                      <select class="form-control" name="stg_type">
                                                          <option value="key" <?php if(@$_GET['typ'] =='key'){echo "selected";} ?> >keywords</option>
                                                          <option value="lan" <?php if(@$_GET['typ'] =='lan'){echo "selected";} ?> >Language</option>
                                                          <option value="lev" <?php if(@$_GET['typ'] =='lev'){echo "selected";} ?> >Level</option>
                                                          <option value="apiKey" <?php if(@$_GET['typ'] =='apiKey'){echo "selected";} ?> >Api Key</option>
                                                      </select>

                                                      <input type="hidden" name="theid" value="<?=@$todoedit?>">

                                                      <div class="form-group has-feedback">
                                                        <!-- <input type="text" class="form-control has-feedback-left" id="inputSuccess4" placeholder="sort" name="sort"> -->
                                                      </div>

                                                      <div class="form-group">
                                                        <div class="">
                                                          <button type="submit" class="btn btn-success btn-block">Submit</button>
                                                        </div>
                                                      </div>

                                                    </form>

                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-sm-5 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body">
                                      <h5 class="card-title">Tags</h5>
                                      <div class="row">
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <!-- <th>Views</th> -->
                                                <th>Type</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php

                                              if(@$_GET['typ'] !=''){
                                                $type=$_GET['typ'];
                                                $gettex=$this->db->query("select * from site_tags_skills where stg_type ='$type' limit $limit1, $limit2");
                                              }else{
                                                $gettex=$this->db->query("select * from site_tags_skills where stg_type !='' limit $limit1, $limit2");
                                              }

                                                $atheadmins=$gettex->result_array();
                                               foreach($atheadmins as $testimonials){ ?>
                                            <tr>
                                                <th scope="row"><?=$testimonials['stg_tgid']?></th>
                                                <!-- <td><?=$testimonials['stg_name']?></td> -->
                                                <td><?=$testimonials['stg_name']?></td>
                                                <td><a href="<?=base_url('index.php/admin/perform/web/tags?typ=')?><?=$testimonials['stg_type']?>"><?=$testimonials['stg_type']?></a></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['stg_tgid']?>&what=tags">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/tags?edit=')?><?=$testimonials['stg_tgid']?>">
                                                  <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>
                                      </div>
                                       <div class="col-12">
                                          <nav class="mt-4" aria-label="Page navigation example">
                                          <ul class="pagination">
                                              <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                              <?php
                                              $pagesare=$pageNum;
                                              for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                              $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                              ?>
                                              <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                              <?php } } ?>
                                              <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                          </ul>
                                      </nav>
                                        </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;

                  case 'filters':
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $gettex=$this->db->query("select * from site_tags_skills where stg_tgid='$aid' ");
                    $atheadmins=$gettex->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                        <div class="main-card mb-3 card col-3">
                                            <div class="card-body"><h5 class="card-title">Tags</h5>
                                                <div>
                                                    <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_tags')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_tags')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_proile22w'>

                                                      <div class="form-group has-feedback">
                                                        <input type="text" class="form-control has-feedback-left" id="inputSuccess2" placeholder="Tag Name" name='name' value="<?=@$atheadmins['stg_name']?>" >
                                                      </div>
                                                      <input type="hidden" name="theid" value="<?=@$todoedit?>">
                                                      <input type="hidden" name="stg_type" value="f">
                                                      <div class="form-group has-feedback">
                                                        <!-- <input type="text" class="form-control has-feedback-left" id="inputSuccess4" placeholder="sort" name="sort"> -->
                                                      </div>

                                                      <div class="form-group">
                                                        <div class="">
                                                          <button type="submit" class="btn btn-success btn-block">Submit</button>
                                                        </div>
                                                      </div>

                                                    </form>

                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-sm-6 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Tags</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <!-- <th>Views</th>
                                                <th>text</th> -->
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php
                                                $gettex=$this->db->query("select * from site_tags_skills where stg_type='f'");
                                                $atheadmins=$gettex->result_array();
                                               foreach($atheadmins as $testimonials){ ?>
                                            <tr>
                                                <th scope="row"><?=$testimonials['stg_tgid']?></th>
                                                <td><?=$testimonials['stg_name']?></td>
                                                <!-- <td><?=$testimonials['stg_name']?></td>
                                                <td><?=$testimonials['stg_name']?></td> -->
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['stg_tgid']?>&what=tags">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/tags?edit=')?><?=$testimonials['stg_tgid']?>">
                                                  <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;

                  case 'category':
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $gettex=$this->db->query("select * from site_catagory where ctid='$aid' ");
                    $atheadmins=$gettex->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                        <div class="main-card mb-3 card col-3">
                                            <div class="card-body"><h5 class="card-title">Category</h5>
                                                <div>
                                                    <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_cat')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_cat')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_proile22w'>

                                                      <div class="form-group has-feedback">
                                                        <input type="text" class="form-control has-feedback-left" id="inputSuccess2" placeholder="Catagory Name" name='name' value="<?=@$atheadmins['name']?>" >
                                                      </div>
                                                      <input type="hidden" name="theid" value="<?=@$todoedit?>">
                                                      <div class="form-group has-feedback">
                                                        <select name="display" class="form-control">
                                                          <option value='1'>Show on Home</option>
                                                          <option value='0'>Do not Show on Home</option>
                                                        </select>
                                                      </div>
                                                      <div class="form-group has-feedback">
                                                        <!-- <input type="text" class="form-control has-feedback-left" id="inputSuccess4" placeholder="sort" name="sort"> -->
                                                      </div>

                                                      <div class="form-group">
                                                        <div class="">
                                                          <button type="submit" class="btn btn-success btn-block">Submit</button>
                                                        </div>
                                                      </div>

                                                    </form>

                                                </div>
                                            </div>
                                        </div>

                                        <div class="col-sm-6 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Categories</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Name</th>
                                                <th>Shown</th>
                                                <th>text</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php 
                                              $thecats=$this->db->query("select * from site_catagory order by ctid desc limit $limit1, $limit2");
                                              $thsersftsy=$thecats->result_array();
                                              $sr=1;
                                              foreach($thsersftsy as $testimonials){ ?>
                                            <tr>
                                                <th scope="row"><?=$sr?></th>
                                                <td><?=$testimonials['name']?></td>
                                                <td><?=read_me_user('yes_no',$testimonials['display'])?></td>
                                                <td><?=$testimonials['details']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['ctid']?>&what=cats">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/category?edit=')?><?=$testimonials['ctid']?>">
                                                  <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php $sr++; } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;

                  case 'sub-category':
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $thecats2234=$this->db->query("select * from site_sub_cat, site_catagory where sc_ctid=ctid and sc_id='$aid'");
                    $atheadmins=$thecats2234->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                        <div class="main-card mb-3 card col-3">
                                            <div class="card-body"><h5 class="card-title">Sub Category</h5>
                                                <div>
                                                    <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_sub_cat')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_sub_cat')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_proile22w'>

                                                      <div class="form-group has-feedback">
                                                        <?php $getheco=$this->db->query("select * from site_catagory"); ?>
                                                          <div class="form-group has-feedback">
                                                            <select name="cat" class="form-control">
                                                              <?php
                                                              foreach ($getheco->result() as $row){ ?>
                                                                    <option value="<?=$row->ctid?>" <?php if(@$atheadmins['sc_ctid']== $row->ctid ){echo "Selected";} ?> ><?=$row->name?></option>
                                                                <?php } ?>
                                                            </select>
                                                          </div>
                                                      </div>

                                                      <div class="form-group has-feedback">
                                                        <input type="text" class="form-control has-feedback-left" id="inputSuccess2" placeholder="Sub Catagory Name" name='name' value="<?=@$atheadmins['sc_name']?>" >
                                                      </div>
                                                      <input type="hidden" name="theid" value="<?=@$todoedit?>">
                                                      <!-- <div class="form-group has-feedback">
                                                        <select name="display" class="form-control">
                                                          <option value='1'>Show in header</option>
                                                          <option value='0'>Do not Show in header</option>
                                                        </select>
                                                      </div> -->

                                                      <!-- <div class="form-group has-feedback">
                                                        <input type="text" class="form-control has-feedback-left" id="inputSuccess4" placeholder="sort" name="sort">
                                                      </div> -->

                                                      <div class="form-group">
                                                        <div class="">
                                                          <button type="submit" class="btn btn-success btn-block">Submit</button>
                                                        </div>
                                                      </div>

                                                    </form>

                                                      <div class="col-12">
                                                        <b> Filter</b>
                                                        <hr/>
                                                        <div class="col-12">
                                                          <a href="<?=base_url('index.php/admin/perform/web/sub-category')?>">
                                                          - Show All
                                                          </a>
                                                        </div>
                                                        <?php 
                                                        $thecats=$this->db->query("select * from site_catagory order by ctid desc limit 100");
                                                        $thsersftsy3=$thecats->result_array();
                                                        foreach($thsersftsy3 as $testimonials5){ ?>
                                                      <div class="col-12">
                                                          <a href="<?=base_url('index.php/admin/perform/web/sub-category')?>?cat=<?=$testimonials5['ctid']?>">
                                                            - <?=$testimonials5['name']?>
                                                          </a>
                                                      </div>
                                                    <?php } ?>
                                                  </div>

                                                </div>
                                            </div>
                                        </div>
                                        <?php
                                        if(isset($_GET['cat']) && $_GET['cat']!=''){
                                          $cat=str_replace('-',' ',$_GET['cat']);                                       
                                          $thecats2234=$this->db->query("select * from site_sub_cat, site_catagory where sc_ctid=ctid AND sc_ctid='$cat' order by sc_id desc limit $limit1, $limit2");
                                        }
                                        else {
                                        $thecats2234=$this->db->query("select * from site_sub_cat, site_catagory where sc_ctid=ctid order by sc_id desc limit $limit1, $limit2");
                                      }
                                        $thsersfwwa34tsy2=$thecats2234->result_array();
                                        ?>
                                        <div class="col-sm-6 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Sub Categories</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th><a href="<?=base_url('index.php/admin/perform/web/sub-category')?>">Category</a></th>
                                                <th>Name</th>
                                                <th>text</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($thsersfwwa34tsy2 as $testimonials){ ?>
                                            <tr>
                                                <th scope="row"><?=$testimonials['sc_id']?></th>
                                                <td><a href="<?=base_url('index.php/admin/perform/web/sub-category')?>?cat=<?=$testimonials['sc_ctid']?>"><?=$testimonials['name']?></a></td>
                                                <td><?=$testimonials['sc_name']?></td>
                                                <td><?=$testimonials['sc_text']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['sc_id']?>&what=csats">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/sub-category?edit=')?><?=$testimonials['sc_id']?>">
                                                  <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;

                  case 'sub2-category':
                  $todoedit='-1';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $aid=$_GET['edit'];
                    $thecats2234=$this->db->query("select * from site_sub_cat, mr_sub2 where mr_sub2_sid=sc_id and mr_sub2_id='$aid'");
                    $atheadmins=$thecats2234->row_array();
                    $todoedit=$aid;
                  }
                  ?>
                        <div class="main-card mb-3 card col-3">
                                  <div class="card-body"><h5 class="card-title">Sub Sub Category</h5>
                                      <div>
                                          <form class="form-horizontal form-label-left" action="<?=base_url('index.php/admin_action/add_sub_cat2')?>" method="post" enctype="multipart/form-data" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/add_sub_cat2')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" id='fomr_id_sub2cat'>

                                            <!-- <div class="form-group has-feedback">
                                              <?php $getheco=$this->db->query("select * from site_sub_cat, site_catagory where sc_ctid=ctid"); ?>
                                                <div class="form-group has-feedback">
                                                  <select name="scat" class="form-control">
                                                    <?php
                                                    foreach ($getheco->result() as $row){ ?>
                                                      <option value="<?=$row->sc_id?>" <?php if(@$atheadmins['sc_id']== $row->sc_id ){echo "Selected";} ?> > <?=$row->name?> -> <?=$row->sc_name?></option>
                                                      <?php } ?>
                                                  </select>
                                                </div>
                                            </div> -->
                                    <div class="form-group has-feedback">
                                      <?php $getheco=$this->db->query("select * from site_catagory"); ?>
                                        <div class="form-group has-feedback">
                                          <select name="cat" id="cat" class="form-control"  onchange="load_subcat(this);">
                                            <option value="">Select Category</option>
                                            <?php
                                            foreach ($getheco->result() as $row){ ?>
                                                  <option value="<?=$row->ctid?>" <?php if(@$atheadmins['mr_sub2_cid']== $row->ctid ){echo "Selected";} ?> ><?=$row->name?></option>
                                              <?php } ?>
                                          </select>
                                        </div>
                                    </div>

                                    <div class="form-group has-feedback">
                                      <?php $getheco=$this->db->query("select * from site_catagory"); ?>
                                        <div class="form-group has-feedback">
                                          <select name="scat" class="form-control" id="get_subcat_data" onchange="load_srch_href(this);">
                                            <option value="">Select SubCategory</option>
                                            <option value="<?=@$atheadmins['mr_sub2_sid']?>" selected><?=@$atheadmins['mr_sub2_scname']?></option>
                                          </select>
                                        </div>
                                    </div>

                                    <div class="form-group has-feedback">
                                      <input type="text" class="form-control has-feedback-left" id="inputSuccess2" placeholder="Sub Sub Catagory Name" name='name' value="<?=@$atheadmins['sc_name']?>" >
                                    </div>
                                    <input type="hidden" name="theid" value="<?=@$todoedit?>">
                                            <!-- <div class="form-group has-feedback">
                                              <select name="display" class="form-control">
                                                <option value='1'>Show in header</option>
                                                <option value='0'>Do not Show in header</option>
                                              </select>
                                            </div> -->

                                            <!-- <div class="form-group has-feedback">
                                              <input type="text" class="form-control has-feedback-left" id="inputSuccess4" placeholder="sort" name="sort">
                                            </div> -->

                                            <div class="form-group">
                                              <div class="">
                                                <button type="submit" class="btn btn-success btn-block">Submit</button>
                                              </div>
                                            </div>
                                          </form>
                                            <div class="form-group">
                                              <div class="">
                                                <a href="<?=base_url('index.php/admin/perform/web/sub2-category')?>" id="sub2cat_srch" class="btn btn-success btn-block">Search</a>
                                              </div>
                                            </div>
                                          <div class="col-12">
                                              <b> Filter</b>
                                              <hr/>
                                              <div class="col-12">
                                                <a href="<?=base_url('index.php/admin/perform/web/sub2-category')?>">
                                                - Show All
                                                </a>
                                              </div>
                                              <?php 
                                              $thecats=$this->db->query("select * from site_sub_cat order by sc_id desc limit 100");
                                              $thsersftsy3=$thecats->result_array();
                                              foreach($thsersftsy3 as $testimonials5){ ?>
                                            <div class="col-12">
                                                <a href="<?=base_url('index.php/admin/perform/web/sub2-category')?>?scat=<?=$testimonials5['sc_id']?>">
                                                  - <?=$testimonials5['sc_name']?>
                                                </a>
                                            </div>
                                          <?php } ?>
                                        </div>

                                      </div>
                                  </div>
                              </div>
                              <?php
                              if((isset($_GET['scat']) && $_GET['scat']!='') && (isset($_GET['cat']) && $_GET['cat']!='')){
                                $cat=$_GET['cat'];
                                $scat=$_GET['scat'];                                       
                                $thecats2234=$this->db->query("select * from site_sub_cat, mr_sub2 where mr_sub2_sid=sc_id AND mr_sub2_cid='$cat' AND mr_sub2_sid='$scat' order by mr_sub2_id desc limit $limit1, $limit2");
                              }
                              if(isset($_GET['scat']) && $_GET['scat']!=''){
                                $scat=str_replace('-',' ',$_GET['scat']);                                       
                                $thecats2234=$this->db->query("select * from site_sub_cat, mr_sub2 where mr_sub2_sid=sc_id AND mr_sub2_sid='$scat' order by mr_sub2_id desc limit $limit1, $limit2");
                              }
                              else {
                              $thecats2234=$this->db->query("select * from site_sub_cat, mr_sub2 where mr_sub2_sid=sc_id order by mr_sub2_sid desc limit $limit1, $limit2");
                            }
                              $thsersfwwa34tsy2=$thecats2234->result_array();
                              ?>
                              <div class="col-sm-6 pl-2">
                                <div class="main-card mb-3 card">
                                    <div class="card-body"><h5 class="card-title">Sub Sub Categories</h5>
                                        <table class="mb-0 table">
                                            <thead>
                                            <tr>
                                                <th>#</th>
                                                <th><a href="<?=base_url('index.php/admin/perform/web/sub2-category')?>">Sub Category</a></th>
                                                <th>Name</th>
                                                <th>text</th>
                                                <th>Action</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                              <?php foreach($thsersfwwa34tsy2 as $testimonials){ ?>
                                            <tr>
                                                <th scope="row"><?=$testimonials['mr_sub2_sid']?></th>
                                                <td><a href="<?=base_url('index.php/admin/perform/web/sub2-category')?>?scat=<?=$testimonials['sc_id']?>"><?=$testimonials['sc_name']?></a></td>
                                                <td><?=$testimonials['mr_sub2_name']?></td>
                                                <td><?=$testimonials['sc_text']?></td>
                                                <td>
                                                <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$testimonials['mr_sub2_sid']?>&what=scat2">
                                                  <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>

                                                  <a href="<?=base_url('index.php/admin/perform/web/sub2-category?edit=')?><?=$testimonials['mr_sub2_sid']?>">
                                                  <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                </td>
                                            </tr>
                                          <?php } ?>
                                            </tbody>
                                        </table>

                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                    </div>
                                </div>
                            </div>
                  <?php
                  break;
                  case 'blogs': 
                    $what='add_blog';
                    $theidval='';
                  if(isset($_GET['edit']) && $_GET['edit'] !=''){
                    $id=$_GET['edit'];
                    $getslider_details=$this->db->query("select * from site_blogs where blog_id='$id' ");
                    $theimage_details3=$getslider_details->row_array();
                    $what='edit_blog';
                    $theidval=$_GET['edit'];
                  }
                  ?>
                   <div class="main-card mb-3 card col-sm-8">
                      <div class="card-header">Add / Remove Blog</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          Because of cache you may not see new Image updated instant so you <br/> need to use a private mode or clear your cache to see your updated Image.<br/>

                          <p> Make sure you are adding horizontal image in the size of <b>1200px width Minimum</b> and hight as per your image.<br/> <b> Also please make sure all the images are of same height</b></p>
                          <form method="post" action="<?=base_url('index.php/admin_action/site_blog');?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/site_blog')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data" >
                            <input type="hidden" name="what" value="<?=$what?>">
                            <input type="hidden" name="blogid" value="<?=$theidval?>">
                            <textarea class="form-control mb-2 rich_text" id="s_s9iskls90s" placeholder="text" name="comment"><?=@$theimage_details3['comment']?></textarea>
                          <div class="row my-2">
                            <div class="col-sm-6"><input type="text" name="blog_link" placeholder="Link" class="form-control col-12" value="<?=@$theimage_details3['blog_link']?>" ></div>
                            <div class="col-sm-6"><input type="text" name="title" placeholder="Title" class="form-control col-12" value="<?=@$theimage_details3['title']?>" ></div>

                          <!-- <div class="col-12 my-1">
                            <select class="form-control" name="types">
                                <option value="1">Blog</option>
                                <option value="2">Offer</option>
                                <option value="3">News</option>
                            </select>
                          </div> -->
                          <div class="col-sm-6">
                            <br><input type="file" name="file_name">
                          </div>
                          
                          <!-- <div class="col-sm-6">
                            <br><label class="pr-5">Expiry Date: </label><input type="date" name="till_date" min="<?=date('Y-m-d')?>">
                          </div> -->
                          </div>
                          <div class="col-12 my-1 px-0">
                            <textarea class="form-control" placeholder="Short Description" name="scomment"><?=@$theimage_details3['scomment']?></textarea>
                          </div>
                          
                          
                            <button class="btn mt-2 btn-warning btn-block py-2">Add / Edit Blog</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    $get_sliders=$this->db->query("select * from site_blogs order by blog_id desc limit 10");
                    $allsliedsrs=$get_sliders->result_array();
                     ?>
                  <div class="col-sm-12">
                      <div class="main-card mb-3 card">
                          <div class="card-body"><h5 class="card-title">All Blogs</h5>
                              <table class="mb-0 table">
                                  <thead>
                                  <tr>
                                      <th>#</th>
                                      <th>Image</th>
                                      <th>Title</th>
                                      <th>Description</th>
                                      <th>Action</th>
                                  </tr>
                                  </thead>
                                  <tbody>
                                    <?php 
                                    foreach($allsliedsrs as $slider2){ ?>
                                  <tr>
                                      <th scope="row"><?=$slider2['blog_id']?></th>
                                      <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['blog_img']?>" style='height:40px;'></td>
                                      <td>
                                        <!-- <?=read_me_user('blog_type',$slider2['blog_type'])?><br/> -->
                                        <b><?=$slider2['title']?></b>
                                      </td>
                                      <td><?=trim_text(strip_tags($slider2['comment']),'90')?></td>
                                      <td style="min-width: 120px;">
                                      <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['blog_id']?>&what=blog" >
                                        <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                        <a href="<?=base_url('index.php/admin/perform/web/blogs')?>?edit=<?=$slider2['blog_id']?>"><button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                      </td>
                                  </tr>
                                <?php } ?>
                                  </tbody>
                              </table>

                          </div>
                      </div>
                  </div>
                  <?php 
                  break;?>














                  <?php
                  case 'services': 
                    $what='add_services';
                    $theidval='';
                    if(isset($_GET['edit']) && $_GET['edit'] !=''){
                      $id=$_GET['edit'];
                      $getslider_details=$this->db->query("select * from `x-services` where service_id='$id' ");
                      $theimage_details3=$getslider_details->row_array();
                      $what='edit_services';
                      $theidval=$_GET['edit'];
                    }
                  ?>
                  
                   <div class="main-card mb-3 card col-sm-7">
                      <div class="card-header">Add / Remove Services</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          

                          <form method="post" action="<?=base_url('index.php/admin_action/services');?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/services')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data" >
                            <input type="hidden" name="what" value="<?=$what?>">
                            <input type="hidden" name="service_id" value="<?=$theidval?>">
                          <div class="row my-2">
                          <div class="col-12 my-1 px-0">
                            <textarea class="form-control rich_text" id="s_s9iskls90s" placeholder="Description" name="scomment"><?=@$theimage_details3['service_description']?></textarea>
                          </div>
                           
                          <div class="col-sm-12">
                            <br><input type="text" class="form-control" placeholder="Service Name" name="name" value="<?=@$theimage_details3['service_name']?>">
                          </div>
                          <div class="col-sm-12">
                            <br><input type="text" name="meta_desc" placeholder="Meta Description" class="form-control mb-2" value="<?=@$theimage_details3['service_meta_desc']?>" >
                          </div>
                          <!-- <div class="col-sm-12">
                            <br><input type="number" class="form-control" placeholder="Service Price" name="price" value="<?=@$theimage_details3['price']?>">
                          </div> -->
                          <div class="col-sm-12">
                            <br><input type="file" name="file_name" value="<?=@$theimage_details3['service_image']?>">
                          </div>
                          </div>
                          
                          
                          
                            <button class="btn mt-2 btn-warning btn-block py-2">Update Service</button>
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    $get_sliders=$this->db->query("select * from `x-services` order by service_id desc limit 10");
                    $allsliedsrs=$get_sliders->result_array();
                     ?>
                  <div class="col-sm-12">
                      <div class="main-card mb-3 card">
                          <div class="card-body"><h5 class="card-title">All Services</h5>
                              <table class="mb-0 table table-responsive">
                                  <thead>
                                  <tr>
                                      <th>#</th>
                                      <th>Image</th>
                                      <th>Name</th>
                                      <th>Description</th>
                                      <th>Meta Description</th>
                                      <th>Action</th>
                                  </tr>
                                  </thead>
                                  <tbody>
                                    <?php 
                                    foreach($allsliedsrs as $slider2){ ?>
                                  <tr>
                                      <th scope="row"><?=$slider2['service_id']?></th>
                                      <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['service_image']?>" style='height:40px;'></td>
                                      
                                      <td><?=trim_text(strip_tags($slider2['service_name']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['service_description']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['service_meta_desc']),'90')?></td>
                                      <td style="min-width: 120px;">
                                      <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['service_id']?>&what=service" >
                                        <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                        <a href="<?=base_url('index.php/admin/perform/web/services')?>?edit=<?=$slider2['service_id']?>"><button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                      </td>
                                  </tr>
                                <?php } ?>
                                  </tbody>
                              </table>

                          </div>
                      </div>
                  </div>
                  
                 <?php
// Add this case to your existing switch statement in the admin view file
// Location: application/views/admin/perform/web.php

case 'exit-permits':
    $what = 'add_exit_permit';
    $theidval = '';
    
    if(isset($_GET['edit']) && $_GET['edit'] != ''){
        $id = $_GET['edit'];
        $getslider_details = $this->db->query("select * from `exit_permit` where pid='$id' ");
        $theimage_details3 = $getslider_details->row_array();
        $what = 'edit_exit_permit';
        $theidval = $_GET['edit'];
    }
?>
<div class="main-card mb-3 card col-sm-8">
    <div class="card-header">Add / Edit Exit Permit</div>
    <div class="card-body">
        <h5 class="card-title">Exit Permit Entry System</h5>
        <p>Create exit permit entries that can be verified via unique link</p>

        <form method="post" action="<?=base_url('index.php/admin_action/exit_permit');?>" 
              onsubmit="return uploadandform('<?=base_url('index.php/admin_action/exit_permit')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" 
              enctype="multipart/form-data">
            
            <input type="hidden" name="what" value="<?=$what?>">
            <input type="hidden" name="id" value="<?=$theidval?>">

            <div class="row my-2">
                <!-- Name -->
                <div class="col-sm-6">
                    <label>Full Name *</label>
                    <input type="text" class="form-control" placeholder="Full Name" 
                           name="name" value="<?=@$theimage_details3['name']?>" required>
                </div>

                <!-- Passport Number -->
                <div class="col-sm-6">
                    <label>Passport Number *</label>
                    <input type="text" class="form-control" placeholder="Passport No" 
                           name="pass_no" value="<?=@$theimage_details3['pass_no']?>" required>
                </div>

                <!-- Country -->
                <div class="col-sm-6 mt-3">
                    <label>Country *</label>
                    <input type="text" class="form-control" placeholder="Country" 
                           name="country" value="<?=@$theimage_details3['country']?>" required>
                </div>

                <!-- Start Date -->
                <div class="col-sm-6 mt-3">
                    <label>Start Date *</label>
                    <input type="date" name="start_date" class="form-control" 
                           value="<?=@$theimage_details3['start_date']?>" required>
                </div>

                <!-- End Date -->
                <div class="col-sm-6 mt-3">
                    <label>End Date *</label>
                    <input type="date" name="end_date" class="form-control" 
                           value="<?=@$theimage_details3['end_date']?>" required>
                </div>

                <!-- Reference Number -->
                <div class="col-sm-6 mt-3">
                    <label>Reference Number</label>
                    <input type="text" class="form-control" placeholder="Reference No" 
                           name="ref_no" value="<?=@$theimage_details3['ref_no']?>">
                </div>

                <!-- Link Key (Auto-generated if empty) -->
                <div class="col-sm-12 mt-3">
                    <label>Unique Link Key (Leave empty for auto-generate)</label>
                    <input type="text" class="form-control" placeholder="Auto-generated if empty" 
                           name="random_key" value="<?=@$theimage_details3['random_key']?>">
                    <small class="text-muted">This key will be used in the verification URL</small>
                </div>

                <!-- Photo Upload -->
                <div class="col-sm-12 mt-3">
                    <label>Photo *</label>
                    <input type="file" name="file_name" accept="image/*">
                    <?php if(@$theimage_details3['image1']): ?>
                        <div class="mt-2">
                            <img src="<?=base_url('assets/avator/upload/')?><?=$theimage_details3['image1']?>" 
                                 style="height:100px;" class="img-thumbnail">
                        </div>
                    <?php endif; ?>
                </div>

                <!-- Submit Button -->
                <div class="col-sm-12 mt-4">
                    <button type="submit" class="btn btn-warning btn-block py-3">
                        <?=$what == 'add_exit_permit' ? 'Add Exit Permit' : 'Update Exit Permit'?>
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>

<?php
// List of all exit permits
$get_permits = $this->db->query("select * from `exit_permit` order by pid desc limit $limit1, $limit2");
$all_permits = $get_permits->result_array();
$sr = 1;
?>

<div class="col-sm-12">
    <div class="main-card mb-3 card">
        <div class="card-body">
            <h5 class="card-title">All Exit Permits</h5>
            <table class="mb-0 table table-responsive">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Photo</th>
                        <th>Name</th>
                        <th>Passport No</th>
                        <th>Country</th>
                        <th>Date Range</th>
                        <th>Link Key</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach($all_permits as $permit): ?>
                    <tr>
                        <th scope="row"><?=$sr?></th>
                        <td>
                            <img src="<?=base_url('assets/avator/upload/')?><?=$permit['image1']?>" 
                                 style='height:40px;'>
                        </td>
                        <td><?=$permit['name']?></td>
                        <td><?=$permit['pass_no']?></td>
                        <td><?=$permit['country']?></td>
                        <td>
                            <?=date('d-m-Y', strtotime($permit['start_date']))?> to 
                            <?=date('d-m-Y', strtotime($permit['end_date']))?>
                        </td>
                        <td>
                            <small><?=$permit['random_key']?></small><br>
                            <a href="<?=base_url('verify/')?><?=$permit['random_key']?>" 
                               target="_blank" class="btn btn-sm btn-info">
                                View Link
                            </a>
                        </td>
                        <td style="min-width: 120px;">
                            <a onclick="return confirm('Are you sure you want to delete this?');" 
                               href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$permit['pid']?>&what=exit_permit">
                                <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger">
                                    <i class="pe-7s-trash btn-icon-wrapper"></i>
                                </button>
                            </a>
                            <a href="<?=base_url('index.php/admin/perform/web/exit-permits')?>?edit=<?=$permit['pid']?>">
                                <button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning">
                                    <i class="pe-7s-pen btn-icon-pen"></i>
                                </button>
                            </a>
                        </td>
                    </tr>
                    <?php $sr++; endforeach; ?>
                </tbody>
            </table>

            <!-- Pagination -->
            <div class="col-12">
                <nav class="mt-4" aria-label="Page navigation example">
                    <ul class="pagination">
                        <li class="page-item">
                            <a href="javascript:void(0);" class="page-link" aria-label="Previous">
                                <span aria-hidden="true">«</span>
                            </a>
                        </li>
                        <?php
                        $pagesare = $pageNum;
                        for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                            $addclass = '';
                            if($pageNum == $x){$addclass='bold';}
                            if($x > 0){
                        ?>
                        <li onclick="paging(<?=$x?>)" class="page-item <?=$addclass?>">
                            <a href="#" class="page-link"><?=$x?></a>
                        </li>
                        <?php }} ?>
                        <li class="page-item">
                            <a href="javascript:void(0);" class="page-link" aria-label="Next">
                                <span aria-hidden="true">»</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</div>

<?php break; ?>

                  <?php 
                  break;
                  
                  

                  case 'products': 
                    $what='add_products';
                    $theidval='';
                    if(isset($_GET['edit']) && $_GET['edit'] !=''){
                      $id=$_GET['edit'];
                      $getslider_details=$this->db->query("select * from `x-products` where pid='$id' ");
                      $theimage_details3=$getslider_details->row_array();
                      $what='edit_product';
                      $theidval=$_GET['edit'];
                    }
                  ?>
                  
                   <div class="main-card mb-3 card col-sm-7">
                      <div class="card-header">Add / Remove Products</div>
                        <div class="card-body">
                          <div class="row">
                            <div class="col-sm-6">
                              <img src="<?=base_url('assets/avator/logo.png')?>" style='width:150px;' class='mb-3'>
                            </div>
                          </div>
                          <h5 class="card-title">Refresh properly to see your new Image.</h5>
                          

                          <form method="post" action="<?=base_url('index.php/admin_action/products');?>" onsubmit="return uploadandform('<?=base_url('index.php/admin_action/products')?>','post',this,'image_name','progress_value_sc','prog_valie_text','Show_Errors_987','loader_post_upload','1','uni_loader_prog_status');" enctype="multipart/form-data" >
                            <input type="hidden" name="what" value="<?=$what?>">
                            <input type="hidden" name="product_id" value="<?=$theidval?>">
                          <div class="row my-2"> 
                          <div class="col-sm-6">
                            <br><input type="text" class="form-control" placeholder="Name" name="name" value="<?=@$theimage_details3['name']?>">
                          </div>
                         <!--  <div class="col-sm-12">
                            <br><input type="text" name="meta_desc" placeholder="Meta Description" class="form-control mb-2" value="<?=@$theimage_details3['service_meta_desc']?>" >
                          </div> -->

                          <div class="col-sm-6">
                            <br><input type="text" class="form-control" placeholder="Passport No" name="p_no" value="<?=@$theimage_details3['pass_no']?>">
                          </div>
                          <div class="col-sm-6">
                            <br><input type="text" name="p_country" placeholder="Passport Country" class="form-control mb-2" value="<?=@$theimage_details3['country']?>" >
                          </div>
                          <div class="col-sm-6">
                            <br><input type="text" class="form-control" placeholder="Visa Category" name="v_cat" value="<?=@$theimage_details3['visa_cat']?>">
                          </div>
                          <div class="col-sm-6">
                            <br><input type="text" class="form-control" placeholder="Visa Sub Category" name="v_sub_cat" value="<?=@$theimage_details3['visa_sub_cat']?>">
                          </div>
                          <div class="col-sm-6">
                            <br><input type="text" class="form-control" placeholder="Application Type" name="a_type" value="<?=@$theimage_details3['application_type']?>">
                          </div>
                          <div class="col-sm-6">
                            <br><input type="text" name="s_fac" placeholder="Staying Facility" class="form-control mb-2" value="<?=@$theimage_details3['staying_facility']?>" >
                          </div>

                          <div class="col-sm-6">
                            <br><input type="date" name="s_date" placeholder="Start Date" class="form-control mb-2" value="<?=@$theimage_details3['start_date']?>" >
                          </div>

                          <div class="col-sm-6">
                            <br><input type="date" name="e_date" placeholder="End Date" class="form-control mb-2" value="<?=@$theimage_details3['end_date']?>" >
                          </div>
                          
                          <div class="col-sm-6">
                            <br><input type="number" min="0" class="form-control" placeholder="Visa Duration" name="price" value="<?=@$theimage_details3['visa_duration']?>">
                          </div>
                          
                          <div class="col-sm-6">
                            <br><input type="text" min="0" class="form-control" placeholder="Refrence No" name="r_no" value="<?=@$theimage_details3['ref_no']?>">
                          </div>
                          
                          <div class="col-sm-6">
                            <br><input type="text" min="0" class="form-control" placeholder="Link Key" name="link" value="<?=@$theimage_details3['random_key']?>">
                          </div>
                          
                          <div class="col-sm-6">
                            <br><input type="file" name="file_name" value="<?=@$theimage_details3['image1']?>">
                          </div>
                          


                          <div class="col-12 my-1 px-0">
                            <textarea class="form-control rich_text" id="s_s9iskls90s" placeholder="Description" name="desc"><?=@$theimage_details3['desc']?></textarea>
                          </div>
                            <button class="btn mt-2 btn-warning btn-block py-3">Update Products</button>
                          </div>
                          
                          </form>
                        </div>
                      <div class="card-footer">Good luck!</div>
                    </div>
                    <?php
                    $get_sliders=$this->db->query("select * from `x-products` order by pid desc limit $limit1, $limit2");
                    $allsliedsrs=$get_sliders->result_array();
                    $sr=1;
                     ?>
                  <div class="col-sm-12">
                      <div class="main-card mb-3 card">
                          <div class="card-body"><h5 class="card-title">All Products</h5>
                              <table class="mb-0 table table-responsive">
                                  <thead>
                                  <tr>
                                  <th>#</th>
                                      <th>Image</th>
                                      <th>Name</th>
                                      <th>Passport No</th>
                                      <th>Visa Category</th>
                                      <th>Country</th>
                                      <th>Key</th>
                                      <th>Action</th>
                                  </tr>
                                  </thead>
                                  <tbody>
                                    <?php 
                                    foreach($allsliedsrs as $slider2){ ?>
                                  <tr>
                                      <th scope="row"><?=$sr?></th>
                                      <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['image1']?>" style='height:40px;'></td>
                                      
                                      <td><?=trim_text(strip_tags($slider2['name']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['pass_no']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['visa_cat']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['country']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['random_key']),'300')?></td>
                                      <td style="min-width: 120px;">
                                      <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['pid']?>&what=product" >
                                        <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                        <a href="<?=base_url('index.php/admin/perform/web/products')?>?edit=<?=$slider2['pid']?>"><button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                      </td>
                                  </tr>
                                <?php $sr++; } ?>
                                  </tbody>
                              </table>

                              <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                          </div>
                      </div>
                  </div>
                  <?php 
                  break;



                  case 'all-products': 
                    $get_sliders=$this->db->query("select * from `x-products` order by pid desc limit $limit1, $limit2");
                    $allsliedsrs=$get_sliders->result_array();
                    $sr=1;
                     ?>
                  <div class="col-sm-12">
                      <div class="main-card mb-3 card">
                          <div class="card-body"><h5 class="card-title">All Products</h5>
                              <table class="mb-0 table table-responsive">
                                  <thead>
                                  <tr>
                                      <th>#</th>
                                      <th>Image</th>
                                      <th>Name</th>
                                      <th>Passport No</th>
                                      <th>Visa Category</th>
                                      <th>Country</th>
                                      <th>Key</th>
                                      <th>Action</th>
                                  </tr>
                                  </thead>
                                  <tbody>
                                    <?php 
                                    foreach($allsliedsrs as $slider2){ ?>
                                  <tr>
                                      <th scope="row"><?=$sr?></th>
                                      <td><img src="<?=base_url('assets/avator/upload/')?><?=$slider2['image1']?>" style='height:40px;'></td>
                                      
                                      <td><?=trim_text(strip_tags($slider2['name']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['pass_no']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['visa_cat']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['country']),'90')?></td>
                                      <td><?=trim_text(strip_tags($slider2['random_key']),'90')?></td>
                                      <td style="min-width: 120px;">
                                      <a onclick="return confirm('Are you sure you want to delete this?');" href="<?=base_url('index.php/admin_action/delete')?>?id=<?=$slider2['pid']?>&what=product" >
                                        <button class="mr-2 btn-icon btn-icon-only btn btn-outline-danger"><i class="pe-7s-trash btn-icon-wrapper"> </i></button></a>
                                        <a href="<?=base_url('index.php/admin/perform/web/products')?>?edit=<?=$slider2['pid']?>"><button class="mr-2 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-pen"> </i></button></a>
                                      </td>
                                  </tr>
                                <?php $sr++; } ?>
                                  </tbody>
                              </table>


                              <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                          </div>
                      </div>
                  </div>
                  <?php 
                  break;















                  case 'o-settings':
                    $todoedit='-1';
                    if(isset($_GET['edit']) && $_GET['edit'] !=''){
                      $aid=$_GET['edit'];
                      $gettex=$this->db->query("select * from site_tags_skills where stg_tgid='$aid' ");
                      $atheadmins=$gettex->row_array();
                      $todoedit=$aid;
                    }
                    ?>
                            <div class="col-sm-5 pl-2">
                                  <div class="main-card mb-3 card">
                                      <div class="card-body">
                                        <h5 class="card-title">Website Values</h5>
                                        <div class="row">
                                          <table class="mb-0 table">
                                              <thead>
                                              <tr>
                                                  <th>#</th>
                                                  <th>Name</th>
                                                  <!-- <th>Views</th> -->
                                                  <th>Type</th>
                                                  <th>Action</th>
                                              </tr>
                                              </thead>
                                              <tbody>
                                                <?php

                                                if(@$_GET['typ'] !=''){
                                                  $type=$_GET['typ'];
                                                  $gettex=$this->db->query("select * from site_tags_skills where stg_type ='$type' limit $limit1, $limit2");
                                                }else{
                                                  $gettex=$this->db->query("select * from site_tags_skills where stg_type ='visit' limit $limit1, $limit2");
                                                }

                                                  $atheadmins=$gettex->result_array();
                                                 foreach($atheadmins as $testimonials){ ?>
                                              <tr>
                                                  <th scope="row"><?=$testimonials['stg_tgid']?></th>
                                                  <!-- <td><?=$testimonials['stg_name']?></td> -->
                                                  <td><?=$testimonials['stg_name']?></td>
                                                  <td><a href="<?=base_url('index.php/admin/perform/web/tags?typ=')?><?=$testimonials['stg_type']?>"><?=$testimonials['stg_type']?></a></td>
                                                  <td>
                                                    <a href="<?=base_url('index.php/admin/perform/web/tags?edit=')?><?=$testimonials['stg_tgid']?>">
                                                    <button class="mr-2 mt-1 btn-icon btn-icon-only btn btn-outline-warning"><i class="pe-7s-pen btn-icon-wrapper"> </i></button></a>
                                                  </td>
                                              </tr>
                                            <?php } ?>
                                              </tbody>
                                          </table>
                                        </div>
                                         <div class="col-12">
                                            <nav class="mt-4" aria-label="Page navigation example">
                                            <ul class="pagination">
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Previous"><span aria-hidden="true">«</span><span class="sr-only">Previous</span></a></li>
                                                <?php
                                                $pagesare=$pageNum;
                                                for ($x = $pageNum-10; $x <= $pageNum+3; $x++) {
                                                $addclass='';if($pageNum == $x ){$addclass='bold';}if($x > 0){
                                                ?>
                                                <li onclick="paging(<?=$x?>)"  class="page-item <?=$addclass?>"><a href="#" class="page-link"><?=$x?></a></li>
                                                <?php } } ?>
                                                <li class="page-item"><a href="javascript:void(0);" class="page-link" aria-label="Next"><span aria-hidden="true">»</span><span class="sr-only">Next</span></a></li>
                                            </ul>
                                        </nav>
                                          </div>

                                      </div>
                                  </div>
                              </div>
                    <?php  
                  break;

                } 
                ?>
            </div>