Documente Academic
Documente Profesional
Documente Cultură
<head>
<title>Pagina wed de bershy </title>
</head>
<body>
function daysBetween(date1, date2){
if (date1.indexOf("-") != -1) { date1 = date1.split("-"); } else if (date1.in
dexOf("/") != -1) { date1 = date1.split("/"); } else { return 0; }
if (date2.indexOf("-") != -1) { date2 = date2.split("-"); } else if (date2.in
dexOf("/") != -1) { date2 = date2.split("/"); } else { return 0; }
if (parseInt(date1[0], 10) >= 1000) {
var sDate = new Date(date1[0]+"/"+date1[1]+"/"+date1[2]);
} else if (parseInt(date1[2], 10) >= 1000) {
var sDate = new Date(date1[2]+"/"+date1[0]+"/"+date1[1]);
} else {
return 0;
}
if (parseInt(date2[0], 10) >= 1000) {
var eDate = new Date(date2[0]+"/"+date2[1]+"/"+date2[2]);
} else if (parseInt(date2[2], 10) >= 1000) {
var eDate = new Date(date2[2]+"/"+date2[0]+"/"+date2[1]);
} else {
return 0;
}
var one_day = 1000*60*60*24;
var daysApart = Math.abs(Math.ceil((sDate.getTime()-eDate.getTime())/one_day)
);
return daysApart;
}
</body>
<html>
----------------------------------------------------------------function getNumeroDeNits(){
var d1 = $('#datepicker1').val().split("-");
var dat1 = new Date(d1[2], parseFloat(d1[1])-1, parseFloat(d1[0]));
var d2 = $('#datepicker2').val().split("-");
var dat2 = new Date(d2[2], parseFloat(d2[1])-1, parseFloat(d2[0]));
var fin = dat2.getTime() - dat1.getTime();
var dias = Math.floor(fin / (1000 * 60 * 60 * 24))
return dias;
}
---------------------------------------------------------------------function dateDifference($d1, $d2){
$v1 = explode("-", $d1);
$date1 = mktime(0, 0, 0, intval($v1[1]), intval($v1[0]), intval($v1[2]));
$v2 = explode("-", $d2);
$date2 = mktime(0, 0, 0, intval($v2[1]), intval($v2[0]), intval($v2[2]));
$dateDiff = $date2 - $date1;
return floor($dateDiff/(60*60*24));
}
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
ar[11] = 31 // Diciembre
119
120
return ar[month];
121
}
--------------------------------------------------------------------
//Quinta celda
var quintacelda = filaactual.insertCell(4);
var cuadrotexto1 = document.createElement('input');
cuadrotexto1.type = 'text';
cuadrotexto1.name = 'txtfila' + iteracion;
cuadrotexto1.id = 'txtfila' + iteracion;
cuadrotexto1.size = 20;
cuadrotexto1.disabled = 'disabled';
// cuadrotexto1.onkeypress = keyPressTest;
quintacelda.appendChild(cuadrotexto1);
}
function quitarFila()
{
var tbl = document.getElementById('TablaCalculadora');
var ultimaFila = tbl.rows.length;
if (ultimaFila > 2) tbl.deleteRow(ultimaFila - 1);
}
</script>
<script type="text/javascript">
_uacct = "UA-83058-1";
urchinTracker();
</script>
<script>
function consumo() {
var CantidadPrecio = document.getElementById('precio0').options.
selectedIndex;
var Precio = document.getElementById('precio0').options[Cantidad
Precio].text;
var CantidadTI = document.getElementById('cantidad0').options.se
lectedIndex;
var Cantidad = document.getElementById('cantidad0').options[Cant
idadTI].text;
document.getElementById('txtfila0').value = Precio * Cantidad;
}
</script>
</head>
<body>
<br>
<h1>Sistema</h1>
<hr>
<br>
<form action="Calculadora.html" method="get">
<input type="button" value="Agregar" onclick="agregarFila();"/>
<input type="button" value="Eliminar" onclick="quitarFila();" />
<table border="0" id="TablaCalculadora">
<tr>
<td>No.</td>
<td>Descripción</td>
<td>Precio Unitario</td>
<td>Cantidad de equipos</td>
<td>Subtotal</td>
</tr>
<tr>
<td>1</td>
<td>
<select name="Descripcion0" id="Descripcion0" style="width:200px
">
<option value="valor1">Equipo de escritorio</option>
<option value="valor2">Servidor</option>
</select>
</td>
<td>
<select name="precio0" id="precio0" style="width:150px">
<option value="valor1">1</option>
<option value="valor2">2</option>
</select>
</td>
<td>
<select name="cantidad0" id="cantidad0" style="width:150px" onbl
ur="javascript:consumo()">
<option value="valor1">1</option>
<option value="valor2">2</option>
</select>
</td>
<td>
<input type="text" name="txtfila0" id="txtfila0" size="20" disab
led="disabled"/>
</td>
</tr>
</table>
</form>
</body>
</html>