From 4cf8e96369829ebddd8364f5c39a9db4dc80dc7b Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 16 Sep 2024 16:24:48 +0300 Subject: [PATCH] profile move to yii --- erp24/controllers/ProfileController.php | 10 ++++++++++ erp24/inc/uni.php | 2 +- erp24/inc/uni2.php | 8 ++++---- erp24/modul/profile/index.php | 19 +++++++++---------- erp24/views/profile/index.php | 6 ++++++ 5 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 erp24/controllers/ProfileController.php create mode 100644 erp24/views/profile/index.php diff --git a/erp24/controllers/ProfileController.php b/erp24/controllers/ProfileController.php new file mode 100644 index 00000000..40ab455a --- /dev/null +++ b/erp24/controllers/ProfileController.php @@ -0,0 +1,10 @@ +render('index'); } +} \ No newline at end of file diff --git a/erp24/inc/uni.php b/erp24/inc/uni.php index 936e1411..3f082064 100644 --- a/erp24/inc/uni.php +++ b/erp24/inc/uni.php @@ -114,7 +114,7 @@ $arrs2[$pid]["arr"]=[$value=>$k[$name_txt]]; $return_array=[]; $return_array=outSelect($val,$name_id,$name_txt,$category_arr,0, 0,"",$mass_start); -foreach($arrs2 as $ide => $vale) { +foreach($arrs2 ?? [] as $ide => $vale) { //echo"
++ $ide => $vale "; $return_array[$ide]=$vale; } diff --git a/erp24/inc/uni2.php b/erp24/inc/uni2.php index 26817c97..5b6640a2 100644 --- a/erp24/inc/uni2.php +++ b/erp24/inc/uni2.php @@ -335,7 +335,7 @@ foreach ($data as $row) { if(empty($row["val"]) and !empty($row["select_val"])) $row["val"]=$row["select_val"]; -$image_config=json_decode($row["image_config"], true,JSON_UNESCAPED_UNICODE); +$image_config=json_decode($row["image_config"] ?? '{"ext" : ""}', true,JSON_UNESCAPED_UNICODE); $ext_1=explode(",",$image_config["ext"]); @@ -1498,7 +1498,7 @@ elseif(isset($forma[$name]["value"])) echo $forma[$name]["value"]; /*file*/ if($pole_arr["type"]=="image") { -$image_config=json_decode($forma[$name]["image_config"], true,JSON_UNESCAPED_UNICODE); +$image_config=json_decode($forma[$name]["image_config"] ?? '{"ext" : "", "param" : []}', true,JSON_UNESCAPED_UNICODE); $ext_1=$image_config["ext"]; $sel=""; @@ -1598,7 +1598,7 @@ echo "".$movie->getFrameWidth()." x ".$movie->getFrameHeight().""; } -echo">".$item[$name]."
$img "; } +echo">".$item[$name]."
" . ($img ?? "") . " "; } /*file*/ @@ -2206,7 +2206,7 @@ echo''; /*button*/ if($pole_arr["type"]=="button") echo"
-
"; diff --git a/erp24/modul/profile/index.php b/erp24/modul/profile/index.php index 41f3ec55..a68b2a1a 100644 --- a/erp24/modul/profile/index.php +++ b/erp24/modul/profile/index.php @@ -1,15 +1,14 @@ -"-не выбрано-"]); +$store_arr=outSelectsql("0","city_store","id","","name","WHERE 1 = 1","",[0=>"-не выбрано-"]); $astore_arr=outSelectsql("0","admin","id","","name","WHERE group_id='50'","",[0=>"-не выбрано-"]); $group_arr=outSelectsql("0","admin_group","id","","name","WHERE id='35' or id='30' or id='40' or id='21' ","",[0=>"-не выбрано-"]); @@ -64,4 +63,4 @@ construct_form_azea($forma,"admin","Профиль","3","","",$arrconf=array("WH -include_once"templates/bottom.php"; +//include_once"templates/bottom.php"; diff --git a/erp24/views/profile/index.php b/erp24/views/profile/index.php new file mode 100644 index 00000000..320cf29d --- /dev/null +++ b/erp24/views/profile/index.php @@ -0,0 +1,6 @@ +