[go: up one dir, main page]

Menu

[r18]: / newQuestion.php  Maximize  Restore  History

Download this file

110 lines (96 with data), 4.6 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='Home';
include('includes/header.php');
?>
<script>
function successInCreatingQuestionF(transport){
var args=transport.responseText.evalJSON();
//Success in create request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in create operation
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/thanks.php';
}else{
//Failure in create operation
}
}
function failureInCreatingQuestionF(){
//Failure in create request
alert('<?php echo _T("NI_newQuestion_V"); ?>');
}
function createNewQuestion(){
var name = $F('qNome');
var surname = $F('qCognome');
var email = $F('qEmail');
var question = $F('qDomanda');
if(formValidationRules.validate()){
OL_createNewQuestion(name, surname, email, question, {onSuccess: successInCreatingQuestionF, onFailure: failureInCreatingQuestionF});
}else{
alert('<?php echo _T("NI_newQuestion_IV"); ?>');
}
}
function backToHome(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/index.php';
}
</script>
<div id="qResult" class="OpResult"></div>
<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:createNewQuestion();\">" . _T("Send question") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:backToHome();\">" . _T("Back to home") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<!-- *********************************************************** -->
<!-- * New question form * -->
<!-- *********************************************************** -->
<form id="formToValidate">
<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("Question") ?></span></span><div class="BlockContentBorder">
<table width="100%">
<tr><td style="width:5%;">(<?php echo _T("Name") ?>)</td> <td><input style="width: 95%" type="text" name="qNome" id="qNome"></td> </tr>
<tr><td style="width:5%;">(<?php echo _T("Surname") ?>)</td> <td><input style="width: 95%" type="text" name="qCognome" id="qCognome"></td> </tr>
<tr><td style="width:5%;"><?php echo _T("Em@il") ?></td> <td><input class="required validate-email" title="<?php echo _T("NI_newQuestion_II"); ?>" style="width: 95%" type="text" name="qEmail" id="qEmail"></td> </tr>
<tr><td style="width:5%;"><?php echo _T("Question") ?></td> <td><textarea class="required" title="<?php echo _T("NI_newQuestion_III"); ?>" style="width: 95%" name="qDomanda" id="qDomanda" rows="7"></textarea></td> </tr>
<tr><td colspan="2"><?php echo _T("NI_newQuestion_I") ?></td> </tr>
</table>
</div>
</div>
</div>
</form>
</div>
</div>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// **********************
// * init function/code *
// **********************
// <code>
// **************************
// * Install event handlers *
// **************************
Event.observe('qResult', 'mouseover', function(){OL_makeThisElementInvisible('qResult');});
// *********************
// * Install validator *
// *********************
formValidationRules = new Validation('formToValidate',{immediate:true, onSubmit:false, useTitles:true, stopOnFirst:false});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>