File: /home/barbeatleanalyti/public_html/barisnew.beatleanalytics.com/site/backup/template/users.php
<?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" 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> 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-1 col-xs-3 col-sm-2 col-lg-1 pull-left form-group no-padding ">
<a class="btn btn-info btn-sm" href="<?php echo $Dash; ?>.html"> <i class="fa fa-long-arrow-left"></i> Back </a>
</div>
<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 FetchIndustryDetails(branchid){
var xhttpI = new XMLHttpRequest();
xhttpI.onreadystatechange = function() {
if (xhttpI.readyState == 4 && xhttpI.status == 200) {
document.getElementById("industry_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" id="branch_list" >
<?php $rsBranches = $objUsers->fetchBranches(); ?>
<!--<span id="span_select" style="width:120px; height:35px; float:right;">-->
<select class="form-control input-md" name="Branches">
<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="state_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-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-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-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> 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>
</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;?>" >
<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 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>
</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( {
"scrollY": 800,
"scrollX": true
} );
} );
</script>
<style>
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>