HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/barbeatleanalyti/public_html/manage.beatleanalytics.com/site/template/users.php
<script type="text/javascript">
$(document).ready(function(){

	//delete attendent user
    $('.delAttendent').click(function(){
    var r = confirm("Would you like to delete this attendent user?");
      if (r == true) 
      {
    	var atteId = $(this).attr('data-uid');
    	//alert(atteId);
	    	$.ajax({
	          type: "POST",
	          url: "runajax.php",
	          data: {method:'deleteAttendent',data:atteId},
	          cache: false,
	          success: function(data) {
	            //$('#loader_image').hide();
	            //alert(data);
	            $("#row"+atteId).hide('500');
	            
	          }
	        });
		}
  	});
});
</script>
<?php
	// Declare new object

	$objUsers = object;
	
	// Assing object 
	$objUsers = $objDB->objController;
	
	// Assign all variable's value
	$pg 			= $objUsers->pg;
	$acn 			= $objUsers->acn;
	$v 				= $objUsers->v;
	$State 			= $objUsers->State;
	$ReligionName 	= $objUsers->ReligionName;
	$sort			= $objUsers->sort;
	$ReligionID		= $objUsers->ReligionID;
	$field			= $objUsers->field;
	$error 			= $objUsers->error;
	$msg 			= $objUsers->msg;
	$perpage 		= $objUsers->perpage;
	$start	 		= $objUsers->start;
	$limit	 		= $objUsers->limit;
	$SearchValue	= $objUsers->SearchValue;
	$s				= $objUsers->s;	

	$OrgID	= $objCustomer->OrgID;
	$BranchID	= $objCustomer->BranchID;
	$IndustryID	= $objCustomer->IndustryID;
	

	
	$rsUserInfo = $objUsers->FetchAllUsersData("All");
	
	if($start == 1)
		$limit = 0;
	else if($start == 2)
		$limit = $perpage;
	else
		$limit = ($start-1) * $perpage;
	
	$objUsers->limit = $limit;
	
	$nume = count($rsUserInfo);
	
	$totalpage = @ceil(count($rsUserInfo)/$perpage);	

	$rsUserInfo = $objUsers->FetchAllUsersData();
	
	
	if($sort == '0'){
		$sort = '1';
	}
	else{	
		$sort = '0';
		}
	

	$link = "";
	if( $start != "" && $start != 0 ){
		$link .= "&start={$start}";
	}
	if( $perpage != "" && $perpage != 0 ){
		$link .= "&perpage={$perpage}";
	}
	if(trim($s) != ""){
		$link .= "&s={$s}";
	}
		
	
	$Dash = "";
	if($_SESSION['UserInfo']['UType'] == 'MasterAdmin'){
	
	$Dash = "dashboardma";
	
	}else if($_SESSION['UserInfo']['UType'] == 'Admin'){
	
	$Dash = "dashboardadmin";
	}


?>

<div class="content-wrapper cust_hight" style="height: 959px">

<?php
		
		if( strtolower($v)=='add'|| strtolower($v)=='edit')
		{} 
			  
	else if($v=='list'){
			  ?>
              <section class="content-header">
<?php  if(strtolower($v) == 'list'){?>
<h1>&nbsp;List of users </h1>
    <ol class="breadcrumb">
    <li><a href="index.html"><i class="fa fa-home"></i> Home</a></li>
    <li><a href="users.html?v=list"><i class="fa users"></i>Users</a></li>
    <li class="active">Users List</li>
  </ol>
  <?php } ?>
 </section>
 <?php
	// Error or success message display
	$objDB->NotificaitonForResult($msg,$error)
?>
 <section class="content">
     <div class="row">
        <div class="col-md-12">
          <div class="box box-primary">
            <div class="box-header">
               <div class="col-md-12 col-xs-12 no-padding">  	
    
    						     <div class="row">
                                 <div class="col-md-12">
                                <form method="post" action="users.html" name="frmSearch" id="frmSearch">
								<input type="hidden" name="start" id="start" value="<?php echo $start?>" />
								<input type="hidden" name="perpage" id="perpage" value="<?php echo $perpage?>" />
                                
                           

                                    
                                  <div class="col-md-3 col-xs-12 col-lg-2 form-group">
                                  <?php $rsOrganization = $objUsers->fetchOrganization(); ?>
                                    <!--<span id="span_select" style="width:120px; height:35px; float:right;">-->
                                        <select class="form-control input-md" id="org_list" onchange="javascript: getBranchData(this.value)" name="Organization">
                                           <option value="0">Select Organization</option> 
										   <?php if(count($rsOrganization) > 0) { ?>
                                           <option style="font-weight:bold;" <?php if(!empty($OrgID)) echo 'selected="selected"'; ?>  value="<?php echo $rsOrganization[0]['OrgId']?>"><?php echo $rsOrganization[0]['db_Orgname']?></option>
                                           <?php  }else{ ?>
											   <option value="0">No any org. found</option>
											<?php  } ?>
										</select>
                                    <!--</span>-->
                                  </div>
                                  
                                  <script>
								  	function getBranchData(orgid){
										
										  var xhttp = new XMLHttpRequest();
										  xhttp.onreadystatechange = function() {
											if (xhttp.readyState == 4 && xhttp.status == 200) {
													document.getElementById("branch_list").innerHTML = xhttp.responseText;
												}
										  };
										  xhttp.open("GET", "runajax.php?acn=FetchBranchDetails&orgid="+orgid, true);
										  xhttp.send();
									}
									
									function getIndustryDetails(branchid){
										 
										  var xhttpI = new XMLHttpRequest();
										  xhttpI.onreadystatechange = function() {
											if (xhttpI.readyState == 4 && xhttpI.status == 200) {
													document.getElementById("ind_list").innerHTML = xhttpI.responseText;
												}
										  };
										  xhttpI.open("GET", "runajax.php?acn=FetchIndustryDetails&branchid="+branchid, true);
										  xhttpI.send();
									}
									
									
                                  </script>
                                  
                                  
                                  
                                  <div class="col-md-3 col-xs-12 col-lg-2 form-group">
                                  
                                  <?php //$rsBranches = $objUsers->fetchBranches();  ?>
                                    <!--<span id="span_select" style="width:120px; height:35px; float:right;">-->
                                        <select class="form-control input-md" id="branch_list" name="Branches" onchange="javascript: getIndustryDetails(this.value)">
                                            <option value="0"> Select Branch </option> 
                                            <!-- <?php if(count($rsBranches) > 0) { for($b=0; $b<count($rsBranches); $b++) { ?>
                                            <option <?php if($BranchID === $rsBranches[$b]['branchId']) echo 'selected="selected"'; ?> value="<?php echo $rsBranches[$b]['branchId']?>"><?php echo $rsBranches[$b]['db_branchName']?></option>
                                            
                                            <?php }
											
											}else{ ?>
                                            <option value="0">No any branch found</option>
                                            <?php } ?> -->
                                            
										</select>
                                    <!--</span>-->
                                  </div>
                                  
                                  <div class="col-md-2 col-xs-12 col-lg-2 form-group" id="industry_list">
                                    <!--<span id="span_select" style="width:120px; height:35px; float:right;">-->
                                    <?php //$rsIndustrys = $objUsers->fetchIndustrys($OrgID,$BranchID,$IndustryID);  ?>
                                  <select class="form-control input-md" id="ind_list" name="Industrys">
                                            <option value="0"> Select Industry </option> 
                                            <!-- <?php if(count($rsIndustrys) > 0) { for($b=0; $b<count($rsIndustrys); $b++) { ?>
                                            <option <?php if($IndustryID === $rsIndustrys[$b]['IndId']) echo 'selected="selected"'; ?> value="<?php echo $rsIndustrys[$b]['IndId']?>"><?php echo $rsIndustrys[$b]['db_industry']?></option>
                                            
                                            <?php }
											
											}else{ ?>
                                            <option value="0">No any ind. found</option>
                                            <?php } ?> -->
                                            
										</select>
                                                                
                                    <!--</span>-->
                                  </div>
                                  
                                 
                                    
                                  <div class=" col-xs-6 col-sm-2 col-md-1 col-lg-1  pull-right text-right form-group no-padding">
                                    <a class="btn btn-sm btn-danger"  href="users.html"> <i class="fa fa-refresh"></i> Reset  </a> </div>
									
									
									 <div class=" col-xs-6 col-sm-3 col-md-1 col-lg-1 pull-right text-right">
                  
				                   <div class="input-group input-group-sm">
				                    <!--<input type="text" id="s" name="s" placeholder="Search content here .." class="form-control" value=""> -->                      
				                    <span class="input-group-btn">
				                             <button class="btn btn-block btn-success btn-md " type="submit"><i class="fa fa-search" aria-hidden="true"></i>Search
											 </button>
				                    </span>
				                  </div>        
				                   
				                </div>
                                    
								  <!--<div class="col-md-2 col-xs-6 col-sm-4 form-group "><a class="btn btn-sm btn-success col-xs-12" href="users.html?v=add"> <i class="fa fa-plus"></i>&nbsp;Add Religions  </a> 
                                    </div> -->
                                    
                                  <!--<div class="form-group col-md-3 pull-right col-sm-4 col-xs-12 no-padding">
                                       <div class="input-group input-group-sm">
                                        <input  type="text" id="s" name="s" placeholder="Search content here .." class="form-control" value="<?php echo $s ?>" >                           
                                                 <span class="input-group-btn">
                                                 <button class="btn btn-info btn-flat" type="submit">Search!</button>
                                                </span>
                                                  </div>        
                  						 </div> -->	
                                </form>
                                </div>
                                </div>
    			
    
               	
                    <div class="row">
     
			
					
					
					<!-------List of users----->
					<div class="customers-list--">


<div class="">
  <div class="col-md-12">
      <div class="table-responsive--  panel-default--">
	  
	  <table id="example9" class="display nowrap" style="width:100%">
          <thead>
            <tr>
			                     <th >Sr.No.</th>
                                  <th>User ID</th>
								  <th><!--<a href="users.html?sort=<?=$sort?>&field=Religion_Name<?php echo $link?>">Name</a> <span> <a href="users.html?sort=<?=$sort?>&field=Religion_Name" > <?php if($field == 'Religion_Name' )  { 
											if($sort == 0){
												echo '<i class="fa fa-sort-asc"></i>'; 	
											}else{
												echo '<i class="fa fa-sort-desc"></i>'; 
											}
								  
								  } else { echo '<i class="fa fa-sort"></i>'; } ?> </a> </span> --> Name </th>
								  <th >Type</th>
                                  <th >Organization</th>
                                  <th>Branch</th>
                                  <th>Industry</th>
                                  <th>Action</th>
					            </tr>
					          </thead>
							  <tbody>
							  
					        <?php 
								
								if(count($rsUserInfo)>0){
								for ($i=0;$i< count($rsUserInfo);$i++)
								{
									   if($i%2)
												$bgclass='altrow';
											else
												$bgclass='oddrow';
								
								?>
									<tr class="<?php echo $bgclass;?>" id="row<?php echo $rsUserInfo[$i]['userId'];?>">
									<td><label name="No"><?php echo $i+1; ?></label></td>
									<td ><label name="User ID"><?php echo $rsUserInfo[$i]['userId'];?></label></td>
									<td ><label name="User name"><?php echo $rsUserInfo[$i]['db_username']; ?></label></td>
                                    <td ><label name="User type">
                                    	<?php 
                                    	if($rsUserInfo[$i]['db_usertype'] == 'owner'){
				   							echo 'Owner';
				   						}elseif($rsUserInfo[$i]['db_usertype'] == 'manager'){
				   							echo 'Manager';
				   						}elseif($rsUserInfo[$i]['db_usertype'] == 'line_manager'){
				   							echo 'Line Manager';
				   						}else{
											echo 'Attendent';
				   						}
				   						//echo $rsUserInfo[$i]['db_usertype']; ?>
				                                    		
                                    	</label></td>
                                    <td ><label name="Organization Name"><?php echo $objUsers->FetchOrganizationName($rsUserInfo[$i]['OrgID']);  ?></label></td>
                                    <td ><label name="Branch Name"><?php echo  $objUsers->FetchBranchName($rsUserInfo[$i]['BranchID']); ?></label></td>
                                    <td><label name="Industry Name"><?php echo $objUsers->FetchIndustryName($rsUserInfo[$i]['IndustryID']); ?></label></td>
                                    <td class="action_user"> 
                                    	<?php if($rsUserInfo[$i]['db_usertype'] == 'attendent'){ ?>
                                    	<a href="addattendant.html?v=edit&uid=<?php echo $rsUserInfo[$i]['userId']; ?>"><i class="fa fa-fw fa-edit" style="color: #48a9d4;"></i></a> 
                                    	<a href="javascript:;" class="delAttendent" data-uid="<?php echo $rsUserInfo[$i]['userId'];?>"><i class="fa fa-trash" aria-hidden="true" style="color: #48a9d4;"></i></a>
                                    <?php }else{?>
                                    	<i class="fa fa-fw fa-edit"></i>
                                    	<i class="fa fa-trash" aria-hidden="true"></i>
                                    <?php } ?>
 									</td>
									</tr>
									<?php }
									}else{
									 ?>
										<tr> <td colspan="9" align="center"> </td> </tr>
										<tr> <td colspan="9" align="center"> No any record found. </td> </tr>
										<tr> <td colspan="9" align="center"> </td> </tr>
										

									<?php } ?>
								 </tbody>
                                 </table>
      </div>
  </div>



</div>



</div>

        <!------//-List of users-------->
		
		
                  <!---- <div class="col-md-12">
                    <div class="table-responsive">
                    
                		 <table class="table table-striped table-bordered">
								  <tbody>
								  <tr>
								  <th class="text-center">Sr.No.</th>
                                  <th class="text-center">User ID</th>
								  <th class="text-center"><!--<a href="users.html?sort=<?=$sort?>&field=Religion_Name<?php echo $link?>">Name</a> <span> <a href="users.html?sort=<?=$sort?>&field=Religion_Name" > <?php if($field == 'Religion_Name' )  { 
											if($sort == 0){
												echo '<i class="fa fa-sort-asc"></i>'; 	
											}else{
												echo '<i class="fa fa-sort-desc"></i>'; 
											}
								  
								  } else { echo '<i class="fa fa-sort"></i>'; } ?> </a> </span> --> <!--Name </th>
								  <th class="text-center">Type</th>
                                  <th class="text-center">Organization</th>
                                  <th class="text-center">Branch</th>
                                  <th class="text-center">Industry</th>
								  </tr>
								  
								  
								  
								<?php 
								
								if(count($rsUserInfo)>0){
								for ($i=0;$i< count($rsUserInfo);$i++)
								{
									   if($i%2)
												$bgclass='altrow';
											else
												$bgclass='oddrow';
								
								?>
									<tr class="<?php echo $bgclass;?>" >
									<td class="text-center"><label name="No"><?php echo $i+1; ?></label></td>
									<td class="text-center"><label name="User ID"><?php echo $rsUserInfo[$i]['userId'];?></label></td>
									<td class="text-center"><label name="User name"><?php echo $rsUserInfo[$i]['db_username']; ?></label></td>
                                    <td class="text-center"><label name="User type"><?php echo $rsUserInfo[$i]['db_usertype']; ?></label></td>
                                    <td class="text-center"><label name="Organization Name"><?php echo $objUsers->FetchOrganizationName($rsUserInfo[$i]['OrgID']);  ?></label></td>
                                    <td class="text-center"><label name="Branch Name"><?php echo  $objUsers->FetchBranchName($rsUserInfo[$i]['BranchID']); ?></label></td>
                                    <td class="text-center"><label name="Industry Name"><?php echo $objUsers->FetchIndustryName($rsUserInfo[$i]['IndustryID']); ?></label></td>
									</tr>
									<?php }
									}else{
									 ?>
										<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>
										<tr class="oddrow"> <td colspan="9" align="center"> No any record found. </td> </tr>
										<tr class="altrow" > <td colspan="9" align="center"> </td> </tr>

									<?php } ?>
								 </tbody>
                                 </table>
                                 
					</div>
                    </div>---->
                    
                    
                    </div>
                    
				
				</div>
   			 </div>
  	  		</div>
    	</div>
    </div>
       <? } ?>  
    </section>
</div>

<script>
	$(document).ready(function() {
    $('#example9').DataTable( {
		"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
        "scrollY": 800,
        "scrollX": true
    } );
} );
	</script>
	
<style>
	 td.action_user i {
    font-size: 20px;
    margin: 0 6px;
    color: #afafaf;
}
		   div.dataTables_wrapper {
    width: 100% !IMPORTANT;
    margin: 0 auto;
    padding: 0px !IMPORTANT;
}
.dataTables_scrollHeadInner {
    padding: 0px !IMPORTANT;
    width: 100% !IMPORTANT;
    margin: 0 auto !IMPORTANT;
}
table.display.nowrap.dataTable.no-footer {
    width: 100% !IMPORTANT;
    text-align: center !IMPORTANT;
    margin: 0 auto;
    padding: 0pc;
}
table.display.nowrap.dataTable.no-footer thead th {
    text-align: center;
}
.dataTables_scrollBody {
    height: auto !IMPORTANT;
    max-height: 800px !IMPORTANT;
}
.dataTables_scroll {
    border: 1px solid #909090;
    border-radius: 3px;
}
		   </style>