|
92
|
Programación / PHP / Re: fatal error on boolean
|
en: 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
|
Programación / PHP / Re: fatal error on boolean
|
en: 19 Marzo 2016, 18:41 pm
|
esta e n mi funcion getLastSale FUNCTION getLastSale(){ $sql = "SELECT LAST_INSERT_ID() AS last"; IF($this->conexion->conexion->query($sql)){ RETURN TRUE; }ELSE{ RETURN FALSE; } $this->conexion->conectar(); }
|
|
|
94
|
Programación / PHP / Re: fatal error on boolean
|
en: 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
|
Programación / PHP / fatal error on boolean
|
en: 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 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
|
Programación / Desarrollo Web / formulario desfazado al momento de darle agregar
|
en: 1 Marzo 2016, 21:52 pm
|
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 <div class="row frm-down"> <select class='form-control select_product' id='select_product' name='select_product'> <?php foreach ($row as $rows) { ?> <option value="<?php echo $rows['idproduct']?>"> <?php echo $rows['product']?></option> <?php } ?> <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"> <button id="btn-add-product" class="btn btn-success btn-add-product" onclick="btn_add_product();">Add </button>
|
|
|
98
|
Programación / PHP / Error al llamar fetchObject on boolean
|
en: 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 <?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
|
Programación / PHP / Re: php variable indefinida
|
en: 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 <?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 ,8, 10 , 13,'GIF'); $pdf->Cell(18, 10, '', 0); $pdf->Cell(150, 10, 'Store "Aron Imperial"', 0); $pdf->SetFont('Arial', '', 9); $pdf->Cell(50, 10, 'Hoy: '.date('d-m-Y').'', 0); $pdf->Ln(15); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(70, 8, '', 0); $pdf->Cell(100, 8, 'List product', 0); $pdf->Ln(23); $pdf->SetFont('Arial', 'B',8); $pdf->Cell(15, 8, 'Code', 0); $pdf->Cell(50, 8, 'Product', 0); $pdf->Cell(25, 8, 'Price', 0); $pdf->Cell(25, 8, 'Stock', 0); $pdf->Ln(8); $pdf->SetFont('Arial','',8); $pdf->query("SELECT * FROM product"); $pdf->Output(); ?>
|
|
|
100
|
Programación / PHP / Re: php variable indefinida
|
en: 22 Enero 2016, 02:32 am
|
cuando intento hacer esto <?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 ,8, 10 , 13,'GIF'); $pdf->Cell(18, 10, '', 0); $pdf->Cell(150, 10, 'Store "Aron Imperial"', 0); $pdf->SetFont('Arial', '', 9); $pdf->Cell(50, 10, 'Hoy: '.date('d-m-Y').'', 0); $pdf->Ln(15); $pdf->SetFont('Arial', 'B', 11); $pdf->Cell(70, 8, '', 0); $pdf->Cell(100, 8, 'List product', 0); $pdf->Ln(23); $pdf->SetFont('Arial', 'B',8); $pdf->Cell(15, 8, 'Code', 0); $pdf->Cell(50, 8, 'Product', 0); $pdf->Cell(25, 8, 'Price', 0); $pdf->Cell(25, 8, '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
|
|
|
|
|
|
|