Exemple #1
0
 public function registrarServicio($descripcion, $metodo, $tiempo_entrega, $cantM_x_ensayo, $tarifa, $tarifa_Acred, $detalle)
 {
     $resultado = array('valor' => 1, 'message' => 'Servicio Registrado correctamente.');
     $servicio = new Servicio();
     $servicio->descripcion = $descripcion;
     $servicio->metodo = $metodo;
     $servicio->tiempo_entrega = $tiempo_entrega;
     $servicio->cantM_x_ensayo = $cantM_x_ensayo;
     $servicio->tarifa = $tarifa;
     $servicio->tarifa_Acred = $tarifa_Acred;
     $servicio->detalle = $detalle;
     if (!$servicio->save()) {
         $resultado = array('valor' => 0, 'message' => 'No hemos podido Registrar el servicio, intentelo nuevamente');
     }
     return $resultado;
 }
 /**
  * Display a listing of the searched resource.
  *
  * @return Response
  */
 public function search()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["search_nombre"] = Input::get('search_nombre');
             $data["search_categoria"] = Input::get('search_categoria');
             $data["search_servicio_clinico"] = Input::get('search_servicio_clinico');
             $data["search_departamento"] = Input::get('search_departamento');
             $data["search_responsable"] = Input::get('search_responsable');
             $data["search_fecha_ini"] = Input::get('search_fecha_ini');
             $data["search_fecha_fin"] = Input::get('search_fecha_fin');
             $data["categorias"] = ProyectoCategoria::all()->lists('nombre', 'id');
             $data["servicios"] = Servicio::all()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::all()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["reportes_data"] = Proyecto::searchReporte($data['search_nombre'], $data['search_categoria'], $data['search_servicio_clinico'], $data['search_departamento'], $data['search_responsable'], $data["search_fecha_ini"], $data["search_fecha_fin"]);
             $data["proyectos_data"] = $data["reportes_data"]->paginate(10);
             return View::make('investigacion.proyecto.documentacion.index', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Servicio::create([]);
     }
 }
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->collExpedientehistorials) {
             foreach ($this->collExpedientehistorials as $o) {
                 $o->clearAllReferences($deep);
             }
         }
         if ($this->aExpediente instanceof Persistent) {
             $this->aExpediente->clearAllReferences($deep);
         }
         if ($this->aServicio instanceof Persistent) {
             $this->aServicio->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     if ($this->collExpedientehistorials instanceof PropelCollection) {
         $this->collExpedientehistorials->clearIterator();
     }
     $this->collExpedientehistorials = null;
     $this->aExpediente = null;
     $this->aServicio = null;
 }
Exemple #5
0
 function getSectorEmpresas(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $data = Parametros::select("*")->first();
     $km = $data["diametro_busqueda"];
     $idSector = $request->getAttribute("id");
     $lat = $request->getAttribute("latitud");
     $lng = $request->getAttribute("longitud");
     $query = "SELECT " . "(6371 * ACOS( SIN(RADIANS(su.latitud)) * SIN(RADIANS({$lat})) + COS(RADIANS(su.longitud - {$lng})) * " . "COS(RADIANS(su.latitud)) * COS(RADIANS({$lat})))) AS distancia, " . "em.id, " . "em.nit, " . "em.razonSocial, " . "em.logo, " . "'' as servicios " . "FROM sucursal su " . "INNER JOIN " . "empresa em ON (em.id = su.idEmpresa) " . "INNER JOIN " . "sectorempresa secemp ON (secemp.idEmpresa = em.id && secemp.idSector =  {$idSector}) " . "WHERE su.Estado = 'ACTIVO' AND em.estado = 'ACTIVO' " . "HAVING distancia < {$km} ORDER BY distancia ASC";
     $data = DB::select(DB::raw($query));
     for ($i = 0; $i < count($data); $i++) {
         $val = "";
         $ser = Servicio::select("nombre")->where("idEmpresa", "=", $data[$i]->id)->get();
         $tam = count($ser);
         for ($j = 0; $j < $tam; $j++) {
             $val .= $ser[$j]->nombre;
             if ($j + 1 < $tam) {
                 $val .= ",";
             }
         }
         $data[$i]->servicios = $val;
     }
     $response->getBody()->write(json_encode($data));
     return $response;
 }
Exemple #6
0
 public function destroy($id)
 {
     $servicio = Servicio::find($id);
     $servicio->delete();
     Session::flash('message', "El servicio Eliminado Correctamente...!");
     Session::flash('class', 'success');
     return Redirect::to('servicio');
 }
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->aProveedoritrade instanceof Persistent) {
             $this->aProveedoritrade->clearAllReferences($deep);
         }
         if ($this->aServicio instanceof Persistent) {
             $this->aServicio->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aProveedoritrade = null;
     $this->aServicio = null;
 }
 public function serversideAction()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         //EL MAPEO DE NUESTRA TABALA
         $table_map = array(0 => 'servicio_nombre', 1 => 'servicio_tipo', 2 => 'servicio_medio');
         $post_data = $request->getPost();
         //NUESTRA QUERY
         $query = new \ServicioQuery();
         //ORDER
         if (isset($post_data['order'])) {
             $order = $table_map[$post_data['order'][0]['column']];
             $dir = $post_data['order'][0]['dir'];
             $query->orderBy($order, $dir);
         } else {
             $query->orderByIdservicio(\Criteria::DESC);
         }
         if (!empty($post_data['search']['value'])) {
             $search = $post_data['search']['value'];
             $c = new \Criteria();
             $c1 = $c->getNewCriterion('servicio.servicio_tipo', '%' . $search . '%', \Criteria::LIKE);
             $c2 = $c->getNewCriterion('servicio.servicio_medio', '%' . $search . '%', \Criteria::LIKE);
             $c3 = $c->getNewCriterion('servicio.servicio_nombre', '%' . $search . '%', \Criteria::LIKE);
             $c4 = $c->getNewCriterion('servicio.servicio_descripcion', '%' . $search . '%', \Criteria::LIKE);
             $c1->addOr($c2)->addOr($c3)->addOr($c4);
             $query->addAnd($c1);
         }
         //EL TOTAL DE LA BUSQUEDA
         $recordsFiltered = $query->count();
         //LIMIT
         $query->setOffset((int) $post_data['start']);
         $query->setLimit((int) $post_data['length']);
         //DAMOS EL FORMATO CORRECTO
         $data = array();
         $value = new \Servicio();
         foreach ($query->find() as $value) {
             $tmp['DT_RowId'] = $value->getIdservicio();
             $tmp['servicio_nombre'] = $value->getServicioNombre();
             $tmp['servicio_tipo'] = $value->getServicioTipo();
             $tmp['servicio_medio'] = $value->getServicioMedio();
             $tmp['servicio_descripcion'] = $value->getServicioDescripcion();
             $tmp['servicio_options'] = '<a data-toggle="tooltip" data-placement="left" title="Editar" href="/catalogo/servicios/editar/' . $value->getIdservicio() . '"><i class="fa fa-pencil"></i></a>';
             $data[] = $tmp;
         }
         //El arreglo que regresamos
         $json_data = array("draw" => (int) $post_data['draw'], "recordsFiltered" => $recordsFiltered, "data" => $data, "page" => $post_data['url_params']['page']);
         return $this->getResponse()->setContent(json_encode($json_data));
     }
 }
 public function actionAjaxAccionMantenimiento()
 {
     $Accion = $_POST['Accion'];
     $descripcion = $_POST['descripcion'];
     $descripcion = $_POST['descripcion'];
     $metodo = $_POST['metodo'];
     $tiempo_entrega = $_POST['tiempo_entrega'];
     $cantM_x_ensayo = $_POST['cantM_x_ensayo'];
     $tarifa = $_POST['tarifa'];
     $tarifa_Acred = $_POST['tarifa_Acred'];
     $detalle = $_POST['detalle'];
     if ($Accion == 'Registrar') {
         $respuesta = Servicio::model()->registrarServicio($descripcion, $metodo, $tiempo_entrega, $cantM_x_ensayo, $tarifa, $tarifa_Acred, $detalle);
     } elseif ($Accion == 'Actualizar') {
         $idServicio = $_POST['idServicio'];
         $respuesta = Servicio::model()->actualizarServicio($idServicio, $descripcion, $metodo, $tiempo_entrega, $cantM_x_ensayo, $tarifa, $tarifa_Acred, $detalle);
     }
     Util::renderJSON(array('success' => $respuesta));
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["categorias"] = ProyectoCategoria::all()->lists('nombre', 'id');
             $data["servicios"] = Servicio::all()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::all()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["tipos"] = [0 => "Seleccione", 1 => 'Clínico', 2 => 'Hospitalario'];
             return View::make('investigacion.requerimientos_clinicos.create', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
Exemple #11
0
 /**
  * Resets all references to other model objects or collections of model objects.
  *
  * This method is a user-space workaround for PHP's inability to garbage collect
  * objects with circular references (even in PHP 5.3). This is currently necessary
  * when using Propel in certain daemon or large-volume/high-memory operations.
  *
  * @param boolean $deep Whether to also clear the references on all referrer objects.
  */
 public function clearAllReferences($deep = false)
 {
     if ($deep && !$this->alreadyInClearAllReferencesDeep) {
         $this->alreadyInClearAllReferencesDeep = true;
         if ($this->aAdmision instanceof Persistent) {
             $this->aAdmision->clearAllReferences($deep);
         }
         if ($this->aLugarinventario instanceof Persistent) {
             $this->aLugarinventario->clearAllReferences($deep);
         }
         if ($this->aServicio instanceof Persistent) {
             $this->aServicio->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aAdmision = null;
     $this->aLugarinventario = null;
     $this->aServicio = null;
 }
 public function render_create_programacion_guias()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["areas"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["tipo_reporte_ts"] = SubtipoDocumentoInf::where('id_tipo', '4')->lists('nombre', 'id');
             //TS
             $data["tipo_reporte_etes"] = TipoReporteETES::lists('nombre', 'idtipo_reporte_ETES');
             $data["reporte_cn_info"] = null;
             return View::make('investigacion/programacion/createProgramacionGuia', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["categorias"] = ProyectoCategoria::orderBy('nombre')->get()->lists('nombre', 'id');
             $data["servicios"] = Servicio::orderBy('nombre')->get()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::orderBy('nombre')->get()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["plan"] = PlanAprendizaje::find($id);
             return View::make('investigacion.proyecto.plan_aprendizaje.edit', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function render_view_iper($tipo = null, $id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if (($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) && $id) {
             if ($tipo == 1) {
                 $data["servicios"] = Servicio::orderBy('nombre', 'asc')->lists('nombre', 'idservicio');
             } else {
                 $data["entornos"] = EntornoAsistencial::lists('nombre', 'id');
             }
             $data["periodicidades"] = array('I' => 'Inicial', 'P' => 'Periodica');
             $data["tipo"] = $tipo;
             $data["iper_data"] = Iper::getIperById($id, $tipo)->get();
             if ($data["iper_data"]->isEmpty()) {
                 return Redirect::to('ipers/list_ipers_ts');
             }
             $data["iper_data"] = $data["iper_data"][0];
             $data["detalles_data"] = DetalleIper::getDetallesByIdIper($data["iper_data"]->id)->get();
             return View::make('riesgos/ipers/viewIperTS', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function search_activos()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["servicios"] = Servicio::orderBy('nombre', 'asc')->lists('nombre', 'idservicio');
             $data["areas"] = Area::lists('nombre', 'idarea');
             $data["grupos"] = Grupo::lists('nombre', 'idgrupo');
             $data["codigo_patrimonial"] = Input::get('codigo_patrimonial');
             $data["nombre_equipo"] = Input::get('nombre_equipo');
             $data["servicio"] = Input::get('servicio');
             $data["area"] = Input::get('area');
             $data["grupo"] = Input::get('grupo');
             if ($data["codigo_patrimonial"] == null && $data["nombre_equipo"] == null && $data["servicio"] == null && $data["area"] == null && $data["grupo"] == null) {
                 $data["equipos_data"] = [];
             } else {
                 $data["equipos_data"] = Activo::searchActivosCalibracion($data["codigo_patrimonial"], $data["nombre_equipo"], $data["area"], $data["servicio"], $data["grupo"])->get();
             }
             if (count($data["equipos_data"]) > 50) {
                 Session::flash('error', 'La búsqueda retornó más de 50 resultados, se recomienda realizar una búsqueda más detallada.');
                 return Redirect::to('reportes_calibracion/create_reporte');
             }
             return View::make('riesgos/reporte_calibracion/createReporteCalibracion', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
Exemple #16
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param Servicio $obj A Servicio object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getIdservicio();
         }
         // if key === null
         ServicioPeer::$instances[$key] = $obj;
     }
 }
 public function edit_certificado_personal($id = null)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 7 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
             $data["personal"] = PersonalCapacitacion::find($id);
             $data["id_capacitacion"] = $data["personal"]->id_capacitacion;
             $data["personal"]->id_departamento = Servicio::find($data["personal"]->id_servicio)->departamento->idarea;
             $data["departamentos"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["tipos_documentos"] = TipoDocumento::lists('nombre', 'idtipo_documento');
             return View::make('rrhh.certificaciones_capacitaciones.editCertificadoPersonal', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
Exemple #18
0
 function form_agregar()
 {
     $respuesta = new stdClass();
     $this->form_validation->set_rules('codigo', 'Código', 'trim|required|min_length[5]|max_length[8]|callback_valida_codigo');
     $this->form_validation->set_rules('nombre', 'Nombre', 'trim|required');
     $this->form_validation->set_rules('mision', 'Misión', 'trim|required');
     $this->form_validation->set_rules('entidad_codigo', 'Entidad', 'trim|required');
     if ($this->form_validation->run() == TRUE) {
         $servicio = new Servicio();
         $servicio->codigo = $this->input->post('codigo');
         $servicio->nombre = $this->input->post('nombre');
         $servicio->sigla = $this->input->post('sigla');
         $servicio->url = $this->input->post('url');
         $servicio->responsable = $this->input->post('responsable');
         $servicio->entidad_codigo = $this->input->post('entidad_codigo');
         $servicio->mision = $this->input->post('mision');
         $servicio->sector_codigo = $this->input->post('sector_codigo') ? $this->input->post('sector_codigo') : '00';
         $servicio->setTagsFromArray($this->input->post('tags'));
         $servicio->save();
         $this->session->set_flashdata('message', 'Servicio agregado exitosamente! :)');
         $respuesta->validacion = TRUE;
         $respuesta->redirect = site_url('backend/servicios/');
     } else {
         $respuesta->validacion = FALSE;
         $respuesta->errores = validation_errors('<p class="error">', '</p>');
     }
     echo json_encode($respuesta);
 }
Exemple #19
0
 function getAllservicios(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $data = Servicio::select('id as idServicio', 'nombre')->where('estado', '=', 'ACTIVO')->get();
     if (count($data) == 0) {
         $response = $response->withStatus(404);
     }
     $response->getBody()->write($data);
     return $response;
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["categorias"] = ProyectoCategoria::all()->lists('nombre', 'id');
             $data["servicios"] = Servicio::all()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::all()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["dimensiones"] = Dimension::all();
             $data["reporte"] = ReporteDesarrollo::find($id);
             //var_dump($data["reporte"]->indicador);
             $arreglo = [];
             foreach ($data["reporte"]->indicador as $indicador) {
                 if (isset($arreglo[$indicador->dimension_id])) {
                     array_push($arreglo[$indicador->dimension_id], $indicador);
                 } else {
                     $arreglo[$indicador->dimension_id] = [$indicador];
                 }
             }
             $data["indicadores"] = $arreglo;
             return View::make('investigacion.reportes.desarrollo.edit', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
             $data["nombres"] = Perfil::where('id_rol', 2)->orderBy('nombres')->get()->lists('UserFullName', 'id');
             $data["tipos"] = RHTipo::all()->lists('nombre', 'id');
             $data["modalidades"] = RHModalidad::all()->lists('nombre', 'id');
             $data["departamentos"] = Area::lists('nombre', 'idarea');
             $data["servicios"] = Servicio::lists('nombre', 'idservicio');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["programacion"] = ProgramacionInternado::find($id);
             $ini = Carbon\Carbon::now()->startOfMonth();
             $end = Carbon\Carbon::now()->startOfMonth()->addMonth();
             while ($ini->month != $end->month) {
                 $dia = $ini->format('Y-m-d');
                 $temp = ProgramacionInternado::where('fecha_ini', '<=', $dia)->where('fecha_fin', '>=', $dia)->get();
                 if (!$temp->isEmpty()) {
                     foreach ($temp as $var) {
                         $dayEvents[$var->id] = $var;
                     }
                     $dias[$dia] = ["number" => $temp->count(), "badgeClass" => "badge-warning", "dayEvents" => $dayEvents];
                 } else {
                     $dias[$dia] = null;
                 }
                 $ini = $ini->addDay();
             }
             $dias = json_encode($dias);
             $data["dias"] = $dias;
             return View::make('rrhh.programacion_internado.edit', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 public function search_oferta_expediente()
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
             $data["search_codigo_compra"] = Input::get('search_codigo_compra');
             $data["search_fecha_ini"] = Input::get('search_fecha_ini');
             $data["search_fecha_fin"] = Input::get('search_fecha_fin');
             $data["search_usuario"] = Input::get('search_usuario');
             $data["search_area"] = Input::get('search_area');
             $data["search_servicio"] = Input::get('search_servicio');
             $data["areas"] = Area::orderBy('nombre', 'asc')->lists('nombre', 'idarea');
             $data["servicios"] = Servicio::orderBy('nombre', 'asc')->lists('nombre', 'idservicio');
             $data["ofertas_expediente_data"] = OfertaExpediente::searchOfertaExpediente($data["search_codigo_compra"], $data["search_usuario"], $data["search_area"], $data["search_servicio"], $data["search_fecha_ini"], $data["search_fecha_fin"])->paginate(10);
             return View::make('oferta_expediente/listOfertaExpediente', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
 /**
  * Filter the query by a related Servicio object
  *
  * @param   Servicio|PropelObjectCollection $servicio The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 ExpedienteservicioQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByServicio($servicio, $comparison = null)
 {
     if ($servicio instanceof Servicio) {
         return $this->addUsingAlias(ExpedienteservicioPeer::IDSERVICIO, $servicio->getIdservicio(), $comparison);
     } elseif ($servicio instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ExpedienteservicioPeer::IDSERVICIO, $servicio->toKeyValue('PrimaryKey', 'Idservicio'), $comparison);
     } else {
         throw new PropelException('filterByServicio() only accepts arguments of type Servicio or PropelCollection');
     }
 }
Exemple #24
0
 public function reserva2()
 {
     $servicios = Servicio::all();
     return View::make('cliente.reserva2');
 }
 public function getTodoServiciosAjax()
 {
     if (!Request::ajax() || !Auth::check()) {
         return Response::json(array('success' => false), 200);
     }
     $id = Auth::id();
     $data["inside_url"] = Config::get('app.inside_url');
     $data["user"] = Session::get('user');
     if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
         // Check if the current user is the "System Admin"
         $data = Input::get('id_departamento');
         if ($data != 0) {
             $servicios = Servicio::lists('nombre', 'idservicio');
         } else {
             $servicios = array();
         }
         return Response::json(array('success' => true, 'servicios' => $servicios), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }
Exemple #26
0
 public function actionAjaxListarServiciosxProducto()
 {
     $idProducto = $_POST['idProducto'];
     $servicios = Servicio::model()->ListarServiciosxProducto($idProducto);
     Util::renderJSON($servicios);
 }
 public function return_area()
 {
     if (!Request::ajax() || !Auth::check()) {
         return Response::json(array('success' => false), 200);
     }
     $id = Auth::id();
     $data["inside_url"] = Config::get('app.inside_url');
     $data["user"] = Session::get('user');
     if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4) {
         // Check if the current user is the "System Admin"
         $data = Input::get('selected_id');
         if ($data != "vacio") {
             $servicio = Servicio::where('idservicio', '=', $data)->get();
         } else {
             $servicio = null;
         }
         return Response::json(array('success' => true, 'servicio' => $servicio), 200);
     } else {
         return Response::json(array('success' => false), 200);
     }
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     if (Auth::check()) {
         $data["inside_url"] = Config::get('app.inside_url');
         $data["user"] = Session::get('user');
         // Verifico si el usuario es un Webmaster
         if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 7 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
             $data["servicios"] = Servicio::all()->lists('nombre', 'idservicio');
             $data["departamentos"] = Area::all()->lists('nombre', 'idarea');
             $data["usuarios"] = User::orderBy('nombre')->get()->lists('UserFullName', 'id');
             $data["cronograma"] = TrabajoCronograma::find($id);
             return View::make('investigacion.trabajo.show', $data);
         } else {
             return View::make('error/error', $data);
         }
     } else {
         return View::make('error/error', $data);
     }
 }
    public function export_pdf()
    {
        if (Auth::check()) {
            $data["inside_url"] = Config::get('app.inside_url');
            $data["user"] = Session::get('user');
            // Verifico si el usuario es un Webmaster
            if ($data["user"]->idrol == 1 || $data["user"]->idrol == 2 || $data["user"]->idrol == 3 || $data["user"]->idrol == 4 || $data["user"]->idrol == 5 || $data["user"]->idrol == 6 || $data["user"]->idrol == 7 || $data["user"]->idrol == 8 || $data["user"]->idrol == 9 || $data["user"]->idrol == 10 || $data["user"]->idrol == 11 || $data["user"]->idrol == 12) {
                $solicitud_id = Input::get('solicitud_id');
                $solicitud = SolicitudCompra::find($solicitud_id);
                if ($solicitud == null) {
                    $url = "solicitudes_compra/edit_solicitud_compra" . "/" . $solicitud_id;
                    return Redirect::to($url);
                }
                $servicio = Servicio::find($solicitud->idservicio);
                $familia = FamiliaActivo::find($solicitud->idfamilia_activo);
                $usuario = User::find($solicitud->id_responsable);
                $tipo_solicitud = TipoSolicitudCompra::find($solicitud->idtipo_solicitud_compra);
                $estado = Estado::find($solicitud->idestado);
                $documento = Documento::searchDocumentoByIdSolicitudCompra($solicitud_id)->get();
                $documento = $documento[0];
                $detalle_solicitud = DetalleSolicitudCompra::getDetalleSolicitudCompra($solicitud_id)->get();
                $size = count($detalle_solicitud);
                $table = '<table style="width:100%">' . '<tr><th>Descripcion</th><th>Marca</th><th>Modelo</th><th>Serie/Numero Parte</th><th>Cantidad</th></tr>';
                for ($i = 0; $i < $size; $i++) {
                    $detalle = $detalle_solicitud[$i];
                    $table = $table . '<tr>' . '<td>' . $detalle->descripcion . '</td>' . '<td>' . $detalle->modelo . '</td>' . '<td>' . $detalle->marca . '</td>' . '<td>' . $detalle->serie_parte . '</td>' . '<td>' . $detalle->cantidad . '</td>' . '</tr>';
                }
                $table = $table . '</table>';
                $html = '<html><head><style>' . 'table, th, td {
    						border: 1px solid black;
    						border-collapse: collapse;
						}' . 'th, td {
							text-align: center;
						}' . '.lista_generales{
							list-style-type:none;
							border:1px solid black;
							width:100%;
						}' . 'li{
							margin-bottom:5px;
							margin-left:-15px;
						}' . '.nombre_general{
							width:100%;
						}' . '#titulo{
							text-align:center;
							margin-top:60px;
							position:fixed;
						}' . '#logo{
							padding:10px 10px 10px 10px;	
						}' . '</style>
						</head>' . '<div class="nombre_general"><img id="logo" src="img/logo_uib.jpg" ></img><h2 id="titulo" >Requerimiento de Compra: N°' . $solicitud->idsolicitud_compra . '</h2></div>' . '<div>' . '<ul class="lista_generales">' . '<li><label><strong>Numero Orden de Mantenimiento</strong></label>: OT N° ' . $solicitud->idordenes_trabajo . '</li>' . '<li><label><strong>Servicio: </strong></label>' . $servicio->nombre . '</li>' . '<li><label><strong>Nombre del Equipo: </strong></label>' . $familia->nombre_equipo . '</li>' . '<li><label><strong>Usuario Responsable: </strong></label>' . $usuario->apellido_pat . ' ' . $usuario->apellido_mat . ', ' . $usuario->nombre . '</li>' . '<li><label><strong>Tipo de Requerimiento: </strong></label>' . $tipo_solicitud->nombre . '</li>' . '<li><label><strong>Fecha: </strong></label>' . $solicitud->fecha . '</li>' . '<li><label><strong>Estado: </strong></label>' . $estado->nombre . '</li>' . '<li><label><strong>Sustento: </strong></label>' . $solicitud->sustento . '</li>' . '<li><label><strong>Reporte de Necesidad: </strong></label>' . $documento->codigo_archivamiento . '</li>' . '</ul></div>' . '<div>' . $table . '</div>' . '</html>';
                return PDF::load($html, "A4", "portrait")->show();
            } else {
                return View::make('error/error', $data);
            }
        } else {
            return View::make('error/error', $data);
        }
    }
Exemple #30
0
 /**
  * Exclude object from result
  *
  * @param   Servicio $servicio Object to remove from the list of results
  *
  * @return ServicioQuery The current query, for fluid interface
  */
 public function prune($servicio = null)
 {
     if ($servicio) {
         $this->addUsingAlias(ServicioPeer::IDSERVICIO, $servicio->getIdservicio(), Criteria::NOT_EQUAL);
     }
     return $this;
 }