Revision: 6477
          http://care2002.svn.sourceforge.net/care2002/?rev=6477&view=rev
Author:   mizuko
Date:     2010-06-30 12:03:11 +0000 (Wed, 30 Jun 2010)

Log Message:
-----------
see #54

Added Paths:
-----------
    care2x/branches/gettext/modules/photolab/photos-index.php
    care2x/branches/gettext/modules/photolab/photos-preview.php
    care2x/branches/gettext/modules/photolab/photos-start.php
    care2x/branches/gettext/modules/photolab/uploadphoto.php

Removed Paths:
-------------
    care2x/branches/gettext/modules/photolab/fotos-index.php
    care2x/branches/gettext/modules/photolab/fotos-preview.php
    care2x/branches/gettext/modules/photolab/fotos-start.php
    care2x/branches/gettext/modules/photolab/uploadfoto.php

Deleted: care2x/branches/gettext/modules/photolab/fotos-index.php
===================================================================
--- care2x/branches/gettext/modules/photolab/fotos-index.php    2010-06-30 
12:00:28 UTC (rev 6476)
+++ care2x/branches/gettext/modules/photolab/fotos-index.php    2010-06-30 
12:03:11 UTC (rev 6477)
@@ -1,200 +0,0 @@
-<?php
-error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
-require('./roots.php');
-require($root_path.'include/helpers/inc_environment_global.php');
-/**
-* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
-* GNU General Public License
-* Copyright 2002,2003,2004,2005 Elpidio Latorilla
-* elpi...@care2x.org, 
-*
-* See the file "copy_notice.txt" for the licence notice
-*/
-define('LANG_FILE','nursing.php');
-define('NO_2LEVEL_CHK',1);
-require_once($root_path.'include/helpers/inc_front_chain_lang.php');
-
-$breakfile=$root_path."modules/nursing/nursing-ward-patientdata.php".URL_REDIRECT_APPEND."&edit=$edit&station=$station&pn=$pn";
-
-require($root_path.'global_conf/inc_remoteservers_conf.php');
-
-if($disc_pix_mode){
-       $final_path="$root_path$photoserver_localpath$pn/";
-}else{
-       $final_path="$photoserver_http$pn/";
-}
-
-//$db->debug=1;
-
-/* Load date formatter */
-include_once($root_path.'include/helpers/inc_date_format_functions.php');
-
-/* Create encounter object */
-require_once($root_path.'include/core/class_encounter.php');
-$encounter= new Encounter;
-$encounter->loadEncounterData($pn);
-/* Create image object */
-require_once($root_path.'modules/photolab/model/class_image.php');
-$img=new Image();
-$all_image=$img->getAllImageData($pn);
-
-# Start Smarty templating here
- /**
- * LOAD Smarty
- */
- # Note: it is advisable to load this after the inc_front_chain_lang.php so
- # that the smarty script can use the user configured template theme
-
- require_once($root_path.'gui/smarty_template/smarty_care.class.php');
- $smarty = new smarty_care('nursing',TRUE,FALSE);
-
-# Title in toolbar
- $smarty->assign('sToolbarTitle',$LDPhotos);
-
- # hide return button
- $smarty->assign('pbBack',FALSE);
-
- # href for help button
- 
$smarty->assign('pbHelp',"javascript:gethelp('encounter_photos.php','photos','','$station','$LDPhotos')");
-
- # href for close button
- 
$smarty->assign('breakfile',"javascript:window.parent.location.replace('$breakfile');");
-
- # Window bar title
- $smarty->assign('sWindowTitle',$LDPhotos);
-
- # Body Onload js
- $smarty->assign('sOnLoadJs','onLoad="if (window.focus) window.focus(); 
window.resizeTo(1000,740);"');
-
-# Collect js code
-
-ob_start();
-
-?>
-
-<style type="text/css">
-       .a12_w {font-family: arial; color: navy; font-size:12; 
background-color:#ffffff}
-       .a12_gry {font-family: arial; color: navy; font-size:12; 
background-color:#000000}
-</style>
-
-<script language="javascript">
-
-var x=-1;
-
-function showphoto(srcimg)
-{
-       if (document.images) document.images.photo.src=srcimg;
-       x=-2;
-}
-
-function preview(n)
-{
-       window.parent.FOTOS_PREVIEW.location.href="photos-preview.php<?php echo 
URL_REDIRECT_APPEND; ?>&pn=<?php echo $pn ?>&nr="+n;
-}
-</script>
-<?php
-
-$sTemp = ob_get_contents();
-ob_end_clean();
-$smarty->append('JavaScript',$sTemp);
-
-# Buffer page output
-
-ob_start();
-
-?>
-
-<p>
-<ul>
-<font class="prompt">
-<?php
-
-echo $pn;
-
-if(is_object($encounter)){
-       $fn=$encounter->PhotoFilename();
-       
if(!empty($fn)&&file_exists($root_path.'uploads/photos/registration/'.$fn)){
-               # If main photo ID exists, show it
-               echo '<br><a 
href="'.$root_path.'main/pop_reg_pic.php'.URL_APPEND.'&pid='.$encounter->PID().'&fn='.$fn.'"
 target="FOTOS_PREVIEW" title="'.$LDClk2Preview.'">
-                       <img src="';
-               echo 
$root_path.'main/imgcreator/thumbnail.php?mx=80&my=100&imgfile=uploads/photos/registration/'.$fn;
-                               
-               echo '" border=0></a>';
-
-       }
-       echo "<br></font>".ucfirst($encounter->LastName()).", 
".ucfirst($encounter->FirstName())." (";
-       echo formatDate2Local($encounter->BirthDate(),$date_format).')<br>';
-       echo "</font>";
-}
-?>
-
-<table border=0>
-<tr>
-<td>
-<nobr>
-
-<?php 
-
-echo "<b>$LDPhotos";
-if(is_object($all_image)) echo " ".$all_image->RecordCount()." $LDPicShots";
-echo '</b><br>
-       <table border=0>';
-
-if(is_object($all_image)){
-       while($image=$all_image->FetchRow()){
-
-               
if(file_exists($final_path.$image['nr'].'.'.$image['mime_type'])){
-       
-                       echo '<tr>
-               <td 
class="a12_w">'.formatDate2Local($image['shot_date'],$date_format);
-                       echo ' <font color=red size="1">Foto 
'.$image['shot_nr'].'</font>';
- 
-               echo '</td>
-                       <td class="a12_gry"><a 
href="javascript:preview(\''.$image['nr'].'\')" title="'.$LDClk2Preview.'">
-                       <img src="';
-                       if(stristr($image['mime_type'],'gif')){
-                               echo 
$final_path.$image['nr'].'.'.$image['mime_type'].'" border=0  width=80></a> 
</td>
-                               </tr>';
-                       }else{
-                               echo  
$root_path.'main/imgcreator/thumbnail.php?mx=80&my=100&imgfile='.$photoserver_localpath.$pn.'/'.$image['nr'].'.'.$image['mime_type'].'"
 border=0></a> </td>
-                               </tr>';
-                       }
-               }
-       }
-}
-
- ?>
- </table>
-<p>
-<a href="javascript:window.parent.location.replace('<?php echo $breakfile 
?>');"><img <?php echo createLDImgSrc($root_path,'close2.gif','0') ?>></a>
-
-</nobr>
-</td>
-<td>
-<img src="<?php echo $root_path ?>gui/img/common/default/pixel.gif" width=50 
border="0">
-
-</td>
-<td>
-<img src="<?php echo $root_path ?>gui/img/common/default/pixel.gif" border="0" 
name="photo">
-
-</td>
-</tr>
-</table>
-
-<p>
-</ul>
-
-<?php
-
-$sTemp = ob_get_contents();
-ob_end_clean();
-
-# Assign page output to the mainframe template
-
-$smarty->assign('sMainFrameBlockData',$sTemp);
- /**
- * show Template
- */
- $smarty->display('common/mainframe.tpl');
-
-?>

Deleted: care2x/branches/gettext/modules/photolab/fotos-preview.php
===================================================================
--- care2x/branches/gettext/modules/photolab/fotos-preview.php  2010-06-30 
12:00:28 UTC (rev 6476)
+++ care2x/branches/gettext/modules/photolab/fotos-preview.php  2010-06-30 
12:03:11 UTC (rev 6477)
@@ -1,212 +0,0 @@
-<?php
-error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
-require('./roots.php');
-require($root_path.'include/helpers/inc_environment_global.php');
-/**
-* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
-* GNU General Public License
-* Copyright 2002,2003,2004,2005 Elpidio Latorilla
-* elpi...@care2x.org, 
-*
-* See the file "copy_notice.txt" for the licence notice
-*/
-
-#
-# Define here the width of the preview image
-#
-define('PREVIEW_SIZE',400);
-
-#
-# The ImageJ applet control panel height
-# Microsoft = ~100
-# Linux = ~90
-#
-define('IMAGEJ_PANEL_HEIGHT', 100);
-#
-# The ImageJ applet control panel height
-#
-define('IMAGEJ_PANEL_WIDTH_MIN', 250);
-
-$lang_tables=array('images.php');
-define('LANG_FILE','nursing.php');
-define('NO_2LEVEL_CHK',1);
-require_once($root_path.'include/helpers/inc_front_chain_lang.php');
-require($root_path.'global_conf/inc_remoteservers_conf.php');
-/* Load date formatter */
-include_once($root_path.'include/helpers/inc_date_format_functions.php');
-
-if($disc_pix_mode){
-       $final_path="$root_path$photoserver_localpath$pn/"; 
-}else{
-       $final_path="$photoserver_http$pn/";
-}
-if(isset($pn)&&$pn){
-       /* Create image object */
-       include_once($root_path.'modules/photolab/model/class_image.php');
-       $img_obj=new Image();
-       //$db->debug=true;
-       if(isset($mode)&&$mode=='save'){
-
-               //$_POST['history']="CONCAT(history,'Notes ".date('Y-m-d 
H:i:s')." ".$_SESSION['sess_user_name']."\n')";
-               $_POST['history']=$img_obj->ConcatHistory("Notes ".date('Y-m-d 
H:i:s')." ".$_SESSION['sess_user_name']."\n");
-               $_POST['modify_id']=$_SESSION['sess_user_name'];
-               $_POST['modify_time']=date('YmdHis');
-               //$img_obj->setDataArray($_POST);
-               if($img_obj->updateImageNotes($_POST)){
-                       
header('Location:'.basename(__FILE__).URL_REDIRECT_APPEND.'&pn='.$pn.'&nr='.$nr.'&bShowImageJApplet='.$bShowImageJApplet);
-                       exit;
-               }
-       }
-       
-       if($img_data=$img_obj->getImageData($nr)){
-               $image=$img_data->FetchRow();
-               $sImgFileName = $image['nr'].'.'.$image['mime_type'];
-               $picsource=$final_path.$sImgFileName;
-       }
-}
-
-?>
-<?php html_rtl($lang); ?>
-<head>
-<script language="javascript">
-<!-- 
-
-function check(d) {
-       if(d.notes.value=="") return false;
-               else return true;
-}
-//-->
-</script>
-<?php echo setCharSet(); ?>
-</head>
-<body topmargin=0 marginheight=0>
-<form name="picnotes" method="post" onSubmit="return check(this)">
-<?php //echo $LDPreview ?>
-<?php 
-       
-if(file_exists($picsource)){
-       #
-       # If java applet class exists, show link
-       #
-       if(file_exists($root_path.'modules/photolab/IJBasicViewer.class') && 
file_exists($root_path.'modules/photolab/ij.jar')){
-               echo '<font face=arial><a 
href="'.basename(__FILE__).URL_APPEND.'&pn='.$pn.'&nr='.$nr.'&bShowImageJApplet='.(!$bShowImageJApplet).'">';
-               if($bShowImageJApplet) echo $LDHideJavaApplet;
-                       else echo $LDShowJavaApplet;
-               echo '</a>&nbsp;</font>';
-       }
-       #
-       # If ImageJ applet class exists, show link
-       #
-       if(file_exists($root_path.'modules/photolab/IJApplet.class') && 
file_exists($root_path.'modules/photolab/ij.jar')){
-               echo '<font face=arial>
-               <a 
href="ijapplet_launcher.php'.URL_APPEND.'&pn='.$pn.'&img='.$sImgFileName.'&bShowImageJApplet='.(!$bShowImageJApplet).'">'.$LDEditWithImageJ.'</a>
-               </font>';
-       }
-?>
-<p>
-<table border=0 cellspacing=0 cellpadding=0>
-  <tr>
-    <td><font size=2 face=arial color=maroon><?php echo $LDShotDate ?>:
-</td>
-    <td><font size=2 face=arial><?php echo 
formatDate2Local($image['shot_date'],$date_format); ?></td>
-  </tr>
-  <tr>
-    <td><font size=2 face=arial color=maroon><?php echo $LDShotNr ?>:</td>
-    <td><font size=2 face=arial><?php echo $image['shot_nr'] ?></td>
-  </tr>
-</table>
-<?php
-if(!isset($preview_size)) $preview_size=0;
-
-list($w,$h,$t,$wh)=getImageSize($picsource); // get the size of the image
-
-if(isset($bShowImageJApplet) && $bShowImageJApplet){
-       #
-       # Set applet's dimensions
-       #
-       $iAppletHeight=$h + IMAGEJ_PANEL_HEIGHT;
-
-       if($w < IMAGEJ_PANEL_WIDTH_MIN ) $iAppletWidth = IMAGEJ_PANEL_WIDTH_MIN;
-               else $iAppletWidth = $w;
-
-       echo '<applet codebase="." code="ij.ImageJApplet.class"  
archive="ij.jar" width='.$iAppletWidth.' height='.$iAppletHeight.'>
-                               <param name=url value='.$picsource.'>
-                </applet>';
-}else{
-
-       if(PREVIEW_SIZE<$w){
-               $toggle_pic=true;
-               if($preview_size) $preview_size=0;
-                       else $preview_size=PREVIEW_SIZE;
-       }else{
-               $toggle_pic=false;
-               $preview_size=$w;
-       }
-
-       if($toggle_pic) echo '<a 
href="'.basename(__FILE__).URL_APPEND.'&pn='.$pn.'&nr='.$nr.'&preview_size='.$preview_size.'">';
-
-       if($t==1){
-
-?>
-
-<img src="<?php        echo $picsource; ?>" <?php if($preview_size) echo 
'width="'.$preview_size.'"'; else echo $wh; ?> border=0  name="preview"
-<?php 
-
-       }elseif(($toggle_pic&&!$preview_size)||(!$toggle_pic&&$preview_size)){
-?>
-<img src="<?php        echo $picsource; ?>" <?php if($preview_size) echo 
'width="'.$preview_size.'"'; else echo $wh; ?> border=0  name="preview"
-<?php
-       }else{
-?>
-<img src="<?php        echo 
$root_path.'main/imgcreator/thumbnail.php?mx='.$preview_size.'&my='.$preview_size.'&imgfile=/'.$photoserver_localpath.$pn.'/'.$image['nr'].'.'.$image['mime_type']
 ?>" border=0  name="preview"
-<?php
-       }
-
-       if($toggle_pic){
-?>
- alt="<?php if($preview_size) echo $LDTogglePreviewOrig; else echo 
$LDToggleOrigPreview; ?>" 
-  title="<?php  if($preview_size) echo $LDTogglePreviewOrig; else echo 
$LDToggleOrigPreview; ?>"
-<?php
-       }
-?>>
-<?php
-       if($toggle_pic) echo '</a>';
-}
-?>
-<br>
-<?php
-if(!empty($image['notes'])){
-       $notes=str_replace('[[','<font size=1 
color="#abcdef">',htmlspecialchars($image['notes']));
-       $notes=str_replace(']]','</font>',$notes);
-?>
-<table border=0 width="100%" cellspacing=0 cellpadding=1 bgcolor="#abcdef">
-  <tr>
-    <td>
-               <table border=0 width="100%" cellspacing=0 cellpadding=5 
bgcolor="#ffffff">
-                 <tr>
-                   <td><font size=2 face="arial,verdana,helvetica">
-                       <?php echo nl2br($notes); ?>
-                       </td>
-                 </tr>
-               </table>
-       </td>
-  </tr>
-</table>
-<?php
-}
-?>
-<textarea name="notes" cols=40 rows=4 wrap="physical"></textarea><br>
-<input type="hidden" name="pn" value="<?php echo $pn ?>">
-<input type="hidden" name="nr" value="<?php echo $nr ?>">
-<input type="hidden" name="sid" value="<?php echo $sid ?>">
-<input type="hidden" name="lang" value="<?php echo $lang ?>">
-<input type="hidden" name="bShowImageJApplet" value="<?php echo 
$bShowImageJApplet ?>">
-<input type="hidden" name="preview_size" value="<?php if(isset($preview_size)) 
echo $preview_size ?>">
-<input type="hidden" name="mode" value="save">
-<input type="image" <?php echo createLDImgSrc($root_path,'savedisc.gif','0'); 
?>>
-<?php
-}
-?>
-</form>
-</body>
-</html>

Deleted: care2x/branches/gettext/modules/photolab/fotos-start.php
===================================================================
--- care2x/branches/gettext/modules/photolab/fotos-start.php    2010-06-30 
12:00:28 UTC (rev 6476)
+++ care2x/branches/gettext/modules/photolab/fotos-start.php    2010-06-30 
12:03:11 UTC (rev 6477)
@@ -1,50 +0,0 @@
-<?php
-error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
-require('./roots.php');
-require($root_path.'include/helpers/inc_environment_global.php');
-/**
-* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
-* GNU General Public License
-* Copyright 2002,2003,2004,2005 Elpidio Latorilla
-* elpi...@care2x.org, 
-*
-* See the file "copy_notice.txt" for the licence notice
-*/
-define('LANG_FILE','lab.php');
-define('NO_2LEVEL_CHK',1);
-require_once($root_path.'include/helpers/inc_front_chain_lang.php');
-?>
-<?php html_rtl($lang); ?>
-
-<head>
-<?php echo setCharSet(); ?>
-<title><?php echo $LDPhotos ?></title>
-
-</head>
-<?php
-if($lang=='ar'||$lang=='fa'){
-?>
-<frameset cols="*,30%">
-  <frame name="FOTOS_PREVIEW" src="photos-preview.php?sid=<?php echo 
"$sid&lang=$lang" ?>">
-  <frame name="FOTOS_INDEX" src="photos-index.php?sid=<?php echo 
"$sid&lang=$lang&edit=$edit&pn=$pn&station=$station&fileroot=$fileroot" ?>" >
-<noframes>
-<body>
-</body>
-</noframes>
-</frameset>
-<?php
-}else{
-?>
-<frameset cols="30%,*">
-  <frame name="FOTOS_INDEX" src="photos-index.php?sid=<?php echo 
"$sid&lang=$lang&edit=$edit&pn=$pn&station=$station&fileroot=$fileroot" ?>" >
-  <frame name="FOTOS_PREVIEW" src="photos-preview.php?sid=<?php echo 
"$sid&lang=$lang" ?>">
-<noframes>
-<body>
-</body>
-</noframes>
-</frameset>
-<?php
-}
-?>
-
-</html>

Copied: care2x/branches/gettext/modules/photolab/photos-index.php (from rev 
6476, care2x/branches/gettext/modules/photolab/fotos-index.php)
===================================================================
--- care2x/branches/gettext/modules/photolab/photos-index.php                   
        (rev 0)
+++ care2x/branches/gettext/modules/photolab/photos-index.php   2010-06-30 
12:03:11 UTC (rev 6477)
@@ -0,0 +1,200 @@
+<?php
+error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
+require('./roots.php');
+require($root_path.'include/helpers/inc_environment_global.php');
+/**
+* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
+* GNU General Public License
+* Copyright 2002,2003,2004,2005 Elpidio Latorilla
+* elpi...@care2x.org, 
+*
+* See the file "copy_notice.txt" for the licence notice
+*/
+define('LANG_FILE','nursing.php');
+define('NO_2LEVEL_CHK',1);
+require_once($root_path.'include/helpers/inc_front_chain_lang.php');
+
+$breakfile=$root_path."modules/nursing/nursing-ward-patientdata.php".URL_REDIRECT_APPEND."&edit=$edit&station=$station&pn=$pn";
+
+require($root_path.'global_conf/inc_remoteservers_conf.php');
+
+if($disc_pix_mode){
+       $final_path="$root_path$photoserver_localpath$pn/";
+}else{
+       $final_path="$photoserver_http$pn/";
+}
+
+//$db->debug=1;
+
+/* Load date formatter */
+include_once($root_path.'include/helpers/inc_date_format_functions.php');
+
+/* Create encounter object */
+require_once($root_path.'include/core/class_encounter.php');
+$encounter= new Encounter;
+$encounter->loadEncounterData($pn);
+/* Create image object */
+require_once($root_path.'modules/photolab/model/class_image.php');
+$img=new Image();
+$all_image=$img->getAllImageData($pn);
+
+# Start Smarty templating here
+ /**
+ * LOAD Smarty
+ */
+ # Note: it is advisable to load this after the inc_front_chain_lang.php so
+ # that the smarty script can use the user configured template theme
+
+ require_once($root_path.'gui/smarty_template/smarty_care.class.php');
+ $smarty = new smarty_care('nursing',TRUE,FALSE);
+
+# Title in toolbar
+ $smarty->assign('sToolbarTitle',$LDPhotos);
+
+ # hide return button
+ $smarty->assign('pbBack',FALSE);
+
+ # href for help button
+ 
$smarty->assign('pbHelp',"javascript:gethelp('encounter_photos.php','photos','','$station','$LDPhotos')");
+
+ # href for close button
+ 
$smarty->assign('breakfile',"javascript:window.parent.location.replace('$breakfile');");
+
+ # Window bar title
+ $smarty->assign('sWindowTitle',$LDPhotos);
+
+ # Body Onload js
+ $smarty->assign('sOnLoadJs','onLoad="if (window.focus) window.focus(); 
window.resizeTo(1000,740);"');
+
+# Collect js code
+
+ob_start();
+
+?>
+
+<style type="text/css">
+       .a12_w {font-family: arial; color: navy; font-size:12; 
background-color:#ffffff}
+       .a12_gry {font-family: arial; color: navy; font-size:12; 
background-color:#000000}
+</style>
+
+<script language="javascript">
+
+var x=-1;
+
+function showphoto(srcimg)
+{
+       if (document.images) document.images.photo.src=srcimg;
+       x=-2;
+}
+
+function preview(n)
+{
+       window.parent.FOTOS_PREVIEW.location.href="photos-preview.php<?php echo 
URL_REDIRECT_APPEND; ?>&pn=<?php echo $pn ?>&nr="+n;
+}
+</script>
+<?php
+
+$sTemp = ob_get_contents();
+ob_end_clean();
+$smarty->append('JavaScript',$sTemp);
+
+# Buffer page output
+
+ob_start();
+
+?>
+
+<p>
+<ul>
+<font class="prompt">
+<?php
+
+echo $pn;
+
+if(is_object($encounter)){
+       $fn=$encounter->PhotoFilename();
+       
if(!empty($fn)&&file_exists($root_path.'uploads/photos/registration/'.$fn)){
+               # If main photo ID exists, show it
+               echo '<br><a 
href="'.$root_path.'main/pop_reg_pic.php'.URL_APPEND.'&pid='.$encounter->PID().'&fn='.$fn.'"
 target="FOTOS_PREVIEW" title="'.$LDClk2Preview.'">
+                       <img src="';
+               echo 
$root_path.'main/imgcreator/thumbnail.php?mx=80&my=100&imgfile=uploads/photos/registration/'.$fn;
+                               
+               echo '" border=0></a>';
+
+       }
+       echo "<br></font>".ucfirst($encounter->LastName()).", 
".ucfirst($encounter->FirstName())." (";
+       echo formatDate2Local($encounter->BirthDate(),$date_format).')<br>';
+       echo "</font>";
+}
+?>
+
+<table border=0>
+<tr>
+<td>
+<nobr>
+
+<?php 
+
+echo "<b>$LDPhotos";
+if(is_object($all_image)) echo " ".$all_image->RecordCount()." $LDPicShots";
+echo '</b><br>
+       <table border=0>';
+
+if(is_object($all_image)){
+       while($image=$all_image->FetchRow()){
+
+               
if(file_exists($final_path.$image['nr'].'.'.$image['mime_type'])){
+       
+                       echo '<tr>
+               <td 
class="a12_w">'.formatDate2Local($image['shot_date'],$date_format);
+                       echo ' <font color=red size="1">Foto 
'.$image['shot_nr'].'</font>';
+ 
+               echo '</td>
+                       <td class="a12_gry"><a 
href="javascript:preview(\''.$image['nr'].'\')" title="'.$LDClk2Preview.'">
+                       <img src="';
+                       if(stristr($image['mime_type'],'gif')){
+                               echo 
$final_path.$image['nr'].'.'.$image['mime_type'].'" border=0  width=80></a> 
</td>
+                               </tr>';
+                       }else{
+                               echo  
$root_path.'main/imgcreator/thumbnail.php?mx=80&my=100&imgfile='.$photoserver_localpath.$pn.'/'.$image['nr'].'.'.$image['mime_type'].'"
 border=0></a> </td>
+                               </tr>';
+                       }
+               }
+       }
+}
+
+ ?>
+ </table>
+<p>
+<a href="javascript:window.parent.location.replace('<?php echo $breakfile 
?>');"><img <?php echo createLDImgSrc($root_path,'close2.gif','0') ?>></a>
+
+</nobr>
+</td>
+<td>
+<img src="<?php echo $root_path ?>gui/img/common/default/pixel.gif" width=50 
border="0">
+
+</td>
+<td>
+<img src="<?php echo $root_path ?>gui/img/common/default/pixel.gif" border="0" 
name="photo">
+
+</td>
+</tr>
+</table>
+
+<p>
+</ul>
+
+<?php
+
+$sTemp = ob_get_contents();
+ob_end_clean();
+
+# Assign page output to the mainframe template
+
+$smarty->assign('sMainFrameBlockData',$sTemp);
+ /**
+ * show Template
+ */
+ $smarty->display('common/mainframe.tpl');
+
+?>

Copied: care2x/branches/gettext/modules/photolab/photos-preview.php (from rev 
6476, care2x/branches/gettext/modules/photolab/fotos-preview.php)
===================================================================
--- care2x/branches/gettext/modules/photolab/photos-preview.php                 
        (rev 0)
+++ care2x/branches/gettext/modules/photolab/photos-preview.php 2010-06-30 
12:03:11 UTC (rev 6477)
@@ -0,0 +1,212 @@
+<?php
+error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
+require('./roots.php');
+require($root_path.'include/helpers/inc_environment_global.php');
+/**
+* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
+* GNU General Public License
+* Copyright 2002,2003,2004,2005 Elpidio Latorilla
+* elpi...@care2x.org, 
+*
+* See the file "copy_notice.txt" for the licence notice
+*/
+
+#
+# Define here the width of the preview image
+#
+define('PREVIEW_SIZE',400);
+
+#
+# The ImageJ applet control panel height
+# Microsoft = ~100
+# Linux = ~90
+#
+define('IMAGEJ_PANEL_HEIGHT', 100);
+#
+# The ImageJ applet control panel height
+#
+define('IMAGEJ_PANEL_WIDTH_MIN', 250);
+
+$lang_tables=array('images.php');
+define('LANG_FILE','nursing.php');
+define('NO_2LEVEL_CHK',1);
+require_once($root_path.'include/helpers/inc_front_chain_lang.php');
+require($root_path.'global_conf/inc_remoteservers_conf.php');
+/* Load date formatter */
+include_once($root_path.'include/helpers/inc_date_format_functions.php');
+
+if($disc_pix_mode){
+       $final_path="$root_path$photoserver_localpath$pn/"; 
+}else{
+       $final_path="$photoserver_http$pn/";
+}
+if(isset($pn)&&$pn){
+       /* Create image object */
+       include_once($root_path.'modules/photolab/model/class_image.php');
+       $img_obj=new Image();
+       //$db->debug=true;
+       if(isset($mode)&&$mode=='save'){
+
+               //$_POST['history']="CONCAT(history,'Notes ".date('Y-m-d 
H:i:s')." ".$_SESSION['sess_user_name']."\n')";
+               $_POST['history']=$img_obj->ConcatHistory("Notes ".date('Y-m-d 
H:i:s')." ".$_SESSION['sess_user_name']."\n");
+               $_POST['modify_id']=$_SESSION['sess_user_name'];
+               $_POST['modify_time']=date('YmdHis');
+               //$img_obj->setDataArray($_POST);
+               if($img_obj->updateImageNotes($_POST)){
+                       
header('Location:'.basename(__FILE__).URL_REDIRECT_APPEND.'&pn='.$pn.'&nr='.$nr.'&bShowImageJApplet='.$bShowImageJApplet);
+                       exit;
+               }
+       }
+       
+       if($img_data=$img_obj->getImageData($nr)){
+               $image=$img_data->FetchRow();
+               $sImgFileName = $image['nr'].'.'.$image['mime_type'];
+               $picsource=$final_path.$sImgFileName;
+       }
+}
+
+?>
+<?php html_rtl($lang); ?>
+<head>
+<script language="javascript">
+<!-- 
+
+function check(d) {
+       if(d.notes.value=="") return false;
+               else return true;
+}
+//-->
+</script>
+<?php echo setCharSet(); ?>
+</head>
+<body topmargin=0 marginheight=0>
+<form name="picnotes" method="post" onSubmit="return check(this)">
+<?php //echo $LDPreview ?>
+<?php 
+       
+if(file_exists($picsource)){
+       #
+       # If java applet class exists, show link
+       #
+       if(file_exists($root_path.'modules/photolab/IJBasicViewer.class') && 
file_exists($root_path.'modules/photolab/ij.jar')){
+               echo '<font face=arial><a 
href="'.basename(__FILE__).URL_APPEND.'&pn='.$pn.'&nr='.$nr.'&bShowImageJApplet='.(!$bShowImageJApplet).'">';
+               if($bShowImageJApplet) echo $LDHideJavaApplet;
+                       else echo $LDShowJavaApplet;
+               echo '</a>&nbsp;</font>';
+       }
+       #
+       # If ImageJ applet class exists, show link
+       #
+       if(file_exists($root_path.'modules/photolab/IJApplet.class') && 
file_exists($root_path.'modules/photolab/ij.jar')){
+               echo '<font face=arial>
+               <a 
href="ijapplet_launcher.php'.URL_APPEND.'&pn='.$pn.'&img='.$sImgFileName.'&bShowImageJApplet='.(!$bShowImageJApplet).'">'.$LDEditWithImageJ.'</a>
+               </font>';
+       }
+?>
+<p>
+<table border=0 cellspacing=0 cellpadding=0>
+  <tr>
+    <td><font size=2 face=arial color=maroon><?php echo $LDShotDate ?>:
+</td>
+    <td><font size=2 face=arial><?php echo 
formatDate2Local($image['shot_date'],$date_format); ?></td>
+  </tr>
+  <tr>
+    <td><font size=2 face=arial color=maroon><?php echo $LDShotNr ?>:</td>
+    <td><font size=2 face=arial><?php echo $image['shot_nr'] ?></td>
+  </tr>
+</table>
+<?php
+if(!isset($preview_size)) $preview_size=0;
+
+list($w,$h,$t,$wh)=getImageSize($picsource); // get the size of the image
+
+if(isset($bShowImageJApplet) && $bShowImageJApplet){
+       #
+       # Set applet's dimensions
+       #
+       $iAppletHeight=$h + IMAGEJ_PANEL_HEIGHT;
+
+       if($w < IMAGEJ_PANEL_WIDTH_MIN ) $iAppletWidth = IMAGEJ_PANEL_WIDTH_MIN;
+               else $iAppletWidth = $w;
+
+       echo '<applet codebase="." code="ij.ImageJApplet.class"  
archive="ij.jar" width='.$iAppletWidth.' height='.$iAppletHeight.'>
+                               <param name=url value='.$picsource.'>
+                </applet>';
+}else{
+
+       if(PREVIEW_SIZE<$w){
+               $toggle_pic=true;
+               if($preview_size) $preview_size=0;
+                       else $preview_size=PREVIEW_SIZE;
+       }else{
+               $toggle_pic=false;
+               $preview_size=$w;
+       }
+
+       if($toggle_pic) echo '<a 
href="'.basename(__FILE__).URL_APPEND.'&pn='.$pn.'&nr='.$nr.'&preview_size='.$preview_size.'">';
+
+       if($t==1){
+
+?>
+
+<img src="<?php        echo $picsource; ?>" <?php if($preview_size) echo 
'width="'.$preview_size.'"'; else echo $wh; ?> border=0  name="preview"
+<?php 
+
+       }elseif(($toggle_pic&&!$preview_size)||(!$toggle_pic&&$preview_size)){
+?>
+<img src="<?php        echo $picsource; ?>" <?php if($preview_size) echo 
'width="'.$preview_size.'"'; else echo $wh; ?> border=0  name="preview"
+<?php
+       }else{
+?>
+<img src="<?php        echo 
$root_path.'main/imgcreator/thumbnail.php?mx='.$preview_size.'&my='.$preview_size.'&imgfile=/'.$photoserver_localpath.$pn.'/'.$image['nr'].'.'.$image['mime_type']
 ?>" border=0  name="preview"
+<?php
+       }
+
+       if($toggle_pic){
+?>
+ alt="<?php if($preview_size) echo $LDTogglePreviewOrig; else echo 
$LDToggleOrigPreview; ?>" 
+  title="<?php  if($preview_size) echo $LDTogglePreviewOrig; else echo 
$LDToggleOrigPreview; ?>"
+<?php
+       }
+?>>
+<?php
+       if($toggle_pic) echo '</a>';
+}
+?>
+<br>
+<?php
+if(!empty($image['notes'])){
+       $notes=str_replace('[[','<font size=1 
color="#abcdef">',htmlspecialchars($image['notes']));
+       $notes=str_replace(']]','</font>',$notes);
+?>
+<table border=0 width="100%" cellspacing=0 cellpadding=1 bgcolor="#abcdef">
+  <tr>
+    <td>
+               <table border=0 width="100%" cellspacing=0 cellpadding=5 
bgcolor="#ffffff">
+                 <tr>
+                   <td><font size=2 face="arial,verdana,helvetica">
+                       <?php echo nl2br($notes); ?>
+                       </td>
+                 </tr>
+               </table>
+       </td>
+  </tr>
+</table>
+<?php
+}
+?>
+<textarea name="notes" cols=40 rows=4 wrap="physical"></textarea><br>
+<input type="hidden" name="pn" value="<?php echo $pn ?>">
+<input type="hidden" name="nr" value="<?php echo $nr ?>">
+<input type="hidden" name="sid" value="<?php echo $sid ?>">
+<input type="hidden" name="lang" value="<?php echo $lang ?>">
+<input type="hidden" name="bShowImageJApplet" value="<?php echo 
$bShowImageJApplet ?>">
+<input type="hidden" name="preview_size" value="<?php if(isset($preview_size)) 
echo $preview_size ?>">
+<input type="hidden" name="mode" value="save">
+<input type="image" <?php echo createLDImgSrc($root_path,'savedisc.gif','0'); 
?>>
+<?php
+}
+?>
+</form>
+</body>
+</html>

Copied: care2x/branches/gettext/modules/photolab/photos-start.php (from rev 
6476, care2x/branches/gettext/modules/photolab/fotos-start.php)
===================================================================
--- care2x/branches/gettext/modules/photolab/photos-start.php                   
        (rev 0)
+++ care2x/branches/gettext/modules/photolab/photos-start.php   2010-06-30 
12:03:11 UTC (rev 6477)
@@ -0,0 +1,50 @@
+<?php
+error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR);
+require('./roots.php');
+require($root_path.'include/helpers/inc_environment_global.php');
+/**
+* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
+* GNU General Public License
+* Copyright 2002,2003,2004,2005 Elpidio Latorilla
+* elpi...@care2x.org, 
+*
+* See the file "copy_notice.txt" for the licence notice
+*/
+define('LANG_FILE','lab.php');
+define('NO_2LEVEL_CHK',1);
+require_once($root_path.'include/helpers/inc_front_chain_lang.php');
+?>
+<?php html_rtl($lang); ?>
+
+<head>
+<?php echo setCharSet(); ?>
+<title><?php echo $LDPhotos ?></title>
+
+</head>
+<?php
+if($lang=='ar'||$lang=='fa'){
+?>
+<frameset cols="*,30%">
+  <frame name="FOTOS_PREVIEW" src="photos-preview.php?sid=<?php echo 
"$sid&lang=$lang" ?>">
+  <frame name="FOTOS_INDEX" src="photos-index.php?sid=<?php echo 
"$sid&lang=$lang&edit=$edit&pn=$pn&station=$station&fileroot=$fileroot" ?>" >
+<noframes>
+<body>
+</body>
+</noframes>
+</frameset>
+<?php
+}else{
+?>
+<frameset cols="30%,*">
+  <frame name="FOTOS_INDEX" src="photos-index.php?sid=<?php echo 
"$sid&lang=$lang&edit=$edit&pn=$pn&station=$station&fileroot=$fileroot" ?>" >
+  <frame name="FOTOS_PREVIEW" src="photos-preview.php?sid=<?php echo 
"$sid&lang=$lang" ?>">
+<noframes>
+<body>
+</body>
+</noframes>
+</frameset>
+<?php
+}
+?>
+
+</html>

Deleted: care2x/branches/gettext/modules/photolab/uploadfoto.php
===================================================================
--- care2x/branches/gettext/modules/photolab/uploadfoto.php     2010-06-30 
12:00:28 UTC (rev 6476)
+++ care2x/branches/gettext/modules/photolab/uploadfoto.php     2010-06-30 
12:03:11 UTC (rev 6477)
@@ -1,186 +0,0 @@
-<?PHP
-
-require('./roots.php');
-require($root_path.'include/helpers/inc_environment_global.php');
-require($root_path.'global_conf/inc_remoteservers_conf.php');
-$local_user='ck_photolab_user';
-
-
-require_once($root_path.'modules/photolab/model/class_image.php');
-
-$img=new Image;
-$disc_pix_mode = true;
-
-if(!isset($db) || !$db) 
include_once($root_path.'include/helpers/inc_db_makelink.php');
-if(!$dblink_ok) {
-  print "ERROR: db not ready.\n";
-  exit;
-}
-
-$userid = $_REQUEST['userid'];
-$keyword = $_REQUEST['keyword'];
-
-
-// if $GUI not set, use text/plain for answers
-if( !isset($_REQUEST['GUI']) ){
-     header( "Content-Type: text/plain" );
-     $CRLF = "\n";
-} else {
-  $CRLF = "<br />\n";
-}
-       
-
-$sql='SELECT * FROM care_users WHERE login_id="'.addslashes($userid).'"';
-if($ergebnis=$db->Execute($sql))
-{
-  $zeile=$ergebnis->FetchRow();  
-  if( !(($zeile['password']==md5($keyword))&&($zeile['login_id']==$userid)) )
-    {
-      print "ERROR: Authorization failed$CRLF";
-      if( !isset($_REQUEST['GUI']) )
-         exit;
-    }
-}
-
-
-
-if( $_REQUEST["function"]=="save" )
-{
-
-  // check for encounter
-  $sql = "SELECT * FROM care_encounter ".
-    " WHERE encounter_nr='".$_REQUEST["encounter_nr"]."'";
-  $result = $db->Execute( $sql );
-  if( !($row = $result->FetchRow()) )
-    {
-      print "ERROR$CRLF".
-       "no patient folder for encounter no 
'".$_REQUEST["encounter_nr"]."'$CRLF";
-      if( !isset($_REQUEST['GUI']) )
-         exit;
-    }
-  else
-    {
-      // Set the encounter as the directory name               
-      $picdir = $_REQUEST["encounter_nr"];
-      
-      if($disc_pix_mode){
-       $d = $root_path.$photoserver_localpath.$picdir;
-      }
-      
-      //DEBUG: print "saving to $d ... $CRLF";
-     // $db->debug=true;
-
-      if( $img->isValidUploadedImage($_FILES['imagefile']) )
-       { 
-         $data=array('encounter_nr'=>$_REQUEST["encounter_nr"],
-                     'upload_date'=>date('Y-m-d'),
-                     'history'=>"Upload ".date('Y-m-d H:i:s')." ".$userid."\n",
-                     'modify_time'=>0,
-                       'create_id'=>$userid,
-                     'create_time'=>date('YmdHis'));
-
-         $picext = strtolower($img->UploadedImageMimeType());
-         
if(stristr($picext,'gif')||stristr($picext,'jpg')||stristr($picext,'png'))
-           {
-             $data['shot_date'] = date("Y-m-d");
-             $data['shot_nr']   = 1;
-             $data['mime_type'] = $picext;
-        
-             if($pknr = $img->saveImageData($data)){
-               
-               # Find the last inserted primary key based on the db type
-               /*switch($dbtype){
-                       case "postgres": 
$picnr=$img->postgre_Insert_ID('care_encounter_image','nr',$pknr); break;
-                       case "postgres7": 
$picnr=$img->postgre_Insert_ID('care_encounter_image','nr',$pknr); break;
-                       # default is mysql $picnr == $picnr;
-               }*/
-               $picnr = $img->LastInsertPK('nr',$pknr);
-
-               $picfilename = $picnr.'.'.$picext;
-          
-               if($disc_pix_mode)
-                 {
-                   if(!is_dir($d)){
-                     // if $d directory not exist create it with CHMOD 777
-                     mkdir($d,0777); 
-                     // Copy the trap files to this new directory
-                     
copy($root_path.'uploads/photos/encounter/donotremove/index.htm', 
-                          $d.'/index.htm');
-                     
copy($root_path.'uploads/photos/encounter/donotremove/index.php', 
-                          $d.'/index.php');
-                   }
-                   // Store to the newly created directory
-                   $dir_path = $d.'/';
-                 }
-               else
-                 {
-                   // Store to cache directory
-                   $dir_path = $root_path.'cache/';
-                 }
-               // Save the uploaded image
-               $img->saveUploadedImage( $_FILES['imagefile'],
-                                        $dir_path, $picfilename );
-          
-               print "saved to $dir_path$picfilename$CRLF";
-             } else {
-               echo $img->getLastQuery();
-             }
-           }
-         
-         
-         if( !isset($_REQUEST['GUI']) )
-           exit;
-       } else {
-         echo "Possible file upload attack:";
-       }
-    }
-} 
-
-else if( $_REQUEST["function"]=="getinfo" )
-{
-  // check for encounter
-  $sql = "SELECT e.encounter_nr, e.pid, e.encounter_date, ".
-    "            p.name_first, p.name_last, p.date_birth ".
-    " FROM care_encounter e, care_person p ".
-    " WHERE p.pid=e.pid ".
-    " AND e.encounter_nr='".$_REQUEST["encounter_nr"]."'";
-
-  $result = $db->Execute( $sql );
-if(is_object($result)){
-  if( ($row = $result->FetchRow()) )
-    {
-      print "PID: ".$row['pid']."$CRLF".
-       $row['name_first']." ".$row['name_last']." (".
-       $row['date_birth'].")$CRLF".
-       "at: ".$row['encounter_date']."$CRLF";
-      if( !isset($_REQUEST['GUI']) )
-         exit;
-    }
-  else
-    {
-      print "ERROR: no encounter with id='".$_REQUEST["encounter_nr"]."'$CRLF";
-      if( !isset($_REQUEST['GUI']) )
-         exit;
-    }
-  }else{
-       echo "Encounter nr. not found";
-       exit;
-  }
-}
-
-
-
-?>
-
-<hr>
-
-<h3>uplaod image</h3>
-
-<form method="post" enctype="multipart/form-data">
-<INPUT type="hidden" name="GUI" value="yes">
-<input type=radio name="function" value="getinfo">info
-<input type=radio name="function" value="save">save<br />
-encounter_nr: <input name="encounter_nr" value=""><br />
-<input type=file size=40 maxlength=2000000 name='imagefile' 
accept='image/*'><br />
-<input type=submit>
-</form>

Copied: care2x/branches/gettext/modules/photolab/uploadphoto.php (from rev 
6476, care2x/branches/gettext/modules/photolab/uploadfoto.php)
===================================================================
--- care2x/branches/gettext/modules/photolab/uploadphoto.php                    
        (rev 0)
+++ care2x/branches/gettext/modules/photolab/uploadphoto.php    2010-06-30 
12:03:11 UTC (rev 6477)
@@ -0,0 +1,186 @@
+<?PHP
+
+require('./roots.php');
+require($root_path.'include/helpers/inc_environment_global.php');
+require($root_path.'global_conf/inc_remoteservers_conf.php');
+$local_user='ck_photolab_user';
+
+
+require_once($root_path.'modules/photolab/model/class_image.php');
+
+$img=new Image;
+$disc_pix_mode = true;
+
+if(!isset($db) || !$db) 
include_once($root_path.'include/helpers/inc_db_makelink.php');
+if(!$dblink_ok) {
+  print "ERROR: db not ready.\n";
+  exit;
+}
+
+$userid = $_REQUEST['userid'];
+$keyword = $_REQUEST['keyword'];
+
+
+// if $GUI not set, use text/plain for answers
+if( !isset($_REQUEST['GUI']) ){
+     header( "Content-Type: text/plain" );
+     $CRLF = "\n";
+} else {
+  $CRLF = "<br />\n";
+}
+       
+
+$sql='SELECT * FROM care_users WHERE login_id="'.addslashes($userid).'"';
+if($ergebnis=$db->Execute($sql))
+{
+  $zeile=$ergebnis->FetchRow();  
+  if( !(($zeile['password']==md5($keyword))&&($zeile['login_id']==$userid)) )
+    {
+      print "ERROR: Authorization failed$CRLF";
+      if( !isset($_REQUEST['GUI']) )
+         exit;
+    }
+}
+
+
+
+if( $_REQUEST["function"]=="save" )
+{
+
+  // check for encounter
+  $sql = "SELECT * FROM care_encounter ".
+    " WHERE encounter_nr='".$_REQUEST["encounter_nr"]."'";
+  $result = $db->Execute( $sql );
+  if( !($row = $result->FetchRow()) )
+    {
+      print "ERROR$CRLF".
+       "no patient folder for encounter no 
'".$_REQUEST["encounter_nr"]."'$CRLF";
+      if( !isset($_REQUEST['GUI']) )
+         exit;
+    }
+  else
+    {
+      // Set the encounter as the directory name               
+      $picdir = $_REQUEST["encounter_nr"];
+      
+      if($disc_pix_mode){
+       $d = $root_path.$photoserver_localpath.$picdir;
+      }
+      
+      //DEBUG: print "saving to $d ... $CRLF";
+     // $db->debug=true;
+
+      if( $img->isValidUploadedImage($_FILES['imagefile']) )
+       { 
+         $data=array('encounter_nr'=>$_REQUEST["encounter_nr"],
+                     'upload_date'=>date('Y-m-d'),
+                     'history'=>"Upload ".date('Y-m-d H:i:s')." ".$userid."\n",
+                     'modify_time'=>0,
+                       'create_id'=>$userid,
+                     'create_time'=>date('YmdHis'));
+
+         $picext = strtolower($img->UploadedImageMimeType());
+         
if(stristr($picext,'gif')||stristr($picext,'jpg')||stristr($picext,'png'))
+           {
+             $data['shot_date'] = date("Y-m-d");
+             $data['shot_nr']   = 1;
+             $data['mime_type'] = $picext;
+        
+             if($pknr = $img->saveImageData($data)){
+               
+               # Find the last inserted primary key based on the db type
+               /*switch($dbtype){
+                       case "postgres": 
$picnr=$img->postgre_Insert_ID('care_encounter_image','nr',$pknr); break;
+                       case "postgres7": 
$picnr=$img->postgre_Insert_ID('care_encounter_image','nr',$pknr); break;
+                       # default is mysql $picnr == $picnr;
+               }*/
+               $picnr = $img->LastInsertPK('nr',$pknr);
+
+               $picfilename = $picnr.'.'.$picext;
+          
+               if($disc_pix_mode)
+                 {
+                   if(!is_dir($d)){
+                     // if $d directory not exist create it with CHMOD 777
+                     mkdir($d,0777); 
+                     // Copy the trap files to this new directory
+                     
copy($root_path.'uploads/photos/encounter/donotremove/index.htm', 
+                          $d.'/index.htm');
+                     
copy($root_path.'uploads/photos/encounter/donotremove/index.php', 
+                          $d.'/index.php');
+                   }
+                   // Store to the newly created directory
+                   $dir_path = $d.'/';
+                 }
+               else
+                 {
+                   // Store to cache directory
+                   $dir_path = $root_path.'cache/';
+                 }
+               // Save the uploaded image
+               $img->saveUploadedImage( $_FILES['imagefile'],
+                                        $dir_path, $picfilename );
+          
+               print "saved to $dir_path$picfilename$CRLF";
+             } else {
+               echo $img->getLastQuery();
+             }
+           }
+         
+         
+         if( !isset($_REQUEST['GUI']) )
+           exit;
+       } else {
+         echo "Possible file upload attack:";
+       }
+    }
+} 
+
+else if( $_REQUEST["function"]=="getinfo" )
+{
+  // check for encounter
+  $sql = "SELECT e.encounter_nr, e.pid, e.encounter_date, ".
+    "            p.name_first, p.name_last, p.date_birth ".
+    " FROM care_encounter e, care_person p ".
+    " WHERE p.pid=e.pid ".
+    " AND e.encounter_nr='".$_REQUEST["encounter_nr"]."'";
+
+  $result = $db->Execute( $sql );
+if(is_object($result)){
+  if( ($row = $result->FetchRow()) )
+    {
+      print "PID: ".$row['pid']."$CRLF".
+       $row['name_first']." ".$row['name_last']." (".
+       $row['date_birth'].")$CRLF".
+       "at: ".$row['encounter_date']."$CRLF";
+      if( !isset($_REQUEST['GUI']) )
+         exit;
+    }
+  else
+    {
+      print "ERROR: no encounter with id='".$_REQUEST["encounter_nr"]."'$CRLF";
+      if( !isset($_REQUEST['GUI']) )
+         exit;
+    }
+  }else{
+       echo "Encounter nr. not found";
+       exit;
+  }
+}
+
+
+
+?>
+
+<hr>
+
+<h3>uplaod image</h3>
+
+<form method="post" enctype="multipart/form-data">
+<INPUT type="hidden" name="GUI" value="yes">
+<input type=radio name="function" value="getinfo">info
+<input type=radio name="function" value="save">save<br />
+encounter_nr: <input name="encounter_nr" value=""><br />
+<input type=file size=40 maxlength=2000000 name='imagefile' 
accept='image/*'><br />
+<input type=submit>
+</form>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Care2002-developers mailing list
Care2002-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/care2002-developers

Reply via email to