y como lo repararia es que ya no como, si me hechas la mano?
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ú
case 'add_product':
$result = new brand();
$newProduct = new product();
$code = trim(stripslashes(htmlspecialchars($_POST['code'])));
$product = trim(stripslashes(htmlspecialchars($_POST['product'])));
$price = trim(stripslashes(htmlspecialchars($_POST['price'])));
$stock = trim(stripslashes(htmlspecialchars($_POST['stock'])));
$brand = $result->getBrandById($_POST['brand']);
if($newProduct->add($code,$product,$brand,$price,$stock)){
echo "success";
}
else{
echo "No se registro";
}
break;
function getBrandById($id){
$sql = "SELECT idbrand,code_,brand FROM brand where idbrand={$id}";
$result = $this->conexion->conexion->query($sql);
$array = array();
while($record = $result->fetch_array(MYSQL_NUM)){
$array[] = $record;
}
return $array;
$this->conexion->cerrar();
}
como pudiera encontrar las vulnerabilidades y distintos tipos de comandos como 'or 1 = 1 -- #
si la consulta fuera esta
code=php-brief] SELECT * FROM users where username = '$variable' and password = '$variable
'
INSERT INTO product (price,stock,code,product) VALUES('$price','$stock','$code','$product')
<span class="label label-success">Approved</span>
if(Data.length === 0)
$('#info').html('<h4 style="color: red">Sorry there are no products available</h4>')
else
$('#info').html('');
html="<table class='table table-condensed table-hover table-striped'><thead><tr><th>#</th><th>Code</th><th>Product</th><th>Price</th><th>Stock</th><th>brand</th><th>status</th><th>Opciones</th></tr></thead><tbody>";
for(i=0;i<Data.length;i++){
data=Data[i][0]+"*"+Data[i][1]+"*"+Data[i][2]+"*"+Data[i][3]+"*"+Data[i][4]+"*"+Data[i][4]+""+Data[i][5]+"*"+Data[i][6];
html+="<tr><td>"+(i+1)+"</td><td>"+Data[i][1]+"</td><td>"+Data[i][2]+"</td><td>"+Data[i][3]+"</td><td>"+Data[i][4]+"</td><td>"+Data[i][5]+"</td><td>"+Data[i][6]+"</td><td><button class='btn btn-warning btn-options' data-toggle='modal' data-target='#modalproduct' onclick='mostrar("+'"'+data+'"'+");'><span class='glyphicon glyphicon-pencil'></span></button><button class='btn btn-danger btn-options' id='confirm' onclick='Delete("+'"'+Data[i][0]+'"'+")'><span class='glyphicon glyphicon-trash'></span></button></td></tr>";
}
html+="<tr><td>"+(i+1)+"</td><td>"+Data[i][1]+"</td><td>"+Data[i][2]+"</td><td>"+Data[i][3]+"</td><td>"+Data[i][4]+"</td><td>"+Data[i][5]+"</td><td>"+Data[i][6]+"</td><td><button class='btn btn-warning btn-options' data-toggle='modal' data-target='#modalproduct' onclick='mostrar("+'"'+data+'"'+");'><span class='glyphicon glyphicon-pencil'></span></button><button class='btn btn-danger btn-options' id='confirm' onclick='Delete("+'"'+Data[i][0]+'"'+")'><span class='glyphicon glyphicon-trash'></span></button></td></tr>";
$recordLastSale = $sale->getLastSale();
$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['idproduct'];
$amount = $detail['amount'] ;
$price = $detail['price'];
$subtotal = $detail['subtotal'];
if($sale->saveSaleDetail($idsale,$idproduct,$amount,$price,$subtotal)){
$_SESSION['detalle'][] = $detail;
echo "success";
}else{
echo "something went wrong";
}
endforeach;
}
function saveSale(){
$sql = "INSERT INTO sales(dates) values(NOW())";
$result = $this->conexion->conexion->query($sql);
return $result;
$this->conexion->conectar();
}
function getLastSale(){
$sql = "SELECT LAST_INSERT_ID() AS last";
$result = $this->conexion->conexion->query($sql);
return $result;
$this->conexion->conectar();
}
function saveSaleDetail($idsale,$idproduct,$amount,$price,$subtotal){
$sql = "INSERT INTO sale_detail(idsale,idproduct,amount,price,subtotal) VALUES('$idsale','$idproduct','$amount','$price','$subtotal')";
$result = $this->conexion->conexion->query($sql);
return $result;
$this->conexion->conectar();
}