205 lines
6.8 KiB
PHP
Executable File
205 lines
6.8 KiB
PHP
Executable File
<?php
|
|
require_once('fixed/config/go_con.php');
|
|
access(22);
|
|
|
|
$type = $_GET['t'];
|
|
$type_sql = '<> 0';
|
|
if (!empty($type)) {
|
|
if (is_numeric($type)) {
|
|
$type_sql = '= '.$type;
|
|
}
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="rtl">
|
|
<?php require_once('fixed/head/go.php'); ?>
|
|
<body class="rtl">
|
|
<?php require_once('fixed/loader/go.php'); ?>
|
|
<!-- page-wrapper Start-->
|
|
<div class="page-wrapper" id="pageWrapper">
|
|
<?php require_once('fixed/header/go.php'); ?>
|
|
<!-- Page Body Start-->
|
|
<div class="page-body-wrapper">
|
|
<?php require_once('fixed/sidebar/go.php'); ?>
|
|
<div class="page-body">
|
|
<!-- Container-fluid starts-->
|
|
<div class="container-fluid user-card">
|
|
<div class="row">
|
|
<?php
|
|
$get_emplyee_sql = mysqli_query($db, "SELECT
|
|
`emplyee`.`id`,
|
|
`emplyee`.`name`,
|
|
`emplyee`.`his_img`,
|
|
`emplyee`.`activation_id` AS `emp_active`,
|
|
`user`.`username`,
|
|
`user`.`activation_id`,
|
|
`occupation`.`name` AS `occ_name`,
|
|
`occupation`.`show_in_table_id`
|
|
FROM `emplyee`
|
|
LEFT JOIN `occupation` ON `emplyee`.`occupation_id` = `occupation`.`id`
|
|
LEFT JOIN `branch` ON `emplyee`.`branch_id` = `branch`.`id`
|
|
LEFT JOIN `user` ON `user`.`emplyee_id` = `emplyee`.`id`
|
|
|
|
WHERE `emplyee`.`occupation_id` $type_sql
|
|
AND `branch`.`commercial_register_id` = $commercial_register_id
|
|
ORDER BY `emplyee`.`activation_id` DESC
|
|
");
|
|
$data = array();
|
|
$data[1] = array();
|
|
$data[2] = array();
|
|
while ($get_emplyee = mysqli_fetch_assoc($get_emplyee_sql)) {
|
|
if ($get_emplyee['emp_active'] == 1) {
|
|
array_push($data[2], $get_emplyee);
|
|
}
|
|
if ($get_emplyee['emp_active'] == 2) {
|
|
array_push($data[1], $get_emplyee);
|
|
}
|
|
}
|
|
|
|
for ($i=0; $i < count($data[1]); $i++) {
|
|
?>
|
|
<div class="col-md-6 col-lg-6 col-xl-4 box-col-6">
|
|
<div class="card custom-card">
|
|
<div class="card-profile">
|
|
<img class="rounded-circle" src="uploads/emplyee/user/1.png" alt="" style="
|
|
background: linear-gradient(225deg,
|
|
<?php
|
|
switch ($data[1][$i]['activation_id']) {
|
|
case 1:
|
|
echo '#e10505, ';
|
|
break;
|
|
|
|
case 2:
|
|
echo '#00ff28, ';
|
|
break;
|
|
|
|
default:
|
|
echo '#e10505, ';
|
|
break;
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
switch ($data[1][$i]['show_in_table_id']) {
|
|
case 1:
|
|
echo '#00ff28';
|
|
break;
|
|
|
|
case 2:
|
|
switch ($data[1][$i]['emp_active']) {
|
|
case 1:
|
|
echo '#e10505';
|
|
break;
|
|
|
|
case 2:
|
|
echo '#00ff28';
|
|
break;
|
|
|
|
default:
|
|
echo '#e10505';
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
?>
|
|
);">
|
|
</div>
|
|
<ul class="card-social">
|
|
<li><a href="edit_emplyee.php?id=<?=$data[1][$i]['id']?>"><i class="fa fa-cog"></i></a></li>
|
|
</ul>
|
|
<div class="text-center profile-details"><a href="user-profile.html">
|
|
<h4><?=$data[1][$i]['name']?></h4></a>
|
|
<h6><?=$data[1][$i]['occ_name']?></h6>
|
|
<?php
|
|
if ($admin_id == 1) {
|
|
?>
|
|
<h6><?=$data[1][$i]['username']?></h6>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<div class="row">
|
|
<?php
|
|
for ($i=0; $i < count($data[2]); $i++) {
|
|
?>
|
|
<div class="col-md-6 col-lg-6 col-xl-4 box-col-6">
|
|
<div class="card custom-card" style="background: #ffdfdf;">
|
|
<div class="card-profile">
|
|
<img class="rounded-circle" src="uploads/emplyee/user/1.png" alt="" style="
|
|
background: linear-gradient(225deg,
|
|
<?php
|
|
switch ($data[2][$i]['activation_id']) {
|
|
case 1:
|
|
echo '#e10505, ';
|
|
break;
|
|
|
|
case 2:
|
|
echo '#00ff28, ';
|
|
break;
|
|
|
|
default:
|
|
echo '#e10505, ';
|
|
break;
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
switch ($data[2][$i]['show_in_table_id']) {
|
|
case 1:
|
|
echo '#00ff28';
|
|
break;
|
|
|
|
case 2:
|
|
switch ($data[2][$i]['emp_active']) {
|
|
case 1:
|
|
echo '#e10505';
|
|
break;
|
|
|
|
case 2:
|
|
echo '#00ff28';
|
|
break;
|
|
|
|
default:
|
|
echo '#e10505';
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
?>
|
|
);">
|
|
</div>
|
|
<ul class="card-social">
|
|
<li><a href="edit_emplyee.php?id=<?=$data[2][$i]['id']?>"><i class="fa fa-cog"></i></a></li>
|
|
</ul>
|
|
<div class="text-center profile-details"><a href="user-profile.html">
|
|
<h4><?=$data[2][$i]['name']?></h4></a>
|
|
<h6><?=$data[2][$i]['occ_name']?></h6>
|
|
<?php
|
|
if ($admin_id == 1) {
|
|
?>
|
|
<h6><?=$data[1][$i]['username']?></h6>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
<!-- Container-fluid Ends-->
|
|
</div>
|
|
<?php require_once('fixed/footer/go.php'); ?>
|
|
</div>
|
|
</div>
|
|
<?php require_once('fixed/js/go.php'); ?>
|
|
</body>
|
|
</html>
|