<?php include('header.php');?>

<?php include('sidebar.php');?>

<?php 

include('includes/class.members.php');

$member = new Members();

include('includes/class.usertype.php');

$usertype = new Usertype();

?>

<?php

$maintitle="Users";

$page="users.php";

$table="tbl_users";

$field_id="int_user_id";

$mode=$_REQUEST['mode'];

$content_id=$_REQUEST['content_id'];

if(isset($_REQUEST['start'])){

$start=$_REQUEST['start']-1;

}

else {

$start=0;

}

?>

<?php

 

if(isset($_REQUEST['submit'])=="submit"){ 

//$required = array("firstname","lastname","email","phone");

//$dataexist=array("email","phone");

$values = $_POST;



unset($values['submit']);

unset($values['mode']);

unset($values['_wysihtml5_mode']);

unset($values['password']);

unset($values['conpassword']);

if(isset($_POST['password'])){

	if($_POST['password']!=$_POST['conpassword']){

		$passworderror="Passowrd entered is not same";

		

	}

$password=array("password"=>md5($_POST['password']));

$values=array_merge($values,$password);

}

$image=$helper->image_upload($_FILES['frm_filename'],"users");

$photo=array("image"=>$image);

if($photo!=""){

$values=array_merge($values,$photo);

}

if(isset($passworderror)){

	  $message=$passworderror;

}

	  else {

	  if($_REQUEST['mode']=="add"){

	  $message=$helper->insert($table,$values,$required,$dataexist);

	  }

	  if($_REQUEST['mode']=="edit"){

	  $message=$helper->update($table, $values,array($field_id=>$_REQUEST['contentid']),$required,$dataexist);

	  }

}

}

if(isset($_REQUEST['updatepass'])=="Update Password"){ 

 $pass=$_REQUEST['password'];

 $conpass=$_REQUEST['conpassword'];

 

if($pass==$conpass){

	$password=md5($pass);

	$required = array("password");

	$helper->update("tbl_users", array("password"=>$password),array("int_user_id"=>$_REQUEST['contentid']),array());

	//header("location:logout.php");

}

else{

	$error="Password not Matching";

}

}

?>



<div class="content-wrapper">

    <!-- Content Header (Page header) -->

    <section class="content-header">

      <h1><?php echo $maintitle;?></h1>

      <ol class="breadcrumb">

        <li><a href="dashboard.php"><i class="fa fa-dashboard"></i> <?php echo AL_DASHBOARD;?></a></li>

        <li class="active"><?php echo $maintitle;?></li>

      </ol>

    </section>



    <!-- Main content -->

    <section class="content">

    <?php

	if($mode=="add" || $mode=="edit"){ 

	?>

     <div class="row">

 <!-- Add / Edit / Delete --> 

          <div class="col-sm-12"> 

          <div class="box box-success">

         <div class="box-header">

              <i class="fa fa-building-o"></i>

              <h3 class="box-title"><?php echo $maintitle;?></h3>

              <div class="box-tools pull-right">

                <div class="btn-group">

                <a href="<?php echo $page;?>"><button class="btn btn-danger btn-flat">&nbsp;<?php echo AL_LISTALL;?> <?php echo $maintitle;?></button></a>

                   

                </div>

              </div>

            </div> 

            </div> 

            </div>



 <!-- Add / Edit / Delete --> 

<?php

if($mode=="edit"){
if($_REQUEST['approve']=="approve"){
    $helper->update($table, array("status"=>1),array($field_id=>$_REQUEST['contentid']), array());
    $helper->approveemail($_REQUEST['contentid'],$table);
 }
 if($_REQUEST['approve']=="pending"){
   $helper->update($table, array("status"=>2),array($field_id=>$_REQUEST['contentid']), array());  
 }
$contentdetails=$helper->select($table,"*",array($field_id=>$_REQUEST['contentid']));



?>



     <div class="col-md-4">



          <!-- Profile Image -->

          <div class="box box-primary">

            <div class="box-body box-profile">

            

				<h3 class="profile-username text-center"><?php echo $contentdetails[0]['firstname']." ".$contentdetails[0]['middlename']." ".$contentdetails[0]['lastname'];?></h3> 

              <p class="text-muted text-center"></p>



              <ul class="list-group list-group-unbordered">

              <?php

			  if($contentdetails[0]['email']!=""){

			  ?>

                <li class="list-group-item">

                  <b><?php echo AL_EMAIL;?>: </b> <?php echo $contentdetails[0]['email'];?>

                </li>

                <?php

			  }

			  ?>

               <?php

			  if($contentdetails[0]['phone']!=""){

			  ?>

                <li class="list-group-item">

                  <b><?php echo AL_PHONE;?>: </b> <?php echo $contentdetails[0]['phone'];?>

                </li>

                <?php

			  }

			  ?>

               <?php

			  if($contentdetails[0]['mobile']!=""){

			  ?>

          

                <li class="list-group-item">

                  <b><?php echo AL_MOBILE;?>: </b> <?php echo $contentdetails[0]['mobile'];?>

                </li>

                <?php

			  }

			  ?>

               <?php

			  if($contentdetails[0]['address']!=""){

			  ?>

                <li class="list-group-item">

                  <b><?php echo AL_ADDRESS;?>: </b> <?php echo $contentdetails[0]['address'];?>

                </li>

                <?php

			  }

			  ?>

				<?php

			  if($contentdetails[0]['city']!=""){

			  ?>

                 <li class="list-group-item">

                  <b><?php echo AL_CITY;?>: </b> <?php echo $contentdetails[0]['city'];?>

                </li>

               <?php

			  }

			  ?>

                <li class="list-group-item">

                  <?php

                  $mycountry= $helper->select("tbl_country","country",array("countryid"=>$contentdetails[0]['country']));

				  ?>

                  <b><?php echo AL_COUNTRY;?>: </b> <?php echo $mycountry[0]['country'];?>

                </li>

                 <li class="list-group-item">

                  <b>Expiry Date: </b> <?php echo $contentdetails[0]['expirydate'];?>

                </li>

                <li class="list-group-item">

                  <b>Status: </b> <?php if($contentdetails[0]['status']==0){ echo "Pending"; }?> <?php if($contentdetails[0]['status']==1){ echo "Active"; } ?>

                </li>
                <li class="list-group-item">
                  <?php
                   
                  if($contentdetails[0]['status']!=1){ 
                    ?>
                    <a href="<?php echo $admin_url;?><?php echo $page;?>?mode=edit&approve=approve&contentid=<?php echo $contentdetails[0]['int_user_id'];?>&start=<?php echo $_REQUEST['start'];?>">
                    <span class="label label-danger">Activate Now</span>
                    </a>  
                    <?php
                  } else { ?>  
                     <a href="<?php echo $admin_url;?><?php echo $page;?>?mode=edit&approve=pending&contentid=<?php echo $contentdetails[0]['int_user_id'];?>&start=<?php echo $_REQUEST['start'];?>">
                    <span class="label label-danger">Deactivate Now</span>
                    </a>
                    <?php
                  }
                  ?>
                      
                </li>
                <?php
                $salemandetails= $helper->select("tbl_staff","*",array("staffid"=>$contentdetails[0]['salesid']));
                ?>
                <li class="list-group-item">Created By: <?php echo $salemandetails[0]['firstname']." ".$salemandetails[0]['lastname'];?> </li>

              </ul>

                 

            </div>

            <!-- /.box-body -->

          </div>

           

        </div>

 <?php

}

?>

        <!-- /.col -->

        <div class="col-md-8">

          

          <div class="col-md-12">

          <!-- Horizontal Form -->

          <div class="box box-info">

            <div class="box-header with-border">

              <h3 class="box-title"><?php echo $maintitle;?> <?php echo AL_INFORMATION;?></h3>

            </div>

            <!-- /.box-header -->

            <!-- form start -->

            <?php

			if($message!=""){

			?>

            <button class="btn btn-block btn-success btn-flat" type="button"><?php echo $message['message'];?></button>

			<?php	

			}

			?>

            <div class="nav-tabs-custom">

            

            <form class="form-horizontal" action="" method="post" enctype="multipart/form-data">

             <div class="tab-content">

              <div class="active tab-pane" id="activity">

              

              <div class="box-body">

                <input type="hidden" name="mode" value="<?php echo $_REQUEST['mode'];?>"/>

                <div class="form-group">                    

                  <label for="inputEmail3" class="col-sm-3 control-label">I am </label>

                  <div class="col-sm-8">

                    <input type="text" value="<?php echo $contentdetails[0]['jobtitle'];?>" autocomplete="off" class="form-control" id="jobtitle" name="jobtitle" placeholder="I am" required="required">

                  </div>

                </div>

                 <div class="form-group">                    

                  <label for="inputEmail3" class="col-sm-3 control-label">Company Name</label>

                  <div class="col-sm-8">

                    <input type="text" value="<?php echo $contentdetails[0]['company'];?>" autocomplete="off" class="form-control" id="firstname" name="company" placeholder="Company" required="required">

                  </div>

                </div>

                <div class="form-group">                    

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_FIRSTNAME;?></label>

                  <div class="col-sm-8">

                    <input type="text" value="<?php echo $contentdetails[0]['firstname'];?>" autocomplete="off" class="form-control" id="firstname" name="firstname" placeholder="First Name" required="required">

                  </div>

                </div>

               

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_LASTNAME;?></label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" id="lastname" autocomplete="off" value="<?php echo $contentdetails[0]['lastname'];?>" name="lastname" placeholder="Last Name" required="required">

                  </div>

                </div>

                  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

                <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>

<script>

   function checkAvailability() {

$("#loaderIcon").show();

jQuery.ajax({

url: "check_email.php",

data:'username='+$("#email").val(),

type:"POST",

success:function(data){

$("#user-availability-status").html(data);

$("#loaderIcon").hide();

},

error:function (){}

});

}

</script>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_EMAIL;?></label>



                  <div class="col-sm-8">

                    <input type="email" class="form-control" value="<?php echo $contentdetails[0]['email'];?>"  id="email"  onBlur="checkAvailability()" name="email" placeholder="Email Address" autocomplete="off">

                    <span id="user-availability-status"></span>

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_PHONE;?></label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" value="<?php echo $contentdetails[0]['phone'];?>" id="phone" name="phone" placeholder="Phone" autocomplete="off">

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_MOBILE;?></label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" id="mobile" value="<?php echo $contentdetails[0]['mobile'];?>" name="mobile" placeholder="Mobile" autocomplete="off">

                  </div>

                </div>

               <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Market of Interest</label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" id="mobile" value="<?php echo $contentdetails[0]['marketofinterest'];?>" name="marketofinterest" placeholder="Marketofinterest" autocomplete="off">

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_CITY;?></label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" id="city" value="<?php echo $contentdetails[0]['city'];?>" name="city" placeholder="City" autocomplete="off">

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_CURRENTADDRESS;?></label>

                  <div class="col-sm-8">

                 <textarea autocomplete="off" name="address" class="textarea" placeholder="Current Address" style="width: 100%; height: 150px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"><?php echo $contentdetails[0]['address'];?></textarea>

                 </div>

                 </div> 

                 <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_PERMANENTADDRESS;?></label>

                  <div class="col-sm-8">

                 <textarea autocomplete="off" name="homeaddress" class="textarea" placeholder="Permanent Address" style="width: 100%; height: 150px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"><?php echo $contentdetails[0]['homeaddress'];?></textarea>

                 </div>

                 </div>

                

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Country</label>



                  <div class="col-sm-8">

                  <?php

                  $countries= $helper->select("tbl_country","countryid,country",array());				   

				  ?>

                  <select name="country" class="form-control" id="country">

                  <?php

				  foreach($countries as $country){

				  ?>

                  <option <?php if($country['countryid']==$contentdetails[0]['country']){ echo "selected";}?> value="<?php echo $country['countryid'];?>"><?php echo $country['country'];?></option>

                  <?php

				  }

				  ?>

                  </select>

                   </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label"><?php echo AL_ZIPCODE;?></label>



                  <div class="col-sm-8">

                    <input type="text" class="form-control" id="zipcode" value="<?php echo $contentdetails[0]['pobox'];?>" name="pobox" placeholder="Zipcode" autocomplete="off">

                  </div>

                </div>

                 <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Expiry Date</label>



                  <div class="col-sm-8">

                      <input name="expirydate" type="text" value="<?php echo $contentdetails[0]['expirydate'];?>" class="form-control pull-right" id="datepicker" autocomplete="off">

                  </div>

                </div>

  

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Status</label> 

                  <div class="col-sm-8">

                      <select class="form-control" name="status">

                          <option <?php if($contentdetails[0]['status']==0){ echo "selected"; } ?> value="0">Pending</option>

                          <option value="1" <?php if($contentdetails[0]['status']==1){ echo "selected"; }?>>Active</option> 

                      </select>

                     

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Plan</label> 

                  <div class="col-sm-8">

                      <select class="form-control" name="plan">

                          <option <?php if($contentdetails[0]['plan']==0){ echo "selected"; } ?> value="0">Un Paid</option>

                          <option value="1" <?php if($contentdetails[0]['plan']==1){ echo "selected"; }?>>Paid</option>

                          <option value="2" <?php if($contentdetails[0]['plan']==2){ echo "selected"; }?>>Trial Period</option>

                      </select>

                     

                  </div>

                </div>

        <script>

function getdistrict(val) {

	$.ajax({

	type: "POST",

	url: "ajaxpro.php",

	data:'state_id='+val,

	success: function(data){

		$("#district-list").html(data);

	}

	});

}

function selectCountry(val) {

$("#search-box").val(val);

$("#suggesstion-box").hide();

}

</script>	

                <?php 

				

define('DB_SERVER', 'localhost');

define('DB_USERNAME', 'menahotel');

define('DB_PASSWORD', 'GN%3{3HX1yie');

define('DB_DATABASE', 'menahotel');

$con=mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);

?>

     <!--<div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Country</label>



                  <div class="col-sm-8">

                  <?php

                  $countries1=mysqli_query($con,"select * from tbl_countries order by id");				   

				  ?>

                  

                  <select onChange="getdistrict(this.value);" name="countries" class="form-control" id="state">

                  <option value=''>Select one</option>

                  <?php

				  while($cc=mysqli_fetch_array($countries1)) {

				  ?>

                  <option  value="<?php echo $cc['id'];?>"><?php echo $cc['country'];?></option>

                  <?php

				  }

				  ?>

                  </select>

                   </div>

                </div>-->

                <!--<div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">City</label>



                  <div class="col-sm-8">

                 

                  

                  <select name="cities" class="form-control" id="district-list">

                  <option value=''>Select one</option>

                

                  </select>

                   </div>

                </div>-->

                

                <?php

                if($_REQUEST['mode']!="edit"){

                ?>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">New Password</label>



                  <div class="col-sm-8">

                    <input required="required" type="password" name="password" class="form-control" id="password" placeholder="Password">

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Confirm Password</label>



                  <div class="col-sm-8">

                    <input required="required" type="password" name="conpassword" class="form-control" id="conpassword" placeholder="Confirm Password">

                  </div>

                </div>

                <?php

                }

                ?>

                

               

                

              </div>

              

              <!-- /.box-body -->

               </div>

              <!-- /.tab-pane -->

              

              <div class="box-footer">

                <button type="reset" class="btn btn-default"><?php echo AL_CANCEL;?></button>

                <input type="submit" name="submit" value="<?php echo AL_SUBMIT;?>" class="btn btn-info pull-right"/>

              </div>

              <!-- /.box-footer -->

            </form>

          </div>

          <!-- /.box -->

          <?php

                if($_REQUEST['mode']=="edit"){

                ?>

          <div class="box box-warning">

            <div class="box-header with-border">

              <h3 class="box-title">Change Password</h3>

            </div>

            <!-- /.box-header -->

            <div class="box-body">

            <?php

			if($error!=""){

			?>

            <button class="btn btn-block btn-success btn-flat" type="button"><?php echo $error;?></button>

			<?php	

			}

			?>

              <form class="form-horizontal" action="" method="post">

               

                <!-- text input -->

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">New Password</label>



                  <div class="col-sm-8">

                    <input required="required" type="password" name="password" class="form-control" id="password" placeholder="Password">

                  </div>

                </div>

                <div class="form-group">

                  <label for="inputEmail3" class="col-sm-3 control-label">Confirm Password</label>



                  <div class="col-sm-8">

                    <input required="required" type="password" name="conpassword" class="form-control" id="conpassword" placeholder="Confirm Password">

                  </div>

                </div>

                 

                <div class="box-footer">

                <button type="reset" class="btn btn-default">Cancel</button>

                <input type="submit" class="btn btn-info pull-right" name="updatepass" value="Update Password"/>

              </div>

                



              </form>

            </div>

            <?php

                }

                ?>

            <!-- /.box-body -->

          </div>

        </div>

        </div>

        </div>

        <?php

	    }

		else {

	    ?>

        <?php

		//if(isset($user_id)){

		if($mode=="delete"){

			 $message=$helper->delete($table, array($field_id=>$_REQUEST['contentid']));

		}

		?>

          <?php

		if($mode=="approve"){
			$helper->update($table, array("status"=>1),array($field_id=>$_REQUEST['contentid']), array());
                        $helper->approveemail($_REQUEST['contentid'],$table);

		}

		?>

         <?php

		if($mode=="pending"){

			$helper->update($table, array("status"=>2),array($field_id=>$_REQUEST['contentid']), array());

		}

		//}

		?>

        <div class="row">

        <div class="col-xs-12">

          <div class="box">

            <div class="box-header">

              <i class="fa fa-building-o"></i>



              <h3 class="box-title"><?php echo $maintitle;?></h3>



              <div class="box-tools pull-right" data-toggle="tooltip" title="">

                <div class="btn-group">

                  

                <?php

                  if(isset($user_id)){

				  ?>

                 <a href="<?php echo $page;?>?mode=add"><button class="btn btn-danger btn-flat"><i class="glyphicon  glyphicon-plus"></i>&nbsp;<?php echo AL_ADDNEW;?> <?php echo $maintitle;?></button></a>

                 <?php

				  }

				  ?>

                </div>

              </div>

            </div>

                      <?php
                      if($_REQUEST['plan']==2){
                         
                       $listtypes=$helper->selectlimit($table,"*",array("plan"=>2),$start,$limit,array("int_user_id"=>"DESC"));	
                      } 
                      elseif($_REQUEST['plan']==1 && $_REQUEST['status']==1){
                         
                       $listtypes=$helper->selectlimit($table,"*",array("plan"=>1,"status"=>1),$start,$limit,array("int_user_id"=>"DESC"));	
                      }
                      elseif($_REQUEST['expire']==1){
                       $listtypes=$helper->selectexpireusers($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                      elseif($_REQUEST['expire']==30){
                       $listtypes=$helper->selectexpireusersin30days($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                      elseif($_REQUEST['type']=="pending"){ 
                      $listtypes=$helper->selectlimit($table,"*",array("status"=>0),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                      else {
                      $listtypes=$helper->selectlimit($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                     /* if($_REQUEST['plan']==2){
                         
                       $listtypes=$helper->selectlimit($table,"*",array("plan"=>2),$start,$limit,array("int_user_id"=>"DESC"));	
                      }
                       elseif($_REQUEST['status']==0){
                         
                       $listtypes=$helper->selectlimit($table,"*",array("status"=>0),$start,$limit,array("int_user_id"=>"DESC"));	
                      }
                       elseif($_REQUEST['plan']==1 && $_REQUEST['status']==1){
                         
                       $listtypes=$helper->selectlimit($table,"*",array("plan"=>1,"status"=>1),$start,$limit,array("int_user_id"=>"DESC"));	
                      }
                      elseif($_REQUEST['expire']==1){
                       $listtypes=$helper->selectexpireusers($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                      elseif($_REQUEST['expire']==30){
                       $listtypes=$helper->selectexpireusersin30days($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));
                      }
                      else {                          
			$listtypes=$helper->selectlimit($table,"*",array(),$start,$limit,array("int_user_id"=>"DESC"));	
                      }*/

			?>

            <!-- /.box-header -->

            <div class="box-body table-responsive no-padding">

            <?php

			if($message!=""){

			?>

            <button class="btn btn-block btn-danger btn-flat" type="button"><?php echo $message['message'];?></button>

			<?php	

			}

			?>

              <table class="table table-hover">

                <tr>

                  <th><?php echo AL_SERIALNO;?></th>

                  <th><?php echo AL_NAME;?></th>

                  <th><?php echo AL_EMAIL;?></th>

                  <th><?php echo AL_PHONE;?></th>                 

                  <th>Date</th>

                  

                 

                <?php /*?>  <th><?php echo AL_STATUS;?></th><?php */?>

                  <th><?php echo AL_ACTION;?></th>

                  

                  

                </tr>

                <?php

				$i=($start*$limit)+1;

				foreach($listtypes as $type){

				?>

                <tr>

                  <td><?php echo $i;?></td>

                  <td><?php echo $type['firstname']." ".$type['lastname'];?>              

                  </td>                  

                  <td><?php echo $type['email'];?></td>

                  <td>Tel: <?php echo $type['phone'];?><br/>Mob: <?php echo $type['mobile'];?></td>

				  

                  <td>

                   <?php echo $type['str_date'];?>

                  </td>

                  

                  <?php

				  if($_REQUEST['start']>0){

					  $limitpage=$_REQUEST['start'];

				  }

				  else {

					  $limitpage=1;

				  }

				  ?>

                 

                  

                 

                  <td>

                      <?php

				  

				  if($type['status']==1){

				  ?>

<a><span class="label label-success"><?php echo "Active";?></span></a>

                  <?php

				  }

				   if($type['status']==0){

				  ?>

				  <a><span class="label label-danger"><?php echo AL_PENDING;?></span></a>

                  <?php

				  }

				  ?>

                      <a href="<?php echo $admin_url;?><?php echo $page;?>?mode=edit&contentid=<?php echo $type[$field_id];?>&start=<?php echo $limitpage;?>"><span class="label label-primary"><i class="fa fa-edit"></i> <?php echo AL_EDIT;?></span></a>

                   <a href="<?php echo $admin_url;?><?php echo $page;?>?mode=delete&contentid=<?php echo $type[$field_id];?>&start=<?php echo $limitpage;?>" onclick="return getConfirmation()"><span class="label label-danger"><i class="fa fa-times"></i> <?php echo AL_DELETE;?></span></a>
<a href="user-visited-pages.php?content_id=<?php echo $type[$field_id];?>"><span class="label label-primary"><i class="fa fa-edit"></i> Pages Visited</span></a>
<a href="user-visited-hotels.php?content_id=<?php echo $type[$field_id];?>"><span class="label label-primary"><i class="fa fa-edit"></i> Hotels Visited</span></a>  
                 
                   </td>

                  

                   

                </tr>

               

                <?php

				$i=$i+1;

				}

				?>

                

                

              </table>

              <?php
                   $expire=$_REQUEST['expire'];
                    
                     if($_REQUEST['plan']==2){
                        $counter_list= $helper->countofdata($table,array("plan"=>2),$limit,array("status"=>"ASC")); 
                        include('pagination/pagination_trial.php');	
                      }
                      
                       elseif($_REQUEST['plan']==1 && $_REQUEST['status']==1){
                       $counter_list= $helper->countofdata($table,array("plan"=>1,"status"=>1),$limit,array("status"=>"ASC")); 
                        include('pagination/pagination_active.php');
                      }
                      elseif($expire==1){
                        $counter_list= $helper->countofexpiredata($table,array(),$limit,array("status"=>"ASC")); 
                        include('pagination/pagination_expire.php');
                      }
                      elseif($_REQUEST['expire']==30){                          
                       $counter_list= $helper->countofexpiredatain30days($table,array(),$limit,array("status"=>"ASC"));
                       include('pagination/pagination_expirein30days.php');
                      }
                      elseif($_REQUEST['type']=="pending"){                          
                        $counter_list= $helper->countofdata($table,array("status"=>0),$limit,array("status"=>"ASC"));
                       include('pagination/pagination_expirein30days.php');
                      }
                      else {   
			  $counter_list= $helper->countofdata($table,array(),$limit,array("status"=>"ASC"));
			  include('pagination/pagination.php');
                      }

			  ?>

            </div>

            <!-- /.box-body -->

          </div>

          <!-- /.box -->

        </div>

      </div>

      <?php

		}

		?>



    </section>

    <!-- /.content -->

  </div>

<?php include('footer.php');  ?>