My question is how to call some DB information to the print page of a PHP system, developed in Codeigniter .
In the users DB "doctor", I have the following tables:
doctor_id
, name
, email
, password
, address
, phone
, department_id
, profile
The code below, calls the name of the doctor, as well as other information from another table, from the patient, to the print page. But, I would like to know how to include, in the same line as the doctor's name, the information of "profile" and "address"?
<?php
$edit_data = $this->db->get_where('prescription', array('prescription_id' => $param2))->result_array();
foreach ($edit_data as $row):
$patient_info = $this->db->get_where('patient' , array('patient_id' => $row['patient_id'] ))->result_array();
?>
<div id="prescription_print">
<div><b><?php $name = $this->db->get_where('doctor' , array('doctor_id' => $row['doctor_id'] ))->row()->name;
echo 'Drº '.$name;?> </b></div>
<br>
<br>
<br>
<?php foreach ($patient_info as $row2){ ?>
<?php echo 'Nome do Paciente: '.$row2['name']; ?><br>
<br>
<br>
<b><?php echo get_phrase('medication'); ?> :</b>
<p><?php echo $row['medication']; ?></p>
<br>
<br>
<?php } ?>
<?php echo 'Data: '.date("d M, Y", $row['timestamp']); ?>
<br>
</b>
</div>
</div>
<br>
<a onClick="PrintElem('#prescription_print')" class="btn btn-primary btn-icon icon-left hidden-print">
Imprimir Prescrição
<i class="entypo-doc-text"></i>
</a>
<?php endforeach; ?>