Пример #1
0
function Guardar()
{
    $destinop = new DestinoCiudad();
    if (isset($_POST['nombre_destino']) && $_POST['nombre_destino'] != "") {
        $nombre = $_POST['nombre_destino'];
        $pais = $_POST['pais_destino'];
        $estatus = $_POST['estatus_destino_val'];
        //$belcorp = $_POST['ciudad_Belcorp'];
        if ($belcorp == "on") {
            $belcorpc = 1;
        } else {
            $belcorpc = 0;
        }
        $destinop->Nuevo_Destino($nombre, $pais, $estatus);
        header("Location: index.php?oksave");
    } else {
        header("Location: index.php?error");
    }
}
Пример #2
0
function Muestra()
{
    include "../../lib/php/messageResources.php";
    $INDEXIDIOMA = $_SESSION["idiomausuario"];
    $destinoc = new DestinoCiudad();
    if (isset($_GET['cd_id'])) {
        $id_destino = $_GET['cd_id'];
        $destinoc->Load_Destino($id_destino);
    } else {
        header("Location: index.php");
    }
    $I = new Interfaz("DestinoCiudad:: Editar Destino", true);
    ?>
<style type="text/css">
<!--
.Estilo1 {color: #FF0000}
-->
</style>
<script language="JavaScript" src="../../lib/js/jquery/jquery-1.3.2.js" type="text/javascript"></script>
<script language="JavaScript" src="../../lib/js/validateForm.js" type="text/javascript"></script>
<script language="JavaScript" src="../../lib/js/valida_form.js" type="text/javascript"></script>
<br><br>
	<form name="formCDestino" method="post" action="">
		<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][344];
    ?>
</strong></td>
		    </tr>
			<tr>
				<td align="right">&nbsp;</td>
				<td><input type="hidden" name="id_destino" id="id_destino" value="<?php 
    echo $id_destino;
    ?>
" readonly="readonly" style="border-color:#FFFFFF" /></td>
		    </tr>
			<tr>
				<td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][229];
    ?>
<span class="Estilo1">*</span>: 	</td>
                <td><input type="text" name="nombre_destino" id="nombre_destino" size="40" value="<?php 
    echo $destinoc->Get_dato("cd_nombre");
    ?>
" /></td>
			</tr>
			<tr>
				<td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][55];
    ?>
<span class="Estilo1">*</span>: </td>
				<td>
				<?
				$cnn = new conexion();
				$query = sprintf("SELECT pd_id, pd_nombre FROM pais_destino ORDER BY pd_id");
				$rst = $cnn->consultar($query);
				$fila = mysql_num_rows($rst);
				?>
				<select name="pais_destino" id="pais_destino">
					<option value="-1"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][346];
    ?>
</option>
					<?php 
    if ($fila > 0) {
        while ($fila = mysql_fetch_assoc($rst)) {
            ?>
								<option value="<?php 
            echo $fila['pd_id'];
            ?>
" <?php 
            if ($fila['pd_id'] == $destinoc->Get_dato('cd_pais')) {
                echo "selected = 'selected'";
            }
            ?>
><?php 
            echo $fila['pd_nombre'];
            ?>
</option>
					<?php 
        }
    } else {
        echo "<option id='-1' value='-1'>" . $LABELINDEX[$INDEXIDIOMA][347] . "</option>";
    }
    ?>
				</select>
				</td>
			</tr>
			<tr>
				<td align="right" width="30%"><?php 
    echo $LABELINDEX[$INDEXIDIOMA][28];
    ?>
: </td>
				<td><input type="checkbox" name="estatus_destino" id="estatus_destino" <?php 
    if ($destinoc->Get_dato("cd_estatus") == "1") {
        echo "checked='checked'";
    }
    ?>
 onclick="verEstatus_ciudad();" />
					<input type="hidden" name="estatus_destino_val" id="estatus_destino_val" value="<?php 
    echo $destinoc->Get_dato("cd_estatus");
    ?>
" /></td>
			</tr>
			<!--<tr>
				<td align="right" width="30%"><?php 
    //echo $LABELINDEX[$INDEXIDIOMA][343];
    ?>
:</td>
				<td><input type="checkbox" name="ciudad_Belcorp" id="ciudad_Belcorp" <?php 
    //if($destinoc->Get_dato("cd_belcorp") == 1){ echo "checked='checked'"; }
    ?>
/></td>
			</tr>-->
			<tr>
				<td colspan="2" align="center">
					<input type="submit" value="<?php 
    echo $LABELINDEX[$INDEXIDIOMA][345];
    ?>
" name="Actualizar" onclick="return validate_ciudad(); ">
				 	<input type="submit" value="<?php 
    echo $LABELINDEX[$INDEXIDIOMA][219];
    ?>
" name="Cancelar">				 	
				</td>
			</tr>
		</table>
</form>
<?php 
    $I->Footer();
}
Пример #3
0
            $destino_name = $_GET["destino"];
            $busqueda_value = "destino=" . $destino_name;
        }
        $I = new Interfaz("Empresa", true);
        $L = new Lista($busqueda_value);
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][340]);
        // Nombre
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][55]);
        // País
        $L->Cabeceras($LABELINDEX[$INDEXIDIOMA][28]);
        // Estatus
        $L->Herramientas("E", "./index.php?mode=EDITAR&cd_id=");
        include "../../lib/php/mnu_toolbar.php";
        ciudadd_toolbar();
        $query = "SELECT ciudad_destino.cd_nombre, pais_destino.pd_nombre, if(ciudad_destino.cd_estatus='1','" . $LABELINDEX[$INDEXIDIOMA][348] . "','" . $LABELINDEX[$INDEXIDIOMA][349] . "') as Estatus, ciudad_destino.cd_id FROM ciudad_destino INNER JOIN pais_destino ON ciudad_destino.cd_pais = pais_destino.pd_id WHERE cd_nombre LIKE '%" . $destino_name . "%' ORDER BY cd_id";
        $L->muestra_lista($query, 3, false, 3);
        $I->Footer();
        break;
    case "NUEVO":
        require_once "ciudadd_new.php";
        break;
    case "EDITAR":
        require_once "ciudadd_edit.php";
        break;
    case "ELIMINAR":
        $destino_ciudad = $_GET["cd_id"];
        $destinoc = new DestinoCiudad();
        $destinoc->Delete_Destino($destino_ciudad);
        header("Location: index.php");
        break;
}