[go: up one dir, main page]

Menu

[r19]: / newAdvice.php  Maximize  Restore  History

Download this file

110 lines (97 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
<?php
$pageRef='Customer care';
include('includes/header.php');
?>
<script>
function successInCreatingAdviceF(result){
var args=result.evalJSON();
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in creating advice
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/advices.php';
}else{
//Failure in creating 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 failureInCreatingAdviceF(){
}
//***********************************************
//* This function is an ajax request simulation.
//* **********************************************
function createAdvice(){
titoloAnnuncio = $F('titoloAnnuncio');
contenutoAnnuncio = $F('contenutoAnnuncio');
if(formValidationRules.validate()){
OL_createAdvice_S(titoloAnnuncio, contenutoAnnuncio, {onSuccess: 'successInCreatingAdviceF', onFailure: 'failureInCreatingAdviceF', formToSubmit: 'myForm', targetElement: 'uploadIframe'})
}else{
alert('<?php echo _T("NI_newAdvice_I"); ?>');
}
}
function backToAdvices(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/advices.php';
}
</script>
<div id="qResult" class="OpResult"></div>
<form method="POST" enctype="multipart/form-data" name="myForm" id="myForm">
<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:createAdvice();\">" . _T("Save advice") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:backToAdvices();\">" . _T("Back to advice management") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<!-- *********************************************************** -->
<!-- * Advice 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 advice") ?></span></span><div class="BlockContentBorder">
<table width="100%">
<tr valign="top"><td style="width: 5%;"><b><?php echo _T("Title") ?></b></td> <td><input class="required" title="<?php echo _T("NI_newAdvice_II") ?>" type="text" id="titoloAnnuncio" name="titoloAnnuncio" style="width:95%;"> </td> </tr>
<tr valign="top"><td style="width: 5%;"><b><?php echo _T("Image") ?></b></td> <td><input class="required" title="<?php echo _T("NI_newAdvice_III") ?>" type="file" id="pathImgAnnuncio" name="pathImgAnnuncio" style="width:95%;"> </td> </tr>
<tr valign="top"><td style="width: 5%;"><b><?php echo _T("Content") ?></b></td> <td><textarea class="required" title="<?php echo _T("NI_newAdvice_IV") ?>" id="contenutoAnnuncio" name="contenutoAnnuncio" style="width:95%;" rows="20"></textarea> </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('myForm',{immediate:true, onSubmit:false, useTitles:true, stopOnFirst:false});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>