имеется отрывок кода include("../monitoring_execution_plans_files/classes/page_monitoring.php");
class page_print extends page_monitoring_report_show
{
var $pdf_cl;
function page_print()
{
include_once("../desktop/classes/mysql.class.php");
include_once("../desktop/functions/functions.php");
set_connection_vars($this->db_name, $this->db_host, $this->db_user, $this->db_pass, $this->db_charset, $this->db_table_prefix);
$this->db_charset = 'utf8';
$this -> db = new MySQL(true, $this -> db_name, $this -> db_host, $this -> db_user, $this -> db_pass, $this -> db_charset);
require('../desktop/classes/fpdf/fpdf.php');
$this -> pdf_cl = new FPDF();
}
кнопка отображается, но при нажатии на неё выходится следующее "FPDF error: Could not include font metric file". Подскажите пожалуйста в чем может быть дело
1. Огорчяшка - 01 Августа, 2014 - 09:05:40 - перейти к сообщению
2. Tyoma5891 - 01 Августа, 2014 - 09:22:57 - перейти к сообщению
Огорчяшка пишет:
имеется отрывок кода include("../monitoring_execution_plans_files/classes/page_monitoring.php");
class page_print extends page_monitoring_report_show
{
var $pdf_cl;
function page_print()
{
include_once("../desktop/classes/mysql.class.php");
include_once("../desktop/functions/functions.php");
set_connection_vars($this->db_name, $this->db_host, $this->db_user, $this->db_pass, $this->db_charset, $this->db_table_prefix);
$this->db_charset = 'utf8';
$this -> db = new MySQL(true, $this -> db_name, $this -> db_host, $this -> db_user, $this -> db_pass, $this -> db_charset);
require('../desktop/classes/fpdf/fpdf.php');
$this -> pdf_cl = new FPDF();
}
кнопка отображается, но при нажатии на неё выходится следующее "FPDF error: Could not include font metric file". Подскажите пожалуйста в чем может быть дело
class page_print extends page_monitoring_report_show
{
var $pdf_cl;
function page_print()
{
include_once("../desktop/classes/mysql.class.php");
include_once("../desktop/functions/functions.php");
set_connection_vars($this->db_name, $this->db_host, $this->db_user, $this->db_pass, $this->db_charset, $this->db_table_prefix);
$this->db_charset = 'utf8';
$this -> db = new MySQL(true, $this -> db_name, $this -> db_host, $this -> db_user, $this -> db_pass, $this -> db_charset);
require('../desktop/classes/fpdf/fpdf.php');
$this -> pdf_cl = new FPDF();
}
кнопка отображается, но при нажатии на неё выходится следующее "FPDF error: Could not include font metric file". Подскажите пожалуйста в чем может быть дело
не вижу ни одно упоминания о выводе кнопки на печать в коде, а ошибку он говорит сейчас что не может подключить файл со шрифтами какойто...
3. Огорчяшка - 01 Августа, 2014 - 09:27:39 - перейти к сообщению
Немного не правильно выразилась, до печати дело не доходит из-за шрифтов, это не весь код, а только кусок, мне бы как раз и хотелось узнать по поводу шрифтов, все указанные файлы лежат там где указаны..
4. Огорчяшка - 05 Августа, 2014 - 07:09:54 - перейти к сообщению
Спойлер (Отобразить)
include("../monitoring_execution_plans_files/classes/page_monitoring.php");
class page_print extends page_monitoring_report_show
{
var $pdf_cl;
function page_print()
{
include_once("../desktop/classes/mysql.class.php");
include_once("../desktop/functions/functions.php");
set_connection_vars($this->db_name, $this->db_host, $this->db_user, $this->db_pass, $this->db_charset, $this->db_table_prefix);
$this->db_charset = 'utf8';
$this -> db = new MySQL(true, $this -> db_name, $this -> db_host, $this -> db_user, $this -> db_pass, $this -> db_charset);
//require('../desktop/classes/fpdf/fpdf.php');
define('FPDF_FONTPATH','font/');
require('fpdf.php');
$this -> pdf_cl = new FPDF();
}
function print_title()
{
$this -> pdf_cl->AddFont('timesbd','','timesbd.php');
$this -> pdf_cl->AddFont('times','','times.php');
$this -> pdf_cl->SetFont('timesbd', '', '12');
$this -> pdf_cl->Text(240,8, 'Приложение №1');
$this -> pdf_cl->Text(225,14, 'к Приказу ГУЗ КОКПТД');
$this -> pdf_cl->Text(234,20, '№85 от 08.02.2010г.');
$this -> pdf_cl->SetFont('timesbd', '', '14');
$this -> pdf_cl->Ln(12);
$this -> pdf_cl->Cell(0,5,'Информация по выполнению плановых показателей деятельности филиалов ГУЗ КОКПТД',0,0,'C');
}
function print_header($name_branch)
{
$this -> pdf_cl->SetFont('times', '', '14');
$this -> pdf_cl->Ln(6);
$this -> pdf_cl->Cell(0,7, 'Филиал ГУЗ КОКПТД ' . $name_branch . ' Отчетный период с ' . $this -> eng_to_rus_date($this -> date_from) . ' по ' . $this -> eng_to_rus_date($this -> date_to),0,0,'L');
$this -> pdf_cl->Ln(9);
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Cell(21,40,'',1,0,'C');
$this -> pdf_cl->Text(14,43, 'Показатель');
$this -> pdf_cl->Text(12,49, 'деятельности');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(33,43, 'Выбыло');
$this -> pdf_cl->Text(32,49, '(выписано');
$this -> pdf_cl->Text(32,55, 'и умерло -');
$this -> pdf_cl->Text(32,61, 'стационар)');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(48,43, 'Койко-дней');
$this -> pdf_cl->Text(48,49, '(стационар)');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(68,43, 'Число');
$this -> pdf_cl->Text(65,49, 'посещений');
$this -> pdf_cl->Cell(18,40,'',1,0,'C');
$this -> pdf_cl->Text(85,43, 'Число');
$this -> pdf_cl->Text(83,49, 'выбывших');
$this -> pdf_cl->Text(83,55, 'больных');
$this -> pdf_cl->Text(83,61, '(дневной');
$this -> pdf_cl->Text(82,67, 'стационар)*');
$this -> pdf_cl->Cell(18,40,'',1,0,'C');
$this -> pdf_cl->Text(102,43, 'Число');
$this -> pdf_cl->Text(101,49, 'пациенто-');
$this -> pdf_cl->Text(102,55, 'дней');
$this -> pdf_cl->Text(101,61, '(дневной');
$this -> pdf_cl->Text(101,67, 'стационар)*');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(120,43, 'Число');
$this -> pdf_cl->Text(120,49, 'рентген-');
$this -> pdf_cl->Text(120,55, 'исследо-');
$this -> pdf_cl->Text(120,61, 'ваний в');
$this -> pdf_cl->Text(119,67, 'единицах');
$this -> pdf_cl->Cell(20,40,'',1,0,'C');
$this -> pdf_cl->Text(138,43, 'Нагрузка');
$this -> pdf_cl->Text(136,49, 'клин.-диагн.');
$this -> pdf_cl->Text(136,55, 'лаборатории');
$this -> pdf_cl->Text(138,61, 'в лаб. ед.');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(157,43, 'Нагрузка');
$this -> pdf_cl->Text(157,49, 'бак. лаб.');
$this -> pdf_cl->Text(157,55, 'в лаб. ед.');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(174,43, 'Общий');
$this -> pdf_cl->Text(173,49, 'показатель');
$this -> pdf_cl->Text(173,55, 'по функцио-');
$this -> pdf_cl->Text(174,61, 'нальной');
$this -> pdf_cl->Text(174,67, 'диагнос-');
$this -> pdf_cl->Text(176,73, 'тике');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(193,43, 'Эндо-');
$this -> pdf_cl->Text(192,49, 'скопия в');
$this -> pdf_cl->Text(192,55, 'единицах');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(208,43, 'ФТО в');
$this -> pdf_cl->Text(207,49, 'единицах');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(224,43, 'Посещения');
$this -> pdf_cl->Text(224,49, 'стоматолога');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(244,43, 'Число');
$this -> pdf_cl->Text(243,49, 'выбывших');
$this -> pdf_cl->Text(244,55, 'больных');
$this -> pdf_cl->Text(243,61, '(санаторий)');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(262,43, 'Койко-дни');
$this -> pdf_cl->Text(261,49, '(санаторий)');
$this -> pdf_cl->Ln();
}
function print_tables($one_month)
{
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(12,81, '1. За месяц');
$this -> pdf_cl->Text(11,85, 'отдельно');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(20,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(11,93, 'План на месяц');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ber_day_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_count_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,103, 'Факт за месяц');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['berth_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,111, '% исполнения');
$this -> pdf_cl->Text(12,115, 'плана**');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ber_day_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_count_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Ln();
}
function print_tables_groth($groth)
{
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(12,121, '2. За месяц с');
$this -> pdf_cl->Text(12,125, 'нарастанием');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(20,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(12,133, 'План');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ber_day_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_count_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_days_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(12,143, 'Факт');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['berth_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,151, '% исполнения');
$this -> pdf_cl->Text(12,155, 'плана**');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ber_day_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_count_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_days_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Ln(11);
}
function print_footer()
{
$this -> pdf_cl->SetFont('times', '', '14');
$this -> pdf_cl->Cell(200,5,'Руководитель филиала (ФИО, подпись)',0,0,'L');
$this -> pdf_cl->Cell(50,5,'Дата ' . date('d.m.Y') ,0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'Ответственное лицо (ФИО, подпись)',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->SetFont('times', '', '12');
$this -> pdf_cl->Cell(50,5,'*в дневных стационарах при поликлинических отделениях (для Новокузнецкого и Прокопьевского филиалов, г.Кемерово)',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'**при невыполнении плана указать причины____________________________________________________________________________________________',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'___________________________________________________________________________________________________________________________________',0,0,'L');
}
}
$index_page = new page_print();
$pdf = $index_page -> pdf_cl;
$db = $index_page -> db;
session_start();
$id_branch = $_GET['id_br'];
$index_page -> date_from = $HTTP_SESSION_VARS['date_from_monit'];
$index_page -> date_to = $HTTP_SESSION_VARS['date_to_monit'];
//без нарастания
$query = 'SELECT '
. $index_page ->db_table_prefix . 'branches`.s_name AS bran_name, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch AS bran_id, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen AS ront_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory AS cl_di_lab_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.bacteriological_laboratory AS bac_lab_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg AS ekg_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy AS endosc_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy AS physio_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days AS berth_days_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count AS left_count_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary AS left_stat_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary AS patient_days_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist AS stom_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium AS left_sanit_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium AS berth_sanit_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month AS visit_month, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create AS date_rep,
date_format(' . $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.date_create, "%d.%m.%Y") AS date_rep2,
(ROUND(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS ront_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen /
(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ront_fact_proc,
(ROUND(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS cl_di_lab_plan_month,
(ROUND((' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory /
(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS cl_di_lab_fact_proc,
(ROUND(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS bac_lab_plan_month,
(ROUND((' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.bacteriological_laboratory /
(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS bac_lab_fact_proc,
(ROUND(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ekg_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg /
(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ekg_fact_proc,
(ROUND(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS endosc_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy /
(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS endosc_fact_proc,
(ROUND(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS physio_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy /
(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS physio_fact_proc,
(ROUND(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ber_day_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days /
(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ber_day_fact_proc,
(ROUND(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS visit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month /
(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS visit_fact_proc,
(ROUND(((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS left_count_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count /
(((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_count_fact_proc,
(ROUND(((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS left_stat_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary /
(((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_stat_fact_proc,
(ROUND(((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS patient_days_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary /
(((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS patient_days_fact_proc,
(ROUND(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS stom_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist /
(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS stom_fact_proc,
(ROUND(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS left_count_sanit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium /
(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_count_sanit_fact_proc,
(ROUND(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS berth_sanit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium /
(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS berth_sanit_fact_proc
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
INNER JOIN ' . $index_page ->db_table_prefix . 'branches`
ON ' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = ' . $index_page ->db_table_prefix . 'branches`.id_branch
WHERE ';
$query = $query . '('
. $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.branch = ' . $id_branch . ') AND ';
$query = $query
. '(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create =
(SELECT
MAX(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create)
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
WHERE
(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = bran_id)
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create >=
DATE_SUB(STR_TO_DATE(CONCAT(YEAR("' . $index_page -> date_to . '"), "-", MONTH("' . $index_page -> date_to . '"), "-26 00:00:00"), "%Y-%m-%d %k:%i"), INTERVAL 1 MONTH))
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create <= "' . $index_page -> date_to . ' 23:59:59")))';
//echo $query;
if ($db -> Query($query))
{
$col_row = $db-> RowCount();
if ($col_row > 0)
{
$ReoportShowArray = $db -> RecordsArray();
$pdf->AddPage('L', 'A4');
$index_page -> print_title();
$index_page -> print_header($ReoportShowArray[0][0]);
$index_page -> print_tables($ReoportShowArray);
}
else
{print ('<font color=red>Недостаточно данных для вывода отчета!!!</font>'); exit;}
}
$query = 'SELECT '
. $index_page ->db_table_prefix . 'branches`.s_name AS bran_name, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch AS bran_id,
SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen) AS ront_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory) as cl_di_lab_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.bacteriological_laboratory) as bac_lab_fact,
sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg) as ekg_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.endoscopy) as endosc_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.physiotherapy) as physio_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.berth_days) as berth_days_fact,
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create AS date_rep,
date_format(' . $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.date_create, "%d.%m.%y %k:%i") AS date_rep2,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count) as left_count_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count_stationary) as left_stat_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.patient_days_stationary) as patient_days_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.stomatologist) as stom_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count_sanitarium) as left_sanit_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.berth_days_sanitarium) as berth_sanit_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.visit_month) as visit_month,
SUM(ROUND(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS ront_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen) /
(SUM((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as ront_fact_proc,
SUM(ROUND(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS cl_di_lab_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory) /
(SUM((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS cl_di_lab_fact_proc,
SUM(ROUND(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS bac_lab_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.bacteriological_laboratory) /
(SUM((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS bac_lab_fact_proc,
SUM(ROUND(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ekg_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg) /
(SUM((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS ekg_fact_proc,
SUM(ROUND(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS endosc_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy) /
(SUM((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS endosc_fact_proc,
SUM(ROUND(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS physio_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy) /
(SUM((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS physio_fact_proc,
SUM(ROUND(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ber_day_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days) /
(SUM((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS ber_day_fact_proc,
SUM(ROUND(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS visit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month) /
(SUM((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as visit_fact_proc,
(ROUND((SUM((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS left_count_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count) /
(SUM((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS left_count_fact_proc,
(ROUND((SUM((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS left_stat_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary) /
(SUM((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS left_stat_fact_proc,
(ROUND((SUM((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS patient_days_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary) /
(SUM((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS patient_days_fact_proc,
SUM(ROUND(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS stom_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist) /
(SUM((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as stom_fact_proc,
SUM(ROUND(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS left_count_sanit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium) /
(SUM((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as left_count_sanit_fact_proc,
SUM(ROUND(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS berth_days_sanit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium) /
(SUM((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as berth_days_sanit_fact_proc
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
INNER JOIN ' . $index_page ->db_table_prefix . 'branches`
ON ' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = '
. $index_page ->db_table_prefix . 'branches`.id_branch
WHERE
(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create
>= "' . $index_page -> date_from . ' 00:00:00")
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create
<= "' . $index_page -> date_to . ' 23:59:59")';
$query = $query
. ' AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = "'
. $id_branch . '")';
$query = $query
. ' GROUP BY
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch';
//echo $query;
if ($db -> Query($query))
{
$col_row = $db-> RowCount();
if ($col_row > 0)
{
$ReoportShowArray_groth = $db -> RecordsArray();
$index_page -> print_tables_groth($ReoportShowArray_groth);
}
}
$index_page -> print_footer();
$pdf->Output();
?>
class page_print extends page_monitoring_report_show
{
var $pdf_cl;
function page_print()
{
include_once("../desktop/classes/mysql.class.php");
include_once("../desktop/functions/functions.php");
set_connection_vars($this->db_name, $this->db_host, $this->db_user, $this->db_pass, $this->db_charset, $this->db_table_prefix);
$this->db_charset = 'utf8';
$this -> db = new MySQL(true, $this -> db_name, $this -> db_host, $this -> db_user, $this -> db_pass, $this -> db_charset);
//require('../desktop/classes/fpdf/fpdf.php');
define('FPDF_FONTPATH','font/');
require('fpdf.php');
$this -> pdf_cl = new FPDF();
}
function print_title()
{
$this -> pdf_cl->AddFont('timesbd','','timesbd.php');
$this -> pdf_cl->AddFont('times','','times.php');
$this -> pdf_cl->SetFont('timesbd', '', '12');
$this -> pdf_cl->Text(240,8, 'Приложение №1');
$this -> pdf_cl->Text(225,14, 'к Приказу ГУЗ КОКПТД');
$this -> pdf_cl->Text(234,20, '№85 от 08.02.2010г.');
$this -> pdf_cl->SetFont('timesbd', '', '14');
$this -> pdf_cl->Ln(12);
$this -> pdf_cl->Cell(0,5,'Информация по выполнению плановых показателей деятельности филиалов ГУЗ КОКПТД',0,0,'C');
}
function print_header($name_branch)
{
$this -> pdf_cl->SetFont('times', '', '14');
$this -> pdf_cl->Ln(6);
$this -> pdf_cl->Cell(0,7, 'Филиал ГУЗ КОКПТД ' . $name_branch . ' Отчетный период с ' . $this -> eng_to_rus_date($this -> date_from) . ' по ' . $this -> eng_to_rus_date($this -> date_to),0,0,'L');
$this -> pdf_cl->Ln(9);
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Cell(21,40,'',1,0,'C');
$this -> pdf_cl->Text(14,43, 'Показатель');
$this -> pdf_cl->Text(12,49, 'деятельности');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(33,43, 'Выбыло');
$this -> pdf_cl->Text(32,49, '(выписано');
$this -> pdf_cl->Text(32,55, 'и умерло -');
$this -> pdf_cl->Text(32,61, 'стационар)');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(48,43, 'Койко-дней');
$this -> pdf_cl->Text(48,49, '(стационар)');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(68,43, 'Число');
$this -> pdf_cl->Text(65,49, 'посещений');
$this -> pdf_cl->Cell(18,40,'',1,0,'C');
$this -> pdf_cl->Text(85,43, 'Число');
$this -> pdf_cl->Text(83,49, 'выбывших');
$this -> pdf_cl->Text(83,55, 'больных');
$this -> pdf_cl->Text(83,61, '(дневной');
$this -> pdf_cl->Text(82,67, 'стационар)*');
$this -> pdf_cl->Cell(18,40,'',1,0,'C');
$this -> pdf_cl->Text(102,43, 'Число');
$this -> pdf_cl->Text(101,49, 'пациенто-');
$this -> pdf_cl->Text(102,55, 'дней');
$this -> pdf_cl->Text(101,61, '(дневной');
$this -> pdf_cl->Text(101,67, 'стационар)*');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(120,43, 'Число');
$this -> pdf_cl->Text(120,49, 'рентген-');
$this -> pdf_cl->Text(120,55, 'исследо-');
$this -> pdf_cl->Text(120,61, 'ваний в');
$this -> pdf_cl->Text(119,67, 'единицах');
$this -> pdf_cl->Cell(20,40,'',1,0,'C');
$this -> pdf_cl->Text(138,43, 'Нагрузка');
$this -> pdf_cl->Text(136,49, 'клин.-диагн.');
$this -> pdf_cl->Text(136,55, 'лаборатории');
$this -> pdf_cl->Text(138,61, 'в лаб. ед.');
$this -> pdf_cl->Cell(17,40,'',1,0,'C');
$this -> pdf_cl->Text(157,43, 'Нагрузка');
$this -> pdf_cl->Text(157,49, 'бак. лаб.');
$this -> pdf_cl->Text(157,55, 'в лаб. ед.');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(174,43, 'Общий');
$this -> pdf_cl->Text(173,49, 'показатель');
$this -> pdf_cl->Text(173,55, 'по функцио-');
$this -> pdf_cl->Text(174,61, 'нальной');
$this -> pdf_cl->Text(174,67, 'диагнос-');
$this -> pdf_cl->Text(176,73, 'тике');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(193,43, 'Эндо-');
$this -> pdf_cl->Text(192,49, 'скопия в');
$this -> pdf_cl->Text(192,55, 'единицах');
$this -> pdf_cl->Cell(16,40,'',1,0,'C');
$this -> pdf_cl->Text(208,43, 'ФТО в');
$this -> pdf_cl->Text(207,49, 'единицах');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(224,43, 'Посещения');
$this -> pdf_cl->Text(224,49, 'стоматолога');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(244,43, 'Число');
$this -> pdf_cl->Text(243,49, 'выбывших');
$this -> pdf_cl->Text(244,55, 'больных');
$this -> pdf_cl->Text(243,61, '(санаторий)');
$this -> pdf_cl->Cell(19,40,'',1,0,'C');
$this -> pdf_cl->Text(262,43, 'Койко-дни');
$this -> pdf_cl->Text(261,49, '(санаторий)');
$this -> pdf_cl->Ln();
}
function print_tables($one_month)
{
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(12,81, '1. За месяц');
$this -> pdf_cl->Text(11,85, 'отдельно');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(20,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(11,93, 'План на месяц');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ber_day_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_count_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,103, 'Факт за месяц');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['berth_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,111, '% исполнения');
$this -> pdf_cl->Text(12,115, 'плана**');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['left_count_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ber_day_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['visit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['left_stat_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10, round($one_month[0]['patient_days_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['ront_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10, round($one_month[0]['cl_di_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10, round($one_month[0]['bac_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['ekg_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['endosc_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10, round($one_month[0]['physio_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['stom_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['left_count_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10, round($one_month[0]['berth_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Ln();
}
function print_tables_groth($groth)
{
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(12,121, '2. За месяц с');
$this -> pdf_cl->Text(12,125, 'нарастанием');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(18,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(20,10,'',1,0,'C');
$this -> pdf_cl->Cell(17,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(16,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Cell(19,10,'',1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->Text(12,133, 'План');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ber_day_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_count_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_days_sanit_plan_month'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(12,143, 'Факт');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['berth_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_month'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_sanit_fact'], 1),1,0,'C');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(21,10,'',1,0,'C');
$this -> pdf_cl->SetFont('timesbd', '', '8');
$this -> pdf_cl->Text(11,151, '% исполнения');
$this -> pdf_cl->Text(12,155, 'плана**');
$this -> pdf_cl->SetFont('times', '', '9');
$this -> pdf_cl->Cell(16,10,round($groth[0]['left_count_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ber_day_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['visit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['left_stat_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(18,10,round($groth[0]['patient_days_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['ront_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(20,10,round($groth[0]['cl_di_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(17,10,round($groth[0]['bac_lab_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['ekg_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['endosc_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(16,10,round($groth[0]['physio_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['stom_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['left_count_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Cell(19,10,round($groth[0]['berth_days_sanit_fact_proc'], 1),1,0,'C');
$this -> pdf_cl->Ln(11);
}
function print_footer()
{
$this -> pdf_cl->SetFont('times', '', '14');
$this -> pdf_cl->Cell(200,5,'Руководитель филиала (ФИО, подпись)',0,0,'L');
$this -> pdf_cl->Cell(50,5,'Дата ' . date('d.m.Y') ,0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'Ответственное лицо (ФИО, подпись)',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->SetFont('times', '', '12');
$this -> pdf_cl->Cell(50,5,'*в дневных стационарах при поликлинических отделениях (для Новокузнецкого и Прокопьевского филиалов, г.Кемерово)',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'**при невыполнении плана указать причины____________________________________________________________________________________________',0,0,'L');
$this -> pdf_cl->Ln();
$this -> pdf_cl->Cell(50,5,'___________________________________________________________________________________________________________________________________',0,0,'L');
}
}
$index_page = new page_print();
$pdf = $index_page -> pdf_cl;
$db = $index_page -> db;
session_start();
$id_branch = $_GET['id_br'];
$index_page -> date_from = $HTTP_SESSION_VARS['date_from_monit'];
$index_page -> date_to = $HTTP_SESSION_VARS['date_to_monit'];
//без нарастания
$query = 'SELECT '
. $index_page ->db_table_prefix . 'branches`.s_name AS bran_name, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch AS bran_id, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen AS ront_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory AS cl_di_lab_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.bacteriological_laboratory AS bac_lab_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg AS ekg_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy AS endosc_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy AS physio_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days AS berth_days_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count AS left_count_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary AS left_stat_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary AS patient_days_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist AS stom_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium AS left_sanit_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium AS berth_sanit_fact, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month AS visit_month, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create AS date_rep,
date_format(' . $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.date_create, "%d.%m.%Y") AS date_rep2,
(ROUND(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS ront_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen /
(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ront_fact_proc,
(ROUND(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS cl_di_lab_plan_month,
(ROUND((' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory /
(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS cl_di_lab_fact_proc,
(ROUND(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS bac_lab_plan_month,
(ROUND((' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.bacteriological_laboratory /
(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS bac_lab_fact_proc,
(ROUND(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ekg_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg /
(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ekg_fact_proc,
(ROUND(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS endosc_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy /
(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS endosc_fact_proc,
(ROUND(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS physio_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy /
(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS physio_fact_proc,
(ROUND(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ber_day_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days /
(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS ber_day_fact_proc,
(ROUND(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS visit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month /
(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS visit_fact_proc,
(ROUND(((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS left_count_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count /
(((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_count_fact_proc,
(ROUND(((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS left_stat_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary /
(((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_stat_fact_proc,
(ROUND(((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS patient_days_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary /
(((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS patient_days_fact_proc,
(ROUND(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS stom_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist /
(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS stom_fact_proc,
(ROUND(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS left_count_sanit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium /
(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS left_count_sanit_fact_proc,
(ROUND(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS berth_sanit_plan_month,
(ROUND((' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium /
(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)) * 100), 2)) AS berth_sanit_fact_proc
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
INNER JOIN ' . $index_page ->db_table_prefix . 'branches`
ON ' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = ' . $index_page ->db_table_prefix . 'branches`.id_branch
WHERE ';
$query = $query . '('
. $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.branch = ' . $id_branch . ') AND ';
$query = $query
. '(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create =
(SELECT
MAX(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create)
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
WHERE
(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = bran_id)
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create >=
DATE_SUB(STR_TO_DATE(CONCAT(YEAR("' . $index_page -> date_to . '"), "-", MONTH("' . $index_page -> date_to . '"), "-26 00:00:00"), "%Y-%m-%d %k:%i"), INTERVAL 1 MONTH))
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create <= "' . $index_page -> date_to . ' 23:59:59")))';
//echo $query;
if ($db -> Query($query))
{
$col_row = $db-> RowCount();
if ($col_row > 0)
{
$ReoportShowArray = $db -> RecordsArray();
$pdf->AddPage('L', 'A4');
$index_page -> print_title();
$index_page -> print_header($ReoportShowArray[0][0]);
$index_page -> print_tables($ReoportShowArray);
}
else
{print ('<font color=red>Недостаточно данных для вывода отчета!!!</font>'); exit;}
}
$query = 'SELECT '
. $index_page ->db_table_prefix . 'branches`.s_name AS bran_name, '
. $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch AS bran_id,
SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen) AS ront_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory) as cl_di_lab_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.bacteriological_laboratory) as bac_lab_fact,
sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg) as ekg_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.endoscopy) as endosc_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.physiotherapy) as physio_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.berth_days) as berth_days_fact,
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create AS date_rep,
date_format(' . $index_page ->db_table_prefix
. 'monitoring_execution_plans_reports`.date_create, "%d.%m.%y %k:%i") AS date_rep2,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count) as left_count_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count_stationary) as left_stat_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.patient_days_stationary) as patient_days_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.stomatologist) as stom_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.left_count_sanitarium) as left_sanit_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.berth_days_sanitarium) as berth_sanit_fact,
sum(' . $index_page ->db_table_prefix .
'monitoring_execution_plans_reports`.visit_month) as visit_month,
SUM(ROUND(((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS ront_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.rontgen) /
(SUM((SELECT
plans2.rontgen
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as ront_fact_proc,
SUM(ROUND(((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS cl_di_lab_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.clinical_diagnostic_laboratory) /
(SUM((SELECT
plans2.clinical_diagnostic_labor atory
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS cl_di_lab_fact_proc,
SUM(ROUND(((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS bac_lab_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.bacteriological_laboratory) /
(SUM((SELECT
plans2.bacteriological_laborator y
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS bac_lab_fact_proc,
SUM(ROUND(((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ekg_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.ekg) /
(SUM((SELECT
plans2.ekg
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS ekg_fact_proc,
SUM(ROUND(((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS endosc_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.endoscopy) /
(SUM((SELECT
plans2.endoscopy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS endosc_fact_proc,
SUM(ROUND(((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS physio_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.physiotherapy) /
(SUM((SELECT
plans2.physiotherapy
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS physio_fact_proc,
SUM(ROUND(((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12), 2)) AS ber_day_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days) /
(SUM((SELECT
plans2.berth_days
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS ber_day_fact_proc,
SUM(ROUND(((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS visit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.visit_month) /
(SUM((SELECT
plans2.visit_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as visit_fact_proc,
(ROUND((SUM((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS left_count_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count) /
(SUM((SELECT
plans2.left_count
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS left_count_fact_proc,
(ROUND((SUM((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS left_stat_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_stationary) /
(SUM((SELECT
plans2.left_count_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS left_stat_fact_proc,
(ROUND((SUM((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12)), 2)) AS patient_days_plan_month,
(ROUND(((sum(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.patient_days_stationary) /
(SUM((SELECT
plans2.patient_days_stationary
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) AS patient_days_fact_proc,
SUM(ROUND(((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS stom_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.stomatologist) /
(SUM((SELECT
plans2.stomatologist
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as stom_fact_proc,
SUM(ROUND(((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS left_count_sanit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.left_count_sanitarium) /
(SUM((SELECT
plans2.left_count_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as left_count_sanit_fact_proc,
SUM(ROUND(((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT 1) / 12), 2)) AS berth_days_sanit_plan_month,
(ROUND(((SUM(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.berth_days_sanitarium) /
(SUM((SELECT
plans2.berth_days_sanitarium
FROM
' . $index_page ->db_table_prefix . 'plans` AS plans2
WHERE
(plans2.branch = bran_id) AND (plans2.change_date <= date_rep)
ORDER BY
plans2.change_date DESC
LIMIT
1) / 12))
) * 100), 2)) as berth_days_sanit_fact_proc
FROM
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`
INNER JOIN ' . $index_page ->db_table_prefix . 'branches`
ON ' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = '
. $index_page ->db_table_prefix . 'branches`.id_branch
WHERE
(' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create
>= "' . $index_page -> date_from . ' 00:00:00")
AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.date_create
<= "' . $index_page -> date_to . ' 23:59:59")';
$query = $query
. ' AND (' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch = "'
. $id_branch . '")';
$query = $query
. ' GROUP BY
' . $index_page ->db_table_prefix . 'monitoring_execution_plans_reports`.branch';
//echo $query;
if ($db -> Query($query))
{
$col_row = $db-> RowCount();
if ($col_row > 0)
{
$ReoportShowArray_groth = $db -> RecordsArray();
$index_page -> print_tables_groth($ReoportShowArray_groth);
}
}
$index_page -> print_footer();
$pdf->Output();
?>
вот полный код
5. likvidator - 05 Августа, 2014 - 08:04:59 - перейти к сообщению
![Сори за фтопик Сори за фтопик](./im/emoticons/off.gif)
![Не понял Не понял](./im/emoticons/blink.gif)
6. RickMan - 05 Августа, 2014 - 08:57:27 - перейти к сообщению
Тебе уже второе раз (минимум) говорят о том, что код надо заварачивать в броки. Если ты не можешь осилить этот банальный совет то о чем говорить вообше? А длинные коды вообще в спойлер закидывать надо...
7. Огорчяшка - 05 Августа, 2014 - 09:30:44 - перейти к сообщению
RickMan пишет:
Тебе уже второе раз (минимум) говорят о том, что код надо заварачивать в броки. Если ты не можешь осилить этот банальный совет то о чем говорить вообше? А длинные коды вообще в спойлер закидывать надо...
Исправлено.
С метрикой я разобралась, а вот теперь другая проблемка....FPDF error: Some data has already been output, can't send PDF file