forked from weatheredwatcher/OpenContract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dos_count.php
50 lines (33 loc) · 999 Bytes
/
dos_count.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
<?php
# test function
require('includes/db-include.php');
function get_do_totals($idc){
$query2="SELECT * FROM tbl_dos WHERE idc_id = '$idc'";
$results2 = mysql_query($query2) or die(mysql_error());
#$array = mysql_fetch_array($results2, MYSQL_NUM);
$counter = 0 ;
$counter2 = 0;
while($row2 = mysql_fetch_assoc($results2)):
$counter += $row2['basic'];
$counter += $row2['additional'];
// echo $row2['basic'];
//echo $row2['additional'];
endwhile;
return $counter;
}
function get_do_reimbursements($idc){
$query2="SELECT * FROM tbl_dos WHERE idc_id = '$idc'";
$results2 = mysql_query($query2) or die(mysql_error());
#$array = mysql_fetch_array($results2, MYSQL_NUM);
$counter = 0 ;
$counter2 = 0;
while($row2 = mysql_fetch_assoc($results2)):
$counter += $row2['reimbursed'];
// echo $row2['basic'];
//echo $row2['additional'];
endwhile;
return $counter;
}
echo get_do_totals(12);
echo get_do_reimbursements(12);
?>