session_start(); $_SESSION["numero"] = $_POST['NumOC']; $_SESSION["fechaoc"] = $_POST['FechaOC']; $_SESSION["fechatope"] = $_POST['fecha_tope']; $_SESSION["codigoD"] = $_POST['CodigoD']; $_SESSION["nombreD"] = $_POST['NombreD']; $_SESSION["solicitante"] = $_POST['SolicitanteOC']; $_SESSION["observacion"] = $_POST['ObservacionesOC']; $rut1 = $_POST['rutp1']; $rut2 = $_POST['rutp2']; $rut = $rut1 . '-' . $rut2; $nombreP = $_POST['NombreP']; $direccionP = $_POST['direccionP']; $cuidadP = $_POST['ciudadP']; $ciu = new ciudad(); $arrc = $ciu->Select2($cuidadP); $rowciudad = mysql_fetch_array($arrc); $telefonoP = $_POST['telefonoP']; $ContactoP = $_POST['contactoP']; $idciudad = $rowciudad['ID_CIUDAD']; $prov = new proveedor(); $row = $prov->Select($rut); $action = mysql_fetch_array($row); if ($action == null) { $prov->Add($rut, $idciudad, $nombreP, $direccionP, $ContactoP, $telefonoP); } include 'IngresarOCBD.php'; $arr = $_SESSION["list"]; $size = $_SESSION["size"]; $fecha = time(); $fechaactual = date("Y-m-d h:m:s", $fecha);
<?php include "../ReglasNegocio/ciudad.php"; $ciudad = $_POST["ciudad"]; $hd_variable = $_POST["hd_variable"]; $id_variable = $_POST["id_variable"]; //echo $hd_variable."<br>"; $city = new ciudad(); if (empty($ciudad)) { header("Location: paso.php?c=z"); } elseif ($hd_variable == "ingresar") { $value = $city->Select2($ciudad); if ($value != 0) { $value = $city->Add($ciudad); } header("Location: paso.php?c=z"); //echo "insercion";} } elseif ($hd_variable == "editar") { $value = $city->Update($id_variable, $ciudad); header("Location: paso.php?c=z"); //echo "edicion"; }