]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
add products/products-1c
authorAlexander Smirnov <fredeom@mail.ru>
Thu, 25 Apr 2024 14:19:28 +0000 (17:19 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Thu, 25 Apr 2024 14:19:28 +0000 (17:19 +0300)
21 files changed:
erp24/controllers/ProductsController.php [new file with mode: 0755]
erp24/modul/products/ajaxRemoveExport.php
erp24/modul/products/ajax_add_product.php
erp24/modul/products/ajax_class_group.php
erp24/modul/products/ajax_class_group_remove.php
erp24/modul/products/ajax_group_config.php
erp24/modul/products/ajax_product_provider.php
erp24/modul/products/ajax_product_provider_add.php
erp24/modul/products/ajax_products_in_group.php
erp24/modul/products/ajax_remove_product.php
erp24/modul/products/products_1c.php
erp24/views/products/ajax-add-product.php [new file with mode: 0644]
erp24/views/products/ajax-class-group-remove.php [new file with mode: 0644]
erp24/views/products/ajax-class-group.php [new file with mode: 0644]
erp24/views/products/ajax-group-config.php [new file with mode: 0644]
erp24/views/products/ajax-product-provider-add.php [new file with mode: 0644]
erp24/views/products/ajax-product-provider.php [new file with mode: 0644]
erp24/views/products/ajax-products-in-group.php [new file with mode: 0644]
erp24/views/products/ajax-remove-export.php [new file with mode: 0644]
erp24/views/products/ajax-remove-product.php [new file with mode: 0644]
erp24/views/products/products-1c.php [new file with mode: 0644]

diff --git a/erp24/controllers/ProductsController.php b/erp24/controllers/ProductsController.php
new file mode 100755 (executable)
index 0000000..429e815
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace app\controllers;
+
+use yii\web\Controller;
+
+class ProductsController extends Controller
+{
+    public function actionProducts1c() { return $this->render('products-1c'); }
+    public function actionAjaxProductProvider() { return $this->renderPartial('ajax-product-provider'); }
+    public function actionAjaxGroupConfig() { return $this->renderPartial('ajax-group-config'); }
+    public function actionAjaxProductsInGroup() { return $this->renderPartial('ajax-products-in-group'); }
+    public function actionAjaxClassGroup() { return $this->renderPartial('ajax-class-group'); }
+    public function actionAjaxClassGroupRemove() { return $this->renderPartial('ajax-class-group-remove'); }
+    public function actionAjaxAddProduct() { return $this->renderPartial('ajax-add-product'); }
+    public function actionAjaxRemoveProduct() { return $this->renderPartial('ajax-remove-product'); }
+    public function actionAjaxRemoveExport() { return $this->renderPartial('ajax-remove-export'); }
+    public function actionAjaxProductProviderAdd() { return $this->renderPartial('ajax-product-provider-add'); }
+}
\ No newline at end of file
index e7730d52337757eb5dce83764bdfe72d8f8aeee7..6212e22420116293a8846d9b1443614beb5323fc 100644 (file)
@@ -1,8 +1,10 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
-if(!empty($_REQUEST["id"])) { 
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+if(!empty($_REQUEST["id"])) {
 $id=htmlentities($_REQUEST["id"]);
 
 
index 8c0bb14268a7f7b5c955a58a31b4e756e3afb169..6da6674ddc5bd2c8cfebe5af5ef9d7c6abc04fd4 100644 (file)
@@ -1,8 +1,8 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
+<?php
 
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
 
 if(!empty($_REQUEST["parent_id"])) { 
     $parent_id=htmlentities($_REQUEST["parent_id"]);
@@ -33,13 +33,12 @@ $db::sql($insert,[$id,$entity_id]);
 
 try {
 
-include_once("inc/db2.php");
 $insert="INSERT INTO info_items_table_shop_0 (id_1c, cat_items_id, data, title, price) VALUES (?,'$cat_items_id',NOW(),?,?)";
-$db2::sql($insert,[$id,$name,$price]);
-$entity_id=$db2->lastInsertId();
+$db::sql($insert,[$id,$name,$price]);
+$entity_id=$db->lastInsertId();
   
 $insert="INSERT INTO export_import_table (export_id, entity, export_val, entity_id) VALUES ('1','products',?,?)";
-$db2::sql($insert,[$id,$entity_id]);
+$db::sql($insert,[$id,$entity_id]);
 } catch (Exception $e) {
  echo $e->getMessage();
 }
index 0346b58f84d9b2f8f58278cb2f571d2491944290..3138f9279ca683fb2890301a45218f33f42214d3 100644 (file)
@@ -1,14 +1,16 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
 if(!empty($_REQUEST["parent_id"])) {
 $parent_id=htmlentities($_REQUEST["parent_id"]);
 $tip=htmlentities($_REQUEST["tip"]);
 
 if(empty($tip)) $tip="wrap";
 
-   $db::sql("INSERT IGNORE INTO products_class (category_id, tip) VALUES(?,?)",[$parent_id,$tip]);   
+   $db::sql("INSERT INTO products_class (category_id, tip) VALUES(?,?) ON CONFLICT (category_id) DO UPDATE SET tip=?",[$parent_id,$tip,$tip]);
      
 echo'ok';
 }
index 740e3fc15b6189eaf229d235c615671019546fac..2fa46209c50a72427cbe76cc3cfcc7c95dd3a1b4 100644 (file)
@@ -1,7 +1,9 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
 if(!empty($_REQUEST["id"]) and !empty($_REQUEST["tip"])) {
     
     $id=htmlentities($_REQUEST["id"]);
index b5a4170731d1ce4aa1c413943378299a48595e3f..05a246e85d325062536670d0941707c3de640006 100644 (file)
@@ -1,7 +1,9 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
 if(!empty($_REQUEST["id"])) {
 $id=htmlentities($_REQUEST["id"]);
 $q = "SELECT * FROM products_class WHERE category_id=?";
index d48b490a1548965b8e502c236dd6f77b3ef2d9ca..6984285763dafd3204574a577451d1ed10b9c79d 100644 (file)
@@ -1,8 +1,10 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
-if(!empty($_REQUEST["id"])) { 
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+if(!empty($_REQUEST["id"])) {
   $id=htmlentities($_REQUEST["id"]);
 
    $data0 = $db::getRows("SELECT * FROM shipment_providers");
@@ -16,7 +18,7 @@ if(!empty($_REQUEST["id"])) {
 
 
 
-$productColorsArray=explode(";",$data["colors"]);
+$productColorsArray=explode(";",$data["colors"] ?? '');
 
 $productGroups=array("1"=>"Голландия/Израиль", 2=>"Кения", 3=>"Эквадор/Коллубмия", 4 => "Россия", 5 => "Горшечка",  6 => "Сопутка",  7 => "Фейерверки", 10 => "Матрица");
 
@@ -27,11 +29,11 @@ echo'<div id=result_prov></div><form method=post class="row" action="">';
 echo'<div class="col-6 text-right">Поставщик</div>
 <div class="col-6"><select class="form-control" id=provider_id name=provider_id>';
   foreach($providers as $idv =>$name) {
-    echo"<option value=".$idv.""; if($data['provider_id']==$idv) echo" selected"; echo">".$name."</option>";
+    echo"<option value=".$idv.""; if(($data['provider_id'] ??'')==$idv) echo" selected"; echo">".$name."</option>";
   }
   
    echo"<option value=dell ";
-    if($data['provider_id']=="dell") echo" selected";
+    if(($data['provider_id']??'')=="dell") echo" selected";
     
     echo">удалить поставщика</option></select></div>";
     
@@ -39,7 +41,7 @@ echo'<div class="col-6 text-right">Поставщик</div>
 echo'<div class="col-6 text-right">Группа</div>
 <div class="col-6"><select class="form-control" id=group_id name=group_id><option value=0 ';   if(empty($data['group_id'])) echo" selected";  echo'>-без группы-</option>';
   foreach($productGroups as $idv =>$name) {
-    echo"<option value=".$idv.""; if($data['group_id']==$idv) echo" selected"; echo">".$name."</option>";
+    echo"<option value=".$idv.""; if(($data['group_id']??'')==$idv) echo" selected"; echo">".$name."</option>";
   }
    echo"</select></div>";
    
@@ -52,13 +54,13 @@ echo"</select></div>";
    
  
 echo'
-<div class="col-6 text-right">срок хранения в днях</div><div class="col-6"> <input type=number style="width:70px;" name=expiration_days id=expiration_days class="form-control" value="'. $data['expiration_days'] .'"></div>
+<div class="col-6 text-right">срок хранения в днях</div><div class="col-6"> <input type=number style="width:70px;" name=expiration_days id=expiration_days class="form-control" value="'. ($data['expiration_days']??'') .'"></div>
 <div class="col-6 text-right">минимальный лот деления в шт. (кол-во шт в месте)
-</div><div class="col-6"> <input type=number style="width:70px;" name=min_lot id=min_lot class="form-control" value="'. $data['min_lot'] .'"></div>
-<div class="col-6 text-right">минимальный заказ в шт.</div><div class="col-6"> <input type=number style="width:70px;" name=min_order id=min_order class="form-control" value="'. $data['min_order'] .'"></div>
-<div class="col-6 text-right">Цена закупки в  долл. или евро (зависит от поставщика) пример 1.25</div><div class="col-6"> <input type=number style="width:70px;" name=price_zakup id=price_zakup class="form-control" value="'. $data['price_zakup'] .'"></div>
-<div class="col-12">Цвета разделитель ;<textarea row=2 name=colors id=colors class="form-control">'. $data['colors'] .'</textarea></div>
-<div class="col-12">Опции <textarea row=2 name=options id=options class="form-control">'. $data['options'] .'</textarea></div>
+</div><div class="col-6"> <input type=number style="width:70px;" name=min_lot id=min_lot class="form-control" value="'. ($data['min_lot']??'') .'"></div>
+<div class="col-6 text-right">минимальный заказ в шт.</div><div class="col-6"> <input type=number style="width:70px;" name=min_order id=min_order class="form-control" value="'. ($data['min_order']??'') .'"></div>
+<div class="col-6 text-right">Цена закупки в  долл. или евро (зависит от поставщика) пример 1.25</div><div class="col-6"> <input type=number style="width:70px;" name=price_zakup id=price_zakup class="form-control" value="'. ($data['price_zakup']??'') .'"></div>
+<div class="col-12">Цвета разделитель ;<textarea row=2 name=colors id=colors class="form-control">'. ($data['colors']??'') .'</textarea></div>
+<div class="col-12">Опции <textarea row=2 name=options id=options class="form-control">'. ($data['options']??'') .'</textarea></div>
 
 
 <div class="col-12">
@@ -93,13 +95,17 @@ echo'</div>
 
 
 function save_providerder(){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_product_provider_add/',
+       url: '/products/ajax-product-provider-add/',
        method: 'post',       
        dataType: 'html',        
        data: {id: '<?=$id?>', provider_id: $('#provider_id').val(),
        options: $('#options').val(),  expiration_days: $('#expiration_days').val(),  
-       min_lot: $('#min_lot').val(), colors: $('#colors').val(), min_order: $('#min_order').val(), price_zakup: $('#price_zakup').val(), group_id: $('#group_id').val() , main: $('#main').val() , view: $('#view').val()   },  
+       min_lot: $('#min_lot').val(), colors: $('#colors').val(), min_order: $('#min_order').val(), price_zakup: $('#price_zakup').val(), group_id: $('#group_id').val() , main: $('#main').val() , view: $('#view').val(), [param3]:token3 },
        success: function(data){  
     $('#result_prov').html(data);
        }}); 
index 849dc4ae2fc65348284574965acaf28a35e8fa3f..d83130bee12897d847fdb0b3426c756d20a2d7b3 100644 (file)
@@ -1,8 +1,10 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
-if(!empty($_REQUEST["id"])) { 
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+if(!empty($_REQUEST["id"])) {
   $id=htmlentities($_REQUEST["id"]);
   $options=htmlentities($_REQUEST["options"]);
   $provider_id=htmlentities($_REQUEST["provider_id"]);
@@ -19,9 +21,10 @@ if(!empty($_REQUEST["id"])) {
   
   $db::sql("UPDATE products_1c SET view=? WHERE id=? LIMIT 1",[$view,$id]);
 
- $db::sql("INSERT INTO products_1c_options (id, options, provider_id, expiration_days,min_lot,colors,price_zakup,min_order,group_id,main) 
- VALUES (?, ?, ?, ?,?,?,?,?,?, ?) ON DUPLICATE KEY UPDATE options=?, provider_id=?, expiration_days=?, min_lot=?, colors=?, price_zakup=?, min_order=?, group_id=?, main=? ",
- [$id, $options, $provider_id , $expiration_days, $min_lot, $colors, $price_zakup, $min_order, $group_id, $main, $options, $provider_id, $expiration_days, $min_lot, $colors, $price_zakup, $min_order, $group_id, $main ]);    
+  $sql = "INSERT INTO products_1c_options (id, options, provider_id, expiration_days,min_lot,colors,price_zakup,min_order,group_id,main) 
+ VALUES (?, ?, ?, ?,?,?,?,?,?, ?) ON CONFLICT (id) DO UPDATE SET options=?, provider_id=?, expiration_days=?, min_lot=?, colors=?, price_zakup=?, min_order=?, group_id=?, main=? ";
+ $db::sql($sql,
+ [$id, $options, $provider_id , $expiration_days, $min_lot, $colors, $price_zakup, $min_order, $group_id, $main, $options, $provider_id, $expiration_days, $min_lot, $colors, $price_zakup, $min_order, $group_id, $main ]);
  echo"ok";
 
 }
index 40d74e5c6049fb12a48add8004a2ac5d00c23c80..e96f87f441b5db0eb59321d749571308e5f345a6 100644 (file)
@@ -1,8 +1,9 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/db2.php");
-include_once("inc/base_new.php");
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
 if(!empty($_REQUEST["parent_id"])) { $parent_id=htmlentities($_REQUEST["parent_id"]);
 $q = "SELECT p.id, p.name, e.entity_id, p.view  FROM products_1c as p LEFT JOIN export_import_table as e ON e.export_id='1' AND e.entity='products' AND e.export_val=p.id WHERE p.tip='products' AND p.parent_id=? order by p.name ASC";
 
@@ -19,7 +20,7 @@ foreach ($data0 as $row0) $colorsProducts[$row0['id']]= explode(";",$row0['color
 
 
 
-$data0=$db::getRows("SELECT product_id,color,name FROM products_varieties WHERE 1 order by posit desc");
+$data0=$db::getRows("SELECT product_id,color,name FROM products_varieties WHERE 1 = 1 order by posit desc");
 foreach($data0 as $row){
 $products_varieties[$row["product_id"]][$row["color"]][]=$row["name"];        
 }
@@ -44,7 +45,7 @@ echo'<table class="table table-sm table-hover"><tbody>';
  //echo count($data2); echo"шт ";
 
 
-   echo'<div  id="provider_'.$row['id'].'"  class="btn btn-sm btn-warning" onclick="ajax_product_provider(\''.$row['id'].'\'); " >+ поставщика '.$providers[$row['id']].'</div>';
+   echo'<div  id="provider_'.$row['id'].'"  class="btn btn-sm btn-warning" onclick="ajax_product_provider(\''.$row['id'].'\'); " >+ поставщика '.($providers[$row['id']]??'').'</div>';
 
 if(!empty($colorsProducts[$row["id"]])) {
     $s=0;
@@ -82,7 +83,7 @@ if($s>0) echo"<a href=\"/products/productVarieties/?id=".$row['id']."\" target=n
   if(!empty($prices[$row['id']]) and empty($row["entity_id"])) 
 echo'<div  id="diver_'.$row['id'].'"  class="btn btn-sm btn-warning" onclick="ajax_add_product(\''.$row['id'].'\',\''.$parent_id.'\',\''.$row['name'].'\',\''.$prices[$row['id']].'\'); " >внести цена '.$prices[$row['id']].'</div>';
 else {
-   echo'<div  id="diver_'.$row['id'].'"  class="btn btn-sm btn-warning" onclick="ajax_add_product(\''.$row['id'].'\',\''.$parent_id.'\',\''.$row['name'].'\',\''.$prices[$row['id']].'\'); " >внести цена '.$prices[$row['id']].'</div>';
+   echo'<div  id="diver_'.$row['id'].'"  class="btn btn-sm btn-warning" onclick="ajax_add_product(\''.$row['id'].'\',\''.$parent_id.'\',\''.$row['name'].'\',\''.($prices[$row['id']]??'').'\'); " >внести цена '.($prices[$row['id']]??'').'</div>';
  
 
     
index 249ab8f83c1ad97136d1935d2122cb0275550b70..7c7cdb3087f6e170eb684b31287dc65e8444d14f 100644 (file)
@@ -1,8 +1,10 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
-if(!empty($_REQUEST["id"])) { 
+<?php
+
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+
+if(!empty($_REQUEST["id"])) {
 $id=htmlentities($_REQUEST["id"]);
 
 
index f259329db954b351769b93fde1b2c0952c8759d9..c505ec1616b4fe75b46db2a3a36fa214ca38114d 100644 (file)
@@ -1,10 +1,9 @@
-<?
-include_once ("startup.php");
-include_once("inc/db.php");
-include_once("inc/base_new.php");
-include_once("inc/design_new.php");
+<?php
 
-include"templates/top.php";
+include_once(dirname(__DIR__, 2) . "/startup.php");
+include_once(dirname(__DIR__, 2) . "/inc/db.php");
+include_once(dirname(__DIR__, 2) . "/inc/base_new.php");
+include_once(dirname(__DIR__, 2) . "/inc/design_new.php");
 
 
 
@@ -28,12 +27,12 @@ function build_tree($cats,$parent_id,$only_parent = false){
  //   if(is_array($cats) and isset($cats[$parent_id])){
         $tree = '<ul style="margin-left:30px;" class="">';
         if($only_parent==false){
-            foreach($cats[$parent_id] as $cat){
+            foreach($cats[$parent_id] ?? [] as $cat){
                 $tree .= '<li class="grup"><table class="m-0 table table-hover"><tbody>';
                 $tree .= '<tr id="tr_'.$cat['id'].'"><td><span class="btn btn-info btn-sm me-2" onclick="if(!document.getElementById(\'trr_'.$cat['id'].'\')) ajax_products_in_group(\''.$cat['id'].'\'); $(\'#trr_'.$cat['id'].'\').toggle();">+</span>
                 <b>'.$cat['name'].'</b><span class="dd'.$cat['id'].'">';
             
- foreach($products_class_row[$cat['id']] as $kk => $tipi) {
+ foreach($products_class_row[$cat['id']] ?? [] as $kk => $tipi) {
      $tree .= ' <span class="tag m-1 tag-info">'.$products_class[$tipi].'  </span> ';
       }
             
@@ -87,12 +86,15 @@ $_CONFIG["jscss"]="
 function ajax_product_provider(id){
 
  jQuery('#modal-7').modal('show', {backdrop: 'static'}); $('#modal-7 .modal-title').text('Поставщики');  
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_product_provider/',
+       url: '/products/ajax-product-provider/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+''},  
+       data: {id: ''+id+'', [param3]:token3},  
        success: function(data){  
     $('#modal-7 .modal-body').html(data);
        }}); 
@@ -105,12 +107,15 @@ $.ajax({
 function ajax_group_config(id){
 
  jQuery('#modal-7').modal('show', {backdrop: 'static'}); $('#modal-7 .modal-title').text('Настрока категории');  
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_group_config/',
+       url: '/products/ajax-group-config/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+''},  
+       data: {id: ''+id+'', [param3]:token3},  
        success: function(data){  
     $('#modal-7 .modal-body').html(data);
        }}); 
@@ -118,11 +123,14 @@ $.ajax({
 
 function ajax_products_in_group(parent_id){
 
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_products_in_group/',
+       url: '/products/ajax-products-in-group/',
        method: 'post',       
        dataType: 'html',        
-       data: {parent_id: ''+parent_id+''},  
+       data: {parent_id: ''+parent_id+'', [param3]:token3},  
        success: function(data){  
    $('#tr_'+parent_id+'').after('<tr id=\"trr_'+parent_id+'\"><td colspan=2>'+data+'</td></tr>');
 
@@ -130,11 +138,15 @@ $.ajax({
 }
 
 function ajax_class_group(parent_id, tip){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_class_group/',
+       url: '/products/ajax-class-group/',
        method: 'post',       
        dataType: 'html',        
-       data: {parent_id: ''+parent_id+'',tip: ''+tip+''},  
+       data: {parent_id: ''+parent_id+'',tip: ''+tip+'', [param3]:token3},  
        success: function(data){  
    $('.dd'+parent_id+''+tip+'').html(data);   
    
@@ -143,11 +155,15 @@ $.ajax({
 
 
 function ajax_class_group_remove(id, tip){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_class_group_remove/',
+       url: '/products/ajax-class-group-remove/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+'', tip: ''+tip+''},  
+       data: {id: ''+id+'', tip: ''+tip+'', [param3]:token3},  
        success: function(data){  
     $('.dd'+id+''+tip+'').html(data);  
        }}); 
@@ -156,22 +172,30 @@ $.ajax({
 
 
 function ajax_add_product(id,parent_id,name,price){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_add_product/',
+       url: '/products/ajax-add-product/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+'', name: ''+name+'',parent_id: ''+parent_id+'',price: ''+price+''},  
+       data: {id: ''+id+'', name: ''+name+'',parent_id: ''+parent_id+'',price: ''+price+'', [param3]:token3},  
        success: function(data){  
    $('#diver_'+id+'').html(data);
 
        }}); 
 }
 function ajax_remove_product(id){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajax_remove_product/',
+       url: '/products/ajax-remove-product/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+''},  
+       data: {id: ''+id+'', [param3]:token3},  
        success: function(data){  
    $('#diver_'+id+'').html(data);
 
@@ -180,11 +204,15 @@ $.ajax({
 
 
 function ajaxRemoveExport(id){
+
+const param3 = $('meta[name=csrf-param]').attr('content');
+const token3 = $('meta[name=csrf-token]').attr('content');
+
 $.ajax({
-       url: '/products/ajaxRemoveExport/',
+       url: '/products/ajax-remove-export/',
        method: 'post',       
        dataType: 'html',        
-       data: {id: ''+id+''},  
+       data: {id: ''+id+'', [param3]:token3},  
        success: function(data){  
    $('#diver2_'+id+'').html(data);
 
@@ -217,11 +245,11 @@ $.ajax({
                        </div>
                </div>
 
-'; 
+';
+
 
 
 
 
 
-include"templates/bottom.php";
\ No newline at end of file
+include_once dirname(__DIR__, 2) . '/templates/bottom_light.php';
\ No newline at end of file
diff --git a/erp24/views/products/ajax-add-product.php b/erp24/views/products/ajax-add-product.php
new file mode 100644 (file)
index 0000000..0bc5aa1
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_add_product.php';
diff --git a/erp24/views/products/ajax-class-group-remove.php b/erp24/views/products/ajax-class-group-remove.php
new file mode 100644 (file)
index 0000000..861157b
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_class_group_remove.php';
diff --git a/erp24/views/products/ajax-class-group.php b/erp24/views/products/ajax-class-group.php
new file mode 100644 (file)
index 0000000..8d9932c
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_class_group.php';
diff --git a/erp24/views/products/ajax-group-config.php b/erp24/views/products/ajax-group-config.php
new file mode 100644 (file)
index 0000000..042f73a
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_group_config.php';
diff --git a/erp24/views/products/ajax-product-provider-add.php b/erp24/views/products/ajax-product-provider-add.php
new file mode 100644 (file)
index 0000000..7518f91
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_product_provider_add.php';
\ No newline at end of file
diff --git a/erp24/views/products/ajax-product-provider.php b/erp24/views/products/ajax-product-provider.php
new file mode 100644 (file)
index 0000000..6b5fd56
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_product_provider.php';
diff --git a/erp24/views/products/ajax-products-in-group.php b/erp24/views/products/ajax-products-in-group.php
new file mode 100644 (file)
index 0000000..7806491
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_products_in_group.php';
diff --git a/erp24/views/products/ajax-remove-export.php b/erp24/views/products/ajax-remove-export.php
new file mode 100644 (file)
index 0000000..34287f0
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajaxRemoveExport.php';
diff --git a/erp24/views/products/ajax-remove-product.php b/erp24/views/products/ajax-remove-product.php
new file mode 100644 (file)
index 0000000..4cd2fec
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/ajax_remove_product.php';
diff --git a/erp24/views/products/products-1c.php b/erp24/views/products/products-1c.php
new file mode 100644 (file)
index 0000000..0386286
--- /dev/null
@@ -0,0 +1,5 @@
+<?php
+
+chdir(__DIR__ . '/../../');
+
+include 'modul/products/products_1c.php';
\ No newline at end of file