Thread Verfasser: Catzenjaeger
Thread ID: 878
Thread Info
Es gibt 11 Beiträge zu diesem Thema, und es wurde 5108 Mal angesehen.  Ausserdem wurden Dateien angehängt.
 Thema drucken
dropdown - Feld bei editieren mit gepeicherten Wert belegen
Catzenjaeger
In folgender Datei fülle ich einzelne Formularfelder mittels Dropdown das sich die Werte aus einer anderen DB Tabelle holt. Das kalppt auch. Beim editieren jedoch werden nicht die aktuell gespeicherten Werte aus der DB sondern andere (falsche) angezeigt.
Was ist da falsch bzw was habe ich übersehen?

Beispiel: die CAT (also figure_cat ) wird ordenungsgemass als Dropdown angezeigt und bei Aufruf wo ich den Datensatz wieder editieren kann wird der richtige Wert ebenfalls wieder angezeigt. Das ist aber nur bei den CATS so . Cei allen anderen Feldern die ich via Dropdown füllen lasse bekomme ich nicht die aktuell gepeicherten Werte die in der Datenbank stehen angezeigt und ich weiss nicht warum. Irgendwo habe ich einen Aktualisierung vergessen bzw übersehen.

Kann jemand helfen?

Hier das ganze file


<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: figure_items.php
| Author: Khalid545
| URL: http://khalidb.co.cc/
| E-Mail: khalidd545@gmail.com
|
| Modification: Catzenjaeger
| URL: www.aliencollectors.com
| E-Mail: admin@aliencollectors.com
|
| Original file: downloads.php By Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../../maincore.php";
require_once THEMES."templates/admin_header.php";
require_once INCLUDES."bbcode_include.php";
include "../infusion_db.php";

$asettings['figure_photo_max_b'] = 4500000;
$asettings['figure_photo_max_w'] = 3840; //3.840 x 2.160 = 4K Auflösung
$asettings['figure_photo_max_h'] = 2160;

if (!checkrights("BOL") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect(BASEDIR."index.php"); }

if (isset($_GET['status']) && !isset($message)) {
   if ($_GET['status'] == "sn") {
      $message = $locale['figure_110'];
   } elseif ($_GET['status'] == "su") {
      $message = $locale['figure_111'];
   } elseif ($_GET['status'] == "se") {
      $message = $locale['figure_113']."<br />\n<span class='small'>";
      if ($_GET['error'] == 0) { $message .= $locale['figure_117']."</span>"; }
      elseif ($_GET['error'] == 1) { $message .= $locale['figure_114']."</span>"; }
      elseif ($_GET['error'] == 2) { $message .= sprintf($locale['figure_115'], parsebytesize($asettings['figure_max_b']))."</span>"; }
      elseif ($_GET['error'] == 3) { $message .= sprintf($locale['figure_116'], str_replace(',', ' ', $asettings['figure_types']))."</span>"; }
      elseif ($_GET['error'] == 4) { $message .= $locale['figure_118']."</span>"; }
      elseif ($_GET['error'] == 5) { $message .=  $locale['figure_170']."</span>";}
      elseif ($_GET['error'] == 6) { $message .=  sprintf($locale['figure_171'], parsebytesize($asettings['figure_photo_max_b']))."</span>";}
      elseif ($_GET['error'] == 7) { $message .=  $locale['figure_172']."</span>";}
      elseif ($_GET['error'] == 8) { $message .=  sprintf($locale['figure_173'], $asettings['figure_photo_max_w'], $asettings['figure_photo_max_h'])."</span>";}
   } elseif ($_GET['status'] == "del") {
      $message = $locale['figure_112'];
   }
   if ($message) { echo "<div id='close-message'><div class='admin-message'>".$message."</div></div>\n"; }
}

$result = dbquery("SELECT * FROM ".DB_FIGURE_CATS);
if (dbrows($result)) {
   if ((isset($_GET['action']) && $_GET['action'] == "delete") && (isset($_GET['figure_id']) && isnum($_GET['figure_id']))) {
      $result = dbquery("SELECT figure_file, figure_cat FROM ".DB_FIGURE." WHERE figure_id='".$_GET['figure_id']."'");
      if (dbrows($result)) {
         $data = dbarray($result);
         if (!empty($data['figure_file']) && file_exists(FIGURES.$data['figure_file'])) {
            @unlink(FIGURES.$data['figure_file']);
         }
         if (!empty($data['figure_image']) && file_exists(IMAGES_FIGURE.$data['figure_image'])) {
            @unlink(IMAGES_FIGURE.$data['figure_image']);
         }
         $result = dbquery("DELETE FROM ".DB_FIGURE." WHERE figure_id='".$_GET['figure_id']."'");
         $result = dbquery("UPDATE ".DB_FIGURE_CATS." SET figure_cat_items=figure_cat_items-1 WHERE figure_cat_id='".$data['figure_cat']."'");   
         $result = dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_item_id='".$_POST['figure_id']."' and comment_type='BO'");         
         $result = dbquery("DELETE FROM ".DB_RATINGS." WHERE rating_item_id='".$_POST['news_id']."' and rating_type='B'");         

      }   
      redirect(FUSION_SELF.$aidlink."&figure_cat_id=".intval($_GET['figure_cat_id'])."&status=del");
   } elseif (isset($_POST['save_download'])) {
      $valid_ext = explode(",", $asettings['figure_types']);
      $error = 0;
      $figure_title = stripinput($_POST['figure_title']);
   //NEU ANFANG
      //$figure_submanufacturer = stripinput($_POST['figure_submanufacturer']);
      $figure_brand = stripinput($_POST['figure_brand']);
      $figure_series = stripinput($_POST['figure_series']);
      $figure_variant = stripinput($_POST['figure_variant']);
      $figure_scale = stripinput($_POST['figure_scale']);
      $figure_weight = stripinput($_POST['figure_weight']);
      $figure_height = stripinput($_POST['figure_height']);
      $figure_width = stripinput($_POST['figure_width']);
      $figure_depth = stripinput($_POST['figure_depth']);
      $figure_material = stripinput($_POST['figure_material']);
      $figure_poa = stripinput($_POST['figure_poa']);
      //$figure_tpoa = stripinput($_POST['figure_tpoa']);
      $figure_packaging = stripinput($_POST['figure_packaging']);
      $figure_retailprice = stripinput($_POST['figure_retailprice']);
      $figure_usedprice = stripinput($_POST['figure_usedprice']);
      $figure_limitation = stripinput($_POST['figure_limitation']);
      $figure_editionsize = stripinput($_POST['figure_editionsize']);
      $figure_artists = stripinput($_POST['figure_artists']);   
   //NEU ENDE      
      //$figure_author = stripinput($_POST['figure_author']);
      $figure_country = stripinput($_POST['figure_country']);
      $figure_manufacturer = stripinput($_POST['figure_manufacturer']);
      $figure_pubdate = stripinput($_POST['figure_pubdate']);
   //NEU
      $figure_accessories = trim(stripinput($_POST['figure_accessories']));
      $figure_description = trim(stripinput($_POST['figure_description']));
   //NEU ENDE
      //$figure_filesize = stripinput($_POST['figure_filesize']);
      $figure_filesize = 1;
      if (isset($_POST['del_upload']) && isset($_GET['figure_id']) && isnum($_GET['figure_id'])) {
         $result = dbquery("SELECT figure_file FROM ".DB_FIGURE." WHERE figure_id='".$_GET['figure_id']."'");
         if (dbrows($result)) {
            $data = dbarray($result);
            if (!empty($data['figure_file']) && file_exists(FIGURES.$data['figure_file'])) {
               @unlink(FIGURES.$data['figure_file']);
            }
         }   
         $figure_file = "";
      } elseif (!empty($_FILES['figure_file']['name']) && is_uploaded_file($_FILES['figure_file']['tmp_name'])) {
         $figure_url = "";

         $file = $_FILES['figure_file'];
         $file_name = str_replace(" ", "_", strtolower(substr($file['name'], 0, strrpos($file['name'], "."))));
         $file_ext = strtolower(strrchr($file['name'],"."));
         $target_folder = FIGURES;
         if (!preg_match("/^[-0-9A-Z_\.\[\]]+$/i", $file_name)) {
            // Invalid file name
            $error = 1;
         } elseif ($file['size'] > $asettings['figure_max_b']){
            // Invalid file size
            $error = 2;
         } elseif (!in_array($file_ext, $valid_ext)) {
            // Invalid file extension
            $error = 3;
         } else {
            if (file_exists($target_folder.$file_name.$file_ext)) {
               $i = 1; $file_name_2 = $file_name;
               while (file_exists($target_folder.$file_name_2.$file_ext)) {
                  $file_name_2 = $file_name."_".$i;
                  $i++;
               }
               $file_name = $file_name_2;
            }
            move_uploaded_file($file['tmp_name'], $target_folder.$file_name.$file_ext);
            chmod($target_folder.$file_name.$file_ext, 0644);
            $figure_file = $file_name.$file_ext;
            if (isset($_POST['calc_upload'])) {
               $figure_filesize = parsebytesize($file['size']);
            }
         }
      } elseif ((isset($_POST['figure_url']) && $_POST['figure_url'] != "")  || isset($_POST['figure_file'])) {
         $figure_url = (isset($_POST['figure_url']) ? stripinput($_POST['figure_url']) : "");
         $figure_file = (isset($_POST['figure_file']) ? $_POST['figure_file'] : "");
      } else {
         $error = 4;
      }
      if (isset($_FILES['figure_image']) && is_uploaded_file($_FILES['figure_image']['tmp_name'])) {
         require_once INCLUDES."photo_functions_include.php";
         $image = $_FILES['figure_image'];
         $image_name = str_replace(" ", "_", strtolower(substr($image['name'], 0, strrpos($image['name'], "."))));
         $image_ext = strtolower(strrchr($image['name'],"."));

         if ($image_ext == ".gif") { $filetype = 1;
         } elseif ($image_ext == ".jpg") { $filetype = 2;
         } elseif ($image_ext == ".png") { $filetype = 3;
         } else { $filetype = false; }

         if (!preg_match("/^[-0-9A-Z_\.\[\]]+$/i", $image_name)) {
            $error = 5;
         } elseif ($image['size'] > $asettings['figure_photo_max_b']){
            $error = 6;
         } elseif (!$filetype) {
            $error = 7;
         } else {
            $image_full = image_exists(IMAGES_FIGURE, $image_name.$image_ext);
            move_uploaded_file($_FILES['figure_image']['tmp_name'], IMAGES_FIGURE.$image_full);
            if (function_exists("chmod")) { chmod(IMAGES_FIGURE.$image_full, 0644); }
            $imagefile = @getimagesize(IMAGES_FIGURE.$image_full);
            if ($imagefile[0] > $asettings['figure_photo_max_w'] || $imagefile[1] > $asettings['figure_photo_max_h']) {
               $error = 8;
               unlink(IMAGES_FIGURE.$image_full);
            } else {
               createthumbnail($filetype, IMAGES_FIGURE.$image_full, IMAGES_FIGURE.$image_full, 3840, 2160);
            }
         }
         if (!$error) {
            $figure_image = $image_full;
         } else {
            $figure_image = "";
         }
      } else {
         $figure_image = (isset($_POST['figure_image']) ? $_POST['figure_image'] : "");
      }
      $figure_cat = intval($_POST['figure_cat']);
      $figure_comments = isset($_POST['figure_comments']) ? "1" : "0";
      $figure_ratings = isset($_POST['figure_ratings']) ? "1" : "0";
      if ($figure_title && $error == 0) {
         if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['figure_id']) && isnum($_GET['figure_id']))) {
            if (isset($_POST['del_image'])) {
               if (!empty($data['figure_image']) && file_exists(IMAGES_FIGURE.$data['figure_image'])) { unlink(IMAGES_FIGURE.$data['figure_image']); }
               $figure_image = "";
            }
            $figure_datestamp = isset($_POST['update_datestamp']) ? ", figure_datestamp='".time()."'" : "";
            $result = dbquery("SELECT figure_cat FROM ".DB_FIGURE." WHERE figure_id='".$_GET['figure_id']."'");
            if (dbrows($result)) {
               $data = dbarray($result);
               if ($data['figure_cat']!=$figure_cat) {
                  $result = dbquery("UPDATE ".DB_FIGURE_CATS." SET figure_cat_items=figure_cat_items-1 WHERE figure_cat_id='".$data['figure_cat']."'");
                  $result = dbquery("UPDATE ".DB_FIGURE_CATS." SET figure_cat_items=figure_cat_items+1 WHERE figure_cat_id='".$figure_cat."'");
               }
            }
            
/*
            //ÄNDERUNG
            $result = dbquery("UPDATE ".DB_FIGURE." SET figure_title='$figure_title', figure_submanufacturer='$figure_submanufacturer',   figure_brand='$figure_brand', figure_series='$figure_series', figure_variant='$figure_variant', figure_scale='$figure_scale', figure_weight='$figure_weight', figure_height='$figure_height', figure_width='$figure_width', figure_depth='$figure_depth', figure_material='$figure_material', figure_poa='$figure_poa', figure_tpoa='$figure_tpoa', figure_packaging='$figure_packaging', figure_retailprice='$figure_retailprice', figure_usedprice='$figure_usedprice', figure_limitation='$figure_limitation', figure_editionsize='$figure_editionsize', figure_artists='$figure_artists', figure_country='$figure_country', figure_manufacturer='$figure_manufacturer', figure_pubdate='$figure_pubdate', figure_image='$figure_image', figure_accessories='$figure_accessories', figure_description='$figure_description', figure_url='$figure_url', figure_file='$figure_file', figure_cat='$figure_cat', figure_allow_comments='$figure_comments', figure_allow_ratings='$figure_ratings', figure_filesize='$figure_filesize'".$figure_datestamp." WHERE figure_id='".$_GET['figure_id']."'");
            //ÄNDERUNG ENDE
            redirect(FUSION_SELF.$aidlink."&figure_cat_id=".$figure_cat."&status=su");
         } else {
            //ÄNDERUNG
            $result = dbquery("INSERT INTO ".DB_FIGURE." (figure_title,   figure_submanufacturer,   figure_brand, figure_series, figure_variant, figure_scale, figure_weight, figure_height, figure_width, figure_depth, figure_material, figure_poa, figure_tpoa, figure_packaging,   figure_retailprice, figure_usedprice, figure_limitation, figure_editionsize, figure_artists, figure_country, figure_manufacturer, figure_pubdate, figure_image, figure_accessories, figure_description, figure_url, figure_file, figure_cat, figure_name, figure_filesize, figure_datestamp, figure_count, figure_allow_comments, figure_allow_ratings) VALUES ('$figure_title', '$figure_submanufacturer', '$figure_brand', '$figure_series', '$figure_variant', '$figure_scale', '$figure_weight', '$figure_height', '$figure_width', '$figure_depth', '$figure_material', '$figure_poa', '$figure_tpoa', '$figure_packaging', '$figure_retailprice', '$figure_usedprice', '$figure_limitation', '$figure_editionsize', '$figure_artists', '$figure_country', '$figure_manufacturer', '$figure_pubdate', '$figure_image', '$figure_accessories', '$figure_description', '$figure_url', '$figure_file', '$figure_cat', '".$userdata['user_id']."', '$figure_filesize', '".time()."', '0', '$figure_comments', '$figure_ratings')");
            //ÄNDERUNG ENDE
*/

//ÄNDERUNG
            $result = dbquery("UPDATE ".DB_FIGURE." SET figure_title='$figure_title', figure_brand='$figure_brand', figure_series='$figure_series', figure_variant='$figure_variant', figure_scale='$figure_scale', figure_weight='$figure_weight', figure_height='$figure_height', figure_width='$figure_width', figure_depth='$figure_depth', figure_material='$figure_material', figure_poa='$figure_poa', figure_packaging='$figure_packaging', figure_retailprice='$figure_retailprice', figure_usedprice='$figure_usedprice', figure_limitation='$figure_limitation', figure_editionsize='$figure_editionsize', figure_artists='$figure_artists', figure_country='$figure_country', figure_manufacturer='$figure_manufacturer', figure_pubdate='$figure_pubdate', figure_image='$figure_image', figure_accessories='$figure_accessories', figure_description='$figure_description', figure_url='$figure_url', figure_file='$figure_file', figure_cat='$figure_cat', figure_allow_comments='$figure_comments', figure_allow_ratings='$figure_ratings', figure_filesize='$figure_filesize'".$figure_datestamp." WHERE figure_id='".$_GET['figure_id']."'");
//ÄNDERUNG ENDE
            redirect(FUSION_SELF.$aidlink."&figure_cat_id=".$figure_cat."&status=su");
         } else {
//ÄNDERUNG
            $result = dbquery("INSERT INTO ".DB_FIGURE." (figure_title,   figure_brand, figure_series, figure_variant, figure_scale, figure_weight, figure_height, figure_width, figure_depth, figure_material, figure_poa, figure_packaging,   figure_retailprice, figure_usedprice, figure_limitation, figure_editionsize, figure_artists, figure_country, figure_manufacturer, figure_pubdate, figure_image, figure_accessories, figure_description, figure_url, figure_file, figure_cat, figure_name, figure_filesize, figure_datestamp, figure_count, figure_allow_comments, figure_allow_ratings) VALUES ('$figure_title', '$figure_brand', '$figure_series', '$figure_variant', '$figure_scale', '$figure_weight', '$figure_height', '$figure_width', '$figure_depth', '$figure_material', '$figure_poa', ' $figure_packaging', '$figure_retailprice', '$figure_usedprice', '$figure_limitation', '$figure_editionsize', '$figure_artists', '$figure_country', '$figure_manufacturer', '$figure_pubdate', '$figure_image', '$figure_accessories', '$figure_description', '$figure_url', '$figure_file', '$figure_cat', '".$userdata['user_id']."', '$figure_filesize', '".time()."', '0', '$figure_comments', '$figure_ratings')");
//ÄNDERUNG ENDE
            $result = dbquery("UPDATE ".DB_FIGURE_CATS." SET figure_cat_items=figure_cat_items+1 WHERE figure_cat_id='".$figure_cat."'");
            redirect(FUSION_SELF.$aidlink."&figure_cat_id=".$figure_cat."&status=sn");
         }
      } else {
         redirect(FUSION_SELF.$aidlink."&status=se&error=$error");
      }
   }
   if ((isset($_GET['action']) && $_GET['action'] == "edit") && (isset($_GET['figure_id']) && isnum($_GET['figure_id']))) {
      $result = dbquery("SELECT * FROM ".DB_FIGURE." WHERE figure_id='".$_GET['figure_id']."'");
      if (dbrows($result)) {
         $data = dbarray($result);
         $figure_title = $data['figure_title'];
      //NEU ANFANG
         //$figure_submanufacturer = $data['figure_submanufacturer'];
         $figure_brand = $data['figure_brand'];
         $figure_series = $data['figure_series'];
         $figure_variant = $data['figure_variant'];
         $figure_scale = $data['figure_scale'];
         $figure_weight = $data['figure_weight'];
         $figure_height = $data['figure_height'];
         $figure_width = $data['figure_width'];
         $figure_depth = $data['figure_depth'];
         $figure_material = $data['figure_material'];
         $figure_packaging = $data['figure_packaging'];
         $figure_poa = $data['figure_poa'];
         //$figure_tpoa = $data['figure_tpoa'];
         $figure_retailprice = $data['figure_retailprice'];
         $figure_usedprice = $data['figure_usedprice'];
         $figure_limitation = $data['figure_limitation'];
         $figure_editionsize = $data['figure_editionsize'];
         $figure_artists = $data['figure_artists'];
      //NEU ENDE   
         //$figure_author = $data['figure_author'];
         $figure_country = $data['figure_country'];
         $figure_manufacturer = $data['figure_manufacturer'];
         $figure_pubdate = $data['figure_pubdate'];
         $figure_image = $data['figure_image'];
      //NEU
         $figure_accessories = stripinput($data['figure_accessories']);
      //NEU ENDE
         $figure_description = stripinput($data['figure_description']);
         $figure_url = $data['figure_url'];
         $figure_file = $data['figure_file'];
         $figure_filesize = $data['figure_filesize'];
         $figure_comments = $data['figure_allow_comments'] == "1" ? " checked='checked'" : "";
         $figure_ratings = $data['figure_allow_ratings'] == "1" ? " checked='checked'" : "";
         $formaction = FUSION_SELF.$aidlink."&amp;action=edit&amp;figure_cat_id=".$data['figure_cat']."&amp;figure_id=".$data['figure_id'];
         opentable($locale['figure_101']);
      } else {
         redirect(FUSION_SELF.$aidlink);
      }
   } else {
      $figure_title = "";      
   //ANFANG
      //$figure_submanufacturer = "";
      $figure_brand = "";
      $figure_series = "";
      $figure_variant = "";
      $figure_scale = "";
      $figure_weight = "";
      $figure_height = "";
      $figure_width = "";
      $figure_depth = "";
      $figure_material = "";
      $figure_packaging = "";
      $figure_poa = "";
      //$figure_tpoa = "";
      $figure_retailprice = "";
      $figure_usedprice = "";
      $figure_limitation = "";
      $figure_editionsize = "";
      $figure_artists = "";
   //ENDE
      //$figure_author = "";
      $figure_country = "";
      $figure_manufacturer = "";
      $figure_pubdate = "";
      $figure_image = "";
   //NEU
      $figure_accessories = "";
   //ENDE
      $figure_description = "";
      $figure_url = "";
      $figure_file = "";
      $figure_comments = " checked='checked'";
      $figure_ratings = " checked='checked'";
      $figure_filesize = "";
      $formaction = FUSION_SELF.$aidlink;
      opentable($locale['figure_100']);
   }
   //CAT
   $editlistcat = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_cat = $data['figure_cat']; } else { $figure_cat = ""; }
   $resultcat = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='0' ORDER BY figure_cat_name");
   if (dbrows($resultcat) != 0) {
      while ($datacat = dbarray($resultcat)) {
         $editlistcat .= menu_subcats($datacat['figure_cat_id'], $datacat['figure_cat_name'],1);
      }
   }
   
   //Scale (locale 442)
   $editlistscale = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_scale = $data['figure_scale']; } else { $figure_scale = ""; }
   $resultscale = dbquery("SELECT * FROM ".DB_FIGURE_SCALES." WHERE figure_scale_parent='0' ORDER BY figure_scale_name");
   if (dbrows($resultscale) != 0) {
      while ($datascale = dbarray($resultscale)) {
         $editlistscale .= menu_subcats($datascale['figure_scale_id'], $datascale['figure_scale_name'],1);
      }
   }
   
   //MANUFACTURER 417
   $editlistmanufacturer = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_manufacturer = $data['figure_manufacturer']; } else { $figure_manufacturer = ""; }
   $resultmanufacturer = dbquery("SELECT * FROM ".DB_FIGURE_MANUFACTURERS." WHERE figure_manufacturer_parent='0' ORDER BY figure_manufacturer_name");
   if (dbrows($resultmanufacturer) != 0) {
      while ($datamanufacturer = dbarray($resultmanufacturer)) {
         $editlistmanufacturer .= menu_subcats($datamanufacturer['figure_manufacturer_id'], $datamanufacturer['figure_manufacturer_name'],1);
      }
   }
         
   //Material (locale 447)
   $editlistmaterial = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_material = $data['figure_material']; } else { $figure_material = ""; }
   $resultmaterial = dbquery("SELECT * FROM ".DB_FIGURE_MATERIALS." WHERE figure_material_parent='0' ORDER BY figure_material_name");
   if (dbrows($resultmaterial) != 0) {
      while ($datamaterial = dbarray($resultmaterial)) {
         $editlistmaterial .= menu_subcats($datamaterial['figure_material_id'], $datamaterial['figure_material_name'],1);
      }
   }
   
   //BRAND   438   
   $editlistbrand = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_brand = $data['figure_brand']; } else { $figure_brand = ""; }
   $resultbrand = dbquery("SELECT * FROM ".DB_FIGURE_BRANDS." WHERE figure_brand_parent='0' ORDER BY figure_brand_name");
   if (dbrows($resultbrand) != 0) {
      while ($databrand = dbarray($resultbrand)) {
         $editlistbrand .= menu_subcats($databrand['figure_brand_id'], $databrand['figure_brand_name'],1);
      }
   }
   
   //POINT OF ARTICULATION (455)
   $editlistpoa = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_poa = $data['figure_poa']; } else { $figure_poa = ""; }
   $resultpoa = dbquery("SELECT * FROM ".DB_FIGURE_POAS." WHERE figure_poa_parent='0' ORDER BY figure_poa_name");
   if (dbrows($resultpoa) != 0) {
      while ($datapoa = dbarray($resultpoa)) {
         $editlistpoa .= menu_subcats($datapoa['figure_poa_id'], $datapoa['figure_poa_name'],1);
      }
   }

/*   
   //TYP POINT OF ARTICULATION (458)
   $editlisttpoa = ""; if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_tpoa = $data['figure_tpoa']; } else { $figure_tpoa = ""; }
   $resulttpoa = dbquery("SELECT * FROM ".DB_FIGURE_TPOAS." WHERE figure_tpoa_parent='0' ORDER BY figure_tpoa_name");
   if (dbrows($resulttpoa) != 0) {
      while ($datatpoa = dbarray($resulttpoa)) {
         $editlisttpoa .= menu_subcats($datatpoa['figure_tpoa_id'], $datatpoa['figure_tpoa_name'],1);
      }
   }
*/   
   //Packaging (locale 448)
   $editlistpackaging = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_packaging = $data['figure_packaging']; } else { $figure_packaging = ""; }
   $resultpackaging = dbquery("SELECT * FROM ".DB_FIGURE_PACKAGINGS." WHERE figure_packaging_parent='0' ORDER BY figure_packaging_name");
   if (dbrows($resultpackaging) != 0) {
      while ($datapackaging = dbarray($resultpackaging)) {
         $editlistpackaging .= menu_subcats($datapackaging['figure_packaging_id'], $datapackaging['figure_packaging_name'],1);
      }
   }
   
      //lIMITATIONS (locale 450)
   $editlistlimitation = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_limitation = $data['figure_limitation']; } else { $figure_limitation = ""; }
   $resultlimitation = dbquery("SELECT * FROM ".DB_FIGURE_LIMITATIONS." WHERE figure_limitation_parent='0' ORDER BY figure_limitation_name");
   if (dbrows($resultlimitation) != 0) {
      while ($datalimitation = dbarray($resultlimitation)) {
         $editlistlimitation .= menu_subcats($datalimitation['figure_limitation_id'], $datalimitation['figure_limitation_name'],1);
      }
   }
   
   echo "<form id='inputform' method='post' action='".$formaction."' enctype='multipart/form-data'>\n";
   echo "<table cellpadding='0' cellspacing='0' width='660' class='center'>\n<tr>\n";
   
   //Category
   echo "<td width='130' class='tbl'>".$locale['figure_123'].":</td>\n";
   echo "<td class='tbl'><select name='figure_cat' class='textbox'>\n".$editlistcat."</select></td>\n";
   echo "</tr>\n<tr>\n";
   
   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";
   
   //TITLE 411
   echo "<td width='130' class='tbl'>".$locale['figure_411'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_title' value='".$figure_title."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //VARIANT 441
   echo "<td width='130' class='tbl'>".$locale['figure_441'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_variant' value='".$figure_variant."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //MANUFACTURER 417
   echo "<td width='130' class='tbl'>".$locale['figure_417'].":</td>\n";
   echo "<td class='tbl'><select name='figure_manufacturer' class='textbox'>\n".$editlistmanufacturer."</select></td>\n";
   echo "</tr>\n<tr>\n";

   //SubManufacturer 415
   //echo "<td width='130' class='tbl'>".$locale['figure_415'].":</td>\n";
   //echo "<td class='tbl'><input type='text' name='figure_submanufacturer' value='".$figure_submanufacturer."' class='textbox' style='width:380px;' /></td>\n";
   //echo "</tr>\n<tr>\n";
   
   //Sculper/Artists 452
   echo "<td width='130' class='tbl'>".$locale['figure_452'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_artists' value='".$figure_artists."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";

   //COUNTRY 436
   echo "<td width='130' class='tbl'>".$locale['figure_436'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_country' value='".$figure_country."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";
   
   //BRAND   438   
   echo "<td width='130' class='tbl'>".$locale['figure_438'].":</td>\n";
   echo "<td class='tbl'><select name='figure_brand' class='textbox'>\n".$editlistbrand."</select></td>\n";
   echo "</tr>\n<tr>\n";
   
   //SERIES 439
   echo "<td width='130' class='tbl'>".$locale['figure_439'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_series' value='".$figure_series."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";

   //Scale (locale 442)
   echo "<td width='130' class='tbl'>".$locale['figure_442'].":</td>\n";
   echo "<td class='tbl'><select name='figure_scale' class='textbox'>\n".$editlistscale."</select></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Weight (locale 443)
   echo "<td width='130' class='tbl'>".$locale['figure_443'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_weight' value='".$figure_weight."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Height (locale 444)
   echo "<td width='130' class='tbl'>".$locale['figure_444'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_height' value='".$figure_height."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Width (locale 445)
   echo "<td width='130' class='tbl'>".$locale['figure_445'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_width' value='".$figure_width."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Depth (locale 446)
   echo "<td width='130' class='tbl'>".$locale['figure_446'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_depth' value='".$figure_depth."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";
   
   //Material (locale 447)
   echo "<td width='130' class='tbl'>".$locale['figure_447'].":</td>\n";
   echo "<td class='tbl'><select name='figure_material' class='textbox'>\n".$editlistmaterial."</select></td>\n";
   echo "</tr>\n<tr>\n";
   
   //POINT OF ARTICULATION (455)
   echo "<td width='130' class='tbl'>".$locale['figure_455'].":</td>\n";
   echo "<td class='tbl'><select name='figure_poa' class='textbox'>\n".$editlistpoa."</select></td>\n";
   echo "</tr>\n<tr>\n";

/*   
   //TYP POINT OF ARTICULATION (458)
   echo "<td width='130' class='tbl'>".$locale['figure_455'].":</td>\n";
   echo "<td class='tbl'><select name='figure_tpoa' class='textbox'>\n".$editlisttpoa."</select></td>\n";
   echo "</tr>\n<tr>\n";
*/   

   //Packaging (locale 448)
   echo "<td width='130' class='tbl'>".$locale['figure_448'].":</td>\n";
   echo "<td class='tbl'><select name='figure_packaging' class='textbox'>\n".$editlistpackaging."</select></td>\n";
   echo "</tr>\n<tr>\n";

   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";

   //RELASE DATE 419
   echo "<td width='130' class='tbl'>".$locale['figure_419'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_pubdate' value='".$figure_pubdate."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Original Retail Price (locale 449)
   echo "<td width='130' class='tbl'>".$locale['figure_449'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_retailprice' value='".$figure_retailprice."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //USED Price (locale 456)
   echo "<td width='130' class='tbl'>".$locale['figure_456'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_usedprice' value='".$figure_usedprice."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";
   
   //Limited Edition (locale 450)
   echo "<td width='130' class='tbl'>".$locale['figure_450'].":</td>\n";
   echo "<td class='tbl'><select name='figure_limitation' class='textbox'>\n".$editlistlimitation."</select></td>\n";
   echo "</tr>\n<tr>\n";
   
   //Edition Size (locale 451)
   echo "<td width='130' class='tbl'>".$locale['figure_451'].":</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_editionsize' value='".$figure_editionsize."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";

   //LEERZEILE
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "<td class='tbl'>&nbsp;</td>\n";
   echo "</tr>\n<tr>\n";
   
   //Accessories: 457
   echo "<td width='130' class='tbl'>".$locale['figure_457'].":</td>\n";
   echo "<td class='tbl'><textarea name='figure_accessories' cols='60' rows='5' class='textbox' style='width:380px;'>".$figure_accessories."</textarea></td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td class='tbl'></td><td class='tbl'>\n";
   echo display_bbcodes("360px", "figure_accessories")."</td>\n";
   echo "</tr>\n<tr>\n";
   
   //DISCRIPTION 423
   echo "<td valign='top' width='80' class='tbl'>".$locale['figure_423'].":</td>\n";
   echo "<td class='tbl'><textarea name='figure_description' cols='60' rows='5' class='textbox' style='width:380px;'>".$figure_description."</textarea></td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td class='tbl'></td><td class='tbl'>\n";
   echo display_bbcodes("360px", "figure_description")."</td>\n";
   echo "</tr>\n<tr>\n";
   
echo "<td width='130' class='tbl'>&nbsp;</td>\n";
echo "<td class='tbl'>&nbsp;</td>\n";
echo "</tr>\n<tr>\n";
   
   //IMAGE UPLOAD
   echo "<td width='130' class='tbl' valign='top'>".$locale['figure_136']."</td>\n<td class='tbl' valign='top'>\n";
   if ($figure_image != "") {
      echo "<label><img src='".IMAGES_FIGURE.$figure_image."' height='350px' width='350px' alt='' /><br />\n";
      echo "<input type='checkbox' name='del_image' value='y' /> ".$locale['figure_131']."</label>\n";
      echo "<input type='hidden' name='figure_image' value='".$figure_image."' />\n";
   } else {
      echo "<input type='file' name='figure_image' class='textbox' style='width:250px;' /><br />\n";
      echo sprintf($locale['figure_137'], parsebytesize($asettings['figure_photo_max_b']))."\n";
   }
   echo "</td>\n</tr>\n<tr>\n";
   
   //IMAGE SOURCE
   echo "<td width='130' class='tbl'>".$locale['figure_122']."</td>\n";
   echo "<td class='tbl'><input type='text' name='figure_url' value='".$figure_url."' class='textbox' style='width:380px;' /></td>\n";
   echo "</tr>\n<tr>\n";
   
   /* WIRD NICHT BENÖTIGT FILEUPLOAD   
   echo "<td width='130' class='tbl' valign='top'>".$locale['figure_130']."</td>\n<td class='tbl' valign='top'>\n";

   if (!empty($figure_file)) {
      echo "<a href='".FIGURES.$figure_file."'>".FIGURES.$figure_file."</a><br />\n";
      echo "<label><input type='checkbox' name='del_upload' value='1' /> ".$locale['figure_131']."</label>\n";
      echo "<input type='hidden' name='figure_file' value='".$figure_file."' />";
   } else {
      echo "<input type='file' name='figure_file' class='textbox' style='width:150px;' /><br />\n";
      echo sprintf($locale['figure_133'], parsebytesize($asettings['figure_max_b']), str_replace(',', ' ', $asettings['figure_types']))."<br />\n";
      echo "<label><input type='checkbox' name='calc_upload' id='calc_upload' value='1' /> ".$locale['figure_132']."</label>\n";
   }
   echo "</td>\n</tr>\n<tr>\n";
   */
   


   //echo "<td width='130' class='tbl'>".$locale['figure_422'].":</td>\n";
   //echo "<td class='tbl'><input type='text' name='figure_filesize' id='figure_filesize' value='".$figure_filesize."' class='textbox' style='width:150px;' /></td>\n";
   //echo "</tr>\n<tr>\n";
   echo "<td class='tbl'></td><td class='tbl'>\n";
   echo "<label><input type='checkbox' name='figure_comments' value='yes''".$figure_comments." /> ".$locale['figure_124']."</label>\n";
   echo "<br /><label><input type='checkbox' name='figure_ratings' value='yes''".$figure_ratings." /> ".$locale['figure_125']."</label>\n</td>\n";
   echo "</tr>\n<tr>\n";
   echo "<td align='center' colspan='2' class='tbl'>";
   if (isset($_GET['action']) && $_GET['action'] == "edit") {
      echo "<label><input type='checkbox' name='update_datestamp' value='1' /> ".$locale['figure_129']."</label><br />\n";
   }
   echo "<input type='submit' name='save_download' value='".$locale['figure_128']."' class='button' /></td>\n";
   echo "</tr>\n</table>\n</form>\n";
   closetable();

   opentable($locale['figure_102']);
   echo "<table cellpadding='0' cellspacing='0' width='400' class='center'>\n";
   $result = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='0' ORDER BY figure_cat_name");
   if (dbrows($result)) {
      echo "<tr>\n";
      echo "<td class='tbl2'>".$locale['figure_140']."</td>\n";
      echo "<td align='right' class='tbl2'>".$locale['figure_141']."</td>\n";
      echo "</tr>\n<tr>\n";
      echo "<td colspan='2' height='1'></td>\n";
      echo "</tr>\n";
      if (!isset($_GET['figure_cat_id']) || !isnum($_GET['figure_cat_id'])) { $_GET['figure_cat_id'] = 0; }
      while ($data = dbarray($result)) {
         if ($data['figure_cat_id'] == $_GET['figure_cat_id']) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; }
         echo "<tr>\n";
         echo "<td class='tbl2'>".$data['figure_cat_name']."</td>\n";
         echo "<td class='tbl2' align='right'><img src='".get_image("panel_$p_img")."' name='b_".$data['figure_cat_id']."' alt='' onclick=\"javascript:flipBox('".$data['figure_cat_id']."')\" /></td>\n";
         echo "</tr>\n";
         $result2 = dbquery("SELECT * FROM ".DB_FIGURE." WHERE figure_cat='".$data['figure_cat_id']."' ORDER BY figure_title");
         if (dbrows($result2) != 0) {
            echo "<tr>\n<td colspan='2'>\n";
            echo "<div id='box_".$data['figure_cat_id']."'".$div.">\n";
            echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
            while ($data2 = dbarray($result2)) {
               if (!empty($data2['figure_file']) && file_exists(FIGURES.$data2['figure_file'])) {
                  $figure_url = FIGURES.$data2['figure_file'];
               } elseif (!strstr($data2['figure_url'],"http://") && !strstr($data2['figure_url'],"../")) {
                  $figure_url = BASEDIR.$data2['figure_url'];
               } else {
                  $figure_url = $data2['figure_url'];
               }
               echo "<tr>\n<td class='tbl'><a href='$figure_url' target='_blank'>".$data2['figure_title']."</a></td>\n";
               echo "<td align='right' width='100' class='tbl'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;figure_cat_id=".$data['figure_cat_id']."&amp;figure_id=".$data2['figure_id']."'>".$locale['figure_142']."</a> -\n";
               echo "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;figure_cat_id=".$data['figure_cat_id']."&amp;figure_id=".$data2['figure_id']."' onclick=\"return confirm('".$locale['figure_160']."');\">".$locale['figure_131']."</a></td>\n";
               echo "</tr>\n";
            }
            echo "</table>\n</div>\n</td>\n</tr>\n";
         }
         echo subcats($data['figure_cat_id'], 1);
      }
      echo "</table>\n";
   } else {
      echo "<tr>\n<td align='center'><br />\n";
      echo $locale['figure_150']."<br /><br /></td>\n";
      echo "</tr>\n</table>\n";
   }
   closetable();
} else {
   opentable($locale['figure_102']);
   echo "<div style='text-align:center'>".$locale['figure_151']."<br />\n".$locale['figure_152']."<br /><br />\n";
   echo "<a href='figure_cats.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_154']."<br />\n";
   echo "<a href='figure_manufacturers.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_180']."<br />\n";
   echo "<a href='figure_brands.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_181']."<br />\n";
   echo "<a href='figure_materials.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_182']."<br />\n";
   echo "<a href='figure_scales.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_183']."<br />\n";
   echo "<a href='figure_poas.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_184']."<br />\n";
   //echo "<a href='figure_tpoas.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_185']."<br />\n";
   echo "<a href='figure_packagings.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_186']."<br />\n";
   echo "<a href='figure_limitations.php".$aidlink."'>".$locale['figure_153']."</a>".$locale['figure_187']."</div>\n";
   closetable();
}

echo "<script country='JavaScript' type='text/javascript'>
$(document).ready(function() {
   $('#calc_upload').click(
   function() {
      if ($('#calc_upload').attr('checked')) {
         $('#figure_filesize').attr('readonly', 'readonly');
         $('#calc_upload').attr('checked', 'checked');
      } else {
         $('#figure_filesize').removeAttr('readonly');
         $('#calc_upload').removeAttr('checked');
      }
   });
});
</script>";

function subcats ($id, $level) {
   global $aidlink, $locale;
   $sublist = "";
   $sresult[$id] = dbquery("SELECT figure_cat_id, figure_cat_name, figure_cat_description, figure_cat_access FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='".$id."' ORDER BY figure_cat_name");
   if (dbrows($sresult[$id]) != 0) {
      while ($sdata[$id] = dbarray($sresult[$id])) {
         if ($sdata[$id]['figure_cat_id'] == $_GET['figure_cat_id']) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; }
         $sublist .= "<tr>\n";
         $sublist .= "<td class='tbl2'>".str_repeat("&mdash; ",$level)." ".$sdata[$id]['figure_cat_name']."</td>\n";
         $sublist .= "<td class='tbl2' align='right'><img src='".get_image("panel_$p_img")."' name='b_".$sdata[$id]['figure_cat_id']."' alt='' onclick=\"javascript:flipBox('".$sdata[$id]['figure_cat_id']."')\" /></td>\n";
         $sublist .= "</tr>\n";
         $bresult[$id] = dbquery("SELECT * FROM ".DB_FIGURE." WHERE figure_cat='".$sdata[$id]['figure_cat_id']."' ORDER BY figure_title");
         if (dbrows($bresult[$id]) != 0) {
            $sublist .= "<tr>\n<td colspan='2'>\n";
            $sublist .= "<div id='box_".$sdata[$id]['figure_cat_id']."'".$div.">\n";
            $sublist .= "<table cellpadding='0' cellspacing='0' width='100%'>\n";
            while ($bdata[$id] = dbarray($bresult[$id])) {
               if (!empty($bdata[$id]['figure_file']) && file_exists(FIGURES.$bdata[$id]['figure_file'])) {
                  $figure_url = FIGURES.$bdata[$id]['figure_file'];
               } elseif (!strstr($bdata[$id]['figure_url'],"http://") && !strstr($bdata[$id]['figure_url'],"../")) {
                  $figure_url = BASEDIR.$bdata[$id]['figure_url'];
               } else {
                  $figure_url = $bdata[$id]['figure_url'];
               }
               $sublist .= "<tr>\n<td class='tbl'><a href='$figure_url' target='_blank'>".$bdata[$id]['figure_title']."</a></td>\n";
               $sublist .= "<td align='right' width='100' class='tbl'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;figure_cat_id=".$sdata[$id]['figure_cat_id']."&amp;figure_id=".$bdata[$id]['figure_id']."'>".$locale['figure_142']."</a> -\n";
               $sublist .= "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;figure_cat_id=".$sdata[$id]['figure_cat_id']."&amp;figure_id=".$bdata[$id]['figure_id']."' onclick=\"return confirm('".$locale['figure_160']."');\">".$locale['figure_131']."</a></td>\n";
               $sublist .= "</tr>\n";
            }
            $sublist .= "</table>\n</div>\n</td>\n</tr>\n";
         }
         $sublist .= subcats($sdata[$id]['figure_cat_id'], $level+1);
      }
   }
   return $sublist;
}

function menu_subcats($id, $name, $level) {
   global $figure_cat, $asettings; $sel = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $sel = ($figure_cat == $id ? " selected='selected'" : ""); }
   $list = "<option value='".$id."'$sel>".str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;",$level-1)." ".$name."</option>\n";
   if ($asettings['subcats']) {
      $sresult[$id] = dbquery("SELECT figure_cat_id, figure_cat_name FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='".$id."' ORDER BY figure_cat_name");
      if (dbrows($sresult[$id]) != 0) {
         while ($sdata[$id] = dbarray($sresult[$id])) {
            $list .= menu_subcats($sdata[$id]['figure_cat_id'], $sdata[$id]['figure_cat_name'], $level+1);
         }
      }
   }
   return $list;
}

require_once THEMES."templates/footer.php";
?>
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Rolly8-HL
Deine Scripte werden immer länger, wie wäre es wenn Du die mal als Datei anhängst?
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Catzenjaeger
ok hängt an. Ich habe in dieser Datei mal immer hinten drann an jeder Eingabebox angeben was in der DB gespeichert wird. Das kommt natürlich wieder raus später.

Komisch jede Box wird genauso gemacht - bei CATS geht es das immer das in der DB abgelegte angezeigt wird. Bei allen aderen wo ich Dropdowns nutze nicht
Catzenjaeger hat folgende Datei angehängt:
Du hast nicht die Berechtigung die Anhäge dieses Themas zu sehen.

Bearbeitet von Catzenjaeger am 10. Mai 2016 12:35:16
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Rolly8-HL
Würde mich mehr Interessieren was in jeder dieser Dropdowns die Cat Untermenüs zu suchen haben?
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Catzenjaeger

Zitat

Rolly8-HL schrieb:

Würde mich mehr Interessieren was in jeder dieser Dropdowns die Cat Untermenüs zu suchen haben?


die Rubriken Manufacturer, Scale, Limitations, Brands können/könnten noch Subkategorien haben (falls man das aktiviert)

Da ich also Vorlage die allgemeine CAT Vorlage genommen haben muss ich damit leben. An ders hätte ich das nicht hinbekommen dazu sind meine Fähigkeiten zu beschränkt.

ABER ICH SEHE gerade du hast recht die Funktionn heiss: immer so wie die Kategorie -->

$editlistmanufacturer .= menu_submanufacturers(.......

aber dann bleibt seite weis Sad


Zeile 280 etwa steht das:

$formaction = FUSION_SELF.$aidlink."&amp;action=edit&amp;figure_cat_id=".$data['figure_cat']."&amp;figure_id=".$data['figure_id'];

muss das für die Rubriken vielleicht auch da rein -- da steht was mit edit. Ich weiss aber nicht was airlink genau ist und was das macht

Zeile 200 etwa:

$figure_cat = intval($_POST['figure_cat']);
das weiss ich auch nicht vielleicht müsste da druntern dann so etwas:
$figure_manufacturer = intval($_POST['figure_manufacturer']);

aber da tat sich nichts
Bearbeitet von Catzenjaeger am 10. Mai 2016 19:12:14
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Rolly8-HL
Du kannst aber nicht alles mit function menu_subcats benutzen, für die ist das ja in Ordnung.

   //CAT 
   $editlistcat = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_cat = $data['figure_cat']; } else { $figure_cat = ""; }
   $resultcat = dbquery("SELECT * FROM ".DB_FIGURE_CATS." WHERE figure_cat_parent='0' ORDER BY figure_cat_name");
   if (dbrows($resultcat) != 0) {
      while ($datacat = dbarray($resultcat)) {
         $editlistcat .= menu_subcats($datacat['figure_cat_id'], $datacat['figure_cat_name'],1);
      }
   }


Aber woher sollen die anderen sich den Wert die gebraucht werden den her holen, doch nur aus der DB_FIGURE und das auch nur mit selected='selected'
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Catzenjaeger
damn ich weiss nicht weiter.

in der manufacturer.php im Ordner Admin heisst di Funktion sub_maunufactueres

wenn ich das aber so in der figure_item.php schreibe sehe ich bis auf die Überschrift nichts auf der seite

also das

Zitat

//MANUFACTURER 417
$editlistmanufacturer = "";
if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_manufacturer = $data['figure_manufacturer']; } else { $figure_manufacturer = ""; }
$resultmanufacturer = dbquery("SELECT * FROM ".DB_FIGURE_MANUFACTURERS." WHERE figure_manufacturer_parent='0' ORDER BY figure_manufacturer_name");
if (dbrows($resultmanufacturer) != 0) {
while ($datamanufacturer = dbarray($resultmanufacturer)) {
$editlistmanufacturer .= menu_subcats($datamanufacturer['figure_manufacturer_id'], $datamanufacturer['figure_manufacturer_name'],1);
}
}

zu das

Zitat

//MANUFACTURER 417
$editlistmanufacturer = "";
if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_manufacturer = $data['figure_manufacturer']; } else { $figure_manufacturer = ""; }
$resultmanufacturer = dbquery("SELECT * FROM ".DB_FIGURE_MANUFACTURERS." WHERE figure_manufacturer_parent='0' ORDER BY figure_manufacturer_name");
if (dbrows($resultmanufacturer) != 0) {
while ($datamanufacturer = dbarray($resultmanufacturer)) {
$editlistmanufacturer .= menu_submanufacturers($datamanufacturer['figure_manufacturer_id'], $datamanufacturer['figure_manufacturer_name'],1);
}
}


RESULTAT: Seite bleibt weis

ich war der Auffassung das wenn das für die normalen cats klappt kalptt das cuh für die anderen. Dem scheint nicht so.

was nun? icvh gebe bald auf -- soviel Arbeit für nichts damn
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Rolly8-HL
Ja ist klar das kann noch weniger gehen, Du kannst nicht alles wild Kopieren und verlangen das es geht, dazu ist es etwas zu Kompliziert.
Wäre besser wenn Du schon damit als Neuling anfängst wie Du selber sagst mit etwas einfacherem zu beginnen, habe selbst auch Jahre gebraucht.
Versuche das mal, bei mir hat das schon mal geklappt.

   //MANUFACTURER 417
   $editlistmanufacturer = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $figure_manufacturer = $data['figure_manufacturer']; } else { $figure_manufacturer = ""; }
   $resultmanufacturer = dbquery("SELECT * FROM ".DB_FIGURE_MANUFACTURERS." WHERE figure_manufacturer_parent='0' ORDER BY figure_manufacturer_name  ");
   $resultmanufacturer2 = dbarray(dbquery("SELECT f.*, fm.*
      FROM ".DB_FIGURE_MANUFACTURERS." f
      LEFT JOIN ".DB_FIGURE." fm ON fm.figure_manufacturer=f.figure_manufacturer_id
      WHERE figure_id='".$_GET['figure_id']."'"));
   if (dbrows($resultmanufacturer) != 0) {
      while ($datamanufacturer = dbarray($resultmanufacturer)) {
         $sel = ($datamanufacturer['figure_manufacturer_id'] == $resultmanufacturer2['figure_manufacturer'] ? " selected='selected'" : "");
            $editlistmanufacturer .= "<option value='".$datamanufacturer['figure_manufacturer_id']."'".$sel.">".$datamanufacturer['figure_manufacturer_name']."</option>\n";
      }
   }

Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Catzenjaeger
ich habs gefunden wie es geht!!!!!!!!! für ein Feld habe ich es schon eingebaut. Man muss die Funktionen unten alle nachbauen und zwar für jedes was subcats hat .. omg haufen arbeit aber es geht

andere Frage wir kann ich im forumlart nachdem ich gespeoihert habe die Maske leeren so das nichts in den feldern steht.
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Rolly8-HL

Zitat

ich habs gefunden wie es geht!!!!!!!!! für ein Feld habe ich es schon eingebaut. Man muss die Funktionen unten alle nachbauen und zwar für jedes was subcats hat .. omg haufen arbeit aber es geht


Was genau wo wie?
Gruß Rolly8-HL
Was für Andere Wichtig ist muss für mich nicht genauso Wichtig sein!
Bin Dickkopf Unbelehrbar mache aus Protest nicht das was andere für Richtig halten!
Das gibt einem zu Denken oder?
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Catzenjaeger
das hier für jedes Dropdown unten einfügen und entsprechend anpassen .. bei mir läufts. Das einzige was mich stört .. wenn ich eine figur gespeichert habe wir das Forumlar dargerstellt aber schon mit Daten (logisch die kommen ja aus der dropdown) ich würde gerne --- nichts daratellen und erst man man in das feld klickt sollen daten sichtbar sein .. aber das ist schönheitsfehler



function sublimitations ($id, $level) {
   global $aidlink, $locale;
   $sublist = "";
   $sresult[$id] = dbquery("SELECT figure_limitation_id, figure_limitation_name, figure_limitation_description, figure_limitation_access FROM ".DB_FIGURE_LIMITATIONS." WHERE figure_limitation_parent='".$id."' ORDER BY figure_limitation_name");
   if (dbrows($sresult[$id]) != 0) {
      while ($sdata[$id] = dbarray($sresult[$id])) {
         if ($sdata[$id]['figure_limitation_id'] == $_GET['figure_limitation_id']) { $p_img = "off"; $div = ""; } else { $p_img = "on"; $div = "style='display:none'"; }
         $sublist .= "<tr>\n";
         $sublist .= "<td class='tbl2'>".str_repeat("&mdash; ",$level)." ".$sdata[$id]['figure_limitation_name']."</td>\n";
         $sublist .= "<td class='tbl2' align='right'><img src='".get_image("panel_$p_img")."' name='b_".$sdata[$id]['figure_limitation_id']."' alt='' onclick=\"javascript:flipBox('".$sdata[$id]['figure_limitation_id']."')\" /></td>\n";
         $sublist .= "</tr>\n";
         $bresult[$id] = dbquery("SELECT * FROM ".DB_FIGURE." WHERE figure_limitation='".$sdata[$id]['figure_limitation_id']."' ORDER BY figure_title");
         if (dbrows($bresult[$id]) != 0) {
            $sublist .= "<tr>\n<td colspan='2'>\n";
            $sublist .= "<div id='box_".$sdata[$id]['figure_limitation_id']."'".$div.">\n";
            $sublist .= "<table cellpadding='0' cellspacing='0' width='100%'>\n";
            while ($bdata[$id] = dbarray($bresult[$id])) {
               if (!empty($bdata[$id]['figure_file']) && file_exists(FIGURES.$bdata[$id]['figure_file'])) {
                  $figure_url = FIGURES.$bdata[$id]['figure_file'];
               } elseif (!strstr($bdata[$id]['figure_url'],"http://") && !strstr($bdata[$id]['figure_url'],"../")) {
                  $figure_url = BASEDIR.$bdata[$id]['figure_url'];
               } else {
                  $figure_url = $bdata[$id]['figure_url'];
               }
               $sublist .= "<tr>\n<td class='tbl'><a href='$figure_url' target='_blank'>".$bdata[$id]['figure_title']."</a></td>\n";
               $sublist .= "<td align='right' width='100' class='tbl'><a href='".FUSION_SELF.$aidlink."&amp;action=edit&amp;figure_limitation_id=".$sdata[$id]['figure_limitation_id']."&amp;figure_id=".$bdata[$id]['figure_id']."'>".$locale['figure_142']."</a> -\n";
               $sublist .= "<a href='".FUSION_SELF.$aidlink."&amp;action=delete&amp;figure_limitation_id=".$sdata[$id]['figure_limitation_id']."&amp;figure_id=".$bdata[$id]['figure_id']."' onclick=\"return confirm('".$locale['figure_160']."');\">".$locale['figure_131']."</a></td>\n";
               $sublist .= "</tr>\n";
            }
            $sublist .= "</table>\n</div>\n</td>\n</tr>\n";
         }
         $sublist .= sublimitations($sdata[$id]['figure_limitation_id'], $level+1);
      }
   }
   return $sublist;
}

function menu_sublimitations($id, $name, $level) {
   global $figure_limitation, $asettings; $sel = "";
   if (isset($_GET['action']) && $_GET['action'] == "edit") { $sel = ($figure_limitation == $id ? " selected='selected'" : ""); }
   $list = "<option value='".$id."'$sel>".str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;",$level-1)." ".$name."</option>\n";
   if ($asettings['sublimitations']) {
      $sresult[$id] = dbquery("SELECT figure_limitation_id, figure_limitation_name FROM ".DB_FIGURE_LIMITATIONS." WHERE figure_limitation_parent='".$id."' ORDER BY figure_limitation_name");
      if (dbrows($sresult[$id]) != 0) {
         while ($sdata[$id] = dbarray($sresult[$id])) {
            $list .= menu_sublimitations($sdata[$id]['figure_limitation_id'], $sdata[$id]['figure_limitation_name'], $level+1);
         }
      }
   }
   return $list;
}

Bearbeitet von Catzenjaeger am 10. Mai 2016 23:30:48
Information:
PHP Version: Nicht ausgewählt •  MySQL Version: Nicht ausgewählt •  PHP-Fusion: Nicht ausgewählt
 
Springe ins Forum: