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.34.42
Current Path : /var/www/html/oums/src/ |
| Current File : /var/www/html/oums/src/home_movements.php |
<?php
include("sys_connect.php");
include("sys_mainphp.php");
include("sys_session.php");
?>
<div style="margin-bottom: 5px;" class="head_blue">Staff Movements</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">Upcoming</a></li>
<li><a data-toggle="tab" href="#menu3">Recent</a></li>
</ul>
<div class="tab-content" id="home-content-note">
<div id="menu1" class="tab-pane fade in active">
<?php
if ($type_id == "ADMIN") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate = current_date
order by fstrtdate desc";
} elseif ($type_id == "CHIEF") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
inner join masdept_user du on sm.fdeptcode = du.fdeptcode and du.fusercode = '$user_id'
where fstrtdate = current_date
order by fstrtdate desc";
} else {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate = current_date and sm.femplcode = '$empl_id'
order by fstrtdate desc";
}
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Move Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-1'> Client</th>";
echo "<th class='text-left col-sm-2'> From</th>";
echo "<th class='text-left col-sm-2'> To</th>";
echo "<th class='text-left col-sm-2'> Purpose</th>";
echo "<th class='text-left col-sm-2'> Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fstrtdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'> $myrow[fstrttown]</td>";
echo "<td class='text-left'> $myrow[fdesttown]</td>";
echo "<td class='text-left'> $myrow[fmovetype]</td>";
echo "<td class='text-left'> $myrow[fmovestat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No movements scheduled today!</div>";
}
?>
</div>
<div id="menu2" class="tab-pane fade">
<?php
if ($type_id == "ADMIN") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate > current_date
order by fstrtdate desc";
} elseif ($type_id == "CHIEF") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
inner join masdept_user du on sm.fdeptcode = du.fdeptcode and du.fusercode = '$user_id'
where fstrtdate > current_date
order by fstrtdate desc";
} else {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate > current_date and sm.femplcode = '$empl_id'
order by fstrtdate desc";
}
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Move Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-1'> Client</th>";
echo "<th class='text-left col-sm-2'> From</th>";
echo "<th class='text-left col-sm-2'> To</th>";
echo "<th class='text-left col-sm-2'> Purpose</th>";
echo "<th class='text-left col-sm-2'> Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fstrtdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'> $myrow[fstrttown]</td>";
echo "<td class='text-left'> $myrow[fdesttown]</td>";
echo "<td class='text-left'> $myrow[fmovetype]</td>";
echo "<td class='text-left'> $myrow[fmovestat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No upcoming movements scheduled!</div>";
}
?>
</div>
<div id="menu3" class="tab-pane fade">
<?php
if ($type_id == "ADMIN") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate < current_date
order by fstrtdate desc";
} elseif ($type_id == "CHIEF") {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
inner join masdept_user du on sm.fdeptcode = du.fdeptcode and du.fusercode = '$user_id'
where fstrtdate < current_date
order by fstrtdate desc";
} else {
$mysql = "select fstrtdate,femplname,sm.fdeptcode,fdeptname,fdeptshrt,fstrttown,fdesttown,fmovetype,fmovestat
from staffmove sm
inner join masdept dp on sm.fdeptcode = dp.fdeptcode
inner join masempl em on sm.femplcode = em.femplcode
where fstrtdate < current_date and sm.femplcode = '$empl_id'
order by fstrtdate desc";
}
$myres = mysqli_query($mycon, $mysql);
$mycnt = mysqli_num_rows($myres);
if ($mycnt > 0) {
echo "<table class='table table-striped table-condensed'>";
echo "<tr>";
echo "<th class='text-left col-sm-1'> Move Date</th>";
echo "<th class='text-left col-sm-3'> Name</th>";
echo "<th class='text-left col-sm-1'> Client</th>";
echo "<th class='text-left col-sm-2'> From</th>";
echo "<th class='text-left col-sm-2'> To</th>";
echo "<th class='text-left col-sm-2'> Purpose</th>";
echo "<th class='text-left col-sm-2'> Status</th>";
echo "</tr>";
while ($myrow = mysqli_fetch_assoc($myres)) {
echo "<tr>";
echo "<td class='text-left'> $myrow[fstrtdate]</td>";
echo "<td class='text-left'> $myrow[femplname]</td>";
echo "<td class='text-left'> [$myrow[fdeptcode]] $myrow[fdeptshrt]</td>";
echo "<td class='text-left'> $myrow[fstrttown]</td>";
echo "<td class='text-left'> $myrow[fdesttown]</td>";
echo "<td class='text-left'> $myrow[fmovetype]</td>";
echo "<td class='text-left'> $myrow[fmovestat]</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<div class='alert alert-info'>No recent movements!</div>";
}
?>
</div>
</div>
|