require_once('./fetcharray.inc.php');
require_once('./recordcount.inc.php');
require_once('./templateclass.php');
require_once('./miscfuncs.inc.php');
$tplItemApplet= "ItemApplet";
$tplItemSearch= "ItemSearch";
$tplItemBooks= "ItemBook";
$tplItemInfo= "ItemInfo";
$tplItemPlain= "ItemPlain";
$tplItemNone= "ItemNone";
$tplItemJBooks= "ItemBookApplet";
function NoSuchItem($ExhibitID)
{
global $TemplateFolder, $tplItemNone;
include("$TemplateFolder/$tplItemNone.tpl");
}
function LoadItem($Identifier, $TemplateFile)
{
global $dbCon;
// var $Result, $Query, $NumRecords, $hashRecord
// How do we handle having to do two joins from the source & artist tables
// double include table with different names? from sources s1, sources s2?
$Query = "SELECT exhibit_id, dob, s1.source, s2.source AS source_credit,
accession_number, object, object_type,
a1.artist, a2.artist AS other_artist, inscriptions, title,
publisher, bpd1, epd2,
imthumb, imfull, description, material, naration,
intrem2, itemid, is_approximate
FROM exhibit, sources s1, sources s2, objects, object_types, artists a1, artists a2, materials, publishers
WHERE exhibit.source_id = s1.source_id
AND exhibit.source_credit_id = s2.source_id
AND exhibit.object_id = objects.object_id
AND exhibit.object_type_id = object_types.object_type_id
AND exhibit.artist_id = a1.artist_id
AND exhibit.other_artist_id = a2.artist_id
AND exhibit.material_id = materials.material_id
AND exhibit.publisher_id = publishers.publisher_id
AND $Identifier";
//print "QUERY: $Query