151 lines
5.4 KiB
PHP
151 lines
5.4 KiB
PHP
<?php
|
|
|
|
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
|
|
// Copyright (C) 2005-2013 Solomon Peachy (pizza@shaftnet.org)
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation; either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
// 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 St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
include_once "include/config.php";
|
|
include_once "include/common.php";
|
|
include_once "include/profile.php";
|
|
include_once "include/site.php";
|
|
|
|
$database = site_prolog(PO_USER_TYPE_USER);
|
|
$type = "camera";
|
|
|
|
$manufacturer_filter = pg_escape_string($database, isset($_REQUEST['filter']) ? $_REQUEST['filter'] : "");
|
|
$manufacturer = get_generic_query_all($database, "select identifier, name from manufacturer order by name", 'manuf_all');
|
|
|
|
switch ($manufacturer_filter) {
|
|
case 'All':
|
|
case '':
|
|
$camera_type = pg_query($database, "select identifier, name, model, variation, url, raw_icc_profile from view_camera_type order by name");
|
|
break;
|
|
default:
|
|
$camera_type = pg_query($database, "select identifier, name, model, variation, url, raw_icc_profile from view_camera_type where view_camera_type.name='$manufacturer_filter' order by name");
|
|
}
|
|
|
|
site_header(sprintf($strings['profile_add'], $strings['generic_'.$type]));
|
|
site_navigator(6);
|
|
site_navigator_status(emit_a(generate_link('user', ''), $strings['generic_users'])." : ".emit_a("my.profile.php", $strings['generic_my_profile'])." : ".sprintf($strings['profile_add'], $strings['generic_'.$type]), "");
|
|
|
|
theme_display_navigator_box_top($profile_data['camera']['idx'], $profile_data, "100%");
|
|
|
|
if (sizeof($manufacturer) == 0) {
|
|
print emit_manuf_add_needed($type);
|
|
theme_display_navigator_box_bottom("100%");
|
|
site_footer($database);
|
|
site_epilog($database);
|
|
exit;
|
|
}
|
|
|
|
print "<form method=\"post\" action=\"camera.add.2.php\" accept-charset=\"".$strings['formats_encoding']."\">\n";
|
|
print "<table class=\"profile\">\n";
|
|
|
|
print emit_profile_manuf_combo("camera.add.php?type=$type", $type, 4, $manufacturer, $manufacturer_filter);
|
|
|
|
print "<tr>\n";
|
|
print emit_th("");
|
|
print emit_th($strings['profile_manufacturer'], "width=\"29%\"");
|
|
print emit_th($strings['profile_model'], "width=\"25%\"");
|
|
print emit_th($strings['profile_variation'], "width=\"21%\"");
|
|
print emit_th($strings['profile_icc_profile'], "width=\"21%\"");
|
|
print "</tr>\n";
|
|
|
|
$num_of_camera_types = pg_num_rows($camera_type);
|
|
if ($num_of_camera_types > 0) {
|
|
for ($i=0; $i < $num_of_camera_types; $i++) {
|
|
$camera = pg_fetch_row($camera_type, $i);
|
|
print "<tr>\n";
|
|
print emit_td(emit_radio_item("type_id", $camera[0], false));
|
|
print "<td><a href=\"$camera[4]\">$camera[1]</a></td>\n";
|
|
print "<td>$camera[2]</td>\n";
|
|
print "<td>$camera[3]</td>\n";
|
|
print "<td>";
|
|
if ($camera[5] != "")
|
|
print $icc_profiles[$camera[5]]['name'];
|
|
print "</td>\n";
|
|
print "</tr>\n";
|
|
}
|
|
}
|
|
else
|
|
print "<tr><td colspan=\"4\">".sprintf($strings['profile_none_found'], $strings['generic_'.$type])."</td></tr>\n";
|
|
print "</table>\n";
|
|
|
|
print "<table class=\"profile\">\n";
|
|
print "<tr class=\"folder_top\">\n";
|
|
print "<td colspan=\"5\">".sprintf($strings['profile_new_type'], $strings['generic_'.$type])."</td>\n";
|
|
print "</tr>\n";
|
|
print "<tr>\n";
|
|
print emit_th("");
|
|
print emit_th($strings['profile_manufacturer'], "width=\"29%\"");
|
|
print emit_th($strings['profile_model'], "width=\"25%\"");
|
|
print emit_th($strings['profile_variation'], "width=\"21%\"");
|
|
print emit_th($strings['profile_icc_profile'], "width=\"21%\"");
|
|
print "</tr>\n";
|
|
|
|
print "<tr>\n";
|
|
print emit_td(emit_radio_item("type_id", "custom", true));
|
|
print emit_td(emit_manufacturer_combo('manufacturer_id', $manufacturer, ""));
|
|
print "<td>";
|
|
print "<input type=\"text\" name=\"model\"/></td>\n";
|
|
print "<td>";
|
|
print "<input type=\"text\" name=\"variation\"/></td>\n";
|
|
print "<td>";
|
|
print emit_icc_profiles_combo("icc_profile", "");
|
|
print "</td>\n";
|
|
print "</tr>\n";
|
|
print "</table>\n";
|
|
|
|
print "<table class=\"profile\">\n";
|
|
print "<tr class=\"folder_top\"><td colspan=\"5\">".sprintf($strings['profile_specific_data'], $strings['generic_'.$type])."</td></tr>\n";
|
|
|
|
print "<tr>\n";
|
|
print emit_th($strings['profile_serial']);
|
|
print emit_th($strings['profile_purchased']);
|
|
print emit_th($strings['profile_new']);
|
|
print emit_th($strings['profile_ignore_comment']);
|
|
print emit_th($strings['generic_access']);
|
|
print "</tr>\n";
|
|
|
|
print "<tr>\n";
|
|
print "<td>\n";
|
|
print "<input type=\"text\" name=\"serial_number\"/></td>\n";
|
|
print "<td>\n";
|
|
print emit_date_input_form("purchase_timestamp", "");
|
|
print "</td>\n";
|
|
print "<td>\n";
|
|
print emit_yes_no_combo("purchased_new", "t");
|
|
print "</td>\n";
|
|
print "<td>";
|
|
print emit_yes_no_combo("ignore_comment", 'f');
|
|
print "</td>\n";
|
|
print "<td>\n";
|
|
print emit_access_combo("access_rights", "t", "");
|
|
print "</td>\n";
|
|
print "</tr>\n";
|
|
print "</table>\n";
|
|
|
|
print $thm_elem['button.add'];
|
|
print $thm_elem['button.clear'];
|
|
print $thm_elem['button.cancel'];
|
|
print "</form>\n";
|
|
|
|
theme_display_navigator_box_bottom("100%");
|
|
|
|
site_footer($database);
|
|
site_epilog($database);
|
|
?>
|