[go: up one dir, main page]

Menu

[r17]: / advices.php  Maximize  Restore  History

Download this file

115 lines (96 with data), 4.3 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
<?php
$pageRef='Customer care';
include('includes/header.php');
?>
<script>
function toCustomerCare(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/customerCare.php';
}
function createNewAdvice(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/newAdvice.php';
}
function setAdviceEventHandlers(){
setTimeout("$$('a.aAdviceModify').each(function(s){Event.observe(s,'click',function(){modifyAdvice(s);})})", 1);
setTimeout("$$('a.aAdviceDelete').each(function(s){Event.observe(s,'click',function(){deleteAdvice(s);})})", 1);
}
function successInDeletingAdviceF(transport){
var args=transport.responseText.evalJSON();
//Success in delete request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in delete operation
OL_advicesTableLoad('w', {elementToFill: 'advicesTable', onSuccess: setAdviceEventHandlers});
}else{
//Failure in delete operation
}
}
function failureInDeletingAdviceF(){
//Failure in delete request
alert('<?php echo _T("NI_advices_II"); ?>');
}
function deleteAdvice(elem){
var args = elem.name.split("_");
var advID = args[0];
var advTitle = args[1];
// ***************************************************************************************************************************************************
// * Confirm sentence: 'Eliminare annuncio \"'+advTitle+'\"?\n\nNOTA: il testo andrÓ perso'
// ***************************************************************************************************************************************************
answer = confirm('<?php echo _T("NI_advices_I"); ?>');
if(answer != 0){
OL_deleteAdvice(advID, {onSuccess: successInDeletingAdviceF, onFailure: failureInDeletingAdviceF});
}else{
}
}
function modifyAdvice(elem){
var args = elem.name.split("_");
var advID = args[0];
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/viewAdviceDetailed.php?advID='+advID;
}
</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:createNewAdvice();\">" . _T("New advice") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:toCustomerCare();\">" . _T("Back to customer care") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn" id="advicesTable">
<!-- *********************************************************** -->
<!-- * Advices table * -->
<!-- *********************************************************** -->
</div>
</div>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// *****************************************
// * Load advices table for the first time *
// *****************************************
OL_advicesTableLoad('w', {elementToFill: 'advicesTable', onSuccess: setAdviceEventHandlers});
// **************************
// * 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>
</div>
</div>
</div>
</body>
</html>