Highway to PSR2
[openemr.git] / interface / patient_file / summary / patient_picture.php
blob8c70b3d1720ef8c8694573d27ce5e05e1065bbce
1 <?php
5 require_once("../../globals.php");
6 function pic_array()
8 $picture_directory = "Patient Photograph"; //change this if you want
9 $pics = array();
10 $sql_query = "select documents.id from documents join categories_to_documents on documents.id = categories_to_documents.document_id join categories on categories.id = categories_to_documents.category_id where categories.name like ? and documents.foreign_id = ?";
11 if ($query = sqlStatement($sql_query, array($picture_directory, $_SESSION['pid']))) {
12 while ($results = sqlFetchArray($query)) {
13 $tmp = $results['id'];
14 if (isset($tmp)) {
15 array_push($pics, "<div name='Patient Photograph' class='patient_pic'><img src='".$GLOBALS['webroot']."/controller.php?document&retrieve&patient_id=".htmlspecialchars($_SESSION['pid'], ENT_QUOTES)."&document_id=".htmlspecialchars($tmp, ENT_QUOTES)."&as_file=false' alt='Patient Photograph'></div>\n");
20 return $pics;