public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema[] = array("Field" => "especialidad", "Type" => "varchar(60)", "Null" => "NO", "Key" => "", "Default" => "", "Extra" => "");
     $esquema[] = array("Field" => "odontologo", "Type" => "varchar(60)", "Null" => "YES", "Key" => "", "Default" => NULL, "Extra" => "");
     return $esquema;
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Maestro::create([]);
     }
 }
Пример #3
0
 public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema[] = array("Field" => "descripcion_referencia", "Type" => "varchar(100)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "numero_pieza_dental", "Type" => "varchar(2)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     return $esquema;
 }
    public function createDetalle($id, $grupo_id)
    {
        $materia = DB::select('select * from materias
			join grupo_materia on materias.id = grupo_materia.materia_id
			where grupo_id = ?
			and status = 1', [$grupo_id]);
        $maestro = Maestro::where('status', '=', 1)->get();
        return View::make('registro-grupal-detalle.create', compact('materia', 'maestro', 'id'));
    }
Пример #5
0
 static function createMaestroObject($version, $options = FALSE)
 {
     if (!isset(self::$MAESTRO)) {
         // instance does not exist, so create it
         self::$MAESTRO = new self($version, $options);
     } else {
         return self::$MAESTRO;
     }
     return self::$MAESTRO;
 }
 public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema[] = array("Field" => "codigo_nomenclador", "Type" => "varchar(8)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "descripcion_nomenclador", "Type" => "varchar(100)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "numero_pieza_dental", "Type" => "varchar(2)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "codigo_nomenclador_paso", "Type" => "varchar(8)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "descripcion_nomenclador_paso", "Type" => "varchar(100)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "usuario_recibido_nombre", "Type" => "varchar(100)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     return $esquema;
 }
Пример #7
0
 public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema[] = array("Field" => "descripcion_referencia", "Type" => "varchar(100)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "numero_pieza_dental", "Type" => "varchar(2)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "requiere_pieza", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "requiere_cara", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "requiere_sector", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "multiples_piezas", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "imagen_odontograma_anterior", "Type" => "varchar(25)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     $esquema[] = array("Field" => "imagen_odontograma_arealizar", "Type" => "varchar(25)", "Null" => "YES", "Key" => "", "Default" => null, "Extra" => "");
     return $esquema;
 }
Пример #8
0
 public static function boot()
 {
     parent::boot();
     static::deleting(function ($ctacte) {
         // Delete all tricks that belong to this user
         foreach ($ctacte->lineas_factura()->get() as $lf) {
             $lf->delete();
         }
         foreach ($ctacte->lineas_recibo()->get() as $lr) {
             $lr->delete();
         }
         $ctacte->mov_caja()->first()->delete();
     });
     // Setup event bindings...
 }
Пример #9
0
 public function crearusuario()
 {
     $keys = array('id', 'nombre', 'apellidop', 'apellidom', 'correo', 'password', 'cel', 'rol');
     $post = $this->app->request->post();
     $response = array('codigo' => '', 'mensaje' => '');
     if (count($post) > 0) {
         $isValid = true;
         /*foreach ($keys as $key => $value) {
         			if (!array_key_exists($value, $post)) { $isValid = false; }
         		}*/
         if ($isValid) {
             $usuario = Usuarios::where('correo', '=', $post['correo'])->get();
             if ($post['id'] == 0) {
                 if (count($usuario) > 0) {
                     $response['codigo'] = 2;
                     $response['mensaje'] = 'Ya existe un usuario asociado a la cuenta de correo';
                 } else {
                     $db = Connection::getConnection();
                     $db::beginTransaction();
                     try {
                         $user = new Usuarios();
                         $user->nombre = $post['nombre'];
                         $user->apellidop = $post['apellidop'];
                         $user->apellidom = $post['apellidom'];
                         $user->correo = $post['correo'];
                         $user->password = $post['password'];
                         $user->cel = $post['cel'];
                         $user->save();
                         $usuario_rol = new UsuarioRol();
                         $usuario_rol->usuarios_id = $user->id;
                         $usuario_rol->rol_id = $post['rol'];
                         $usuario_rol->save();
                         $db::commit();
                         $response['codigo'] = 1;
                         $response['mensaje'] = 'Se guardó correctamente';
                     } catch (Exception $e) {
                         $db::rollback();
                         $response['codigo'] = 3;
                         $response['mensaje'] = $e->getMessage();
                     }
                 }
             } else {
                 if (count($usuario) > 0) {
                     $db = Connection::getConnection();
                     $db::beginTransaction();
                     try {
                         $usuario[0]->nombre = $post['nombre'];
                         $usuario[0]->apellidoP = $post['apellidop'];
                         $usuario[0]->apellidoM = $post['apellidom'];
                         $usuario[0]->correo = $post['correo'];
                         $usuario[0]->cel = $post['cel'];
                         $usuario[0]->save();
                         $maestro = new Maestro();
                         $maestro->id_maestro = $usuario->id;
                         $maestro->estados_id = $post['estados_id'];
                         $maestro->save();
                         $db::commit();
                         $response['codigo'] = 1;
                         $response['mensaje'] = 'Se guardó correctamente2';
                     } catch (Exception $e) {
                         $db::rollback();
                         $response['codigo'] = 3;
                         $response['mensaje'] = $e->getMessage();
                     }
                 } else {
                     $response['codigo'] = 4;
                     $response['mensaje'] = 'Usuario no encontrado';
                 }
             }
         } else {
             $response['codigo'] = 0;
             $response['mensaje'] = 'Debe enviar todos los parámetros';
         }
     } else {
         $response['codigo'] = 0;
         $response['mensaje'] = 'Debe enviar todos los parámetros';
     }
     echo json_encode($response);
 }
Пример #10
0
 public function run()
 {
     Maestro::create(['password' => 'cbtis', 'username' => 'usuario', 'email' => '*****@*****.**']);
 }
Пример #11
0
 public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema[] = array("Field" => "presento_queja", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => "0", "Extra" => "");
     $esquema[] = array("Field" => "tiene_hiv", "Type" => "tinyint(1)", "Null" => "YES", "Key" => "", "Default" => "0", "Extra" => "");
     $esquema[] = array("Field" => "edad", "Type" => "int (11)", "Null" => "YES", "Key" => "", "Default" => "0", "Extra" => "");
     //dd($esquema);
     return $esquema;
 }
Пример #12
0
 public function getEsquema()
 {
     $esquema = parent::getEsquema();
     $esquema1 = array_filter($esquema, function ($e) {
         return $e->Field != 'password';
     });
     return array($esquema1);
 }
Пример #13
0
 function processContent($taskid, $op, $object)
 {
     $node = $object;
     // For this task type, the object passed in, is the node object.
     $rec = db_select('maestro_queue')->fields('maestro_queue', array('process_id', 'template_data_id'))->condition('id', $node->maestro_taskid, '=')->execute()->fetchObject();
     if ($node->status == 1) {
         $status = MaestroContentStatusCodes::STATUS_PUBLISHED;
     } else {
         $status = 0;
     }
     $tracking_id = db_select('maestro_process')->fields('maestro_process', array('tracking_id'))->condition('id', $rec->process_id, '=')->execute()->fetchField();
     if ($op == 'insert') {
         db_insert('maestro_project_content')->fields(array('nid' => $node->nid, 'tracking_id' => $tracking_id, 'task_id' => $taskid, 'content_type' => $node->type, 'status' => $status))->execute();
         // Initiate the mestro workflow engine and complete the task
         // Complete task is an engine method
         $maestro = Maestro::createMaestroObject(1);
         $maestro->engine()->completeTask($taskid);
     }
 }
 public function listMaestros()
 {
     $maestros = Maestro::with('perfil')->get();
     foreach ($maestros as $key => $value) {
         $action = '/admin/maestro/' . $value->perfil->username;
         $value->perfil->action = $action;
     }
     //Utilities::printData($maestros);
     $this->view = new ListaMaestros($maestros);
     $this->view->display();
 }
 public function editAction($params)
 {
     $curso_id = strip_tags(htmlspecialchars($params['curso']));
     $curso_id = intval($curso_id);
     $curso_id = filter_var($curso_id, FILTER_VALIDATE_INT);
     $maestro_id = strip_tags(htmlspecialchars($params['maestro']));
     $maestro_id = intval($maestro_id);
     $maestro_id = filter_var($maestro_id, FILTER_VALIDATE_INT);
     $nombre = strip_tags(htmlspecialchars($params['post']['nombre_curso']));
     $nombre_curso = strip_tags(htmlspecialchars($params['post']['nombre_curso']));
     $descripcion = strip_tags(htmlspecialchars($params['post']['descr_curso']));
     $fecha_termino = strip_tags(htmlspecialchars($params['post']['fecha_termino']));
     if (!$curso_id) {
         $this->app->redirect($this->app->urlFor('Index'));
     }
     $curso = Cuso::find($curso_id);
     $maestro = Maestro::find($maestro_id);
     if (count($curso) == 0) {
         $this->app->redirect($this->app->urlFor('Index'));
     }
     if (count($maestro) == 0) {
         $this->app->redirect($this->app->urlFor('Index'));
     }
     if (strcmp($nombre, '') == 0) {
         $this->app->redirect('/curso/' . $curso->curso_id . '/edit?attempt=1');
     }
 }