����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 13.59.212.110 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/www/html/app6/core/app/action/ |
Upload File : |
<?php $barcode = $_POST["barcode"]; $nameitem = $_POST['nameitem']; $stock = $_POST['stock']; $tax = 16; $price = $_POST['price']; $note = $_POST['note']; $price_in= $price- ($price/1.30); $price_in= number_format($price_in,2); if(count($_POST)>0){ //alta de product en tabla m_item $max_item = ProductData::getByIdMax(); //producto ultimo $product_item= $max_item[0]->id; $product_item =++ $product_item; $id_item = $product_item; $item_name = $nameitem; $price = $price; $stock = $stock; $unit = "A1"; if(isset($_POST["qy"])){ //VALORES DE PAQUETE $qy= $_POST["qy"]; $product_id = $_POST["product_id"]; $type= $_POST["is_service"]; } //GUARDAMOS LOS VALORES DE LOS PRODUCTOS EN LA TABLA operation //registramos los productos $servername = "localhost"; $database = "sae"; $username = "root"; $password = "Hues198020"; // Create connection $conn = mysqli_connect($servername, $username, $password, $database); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } $sql = "INSERT INTO m_item (id_item,item_name,barcode,stock,price,unit) VALUES ('$id_item','$item_name','$barcode','$stock','$price','$unit')"; $result3 = mysqli_query($conn, $sql); mysqli_close($conn); //ALTA DE PRODUCTOS EN TABLA product $product = new ProductData(); $product->barcode = $barcode; $product->name = $item_name; //metemos el 30% menos en precio costo $product->price_in = $price_in; $product->price_out = $price; $product->iva = 16; $product->unit = "pz"; $product->description = $note; $product->presentation = $unit; $product->inventary_min = 5; $product->category_id=1; $product->user_id = $_SESSION["user_id"]; $product->is_service = 1; //paquete valores $product->product_children = 1; $product->qy = 1; //////////// $prod= $product->add(); if(isset($prod[1])){ $op = new OperationData2(); $op->product_id = $prod[1] ; $op->stock_id = StockData::getPrincipal()->id; $op->operation_type_id=OperationTypeData::getByName("entrada")->id; $op->price_in =$price; $op->price_out= $price; $op->q= $stock; $op->re_id="NULL"; $op->is_oficial=1; $op->add(); } $datos = array( 'estado' => 'ok', 'barcode' => $_POST['barcode'] ); //Devolvemos el array pasado a JSON como objeto echo json_encode($datos, JSON_FORCE_OBJECT); }else{ $datos = array( 'estado' => 'false', 'barcode' => $_POST['barcode'] ); echo json_encode($datos, JSON_FORCE_OBJECT); } ?>