Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 18.216.253.84
<?php
class dash_client
{
public $internal_code;
function __construct($aobj_context)
{
session_start();
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->aobj_context=$aobj_context;
require_once($aobj_context->main_src."/src/format.php");
$this->source_path=$this->aobj_context->main_src."/statutory_data/";
$this->user_id = $_SESSION['user_id'];
$this->user_type = $_SESSION['user_type'];
}
function FormDashBoardForClient()
{
$get_last_processed_month_data="SELECT MAX(MONTH) AS last_processed_month FROM approve_monthly_data WHERE STATUS='Approved'";
$obj_last_processed_month_data = $this->aobj_context->mobj_db->GetRow($get_last_processed_month_data);
$last_month=$obj_last_processed_month_data['last_processed_month'];
$last_processed_month=ui_month_format($last_month);
$get_processing_month_data="SELECT MAX(MONTH) AS processed_month FROM approve_monthly_data WHERE STATUS='New'";
$obj_processing_month_data = $this->aobj_context->mobj_db->GetRow($get_processing_month_data);
$process_month=$obj_processing_month_data['processed_month'];
$processed_month=ui_month_format($process_month);
$pending_mails=0;
$pending_mails="SELECT COUNT(1) AS pending_mails FROM out_box_mails WHERE send_mail=0";
$obj_pending_mails= $this->aobj_context->mobj_db->GetRow($pending_mails);
$pending_mails=$obj_pending_mails['pending_mails'];
$this->file_names_arr=array();
$allowed_extentions=array("zip","rar",'xls','xlsx');
$i=0;
if (is_dir($this->source_path))
{
$files = scandir($this->source_path);
foreach ($files as $file)
{
$info =pathinfo($file);
$extension=strtolower($info['extension']);
if (in_array($extension,$allowed_extentions)&& is_file($this->source_path.'/'.$file))
{
$this->file_names_arr[$i]['file_name']=$file;
$this->file_names_arr[$i]['full_path']=$this->source_path.''.$file.'';
$date=date ("F d Y ", filemtime($this->file_names_arr[$i]['full_path']));
$this->file_names_arr[$i]['date']=$date;
$i++;
}
}
}
$uploaded_file_count=count($this->file_names_arr);
$this->html='<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat blue">
<div class="visual">
<i class="fa fa-check-square"></i>
</div>
<div class="details">
<div class="number">
'.$last_processed_month.'
</div>
<div class="desc">
</div>
</div>
<a class="more" style="font-weight:700; opacity: 0.98;" href="#"> Last processed month
</a>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat green">
<div class="visual">
<i class="fa fa-cogs"></i>
</div>
<div class="details">
<div class="number">
'.$processed_month.'
</div>
<div class="desc">
</div>
</div>
<a class="more" style="font-weight:700; opacity: 0.98;" href="#">Processing Month
</a>
</div>
</div>';
if($uploaded_file_count>0)
{
$this->html.='<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat yellow">
<div class="visual">
<i class="fa fa-files-o"></i>
</div>
<div class="details">
<div class="number">
'.$uploaded_file_count.'
</div>
<div class="desc">
</div>
</div>';
$this->html.="<a class='more' style='font-weight:700; opacity: 0.98;' href='#' onclick=\"getModulesDetails('Import~Statutory~Data',36,'Add','Import Statutory Data','New') ;\">Uploded files
</a>
</div>
</div>";
}
$this->html.='<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
<div class="dashboard-stat red">
<div class="visual">
<i class="fa fa-envelope"></i>
</div>
<div class="details">
<div class="number">
'.$pending_mails.'
</div>
<div class="desc">
</div>
</div>';
$this->html.="<a class='more' style='font-weight:700; opacity: 0.98;' href='#' >Pending Mails to Send
</a>
</div>
</div>";
$this->html.='</div>';
return $this->html;
}
}
?>
|