try { if (isset($new_parts)) { $new_parts_loop = Part::build_template_table_array($new_parts, 'imported_parts'); } } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('upload'); if (isset($import_data)) { $html->set_loop('table', $table_loop); $html->set_variable('table_rowcount', count($import_data), 'integer'); $html->print_template('check_data'); } if (strlen($file_content) > 0) { $html->print_template('file_content'); } if (isset($new_parts_loop)) { $html->set_loop('table', $new_parts_loop); $html->print_template('new_parts'); } if ($action == 'default') { $html->print_template('file_examples'); }
$html->set_variable('manufacturer_list', $manufacturer_list, 'string'); $html->set_variable('category_list', $category_list, 'string'); $html->set_variable('storelocation_list', $storelocation_list, 'string'); $html->set_variable('footprint_list', $footprint_list, 'string'); // global/category stuff $category = new Category($database, $current_user, $log, $category_id); $html->set_variable('disable_footprints', $config['footprints']['disable'] || $category->get_disable_footprints(true), 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'] || $category->get_disable_manufacturers(true), 'boolean'); $html->set_variable('max_upload_filesize', ini_get('upload_max_filesize'), 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ // an empty string in "$reload_link" means that the reload-button won't be visible $reload_link = $fatal_error && $action != 'delete_part_confirmed' ? 'edit_part_info.php?pid=' . $part_id : ''; $html->print_header($messages, $reload_link); if (!$fatal_error) { $html->print_template('part'); if (!($is_new_part || $add_one_more_part)) { $html->print_template('orderdetails'); $html->print_template('attachements'); $html->print_template('actions'); } } $html->print_footer();
$html->set_variable('tools_footprints_autoload', $config['tools']['footprints']['autoload'], 'boolean'); $html->set_variable('developer_mode_available', file_exists(BASE . '/development'), 'boolean'); $html->set_variable('enable_developer_mode', $config['developer_mode'], 'boolean'); $html->set_variable('enable_dokuwiki_write_perms', file_exists(DOKUWIKI_PERMS_FILENAME), 'boolean'); // popup settings $html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean'); $html->set_variable('popup_width', $config['popup']['width'], 'integer'); $html->set_variable('popup_height', $config['popup']['height'], 'integer'); // site properties $html->set_variable('page_title', $config['page_title'], 'string'); $html->set_variable('startup_banner', $config['startup']['custom_banner'], 'string'); // server $html->set_variable('php_version', phpversion(), 'string'); $html->set_variable('htaccess_works', getenv('htaccessWorking') == 'true', 'boolean'); $html->set_variable('is_online_demo', $config['is_online_demo'], 'boolean'); // check if the server supports the selected language and print a warning if not if (!own_setlocale(LC_ALL, $config['language'])) { $messages[] = array('text' => 'Achtung:', 'strong' => true, 'color' => 'red'); $messages[] = array('text' => 'Die gewählte Sprache "' . $config['language'] . '" wird vom Server nicht unterstützt!', 'color' => 'red'); $messages[] = array('text' => 'Bitte installieren Sie diese Sprache oder wählen Sie eine andere.', 'color' => 'red'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('system_config'); } $html->print_footer();
$html->set_loop('table', $table_loop); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Set the rest of the HTML variables * *********************************************************************************/ $html->use_javascript(array('popup')); if (!$fatal_error) { // global stuff $html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean'); $html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean'); $html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean'); $html->set_variable('popup_width', $config['popup']['width'], 'integer'); $html->set_variable('popup_height', $config['popup']['height'], 'integer'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('show_noprice_parts'); } $html->print_footer();
/******************************************************************************** * * Set the rest of the HTML variables * *********************************************************************************/ $html->set_loop('authors', $authors); if (!$fatal_error) { $html->set_variable('banner', $config['startup']['custom_banner'], 'string'); try { $system_version = $system->get_installed_version(); $html->set_variable('system_version', $system_version->as_string(false, true, true, false), 'string'); $html->set_variable('system_version_full', $system_version->as_string(false, false, false, true), 'string'); $html->set_variable('git_branch', get_git_branch_name(), 'string'); $html->set_variable('git_commit', get_git_commit_hash(10), 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'startup.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('startup'); } $html->print_footer();
$name = $new_name; $filename = $new_filename; } else { $parent_id = 0; $name = ''; $filename = ''; } $html->set_variable('name', $name, 'string'); $html->set_variable('filename', str_replace(BASE . '/', '', $filename), 'string'); $footprint_list = $root_footprint->build_html_tree($selected_id, true, false); $html->set_variable('footprint_list', $footprint_list, 'string'); $parent_footprint_list = $root_footprint->build_html_tree($parent_id, true, true); $html->set_variable('parent_footprint_list', $parent_footprint_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_footprints.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_footprints'); } $html->print_footer();
$noprice_parts = Part::get_noprice_parts($database, $current_user, $log); $count_of_parts_with_price = Part::get_count($database) - count($noprice_parts); // :-) $html->set_variable('parts_count_with_prices', $count_of_parts_with_price, 'integer'); $html->set_variable('parts_count_sum_value', Part::get_sum_price_instock($database, $current_user, $log, true), 'string'); $html->set_variable('parts_count', Part::get_count($database), 'integer'); $html->set_variable('parts_count_sum_instock', Part::get_sum_count_instock($database), 'integer'); $html->set_variable('categories_count', Category::get_count($database), 'integer'); $html->set_variable('footprint_count', Footprint::get_count($database), 'integer'); $html->set_variable('location_count', Storelocation::get_count($database), 'integer'); $html->set_variable('suppliers_count', Supplier::get_count($database), 'integer'); $html->set_variable('manufacturers_count', Manufacturer::get_count($database), 'integer'); $html->set_variable('devices_count', Device::get_count($database), 'integer'); $html->set_variable('attachements_count', Attachement::get_count($database), 'integer'); $html->set_variable('footprint_picture_count', count(find_all_files(BASE . '/img/footprints/', true)), 'integer'); $html->set_variable('iclogos_picture_count', count(find_all_files(BASE . '/img/iclogos/', true)), 'integer'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('statistics'); } $html->print_footer();
$name = ''; $disable_footprints = false; $disable_manufacturers = false; $disable_autodatasheets = false; } $html->set_variable('name', $name, 'string'); $html->set_variable('disable_footprints', $disable_footprints, 'boolean'); $html->set_variable('disable_manufacturers', $disable_manufacturers, 'boolean'); $html->set_variable('disable_autodatasheets', $disable_autodatasheets, 'boolean'); $category_list = $root_category->build_html_tree($selected_id, true, false); $html->set_variable('category_list', $category_list, 'string'); $parent_category_list = $root_category->build_html_tree($parent_id, true, true); $html->set_variable('parent_category_list', $parent_category_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_categories.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_categories'); } $html->print_footer();
// step "set_db_settings" $tmpl_site_to_show = 'set_db_settings'; $html->set_loop('db_type_loop', array_to_template_loop($config['db_types'], $config['db']['type'])); $html->set_loop('db_charset_loop', array_to_template_loop($config['db_charsets'], $config['db']['charset'])); $html->set_variable('db_host', $config['db']['host'], 'string'); $html->set_variable('db_name', $config['db']['name'], 'string'); $html->set_variable('db_user', $config['db']['user'], 'string'); } elseif (!$config['installation_complete']['db_backup_path']) { // step "set_db_backup_path" $tmpl_site_to_show = 'set_db_backup_path'; $html->set_variable('db_backup_name', $config['db']['backup']['name'], 'string'); $html->set_variable('db_backup_path', $config['db']['backup']['url'], 'string'); } else { // installation/update complete $tmpl_site_to_show = 'finish'; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'install.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible $html->print_template('header'); if (!$fatal_error) { $html->print_template($tmpl_site_to_show); } $html->print_footer();
$html->set_variable('fax_number', $selected_manufacturer->get_fax_number(), 'string'); $html->set_variable('email_address', $selected_manufacturer->get_email_address(), 'string'); $html->set_variable('website', $selected_manufacturer->get_website(), 'string'); $html->set_variable('auto_product_url', $selected_manufacturer->get_auto_product_url(NULL), 'string'); } elseif ($action == 'add') { $parent_id = $new_parent_id; } else { $parent_id = 0; } $manufacturer_list = $root_manufacturer->build_html_tree($selected_id, true, false); $html->set_variable('manufacturer_list', $manufacturer_list, 'string'); $parent_manufacturer_list = $root_manufacturer->build_html_tree($parent_id, true, true); $html->set_variable('parent_manufacturer_list', $parent_manufacturer_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_manufacturers.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_manufacturers'); } $html->print_footer();
* Set all HTML variables * *********************************************************************************/ $html->set_variable('current_system_version', $config['system']['version'], 'string'); if (file_exists($release_package_filename)) { $html->set_variable('release_archive_link', str_replace(BASE, BASE_RELATIVE, $release_package_filename), 'string'); $html->set_variable('release_archive_basename', basename($release_package_filename), 'string'); } $html->set_variable('packing_checklist_link', BASE_RELATIVE . '/development/package_output/readme.txt', 'string'); if (isset($doxygen_output_loop)) { //$html->set_variable('exec_successful', $doxygen_successful, 'boolean'); $html->set_loop('exec_output', $doxygen_output_loop); } if (isset($tab2spaces_output_loop)) { //$html->set_variable('exec_successful', $tab2spaces_successful, 'boolean'); $html->set_loop('exec_output', $tab2spaces_output_loop); } if (isset($release_packing_output_loop)) { //$html->set_variable('exec_successful', $release_packing_successful, 'boolean'); $html->set_loop('exec_output', $release_packing_output_loop); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('developer_tools'); } $html->print_footer();
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ include_once 'start_session.php'; $messages = array(); $fatal_error = false; // if a fatal error occurs, only the $messages will be printed, but not the site content /******************************************************************************** * * Initialize Objects * *********************************************************************************/ $html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Labels'); /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('labels'); } $html->print_footer(); ?>
$name = $selected_attachement_type->get_name(); } elseif ($action == 'add') { $parent_id = $new_parent_id; $name = $new_name; } else { $parent_id = 0; $name = ''; } $html->set_variable('name', $name, 'string'); $attachement_types_list = $root_attachement_type->build_html_tree($selected_id, true, false); $html->set_variable('attachement_types_list', $attachement_types_list, 'string'); $parent_attachement_types_list = $root_attachement_type->build_html_tree($parent_id, true, true); $html->set_variable('parent_attachement_types_list', $parent_attachement_types_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_attachement_types.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_attachement_types'); } $html->print_footer();
$html->set_variable('disable_calculator', $config['menu']['disable_calculator'], 'boolean'); $html->set_variable('disable_iclogos', $config['menu']['disable_iclogos'], 'boolean'); $html->set_variable('disable_tools_footprints', $config['menu']['disable_footprints'], 'boolean'); $html->set_variable('developer_mode', $config['developer_mode'], 'boolean'); $html->set_variable('db_backup_name', $config['db']['backup']['name'], 'string'); $html->set_variable('db_backup_url', $config['db']['backup']['url'], 'string'); if ($config['debug']['enable']) { if ($config['debug']['request_debugging_enable']) { $messages[] = array('html' => '<input type="submit" name="disable_request_debugging" value="REQUEST-Debugging deaktivieren">'); } else { $messages[] = array('html' => '<input type="submit" name="enable_request_debugging" value="REQUEST-Debugging aktivieren">'); } if ($config['debug']['template_debugging_enable']) { $messages[] = array('html' => '<input type="submit" name="disable_template_debugging" value="Template-Debugging deaktivieren">'); } else { $messages[] = array('html' => '<input type="submit" name="enable_template_debugging" value="Template-Debugging aktivieren">'); } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'navigation.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible //if (! $fatal_error) // --> we do not hide the navigation, because this way you can reach the debug-link in the menu $html->print_template('navigation'); $html->print_footer();
} /******************************************************************************** * * Set the rest of the HTML variables * *********************************************************************************/ $html->use_javascript(array('popup', 'validatenumber')); if (!$fatal_error) { // export formats $html->set_loop('export_formats', build_export_formats_loop('orderparts', $export_format_id)); if (isset($export_string)) { $html->set_variable('export_result', str_replace("\n", '<br>', str_replace("\n ", '<br> ', str_replace("\n ", '<br> ', htmlspecialchars($export_string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8')))), 'string'); } // global stuff $html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean'); $html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean'); $html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean'); $html->set_variable('popup_width', $config['popup']['width'], 'integer'); $html->set_variable('popup_height', $config['popup']['height'], 'integer'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('show_order_parts'); } $html->print_footer();
$html->set_variable('fax_number', $selected_supplier->get_fax_number(), 'string'); $html->set_variable('email_address', $selected_supplier->get_email_address(), 'string'); $html->set_variable('website', $selected_supplier->get_website(), 'string'); $html->set_variable('auto_product_url', $selected_supplier->get_auto_product_url(NULL), 'string'); } elseif ($action == 'add') { $parent_id = $new_parent_id; } else { $parent_id = 0; } $supplier_list = $root_supplier->build_html_tree($selected_id, true, false); $html->set_variable('supplier_list', $supplier_list, 'string'); $parent_supplier_list = $root_supplier->build_html_tree($parent_id, true, true); $html->set_variable('parent_supplier_list', $parent_supplier_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_suppliers.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_suppliers'); } $html->print_footer();
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ include_once 'start_session.php'; $messages = array(); $fatal_error = false; // if a fatal error occurs, only the $messages will be printed, but not the site content /******************************************************************************** * * Initialize Objects * *********************************************************************************/ $html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Hersteller IC Logos'); /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('iclogos'); } $html->print_footer(); ?>
$categories = array(); foreach ($directories as $directory) { $categories[] = rtrim($directory, "\\/"); $categories = array_merge($categories, find_all_directories($directory, true)); } sort($categories); foreach ($categories as $category) { $pictures_loop = array(); $pictures = find_all_files($category . '/', false, '.png'); foreach ($pictures as $filename) { $pictures_loop[] = array('title' => str_replace('.png', '', basename($filename)), 'filename' => str_replace(BASE, BASE_RELATIVE, $filename)); } if (count($pictures_loop) > 0) { $categories_loop[] = array('category_name' => str_replace(BASE, '', $category), 'pictures_loop' => $pictures_loop); } } $html->set_loop('categories_loop', $categories_loop); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('footprints'); } $html->print_footer(); ?>
$name = $selected_device->get_name(); } elseif ($action == 'add') { $parent_id = $new_parent_id; $name = $new_name; } else { $parent_id = 0; $name = ''; } $html->set_variable('name', $name, 'string'); $device_list = $root_device->build_html_tree($selected_id, true, false); $html->set_variable('device_list', $device_list, 'string'); $parent_device_list = $root_device->build_html_tree($parent_id, true, true); $html->set_variable('parent_device_list', $parent_device_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_devices.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_devices'); } $html->print_footer();
$html->set_variable('refresh_navigation_frame', isset($database_update_executed) && $database_update_executed, 'boolean'); if (!$fatal_error) { try { $current = $database->get_current_version(); $latest = $database->get_latest_version(); $html->set_variable('current_version', $current, 'integer'); $html->set_variable('latest_version', $latest, 'integer'); $html->set_variable('update_required', $latest > $current, 'boolean'); $html->set_variable('last_update_failed', $config['db']['update_error']['version'] == $current, 'boolean'); if ($current > 0 && $current < 13 && $latest >= 13) { $messages[] = array('text' => 'Achtung!<br><br>' . 'Das Datenbankupdate auf Version 13 ist sehr umfangreich, es finden sehr viele Veränderungen statt.<br>' . 'Es wird dringend empfohlen, vor dem Update eine Sicherung der Datenbank anzulegen, ' . 'damit diese im Fehlerfall wiederhergestellt, und so ein Datenverlust verhindert werden kann.<br>' . 'Die Entwickler von Part-DB übernehmen keinerlei Haftung für Schäden, die durch fehlgeschlagene Updates, ' . 'Fehler in der Software oder durch andere Ursachen hervorgerufen werden.', 'strong' => true, 'color' => 'red'); } elseif ($current > 0 && $latest > $current) { $messages[] = array('text' => 'Hinweis:<br><br>' . 'Es wird dringend empfohlen, vor jedem Datenbankupdate eine Sicherung der Datenbank anzulegen.<br>' . 'Die Entwickler von Part-DB übernehmen keinerlei Haftung für Schäden, die durch fehlgeschlagene Updates, ' . 'Fehler in der Software oder durch andere Ursachen hervorgerufen werden.', 'strong' => true, 'color' => 'red'); } } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } $html->set_variable('hide_status', $fatal_error, 'boolean'); /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ // an empty $reload_link means that the reload-button won't be visible $reload_link = $fatal_error || isset($database_update_executed) ? 'system_database.php' : ''; $html->print_header($messages, $reload_link); //if (! $fatal_error) // we don't hide the site content if there is an error, because this way we can set the database connection data $html->print_template('system_database'); $html->print_footer();
'Portable', 'Smartphone', 'SDA', 'PDA', 'Handheld', 'Symbian', 'WAP', 'Palm', 'Avantgo', 'cHTML', 'BlackBerry', 'Opera Mini', 'Nokia', 'PSP', 'J2ME' ); foreach ($agents as $agent) { if (strpos($_SERVER["HTTP_USER_AGENT"], $agent)) { $mobile = true; break; } } } $html->set_variable('mobile', $mobile, 'boolean');*/ /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ if (count($messages) == 0) { $html->set_meta(array('frameset' => true)); } $html->print_header($messages, 'index.php'); if (!$fatal_error && count($messages) == 0) { $html->print_template('frameset'); } $html->print_footer();
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ include_once 'start_session.php'; $messages = array(); $fatal_error = false; // if a fatal error occurs, only the $messages will be printed, but not the site content /******************************************************************************** * * Initialize Objects * *********************************************************************************/ $html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Widerstandsrechner'); /******************************************************************************** * * Set all HTML variables * *********************************************************************************/ $html->use_javascript(array('calculator'), 'reset4ring(); reset6ring(); ratio_reset(); resistor_reset();'); /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('calculator'); } $html->print_footer();
$messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Set the rest of the HTML variables * *********************************************************************************/ $html->use_javascript(array('popup')); if (!$fatal_error) { // obsolete parts $html->set_variable('show_no_orderdetails_parts', $show_no_orderdetails_parts, 'boolean'); // global stuff $html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean'); $html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean'); $html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean'); $html->set_variable('popup_width', $config['popup']['width'], 'integer'); $html->set_variable('popup_height', $config['popup']['height'], 'integer'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('show_obsolete_parts'); } $html->print_footer();
$html->set_variable('search_supplierpartnr', $search_supplierpartnr, 'boolean'); $html->set_variable('search_storelocation', $search_storelocation, 'boolean'); $html->set_variable('search_footprint', $search_footprint, 'boolean'); $html->set_variable('search_manufacturer', $search_manufacturer, 'boolean'); if (!$fatal_error) { // export formats $html->set_loop('export_formats', build_export_formats_loop('searchparts')); // global stuff $html->set_variable('disable_footprints', $config['footprints']['disable'], 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'], 'boolean'); $html->set_variable('disable_auto_datasheets', $config['auto_datasheets']['disable'], 'boolean'); $html->set_variable('use_modal_popup', $config['popup']['modal'], 'boolean'); $html->set_variable('popup_width', $config['popup']['width'], 'integer'); $html->set_variable('popup_height', $config['popup']['height'], 'integer'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $html->print_header($messages); if (!$fatal_error) { $html->print_template('search_header'); foreach ($parts_table_loops as $category_full_path => $loop) { $html->set_variable('category_full_path', $category_full_path, 'string'); $html->set_variable('table_rowcount', count($loop), 'integer'); $html->set_loop('table', $loop); $html->print_template('searched_parts_table'); } } $html->print_footer();
$name = $new_name; $is_full = $new_is_full; } else { $parent_id = 0; $name = ''; $is_full = false; } $html->set_variable('name', $name, 'string'); $html->set_variable('is_full', $is_full, 'boolean'); $storelocation_list = $root_storelocation->build_html_tree($selected_id, true, false); $html->set_variable('storelocation_list', $storelocation_list, 'string'); $parent_storelocation_list = $root_storelocation->build_html_tree($parent_id, true, true); $html->set_variable('parent_storelocation_list', $parent_storelocation_list, 'string'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'edit_storelocations.php' : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('edit_storelocations'); } $html->print_footer();
$html->set_variable('import_rowcount', isset($import_data) ? count($import_data) : 0, 'integer'); $html->set_variable('import_file_content', $import_file_content, 'string'); $html->set_variable('import_format', $import_format, 'string'); $html->set_variable('import_separator', $import_separator, 'string'); //$html->set_variable('import_data_is_valid', (isset($import_data_is_valid) && ($import_data_is_valid)), 'boolean'); } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'show_device_parts.php?devid=' . $device_id : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { if (count($subdevices_loop) > 0 || $device_id == 0) { $html->print_template('subdevices'); } if ($device_id > 0) { $html->set_loop('table', isset($searched_parts_loop) ? $searched_parts_loop : array()); $html->print_template('add_parts'); $html->set_loop('table', $device_parts_loop); $html->print_template('device_parts'); $html->print_template('export'); $html->set_loop('table', isset($import_loop) ? $import_loop : array()); $html->print_template('import'); $html->print_template('copy_device'); } } $html->print_footer();
foreach ($attachements as $attachement) { $attachements_loop[] = array('attachement_name' => $attachement->get_name(), 'filename' => str_replace(BASE, BASE_RELATIVE, $attachement->get_filename()), 'is_picture' => $attachement->is_picture()); } if (count($attachements) > 0) { $attachement_types_loop[] = array('attachement_type' => $attachement_type->get_full_path(), 'attachements_loop' => $attachements_loop); } } if (count($attachement_types_loop) > 0) { $html->set_loop('attachement_types_loop', $attachement_types_loop); } // global/category stuff $html->set_variable('disable_footprints', $config['footprints']['disable'] || $category->get_disable_footprints(true), 'boolean'); $html->set_variable('disable_manufacturers', $config['manufacturers']['disable'] || $category->get_disable_manufacturers(true), 'boolean'); } catch (Exception $e) { $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red'); $fatal_error = true; } } /******************************************************************************** * * Generate HTML Output * *********************************************************************************/ $reload_link = $fatal_error ? 'show_part_info.php?pid=' . $part_id : ''; // an empty string means that the... $html->print_header($messages, $reload_link); // ...reload-button won't be visible if (!$fatal_error) { $html->print_template('show_part_info'); } $html->print_footer();