posted_variables(); $prof->idx_profile = $_SESSION['idx_profile']; $prof->load(); $idx_profile = $prof->idx_profile; $table_default_header_type = array( 'WIDTH' => 6, 'T_COLOR' => array(50,50,50), 'T_SIZE' => 7, 'T_FONT' => 'Arial', 'T_ALIGN' => 'C', 'V_ALIGN' => 'T', 'T_TYPE' => 'B', 'LN_SIZE' => 7, 'BG_COLOR' => array(50,50,50), 'BRD_COLOR' => array(230,230,230), 'BRD_SIZE' => 0.1, 'BRD_TYPE' => '1', 'BRD_TYPE_NEW_PAGE' => '', 'TEXT' => '', ); $table_default_data_type = array( 'T_COLOR' => array(0,0,0), 'T_SIZE' => 6, 'T_FONT' => 'Arial', 'T_ALIGN' => 'N', 'V_ALIGN' => 'T', 'T_TYPE' => '', 'LN_SIZE' => 5, 'BG_COLOR' => array(255,255,255), 'BRD_COLOR' => array(180,180,180), 'BRD_SIZE' => 0.1, 'BRD_TYPE' => '1', 'BRD_TYPE_NEW_PAGE' => '', ); $table_default_table_type = array( 'TB_ALIGN' => 'L', 'L_MARGIN' => 5, 'BRD_COLOR' => array(180,180,180), 'BRD_SIZE' => '0.1', ); //set the style $label_t_size = 9; $label_bg_color = array(250,250,250); $label_ln_space = 9; $label_t_color = array(0,0,0); $data_t_size = 8; $data_bg_color = array(255,255,255); $data_ln_space = 8; $data_t_color = array(0,0,0); $border_color = array(180,180,180); $pdf = new FPDF_TABLE(); $pdf->SetAutoPageBreak(true, 20); $pdf->report_title = 'Touch My Heart Profile'; $pdf->report_sub_title = 'Profile Date: ' .date('m/d/Y'); $pdf->AddPage(); $ynow = $pdf->GetY(); $pdf->SetXY(14,$ynow + 13); $pdf->SetFontSize(9); $pdf->Write(10,'Member Name: '); $pdf->SetX(40); $pdf->Write(10,$prof->cpeople->first_name .' ' .$prof->cpeople->last_name); $ynow = $pdf->GetY(); $pdf->SetXY(14,$ynow + 5); $pdf->Write(10,'Gender: '); $pdf->SetX(40); $pdf->Write(10,strtoupper($prof->cpeople->sex)); $ynow = $pdf->GetY(); $pdf->SetXY(14,$ynow + 5); $pdf->Write(10,'Physicians: '); list($s,$r) = $prof->db->doQuery("SELECT * FROM tbl_physician WHERE fdx_profile = $prof->idx_profile AND physician_active = 1 ORDER BY phys_order"); if(!mysql_num_rows($r)){ $pdf->SetX(40); $pdf->Write(10,'No Physicians Specified'); } while($row = mysql_fetch_assoc($r)){ $pdf->SetX(40); $pdf->Write(10,$row['physician_name'] .' - Specialty: ' .$row['specialty']); $ynow = $pdf->GetY(); $pdf->SetXY(40,$ynow + 5); } $pdf->SetXY(14,$ynow + 5); $pdf->Write(10,'Medications: '); list($s,$r) = $prof->db->doQuery("SELECT * FROM tbl_medication WHERE fdx_profile = $prof->idx_profile AND medication_active = 1 ORDER BY medication_order"); if(!mysql_num_rows($r)){ $pdf->SetX(40); $pdf->Write(10,'No Medications Specified'); } while($row = mysql_fetch_assoc($r)){ $pdf->SetX(40); $pdf->Write(10,$row['medication_name'] .' ' .$row['doseage'] .' ' .$row['frequency']); $ynow = $pdf->GetY(); $pdf->SetXY(40,$ynow + 5); } $pdf->SetXY(14,$ynow + 5); $pdf->Write(10,'Allergies: '); list($s,$r) = $prof->db->doQuery("SELECT * FROM tbl_allergy WHERE fdx_profile = $prof->idx_profile AND allergy_active = 1 ORDER BY allergy_order"); if(!mysql_num_rows($r)){ $pdf->SetX(40); $pdf->Write(10,'No Allergies Specified'); } while($row = mysql_fetch_assoc($r)){ $pdf->SetX(40); $pdf->Write(10,$row['allergy_name']); $ynow = $pdf->GetY(); $pdf->SetXY(40,$ynow + 5); } $ynow = $pdf->GetY(); $pdf->SetXY(14,$ynow + 13); $columns = 1; $pdf->Table_Init($columns, true, false); $table_subtype = $table_default_table_type; $pdf->Set_Table_Type($table_subtype); $data_subtype = $table_default_data_type; $data_type = Array();//reset the array for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype; $pdf->Set_Data_Type($data_type); $j = 0; $subhead = array($pdf->report_title => 172); foreach($subhead as $k=>$v){ $header_type["$j"]['TEXT'] = $k; $header_type["$j"]['WIDTH'] = $v; $header_type["$j"]['LN_SIZE'] = 6; $header_type["$j"]['T_TYPE'] = 'b'; $header_type["$j"]['T_SIZE'] = 8; $header_type["$j"]['COLSPAN'] = 1; $header_type["$j"]['BG_COLOR'] = array(245,245,245); $header_type["$j"]['T_COLOR'] = array(25,25,25); $header_type["$j"]['T_ALIGN'] = "L"; $header_type["$j"]['V_ALIGN'] = "M"; $header_type["$j"]['LN_SPACE'] = $label_ln_space; $header_type["$j"]['BRD_COLOR'] = array(155,155,155); $header_type["$j"]['BRD_SIZE'] = '.1'; $header_type["$j"]['BRD_TYPE'] = '1'; $j++; } $pdf->Set_Header_Type($header_type); $pdf->Draw_Header(); $columns = 3; $pdf->Table_Init($columns, true, false); $table_subtype = $table_default_table_type; $pdf->Set_Table_Type($table_subtype); $data_subtype = $table_default_data_type; $data_type = Array();//reset the array for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype; $pdf->Set_Data_Type($data_type); $j = 0; $subhead = array("Pillar"=>32, "Plan"=>110, "Partners/Resources"=>42 ); foreach($subhead as $k=>$v){ $header_type["$j"]['TEXT'] = $k; $header_type["$j"]['WIDTH'] = $v; $header_type["$j"]['LN_SIZE'] = 6; $header_type["$j"]['T_TYPE'] = ''; $header_type["$j"]['T_SIZE'] = 9; $header_type["$j"]['COLSPAN'] = 1; $header_type["$j"]['BG_COLOR'] = array(120,120,120); $header_type["$j"]['T_COLOR'] = array(245,245,245); $header_type["$j"]['T_ALIGN'] = "L"; $header_type["$j"]['V_ALIGN'] = "M"; $header_type["$j"]['LN_SPACE'] = $label_ln_space; $header_type["$j"]['BRD_COLOR'] = array(155,155,155); $header_type["$j"]['BRD_SIZE'] = '.1'; $header_type["$j"]['BRD_TYPE'] = '1'; $j++; } $pdf->Set_Header_Type($header_type); $pdf->Draw_Header(); list($s,$r) = $prof->db->doQuery("SELECT * FROM tbl_category ORDER BY idx_category"); while($row = mysql_fetch_assoc($r)){ unset($part_cat,$journal); list($s,$r2) = $prof->db->doQuery("SELECT * FROM tbl_profile_cat_partner JOIN tbl_partner ON tbl_profile_cat_partner.fdx_partner = idx_partner WHERE tbl_profile_cat_partner.fdx_category = " .$row['idx_category'] ." AND tbl_profile_cat_partner.fdx_profile = $idx_profile ORDER BY partner_name"); while($row2 = mysql_fetch_assoc($r2)){ $part_cat .= $row2['partner_name'] ."\n"; } list($s,$r2) = $prof->db->doQuery("SELECT * FROM tbl_cat_journal WHERE fdx_category = " .$row['idx_category'] ." AND fdx_profile = $idx_profile AND cat_journal_active = 1 ORDER BY EntryDate DESC LIMIT 3"); while($row2 = mysql_fetch_assoc($r2)){ $journal .= $row2['journal'] ."\n"; } $col_arr = array(0 => array(1,32), 1 => array(1,110), 2 => array(1,42)); $vals = array($row['category_name'], $journal, $part_cat); $pdf_row = $prof->create_row_array('data',1,$col_arr,$vals); $pdf->Draw_Data($pdf_row); } $columns = 3; $pdf->setY($pdf->getY() + 15); $pdf->Table_Init($columns, true, false); $table_subtype = $table_default_table_type; $pdf->Set_Table_Type($table_subtype); $data_subtype = $table_default_data_type; $data_type = Array();//reset the array for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype; $pdf->Set_Data_Type($data_type); $j = 0; $subhead = array("Event Date"=>30, "Event Name"=>60, "Description"=>90 ); foreach($subhead as $k=>$v){ $header_type["$j"]['TEXT'] = $k; $header_type["$j"]['WIDTH'] = $v; $header_type["$j"]['LN_SIZE'] = 6; $header_type["$j"]['T_TYPE'] = ''; $header_type["$j"]['T_SIZE'] = 9; $header_type["$j"]['COLSPAN'] = 1; $header_type["$j"]['BG_COLOR'] = array(120,120,120); $header_type["$j"]['T_COLOR'] = array(245,245,245); $header_type["$j"]['T_ALIGN'] = "L"; $header_type["$j"]['V_ALIGN'] = "M"; $header_type["$j"]['LN_SPACE'] = $label_ln_space; $header_type["$j"]['BRD_COLOR'] = array(155,155,155); $header_type["$j"]['BRD_SIZE'] = '.1'; $header_type["$j"]['BRD_TYPE'] = '1'; $j++; } $pdf->Set_Header_Type($header_type); $pdf->Draw_Header(); list($s,$r) = $prof->db->doQuery("SELECT * FROM tbl_event_profile JOIN tbl_event ON fdx_event = idx_event WHERE fdx_profile = " .$_SESSION['idx_profile'] ." ORDER BY event_date DESC"); while($row = mysql_fetch_assoc($r)){ $col_arr = array(0 => array(1,30), 1 => array(1,60), 2 => array(1,90)); $vals = array(date('F jS, g:i a',$row['event_date']), $row['event_name'], $row['event_desc']); $pdf_row = $prof->create_row_array('data',1,$col_arr,$vals); $pdf->Draw_Data($pdf_row); } $pdf->Output(); ?>