--- /dev/null
+<?php
+
+namespace yii_app\actions\shipment;
+
+use yii\base\Action;
+
+class StoreProductsFactEditAction extends Action
+{
+ public function run() {
+ return $this->controller->renderPartial('store-products-fact-edit');
+ }
+}
\ No newline at end of file
'division-print-edit' => \yii_app\actions\shipment\DivisionPrintEditAction::class,
'set-division-priority' => \yii_app\actions\shipment\SetDivisionPriorityAction::class,
'store-products-fact' => \yii_app\actions\shipment\StoreProductsFactAction::class,
+ 'store-products-fact-edit' => \yii_app\actions\shipment\StoreProductsFactEditAction::class,
'polnogramm' => \yii_app\actions\shipment\PolnogrammAction::class,
'store-planogram-logi' => \yii_app\actions\shipment\StorePlanogramLogiAction::class,
];
//include"templates/bottom.php";
+include_once dirname(__DIR__, 2) . '/templates/bottom_light.php';
--- /dev/null
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+
+if(!empty($_REQUEST["product_id"])) {
+
+ $product_id=htmlentities($_REQUEST["product_id"]);
+ $color=htmlentities($_REQUEST["color"]);
+ $quantity=intval($_REQUEST["quantity"]);
+ $store_id=htmlentities($_REQUEST["store_id"]);
+ $date_id=intval($_REQUEST["date_id"]);
+ echo"Сохранили количество =$quantity";
+
+
+
+ if($color!="NULL") $color=str_replace('"','',$color);
+ else $color='';
+ $sql="INSERT IGNORE INTO store_products_fact SET ";
+ $up= "store_id='$store_id', product_id='$product_id', date_id='$date_id', color='$color', quantity='$quantity' ";
+ $sql .="$up ON DUPLICATE KEY UPDATE $up";
+//echo"<br><br>++$color++$sql";
+ $db::sql($sql);
+
+}
\ No newline at end of file
.zak td.td_product:hover {background:#fff;}
*/
+global $_CONFIG;
- $_CONFIG["jscss"] = ($_CONFIG["jscss"] ?? '') . '<style>.t tbody tr td{padding:0;}
+ $_CONFIG["jscss"] = '<style>.t tbody tr td{padding:0;}
.t tbody tr td input.form-control{padding:0;margin:0 2px;text-align:center;font-weight:bold;}
.table tbody tr td{padding:0;}
</style>
<script>
+const param6x = $(\'meta[name=csrf-param]\').attr(\'content\');
+const token6x = $(\'meta[name=csrf-token]\').attr(\'content\');
$quantity=htmlentities($_REQUEST["quantity"]);
var quantity=$(\'#color_quantity_\'+product_id+\'_\'+color+\'\').val();
$.ajax({
- url: \'/shipment/storeProductsFactEdit/\',
+ url: \'/shipment/store-products-fact-edit/\',
method: \'post\',
dataType: \'html\',
- data: {store_id: \''.$store_id.'\', date_id: \''.$date_id.'\', quantity: quantity, product_id: product_id, color: color},
- success: function(data){
+ data: {store_id: \''.$store_id.'\', date_id: \''.$date_id.'\', quantity: quantity, product_id: product_id, color: color, [param6x]: token6x},
+ success: function(data) {
$(\'#editDiv\').html(data);
}});
}
}
</script>';
+ include_once dirname(__DIR__, 2) . '/templates/bottom_light.php';
}
//include"templates/bottom.php";
+