From: Alexander Smirnov Date: Thu, 7 Dec 2023 16:12:44 +0000 (+0300) Subject: move /shipment/fields to erp X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7c0d27589117b5e1cd61c63145fa00641ce1f449;p=yii-erp24%2F.git move /shipment/fields to erp --- diff --git a/erp24/actions/shipment/FieldsAction.php b/erp24/actions/shipment/FieldsAction.php new file mode 100644 index 0000000..8bbd1ba --- /dev/null +++ b/erp24/actions/shipment/FieldsAction.php @@ -0,0 +1,12 @@ +controller->render('fields'); + } +} \ No newline at end of file diff --git a/erp24/controllers/ShipmentController.php b/erp24/controllers/ShipmentController.php index 25db956..2d968c7 100755 --- a/erp24/controllers/ShipmentController.php +++ b/erp24/controllers/ShipmentController.php @@ -11,6 +11,7 @@ class ShipmentController extends \yii\web\Controller return [ 'index' => \yii_app\actions\shipment\IndexAction::class, 'add' => \yii_app\actions\shipment\AddAction::class, + 'fields' => \yii_app\actions\shipment\FieldsAction::class, 'fields-data' => \yii_app\actions\shipment\FieldsDataAction::class, 'ajax-update-fields-data-test' => \yii_app\actions\shipment\AjaxUpdateFieldsDataTestAction::class, 'division-print-edit' => \yii_app\actions\shipment\DivisionPrintEditAction::class, diff --git a/erp24/inc/db.php b/erp24/inc/db.php index 46f2701..4f56a61 100644 --- a/erp24/inc/db.php +++ b/erp24/inc/db.php @@ -144,19 +144,20 @@ protected $config = ''; * @return array */ public static function getColumn($query, $args = []) { - $GLOBALS["sql_cnt"]++; + $GLOBALS["sql_cnt"] = ($GLOBALS["sql_cnt"] ?? 0) + 1; return self::run($query, $args)->fetchAll(PDO::FETCH_COLUMN); } public static function getCol($query, $args = []) { - $GLOBALS["sql_cnt"]++; + $GLOBALS["sql_cnt"] = ($GLOBALS["sql_cnt"] ?? 0) + 1; return self::run($query, $args)->fetch(PDO::FETCH_NAMED); } public static function sql($query, $args = []) - { $GLOBALS["sql_cnt"]++; + { + $GLOBALS["sql_cnt"] = ($GLOBALS["sql_cnt"] ?? 0) + 1; self::run($query, $args); } @@ -179,7 +180,7 @@ protected $config = ''; { $ret_arr=array(); $data= self::run($query, $args)->fetchAll(); - $GLOBALS["sql_cnt"]++; + $GLOBALS["sql_cnt"] = ($GLOBALS["sql_cnt"] ?? 0) + 1;; foreach($data as $row) $ret_arr[$row["id"]]=$row["name"]; return $ret_arr; } diff --git a/erp24/views/shipment/fields.php b/erp24/views/shipment/fields.php new file mode 100644 index 0000000..b9eb340 --- /dev/null +++ b/erp24/views/shipment/fields.php @@ -0,0 +1,103 @@ +2) exit("У вас нет доступа"); + +$roles=$db::mapping("SELECT id, name FROM admin_group WHERE id=7 or id=30 or id=17 or id=70 or id=71 or id=9 or id=51 or id=1 or id=10"); + +echo "
"; + +echo'

Настройка статусов в заказе у поставщиков кто может ставить статусы

'; + + +if(!empty($_POST["save"])){ + + foreach($_POST["description"] as $idr => $val) { + + $db::sql("UPDATE store_orders_fields SET description=? WHERE id=?",[$val,$idr]); + + } + + +} + +$data=$db::getRows("SELECT id, dostup FROM `store_orders_statuses` WHERE 1"); +foreach($data as $row) { + $dostup[$row["id"]] = json_decode($row["dostup"], true); + +} + + +echo'
'; +?>название кратко +name_eng +SQL таблица сохранения + +тип +тип данных + +сумма по столбцу +сохраняем цвета в ячейке + + +'; +foreach($data as $row) { + + echo" + ".$row["name"]."
+ ".$row["name_full"]." + + + ".$row["name_eng"]." + ".$row["sql_table_values"]." + ".$row["type"].""; + + if(in_array($row["type"],array("multiplication","avg","difference"))) + echo" "; + + echo" + ".$row["tip"]." + + "; if($row["summ"]) echo"да"; echo" + "; if($row["colors_save"]) echo"да"; echo" + "; + /* + echo''; + foreach($statuses as $gid => $name) { + if(!empty($roles[$gid])) { + + echo"'; + + + + } + } + echo'
".$name." "; + + // $dostup[$status_id] + + echo'
'; + */ + +} +echo'
'; + +echo ""; + +//include"templates/bottom.php"; + + + + + +