Пример #1
0
 public function ver($id_caja = NULL)
 {
     $this->cargar_header_y_principal();
     if ($id_caja === NULL) {
         $data['titulo'] = 'Movimientos de cajas';
         $movimientos = $this->movimiento_caja_model->obtener_movimientos_table();
         $resultado;
         if (!empty($movimientos)) {
             $this->load->helper('date');
             $this->load->library('table');
             $this->table->set_template(array('table_open' => '<table class="table">'));
             $this->table->set_heading('Caja', 'Importe', 'Concepto', 'Fecha', 'Descripción', 'Usuario');
             foreach ($movimientos as $indice => $fila) {
                 $movimientos[$indice]['fecha'] = transform_date($fila['fecha']);
             }
             $resultado = '<div class="table-responsive">' . $this->table->generate($movimientos) . '</div>';
         } else {
             $resultado = '<h4>No se encontraron resultados</h4>';
         }
         $data['contenido'] = $resultado;
     } else {
         $caja = $this->caja_model->obtener_caja_por_id($id_caja);
         $movimientos = $this->movimiento_caja_model->obtener_movimientos_por_caja_table($id_caja);
         $data['titulo'] = 'Movimientos de ' . ($caja != NULL ? $caja->descripcion : 'caja');
         if (empty($movimientos) || $movimientos === NULL) {
             $data['contenido'] = '<h4>No se encontraron movimientos para la caja seleccionada</h4>';
         } else {
             $this->load->helper('date');
             $this->load->library('table');
             $this->table->set_template(array('table_open' => '<table class="table">'));
             $this->table->set_heading('Importe', 'Concepto', 'Fecha', 'Descripción', 'Usuario');
             foreach ($movimientos as $indice => $fila) {
                 $movimientos[$indice]['fecha'] = transform_date($fila['fecha']);
             }
             $data['contenido'] = '<div class="table-responsive">' . $this->table->generate($movimientos) . '</div>';
         }
     }
     $this->load->view('movimientos_caja/ver', $data);
     $this->load->view('templates/footer');
 }
Пример #2
0
 public function ver($id_cliente = NULL)
 {
     $this->cargar_header_y_principal();
     if ($id_cliente === NULL) {
         $data['titulo'] = 'Clientes';
         $clientes = $this->cliente_model->obtener_clientes();
         $resultado;
         if (!empty($clientes)) {
             $this->load->library('table');
             $this->load->helper('url');
             // Cargo helper para usar función anchor
             $this->load->helper('date');
             $this->table->set_heading('Nombre', 'Apellido', 'Teléfono', 'Fecha de alta', '');
             $this->table->set_template(array('table_open' => '<table class="table">'));
             $this->table->set_empty('-');
             foreach ($clientes as $indice_fila => $fila) {
                 $clientes[$indice_fila]['id'] = anchor('clientes/ver/' . $fila['id'], 'Ver', 'class="btn btn-info"');
                 //Permite generar el link para ver el cliente particular
                 $clientes[$indice_fila]['fecha_alta'] = transform_date($fila['fecha_alta'], '/');
             }
             $resultado = '<div class="table-responsive">' . $this->table->generate($clientes) . '</div>';
         } else {
             $resultado = '<h4>No se encontraron resultados</h4>';
         }
         $data['contenido'] = $resultado;
     } else {
         $data['titulo'] = 'Información del cliente';
         $cliente = $this->cliente_model->obtener_cliente_por_id($id_cliente);
         if ($cliente === NULL) {
             $data['contenido'] = '<h4>Error al recuperar información del cliente seleccionado</h4>';
         } else {
             $data['id_cliente'] = $cliente->id_cliente;
             $data['nombre'] = $cliente->nombre;
             $data['apellido'] = $cliente->apellido;
             $data['telefono'] = $cliente->telefono;
         }
     }
     $this->load->view('clientes/ver', $data);
     $this->load->view('templates/footer');
 }
Пример #3
0
 public function ver($id_usuario = NULL)
 {
     $this->cargar_header_y_principal();
     if ($id_usuario === NULL) {
         $data['titulo'] = 'Usuarios del sistema';
         $usuarios = $this->usuario_model->obtener_usuarios();
         $resultado;
         if (!empty($usuarios)) {
             $this->load->library('table');
             $this->load->helper('url');
             // Cargo helper para usar función anchor
             $this->load->helper('date');
             $this->table->set_heading('Email', 'Fecha de alta', '');
             $this->table->set_template(array('table_open' => '<table class="table">'));
             foreach ($usuarios as $indice_fila => $fila) {
                 $usuarios[$indice_fila]['id'] = anchor('usuarios/ver/' . $fila['id'], 'Ver', 'class="btn btn-info"');
                 //Permite generar el link para ver el usuario particular
                 $usuarios[$indice_fila]['fecha_alta'] = transform_date($fila['fecha_alta'], '/');
             }
             $resultado = '<div class="table-responsive">' . $this->table->generate($usuarios) . '</div>';
         } else {
             $resultado = '<h4>No se encontraron resultados</h4>';
         }
         $data['contenido'] = $resultado;
     } else {
         $data['titulo'] = 'Información del usuario';
         $usuario = $this->usuario_model->obtener_usuario_por_id($id_usuario);
         if ($usuario === NULL) {
             $data['contenido'] = '<h4>Error al recuperar información del usuario seleccionado</h4>';
         } else {
             $data['id_usuario'] = $usuario->id_usuario;
             $data['email'] = $usuario->email;
             $data['email_original'] = $usuario->email;
             $data['id_categoria'] = $usuario->id_categoria;
             $data['categorias'] = $this->categoria_usuarios_model->obtener_categorias_usuario_dropdown();
         }
     }
     $this->load->view('usuarios/ver', $data);
     $this->load->view('templates/footer');
 }
Пример #4
0
 public function ver()
 {
     $this->cargar_header_y_principal();
     $data['titulo'] = 'Historial de ventas';
     $ventas = $this->venta_model->obtener_ventas();
     $resultado;
     if (!empty($ventas)) {
         $this->load->library('table');
         $this->load->helper('date');
         $this->load->helper('url');
         $this->table->set_template(array('table_open' => '<table class="table">'));
         $this->table->set_heading('Importe total', 'Cliente', 'Código producto', 'Talle', 'Número', 'Cantidad', 'Fecha de venta', 'Vendedor', 'Caja', 'Forma de pago');
         $this->table->set_empty('-');
         foreach ($ventas as $indice => $fila) {
             $ventas[$indice]['fecha'] = transform_date($fila['fecha']);
         }
         $resultado = '<div class="table-responsive">' . $this->table->generate($ventas) . '</div>';
     } else {
         $resultado = '<h4>No se encontraron resultados</h4>';
     }
     $data['contenido'] = $resultado;
     $this->load->view('ventas/ver', $data);
     $this->load->view('templates/footer');
 }
Пример #5
0
function transformFromTimestamp($timestamp = FALSE, $seperated = TRUE)
{
    if (!$timestamp) {
        return FALSE;
    }
    // Bsp.: '2005-05-13 07:15:31'
    if ($seperated) {
        $tmp = explode(' ', $timestamp);
        if (count($tmp) < 2) {
            return FALSE;
        }
        $year = explode('-', $tmp[0]);
        if (count($year) < 3) {
            return FALSE;
        }
        $time = explode(':', $tmp[1]);
        if (count($time) < 3) {
            return FALSE;
        }
        $result = array('Jahr' => $year[0], 'Monat' => $year[1], 'Tag' => $year[2], 'Stunde' => $time[0], 'Minute' => $time[1], 'Sekunde' => $time[2]);
    } else {
        $tmp = explode(' ', $timestamp);
        $date = transform_date($tmp[0]);
        $tmp2 = explode(':', $tmp[1]);
        $time = $tmp2[0] . ':' . $tmp2[1];
        $result = $date . ' ' . $time;
    }
    return $result;
}
Пример #6
0
 public function getKreisverbandUser($kreisID = FALSE, $limitStart = 0, $limitEnd = 50)
 {
     if (!is_numeric($kreisID)) {
         return FALSE;
     }
     $query = "SELECT userkreisverband.UserID, user.Name, user.Vorname, user.Plz, userkreisverband.MitgliedSeit FROM userkreisverband\n                    INNER JOIN user ON userkreisverband.UserID=user.UserID\n                    WHERE Austritt IS NULL AND userkreisverband.KreisverbandID={$kreisID} LIMIT {$limitStart},{$limitEnd};";
     $DBAnswer = $this->db->query($query);
     $DBAnswer = $DBAnswer->result_array();
     if (count($DBAnswer) > 0) {
         foreach ($DBAnswer as $key => $value) {
             $DBAnswer[$key]['MitgliedSeit'] = transform_date($DBAnswer[$key]['MitgliedSeit']);
         }
         return $DBAnswer;
     } else {
         return FALSE;
     }
 }
Пример #7
0
 /**
  * Update user profile
  * 
  * @param type $user
  * @return type 
  */
 public function update($user = '')
 {
     if (empty($user)) {
         return FALSE;
     }
     $pre_user = $this->find($user[$this->pkey], 1);
     if (!empty($user['birth_date'])) {
         $user['birth_date'] = transform_date($user['birth_date']);
     }
     if (!empty($user['new_password'])) {
         $user['password'] = $this->make_password($user['new_password'], $prev_user['salt']);
     }
     unset($user['new_password']);
     $this->db->where($this->pkey, $user[$this->pkey])->update($this->table, $user);
     return TRUE;
 }