[go: up one dir, main page]

Menu

[r21]: / newSupplier.php  Maximize  Restore  History

Download this file

116 lines (101 with data), 5.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
109
110
111
112
113
114
115
<?php
$pageRef='Stock';
include('includes/header.php');
?>
<script>
function successInCreatingSupplierF(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/suppliers.php';
}else{
//Failure in create operation
}
}
function failureInCreatingSupplierF(){
//Failure in create request
alert('<?php echo _T("NI_newSupplier_I"); ?>');
}
function createSupplier(){
var name = $F('name'); //01
var add1 = $F('add1'); //02
var add2 = $F('add2'); //03
var add3 = $F('add3'); //04
var telephone = $F('telephone'); //05
var fax = $F('fax'); //06
var mobile = $F('mobile'); //07
var website = $F('website'); //08
var email = $F('email'); //09
var referent = $F('referent'); //10
//Validazione dati
if(formValidationRules.validate()){
OL_createNewSupplier(name, add1, add2, add3, telephone, fax, mobile, website, email, referent, {onSuccess: successInCreatingSupplierF, onFailure: failureInCreatingSupplierF});
}else{
// ***************************************************************************************************************************************************
// * Alert sentence: 'There are invalid fields (look at tips in the form)'
// ***************************************************************************************************************************************************
alert('<?php echo _T("NI_newSupplier_II"); ?>');
}
}
function supplierList(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/suppliers.php';
}
</script>
<div id="qResult" class="OpResult"></div>
<div class="Columns">
<div class="Column1">
<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:createSupplier();\">" . _T("Save supplier") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:supplierList();\">" . _T("Supplier list") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<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("New supplier") ?></span></span><div class="BlockContentBorder">
<table width="100%">
<tr><td width="10%"><b><?php echo _T("Name") ?> :</b></td><td><input type="text" class="required" title="<?php echo _T("NI_newSupplier_III") ?>" style="width:100%" id="name"></td></tr>
<tr><td width="10%"><b><?php echo _T("Address") ?>1 :</b></td><td><input type="text" style="width:100%" id="add1"></td></tr>
<tr><td width="10%"><b><?php echo _T("Address") ?>2 :</b></td><td><input type="text" style="width:100%" id="add2"></td></tr>
<tr><td width="10%"><b><?php echo _T("Address") ?>3 :</b></td><td><input type="text" style="width:100%" id="add3"></td></tr>
<tr><td width="10%"><b><?php echo _T("Telephone") ?> :</b></td><td><input type="text" class="validate-number" title="<?php echo _T("NI_newSupplier_IV") ?>" style="width:100%" id="telephone"></td></tr>
<tr><td width="10%"><b><?php echo _T("Fax") ?> :</b></td><td><input type="text" class="validate-number" title="<?php echo _T("NI_newSupplier_V") ?>" style="width:100%" id="fax"></td></tr>
<tr><td width="10%"><b><?php echo _T("Mobile") ?> :</b></td><td><input type="text" class="validate-number" title="<?php echo _T("NI_newSupplier_VI") ?>" style="width:100%" id="mobile"></td></tr>
<tr><td width="10%"><b><?php echo _T("Website") ?> :</b></td><td><input type="text" style="width:100%" id="website"></td></tr>
<tr><td width="10%"><b><?php echo _T("Em@il") ?> :</b></td><td><input type="text" class="validate-email" title="<?php echo _T("NI_newSupplier_VII") ?>" style="width:100%" id="email"></td></tr>
<tr><td width="10%"><b><?php echo _T("Referent") ?> :</b></td><td><input type="text" style="width:100%" id="referent"></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(){
// **************************
// * 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>