
PK 
<?php
ob_start();
//error_reporting(E_ALL ^ E_NOTICE);
@session_start();
ini_set('allow_url_include',1);
date_default_timezone_set("Asia/Kolkata");
set_time_limit(600);
ini_set('max_execution_time',600);
include '../includes/settings/constant.php';
//include '../includes/settings/db.php';
require_once '../includes/settings/PDODB.php';
include '../includes/modules/functions.php';
$function = new FUNCTIONS();
//print_r($_SESSION);
if(empty($_SESSION['adminId'])){
header("Location: ../index.php");
exit();
}
$curYear = date('Y');
$fromdate = $curYear."-04-01";
$todate = date("Y-m-d");
//print_r($todate); exit;
$user = $function->getUsers(NULL,NULL,NULL,1);
$vehicles = $function->getVehicleDetails(NULL,1);
$driverdata = $function->getDriverDetails($id=NULL,$member_id=NULL,$isactive=1);
$servantdata = $function->getServant($id=NULL,$member_id=NULL,$isactive=1);
$account = $function->getAllAccountDetails($uid=NULL,$orderid='',$is_adjustment=1,$isactive=1,$from_date=$fromdate,$to_date=$todate,$orderBy='DESC');
$chq_totamt= 0;
foreach ($account as $key => $value) {
$chq_totamt += $value['credit'];
}
$discountperiod = $function->getDiscountPeriod($id=NULL,$date_to=NULL,$date_from=NULL);
//print_r($discountperiod); exit;
if(isset($_POST['acsearch'])){
//print_r($_POST); exit;
$date_from = !empty($_POST['date_from'])?$_POST['date_from']:"";
$date_to = !empty($_POST['date_to'])?$_POST['date_to']:"";
$date_from =date('Y-m-d', strtotime($date_from));
$date_to =date('Y-m-d', strtotime($date_to));
$pdodb = PDODB::getInstance();
$sql = "UPDATE discount_period SET date_from = '".$date_from."', date_to = '".$date_to."'";
$result = $pdodb->query($sql);
PDODB::closeInstance();
if(!empty($result)){
echo '<script type="text/javascript">location.replace("index.php");</script>';
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>INSPINIA | Dashboard</title>
<?php include_once '../layout/style.php'; ?>
</head>
<body>
<div id="wrapper">
<?php $currentPage = 'dashboard'; include_once '../layout/side-bar.php'; ?>
<div id="page-wrapper" class="gray-bg dashbard-1">
<?php include_once '../layout/header.php'; ?>
<div class="row border-bottom white-bg dashboard-header">
<div class="col-sm-6">
<h2>Welcome RWA Sector 40</h2>
<small>Dashboard</small>
</div>
</div>
<?php if ($_SESSION['admin_role_id']==1) { ?>
<div class="row" style="background-color: #fff;">
<div class="ibox-content">
<div class="col-lg-4">
<a href="../member/index.php">
<div class="panel panel-primary">
<div class="panel-heading">
Member
</div>
<div class="panel-body text-navy">
<h1 class="no-margins"><?=count($user);?></h1>
<!-- <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i></div> -->
<p>Total number of members</p>
</div>
</div>
</a>
</div>
<div class="col-lg-4">
<a href="../driver/all-driver.php">
<div class="panel panel-success">
<div class="panel-heading">
Driver
</div>
<div class="panel-body text-success">
<h1 class="no-margins"><?=count($driverdata);?></h1>
<!-- <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i></div> -->
<p>Total number of driver</p>
</div>
</div>
</a>
</div>
<div class="col-lg-4">
<a href="../servant/all-servant.php">
<div class="panel panel-info">
<div class="panel-heading">
Servant
</div>
<div class="panel-body text-info">
<h1 class="no-margins"><?=count($servantdata);?></h1>
<!-- <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i></div> -->
<p>Total number of Servant</p>
</div>
</div>
</a>
</div>
<div class="col-lg-4">
<a href="../vehicle/vehicle-list.php">
<div class="panel panel-warning">
<div class="panel-heading">
Vehicle
</div>
<div class="panel-body text-warning">
<h1 class="no-margins"><?=count($vehicles);?></h1>
<!-- <div class="stat-percent font-bold text-success">98% <i class="fa fa-bolt"></i></div> -->
<p>Total number of Vehicle</p>
</div>
</div>
</a>
</div>
<div class="col-lg-4">
<a href="../rwa-ac/index.php">
<div class="panel panel-danger">
<div class="panel-heading">
Payments
</div>
<div class="panel-body text-danger">
<h1 class="no-margins">₹ <?=$chq_totamt;?> /-</h1>
<p>(From <?=$fromdate;?> to <?=$todate;?> )</p>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form method="POST" action="">
<div class="form-group" id="data_5">
<label class="font-noraml"><strong>Discount time period</strong></label>
<div class="input-daterange input-group" id="datepicker">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input type="text" class="input-sm form-control" id="date_to" name="date_to" value="<?=date('m/j/Y', strtotime($discountperiod[0]['date_to']));?>"/>
<span class="input-group-addon">to</span>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
<input type="text" class="input-sm form-control" id="date_from" name="date_from" value="<?=date('m/j/Y', strtotime($discountperiod[0]['date_from']));?>" />
</div>
<div class="form-group" style="margin-top: 10px;">
<button class="btn btn-sm btn-primary" name="acsearch" id="acsearch">Update</button>
<a href="" class="btn btn-sm btn-primary">Clear</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<?php } if ($_SESSION['admin_role_id']==2) { ?>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-content">
<button id="payButton" class="btn btn-primary dim" type="button"><i class="fa fa-money"></i><span class="nav-label"> Payment </span></button>
<button id="addmemberButton" class="btn btn-danger dim" type="button"><i class="fa fa-user-plus"></i><span class="nav-label"> Add New Member</span>
</button>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php include_once '../layout/script.php'; ?>
<script type="text/javascript">
document.getElementById("payButton").onclick = function () {
location.href = "../payment/index.php";
};
document.getElementById("addmemberButton").onclick = function () {
location.href = "../newmember/index.php";
};
</script>
<script>
$(document).ready(function() {
setTimeout(function() {
toastr.options = {
closeButton: true,
progressBar: true,
showMethod: 'slideDown',
timeOut: 4000
};
toastr.success('Welcome to RWA Admin');
}, 1300);
$('#data_5 .input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
});
</script>
</body>
</html>


PK 99