-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrep_employee_unaccounted.php
71 lines (58 loc) · 1.76 KB
/
rep_employee_unaccounted.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// $flagNoAuth =true;
require ('common/auth.php');
require ('classes/budget.class.php');
// require ('classes/reports.class.php');
include ('includes/inc-frame_top.php');
// $oBudget = new Budget($budget_scenario);
if ($_GET['tab']){
$oBudget = new Budget($_GET['tab']);
$sql = "SELECT * FROM vw_employee_select
LEFT JOIN reg_headcount ON particulars=empGUID1C AND posted=1 AND scenario='{$_GET['tab']}'
LEFT JOIN vw_profit ON pccID=empProfitID
LEFT JOIN vw_function ON funGUID=empFunctionGUID
WHERE particulars IS NULL AND empFlagDeleted=0 AND empEndDate >='".date('Y-m-d',$oBudget->date_start)."'
ORDER BY empProfitID";
// die($sql);
$rs =$oSQL->q($sql);
?>
<ol>
<?php
while ($rw=$oSQL->f($rs)){
?>
<li><?php echo $rw["empTitleLocal"],' (',$rw["funTitleLocal"],'), ',$rw["pccTitle$strLocal"];?></li>
<?php
}
?>
</ol>
<?php
$sql = "SELECT COUNT(particulars) as nCount, EMP.*, funTitleLocal, GROUP_CONCAT(pccTitle) as pccTitle
FROM reg_headcount
JOIN vw_employee_select EMP ON particulars=empGUID1C AND posted=1 AND scenario='{$_GET['tab']}' and source<>'Actual'
JOIN vw_profit ON pc=pccID
JOIN vw_function ON funGUID=empFunctionGUID
GROUP BY particulars
HAVING COUNT(particulars)>1
ORDER BY empProfitID";
// die($sql);
$rs =$oSQL->q($sql);
?>
<h3>Двойной учет</h3>
<ol>
<?php
while ($rw=$oSQL->f($rs)){
?>
<li><?php echo $rw["empTitleLocal"],' (',$rw["funTitleLocal"],'): ',$rw["pccTitle"];?></li>
<?php
}
?>
</ol>
<?php
} else {
$arrJS[] = 'js/journal.js';
include ('includes/inc-frame_top.php');
echo '<h1>',$arrUsrData["pagTitle$strLocal"],'</h1>';
echo Budget::getScenarioTabs();
include ('includes/inc-frame_bottom.php');
}
?>