public function editarQpon($id) { // $rules = array( // "nombre" => "required", // "descripcion" => "required", // "latitud" => "required", // "longitud" => "required", // "vigenciaHasta" => "required" // ); // $messages = array( // "required" => "Por favor ingresa un :attribute", // "descripcion.required" => "Por favor ingresa una descripcion", // "latitud.required" => "Por favor ingresa una latitud", // "longitud.required" => "Por favor ingresa una longitud", // "vigenciaHasta.required" => "Por favor ingresa una vigencia" // ); // $validator = Validator::make(Input::all(), $rules, $messages); // if($validator->fails()) { // return Redirect::to("qpones/editar/" . $id) // ->withErrors($validator); // } // else { $qpon = Qpon::find($id); $categorias = CategoriasQpon::lists('nombre', 'id'); $negocios = Negocio::lists('nombre', 'id'); return View::make('qpones.editar', array('qpon' => $qpon, 'categorias' => $categorias, 'negocios' => $negocios)); //} }
public function show($id) { $categoria = Negocio::find($id); //$anioMes = strftime("%Y%m",strtotime($negocio->created_at)); //echo $anioMes; //echo " ".$negocio->id; $imagenes = $negocio->imagenes; return View::make('negocios.show')->with('negocio', $negocio)->with('imagenes', $imagenes); }
public static function findPlace($nombre = false, $ubicacion = false) { $busqueda = Negocio::select('*'); if ($ubicacion) { $busqueda->where(DB::raw('concat_ws(" ", calle, numeroExterior, numeroInterior,colonia, cp, delegacion, ciudad, municipio, estado, pais)'), 'like', '%' . $ubicacion . '%'); } if ($nombre) { $busqueda->where('nombre', 'like', $nombre); } return $busqueda->first(); }
public function uploadFile() { $negocio = Negocio::find(Input::get('negocio_id')); $anioMes = strftime("%Y%m", strtotime($negocio->created_at)); if (Input::hasFile('file')) { $file = Input::file('file'); $extension = $file->getClientOriginalExtension(); $name = $file->getClientOriginalName(); $filename = md5(date("Ymdhis")); if ($extension == 'jpg' || $extension == 'png' || $extension == 'jpeg') { $SimplePath = checkPath($anioMes, $negocio->id, 3); // 3 = imagenes $path = public_path() . '/' . $SimplePath; $image = Image::make(Input::file('file')->getRealPath()); $image->fit(1280, 480); //3x $filename3x = $filename . '@3x.' . $extension; $image->save($path . '/' . $filename3x); $image->fit(640, 240); //2x $filename2x = $filename . '@2x.' . $extension; $image->save($path . '/' . $filename2x); $image->fit(320, 120); //1x $filename1x = $filename . '.' . $extension; $image->save($path . '/' . $filename1x); $imagenNegocio = new Imagen(); $imagenNegocio->imagen = $anioMes . '/' . $negocio->id . '/imagenes/' . $filename1x; $imagenNegocio->save(); if ($negocio->imagenes()->save($imagenNegocio)) { return Response::json(["response" => "ok", "img" => $anioMes . '/' . $negocio->id . '/imagenes/' . $filename1x]); } else { return Response::json(["response" => "error"]); } } } else { return Response::json(["response" => "error"]); } }
public function run() { foreach (range(1, 1) as $index) { Negocio::create(['descripcion' => 'Universidad Mayor', 'id_estado' => 1]); } }
<?php require '../backend/print_pdf_class.php'; require '../backend/config/db.php'; require '../backend/negocio.class.php'; $negocio = new Negocio(); $orden = $_GET["orden"]; $out = ''; $query1 = "\nSELECT * FROM factura_maestra\n WHERE numero_orden = '{$orden}'"; $result1 = mysql_query($query1); $tipo = ''; while ($data1 = mysql_fetch_array($result1)) { $tipo = $data1["tipo"]; $subtotal = $data1["subtotal"]; $itbis = $data1["itbis"]; $impuesto = $subtotal * $itbis / 100; $total = $subtotal + $impuesto; $subtotal = number_format($subtotal, 2); $impuesto = number_format($impuesto, 2); $total = number_format($total, 2); if ($tipo == 'factura') { $label = "Factura"; } else { if ($tipo == 'cotizacion') { $label = "Cotizacion"; } } //BEGIN SHOW $mfax = ''; $mwhatsapp = ''; $memail = '';