[go: up one dir, main page]

Menu

[r19]: / modifyDoc.php  Maximize  Restore  History

Download this file

129 lines (112 with data), 5.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
$pageRef='Patients';
include('includes/header.php');
?>
<script>
function successInUpdatingDocF(result){
var args=result.evalJSON();
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in updating advice
}else{
//Failure in updating advice
}
}
//***********************************************
//* 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 failureInUpdatingDocF(){
}
//***********************************************
//* This function is an ajax request simulation.
//* **********************************************
function saveDocUpdate(docID){
docTitle = $F('docTitle');
if(formValidationRules.validate()){
OL_updateDoc_S(docID, docTitle, {onSuccess: 'successInUpdatingDocF', onFailure: 'failureInUpdatingDocF', formToSubmit: 'fileForm', targetElement: 'uploadIframe'})
}else{
alert('<?php echo _T("NI_modifyDoc_II"); ?>');
}
}
//function docSave(docID){
// $('fileForm').submit();
//}
function backToVisit(visitId){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/viewVisitDetailed.php?cl='+visitId;
}
</script>
<?php
$docId = $_GET[cl];
$getDoc = mysql_query("SELECT * FROM docs ORDER BY docs.docID=" . $docId);
while($row = mysql_fetch_array($getDoc)) {
$titoloDoc=$row[docTitle];
$pathDoc=$row[docPath];
$nameDoc=$row[docName];
$mimeDoc=$row[docMime];
}
$getVisit = mysql_query("SELECT * FROM docs WHERE docID='$docId'");
while($row = mysql_fetch_array($getVisit)) {
$visit=$row[docOwner];
}
?>
<div id="qResult" class="OpResult"></div>
<form method="POST" enctype="multipart/form-data" id="fileForm" name="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:saveDocUpdate('" . $docId . "');\">" . _T("Save changes") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:backToVisit('" . $visit . "');\">" . _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("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_modifyDoc_III") ?>" style="width:99%" type="text" id="docTitle" name="docTitle" value="<?php echo $titoloDoc ?>"></td> </tr>
<tr><td style="width:5%;"><?php echo _T("File") ?>:</td> <td><input style="width:99%" type="file" id="docPath" name="docPath" value="<?php echo $pathDoc ?>"></td> </tr>
<tr><td colspan="2"><b><?php echo _T("NI_modifyDoc_I") ?></b></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>