!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/almazenServer/application/controllers/   drwxr-xr-x
Free 9.99 GB of 29.4 GB (33.98%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     tiendaNube.php (5.45 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php if (!defined('BASEPATH')) {
    exit(
'No direct script access allowed');
}

class 
tiendaNube extends CI_Controller {
    public function 
__construct() {
        
parent::__construct();
        
$this->load->model('consultas_model');
        
/* Cargamos la base de datos */
        
$this->load->database();
        
$this->load->library('javascript');
        
$this->load->library('session');
        
$this->load->library('Jquery_pagination');
        
$this->load->library('toastr');

        
/* Añadimos el helper al controlador */
        
$this->load->helper('url');
        
error_reporting(E_ALL ^ (E_NOTICE E_WARNING));
    }

    public function 
getOrdenesTotalesAajax() {
        
// me traigo la info de todas las ordenes ingresadas al sistema
        
$respuesta $this->consultas_model->getOrdenesTiendaNubeTotalesAajax();
        return 
$respuesta;
    }

    public function 
index() {

        
$data = array(
            
"contenido" => "tiendanube_view",
            
"titulo"    => "INGRESO VENTAS TIENDA NUBE",

        );
        
$this->load->view('template'$data);

    }

    
// descontamos el stock con los items
    
public function descontarStock() {

    }

    
// creamos el pedido con la informacion enviada
    
public function crearPedido() {

    }

    
// revisamos si el pedido fue o no ingresado previamente
    
public function checkPedido() {

    }

    public function 
procesarOrdenes() {
        
$postdata  file_get_contents("php://input");
        
$request   json_decode($postdata);
        
$respuesta $request;
        
var_dump($request);
        
var_dump($_POST['data']);
        
//voy recorriendo las ordenes enviadas desde pantalla

        // 1 consulto si la Orden ya tiene o no un pedido asignado.

        
echo json_encode($respuesta);

    }

    public function 
procesarInputCSV() {
        
$this->load->library('pHPExcel');

        
$PHPExcel = new PHPExcel();

        if (!empty(
$_FILES['file']['name'])) {
            
$import_xls_file $_FILES['file']['name'];
        } else {
            
$import_xls_file 0;
        }

        
$fp               fopen($_FILES['file']['tmp_name'], 'r') or die("can't open file");
        
$registrosPedidos 0;
        
$registroArray    0;
        
$orden_actual     0;

        
$dataPedidos            = array();
        
$arrayDetalleCadaPedido = array();
        while (
$csv_line fgetcsv($fp1024)) {
            
$count++;
            if (
$count == 1) {
                continue;
            } 
//keep this if condition if you want to remove the first row
            
for ($i 0$j count($csv_line); $i $j$i++) {

                
$lineaParseada      explode(";"$csv_line[0]);
                
$info_registro_fila = array();

                
$info_registro_fila['nro_orden'] = $lineaParseada[0]; //remove if you want to have primary key,
                
$info_registro_fila['correo']    = $lineaParseada[1];

                if (
$lineaParseada[2] != '') {
                    
$info_registro_fila['fecha'] = $lineaParseada[2];
                }

                if (
$lineaParseada[7] != '') {
                    
$info_registro_fila['subtotal'] = $lineaParseada[7];
                }
                if (
$lineaParseada[10] != '') {
                    
$info_registro_fila['total'] = $lineaParseada[10];
                }

                if (
$lineaParseada[11] != '') {
                    
$info_registro_fila['nombre_cliente'] = $lineaParseada[11];
                }

                if (
$lineaParseada[12] != '') {
                    
$info_registro_fila['dni'] = $lineaParseada[12];
                }

                if (
$lineaParseada[13] != '') {
                    
$info_registro_fila['telefono'] = $lineaParseada[13];
                }

                
// info detalle del pedido o orden
                
$info_array_detalle_actual['nombre']   = $lineaParseada[34];
                
$info_array_detalle_actual['precio']   = $lineaParseada[32];
                
$info_array_detalle_actual['cantidad'] = $lineaParseada[33];

            }

            
$registroArray++;
            
$arrayDetalleCadaPedido[$registroArray] = array(
                
'nro_orden' => $info_registro_fila['nro_orden'],
                
'nombre'    => $info_array_detalle_actual['nombre'],
                
'precio'    => $info_array_detalle_actual['precio'],
                
'cantidad'  => $info_array_detalle_actual['cantidad'],
            );
            
//    if($orden_actual == '0'){$orden_actual=$info_registro_fila['nro_orden'];}

            
if ($info_registro_fila['nro_orden'] != $orden_actual) {
                
$orden_actual $info_registro_fila['nro_orden'];

                
$dataPedidos[$registrosPedidos]['nro_orden']      = $info_registro_fila['nro_orden'];
                
$dataPedidos[$registrosPedidos]['correo']         = $info_registro_fila['correo'];
                
$dataPedidos[$registrosPedidos]['fecha']          = $info_registro_fila['fecha'];
                
$dataPedidos[$registrosPedidos]['subtotal']       = $info_registro_fila['subtotal'];
                
$dataPedidos[$registrosPedidos]['total']          = $info_registro_fila['total'];
                
$dataPedidos[$registrosPedidos]['nombre_cliente'] = $info_registro_fila['nombre_cliente'];
                
$dataPedidos[$registrosPedidos]['dni']            = $info_registro_fila['dni'];
                
$dataPedidos[$registrosPedidos]['telefono']       = $info_registro_fila['telefono'];

                
$registrosPedidos++;
            }

        }

        echo 
json_encode($dataPedidos);

    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0104 ]--