-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprint_from_to_opd_nabl.php
90 lines (79 loc) · 2.33 KB
/
print_from_to_opd_nabl.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
$GLOBALS['nojunk']='';
require_once 'project_common.php';
require_once 'base/verify_login.php';
////////User code below/////////////////////
require_once('tcpdf/tcpdf.php');
$GLOBALS['img_list']=array();
$error=false;
$at_least_one_sample=false;
$link=get_link($GLOBALS['main_user'],$GLOBALS['main_pass']);
//echo '<pre>';print_r($_POST);echo '</pre>';
//exit();
$pdf = new ACCOUNT1('P', 'mm', 'A4', true, 'UTF-8', false);
$to=strlen($_POST['to'])>0?$_POST['to']:$_POST['from'];
for ($i=$_POST['from'];$i<=$to;$i++)
{
$released=get_one_ex_result($link,$i,$GLOBALS['released_by']);
$interim_released=get_one_ex_result($link,$i,$GLOBALS['interim_released_by']);
$ow=get_one_ex_result($link,$i,$GLOBALS['OPD/Ward']);
$location_post='__ex__'.$GLOBALS['OPD/Ward'];
if(sample_exist($link,$i)) //if there is such sample
{
if(strlen($_POST[$location_post])>0) //if location given
{
if($ow==$_POST[$location_post]) //if locaion match
{
if(strlen($released)!=0 || strlen($interim_released)!=0 ) //if released/interim
{
$at_least_one_sample=true;
print_sample($link,$i,$pdf);
}
else //else output html(no pdf)
{
//echo '<link rel="stylesheet" href="project_common.css">
// <script src="project_common.js"></script>';
//echo '<div class="d-inline">Sample _ID='.$i.' is [ not released ]</div>';
sample_id_view_button($i,'_blank',$i.' is not released');
$error=true;
}
}
else //if location do not match
{
//do nothing
}
}
else //location not given, print all
{
if(strlen($released)!=0 || strlen($interim_released)!=0 ) //if released/interim
{
$at_least_one_sample=true;
print_sample($link,$i,$pdf);
}
else //else output html(no pdf)
{
//echo '<link rel="stylesheet" href="project_common.css">
// <script src="project_common.js"></script>';
//echo '<div class="d-inline">Sample _ID='.$i.' is [ not released ]</div>';
sample_id_view_button($i,'_blank',$i.' is not released');
$error=true;
}
}
}
else //no such sample
{
//do nothing
}
}
if($error===false && $at_least_one_sample!==false)
{
$pdf->Output('report.pdf', 'I');
}
else
{
echo 'nothing to print';
}
//////////////user code ends////////////////
//tail();
//////////////Functions///////////////////////
?>