Example #1
0
    if ($encounter['encounter_class_nr'] == 1) {
        $data[] = array(ar2uni($current_ward_name), ar2uni("{$LDWard} :"));
    } else {
        $data[] = array(ar2uni($current_dept_name), ar2uni("{$LDDepartment} :"));
    }
    $data[] = array('');
    $data[] = array(ar2uni($encounter['referrer_diagnosis']), ar2uni("{$LDDiagnosis} :"));
    $data[] = array(ar2uni($encounter['referrer_dr']), ar2uni("{$LDRecBy} :"));
    $data[] = array(ar2uni($encounter['referrer_recom_therapy']), ar2uni("{$LDTherapy} :"));
    $data[] = array(ar2uni($encounter['referrer_notes']), ar2uni("{$LDSpecials} :"));
    $data[] = array('');
    $data[] = array(ar2uni($insclass), ar2uni("{$LDBillType} :"));
    $data[] = array($encounter['insurance_nr'], ar2uni("{$LDInsuranceNr} :"));
    $data[] = array(ar2uni($insurance_obj->getFirmName($encounter['insurance_firm_id'])), ar2uni("{$LDInsuranceCo} :"));
    $data[] = array('');
    $data[] = array(ar2uni($encounter['create_id']), ar2uni("{$LDAdmitBy} :"));
    $pdf->ezTable($data, '', '', array('xPos' => 'right', 'xOrientation' => 'left', 'showLines' => 0, 'fontSize' => $report_textsize, 'showHeadings' => 0, 'shaded' => 0, 'cols' => array(0 => array('justification' => 'right'))));
} else {
    # Load the page header #1
    require '../std_plates/pageheader1.php';
    # Load the patient data plate #1
    require '../std_plates/patientdata1.php';
    $data = NULL;
    # make empty line
    //$y=$pdf->ezText("\n",14);
    //$data[]=array($LDPatientData);
    //$pdf->ezTable($data,'','',array('xPos'=>'left','xOrientation'=>'right','showLines'=>0,'fontSize'=>$report_titlesize,'showHeadings'=>0,'shaded'=>2,'shadeCol2'=>array(0.9,0.9,0.9),'width'=>555));
    # make empty line
    $y = $pdf->ezText("\n", 14);
    $sql = "SELECT cep.prescribe_date,cep.article,cep.dosage,cep.times_per_day,cep.days,cep.total_dosage,cep.prescriber FROM care_encounter_prescription AS cep INNER JOIN care_encounter AS ce ON ce.encounter_nr=cep.encounter_nr INNER JOIN care_tz_drugsandservices AS pricelist ON pricelist.item_id=cep.article_item_number WHERE ce.pid='" . $encounter['pid'] . "' AND pricelist.purchasing_class like 'drug_list%'";
    //echo $sql;
Example #2
0
} else {
    ImageString($im, 2, 10, 2, $LDPrintPortraitFormat, $black);
    ImageString($im, 2, 10, 15, $LDClickImgToPrint, $black);
}
# Create the name label
$namelabel = ImageCreate(145, 40);
$nm_white = ImageColorAllocate($namelabel, 255, 255, 255);
//white bkgrnd
$nm_black = ImageColorAllocate($namelabel, 0, 0, 0);
$lmargin = 1;
# Left margin
$tmargin = 11;
# Top margin
$dataline1 = ar2uni($result['name_last']) . ', ' . ar2uni($result['name_first']);
$dataline2 = $result['date_birth'];
$dataline3 = $result['current_ward'] . ' ' . $result['current_dept'] . ' ' . ar2uni($result['insurance_co_id']) . ' ' . ar2uni($result['insurance_2_co_id']);
//$ttf_ok=0;
if ($ttf_ok) {
    ImageTTFText($namelabel, 11, 0, $lmargin, $tmargin, $nm_black, $arial, $dataline1);
    ImageTTFText($namelabel, 10, 0, $lmargin, $tmargin + 13, $nm_black, $arial, $dataline2);
    ImageTTFText($namelabel, 10, 0, $lmargin, $tmargin + 26, $nm_black, $arial, $dataline3);
} else {
    ImageString($namelabel, 2, 1, 2, $dataline1, $nm_black);
    ImageString($namelabel, 2, 1, 15, $dataline2, $nm_black);
    ImageString($namelabel, 2, 1, 28, $dataline3, $nm_black);
}
//-------------- place the wristbands
$topm = $topmargin;
ImageCopy($im, $wb_lrg, $leftmargin, $topm, 0, 0, $size_lrg[0], $size_lrg[1]);
$topm += $yoffset;
ImageCopy($im, $wb_med, $leftmargin, $topm, 0, 0, $size_med[0], $size_med[1]);
# Family name, first name
ImageTTFText($label, 16, 0, $lmargin, $tmargin + 56, $eblack, $arial, ar2uni($result['name_last']) . ', ' . ar2uni($result['name_first']));
# Date of birth
ImageTTFText($label, 11, 0, $lmargin, $tmargin + 74, $eblack, $arial, $result['date_birth']);
# Address street nr, street name
ImageTTFText($label, 11, 0, $lmargin, $tmargin + 93, $eblack, $arial, ucfirst(ar2uni($result['addr_str'])) . ' ' . $result['addr_str_nr']);
# Address, zip, city/town name
ImageTTFText($label, 11, 0, $lmargin, $tmargin + 108, $eblack, $arial, ucfirst(ar2uni($result['addr_zip'])) . ' ' . ar2uni($result['name']));
# Sex
ImageTTFText($label, 14, 0, $lmargin, $tmargin + 130, $eblack, $arial, strtoupper($result['sex']));
# Family name, repeat print
ImageTTFText($label, 14, 0, $lmargin + 30, $tmargin + 130, $eblack, $arial, ar2uni($result['name_last']));
# Insurance co name
ImageTTFText($label, 14, 0, $lmargin, $tmargin + 150, $eblack, $arial, $ins_obj->getFirmName($result['insurance_firm_id']));
# Location
ImageTTFText($label, 9, 0, $lmargin, $tmargin + 170, $eblack, $arial, ar2uni($locstr));
#Blood group
if (stristr('AB', $result['blood_group'])) {
    ImageTTFText($label, 24, 0, $lmargin + 240, $tmargin + 127, $eblack, $arial, $result['blood_group']);
} else {
    ImageTTFText($label, 24, 0, $lmargin + 245, $tmargin + 127, $eblack, $arial, $result['blood_group']);
}
// place the barcode img
if ($bc) {
    ImageCopy($label, $bc, 110, 4, 9, 9, 170, 37);
}
if (!$child_img) {
    Imagepng($label);
    // *******************************************************************
    // * comment the following one line if you want to deactivate caching of
    // * the barcode label image
Example #4
0
    if (!$GLOBAL_CONFIG['person_citizenship_hide'] && $person['citizenship']) {
        $data[] = array(ar2uni($person['citizenship']), ar2uni("{$LDCitizenship} :"));
    }
    if (!$GLOBAL_CONFIG['person_sss_nr_hide'] && $person['sss_nr']) {
        $data[] = array($person['sss_nr'], ar2uni("{$LDSSSNr} :"));
    }
    if (!$GLOBAL_CONFIG['person_nat_id_nr_hide'] && $person['nat_id_nr']) {
        $data[] = array($person['nat_id_nr'], ar2uni("{$LDNatIdNr} :"));
    }
    if (!$GLOBAL_CONFIG['person_religion_hide'] && $person['religion']) {
        $data[] = array(ar2uni($person['religion']), ar2uni("{$LDReligion} :"));
    }
    if (!$GLOBAL_CONFIG['person_ethnic_orig_hide'] && $person['ethnic_orig']) {
        $data[] = array(ar2uni($person['ethnic_orig']), ar2uni("{$LDEthnicOrigin} :"));
    }
    $data[] = array(ar2uni($person['create_id']), ar2uni("{$LDAdmitBy} :"));
    $pdf->ezTable($data, '', '', array('xPos' => 'right', 'xOrientation' => 'left', 'showLines' => 0, 'fontSize' => $report_textsize, 'showHeadings' => 0, 'shaded' => 0, 'cols' => array(0 => array('justification' => 'right'))));
} else {
    # Load the page header #1
    require '../std_plates/pageheader1.php';
    # Load the patient data plate #1
    require '../std_plates/persondata1.php';
    $data = NULL;
    # make empty line
    //$y=$pdf->ezText("\n",14);
    $data[] = array($LDPatientRegister);
    $pdf->ezTable($data, '', '', array('xPos' => 'left', 'xOrientation' => 'right', 'showLines' => 0, 'fontSize' => $report_titlesize, 'showHeadings' => 0, 'shaded' => 2, 'shadeCol2' => array(0.9, 0.9, 0.9), 'width' => 555));
    # make empty line
    $y = $pdf->ezText("\n", 14);
    # reset
    $data = NULL;
Example #5
0
        $notestype = $enc_obj->getType($type_nr);
        $title = ar2uni($notestype['name']);
    }
    $data[] = array($title);
    $pdf->ezTable($data, '', '', array('xPos' => 'left', 'xOrientation' => 'right', 'showLines' => 0, 'fontSize' => $report_titlesize, 'showHeadings' => 0, 'shaded' => 2, 'shadeCol2' => array(0.9, 0.9, 0.9), 'width' => 555, 'cols' => array(0 => array('justification' => 'right'))));
    if (is_object($notes)) {
        $report = $notes->FetchRow();
        //$y=$pdf->ezText("\n". ar2uni($LDBy).": ".ar2uni($report['personell_name'])."   ". ar2uni($LDDate).": ".formatDate2Local($report['date'],$date_format)."   ".ar2uni($LDTime).": ".$report['time'],$report_authorsize);
        $data = NULL;
        $data[] = array("\n" . ar2uni($LDBy) . ": " . ar2uni($report['personell_name']) . "   " . ar2uni($LDDate) . ": " . formatDate2Local($report['date'], $date_format) . "   " . ar2uni($LDTime) . ": " . $report['time'], '');
        $data[] = array(ar2uni($report['notes']), ar2uni(" {$LDNotes}:"));
        if (!empty($report['short_notes'])) {
            $data[] = array(ar2uni($report['short_notes']), ar2uni(" {$LDShortNotes}:"));
        }
        if (!empty($report['aux_notes'])) {
            $data[] = array(ar2uni($report['aux_notes']), ar2uni(" {$LDShortNotes}:"));
        }
        $pdf->ezTable($data, '', '', array('xPos' => 'right', 'xOrientation' => 'left', 'showLines' => 0, 'fontSize' => $report_textsize, 'showHeadings' => 0, 'shaded' => 0, 'cols' => array(0 => array('justification' => 'right'))));
    }
} else {
    # Load the page header #1
    require '../std_plates/pageheader1.php';
    # Load the patient data plate #1
    require '../std_plates/patientdata1.php';
    $data = NULL;
    # make empty line
    $y = $pdf->ezText("\n", 14);
    #Get the report title
    if (isset(${$LD_var}) && !empty(${$LD_var})) {
        $title = ${$LD_var};
    } else {
Example #6
0
ImageTTFText($label2, 11, 0, 10, 75, $black, $arial, ar2uni($result['name_first']));
ImageTTFText($label2, 11, 0, 10, 95, $black, $arial, strtoupper($result['sex']));
ImageTTFText($label2, 10, 0, 50, 95, $black, $arial, formatDate2Local($result['date_birth'], $date_format));
ImageTTFText($label2, 10, 0, 10, 109, $black, $arial, $ins_obj->getFirmName($result['insurance_firm_id']));
ImageTTFText($label2, 9, 0, 10, 124, $black, $arial, ar2uni($locstr));
# ----- create smaller label without barcode
$label3 = ImageCreate(173, 133);
$e3white = ImageColorAllocate($label3, 255, 255, 255);
# white bkgrnd
$black = ImageColorAllocate($label3, 0, 0, 0);
$addr1 = ar2uni($result['addr_str']) . ' ' . $result['addr_str_nr'];
$addr2 = ar2uni($result['addr_zip']) . ' - ' . ar2uni($result['name']);
ImageTTFText($label3, 10, 0, 10, 11, $black, $arial, $full_en);
ImageTTFText($label3, 9, 0, 110, 11, $black, $arial, formatDate2Local($result['encounter_date'], $date_format));
ImageTTFText($label3, 12, 0, 10, 34, $black, $arial, ar2uni($result['name_last']) . '');
ImageTTFText($label3, 12, 0, 10, 49, $black, $arial, ar2uni($result['name_first']));
ImageTTFText($label3, 10, 0, 10, 64, $black, $arial, formatDate2Local($result['date_birth'], $date_format));
ImageTTFText($label3, 10, 0, 10, 84, $black, $arial, $addr1);
ImageTTFText($label3, 10, 0, 10, 99, $black, $arial, $addr2);
//-------------- place 6 labels
for ($i = 0, $wi = 359; $i < 4; $i++, $wi += 179) {
    ImageCopy($im, $label, 1, $wi, 0, 0, 282, 178);
    ImageCopy($im, $label, 285, $wi, 0, 0, 282, 178);
    if (defined('DRAW_BORDER') && DRAW_BORDER) {
        ImageLine($im, 0, $wi, 569, $wi, $blue);
    }
}
// ---  place the smaller labels
for ($i = 0, $j = 1; $i < 1080; $i += 135, $j++) {
    if ($j > 4) {
        ImageCopy($im, $label2, 570, $i + 5, 0, 0, 173, 133);
Example #7
0
}
# ----- create smaller label without barcode
$label3 = ImageCreate(173, 133);
$e3white = ImageColorAllocate($label3, 255, 255, 255);
# white bkgrnd
$black = ImageColorAllocate($label3, 0, 0, 0);
$addr1 = $result['addr_str'] . ' ' . $result['addr_str_nr'];
$addr2 = $result['addr_zip'] . ' - ' . $result['name'];
if ($ttf_ok) {
    ImageTTFText($label3, 12, 0, 10, 11, $black, $arial, $full_en);
    ImageTTFText($label3, 9, 0, 110, 11, $black, $arial, formatDate2Local($result['encounter_date'], $date_format));
    ImageTTFText($label3, 12, 0, 10, 34, $black, $arial, ar2uni($result['name_last']) . ',');
    ImageTTFText($label3, 12, 0, 10, 49, $black, $arial, ar2uni($result['name_first']));
    ImageTTFText($label3, 10, 0, 10, 64, $black, $arial, formatDate2Local($result['date_birth'], $date_format));
    ImageTTFText($label3, 10, 0, 10, 84, $black, $arial, ar2uni($addr1));
    ImageTTFText($label3, 10, 0, 10, 99, $black, $arial, ar2uni($addr2));
} else {
    ImageString($label3, 4, 10, 2, $full_en, $black);
    ImageString($label3, 2, 110, 2, formatDate2Local($result['encounter_date'], $date_format), $black);
    ImageString($label3, 4, 10, 25, $result['name_last'] . ',', $black);
    ImageString($label3, 4, 10, 40, $result['name_first'], $black);
    ImageString($label3, 2, 10, 55, formatDate2Local($result['date_birth'], $date_format), $black);
    ImageString($label3, 2, 10, 75, $addr1, $black);
    ImageString($label3, 2, 10, 90, $addr2, $black);
}
//-------------- place 6 labels
for ($i = 0, $wi = 359; $i < 4; $i++, $wi += 179) {
    ImageCopy($im, $label, 1, $wi, 0, 0, 282, 178);
    ImageCopy($im, $label, 285, $wi, 0, 0, 282, 178);
    if (defined('DRAW_BORDER') && DRAW_BORDER) {
        ImageLine($im, 0, $wi, 569, $wi, $blue);
Example #8
0
    $str_print = $LDFillByLab;
} else {
    $str_print = $LDFillByWard;
}
require_once $root_path . 'include/inc_ttf_check.php';
if ($ttf_render) {
    //ImageColorTransparent($im,$green);
    // *******************************************************************
    // * the following code is for ttf fonts use only for php machines with ttf support
    // *******************************************************************
    /*
    /* -------------- START ----------------------------------------------*/
    if ($lang == 'ar' || $lang == 'fa') {
        // Modified on ( 22/01/2004) By Walid Fathalla
        include_once $root_path . 'include/inc_ttf_ar2uni.php';
        //To actvate function of show arabic
        ImageTTFText($im, 14, 90, 16, 390, $black, $arial, ar2uni($str_print));
    } else {
        ImageTTFText($im, 14, 90, 16, 390, $black, $arial, $str_print);
    }
    /* -------------- END -------------------------------------------------*/
    // ******************************************************************
    // * the following code is the default - uses system fonts
    // ******************************************************************
} else {
    /* -------------- START  ----------------------*/
    ImageStringUp($im, 5, 2, 390, $str_print, $black);
    /* -------------- END --------------------------*/
}
Imagepng($im);
ImageDestroy($im);
Example #9
0
<?php

/*
*  Modification for arabic version
* Walid Fathalla (Tripoli, Libya) <*****@*****.**>
* 2004 June
*/
include_once $root_path . 'include/inc_t1ps_ar2uni.php';
if (preg_match('/pageheader1ar.php/i', $_SERVER['PHP_SELF'])) {
    die('<meta http-equiv="refresh" content="0; url=../../../">');
}
#Get care logo
$imgsize = GetImageSize($arlogo);
$pdf->addPngFromFile($arlogo, 420, 780, $imgsize[0]);
# Attach logo
$pdf->selectFont($fontpath . 'TRIPOLI_.afm');
$pdf->ezStartPageNumbers(550, 25, 8);
# Get the main informations
if (!isset($GLOBAL_CONFIG)) {
    $GLOBAL_CONFIG = array();
}
include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$glob =& new GlobalConfig($GLOBAL_CONFIG);
# Get all config items starting with "main_"
$glob->getConfig('main_%');
$addr[] = array(ar2uni($GLOBAL_CONFIG['main_info_address']), $GLOBAL_CONFIG['main_info_phone'] . "\n" . $GLOBAL_CONFIG['main_info_fax'] . "\n" . $GLOBAL_CONFIG['main_info_email'] . "\n", ar2uni("{$LDEmail} :\n{$LDFax} :\n{$LDPhone} :"));
$pdf->ezTable($addr, '', '', array('xPos' => 25, 'xOrientation' => 'right', 'showLines' => 0, 'showHeadings' => 0, 'shaded' => 0, 'fontsize' => 6, 'cols' => array(1 => array('justification' => 'right'))));
Example #10
0
* Walid Fathalla (Tripoli, Libya) <*****@*****.**>
* 2004 June
*/
include_once $root_path . 'include/inc_t1ps_ar2uni.php';
$pataddress = $encounter['addr_str'] . " " . $encounter['addr_str_nr'] . "\n" . $encounter['addr_zip'] . " " . $encounter['citytown_name'];
//$pdf->Line(20,750,550,750);
$pdf->ezText("\n", 6);
$data[] = array(ar2uni($pataddress), ar2uni("{$LDAddress} :"), '    ', ar2uni($encounter['name_first']) . "\n" . ar2uni($encounter['name_last']) . "\n" . formatDate2Local($encounter['date_birth'], $date_format) . "\n\n" . $encounter['pid'], ar2uni("{$LDRegistryNr} :\n\n{$LDBday} :\n{$LDLastName} :\n{$LDFirstName} :"));
$pdf->ezTable($data, '', '', array('xPos' => 'right', 'xOrientation' => 'left', 'showLines' => 0, 'fontSize' => 12, 'showHeadings' => 0, 'shaded' => 0, 'cols' => array(0 => array('justification' => 'right'))));
# Add the PID barcode
if (file_exists($pidbarcode)) {
    $imgsize = GetImageSize($pidbarcode);
    $pdf->addPngFromFile($pidbarcode, 400, 650, $imgsize[0], 25);
}
$y = $pdf->ezText("\n", 20);
$pdf->addText(490, $y, 14, ar2uni("{$LDEncounterNr}:"));
//280
$pdf->addText(400, $y, 14, $enc);
//280
# Add the encounter barcode
if (file_exists($encbarcode)) {
    $imgsize = GetImageSize($encbarcode);
    $pdf->addPngFromFile($encbarcode, 200, 600, $imgsize[0], 50);
    //400
}
$pdf->setStrokeColor(0, 0, 0);
$pdf->setLineStyle(2);
$pdf->rectangle(20, 650, 555, 110);
# Add the person id picture
if (file_exists($idpic)) {
    //$imgsize=GetImageSize($idpic);
    # Encounter admission date
    ImageTTFText($label, 11, 0, $lmargin, $tmargin + 30, $eblack, $arial, $result['pdate']);
    # Family name, first name
    ImageTTFText($label, 16, 0, $lmargin, $tmargin + 56, $eblack, $arial, ar2uni($result['name_last']) . ', ' . ar2uni($result['name_first']));
    # Date of birth
    ImageTTFText($label, 11, 0, $lmargin, $tmargin + 74, $eblack, $arial, $result['date_birth']);
    # Address street nr, street name
    ImageTTFText($label, 11, 0, $lmargin, $tmargin + 93, $eblack, $arial, ar2uni(ucfirst($result['addr_str'])) . ' ' . ar2uni($result['addr_str_nr']));
    # Address, zip, city/town name
    ImageTTFText($label, 11, 0, $lmargin, $tmargin + 108, $eblack, $arial, ar2uni(ucfirst($result['addr_zip'])) . ' ' . ar2uni($result['citytown_name']));
    # Sex
    ImageTTFText($label, 14, 0, $lmargin, $tmargin + 130, $eblack, $arial, strtoupper($result['sex']));
    # Family name, repeat print
    ImageTTFText($label, 14, 0, $lmargin + 30, $tmargin + 130, $eblack, $arial, ar2uni($result['name_last']));
    # Insurance co name
    ImageTTFText($label, 14, 0, $lmargin, $tmargin + 150, $eblack, $arial, ar2uni($ins_obj->getFirmName($result['insurance_firm_id'])));
    # Location
    ImageTTFText($label, 9, 0, $lmargin, $tmargin + 170, $eblack, $arial, $locstr);
    #Blood group
    if (stristr('AB', $result['blood_group'])) {
        ImageTTFText($label, 24, 0, $lmargin + 240, $tmargin + 127, $eblack, $arial, $result['blood_group']);
    } else {
        ImageTTFText($label, 24, 0, $lmargin + 245, $tmargin + 127, $eblack, $arial, $result['blood_group']);
    }
} else {
    # Use system fonts
    #  Full encounter nr
    ImageString($label, 4, 2, 2, $fen, $eblack);
    # Encounter admission date
    ImageString($label, 2, 2, 18, $result['pdate'], $eblack);
    # Family name, first name
Example #12
0
<?php

include_once $root_path . 'include/inc_t1ps_ar2uni.php';
$pataddress = $encounter['addr_str'] . " " . $encounter['addr_str_nr'] . "\n" . $encounter['addr_zip'] . " " . $person_obj->CityTownName($encounter['addr_citytown_nr']);
//$pdf->Line(20,750,550,750);
$pdf->ezText("\n", 6);
$data[] = array(ar2uni($pataddress), ar2uni("{$LDAddress} :"), '    ', ar2uni($encounter['name_first']) . "\n" . ar2uni($encounter['name_last']) . "\n" . formatDate2Local($encounter['date_birth'], $date_format) . "\n\n" . $encounter['pid'], ar2uni("{$LDRegistryNr} :\n\n{$LDBday} :\n{$LDLastName} :\n{$LDFirstName} :"));
$pdf->ezTable($data, '', '', array('xPos' => 'right', 'xOrientation' => 'left', 'showLines' => 0, 'fontSize' => 12, 'showHeadings' => 0, 'shaded' => 0, 'cols' => array(0 => array('justification' => 'right'))));
# Add the PID barcode
if (file_exists($pidbarcode)) {
    $imgsize = GetImageSize($pidbarcode);
    $pdf->addPngFromFile($pidbarcode, 400, 650, $imgsize[0], 25);
}
$y = $pdf->ezText("\n", 18);
# Add the person id picture
if (file_exists($idpic)) {
    //$imgsize=GetImageSize($idpic);
    $pdf->addJpegFromFile($idpic, 40, 655, 70);
}
$pdf->setStrokeColor(0, 0, 0);
$pdf->setLineStyle(2);
$pdf->rectangle(20, 650, 555, 110);
$lmargin = 10;
# Left margin
$tmargin = 2;
# Top margin
ImageTTFText($im, 12, 0, $lmargin + 850, $tmargin + 10, $black, $arial, ar2uni($LDPrintPortraitFormat));
ImageTTFText($im, 12, 0, $lmargin + 920, $tmargin + 25, $black, $arial, ar2uni($LDClickImgToPrint));
# Create the name label
$namelabel = ImageCreate(145, 40);
$nm_white = ImageColorAllocate($namelabel, 255, 255, 255);
//white bkgrnd
$nm_black = ImageColorAllocate($namelabel, 0, 0, 0);
$lmargin = 1;
# Left margin
$tmargin = 11;
# Top margin
$dataline1 = ar2uni($result['name_last']) . ', ' . ar2uni($result['name_first']);
$dataline2 = $result['date_birth'];
$dataline3 = '1234567890' . $result['current_ward'] . ' ' . $result['current_dept'] . ' ' . $result['insurance_co_id'] . ' ' . $result['insurance_2_co_id'];
//$ttf_ok=0;
ImageTTFText($namelabel, 11, 0, $lmargin, $tmargin, $nm_black, $arial, $dataline1);
ImageTTFText($namelabel, 10, 0, $lmargin, $tmargin + 13, $nm_black, $arial, $dataline2);
ImageTTFText($namelabel, 10, 0, $lmargin, $tmargin + 26, $nm_black, $arial, $dataline3);
//-------------- place the wristbands
$topm = $topmargin;
ImageCopy($im, $wb_lrg, $leftmargin, $topm, 0, 0, $size_lrg[0], $size_lrg[1]);
$topm += $yoffset;
ImageCopy($im, $wb_med, $leftmargin, $topm, 0, 0, $size_med[0], $size_med[1]);
$topm += $yoffset;
ImageCopy($im, $wb_sml, $leftmargin, $topm, 0, 0, $size_sml[0], $size_sml[1]);
$topm += $yoffset;
ImageCopy($im, $wb_bby, $leftmargin, $topm, 0, 0, $size_bby[0], $size_bby[1]);