public function procesaNuevo()
 {
     $hospedaje = new Hospedaje();
     $hospedaje->viatico_id = Input::get('viatico_id');
     $hospedaje->inst_hospedaje = Input::get('inst_hospedaje');
     $hospedaje->hotel = Input::get('hotel');
     $hospedaje->fechainicio_hotel = Input::get('fechainicio_hotel');
     $hospedaje->fechafin_hotel = Input::get('fechafin_hotel');
     $hospedaje->costo_hotel = Input::get('costo_hotel');
     $hospedaje->save();
 }
 public function run()
 {
     DB::table('hospedaje')->delete();
     $hospedaje = Hospedaje::create(array('fecha_inicio' => '2014-10-01', 'fecha_fin' => '2014-10-05', 'inst_hospedaje' => 'IFAI', 'costo' => '2500', 'hotel' => 'Marriot'));
     $viaticos = Viatico::where('id', '=', '1')->get();
     foreach ($viaticos as $viatico) {
         $viatico->hospedajes()->attach($hospedaje->id);
     }
     $hospedaje = Hospedaje::create(array('fecha_inicio' => '2014-09-15', 'fecha_fin' => '2014-09-17', 'inst_hospedaje' => 'PGR', 'costo' => '1500', 'hotel' => 'Baja Inn'));
     $viatico = Viatico::where('id', '=', '2')->get();
     foreach ($viaticos as $viatico) {
         $viatico->hospedajes()->attach($hospedaje->id);
     }
     $hospedaje = Hospedaje::create(array('fecha_inicio' => '2013-01-01', 'fecha_fin' => '2013-01-07', 'inst_hospedaje' => 'IFAI', 'costo' => '3500', 'hotel' => 'Otro Hotel'));
     $viatico = Viatico::where('id', '=', '3')->get();
     foreach ($viaticos as $viatico) {
         $viatico->hospedajes()->attach($hospedaje->id);
     }
     $hospedaje = Hospedaje::create(array('fecha_inicio' => '2014-08-01', 'fecha_fin' => '2014-08-05', 'inst_hospedaje' => 'Otro', 'costo' => '2500', 'hotel' => 'Misión'));
     $viatico = Viatico::where('id', '=', '4')->get();
     foreach ($viaticos as $viatico) {
         $viatico->hospedajes()->attach($hospedaje->id);
     }
     $hospedaje = Hospedaje::create(array('fecha_inicio' => '2014-10-01', 'fecha_fin' => '2014-10-05', 'inst_hospedaje' => 'IFAI', 'costo' => '5500', 'hotel' => 'Holiday Inn'));
     $viatico = Viatico::where('id', '=', '5')->get();
     foreach ($viaticos as $viatico) {
         $viatico->hospedajes()->attach($hospedaje->id);
     }
 }
Esempio n. 3
0
            if ($u_id != $datos["u_id"]) {
                $tramite->EnviaNotificacion($t_id, $mensaje, $u_id, $datos["u_id"], "1");
            }
        }
    }
    header("Location: ./index.php?id=" . $t_id);
}
if (isset($_POST['aceptar']) && isset($_POST['idI']) && $_POST['idI'] != "" && isset($_POST['iu']) && $_POST['iu'] != "") {
    $itinerario_id = $_POST['idI'];
    $usuario_id = $_POST['iu'];
    $tramite_id = $_POST['tramite'];
    $pais_destino_itinerario = $_POST['p_destino'];
    $pais_origen_itinerario = $_POST['p_origen'];
    $sql = "DELETE FROM hospedaje WHERE h_id_itinerario = {$itinerario_id}";
    $cnn->ejecutar($sql);
    $cotizacion = new Hospedaje();
    if (isset($_POST['rowCount']) || $_POST['rowCount'] != 0) {
        for ($i = 1; $i <= $_POST['rowCount']; $i++) {
            $ciudad_h = $_POST['ciudad' . $i];
            $hotel_h = $_POST['nombreHotel' . $i];
            $noches_h = $_POST['noches' . $i];
            $f_llegada_h = $_POST['f_llegada' . $i];
            $f_salida_h = $_POST['f_salida' . $i];
            $no_reservacion_h = $_POST['no_reservacion' . $i];
            $monto_noche_h = $_POST['monto_noche' . $i];
            $hr_llegada_h = $_POST['hr_llegada' . $i];
            $tipo_habitacion_h = $_POST['tipo_habitacion' . $i];
            $hr_salida_h = $_POST['hr_salida' . $i];
            $impuesto_cot_h = $_POST['impuesto_cotizacion' . $i];
            $f_llegada_mysql = fecha_to_mysql($f_llegada_h);
            $f_salida_mysql = fecha_to_mysql($f_salida_h);