Files
kopalnia_2014/sites/backup/site809.php
T
2026-09-03 11:24:19 +02:00

1411 lines
73 KiB
PHP

<?php
if (!empty($_SESSION['site809']))
{
?>
<script>
$(function() {$( "#data_01" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_02" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_03" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_04" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_05" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_06" ).datepicker({changeMonth: true,changeYear: true});});
$(function() {$( "#data_07" ).datepicker({changeMonth: true,changeYear: true});});
</script>
<div id='loader-wrapper'><div id='loader'></div></div>
<?php
delSearchSessionData();
?>
<?php
// raport 001
// ============================================================================================================
if ($_POST['subRap001']=='Generuj' && $_GET['rap']=='001' && strlen($_POST['inRap001'])>9)
{
$rap_001xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap001.xlsx";
$rap_001pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap001.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Wykaz energochłonności dla studni ['.$_POST['inRap001'].', godz. '.$_POST['inRap001_hour'].']');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this->SetLineWidth(.1);
$this->SetFont('arial_ce', 'B', 8);
$this->Cell(15,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Bariera'),1,0,'C');
$this->Cell(30,7,iconv('utf-8','windows-1250','Energochłonność'),1,0,'C');
$this->Cell(40,7,iconv('utf-8','windows-1250','Opis'),1,0,'C');
$this->Cell(40,7,iconv('utf-8','windows-1250','Status'),1,0,'C');
$this->Cell(30,7,iconv('utf-8','windows-1250','Data'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:G1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Wykaz energochłonności dla studni ['.$_POST['inRap001'].']');
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Lp.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', 'Bariera');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Energochłonność');
$objPHPExcel->getActiveSheet()->SetCellValue('E2', 'Opis');
$objPHPExcel->getActiveSheet()->SetCellValue('F2', 'Oddział');
$objPHPExcel->getActiveSheet()->SetCellValue('G2', 'Data');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
// ===========================================================================
// ===========================================================================
$i=0;$res=null;
$pdf -> SetFont('arial_ce', '', 7);
//$wynik = mysql_query("select SOD_UJ,WLL_NAME,RDD_VALUE,SOD_DESC,SOD_PLC,RDD_AUDIT_DATE from rep_dev_details INNER join seg_dev_resources on DRS_ID=RDD_DRS_ID left join seg_wells on WLL_ID=DRS_DEV_ID and DRS_DEV_TYPE=12 left join seg_object_def on SOD_NAME=WLL_NAME where RDD_AUDIT_DATE>'".$_POST['inRap001_from']." 00:00:00' and RDD_AUDIT_DATE<'".$_POST['inRap001_to']." 23:59:59' and SOD_PLC='".$_SESSION['syndis_eq_stock']."'");
$wynik = mysql_query("select WLL_NAME,WLL_BARIERA,WLL_SYS_TYPE,WLL_STAT_DESC,RDD_VALUE,RDD_AUDIT_DATE from rep_dev_details,seg_dev_resources left join seg_wells on WLL_ID=DRS_DEV_ID and DRS_DEV_TYPE=12 where RDD_DRS_ID=DRS_ID and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and RDD_AUDIT_DATE>='".$_POST['inRap001']." ".$_POST['inRap001_hour'].":00:00' and RDD_AUDIT_DATE<'".$_POST['inRap001']." ".$_POST['inRap001_hour'].":59:59' order by WLL_NAME");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
if ($r['RDD_VALUE']=='R') $engTmp = 'Czerwony';
else if ($r['RDD_VALUE']=='Y') $engTmp = 'Żółty';
else if ($r['RDD_VALUE']=='G') $engTmp = 'Zielony';
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+3), $i+1);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+3), $r['WLL_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+3), $r['WLL_BARIERA']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+3), $engTmp);
$objPHPExcel->getActiveSheet()->SetCellValue('E'.($i+3), $r['WLL_SYS_TYPE']);
$objPHPExcel->getActiveSheet()->SetCellValue('F'.($i+3), $r['WLL_STAT_DESC']);
$objPHPExcel->getActiveSheet()->SetCellValue('G'.($i+3), $r['RDD_AUDIT_DATE']);
$pdf->Cell(15,7,iconv('utf-8','windows-1250',$i+1),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$r['WLL_NAME']),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250',$r['WLL_BARIERA']),1,0,'C');
$pdf->Cell(30,7,iconv('utf-8','windows-1250',$engTmp),1,0,'C');
$pdf->Cell(40,7,iconv('utf-8','windows-1250',$r['WLL_SYS_TYPE']),1,0,'C');
$pdf->Cell(40,7,iconv('utf-8','windows-1250',$r['WLL_STAT_DESC']),1,0,'C');
$pdf->Cell(30,7,iconv('utf-8','windows-1250',$r['RDD_AUDIT_DATE']),1,0,'C');
$pdf->Ln();
$res[]=array(
'a' => $r['WLL_NAME'],
'b' => $r['WLL_BARIERA'],
'c' => $engTmp,
'd' => $r['WLL_SYS_TYPE'],
'e' => $r['WLL_STAT_DESC'],
'f' => $r['RDD_AUDIT_DATE']
);
$i++;
}
unset($_SESSION['site809_rap001']);
$_SESSION['site809_rap001']=$res;
$objPHPExcel->getActiveSheet()->setTitle('Wykaz energochłonności');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_001xls);
unset($objPHPExcel);
$pdf->Output($rap_001pdf);
}
// ============================================================================================================
// ============================================================================================================
// raport 002
// ============================================================================================================
if ($_POST['subRap002']=='Generuj' && $_GET['rap']=='002')
{
$rap_002xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap002.xlsx";
$rap_002pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap002.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Łączna ilość agregatów pompowych zabudowanych w studniach');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 8);
$this->Cell(12,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(12,7,iconv('utf-8','windows-1250','Bariera'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Typ pompy'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Nr pompy'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Typ silnika'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Nr silnika'),1,0,'C');
$this->Cell(36,7,iconv('utf-8','windows-1250','Opis'),1,0,'C');
$this->Cell(30,7,iconv('utf-8','windows-1250','Oddział'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:I1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:I1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Łączna ilość agregatów pompowych zabudowanych w studniach');
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Lp.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', 'Bariera');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Typ pompy');
$objPHPExcel->getActiveSheet()->SetCellValue('E2', 'Nr pompy');
$objPHPExcel->getActiveSheet()->SetCellValue('F2', 'Typ silnika');
$objPHPExcel->getActiveSheet()->SetCellValue('G2', 'Nr silnika');
$objPHPExcel->getActiveSheet()->SetCellValue('H2', 'Opis');
$objPHPExcel->getActiveSheet()->SetCellValue('I2', 'Oddział');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
// ===========================================================================
// ===========================================================================
$i=0;$res=null;
$pdf -> SetFont('arial_ce', '', 7);
$wynik = mysql_query("select WLL_NAME,SOD_UJ,RWL_PUP_DRS_ID,RWL_ENG_DRS_ID,SOD_DESC,SOD_PLC from seg_well_pump_eng_rel INNER join seg_wells on WLL_ID=RWL_WLL_ID left join seg_object_def on WLL_NAME=SOD_NAME where SOD_PLC='".$_SESSION['syndis_eq_stock']."' order by WLL_NAME");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
unset($qtmpP);
$qtmpP = sqlGetResAsArray("select PUP_NAME,DRS_SN_NUMBER from seg_dev_resources,seg_pumps where PUP_ID=DRS_DEV_ID and DRS_DEV_TYPE=10 and DRS_ID=".$r['RWL_PUP_DRS_ID']." limit 1");
unset($qtmpE);
$qtmpE = sqlGetResAsArray("select ENG_NAME,DRS_SN_NUMBER from seg_dev_resources,seg_engines where ENG_ID=DRS_DEV_ID and DRS_DEV_TYPE=11 and DRS_ID=".$r['RWL_ENG_DRS_ID']." limit 1");
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+3), $i+1);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+3), $r['WLL_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+3), $r['SOD_UJ']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+3), $qtmpP[0]['PUP_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('E'.($i+3), $qtmpP[0]['DRS_SN_NUMBER']);
$objPHPExcel->getActiveSheet()->SetCellValue('F'.($i+3), $qtmpE[0]['ENG_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('G'.($i+3), $qtmpE[0]['DRS_SN_NUMBER']);
$objPHPExcel->getActiveSheet()->SetCellValue('H'.($i+3), $r['SOD_DESC']);
$objPHPExcel->getActiveSheet()->SetCellValue('I'.($i+3), $r['SOD_PLC']);
$pdf->Cell(12,7,iconv('utf-8','windows-1250',$i+1),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$r['WLL_NAME']),1,0,'C');
$pdf->Cell(12,7,iconv('utf-8','windows-1250',$r['SOD_UJ']),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$qtmpP[0]['PUP_NAME']),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$qtmpP[0]['DRS_SN_NUMBER']),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$qtmpE[0]['ENG_NAME']),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$qtmpE[0]['DRS_SN_NUMBER']),1,0,'C');
$pdf->Cell(36,7,iconv('utf-8','windows-1250',$r['SOD_DESC']),1,0,'C');
$pdf->Cell(30,7,iconv('utf-8','windows-1250',$r['SOD_PLC']),1,0,'C');
$pdf->Ln();
$res[]=array(
'a' => $r['WLL_NAME'],
'b' => $r['SOD_UJ'],
'c' => $qtmpP[0]['PUP_NAME'],
'd' => $qtmpP[0]['DRS_SN_NUMBER'],
'e' => $qtmpE[0]['ENG_NAME'],
'f' => $qtmpE[0]['DRS_SN_NUMBER'],
'g' => $r['SOD_DESC'],
'h' => $r['SOD_PLC']
);
$i++;
}
unset($_SESSION['site809_rap002']);
$_SESSION['site809_rap002']=$res;
$objPHPExcel->getActiveSheet()->setTitle('Wykaz energochłonności');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_002xls);
unset($objPHPExcel);
$pdf->Output($rap_002pdf);
}
// ============================================================================================================
// ============================================================================================================
// raport 003
// ============================================================================================================
if ($_POST['subRap003']=='Generuj' && $_GET['rap']=='003' && strlen($_POST['inRap003'])>9)
{
$rap_003xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap003.xlsx";
$rap_003pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap003.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Parametry pracy studni i układu pompowego ['.$_POST['inRap003'].', godz. '.$_POST['inRap003_hour'].']');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 8);
$this->Cell(11,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Bariera'),1,0,'C');
$this->Cell(11,7,iconv('utf-8','windows-1250','Hst'),1,0,'C');
$this->Cell(11,7,iconv('utf-8','windows-1250','Hd'),1,0,'C');
$this->Cell(12,7,iconv('utf-8','windows-1250','Q'),1,0,'C');
$this->Cell(10,7,iconv('utf-8','windows-1250','p1'),1,0,'C');
$this->Cell(10,7,iconv('utf-8','windows-1250','p2'),1,0,'C');
$this->Cell(10,7,iconv('utf-8','windows-1250','I'),1,0,'C');
$this->Cell(12,7,iconv('utf-8','windows-1250','U'),1,0,'C');
$this->Cell(11,7,iconv('utf-8','windows-1250','Pe'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Czas'),1,0,'C');
$this->Cell(12,7,iconv('utf-8','windows-1250','Dgn.'),1,0,'C');
$this->Cell(30,7,iconv('utf-8','windows-1250','Data'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:O1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:O1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Parametry pracy studni i układu pompowego ['.$_POST['inRap003_from'].' - '.$_POST['inRap003_to'].']');
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Lp.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', 'Bariera');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Hst');
$objPHPExcel->getActiveSheet()->SetCellValue('E2', 'Hd');
$objPHPExcel->getActiveSheet()->SetCellValue('F2', 'Q[m3/min]');
$objPHPExcel->getActiveSheet()->SetCellValue('G2', 'p1');
$objPHPExcel->getActiveSheet()->SetCellValue('H2', 'p2');
$objPHPExcel->getActiveSheet()->SetCellValue('I2', 'I');
$objPHPExcel->getActiveSheet()->SetCellValue('J2', 'U');
$objPHPExcel->getActiveSheet()->SetCellValue('K2', 'Pe [kW]');
$objPHPExcel->getActiveSheet()->SetCellValue('L2', 'Czas pracy agregatu [h]');
$objPHPExcel->getActiveSheet()->SetCellValue('M2', 'Diagnostyka');
$objPHPExcel->getActiveSheet()->SetCellValue('N2', 'Oddział');
$objPHPExcel->getActiveSheet()->SetCellValue('O2', 'Data');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
// ===========================================================================
// ===========================================================================
$i=0;$res=null;
$pdf -> SetFont('arial_ce', '', 7);
$wynik = mysql_query("select RHD_DRS_ID,WLL_NAME,SOD_UJ,RHD_DATE,RHD_HST_VAL,RHD_HD_VAL,RHD_Q_VAL,RHD_P1_VAL,RHD_P2_VAL,RHD_I_VAL,RHD_U_VAL,RHD_PE_VAL,RHD_DGN_VAL,RHD_WORK_TIME_VAL,SOD_DESC,SOD_PLC from rep_his_data_everyday,rep_object_departments where DRS_ID=RHD_DRS_ID and SOD_PLC='".$_SESSION['syndis_eq_stock']."' and RHD_DATE>='".$_POST['inRap003']." ".$_POST['inRap003_hour'].":00:00' and RHD_DATE<'".$_POST['inRap003']." ".$_POST['inRap003_hour'].":59:59' order by SOD_UJ,WLL_NAME");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
//unset($qtmp);
//$qtmp = sqlGetResAsArray("select max(case WHEN DRD_RESOURCES_DETAIL=265 then DRD_VALUE end) PB_ENG,max(case WHEN DRD_RESOURCES_DETAIL=230 then DRD_VALUE end) IL_WOD,max(case WHEN DRD_RESOURCES_DETAIL=721 then DRD_VALUE end) ZU_ENG from seg_dev_resources_det where DRD_DRS_ID=".$r['RHD_DRS_ID']." and DRD_AUDIT_DATE like '".substr($r['RHD_DATE'],0,14)."%' union select max(case WHEN DRD_RESOURCES_DETAIL=265 then DRD_VALUE end) PB_ENG,max(case WHEN DRD_RESOURCES_DETAIL=230 then DRD_VALUE end) IL_WOD,max(case WHEN DRD_RESOURCES_DETAIL=721 then DRD_VALUE end) ZU_ENG from seg_dev_resources_det_his where DRD_DRS_ID=".$r['RHD_DRS_ID']." and DRD_AUDIT_DATE like '".substr($r['RHD_DATE'],0,14)."%'");
//select max(case WHEN DRD_RESOURCES_DETAIL=265 then DRD_VALUE end) PB_ENG,max(case WHEN DRD_RESOURCES_DETAIL=230 then DRD_VALUE end) IL_WOD,max(case WHEN DRD_RESOURCES_DETAIL=721 then DRD_VALUE end) ZU_ENG from seg_dev_resources_det where DRD_DRS_ID=3143 and DRD_AUDIT_DATE like '2015-10-13 13:%' union select max(case WHEN DRD_RESOURCES_DETAIL=265 then DRD_VALUE end) PB_ENG,max(case WHEN DRD_RESOURCES_DETAIL=230 then DRD_VALUE end) IL_WOD,max(case WHEN DRD_RESOURCES_DETAIL=721 then DRD_VALUE end) ZU_ENG from seg_dev_resources_det_his where DRD_DRS_ID=3143 and DRD_AUDIT_DATE like '2015-10-13 13:%'
if ($r['RHD_DGN_VAL']==0) $dgn="OK";
else $dgn="ERR";
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+3), $i+1);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+3), $r['WLL_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+3), $r['SOD_UJ']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+3), $r['RHD_HST_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('E'.($i+3), $r['RHD_HD_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('F'.($i+3), round($r['RHD_Q_VAL']/60,3));
$objPHPExcel->getActiveSheet()->SetCellValue('G'.($i+3), $r['RHD_P1_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('H'.($i+3), $r['RHD_P2_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('I'.($i+3), $r['RHD_I_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('J'.($i+3), $r['RHD_U_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('K'.($i+3), $r['RHD_PE_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('L'.($i+3), $r['RHD_WORK_TIME_VAL']);
$objPHPExcel->getActiveSheet()->SetCellValue('M'.($i+3), $dgn);
$objPHPExcel->getActiveSheet()->SetCellValue('N'.($i+3), $r['SOD_PLC']);
$objPHPExcel->getActiveSheet()->SetCellValue('O'.($i+3), $r['RHD_DATE']);
$pdf->Cell(11,7,iconv('utf-8','windows-1250',$i+1),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250',$r['WLL_NAME']),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250',$r['SOD_UJ']),1,0,'C');
$pdf->Cell(11,7,iconv('utf-8','windows-1250',$r['RHD_HST_VAL']),1,0,'C');
$pdf->Cell(11,7,iconv('utf-8','windows-1250',$r['RHD_HD_VAL']),1,0,'C');
$pdf->Cell(12,7,iconv('utf-8','windows-1250',round($r['RHD_Q_VAL']/60,3)),1,0,'C');
$pdf->Cell(10,7,iconv('utf-8','windows-1250',$r['RHD_P1_VAL']),1,0,'C');
$pdf->Cell(10,7,iconv('utf-8','windows-1250',$r['RHD_P2_VAL']),1,0,'C');
$pdf->Cell(10,7,iconv('utf-8','windows-1250',$r['RHD_I_VAL']),1,0,'C');
$pdf->Cell(12,7,iconv('utf-8','windows-1250',$r['RHD_U_VAL']),1,0,'C');
$pdf->Cell(11,7,iconv('utf-8','windows-1250',$r['RHD_PE_VAL']),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250',$r['RHD_WORK_TIME_VAL']),1,0,'C');
$pdf->Cell(12,7,iconv('utf-8','windows-1250',$dgn),1,0,'C');
$pdf->Cell(30,7,iconv('utf-8','windows-1250',$r['RHD_DATE']),1,0,'C');
$pdf->Ln();
// ,,,,,,,,,,SOD_DESC,SOD_PLC
$res[]=array(
'a' => $r['WLL_NAME'],
'b' => $r['SOD_UJ'],
'c' => $r['RHD_HST_VAL'],
'd' => $r['RHD_HD_VAL'],
'e' => round($r['RHD_Q_VAL']/60,3),
'f' => $r['RHD_P1_VAL'],
'g' => $r['RHD_P2_VAL'],
'h' => $r['RHD_I_VAL'],
'i' => $r['RHD_U_VAL'],
'j' => $r['RHD_PE_VAL'],
'k' => $r['RHD_WORK_TIME_VAL'],
'l' => $dgn,
'm' => $r['RHD_DATE']
);
$i++;
}
unset($_SESSION['site809_rap003']);
$_SESSION['site809_rap003']=$res;
$objPHPExcel->getActiveSheet()->setTitle('Parametry pracy');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_003xls);
unset($objPHPExcel);
$pdf->Output($rap_003pdf);
}
// ============================================================================================================
// ============================================================================================================
// raport 004
// ============================================================================================================
if ($_POST['subRap004']=='Generuj' && $_GET['rap']=='004' && strlen($_POST['inRap004_from'])>9 && strlen($_POST['inRap004_to'])>9)
{
$rap_004xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap004.xlsx";
$rap_004pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap004.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Wykaz pracy studni');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$this -> SetFont('arial_ce', 'I', 8);
$title = iconv('utf-8','windows-1250','Okres obliczeniowy: '.$_POST['inRap004_from'].' - '.$_POST['inRap004_to']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this->SetLineWidth(.1);
$this ->SetFont('arial_ce', 'B', 7);
$this->Cell(10,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(17,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(35,7,iconv('utf-8','windows-1250','Typ'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Pompa'),1,0,'C');
$this->Cell(18,7,iconv('utf-8','windows-1250','Silnik'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Qśr [m3/min]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Tp [h]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','V [m3]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Hd [m]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Hst [m]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Tw [C]'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',7);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
function Label()
{
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 7);
$this->Cell(10,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(17,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(35,7,iconv('utf-8','windows-1250','Typ'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Pompa'),1,0,'C');
$this->Cell(18,7,iconv('utf-8','windows-1250','Silnik'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Qśr [m3/min]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Tp [h]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','V [m3]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Hd [m]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Hst [m]'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Tw [C]'),1,0,'C');
$this->Ln();
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$styleBarier = array(
'font' => array(
'bold' => true,
'size' => 12
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:M1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Parametry pracy studni i układu pompowego ['.$_POST['inRap004_from'].' - '.$_POST['inRap004_to'].']');
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Lp.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', 'Typ');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Pompa');
$objPHPExcel->getActiveSheet()->SetCellValue('E2', 'Qn [m3/min]');
$objPHPExcel->getActiveSheet()->SetCellValue('F2', 'Silnik');
$objPHPExcel->getActiveSheet()->SetCellValue('G2', 'Moc [kW]');
$objPHPExcel->getActiveSheet()->SetCellValue('H2', 'Qśr [m3/min]');
$objPHPExcel->getActiveSheet()->SetCellValue('I2', 'Tp [h]');
$objPHPExcel->getActiveSheet()->SetCellValue('J2', 'V [m3]');
$objPHPExcel->getActiveSheet()->SetCellValue('K2', 'Hd [m]');
$objPHPExcel->getActiveSheet()->SetCellValue('L2', 'Hst [m]');
$objPHPExcel->getActiveSheet()->SetCellValue('M2', 'Tw [C]');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
/*
$pdf->SetLineWidth(.1);
$pdf -> SetFont('arial_ce', 'B', 8);
$pdf->Cell(12,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$pdf->Cell(30,7,iconv('utf-8','windows-1250','Typ'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','Pompa'),1,0,'C');
$pdf->Cell(18,7,iconv('utf-8','windows-1250','Silnik'),1,0,'C');
$pdf->Cell(20,7,iconv('utf-8','windows-1250','Qśr [m3/min]'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','Tp [h]'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','V [m3]'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','Hd [m]'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','Hst [m]'),1,0,'C');
$pdf->Cell(15,7,iconv('utf-8','windows-1250','Tw [C]'),1,0,'C');
$pdf->Ln();
*/
// ===========================================================================
// ===========================================================================
unset($qtmp_01);
//$globalArray = sqlGetResAsArray("select SOD_UJ,WLL_NAME,SOD_DESC,WLE_PUMP_NAME,WLE_PUMP_Q_N,WLE_ENG_NAME,WLE_ENG_POWER,DRS_ID,AVG(RHD_Q_VAL) Q_SR, max(RHD_HST0_VAL) HST0, min(RHD_ID) MIN_ID, max(RHD_ID) MAX_ID from rep_object_departments,rep_his_data_everyday where DRS_ID=RHD_DRS_ID and RHD_DATE>'".$_POST['inRap004_from']." 00:00:00' and RHD_DATE<'".$_POST['inRap004_to']." 23:59:59' and SOD_PLC='".$_SESSION['syndis_eq_stock']."' and RHD_Q_VAL>0 group by DRS_ID order by SOD_UJ,WLL_NAME");
$globalArray = sqlGetResAsArray("select DRS_ID,WLL_NAME,WLL_BARIERA,WLE_PUMP_NAME,WLE_PUMP_NO,WLE_ENG_NAME,WLE_ENG_NO,WLL_SYS_TYPE,DRS_DEPARTMENT,WLE_DATE_FROM,WLE_DATE_TO from seg_wells_exchanged left join seg_wells on WLL_ID=WLE_WLL_ID left join seg_dev_resources on DRS_DEV_ID=WLL_ID and DRS_DEV_TYPE=12 where (WLE_DATE_TO>'".$_POST['inRap004_from']." 00:00:00' or WLE_DATE_TO is null) and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' order by WLL_BARIERA,WLL_NAME");
$i=0;$res=null; $kom=0; $lp=1;
$pdf -> SetFont('arial_ce', '', 7);
$newBariera=null; $sumBariera=0;
for ($i=0; $i<count($globalArray); $i++)
{
$minArray = null;
// $minArray = sqlGetResAsArray("select RHD_VM3_VAL,RHD_WTEMP_VAL,RHD_WORK_TIME_VAL from rep_his_data_everyday where RHD_ID=".$globalArray[$i]['MIN_ID']);
$maxArray = null;
// $maxArray = sqlGetResAsArray("select RHD_HD_VAL,RHD_VM3_VAL,RHD_WTEMP_VAL,RHD_WORK_TIME_VAL from rep_his_data_everyday where RHD_ID=".$globalArray[$i]['MAX_ID']);
$paramArray = null;
$paramArray = sqlGetResAsArray("select avg(R04_QSR) Q_SR,avg(R04_WAT_TMP) WTEMP_VAL,max(R04_HST0) HST0,max(R04_HD) HD_VAL,sum(R04_VM3) VM3_VAL, sum(R04_WORK_TIME) WORK_TIME_VAL from rep_004_data where R04_DRS_ID=".$globalArray[$i]['DRS_ID']." and R04_DATE>='".$_POST['inRap004_from']."' and R04_DATE<='".$_POST['inRap004_to']."'");
if($paramArray[0]['Q_SR']>0)
{
$pupQn = null; $pupQn = round(sqlStringValue("select PUP_Q_N from seg_dev_resources,seg_pumps where PUP_ID=DRS_DEV_ID and DRS_DEV_TYPE=10 and PUP_NAME='".$globalArray[$i]['WLE_PUMP_NAME']."' and DRS_SN_NUMBER='".$globalArray[$i]['WLE_PUMP_NO']."' limit 1", "PUP_Q_N")/60,2);
$engPow = null; $engPow = round(sqlStringValue("select ENG_POWER from seg_dev_resources,seg_engines where DRS_DEV_ID=ENG_ID and DRS_DEV_TYPE=11 and ENG_NAME='".$globalArray[$i]['WLE_ENG_NAME']."' and DRS_SN_NUMBER='".$globalArray[$i]['WLE_ENG_NO']."' limit 1","ENG_POWER"),2);
if ($paramArray[0]['HST0']>0) $hstZERO = round($paramArray[0]['HST0'],2);
else $hstZERO=null;
if ($newBariera!=$globalArray[$i]['WLL_BARIERA'])
{
// podsumowanie
if ($i>0)
{
$objPHPExcel->getActiveSheet()->mergeCells('A'.($kom+3).':I'.($kom+3));
$objPHPExcel->getActiveSheet()->getStyle('A'.($kom+3).':I'.($kom+3))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom+3), 'Razem bariera '.$newBariera);
$objPHPExcel->getActiveSheet()->SetCellValue('J'.($kom+3), $sumBariera);
$pdf->Cell(130,5,iconv('utf-8','windows-1250','Razem bariera '.$newBariera),0,0,'R');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',$sumBariera),0,0,'R');
$pdf->Ln();
$kom++;
$sumBariera=0;
}
// =========================================================================
$newBariera=$globalArray[$i]['WLL_BARIERA'];
$objPHPExcel->getActiveSheet()->mergeCells('A'.($kom+3).':M'.($kom+3));
$objPHPExcel->getActiveSheet()->getRowDimension($kom+3)->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A'.($kom+3).':M'.($kom+3))->applyFromArray($styleBarier);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom+3), 'Bariera '.$newBariera);
$pdf -> SetFont('arial_ce', 'B', 8);
$pdf->Cell(0,10,iconv('utf-8','windows-1250','Bariera '.$newBariera),0,1,'L');
//$pdf->Label();
$kom++;
}
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom+3), $lp);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($kom+3), $globalArray[$i]['WLL_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($kom+3), $globalArray[$i]['WLL_SYS_TYPE']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom+3), $globalArray[$i]['WLE_PUMP_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('E'.($kom+3), $pupQn);
$objPHPExcel->getActiveSheet()->SetCellValue('F'.($kom+3), $globalArray[$i]['WLE_ENG_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('G'.($kom+3), $engPow);
$objPHPExcel->getActiveSheet()->SetCellValue('H'.($kom+3), round($paramArray[0]['Q_SR']/60,3));
$objPHPExcel->getActiveSheet()->SetCellValue('I'.($kom+3), round($paramArray[0]['WORK_TIME_VAL'],2));
$objPHPExcel->getActiveSheet()->SetCellValue('J'.($kom+3), round($paramArray[0]['VM3_VAL'],2));
$objPHPExcel->getActiveSheet()->SetCellValue('K'.($kom+3), round($paramArray[0]['HD_VAL'],2));
$objPHPExcel->getActiveSheet()->SetCellValue('L'.($kom+3), $hstZERO);
$objPHPExcel->getActiveSheet()->SetCellValue('M'.($kom+3), round($paramArray[0]['WTEMP_VAL'],2));
$sumBariera+= (float) round($paramArray[0]['VM3_VAL'],2);
$kom++;
$pdf -> SetFont('arial_ce', '', 6);
$pdf->Cell(10,5,iconv('utf-8','windows-1250',$lp),1,0,'C');
$pdf->Cell(17,5,iconv('utf-8','windows-1250',$globalArray[$i]['WLL_NAME']),1,0,'C');
$pdf->Cell(35,5,iconv('utf-8','windows-1250',$globalArray[$i]['WLL_SYS_TYPE']),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',$globalArray[$i]['WLE_PUMP_NAME']),1,0,'C');
$pdf->Cell(18,5,iconv('utf-8','windows-1250',$globalArray[$i]['WLE_ENG_NAME']),1,0,'C');
$pdf->Cell(20,5,iconv('utf-8','windows-1250',round($paramArray[0]['Q_SR']/60,3)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($paramArray[0]['WORK_TIME_VAL'],2)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($paramArray[0]['VM3_VAL'],2)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($paramArray[0]['HD_VAL'],2)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',$hstZERO),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($paramArray[0]['WTEMP_VAL'],2)),1,0,'C');
$pdf->Ln();
$lp++;
$res[]=array(
'bar' => $globalArray[$i]['WLL_BARIERA'],
'a' => $globalArray[$i]['WLL_NAME'],
'b' => $globalArray[$i]['WLL_SYS_TYPE'],
'c' => $globalArray[$i]['WLE_PUMP_NAME'],
'd' => $pupQn,
'e' => $globalArray[$i]['WLE_ENG_NAME'],
'f' => $engPow,
'g' => round($paramArray[0]['Q_SR']/60,3),
'h' => round($paramArray[0]['WORK_TIME_VAL'],2),
'i' => round($paramArray[0]['VM3_VAL'],2),
'j' => round($paramArray[0]['HD_VAL'],2),
'k' => $hstZERO,
'l' => round($paramArray[0]['WTEMP_VAL'],2),
'fr' => $_POST['inRap004_from'],
'to' => $_POST['inRap004_to']
);
}
}
unset($_SESSION['site809_rap004']);
$_SESSION['site809_rap004']=$res;
$objPHPExcel->getActiveSheet()->setTitle('Parametry pracy');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_004xls);
unset($objPHPExcel);
$pdf->Output($rap_004pdf);
}
// ============================================================================================================
// ============================================================================================================
// raport 005
// ============================================================================================================
if ($_POST['subRap005']=='Generuj' && $_GET['rap']=='005')
{
$rap_005xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap005.xlsx";
$rap_005pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap005.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Wykaz obiektów na stanie wydziału');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 7);
$this->Cell(10,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(35,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(40,7,iconv('utf-8','windows-1250','Typ'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Data oddania'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','X'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Y'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Rz. pier.'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Rz. akt.'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Gł. LS'),1,0,'C');
$this->Ln();
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',8);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
function Label()
{
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 7);
$this->Cell(10,7,iconv('utf-8','windows-1250','Lp.'),1,0,'C');
$this->Cell(35,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(40,7,iconv('utf-8','windows-1250','Typ'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Data oddania'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','X'),1,0,'C');
$this->Cell(20,7,iconv('utf-8','windows-1250','Y'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Rz. pier.'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Rz. akt.'),1,0,'C');
$this->Cell(15,7,iconv('utf-8','windows-1250','Gł. LS'),1,0,'C');
$this->Ln();
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$styleBarier = array(
'font' => array(
'bold' => true,
'size' => 12
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:I1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:I1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Wykaz obiektów na stanie wydziału - '.$_SESSION['syndis_eq_stock']);
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Lp.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', 'Typ');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Data oddania');
$objPHPExcel->getActiveSheet()->SetCellValue('E2', 'X');
$objPHPExcel->getActiveSheet()->SetCellValue('F2', 'Y');
$objPHPExcel->getActiveSheet()->SetCellValue('G2', 'Rzędna pierwotna');
$objPHPExcel->getActiveSheet()->SetCellValue('H2', 'Rzędna aktualna');
$objPHPExcel->getActiveSheet()->SetCellValue('I2', 'Głębokość LS');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
// ===========================================================================
// ===========================================================================
$i=0;$res=null; $newBariera=null;$kom=0;
$pdf -> SetFont('arial_ce', '', 7);
$wynik = mysql_query("select SOD_UJ,OBJ_NAME,SOD_DESC,OHC_DATA_ODDANIA,OHC_DL_GEOGR,OHC_SZER_GEOGR,OHC_RZEDNA_TEREN,OHC_RZEDNA_TERENU_ACT,(select DRD_VALUE from seg_dev_resources_det where DRD_ID=MAX_DRD_ID limit 1) DEPTH_LS from (select DRS_ID OBJ_ID,WLL_NAME OBJ_NAME from seg_dev_resources left join seg_wells on WLL_ID=DRS_DEV_ID where DRS_STATUS_DIC_ID<>9 and DRS_DEV_TYPE=12 union select DRS_ID OBJ_ID,SRP_NAME OBJ_NAME from seg_dev_resources left join seg_reservoirs_piezometers on SRP_ID=DRS_DEV_ID where DRS_STATUS_DIC_ID<>9 and DRS_DEV_TYPE=601) V_TB left join seg_object_hole_cards on OHC_NAME=OBJ_NAME left join viw_spm_maxdrd_110 ON DRS_ID=OBJ_ID left join seg_object_def on SOD_NAME=OBJ_NAME where SOD_PLC='".$_SESSION['syndis_eq_stock']."' order by SOD_UJ,OBJ_NAME");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
if ($newBariera!=$r['SOD_UJ'])
{
$newBariera=$r['SOD_UJ'];
$objPHPExcel->getActiveSheet()->mergeCells('A'.($kom+3).':I'.($kom+3));
$objPHPExcel->getActiveSheet()->getRowDimension($kom+3)->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A'.($kom+3).':I'.($kom+3))->applyFromArray($styleBarier);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom+3), 'Bariera '.$newBariera);
$pdf -> SetFont('arial_ce', 'B', 8);
$pdf->Cell(0,10,iconv('utf-8','windows-1250','Bariera '.$newBariera),0,1,'L');
//$pdf->Label();
$kom++;
}
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom+3), $i+1);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($kom+3), $r['OBJ_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($kom+3), $r['SOD_DESC']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom+3), $r['OHC_DATA_ODDANIA']);
$objPHPExcel->getActiveSheet()->SetCellValue('E'.($kom+3), $r['OHC_DL_GEOGR']);
$objPHPExcel->getActiveSheet()->SetCellValue('F'.($kom+3), $r['OHC_SZER_GEOGR']);
$objPHPExcel->getActiveSheet()->SetCellValue('G'.($kom+3), round($r['OHC_RZEDNA_TEREN'],2));
$objPHPExcel->getActiveSheet()->SetCellValue('H'.($kom+3), round($r['OHC_RZEDNA_TERENU_ACT'],2));
$objPHPExcel->getActiveSheet()->SetCellValue('I'.($kom+3), round($r['DEPTH_LS'],2));
$kom++;
$pdf -> SetFont('arial_ce', '', 6);
$pdf->Cell(10,5,iconv('utf-8','windows-1250',$i+1),1,0,'C');
$pdf->Cell(35,5,iconv('utf-8','windows-1250',$r['OBJ_NAME']),1,0,'C');
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$r['SOD_DESC']),1,0,'C');
$pdf->Cell(20,5,iconv('utf-8','windows-1250',$r['OHC_DATA_ODDANIA']),1,0,'C');
$pdf->Cell(20,5,iconv('utf-8','windows-1250',$r['OHC_DL_GEOGR']),1,0,'C');
$pdf->Cell(20,5,iconv('utf-8','windows-1250',$r['OHC_SZER_GEOGR']),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($r['OHC_RZEDNA_TEREN'],2)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($r['OHC_RZEDNA_TERENU_ACT'],2)),1,0,'C');
$pdf->Cell(15,5,iconv('utf-8','windows-1250',round($r['DEPTH_LS'],2)),1,0,'C');
$pdf->Ln();
$res[]=array(
'bar'=>$r['SOD_UJ'],
'a' => $r['OBJ_NAME'],
'b' => $r['SOD_DESC'],
'c' => $r['OHC_DATA_ODDANIA'],
'd' => $r['OHC_DL_GEOGR'],
'e' => $r['OHC_SZER_GEOGR'],
'f' => round($r['OHC_RZEDNA_TEREN'],2),
'g' => round($r['OHC_RZEDNA_TERENU_ACT'],2),
'h' => round($r['DEPTH_LS'],2)
);
$i++;
}
unset($_SESSION['site809_rap005']);
$_SESSION['site809_rap005']=$res;
$objPHPExcel->getActiveSheet()->setTitle('Wykaz obiektów');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_005xls);
unset($objPHPExcel);
$pdf->Output($rap_005pdf);
}
// ============================================================================================================
// ============================================================================================================
// raport 006
// ============================================================================================================
if ($_POST['subRap006']=='Generuj' && $_GET['rap']=='006' && !empty($_POST['inRap006']))
{
$rap_006xls = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap006.xlsx";
$rap_006pdf = "./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_rap006.pdf";
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');
require_once './PHPExcel.php';
require_once('./fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this -> SetFont('arial_ce', 'I', 10);
$title = iconv('utf-8','windows-1250','PGE GiEK S.A. o/KWB Bełchatów');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$title = iconv('utf-8','windows-1250','Oddział Odwodnienia '.$_SESSION['syndis_eq_stock']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
$this -> SetFont('arial_ce', 'B', 9);
$title = iconv('utf-8','windows-1250','Zrzut wody na odprowadzalniki');
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(4);
$this -> SetFont('arial_ce', 'I', 8);
$title = iconv('utf-8','windows-1250','na dzień: '.$_POST['inRap006']);
$this->Cell(0,10,$title,0,0,'L');
$this->Ln(7);
}
function Footer()
{
$this->SetY(-15);
$this->SetFont('Arial','I',7);
$this->Cell(95,10,'Data wydruku: '.date('Y-m-d'),0,0,'L');
$this->Cell(95,10,'Strona '.$this->PageNo().'/{nb}',0,1,'R');
}
function Label()
{
$this->SetLineWidth(.1);
$this -> SetFont('arial_ce', 'B', 7);
$this->Cell(40,7,iconv('utf-8','windows-1250','Bariera'),1,0,'C');
$this->Cell(55,7,iconv('utf-8','windows-1250','Studnia'),1,0,'C');
$this->Cell(55,7,iconv('utf-8','windows-1250',''),1,0,'C');
$this->Cell(40,7,iconv('utf-8','windows-1250','Zrzut [m3/min]'),1,0,'C');
$this->Ln();
}
}
$pdf = new PDF();
$pdf->AddFont('arial_ce','','arial_ce.php');
$pdf->AddFont('arial_ce','I','arial_ce_i.php');
$pdf->AddFont('arial_ce','B','arial_ce_b.php');
$pdf->AddFont('arial_ce','BI','arial_ce_bi.php');
$styleArray = array(
'font' => array(
'bold' => true,
'size' => 16
));
$styleBarier = array(
'font' => array(
'bold' => true,
'size' => 12
));
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0)->mergeCells('A1:G1');
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(25);
$objPHPExcel->getActiveSheet()->getStyle('A1:G1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Zrzut wody na odprowadzalniki na dzień '.$_POST['inRap006']);
// nagłówki
// ===========================================================================
$objPHPExcel->getActiveSheet()->SetCellValue('A2', 'Bariara.');
$objPHPExcel->getActiveSheet()->SetCellValue('B2', 'Studnia');
$objPHPExcel->getActiveSheet()->SetCellValue('C2', '');
$objPHPExcel->getActiveSheet()->SetCellValue('D2', 'Zrzut [m3/min]');
// ===========================================================================
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf -> SetFont('arial_ce', 'B', 8);
$pdf->Label();
$kom=3;
$res=null;
// ogólna wartość dla danej daty - suma ilości wody na cały system
// ===========================================================================
$globaWater = round(sqlValue("select sum(R04_QSR) QSR from rep_004_data,seg_dev_resources where DRS_ID=R04_DRS_ID and DRS_DEV_TYPE=12 and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and R04_QSR>0 and R04_DATE='".$_POST['inRap006']."'")/60,2);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom), 'SYSTEM');
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($kom), '-->');
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($kom), 'SYSTEM');
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom), $globaWater);
$pdf -> SetFont('arial_ce', '', 6);
$pdf->Cell(40,5,iconv('utf-8','windows-1250','SYSTEM'),1,0,'L');
$pdf->Cell(55,5,iconv('utf-8','windows-1250','------->'),1,0,'C');
$pdf->Cell(55,5,iconv('utf-8','windows-1250','SYSTEM'),1,0,'C');
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$globaWater),1,0,'R');
$pdf->Ln();
$kom++;
// ===========================================================================
$objPHPExcel->getActiveSheet()->mergeCells('A'.($kom).':C'.($kom));
$objPHPExcel->getActiveSheet()->getRowDimension($kom)->setRowHeight(15);
$objPHPExcel->getActiveSheet()->getStyle('A'.($kom).':D'.($kom))->applyFromArray($styleBarier);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom), 'Razem');
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom), $globaWater);
$pdf -> SetFont('arial_ce', 'B', 7);
$pdf->Cell(150,5,iconv('utf-8','windows-1250','Razem'),1,0,'L');
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$globaWater),1,0,'R');
$pdf->Ln();
$pdf->Ln();
$kom++;
$kom++;
// ===========================================================================
// Podział na poszczególne zrzuty
unset($tmpArray);
unset($zrzutArray);
$tmpArray = sqlGetResAsArray("select WWD_ID,WWD_NAME from seg_water_drainage order by WWD_NAME");
for($i=0; $i<count($tmpArray); $i++)
{
$qtmp = (float) sqlValue("select sum(R04_QSR) QSR from rep_004_data where R04_DATE='".$_POST['inRap006']."' and R04_DRS_ID in (select WLD_DRS_ID from seg_water_drainage,seg_well_water_drainage left join seg_dev_resources on WLD_DRS_ID=DRS_ID and DRS_DEV_TYPE=12 and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' where WLD_WWD_ID=WWD_ID and WLD_DRS_ID is not null and WWD_ID=".$tmpArray[$i]['WWD_ID'].")");
if ($qtmp>0)
{
$qtmp = round($qtmp/60,2);
$parentName=sqlStringValue("select WWD_NAME from seg_water_drainage where WWD_ID=(select WWD_PARENT_ID from seg_water_drainage where WWD_ID=".$tmpArray[$i]['WWD_ID'].")","WWD_NAME");
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom), $tmpArray[$i]['WWD_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($kom), '-->');
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($kom), $parentName);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom), $qtmp);
$pdf -> SetFont('arial_ce', '', 6);
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$tmpArray[$i]['WWD_NAME']),1,0,'L');
$pdf->Cell(55,5,iconv('utf-8','windows-1250','------->'),1,0,'C');
$pdf->Cell(55,5,iconv('utf-8','windows-1250',$parentName),1,0,'L');
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$qtmp),1,0,'R');
$pdf->Ln();
$zrzutArray[] = array(
'zrzID' => $tmpArray[$i]['WWD_ID'],
'zrzName' => $tmpArray[$i]['WWD_NAME']
);
$kom++;
}
}
$pdf->Ln();
$kom++;
// poszczególne odprowadzenia
for($i=0; $i<count($zrzutArray); $i++)
{
$objPHPExcel->getActiveSheet()->getStyle('A'.($kom))->applyFromArray($styleBarier);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom), $zrzutArray[$i]['zrzName']);
$kom++;
$pdf -> SetFont('arial_ce', 'B', 7);
$pdf->Cell(0,5,iconv('utf-8','windows-1250',$zrzutArray[$i]['zrzName']),0,1,'L');
unset($tmpArray); $tmpArray = sqlGetResAsArray("select WLL_BARIERA,WLL_NAME,WLD_DRS_ID from seg_well_water_drainage,seg_dev_resources left join seg_wells on WLL_ID=DRS_DEV_ID where DRS_ID=WLD_DRS_ID and DRS_DEV_TYPE=12 and DRS_DEPARTMENT='".$_SESSION['syndis_eq_stock']."' and WLD_DRS_ID is not null and WLD_WWD_ID=".$zrzutArray[$i]['zrzID']." order by WLL_NAME");
for($j=0; $j<count($tmpArray); $j++)
{
$qtmp = (float) sqlValue("select sum(R04_QSR) from rep_004_data where R04_DRS_ID=".$tmpArray[$j]['WLD_DRS_ID']." and R04_DATE='".$_POST['inRap006']."'");
if ($qtmp>0)
{
$qtmp = round($qtmp/60,2);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($kom), $tmpArray[$j]['WLL_BARIERA']);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($kom), $tmpArray[$j]['WLL_NAME']);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($kom), $qtmp);
$kom++;
$pdf -> SetFont('arial_ce', '', 6);
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$tmpArray[$j]['WLL_BARIERA']),1,0,'L');
$pdf->Cell(55,5,iconv('utf-8','windows-1250',$tmpArray[$j]['WLL_NAME']),1,0,'C');
$pdf->Cell(55,5,iconv('utf-8','windows-1250',''),1,0,'L');
$pdf->Cell(40,5,iconv('utf-8','windows-1250',$qtmp),1,0,'R');
$pdf->Ln();
}
}
$kom++;
$pdf->Ln();
}
$objPHPExcel->getActiveSheet()->setTitle('Zrzut wody');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save($rap_006xls);
unset($objPHPExcel);
$pdf->Output($rap_006pdf);
}
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
// ============================================================================================================
?>
<?php
//zapamiętywanie dat w raportach
if (empty($_POST['inRap001_from'])) $_POST['inRap001_from']=date('Y-m')."-01";
if (empty($_POST['inRap001_to'])) $_POST['inRap001_to']=date('Y-m-d');
if (empty($_POST['inRap003_from'])) $_POST['inRap003_from']=date('Y-m')."-01";
if (empty($_POST['inRap003_to'])) $_POST['inRap003_to']=date('Y-m-d');
if (empty($_POST['inRap004_from'])) $_POST['inRap004_from']=date('Y-m')."-01";
if (empty($_POST['inRap004_to'])) $_POST['inRap004_to']=date('Y-m-d');
?>
<div class="tag100">
<div class="head_tag">Raporty - I</div>
<div class="tag">
<table WIDTH="100%" class="tag">
<tr>
<td class="label">Nazwa raportu</td>
<td class="label">Akcja</td>
<td class="label"></td>
</tr>
<form action="./?pg=site809&rap=002" method="post">
<tr>
<td class='field_left'>Łączna ilość agregatów pompowych zabudowanych w studniach</td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap002" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap002']=='Generuj'): ?>
<a href="<?php echo $rap_002xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_002pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="./export/site809_rap002_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
<form action="./?pg=site809&rap=005" method="post">
<tr>
<td class='field_left'>Wykaz obiektów na stanie wydziału</td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap005" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap005']=='Generuj'): ?>
<a href="<?php echo $rap_005xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_005pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="./export/site809_rap005_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
</table>
</div>
<div class="head_tag">Raporty - II</div>
<div class="tag">
<table WIDTH="100%" class="tag">
<tr>
<td class="label">Nazwa raportu</td>
<td class="label">Data od</td>
<td class="label">Data do</td>
<td class="label">Akcja</td>
<td class="label"></td>
</tr>
<form action="./?pg=site809&rap=004" method="post">
<tr>
<td class='field_left'>Wykaz pracy studni</td>
<td class='field_center'><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_05' NAME='inRap004_from' SIZE='10' value="<?php echo $_POST['inRap004_from']; ?>"></td>
<td class='field_center'><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_06' NAME='inRap004_to' SIZE='10' value="<?php echo $_POST['inRap004_to']; ?>"></td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap004" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap004']=='Generuj'): ?>
<a href="<?php echo $rap_004xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_004pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="./export/site809_rap004_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
</table>
</div>
<div class="head_tag">Raporty - III</div>
<div class="tag">
<table WIDTH="100%" class="tag">
<tr>
<td class="label">Nazwa raportu</td>
<td class="label">Data</td>
<td class="label">Godzina</td>
<td class="label">Akcja</td>
<td class="label"></td>
</tr>
<form action="./?pg=site809&rap=001" method="post">
<tr>
<td class='field_left'>Wykaz energochłonności dla studni na dany moment.</td>
<td class='field_center'><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_01' NAME='inRap001' SIZE='10' value="<?php echo $_POST['inRap001']; ?>"></td>
<td class='field_center'><?php getSelectHours('inRap001_hour');?></td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap001" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap001']=='Generuj'): ?>
<a href="<?php echo $rap_001xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_001pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="./export/site809_rap001_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
<form action="./?pg=site809&rap=003" method="post">
<tr>
<td class='field_left'>Parametry pracy studni i układu pompowego</td>
<td class='field_center'><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_03' NAME='inRap003' SIZE='10' value="<?php echo $_POST['inRap003']; ?>"></td>
<td class='field_center'><?php getSelectHours('inRap003_hour');?></td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap003" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap003']=='Generuj'): ?>
<a href="<?php echo $rap_003xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_003pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="./export/site809_rap003_print.php" target="_blank" title="Wydruk"><img src="/images/printer-icon.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
</table>
</div>
<div class="head_tag">Raporty - IV</div>
<div class="tag">
<table WIDTH="100%" class="tag">
<tr>
<td class="label">Nazwa raportu</td>
<td class="label">Data</td>
<td class="label">Akcja</td>
<td class="label"></td>
</tr>
<form action="./?pg=site809&rap=006" method="post">
<tr>
<td class='field_left'>Zrzut wody na odprowadzalniki</td>
<td class='field_center'><INPUT STYLE='text-align: right' TYPE='TEXT' id='data_07' NAME='inRap006' SIZE='10' value="<?php echo $_POST['inRap006']; ?>"></td>
<td class='field_center'><input class='btn btn-success btn-xs' type="submit" name="subRap006" value="Generuj" onclick="makeRequest('?pg=site809');"></td>
<td CLASS='desc_value' style="max-width: 100px; text-align: center;">
<?php if ($_POST['subRap006']=='Generuj'): ?>
<a href="<?php echo $rap_006xls; ?>" target="_blank" title="Export do EXCEL"><img src="/images/excel_ico.png" style="max-width: 20px; border: 0;"></a>&nbsp;&nbsp;
<a href="<?php echo $rap_006pdf; ?>" target="_blank" title="Export do PDF"><img src="/images/pdf_ico.png" style="max-width: 20px; border: 0;"></a>
<?php endif; ?>
</td>
</tr>
</form>
</table>
</div>
</div>
<?php
}
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
?>