$v) $_REQUEST[$k] = $v; sqlUpdate("zones", "linkRef = '', zoneNo = '', zoneType = '', zoneEOL = '', zoneDevice = '', zoneName = ''", "tid = '".$row['tid']."'"); } else if (!empty($_REQUEST['zoneNo']) and !empty($_REQUEST['zoneName'])) { // standardize zoneNo $zoneNo = substr("000".$_REQUEST['zoneNo'], -3); // check to see if the zoneNo is already used $zoneExists = sqlSelect("zones", "linkRef = '".$job['tid']."' and zoneNo = '$zoneNo'"); if ($zoneExists['n'] == 0) // zoneNo does not exist, so save entry { if (empty($_REQUEST['zonePart'])) $_REQUEST['zonePart'] = "1"; $row = sqlSelect("zones", "zoneNo = ''"); // -- recycalbe entry? if ($row['n']) // - iff yes, use it { $row = mysql_fetch_assoc($row['r']); sqlUpdate("zones", "linkRef = '".$job['tid']."', zoneNo = '$zoneNo', zoneDevice = '".ucwords(strtolower($_REQUEST['zoneDevice']))."', zonePart = '".$_REQUEST['zonePart']."', zoneType = '".strtoupper($_REQUEST['zoneType'])."', zoneEOL = '".strtoupper($_REQUEST['zoneEOL'])."', zoneName = '".ucwords(strtolower($_REQUEST['zoneName']))."'", "tid = '".$row['tid']."'"); } else // ---- else create new entry sqlInsert("zones", "zoneref = '', linkRef = '".$job['tid']."', zoneNo = '".substr("000".$_REQUEST['zoneNo'], -3)."', zoneDevice = '".ucwords(strtolower($_REQUEST['zoneDevice']))."', zonePart = '".$_REQUEST['zonePart']."', zoneType = '".strtoupper($_REQUEST['zoneType'])."', zoneEOL = '".strtoupper($_REQUEST['zoneEOL'])."', zoneName = '".ucwords(strtolower($_REQUEST['zoneName']))."'"); unset($_REQUEST['zoneNo']); unset($_REQUEST['zoneDevice']); unset($_REQUEST['zoneType']); unset($_REQUEST['zoneEOL']); unset($_REQUEST['zoneName']); } else { // oops! the zone number already exists echo "Zone number already listed; please try again
\n"; } } ?> \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; echo" \n"; echo" \n"; echo "\n"; echo "\n"; //***************** post process loop ***************************** // get all zone listings for this rTid $rows = 0; $c = "cursor: pointer; color: black;\""; $noZones = false; $zoneList = sqlSelect("zones", "linkRef = '".$job['tid']."'", "", "zoneNo"); if (!$zoneList['n']) // no zones are attached to this SO, so see if zones are available for this client under other SOs { $zoneList = sqlSelect("zones,headers", "zones.linkRef=headers.tid and headers.oCode='{$job['oCode']}'", "zones.linkRef", "zoneNo,zones.lastmod desc"); if ($zoneList['n']) { $zoneList = mysql_fetch_assoc($zoneList['r']); $c = "color: #333;\""; //$zoneList = sqlSelect("zones,headers", "zones.linkRef=headers.tid and headers.oCode='{$job['oCode']}'", "", "zoneNo,zones.lastmod desc"); $zoneList = sqlSelect("zones", "linkRef='{$zoneList['linkRef']}'", "", "zoneNo"); } $noZones = true; } while ($zone = mysql_fetch_assoc($zoneList['r'])) { if ($lastZoneNum != $zone['zoneNo']) { $lastZoneNum = $zone['zoneNo']; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $rows += 1; } } while ($rows++ < 18) { echo "\n"; } if ($noZones and $zoneList['n']) { // zones listed are attached to a different SO - offer to copy to this SO echo " \n"; } ?>
Num Par Device Type Loop Description
".$zone['zoneNo']."".$zone['zonePart']."".$zone['zoneDevice']."".$zone['zoneType']."".$zone['zoneEOL']."".$zone['zoneName']."
 
\n"; echo " \n"; echo "