Example #1
0
                        if ($fda_num != 0) {
                            $fda_label = "(FDA pharmacogenomic biomarker)";
                        }
                        $drug_info = $row3['info'];
                        if ($file_code == "example") {
                            $split_drug_s = strpos(str_replace(array("\"", "\\'"), "", $row3['Drug']), "--");
                            //获取drug的长度
                            $drug_name = substr(str_replace(array("\"", "\\'"), "", $row3['Drug']), 0, $split_drug_s);
                        } else {
                            $drug_name = $row3['Drug'];
                        }
                        $drug_name1 = strtolower($drug_name);
                        $drug_name2 = ucfirst($drug_name1);
                        //$pdf->AddPage();
                        $pdf->Bookmark($drug_name2 . $fda_label, 2, 0, '', 'I', array(0, 128, 0));
                        $pdf->writeHTML('<h1>' . $drug_name2 . $fda_label . '</h1>', true, false, true, false, '');
                        $pdf->writeHTML('' . '<br>' . $drug_info . '<br>', true, false, true, false, '');
                        $sql4 = "select * from {$file_code} where System like '%{$tmp_system_name}%' and subSystem like '%{$tmp_subsystem_name}%' and Drug LIKE '%{$tmp_drug_name}%'";
                        $res4 = mysql_query($sql4);
                        $pdf->writeHTML('
<h3>Your genetic data</h3>
<table cellpadding="0" cellspacing="0">
<hr size="590" color="#999999">
 <tr>
  <td width="80" align="center">SNPs ID</td>
  <td width="110" align="center">Evidence level</td>
  <td width="80" align="center">Gene</td>
  <td width="110" align="center">Your genotype</td>
  <td width="70" align="center">Efficacy</td>
  <td width="70" align="center">Dosage</td>
  <td width="70" align="center">Toxicity</td>
Example #2
0
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
// set font
$pdf->SetFont('helvetica', '', 10);
$tmp_system_name = "tmp";
$tmp_subsystem_name = "tmp";
$tmp_drug_name = "tmp";
$sql1 = "select * from example order by System";
$res1 = mysql_query($sql1) or die(mysql_error());
while ($row1 = mysql_fetch_array($res1)) {
    if ($tmp_system_name != $row1['System']) {
        $tmp_system_name = $row1['System'];
        $pdf->AddPage();
        $pdf->Bookmark(ucfirst(strtolower($tmp_system_name)), 0, 0, '', 'B', array(0, 64, 128));
        $pdf->writeHTML('<h1>' . ucfirst(strtolower($tmp_system_name)) . '</h1>', true, false, true, false, '');
        $sql2 = "select * from example where System like '%{$tmp_system_name}%' order by subSystem";
        $res2 = mysql_query($sql2);
        while ($row2 = mysql_fetch_array($res2)) {
            if ($tmp_subsystem_name != $row2['subSystem']) {
                $tmp_subsystem_name1 = $row2['subSystem'];
                if ($row2['subSystem'] == "") {
                    $tmp_subsystem_name1 = "Unclassified";
                }
                //$pdf->AddPage();
                $tmp_subsystem_name = $row2['subSystem'];
                $pdf->Bookmark(ucfirst(strtolower($tmp_subsystem_name1)), 1, 0, '', '', array(128, 0, 0));
                $pdf->writeHTML('<h2>' . ucfirst(strtolower($tmp_subsystem_name1)) . '</h2>', true, false, true, false, '');
                $sql3 = "select * from example where System like '%{$tmp_system_name}%' and subSystem like '%{$tmp_subsystem_name}%' order by Drug";
                $res3 = mysql_query($sql3);
                while ($row3 = mysql_fetch_array($res3)) {