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.119.112.208
Current Path : /var/www/html/oums/src/ |
| Current File : /var/www/html/oums/src/home_work_view.php |
<?php
include("sys_connect.php");
include("sys_mainphp.php");
include("sys_session.php");
?>
<div style="margin-bottom: 5px;" class="head_blue">Work Entry Review</div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#view_pend_client">Review Summary</a></li>
<li><a data-toggle="tab" href="#view_pend_today">Pending Review (Today)</a></li>
<li><a data-toggle="tab" href="#view_pend_month">Pending Review (This Month)</a></li>
<li><a data-toggle="tab" href="#view_entr_today">Work Review (Today)</a></li>
<li><a data-toggle="tab" href="#view_entr_month">Work Review (This Month)</a></li>
</ul>
<div class="tab-content" id="home-content-note">
<div id="view_pend_client" class="tab-pane fade in active">
<?php
$myqry = "";
if ($type_id == 'ADMIN') {
$myqry = "";
} else {
$myqry = " and wk.freptempl='$empl_id'";
}
$mysql = "select concat('[',freptempl,'] ',femplname) as freptname,count(*) as totwork,
sum(case when ifnull(fviewstat,'')='REVIEWED' then 1 else 0 end) as totview,
sum(case when ifnull(fviewstat,'')='PENDING' then 1 else 0 end) as totpend,
format((sum(case when ifnull(fviewstat,'')='PENDING' then 1 else 0 end)/count(*)*100),2) as perpend
from workentry wk
left join masempl em on wk.freptempl = em.femplcode
where ifnull(wk.fdelestat,'F')='F'
group by em.femplname having totpend>0;";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-right'>#</th>";
echo "<th class='text-left col-sm-4'>Reporting Head</th>";
echo "<th class='text-right col-sm-2'>Total Entries</th>";
echo "<th class='text-right col-sm-2'>Total Reviewed</th>";
echo "<th class='text-right col-sm-2'>Review Pending</th>";
echo "<th class='text-right col-sm-2'>% Pending</th>";
echo "</tr>";
$i = 1;
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-right'> $i.</td>";
echo "<td class='text-left'> $myrow[freptname]</td>";
echo "<td class='text-right'> $myrow[totwork]</td>";
echo "<td class='text-right'> $myrow[totview]</td>";
echo "<td class='text-right'> $myrow[totpend]</td>";
echo "<td class='text-right'> $myrow[perpend]</td>";
echo "</tr>";
$i++;
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No review pending today!</div>";
}
?>
</div>
<div id="view_pend_today" class="tab-pane fade">
<?php
$myqry = "";
if ($type_id == 'ADMIN') {
$myqry = "";
} else {
$myqry = " and wk.freptempl='$empl_id'";
}
$mysql = "select date_format(wk.fworkdate,'%d/%m/%Y') as fworkdate, em.fdeptcode,fdeptname,fdeptshrt,concat('[',fworkcode,'] ',fworkname) as fworkname,
wk.femplcode,em.femplname as femplname,wk.freptempl,e2.femplname as freptname
from workentry wk
left join masempl em on wk.femplcode = em.femplcode
left join masempl e2 on wk.freptempl = e2.femplcode
left join masdept dp on wk.fdeptcode = dp.fdeptcode
where wk.fviewstat='PENDING' and wk.fworkdate = current_date and ifnull(wk.fdelestat,'F')='F' " . $myqry . "
order by fworkdate desc,fdeptcode,em.femplname,fworkname;";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-right'>#</th>";
echo "<th class='text-left col-sm-1'>Date</th>";
echo "<th class='text-left col-sm-3'>Empl. Name</th>";
echo "<th class='text-left col-sm-1'>Location</th>";
echo "<th class='text-left col-sm-5'>Work Name</th>";
echo "<th class='text-left col-sm-2'>Reporting Head</th>";
echo "</tr>";
$i = 1;
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-right'> $i.</td>";
echo "<td class='text-left'> $myrow[fworkdate]</td>";
echo "<td class='text-left'> [$myrow[femplcode]] $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'> $myrow[fworkname]</td>";
echo "<td class='text-left'> $myrow[freptname]</td>";
echo "</tr>";
$i++;
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No work entry review pending today!</div>";
}
?>
</div>
<div id="view_pend_month" class="tab-pane fade">
<?php
$myqry = "";
if ($type_id == 'ADMIN') {
$myqry = "";
} else {
$myqry = " and wk.freptempl='$empl_id'";
}
$mysql = "select date_format(wk.fworkdate,'%d/%m/%Y') as fworkdate, em.fdeptcode,fdeptname,fdeptshrt,concat('[',fworkcode,'] ',fworkname) as fworkname,
wk.femplcode,em.femplname as femplname,wk.freptempl,e2.femplname as freptname
from workentry wk
left join masempl em on wk.femplcode = em.femplcode
left join masempl e2 on wk.freptempl = e2.femplcode
left join masdept dp on wk.fdeptcode = dp.fdeptcode
where fviewstat='PENDING' and date_format(fworkdate,'%m/%Y') = date_format(current_date,'%m/%Y') and ifnull(wk.fdelestat,'F')='F' " . $myqry . "
order by fworkdate desc,fdeptcode,femplname,fworkname;";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-right'>#</th>";
echo "<th class='text-left col-sm-1'>Date</th>";
echo "<th class='text-left col-sm-3'>Empl. Name</th>";
echo "<th class='text-left col-sm-1'>Location</th>";
echo "<th class='text-left col-sm-5'>Work Name</th>";
echo "<th class='text-left col-sm-2'>Reporting Head</th>";
echo "</tr>";
$i = 1;
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-right'> $i.</td>";
echo "<td class='text-left'> $myrow[fworkdate]</td>";
echo "<td class='text-left'> [$myrow[femplcode]] $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'> $myrow[fworkname]</td>";
echo "<td class='text-left'> $myrow[freptname]</td>";
echo "</tr>";
$i++;
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No review pending in this month!</div>";
}
?>
</div>
<div id="view_entr_today" class="tab-pane fade">
<?php
if ($type_id == 'ADMIN') {
$myqry = "";
} elseif ($type_id == 'CHIEF') {
$myqry = " and em.frepthead='$empl_id'";
} else {
$myqry = " and em.femplcode='$empl_id'";
}
$mysql = "select date_format(wk.fworkdate,'%d/%m/%Y') as fworkdate, date_format(wk.fviewtime,'%d/%m/%Y %h:%i:%s %p') as fviewtime,
em.fdeptcode,fdeptname,fdeptshrt,em.femplcode,femplname,concat('[',fworkcode,'] ',fworkname) as fworkname
from workentry wk
left join masempl em on wk.femplcode = em.femplcode
left join masdept dp on wk.fdeptcode = dp.fdeptcode
where fviewstat<>'PENDING' and date_format(fviewtime,'%d/%m/%Y') = date_format(current_date,'%d/%m/%Y') and ifnull(wk.fdelestat,'F')='F' " . $myqry . "
order by fworkdate desc,fdeptcode,femplname,fworkname";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-right'>#</th>";
echo "<th class='text-left col-sm-1'>Date</th>";
echo "<th class='text-left col-sm-3'>Empl. Name</th>";
echo "<th class='text-left col-sm-1'>Location</th>";
echo "<th class='text-left col-sm-5'>Work Name</th>";
echo "<th class='text-left col-sm-2'>Reviewed On</th>";
echo "</tr>";
$i = 1;
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-right'> $i.</td>";
echo "<td class='text-left'> $myrow[fworkdate]</td>";
echo "<td class='text-left'> [$myrow[femplcode]] $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'>$myrow[fworkname]</td>";
echo "<td class='text-left'>$myrow[fviewtime]</td>";
echo "</tr>";
$i++;
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No work review found today!</div>";
}
?>
</div>
<div id="view_entr_month" class="tab-pane fade">
<?php
$myqry = "";
if ($type_id == 'ADMIN') {
$myqry = "";
} elseif ($type_id == 'CHIEF') {
$myqry = " and em.frepthead='$empl_id'";
} else {
$myqry = " and em.femplcode='$empl_id'";
}
$mysql = "select date_format(wk.fworkdate,'%d/%m/%Y') as fworkdate, date_format(wk.fviewtime,'%d/%m/%Y %h:%i:%s %p') as fviewtime,
em.fdeptcode,fdeptname,fdeptshrt,em.femplcode,femplname,concat('[',fworkcode,'] ',fworkname) as fworkname
from workentry wk
left join masempl em on wk.femplcode = em.femplcode
left join masdept dp on wk.fdeptcode = dp.fdeptcode
where fviewstat<>'PENDING' and date_format(fviewtime,'%m/%Y') = date_format(current_date,'%m/%Y') and ifnull(wk.fdelestat,'F')='F' " . $myqry . "
order by fworkdate desc,fdeptcode,femplname,fworkname";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-right'>#</th>";
echo "<th class='text-left col-sm-1'>Date</th>";
echo "<th class='text-left col-sm-3'>Empl. Name</th>";
echo "<th class='text-left col-sm-1'>Location</th>";
echo "<th class='text-left col-sm-5'>Work Name</th>";
echo "<th class='text-left col-sm-2'>Reviewed On</th>";
echo "</tr>";
$i = 1;
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-right'> $i.</td>";
echo "<td class='text-left'> $myrow[fworkdate]</td>";
echo "<td class='text-left'> [$myrow[femplcode]] $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'>$myrow[fworkname]</td>";
echo "<td class='text-left'>$myrow[fviewtime]</td>";
echo "</tr>";
$i++;
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No work review found in this month!</div>";
}
?>
</div>
</div>
|