php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13680 When executing know working code under Win32 4.0.6 I receive a bunch of Warning
Submitted: 2001-10-15 18:48 UTC Modified: 2001-10-16 03:01 UTC
From: karl dot c dot zander at intel dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 4.0.6 OS: NT 4 SP6a
Private report: No CVE-ID: None
 [2001-10-15 18:48 UTC] karl dot c dot zander at intel dot com
I am using PHP v4.0.6 under NT 4 SP6a and IIS 4.0.  I originally wrote this program under Red Hat Linux 7.1 with PHP v4.0.4pl1, Apache 1.3.19 and FreeTDS v0.52.  Note:  I'm quite the beginner when it comes to PHP.  I am accessing a MS SQL 7 SP2 database.  Whenever I try to click my save button under NT I get these error messages back:

Warning: MS SQL: Unable to select database: pvlcfg in u:\inetpub\mako/pages/index.php on line 1635

Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1645

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1646

Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1652

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1653

Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1683

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1685

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1687
 


Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1706

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1707

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1709
 

Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1725

Warning: Supplied argument is not a valid MS SQL-result resource in u:\inetpub\mako/pages/index.php on line 1726

Warning: MS SQL: Query failed in u:\inetpub\mako/pages/index.php on line 1737
Failed to get crit config


I used to have my delete loops with their own if statements and delete buttons, but I got rid of that in favor of a single delete button for any element.  I know this isn't too much information, but do you have any suggestions?  This same code works fine under Linux.  Here's the code (I could only include some of it do to reasons of confidentiality):
<HTML>
<HEAD>
<TITLE>Mako - PVL Compatibility - Checksheet</TITLE>
</HEAD>
<BODY BGCOLOR="#999999">
<FORM METHOD="POST" ACTION="index.php">
<?php
include("queer.inc.php");
$whost = "192.168.0.3";
$server = "192.168.0.3";
$con = mssql_connect($server, 'admin', 'admin');
$msdbs = mssql_select_db('pvlcfg');

//Dummy check!
if ($RUN == "")
	die("Please go back and select a Run!");

if ($NOS == "")
	die("Please go back and select an Operating System!");


//Defining functions
function checkdateformat($date, $format)
{
	$format = str_replace("dd", "([0-9] {2})", $format);
//	$format = str_replace("d", "([0-9] {1,2})", $format);
	$format = str_replace("mm", "([0-9] {2})", $format);
//	$format = str_replace("m", "([0-9] {1,2})", $format);
	$format = str_replace("yyyy", "([0-9] {4})", $format);
//	$format = str_replace("yy", "([0-9] {2,4})", $format);

	if (ereg($format, $date))
	{ 
		return true; 
	}
	
	else
	{ 
		return false;
	}
}

function insertboard($cfgid)
{
	$NEWPBA = "704293-302";
	$NEWBOARD = "INLW84400035";

	$insert_board = mssql_query("INSERT INTO [BoardSet Details] (Cfg_ID, Board_ID, PBA, Type) VALUES('$cfgid', '$NEWBOARD', '$NEWPBA', 'Baseboard')");
}

function insertinstall($cfgid,$INSTALL)
{
	mssql_query("INSERT INTO CompatInstall (Cfg_Id, Install) VALUES('$cfgid', '$INSTALL')");
}

function insertsysid($SYSID,$RUN,$NOS)
{
if ($SYSID != "")
	$insert_sysid = mssql_query("INSERT INTO [SysSet Details] (Run_ID, Systems_ID, NOS_ID) VALUES('$RUN', '$SYSID', '$NOS')") or die("Failed to insert sysid");
}

$select_config = mssql_query("SELECT Cfg_ID,CfgNumber FROM Configs WHERE Run_ID = '$RUN' AND NOS_ID = '$NOS'") or die("Failed to Get new cfgid");	
$newcfg = mssql_fetch_array($select_config);
$cfgid = $newcfg[0];

if ($newcfg[1] != "COMP")
{
	if ($newcfg[1] != "")
		die("You selected a MAV config!  Please select a Compatibility config.");
}

	//First Check to see what's in the DB
	for ($pcount = 0; $pcount < 12; $pcount++)
	{
		$get_pba = mssql_query("SELECT PBA FROM Board WHERE Board_ID = '$BOARD[$pcount]'") or die("Failed to get PBA");
	$c_pba = mssql_fetch_array($get_pba);
	$PBA[$pcount] = $c_pba[0];
	}
	$check_board = mssql_query("SELECT Board_ID FROM [BoardSet Details] WHERE Cfg_ID = '$cfgid'") or die("Failed to check board");
	$c_board = mssql_fetch_array($check_board);
	
	$check_sysid = mssql_query("SELECT Systems_ID FROM [SysSet Details] WHERE Run_ID = '$RUN' AND NOS_ID = '$NOS'") or die("Failed to check sysid");
	$c_sysid = mssql_fetch_array($check_sysid) or insertsysid($SYSID,$RUN,$NOS);
	$check_install = mssql_query("SELECT Cfg_ID FROM CompatInstall WHERE Cfg_ID = '$cfgid'");
	if ($INSTALL == "")
	{
		$INSTALL = "Onboard SCSI";
	}
	$c_ins = mssql_fetch_array($check_install) or insertinstall($cfgid,$INSTALL); 

	if ($TOTMEM == "")
		$TOTMEM = 0;

	$format = "yyyy-mm-dd";
	$date_check1 = checkdateformat($SDATE, $format);
	$date_check2 = checkdateformat($EDATE, $format);
/*	
	if ($date_check1 == 0)
		die("Start Date format is invalid");

	if ($date_check2 == 0)
		die("End Date format is invalid");
*/
	if ($PAGE_COUNT != 0)
	{
		$update_run = mssql_query("UPDATE Configs SET CfgNumber='COMP', ConfigName='$CFGNAM', NOSVersion='$NOSVER', TechName='$TECH', System_ID='$SYSID', CfgBeginDate='$SDATE', CfgEndDate='$EDATE', TotalMemory='$TOTMEM' WHERE Cfg_ID = '$cfgid'") or die("Failed to update config");
	}
	
	if ($c_sysid[0] == "")
	{
		$update_sysid = mssql_query("UPDATE [SysSet Details] SET Systems_ID='$SYSID' WHERE Run_ID = '$RUN' AND NOS_ID = '$NOS'") or die("Failed to update sysid");
	}
	//Updates
	$update_install = mssql_query("UPDATE CompatInstall SET Cfg_ID='$cfgid', Install='$INSTALL' WHERE Cfg_ID = '$cfgid'");
	
	for ($tt = 0; $tt < 19; $tt++)
	{
		$update_track = mssql_query("UPDATE Trackers SET Cfg_ID='$cfgid', Tracker_ID='$TRACK[$tt]', Status='$TSTAT[$tt]' WHERE DCS_ID = '$TRID[$tt]'");
	}

	for ($nn = 0; $nn < 9; $nn++)
	{
		$update_note = mssql_query("UPDATE Notes SET Cfg_ID='$cfgid', Note='$NOTE[$nn]' WHERE Note_ID = '$NOTEID[$nn]'");
	}

	$update_inv = mssql_query("UPDATE CompatSysInventory SET Cfg_ID='$cfgid', Keybrd='$KEYBOARD', Monitor='$MONITOR', Mouse='$MOUSE', Floppie='$FLOPPY', Modem='$MODEM', Printer='$PRINTER' WHERE Inv_ID = '$INVID'");

	for ($pup = 0; $pup < 19; $pup++)
	{
		if ($PROC[$pup] != 0)
		{
			$update_procs = mssql_query("UPDATE [ProcSet Details] SET Cfg_ID='$cfgid', Processors_ID='$PROC[$pup]', SerialNumber='$PSER[$pup]' WHERE ProSet_id = '$PID[$pup]'");
		}
	}
	for ($mem = 0; $mem < 19; $mem++)
	{
		if ($RAM[$mem] != 0)
		{
			$update_mem = mssql_query("UPDATE [MemSet Details] SET Cfg_ID='$cfgid', Memory_ID='$RAM[$mem]' WHERE MemSet_ID = '$MID[$mem]'");
		}
	}
	
	for ($dbd = 0; $dbd < 19; $dbd++)
	{
		if ($BOARD[$dbd] != "")
		{
			$update_board = mssql_query("UPDATE [BoardSet Details] SET Cfg_ID='$cfgid', Board_ID='$BOARD[$dbd]', PBA='$PBA[$dbd]', Type='$BTYPE[$dbd]' WHERE Cfg_ID = '$cfgid' AND Board_ID = '$OBOARD[$dbd]'") or die("Failed to update board$dbd");
		}
	}

//Test connect
mssql_close();
$tconnect = mssql_connect($server, 'admin', 'admin');
$msdbstree = mssql_select_db('pvlcfg');

	
	for ($obu = 0; $obu < 19; $obu++)
	{
		if ($OB[$obu] != "")
		{
			$sel_onam = mssql_query("SELECT DeviceName FROM OBDeviceTypes WHERE Device_ID = '$OB[$obu]'");
			$new_onam = mssql_fetch_array($sel_onam);
			$update_ob = mssql_query("UPDATE [Onboard Details] SET Cfg_ID='$cfgid', Device_Id='$OB[$obu]', DeviceType='$OTYPE[$obu]', DeviceName='$new_onam[0]', Location='OB', ChannelPort='$OCHAN[$obu]', IRQ='$OIRQ[$obu]', NOSint='$OOSINT[$obu]', IOPort='$OIO[$obu]', MemoryRange='$OMEM[$obu]', DriverName='$ODRVNAME[$obu]', DriverVersion='$ODRVVER[$obu]', BIOSRev='$OBIOS[$obu]', FWRev='$OFW[$obu]', OBNote='$ORES[$obu]' WHERE OBSet_Id = '$OADSET[$obu]'") or die("Failed to update OB DEV[$obu]");
			$new_onam = "";
		}
	}

	for ($n = 0; $n < 19; $n++)
	{
		if ($NET[$n] != 0)
		{
			$sel_nmod = mssql_query("SELECT Model FROM Inventory WHERE SerialNumber = '$NET[$n]'");
			$new_nmod = mssql_fetch_array($sel_nmod);
			$update_nic = mssql_query("UPDATE [AdapSet Details] SET Cfg_id='$cfgid', SerialNumber='$NET[$n]', Slot='$NSLOT[$n]', Type='$NTYPE[$n]', IRQ='$NIRQ[$n]', NOSInt='$NOSINT[$n]', IOPort='$NIO[$n]', MemoryRange='$NMEM[$n]', DriverName='$NDRVNAME[$n]', DriverVersion='$NDRVVER[$n]', AdapNote='$NRES[$n]', Model='$new_nmod[0]' WHERE AdSet_ID = '$NADSET[$n]'") or die("Failed to update nic $n");
			$new_nmod = "";
		}
	}	

	for ($h = 0; $h < 19; $h++)
	{
		if ($HBA[$h] != 0)
		{
			$sel_hmod = mssql_query("SELECT Model FROM Inventory WHERE SerialNumber = '$HBA[$h]'");
			$new_hmod = mssql_fetch_array($sel_hmod);
			$update_hba = mssql_query("UPDATE [AdapSet Details] SET Cfg_ID='$cfgid', SerialNumber='$HBA[$h]', Slot='$HSLOT[$h]', Type='$HTYPE[$h]', IRQ='$HIRQ[$h]', NOSInt='$HOSINT[$h]', IOPort='$HIO[$h]', MemoryRange='$HMEM[$h]', DriverName='$HDRVNAME[$h]', DriverVersion='$HDRVVER[$h]', BIOSRev='$HBIOS[$h]', FWRev='$HFW[$h]', AdapNote='$HRES[$h]', Model='$new_hmod[0]' WHERE AdSet_ID = '$HADSET[$h]'") or die("Failed to update hba $h");
			$new_hmod = "";
		}
	}	
	
	for ($r = 0; $r < 19; $r++)
	{
		if ($MISC[$r] != "")
		{
			$sel_rmod = mssql_query("SELECT Model FROM Inventory WHERE SerialNumber = '$MISC[$r]'");
			$new_rmod = mssql_fetch_array($sel_rmod);
			$update_hba = mssql_query("UPDATE [AdapSet Details] SET Cfg_ID='$cfgid', SerialNumber='$MISC[$r]', Slot='$MSLOT[$r]', Type='$MTYPE[$r]', IRQ='$MIRQ[$r]', NOSInt='$MOSINT[$r]', IOPort='$MIO[$r]', MemoryRange='$MMEM[$r]', DriverName='$MDRVNAME[$r]', DriverVersion='$MDRVVER[$r]', BIOSRev='$MBIOS[$r]', FWRev='$MFW[$r]', AdapNote='$MRES[$r]', Model='$new_rmod[0]' WHERE AdSet_ID = '$MADSET[$r]'") or die("Failed to update MISC $r");
			$new_rmod = "";
		}
	}	

if ($cfgid == 0)
{
	$nos_nsel = mssql_query("SELECT NOSAbbrev FROM NOSAreas WHERE NOS_ID = '$NOS'");
	$nos_na = mssql_fetch_array($nos_nsel);
	$CFGNO = "COMP";
	//Generate ConfigName
	$CFGNAM = $RUN . $nos_na[0] . $CFGNO;
	$insert_config = mssql_query("INSERT INTO Configs (Run_ID, NOS_ID, CfgNumber, ConfigName, NOSVersion, TechName, System_ID, CfgBeginDate, CfgEndDate, TotalMemory) VALUES('$RUN', '$NOS', 'COMP', '$CFGNAM', '$NOSVER', '$TECH', '$SYSID', '$CFGBDATE', '$CFGEDATE', '$TOTMEM')") or die("Failed to insert Config!");

	$select_cfg = mssql_query("SELECT * FROM Configs WHERE Run_ID = '$RUN' AND NOS_ID = '$NOS'") or die("Failed to Get new cfgid");	
	while ($newconfig = mssql_fetch_array($select_cfg))
	{
		$ncfgid = $newconfig[0];
	}
	
	if ($newconfig[19] == "")
		$newconfig[19] = 0;


	for ($n = 0; $n < 19; $n++)
	{
		if ($NET[$n] != 0)
		{
			$insert_nic = mssql_query("INSERT INTO [AdapSet Details] (Cfg_ID, SerialNumber, Slot, Type, IRQ, IOPort, MemoryRange, DriverName, DriverVersion, AdapNote, Model) VALUES('$ncfgid', '$NET[$n]', '$NSLOT[$n]', '$NTYPE[$n]', '$NIRQ[$n]', '$NIO[$n]', '$NMEM[$n]', '$NDRVNAME[$n]', '$NDRVVER[$n]', '$NRES[$n]', '$NMOD[$n]')") or die("Failed to insert nic $n");
		}
	}	
	for ($h = 0; $h < 19; $h++)
	{
		if ($HBA[$h] != 0)
		{
			$insert_hba = mssql_query("INSERT INTO [AdapSet Details] (Cfg_ID, SerialNumber, Slot, Type, IRQ, IOPort, MemoryRange, DriverName, DriverVersion, AdapNote, Model) VALUES('$ncfgid', '$HBA[$h]', '$HSLOT[$h]', '$HTYPE[$h]', '$HIRQ[$h]', '$HIO[$h]', '$HMEM[$h]', '$HDRVNAME[$h]', '$HDRVVER[$h]', '$HRES[$h]', '$HMOD[$h]')") or die("Failed to insert hba $h");
		}
	}
	$insert_inv = mssql_query("INSERT INTO CompatSysInventory (Cfg_ID, Keybrd, Monitor, Mouse, Floppie, Modem, Printer) VALUES('$ncfgid', '$KEYBOARD', '$MONITOR', '$MOUSE', '$FLOPPY', '$MODEM', '$PRINTER')");	
	$cfgid = $ncfgid;
}

if ($SAVE == "SAVE")
{
	print("");
}	
mssql_close();
$tpconnect = mssql_connect($server, 'admin', 'admin');
$msdbs_tp = mssql_select_db('pvlcfg');

if ($DELETE == "DELETE")
{
	for ($od = 0; $od < 19; $od++)
	{
		if ($OSEL[$od] == "ON")
		{
			$delob = mssql_query("DELETE FROM [Onboard Details] WHERE OBSet_ID = '$OADSET[$od]'");
		}
	}

	for ($dn = 0; $dn < 19; $dn++)
	{
		if ($NSEL[$dn] == "ON")
		{
			$delnic = mssql_query("DELETE FROM [AdapSet Details] WHERE AdSet_ID = '$NADSET[$dn]'");
		}
	}

	for ($dh = 0; $dh < 19; $dh++)
	{
		if ($HSEL[$dh] == "ON")
		{
			$delhba = mssql_query("DELETE FROM [AdapSet Details] WHERE AdSet_ID = '$HADSET[$dh]'");
		}
	}

	for ($pvar = 0; $pvar < 19; $pvar++)
	{
		if ($PSEL[$pvar] == "ON")
		{
			$delproc = mssql_query("DELETE FROM [ProcSet Details] WHERE ProSet_id = '$PID[$pvar]'");
		}
	}

	for ($mvar = 0; $mvar < 19; $mvar++)
	{
		if ($MSEL[$mvar] == "ON")
		{
			$delmem = mssql_query("DELETE FROM [MemSet Details] WHERE MemSET_ID = '$MID[$mvar]'");
		}
	}

	for ($db = 0; $db < 11; $db++)
	{
		if ($BSEL[$db] == "ON")
		{
			$delboard = mssql_query("DELETE FROM [BoardSet Details] WHERE Cfg_ID = '$cfgid' AND Board_ID = '$BOARD[$db]'");
		}
	}

	for ($dm = 0; $dm < 19; $dm++)
	{
		if ($CSEL[$dm] == "ON")
		{
			$delmisc = mssql_query("DELETE FROM [AdapSet Details] WHERE AdSet_ID = '$MADSET[$dm]'");
		}
	}

	for ($nt = 0; $nt < 11; $nt++)
	{
		if ($NOTSER[$nt] == "ON")
		{
			$delnote = mssql_query("DELETE FROM Notes WHERE Cfg_ID = '$cfgid' AND Note_ID = '$NOTEID[$nt]'");
		}
	}

	for ($tr = 0; $tr < 19; $tr++)
	{
		if ($TRSEL[$tr] == "ON")
		{
			$deltrack = mssql_query("DELETE FROM Trackers WHERE Cfg_ID = '$cfgid' AND DCS_ID = '$TRID[$tr]'");
		}
	}
}


if ($ADDOB == "ADD OB")
{
	$addob = mssql_query("INSERT INTO [Onboard Details] (Cfg_ID, DeviceType) VALUES('$cfgid', 'NIC')") or die("Failed to ADD OB info");
}

if ($ADDNIC == "ADD NIC")
{
	$addnic = mssql_query("INSERT INTO [AdapSet Details] (Cfg_ID, Type) VALUES('$cfgid', 'NIC')") or die("Failed to ADD NIC");
}

if ($ADDHBA == "ADD HBA")
{
	$addhba = mssql_query("INSERT INTO [AdapSet Details] (Cfg_ID, Type) VALUES('$cfgid', 'SCSI HBA')") or die("Failed to ADD HBA");
}

if ($ADDPROC == "ADD PROC")
{
	$insert_proc = mssql_query("INSERT INTO [ProcSet Details] (Cfg_ID,Processors_ID) VALUES('$cfgid', '1')");
}

if ($ADDRAM == "ADD RAM")
{
	$insert_mem = mssql_query("INSERT INTO [MemSet Details] (Cfg_ID, Memory_ID) VALUES('$cfgid', '1')");
}

if ($ADDBOARD == "ADD BOARD")
{
	$NEWPBA = "704293-302";
	$NEWBOARD = "INLW84400035";

	$insert_board = mssql_query("INSERT INTO [BoardSet Details] (Cfg_ID, Board_ID, PBA, Type) VALUES('$cfgid', '$NEWBOARD', '$NEWPBA', 'Baseboard')");
}

if ($ADDMISC == "ADD MISC")
{
	$addmisc = mssql_query("INSERT INTO [AdapSet Details] (Cfg_ID, Type) VALUES('$cfgid', 'Sound Card')") or die("Failed to ADD MISC");
}

if ($ADDNOTE == "ADD NOTE")
{
	$insert_note = mssql_query("INSERT INTO Notes (Cfg_ID, Note) VALUES('$cfgid', '')");
}

if ($ADDTRACK == "ADD TRACKER")
{
	$insert_track = mssql_query("INSERT INTO Trackers (Tracker_ID, Status, Cfg_ID) VALUES('0', 'opened', '$cfgid')");
}

mssql_close();

/* --------------------------------Start-Sheet--------------------------*/

$connect = mssql_connect($server, 'admin', 'admin');
$msdbstoo = mssql_select_db('pvlcfg');

//Which product?
$prodsel = mssql_query("SELECT Prod_ID FROM Runs WHERE Run_ID = '$RUN'");
while ($getprod = mssql_fetch_array($prodsel))
{
$prod = $getprod[0];
}

// Get Onboard info and display them in tables
$getnos = mssql_query("SELECT NOS FROM NOSAreas WHERE NOS_ID = '$NOS'");
$nosname = mssql_fetch_array($getnos);
print("<CENTER><A HREF =\"select.php\"><IMG SRC=\"http://$whost/images/left-bb.jpg\"></A>");
print("<FONT SIZE=5 COLOR=\"#0033CC\"><B>Mako - PVL Compatibility CheckSheet</B></FONT><A HREF=\"$PG?RUN=$RUN&NOSN=$nosname[0]&CFGID=$cfgid&NOS=$NOS\"><IMG SRC=\"http://$whost/images/right-bb.jpg\"></A><BR>");
print("<FONT SIZE=4 COLOR=\"#0033CC\"><B>$nosname[0] $RUN</B></FONT>");
print("</CENTER></TD></TR><BR>\n");
?>
<FONT SIZE="-4">
<TABLE WIDTH ="600" BORDER=1>
<TR ALIGN=LEFT><TD WIDTH="600" VALIGN="TOP">
<?php
//Navigation column
print("<TD ALIGN=LEFT VALIGN=\"TOP\" WIDTH=\"20%\">");
print("<INPUT TYPE=SUBMIT NAME=\"ADDOB\" VALUE=\"ADD OB\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDBOARD\" VALUE=\"ADD BOARD\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDPROC\" VALUE=\"ADD PROC\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDRAM\" VALUE=\"ADD RAM\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDNIC\" VALUE=\"ADD NIC\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDHBA\" VALUE=\"ADD HBA\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDMISC\" VALUE=\"ADD MISC\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDNOTE\" VALUE=\"ADD NOTE\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"ADDTRACK\" VALUE=\"ADD TRACKER\"><BR>");
print("<INPUT TYPE=SUBMIT NAME=\"DELETE\" VALUE=\"DELETE\"><BR>");
print("<A HREF=\"tests.php?RUN=$RUN&PROD=$prod&CFGID=$cfgid&NOS=$NOS&NOSN=$nosname[0]&SVTRIG=SVTRIG\">Select Test Kit</A><BR>");
print("<A HREF=\"storage.php?RUN=$RUN&PROD=$prod&CFGID=$cfgid&NOSN=$nosname[0]&SVTRIG=SVTRIG\">Storage Management</A><BR>");
print("<A HREF=\"network.php?RUN=$RUN&PROD=$prod&CFGID=$cfgid&NOSN=$nosname[0]&SVTRIG=SVTRIG\">Network Management</A><BR>");
print("<INPUT TYPE=\"SUBMIT\" NAME=\"SAVE\" VALUE=\"SAVE\"><BR><INPUT TYPE=\"RESET\" VALUE=\"Reset\"><BR>");
print("<A HREF=\"http://$whost/index.html\">MAIN MENU</A>");
print("</TD>");

print("<TD VALIGN=\"TOP\" WIDTH=\"80%\">");
$querystg = "SELECT Product,PCISlots,ISASlots,IDEDown,USBDown,LanDown,SCSIDown,SCSIDownLegacy,VideoDown FROM Products WHERE Prod_ID = '$prod'";
$resid = mssql_query($querystg);

$column_count = mssql_num_fields($resid);
print("<TABLE BORDER=1>\n");
while ($row = mssql_fetch_row($resid))
{
	print("<TR ALIGN=LEFT VALIGN=TOP><TH>Product</TH><TH>PCI Slots</TH><TH>ISA Slots</TH><TH>IDE</TH><TH>USB</TH><TH>Onboard Lan</TH><TH>Onboard SCSI</TH><TH>Legacy SCSI</TH><TH>Onboard Video</TH></TR>\n");
	print("<TR ALIGN=LEFT VALIGN=TOP>");
	for ($column_num = 0;
	     $column_num < $column_count;
	     $column_num++)
		{
		 print("<TD>$row[$column_num]</TD>\n");
		}
	print("</TR>\n");
}
print("</TABLE>\n");
print("<BR>\n");
print("<BR>\n");
// Get code info and display in tables

$column_num = 0;
$codeq = "SELECT BIOS_Rev,SSU_Rev,BMC_Rev,HSC_Rev,FPC_Rev,FRUSDR_Rev,OTH1_Rev,OTH2_Rev,OTH3_Rev FROM Code WHERE Run_ID = '$RUN'";
$codeid = mssql_query($codeq);
$column_count = mssql_num_fields($codeid);
print("<TABLE BORDER=1>\n");
while ($crow = mssql_fetch_row($codeid))
{
	print("<TR ALIGN=LEFT VALIGN=TOP><TH>Bios Rev</TH><TH>SSU Rev</TH><TH>BMC Rev</TH><TH>HSC Rev</TH><TH>FPC Rev</TH><TH>FRU/SDR Rev</TH><TH>Other</TH><TH>Other</TH><TH>Other</TH></TR>\n");
	print("<TR ALIGN=LEFT VALIGN=TOP>");
	for ($column_num = 0;
	     $column_num < $column_count;
	     $column_num++)
		{
		 print("<TD>$crow[$column_num]</TD>\n");
		}
	print("</TR>\n");
}
print("</TABLE><BR>\n");

//Read in saved Run info/Inventory info

$oldinv = mssql_query("SELECT * FROM CompatSysInventory WHERE Cfg_ID = '$cfgid'");
while ($inv = mssql_fetch_array($oldinv))
{
	$saved_invid = $inv[0];
	$saved_keyboard = $inv[2];
	$saved_monitor = $inv[3];
	$saved_mouse = $inv[4];
	$saved_floppy = $inv[5];
	$saved_modem = $inv[6];
	$saved_printer = $inv[7];
}

$oldconfigq = mssql_query("SELECT CfgNumber,ConfigName,NOSVersion,TechName,CfgBeginDate,CfgEndDate,TotalMemory FROM Configs WHERE Cfg_ID = '$cfgid'") or die("Failed to get crit config");
$oldconfigx = mssql_fetch_array($oldconfigq) or die("Failed to fetch base config");

$nos_rsel = mssql_query("SELECT NOSAbbrev FROM NOSAreas WHERE NOS_ID = '$NOS'");
$nos_ra = mssql_fetch_array($nos_rsel);
$CFGNO = "COMP";
//Generate ConfigName
$CFGNAM = $RUN . $nos_ra[0] . $CFGNO;
print("<INPUT TYPE=HIDDEN NAME=\"CFGNAM\" VALUE=\"$CFGNAM\">");

print("<INPUT TYPE=HIDDEN NAME=\"INVID\" VALUE=\"$saved_invid\">");
	
?>
<TABLE><TR><TH>Start Date</TH><TH>End Date</TH>
<TH>System ID</TH><TH>NOS Version</TH><TH>Technician</TH></TR>
<TR><TD>
<?php
//Inventory stuff - with proc/mem selections
if ($oldconfigx[4] == "")
{
	$oldconfigx[4] = "";
}

if ($oldconfigx[5] == "")
	$oldconfigx[5] = "";

print("<INPUT TYPE=\"TEXT\" NAME=\"SDATE\" VALUE=\"$oldconfigx[4]\" SIZE=\"10\" MAXLENGTH=\"10\"></TD>");
print("<TD><INPUT TYPE=\"TEXT\" NAME=\"EDATE\" VALUE=\"$oldconfigx[5]\" SIZE=\"10\" MAXLENGTH=\"10\"></TD>");

//System stuff
$get_sys = mssql_query("SELECT * FROM Systems WHERE Prod_ID = '$prod' ORDER BY Systems_ID");
$getold_sys = mssql_query("SELECT Systems_ID FROM [SysSet Details] WHERE Run_ID = '$RUN' AND NOS_ID = '$NOS' ORDER BY Systems_ID") or die("Failed to get old sysid");
$old_sys = mssql_fetch_array($getold_sys);

print("<TD><SELECT SIZE=1 NAME=\"SYSID\">");
print("<OPTION SELECTED VALUE=\"$old_sys[0]\">$old_sys[0]");
while ($sys = mssql_fetch_array($get_sys))
{
	print("<OPTION VALUE=\"$sys[1]\">$sys[1]");
}
print("</SELECT></TD>");

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-16 03:01 UTC] mfischer@php.net
Please ask support questions at php-general@lists.php.net or php-db@php.net (database) or php-install@php.net.

- Markus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC