|
Directory : /home/zjabogados/public_html/otrosscripts/ |
<?php require_once('../../Connections/zyz.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysqli_real_escape_string") ? mysqli_real_escape_string($theValue) : mysqli_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
session_start();
$motorBD = $_SESSION['motorBD'];
$idusuario = $_SESSION['idusuario'];
require_once("../Libs/functionsjava.htm");
require_once("../Libs/functionsextra.php");
if (isset($_POST['paso'])) {
$paso = $_POST['paso'];
}
else {
$paso = 0;
}
if (isset($_POST['tb_caso_pesificacion'])) {
$tb_caso_pesificacion = $_POST['tb_caso_pesificacion'];
}
else {
$tb_caso_pesificacion = $_GET['tb_caso_pesificacion'];
}
if (isset($_POST['id_accionado_pesificacion'])) {
$id_accionado_pesificacion = $_POST['id_accionado_pesificacion'];
}
else {
$id_accionado_pesificacion = $_GET['id_accionado_pesificacion'];
}
if (isset($_POST['acc'])) {
$acc = $_POST['acc'];
}
else {
$acc = $_GET['acc'];
}
$desabilitado = '';
if ($acc == 'I') {
$etiqueta_boton = 'Agregar';
}
if ($acc == 'M') {
$etiqueta_boton = 'Modificar';
}
if ($acc == 'B') {
$etiqueta_boton = 'Borrar';
$desabilitado = 'disabled = "disabled"';
}
if ($paso == 1) {
$tb_banco = DarFormato($_POST['tb_banco'], 'n');
$abogado = DarFormato($_POST['abogado'], 'c');
$tel_abogado = DarFormato($_POST['tel_abogado'], 'c');
$sucursal = DarFormato($_POST['sucursal'], 'c');
$domicilio_de_la_sucursal = DarFormato($_POST['domicilio_de_la_sucursal'], 'c');
$telefonos = DarFormato($_POST['telefonos'], 'c');
$fax = DarFormato($_POST['fax'], 'c');
$observaciones = DarFormato($_POST['observaciones'], 'c');
if ($acc == 'I') {
$sql = "Insert Into tb_accionado_pesificacion (tb_caso_pesificacion, tb_banco, abogado, tel_abogado, sucursal, domicilio_de_la_sucursal, telefonos, fax, observaciones) VALUES ($tb_caso_pesificacion, $tb_banco, $abogado, $tel_abogado, $sucursal, $domicilio_de_la_sucursal, $telefonos, $fax, $observaciones)";
mysqli_query($zyz, $sql) or die(mysqli_error());
}
if ($acc == 'M') {
$sql = "UPDATE tb_accionado_pesificacion SET tb_banco = $tb_banco, abogado = $abogado, tel_abogado = $tel_abogado, sucursal = $sucursal, domicilio_de_la_sucursal = $domicilio_de_la_sucursal, telefonos = $telefonos, fax = $fax, observaciones = $observaciones WHERE id_accionado_pesificacion = $id_accionado_pesificacion";
mysqli_query($zyz, $sql) or die(mysqli_error());
}
if ($acc == 'B') {
$sql = "DELETE FROM tb_accionado_pesificacion WHERE id_accionado_pesificacion = $id_accionado_pesificacion";
mysqli_query($zyz, $sql) or die(mysqli_error());
}
?>
<script language="JavaScript">
opener.parent.rightFrame.document.form_actualizar.valor.value = '';
opener.parent.rightFrame.document.form_actualizar.campo.value = 'otra';
opener.parent.rightFrame.document.form_actualizar.acc.value = 'R';
opener.parent.rightFrame.document.form_actualizar.submit();
window.close();
</script>
<?php
}
?>
<?php
$colname_rs_accionado = "-1";
if (isset($id_accionado_pesificacion)) {
$colname_rs_accionado = $id_accionado_pesificacion;
}
mysqli_select_db($zyz, $database_zyz);
$query_rs_accionado = sprintf("SELECT * FROM tb_accionado_pesificacion WHERE id_accionado_pesificacion = %s", GetSQLValueString($colname_rs_accionado, "int"));
$rs_accionado = mysqli_query($zyz, $query_rs_accionado) or die(mysqli_error());
$row_rs_accionado = mysqli_fetch_assoc($rs_accionado);
$totalRows_rs_accionado = mysqli_num_rows($rs_accionado);
mysqli_select_db($zyz, $database_zyz);
$query_rs_banco = "SELECT id_banco, nombre_o_razon_social banco FROM tb_banco ORDER BY nombre_o_razon_social";
$rs_banco = mysqli_query($zyz, $query_rs_banco) or die(mysqli_error());
$row_rs_banco = mysqli_fetch_assoc($rs_banco);
$totalRows_rs_banco = mysqli_num_rows($rs_banco);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><!-- InstanceBegin template="/Templates/Contenido.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Documento sin título</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
margin-left: 0px;
margin-top: 0px;
}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
}
-->
</style>
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.Estilo1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
<!-- InstanceEndEditable -->
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="10">
<tr>
<td><!-- InstanceBeginEditable name="Contenido" -->
<table width="450" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28"><img src="../img/tabla_tit_izq.jpg" width="28" height="40"></td>
<td valign="bottom" background="../img/tabla_tit_med.jpg"><table border="0" cellspacing="8" cellpadding="1">
<tr>
<td><span class="Estilo1">ACCIONADOS DEL CASO </span> </td>
</tr>
</table></td>
<td width="28"><img src="../img/tabla_tit_der.jpg" width="28" height="40"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="13" background="../img/tabla_cont_izq.jpg"> </td>
<td bgcolor="#9EC6EA"><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td><form method="post" name="form1" onsubmit="CalcularMontoCuota(); return Chequear(this);">
<table align="center">
<tr valign="baseline">
<td align="right" valign="top" nowrap>Banco:</td>
<td valign="top"><label>
<select name="tb_banco" id="Banco">
<?php
do {
?>
<option value="<?php echo $row_rs_banco['id_banco']?>"<?php if (!(strcmp($row_rs_banco['id_banco'], $row_rs_accionado['tb_banco']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_banco['banco']?></option>
<?php
} while ($row_rs_banco = mysqli_fetch_assoc($rs_banco));
$rows = mysqli_num_rows($rs_banco);
if($rows > 0) {
mysqli_data_seek($rs_banco, 0);
$row_rs_banco = mysqli_fetch_assoc($rs_banco);
}
?>
</select>
</label>
* </td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Abogado:</td>
<td><label>
<input name="abogado" type="text" id="Abogado" value="<?php echo $row_rs_accionado['abogado']; ?>">
</label></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Tel Abogado:</td>
<td><input name="tel_abogado" type="text" id="Tel abogado" value="<?php echo $row_rs_accionado['tel_abogado']; ?>"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Sucursal:</td>
<td><input name="sucursal" type="text" id="sucursal" value="<?php echo $row_rs_accionado['sucursal']; ?>" class="NO varchar">
*</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Domicilio de la sucursal:</td>
<td><input name="domicilio_de_la_sucursal" type="text" id="Domicilio de la sucursal" value="<?php echo $row_rs_accionado['domicilio_de_la_sucursal']; ?>"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Telefonos:</td>
<td><input name="telefonos" type="text" id="telefonos" value="<?php echo $row_rs_accionado['telefonos']; ?>"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Fax:</td>
<td><input name="fax" type="text" id="fax" value="<?php echo $row_rs_accionado['fax']; ?>"></td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap>Observaciones:</td>
<td><textarea name="observaciones" id="Observaciones"><?php echo $row_rs_accionado['observaciones']; ?></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><input name="acc" type="hidden" id="acc" value="<?php echo $acc ?>" size="32">
<input name="id_accionado_pesificacion" type="hidden" value="<?php echo $id_accionado_pesificacion ?>">
<input name="tb_caso_pesificacion" type="hidden" value="<?php echo $tb_caso_pesificacion ?>">
<input name="paso" type="hidden" id="paso" value="<?php echo $paso+1 ?>" size="32"></td>
<td><input type="submit" value="<?php echo $etiqueta_boton ?>"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td> </td>
</tr>
</table>
</form>
</td>
</tr>
</table></td>
<td width="13" background="../img/tabla_cont_der.jpg"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28"><img src="../img/tabla_pie_izq2.jpg" width="28" height="19"></td>
<td background="../img/tabla_pie_med2.jpg"> </td>
<td width="28"><img src="../img/tabla_pie_der2.jpg" width="28" height="19"></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- InstanceEndEditable --></td>
</tr>
</table></td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
<?php
mysqli_free_result($rs_accionado);
mysqli_free_result($rs_banco);
?>