<?php
$pageRef='Patients';
include('includes/header.php');
?>
<script>
function successInCreatingDocF(result){
var args=result.evalJSON();
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in creating doc
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/viewVisitDetailed.php?cl=<?php echo $_GET[cl] ?>';
}else{
//Failure in creating doc
}
}
//***********************************************
//* This function will be never call. This
//* function during ajax request is called if
//* the request fails. In this case we are
//* simulating ajax request and we can not know
//* if the request is going on or not. Maybe a
//* timeout will make the wrong request
//* detectable.
//* **********************************************
function failureInCreatingDocF(){
}
//***********************************************
//* This function is an ajax request simulation.
//* **********************************************
function createDoc(visitId){
docTitle = $F('docTitle');
if(formValidationRules.validate()){
OL_createDoc_S(visitId, docTitle, {onSuccess: 'successInCreatingDocF', onFailure: 'failureInCreatingDocF', formToSubmit: 'fileForm', targetElement: 'uploadIframe'})
}else{
alert('<?php echo _T("NI_newDoc_I"); ?>');
}
}
function docAdd(){
$('fileForm').submit();
}
function backToVisit(visitId){
window.location.href='http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/viewVisitDetailed.php?cl='+visitId;
}
</script>
<div id="qResult" class="OpResult"></div>
<form method="POST" enctype="multipart/form-data" name="fileForm" id="fileForm">
<div class="Columns">
<div class="Column1">
<!-- *********************************************************** -->
<!-- * Menu tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Actions") ?></span></span><div class="BlockContentBorder">
<ul>
<?php echo "<li><a href=\"javascript:createDoc('" . $_GET[cl] . "');\">" . _T("New document") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:backToVisit('" . $_GET[cl] . "');\">" . _T("Back to visit") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<!-- *********************************************************** -->
<!-- * Document tab * -->
<!-- *********************************************************** -->
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("New document") ?></span></span><div class="BlockContentBorder">
<table width="100%">
<tr><td style="width:5%;"><?php echo _T("Title") ?>:</td> <td><input class="required" title="<?php echo _T("NI_newDoc_II") ?>" style="width:99%;" type="text" name="docTitle" id="docTitle"></td> </tr>
<tr><td style="width:5%;"><?php echo _T("Path") ?>:</td> <td><input class="required" title="<?php echo _T("NI_newDoc_III") ?>" style="width:99%;" type="file" name="docPath" id="docPath"></td> </tr>
</table>
</div>
</div>
</div>
</div>
</div>
<iframe style="display:none;" id="uploadIframe" name="uploadIframe" src="#"></iframe>
</form>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// **************************
// * Install event handlers *
// **************************
Event.observe('qResult', 'mouseover', function(){OL_makeThisElementInvisible('qResult');});
// *********************
// * Install validator *
// *********************
formValidationRules = new Validation('fileForm',{immediate:true, onSubmit:false, useTitles:true, stopOnFirst:false});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>