{
global $dbxlink;
$query =
- "select Rack.id, Rack.name, height, Rack.comment, row_id, dict_value as row_name " .
+ "select Rack.id, Rack.name, height, Rack.comment, row_id, " .
+ "left_is_front, bottom_is_unit1, dict_value as row_name " .
"from Rack left join Dictionary on row_id = dict_key natural join Chapter " .
"where chapter_name = 'RackRow' and Rack.deleted = 'no' " .
(($row_id == 0) ? "" : "and row_id = ${row_id} ") .
return;
}
$ret = array();
- $clist = array ('id', 'name', 'height', 'comment', 'row_id', 'row_name');
+ $clist = array
+ (
+ 'id',
+ 'name',
+ 'height',
+ 'comment',
+ 'row_id',
+ 'left_is_front',
+ 'bottom_is_unit1',
+ 'row_name'
+ );
while ($row = $result->fetch (PDO::FETCH_ASSOC))
- foreach ($clist as $dummy => $cname)
+ foreach ($clist as $cname)
$ret[$row['id']][$cname] = $row[$cname];
$result->closeCursor();
usort ($ret, 'sortRacks');
}
global $dbxlink;
$query =
- "select Rack.id, Rack.name, row_id, height, Rack.comment, dict_value as row_name from " .
+ "select Rack.id, Rack.name, row_id, height, Rack.comment, " .
+ "left_is_front, bottom_is_unit1, dict_value as row_name from " .
"Rack left join Dictionary on Rack.row_id = dict_key natural join Chapter " .
"where chapter_name = 'RackRow' and Rack.id='${rack_id}' and Rack.deleted = 'no' limit 1";
$result1 = $dbxlink->query ($query);
}
// load metadata
- $rack['id'] = $row['id'];
- $rack['name'] = $row['name'];
- $rack['height'] = $row['height'];
- $rack['comment'] = $row['comment'];
- $rack['row_id'] = $row['row_id'];
- $rack['row_name'] = $row['row_name'];
+ $clist = array
+ (
+ 'id',
+ 'name',
+ 'height',
+ 'comment',
+ 'row_id',
+ 'left_is_front',
+ 'bottom_is_unit1',
+ 'row_name'
+ );
+ foreach ($clist as $cname)
+ $rack[$cname] = $row[$cname];
$result1->closeCursor();
// start with default rackspace
if ($next_id != NULL)
echo " <a href='${root}?page=rack&rack_id=${next_id}'>> > ></a>";
echo "</h2>\n";
+ if ($rackData['left_is_front'] == 'yes')
+ $markup = array ('left' => 'Front', 'right' => 'Back');
+ else
+ $markup = array ('left' => 'Back', 'right' => 'Front');
echo "<table class=rack border=0 cellspacing=0 cellpadding=1>\n";
- echo "<tr><th width='10%'> </th><th width='20%'>Front</th>";
- echo "<th width='50%'>Interior</th><th width='20%'>Back</th></tr>\n";
+ echo "<tr><th width='10%'> </th><th width='20%'>${markup['front']}</th>";
+ echo "<th width='50%'>Interior</th><th width='20%'>${markup['back']}</th></tr>\n";
for ($i = $rackData['height']; $i > 0; $i--)
{
- echo "<tr><th>$i</th>";
+ echo '<tr><th>' . ($rackData['botom_is_unit1'] == 'yes' ? $i : rackData['height'] - $i + 1) . '</th>';
for ($locidx = 0; $locidx < 3; $locidx++)
{
if (isset ($rackData[$i][$locidx]['skipped']))
{
if ($rack_id == 0)
{
- showError ('Invalid rack_id in renderRack()');
+ showError ('Invalid rack_id in renderRackPage()');
return;
}
if (($rackData = getRackData ($rack_id)) == NULL)
{
- showError ('getRackData() failed in renderRack()');
+ showError ('getRackData() failed in renderRackPage()');
return;
}
echo "<table border=0 class=objectview cellspacing=0 cellpadding=0><tr>";