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 : 3.145.45.223
Current Path : /var/www/html/oums/src/ |
| Current File : /var/www/html/oums/src/home_events.php |
<?php
include("sys_connect.php");
include("sys_mainphp.php");
include("sys_session.php");
?>
<div style="margin-bottom: 5px;" class="head_blue">Events's</div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#menu1">Today's</a></li>
<li><a data-toggle="tab" href="#menu2">This month</a></li>
<li><a data-toggle="tab" href="#menu3">Next month</a></li>
<!-- <li><a data-toggle="tab" href="#menu4">Previous month</a></li> -->
</ul>
<!-- this section is used to display birthday for current day -->
<div class="tab-content" id="home-content-note">
<div id="menu1" class="tab-pane fade in active">
<?php
$mysql = "select * from (
select femplname,e.fdeptcode,fdeptname,'Birthday' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fbrthdate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fbrthdate,'%d-%m') = date_format(current_date,'%d-%m') and femplstat='T'
union all
select femplname,e.fdeptcode,fdeptname,'Work Anniversary' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fjoindate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fjoindate,'%d-%m') = date_format(current_date,'%d-%m') and femplstat='T'
) xtmp
where fdeptcode not in ('dep','ihf') and e.femplstat='T'
order by fevntdate,femplname";
$myres = mysqli_query($mycon, $mysql);
if (mysqli_num_rows($myres) != 0) {
echo "<table class='table table-striped table-condensed table-hover'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-5'> Client</th>";
echo "<th class='text-left col-sm-2'> Remarks</th>";
echo "<th class='text-left col-sm-1'> Work Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fevntdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptname]</td>";
echo "<td class='text-left'> $myrow[fevntremk]</td>";
echo "<td class='text-left'> $myrow[femplstat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No events today!</div>";
}
?>
</div>
<div id="menu2" class="tab-pane fade">
<?php
$mysql = "select *
from (
select e.femplcode,femplname,e.fdeptcode,fdeptname,'Birthday' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fbrthdate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fbrthdate,'%m') = date_format(current_date,'%m') and femplstat='T'
union all
select e.femplcode,femplname,e.fdeptcode,fdeptname,'Work Anniversary' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fjoindate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fjoindate,'%m') = date_format(current_date,'%m') and femplstat='T'
) xtmp where fdeptcode not in ('dep','ihf')
order by fevntdate,femplname;";
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed table-hover'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-5'> Client</th>";
echo "<th class='text-left col-sm-2'> Remarks</th>";
echo "<th class='text-left col-sm-1'> Work Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fevntdate]</td>";
echo "<td class='text-left'> [$myrow[femplcode]] $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptname]</td>";
echo "<td class='text-left'> $myrow[fevntremk]</td>";
echo "<td class='text-left'> $myrow[femplstat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No events found!</div>";
}
?>
</div>
<div id="menu3" class="tab-pane fade">
<?php
$mysql = "select *
from (
select femplname,e.fdeptcode,fdeptname,'Birthday' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fbrthdate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fbrthdate,'%m') = date_format(current_date + interval 1 month,'%m') and femplstat='T'
union all
select femplname,e.fdeptcode,fdeptname,'Work Anniversary' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fjoindate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
inner join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fjoindate,'%m') = date_format(current_date + interval 1 month,'%m') and femplstat='T'
) xtmp where fdeptcode not in ('dep','ihf')
order by fevntdate,femplname";
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed table-hover'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-5'> Client</th>";
echo "<th class='text-left col-sm-2'> Remarks</th>";
echo "<th class='text-left col-sm-1'> Work Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fevntdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptname]</td>";
echo "<td class='text-left'> $myrow[fevntremk]</td>";
echo "<td class='text-left'> $myrow[femplstat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No events found!</div>";
}
?>
</div>
<div id="menu4" class="tab-pane fade">
<?php
$mysql = "select *
from (
select femplname,e.fdeptcode,fdeptname,'Birthday' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fbrthdate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
left join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fbrthdate,'%m') = date_format(current_date - interval 1 month,'%m')
union all
select femplname,e.fdeptcode,fdeptname,'Work Anniversary' as fevntremk,
(case when femplstat='T' then 'Active' else 'Not Active' end) as femplstat,
concat(date_format(fjoindate,'%d %b'),' ',year(current_date)) as fevntdate
from masempl e
left join masdept d on e.fdeptcode=d.fdeptcode
where date_format(fjoindate,'%m') = date_format(current_date - interval 1 month,'%m') and femplstat='T'
) xtmp
order by fevntdate,femplname";
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed table-hover'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-5'> Client</th>";
echo "<th class='text-left col-sm-2'> Remarks</th>";
echo "<th class='text-left col-sm-1'> Work Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fevntdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptname]</td>";
echo "<td class='text-left'> $myrow[fevntremk]</td>";
echo "<td class='text-left'> $myrow[femplstat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No events found!</div>";
}
?>
</div>
</div>
|