Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - geshiro

#91
PHP / Re: fatal error on boolean
19 Marzo 2016, 19:48 PM
si , bool = 0,1 , string = caracteres y asi
#92
PHP / Re: fatal error on boolean
19 Marzo 2016, 19:39 PM
me sale esto ahora
Fatal error: Call to a member function fetch_object() on string in C:\xampp\htdocs\store\controllers\sales.php on line 35
#93
PHP / Re: fatal error on boolean
19 Marzo 2016, 18:41 PM
esta e n mi funcion getLastSale
Código (sql) [Seleccionar]

function getLastSale(){
$sql = "SELECT LAST_INSERT_ID() AS last";
if($this->conexion->conexion->query($sql)){
return true;
}else{
return false;
}
$this->conexion->conectar();
}

#94
PHP / Re: fatal error on boolean
19 Marzo 2016, 17:56 PM
me lanza ahora esto

bool(true)
Fatal error: Call to a member function fetch_object() on boolean in C:\xampp\htdocs\store\controllers\sales.php on line 36

si le pongo var_dump();
#95
PHP / fatal error on boolean
19 Marzo 2016, 03:43 AM
Fatal error: Call to a member function fetch_object() on boolean in C:\xampp\htdocs\store\controllers\sales.php on line 35


Código (php) [Seleccionar]

case 'save':
          $sale = new Sale();
          if(count($_SESSION['detalle'])>0){
            $sale->saveSale();
            $recordLastSale = $sale->getLastSale();
            $resultLastSale = $recordLastSale->fetch_object();
            $idsale = $resultLastSale->last;
            foreach ($_SESSION['detalle'] as $detail):
                $idproduct = $detail['idsale_detail'];
                $amount = $detail['amount'] ;
                $price = $detail['price'];
                $subtotal = $detail['subtotal'];
                if($sale->saveSaleDetail($idsale,$idproduct,$amount,$price,$subtotal)){
                  echo "success";
                }else{
                  echo "something when wrong";
                }
              endforeach;
              $_SESSION['detalle'] = array(); 
          }else{
              echo "something when wrong";
          }
       break;
#96
el problema empieza cuando agrego el select se hace demasiado grande de pantalla a pantalla y no se queda en el mismo tamaño que le di estoy usando bootstrap
Código (html4strict) [Seleccionar]

<div class="row frm-down">
            <div class="form-group">
                <div class="col-xs-4">
                    <div>
                        <select class='form-control select_product' id='select_product' name='select_product'>
                            <option value="0">Select one product</option>
                            <?php foreach ($row as $rows) { ?>
                                <option value="<?php echo $rows['idproduct']?>"><?php echo $rows['product']?></option>
                           <?php ?>
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-3 frm-price">
                    <input type="text" class="form-control" id="txt_amount" name="txt_amount" onkeyup="validacion('txt_amount');" placeholder="amount" maxlength="5">
                </div>
            </div>
            <div class="col-lg-2">
                <div>
                    <button id="btn-add-product" class="btn btn-success btn-add-product" onclick="btn_add_product();">Add</button>
                </div>
            </div>
        </div>
#97
PHP / Re: ayuda! pasar variable de .php a otro
24 Enero 2016, 06:43 AM
una las injecciones sql se evitan escapando los strings y caracteres raros usa ajax para que puedas pasar las url ocultas pero igual si no te hacen sql injection esta el XSS :)
#98
PHP / Error al llamar fetchObject on boolean
24 Enero 2016, 06:35 AM
me pudieran hechar la mano ya mande el error por json para saber, imprimi el error y nada no me da que es alguien me puediera ayudar con el error

Código (php) [Seleccionar]

<?php
require_once(
'../models/sales.php');
require_once('../models/product.php');
$boton=$_POST['boton'];
switch ($boton) {
case 'add_sale':
$objProducto = new product();
if (isset($_POST['producto_id']) && $_POST['producto_id']!='' && isset($_POST['cantidad']) && $_POST['cantidad']!='') {
$cantidad $_POST['cantidad'];
$producto_id $_POST['producto_id'];

$resultado_producto $objProducto->getProductByid($producto_id);
$producto $resultado_producto->fetchObject();
$descripcion $producto->descripcion;
$precio $producto->precio;

$subtotal $cantidad $precio;

$_SESSION['detalle'][$producto_id] = array('id'=>$producto_id'producto'=>$descripcion'cantidad'=>$cantidad'precio'=>$precio'subtotal'=>$subtotal);
}else{
echo 'error';
}
break;
}
?>

#99
PHP / Re: php variable indefinida
22 Enero 2016, 03:32 AM
ahora si me deja acceder pero ahora query no puedo usarlo porque dice que no esta definido Fatal error: Call to undefined method PDF::query() in C:\xampp\htdocs\store\fpdf\list_product.php on line 33

Código (php) [Seleccionar]

<?php
require(
'fpdf.php');
class PDF extends FPDF{
private $conexion;
public function __construct(){
require('../models/conexion.php');
$this->conexion = new conexion();
$this->conexion->conectar();
parent::__construct();
}
}

$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Arial'''10);
$pdf->Image('../assests/img/tienda.gif' 10 ,810 13,'GIF');
$pdf->Cell(1810''0);
$pdf->Cell(15010'Store "Aron Imperial"'0);
$pdf->SetFont('Arial'''9);
$pdf->Cell(5010'Hoy: '.date('d-m-Y').''0);
$pdf->Ln(15);
$pdf->SetFont('Arial''B'11);
$pdf->Cell(708''0);
$pdf->Cell(1008'List product'0);
$pdf->Ln(23);
$pdf->SetFont('Arial''B',8);
$pdf->Cell(158'Code'0);
$pdf->Cell(508'Product'0);
$pdf->Cell(258'Price'0);
$pdf->Cell(258'Stock'0);
$pdf->Ln(8);
$pdf->SetFont('Arial','',8);
$pdf->query("SELECT * FROM product");
$pdf->Output();
?>


#100
PHP / Re: php variable indefinida
22 Enero 2016, 02:32 AM
cuando intento hacer esto

Código (php) [Seleccionar]

<?php
require(
'fpdf.php');
class PDF extends FPDF{
private $conexion;
public function __construct(){
require('../models/conexion.php');
$this->conexion = new conexion();
$this->conexion->conectar();
}
}

$pdf = new PDF();
$pdf->AddPage();
$pdf->SetFont('Arial'''10);
$pdf->Image('../assests/img/tienda.gif' 10 ,810 13,'GIF');
$pdf->Cell(1810''0);
$pdf->Cell(15010'Store "Aron Imperial"'0);
$pdf->SetFont('Arial'''9);
$pdf->Cell(5010'Hoy: '.date('d-m-Y').''0);
$pdf->Ln(15);
$pdf->SetFont('Arial''B'11);
$pdf->Cell(708''0);
$pdf->Cell(1008'List product'0);
$pdf->Ln(23);
$pdf->SetFont('Arial''B',8);
$pdf->Cell(158'Code'0);
$pdf->Cell(508'Product'0);
$pdf->Cell(258'Price'0);
$pdf->Cell(258'Stock'0);
$pdf->Ln(8);
$pdf->SetFont('Arial','',8);
$pdf->Output();
?>



me esta esto otro error


Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\store\fpdf\fpdf.php on line 501

Fatal error: Uncaught exception 'Exception' with message 'FPDF error: Undefined font: helvetica ' in C:\xampp\htdocs\store\fpdf\fpdf.php:271 Stack trace: #0 C:\xampp\htdocs\store\fpdf\fpdf.php(510): FPDF->Error('Undefined font:...') #1 C:\xampp\htdocs\store\fpdf\list_product.php(14): FPDF->SetFont('Arial', '', 10) #2 {main} thrown in C:\xampp\htdocs\store\fpdf\fpdf.php on line 271