si , bool = 0,1 , string = caracteres y asi
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ú
function getLastSale(){
$sql = "SELECT LAST_INSERT_ID() AS last";
if($this->conexion->conexion->query($sql)){
return true;
}else{
return false;
}
$this->conexion->conectar();
}
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;
<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>
<?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;
}
?>
<?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();
?>
<?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();
?>