Beispiel #1
0
function Guardar()
{
    $clasedoc = new Clasedoc();
    if (isset($_POST['nombre']) && $_POST['nombre'] != "") {
        $nombre = $_POST['nombre'];
        $descripcion = $_POST['descripcion'];
        $tipo = $_POST['tipo'];
        $pais = $_POST['pais'];
        $clasificacion = $_POST['clasificacion'];
        $definicion = $_POST['definicionvalue'];
        $estatus = $_POST['estatus'];
        if ($estatus == "on") {
            $clasedoc->Nueva_Clasedoc($nombre, $descripcion, $tipo, $pais, $clasificacion, $definicion, "1");
        } else {
            $clasedoc->Nueva_Clasedoc($nombre, $descripcion, $tipo, $pais, $clasificacion, $definicion, "0");
        }
        header("Location: index.php?oksave");
    } else {
        header("Location: index.php?error");
    }
}
Beispiel #2
0
function Muestra()
{
    $clasedoc = new Clasedoc();
    if (isset($_GET['cd_id'])) {
        $clasedoc_id = $_GET['cd_id'];
        $clasedoc->Load_Clasedoc($clasedoc_id);
    } else {
        header("Location: index.php?cd_id=" . $clasedoc_id);
    }
    $I = new Interfaz("Clasedoc:: Editar Clasedoc", true);
    global $LABELINDEX, $INDEXIDIOMA;
    ?>
<style type="text/css">
<!--
.Estilo1 {color: #FF0000}
-->
</style>
<script src="../../lib/js/jquery/jquery-1.3.2.js" type="text/javascript"></script>
<script src="../../lib/js/validateForm.js" type="text/javascript"></script>
<script  src="js/validaformcd.js" type="text/javascript"></script>

<br><br>
			<form name="form1" method="post">
			<table width="80%" align="center" cellpadding="4" cellspacing="4" border="0" bgcolor="#f4f4f4" style="padding-top: 20px;">
				 <tr>
				   <td align="right">&nbsp;</td>
				   <td><strong><?php 
    echo $LABELINDEX[$INDEXIDIOMA][418];
    ?>
</strong></td>
                 </tr>
				 <tr>
                    <td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][411];
    ?>
<span class="Estilo1">*</span>:</td><td> <input type="text" name="nombre" id="nombre" size="40" value="<?php 
    echo $clasedoc->Get_Dato("cd_nombre");
    ?>
"/></td>
                 </tr>
                 <tr>
                    <td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][413];
    ?>
<span class="Estilo1"></span>:</td><td> <input type="text" name="descripcion" id="descripcion" size="40" value="<?php 
    echo $clasedoc->Get_Dato("cd_descripcion");
    ?>
"/></td>
                 </tr>
                 <tr>
                    <td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][414];
    ?>
<span class="Estilo1">*</span>:</td><td> <select name="tipo" id="tipo" >                    
                     <option value="-1">Seleccione</option>
		             <?php 
    if (strcmp($clasedoc->Get_Dato("cd_tipo"), "0") == 0) {
        echo "<option value='0' selected>Extranjero</option>";
        echo "<option value='1'>Nacional</option>";
    } else {
        echo "<option value='0'>Extranjero</option>";
        echo "<option value='1' selected>Nacional</option>";
    }
    ?>
                    </td>
                 </tr>
                 <tr>
                    <td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][415];
    ?>
<span class="Estilo1">*</span>:</td>
                    <td>
                    <?
						$cnn = new conexion();
						$query = sprintf("SELECT p_id, p_nombre FROM pais ORDER BY p_id");
						$rst = $cnn->consultar($query);
						$fila = mysql_num_rows($rst);
						?>
				<select name="pais" id="pais">
					<option value="-1"> Seleccione </option>
					<?php 
    if ($fila > 0) {
        while ($fila = mysql_fetch_assoc($rst)) {
            if (strcmp($clasedoc->Get_Dato("cd_pais"), $fila["p_id"]) == 0) {
                echo "<option value=" . $fila["p_id"] . "  selected >" . $fila["p_nombre"] . "</option>";
            } else {
                echo "<option value=" . $fila["p_id"] . ">" . $fila["p_nombre"] . "</option>";
            }
        }
    } else {
        echo "<option id='-1' value='-1'>No hay paises</option>";
    }
    ?>
				</select>
                    </td>
                 </tr>
                 <tr>
                    <td align="right" width="30%">
                    <?php 
    echo $LABELINDEX[$INDEXIDIOMA][416];
    ?>
                    <span class="Estilo1">*</span>:</td><td>
                    <?php 
    if ($clasedoc->Get_Dato("cd_definicion") == 1) {
        echo "Concepto:<input type='radio'  name='radioDef' value='1' checked onclick='validacion();'/>";
        echo "Documento:<input type='radio' name='radioDef'  value='2' onclick='validacion();'/>";
    } else {
        echo "Concepto:<input type='radio'  name='radioDef' value='1'  onclick='validacion();'/>";
        echo "Documento:<input type='radio' name='radioDef'  value='2' checked onclick='validacion();'/>";
    }
    ?>
                     </td>
                 </tr>
          		<tr>
       		     <td align="right" width="30%">                
       		     <?php 
    if ($clasedoc->Get_Dato("cd_definicion") == 1) {
        echo "<div id='clasificacionDIV'>";
    } else {
        echo "<div id='clasificacionDIV' style='display:none;'>";
    }
    ?>
	
                	<?php 
    echo $LABELINDEX[$INDEXIDIOMA][417];
    ?>
:</div>
                </td>
                
                   <td>
                    <?
						$cnn = new conexion();
						$query = sprintf("SELECT c_id,c_nombre,c_estatus from clasificacion ORDER BY c_id");
						$rst = $cnn->consultar($query);
						$fila = mysql_num_rows($rst);
						?>
					<?php 
    if ($clasedoc->Get_Dato("cd_definicion") == 1) {
        echo "<div id='clasificacionDIV2'>";
    } else {
        echo "<div id='clasificacionDIV2' style='display:none;'>";
    }
    ?>
	
               														
					<select name="clasificacion" id="clasificacion">
					<option value="-1"> Seleccione </option>
					<?php 
    if ($fila > 0) {
        while ($fila = mysql_fetch_assoc($rst)) {
            if (strcmp($clasedoc->Get_Dato("cd_clasificacion"), $fila["c_id"]) == 0) {
                echo "<option value=" . $fila["c_id"] . " selected >" . $fila["c_nombre"] . "</option>";
            } else {
                echo "<option value=" . $fila["c_id"] . "  >" . $fila["c_nombre"] . "</option>";
            }
        }
    } else {
        echo "<option id='-1' value='-1'>No hay clasificaciones</option>";
    }
    ?>
				</select>
				</div>
                </td>
                    
                 </tr>
				<tr>
				 	<td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][412];
    ?>
:</td>
				 	<td> 
				 	<?php 
    if ($clasedoc->Get_Dato("cd_estatus") == 1) {
        echo "<input type='checkbox' name='estatus' id='estatus' checked/>";
    } else {
        echo "<input type='checkbox' name='estatus' id='estatus'/>";
    }
    ?>
				 	</td>				 	
				</tr>
				 <tr><td colspan="2">&nbsp;</td></tr>
				 <tr>
				 	<td colspan="2" align="center">
				 		<input type="submit" value="<?php 
    echo $LABELINDEX[$INDEXIDIOMA][345];
    ?>
" name="Actualizar" onclick="return validateClasedoc();">
 						<input type="submit" value="<?php 
    echo $LABELINDEX[$INDEXIDIOMA][219];
    ?>
" name="Cancelar">			 	
				 		</td>
				 </tr>
			</table>
			<input type="hidden" name="definicionvalue" id="definicionvalue" value='<?php 
    echo $clasedoc->Get_Dato("cd_definicion");
    ?>
' />
			<input type="hidden" name="cd_id" id="cd_id" value='<?php 
    $_GET["cd_id"];
    ?>
'/>
        </form>

<?php 
    $I->Footer();
}
Beispiel #3
0
        // Nombre
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][55]);
        // País
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][652]);
        // Definido por
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][412]);
        // Estatus
        $L->Herramientas("E", "./index.php?mode=edit&cd_id=");
        include "../../lib/php/mnu_toolbar.php";
        clasedoc_toolbar();
        $query = "SELECT if (cd_definicion=1,(select c_nombre from clasificacion where c_id=cd_clasificacion),cd_descripcion) as descripcion , if (cd_tipo=0, 'Ext','Nal')as cd_tipo,cd_nombre, (select p_codigo from pais where p_id=cd_pais) as cd_pais , if (cd_definicion=1,'" . $LABELINDEX[$INDEXIDIOMA][34] . "','" . $LABELINDEX[$INDEXIDIOMA][650] . "') as cd_definicion2, if(cd_estatus=1,'" . $LABELINDEX[$INDEXIDIOMA][348] . "','" . $LABELINDEX[$INDEXIDIOMA][349] . "') as status,cd_id FROM clase_doc WHERE cd_nombre LIKE '%" . $clasedoc_name . "%' ORDER BY cd_id";
        error_log($query);
        $L->muestra_lista($query, 6, false, 6);
        $I->Footer();
        break;
    case "new":
        require_once "clasedoc_new.php";
        break;
    case "edit":
        require_once "clasedoc_edit.php";
        break;
    case "delete":
        $clasedoc_id = $_GET["cd_id"];
        $clasedoc = new Clasedoc();
        $clasedoc->Delete_Clasedoc($cluster_id);
        header("Location: index.php");
        break;
}
?>