crams-commits Mailing List for Computer Rack & Asset Management System
Status: Pre-Alpha
Brought to you by:
cheezel
You can subscribe to this list here.
2009 |
Jan
(10) |
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Brian <ch...@us...> - 2009-03-29 12:38:18
|
Update of /cvsroot/crams/crams/db In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5142/db Modified Files: db_pgsql.php Log Message: - Improved existing SQL's - Started adding function to return the rack's configuration Index: db_pgsql.php =================================================================== RCS file: /cvsroot/crams/crams/db/db_pgsql.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** db_pgsql.php 16 Jan 2009 12:07:42 -0000 1.2 --- db_pgsql.php 29 Mar 2009 12:38:12 -0000 1.3 *************** *** 32,36 **** // Generate our SQL. ! $SQL = "SELECT id_data_centre as id, description FROM ".$CRAMS_DB_PREFIX."data_centre WHERE enabled=1"; // Retrieve the results. --- 32,36 ---- // Generate our SQL. ! $SQL = "SELECT id_data_centre as id, description FROM ".$CRAMS_DB_PREFIX."data_centre WHERE enabled=1 ORDER BY description"; // Retrieve the results. *************** *** 61,65 **** // Generate our SQL. ! $SQL = "SELECT id_rack as id, reference, description FROM ".$CRAMS_DB_PREFIX."rack WHERE enabled = 1 AND data_centre = ".$siteid; // Retrieve the results. --- 61,65 ---- // Generate our SQL. ! $SQL = "SELECT id_rack as id, reference, description FROM ".$CRAMS_DB_PREFIX."rack WHERE enabled = 1 AND data_centre = ".$siteid." ORDER BY reference"; // Retrieve the results. *************** *** 80,83 **** --- 80,111 ---- } + function db_Get_Rack_Config($rackid) + { + // Get a database handle to work with. + $dbh = db_Get_Handle(); + if (!$dbh) + { + return FALSE; + } + + // Generate our SQL. + $SQL = "SELECT id_rack as id, height, power FROM ".$CRAMS_DB_PREFIX."rack WHERE id_rack=".$rackid; + + // Retrieve the results. + $RESULT = pg_query($dbh, $SQL); + if (!$RESULT) + { + // Query failed. return failure. + return FALSE; + } + + $DATA = pg_fetch_array($RESULT); + + // Close the database handle. + db_Free_Handle($dbh); + + // Return the results. + return $DATA; + } ?> |
From: Brian <ch...@us...> - 2009-03-29 12:36:36
|
Update of /cvsroot/crams/crams In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5008 Modified Files: crams.css index.php rack.php Log Message: - Cleaned up code output to provide better adherance with W3C standards Index: index.php =================================================================== RCS file: /cvsroot/crams/crams/index.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.php 16 Jan 2009 12:07:42 -0000 1.3 --- index.php 29 Mar 2009 12:36:30 -0000 1.4 *************** *** 4,10 **** require_once("rack.php"); ! $GLOBALS['OUTPUT']="<html><head>\n"; $GLOBALS['OUTPUT'].="<link rel='stylesheet' href='crams.css' type='text/css' media='screen'>\n"; $GLOBALS['OUTPUT'].="<meta http-equiv='Content-Script-Type' content='text/javascript'>\n"; $GLOBALS['OUTPUT'].="<script src='js/rack.js'></script>\n"; $GLOBALS['OUTPUT'].="<title>$CRAMS_SYS_NAME Rack and Asset Management System</title></head><body>\n"; --- 4,12 ---- require_once("rack.php"); ! $GLOBALS['OUTPUT']="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\">\n"; ! $GLOBALS['OUTPUT'].="<html><head>\n"; $GLOBALS['OUTPUT'].="<link rel='stylesheet' href='crams.css' type='text/css' media='screen'>\n"; $GLOBALS['OUTPUT'].="<meta http-equiv='Content-Script-Type' content='text/javascript'>\n"; + $GLOBALS['OUTPUT'].="<meta name='Author' content='Brian Cheeseman'>\n"; $GLOBALS['OUTPUT'].="<script src='js/rack.js'></script>\n"; $GLOBALS['OUTPUT'].="<title>$CRAMS_SYS_NAME Rack and Asset Management System</title></head><body>\n"; *************** *** 31,35 **** // Allow for the rack selection drop down field. As we have no rack yet, we will not place any rack entries in it. ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect' id='rackselect'>\n"; $GLOBALS['OUTPUT'].="<option>Select Data Centre</option>\n"; $GLOBALS['OUTPUT'].="</select>\n"; --- 33,37 ---- // Allow for the rack selection drop down field. As we have no rack yet, we will not place any rack entries in it. ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect' id='rackselect' onchange='rackChange()'>\n"; $GLOBALS['OUTPUT'].="<option>Select Data Centre</option>\n"; $GLOBALS['OUTPUT'].="</select>\n"; *************** *** 45,48 **** --- 47,53 ---- $GLOBALS['OUTPUT'].=" <img src='images/valid_xhtml.png'> <img src='images/valid_css.png'></div>\n"; + /* Generate popup menu div holder */ + $GLOBALS['OUTPUT'].="<div id='pumenu'>Popup Menu</div>\n"; + /* Generate the host editing page */ Index: crams.css =================================================================== RCS file: /cvsroot/crams/crams/crams.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** crams.css 16 Jan 2009 12:07:42 -0000 1.3 --- crams.css 29 Mar 2009 12:36:30 -0000 1.4 *************** *** 1,18 **** - @CHARSET "ISO-8859-1"; - body { font-family: Sans-Serif; font-size: small; margin: 0.0em; } div#header { font-size: x-large; - width: 100%; text-align: center; background-color: #eeeeff; border-bottom: 1px solid #bbbbff; padding: 0.5em; - float: top; font-style: italic; } --- 1,15 ---- body { font-family: Sans-Serif; font-size: small; margin: 0.0em; + width: 100%; } div#header { font-size: x-large; text-align: center; background-color: #eeeeff; border-bottom: 1px solid #bbbbff; padding: 0.5em; font-style: italic; } *************** *** 32,36 **** padding: 0.3em; margin: 0.5em; - display: none; } --- 29,32 ---- *************** *** 42,46 **** border-top: 1px solid #bbbbff; margin-top: 0.5em; ! float: bottom; } --- 38,51 ---- border-top: 1px solid #bbbbff; margin-top: 0.5em; ! } ! ! div#pumenu { ! text-align: left; ! position: absolute; ! left: 0; ! top: 0; ! background-color: #eeeeff; ! border: 2px solid #3333ff; ! margin: 0.5em; } *************** *** 68,69 **** --- 73,99 ---- width: 4.8em; } + + div#pumenu div.pum { + padding: 0.3em; + } + + div#pumenu div.pum span.pumenu img { + border: none; + padding-right: 0.4em; + vertical-align: middle; + width: 24px; + height: 24px; + } + + div#pumenu div.pum:hover { + background-color: #bbbbff; + } + + div#pumenu div.pumhead { + border: none; + padding: 0.5em; + vertical-align: middle; + font-weight: bold; + background-color: #3333ff; + color: #ffffdd; + } Index: rack.php =================================================================== RCS file: /cvsroot/crams/crams/rack.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rack.php 15 Jan 2009 11:25:04 -0000 1.1 --- rack.php 29 Mar 2009 12:36:30 -0000 1.2 *************** *** 1,19 **** <?php ! function generateSingleRackHTML() { ! $GLOBALS['OUTPUT'].="<table class='racks'>\n"; ! $GLOBALS['OUTPUT'].="<tr><th>Front</th><th> </th><th>Rear</th></tr>"; ! $RUs = 48; for ($i = 0; $i < $RUs; $i++) { ! $GLOBALS['OUTPUT'].="<tr class='ru'>"; ! $GLOBALS['OUTPUT'].="<td class='ru' id='fru".($RUs-$i)."' onclick=\"ruclick('fru".($RUs-$i)."')\">".($RUs-$i)."</td>"; ! $GLOBALS['OUTPUT'].="<td class='rb'> </td>"; ! $GLOBALS['OUTPUT'].="<td class='ru' id='rru".($RUs-$i)."' onclick=\"ruclick('rru".($RUs-$i)."')\">".($RUs-$i)."</td></tr>\n"; } ! $GLOBALS['OUTPUT'] .= "</table>\n"; } --- 1,31 ---- <?php ! function generateSingleRackHTML($rackid, $showBack = 1) { ! $RACK=db_Get_Rack_Config($rackid); ! if (!$RACK) ! { ! return "<p>ERROR: Unable to load rack configuration.</p>"; ! } ! ! $RUs=$RACK['height']; ! $POWER=$RACK['power']; ! ! $OUT="<table class='racks'>\n"; ! $OUT.="<tr><th>Front</th><th> </th><th>Rear</th></tr>"; for ($i = 0; $i < $RUs; $i++) { ! $OUT.="<tr class='ru'>"; ! $OUT.="<td class='ru' id='f_".$rackid."_".($RUs-$i)."' onclick=\"ruclick('f_".$rackid."_".($RUs-$i)."')\">".($RUs-$i)."</td>"; ! if ($showBack == 1) ! { ! $OUT.="<td class='rb'> </td>"; ! $OUT.="<td class='ru' id='r_".$rackid."_".($RUs-$i)."' onclick=\"ruclick('r_".$rackid."_".($RUs-$i)."')\">".($RUs-$i)."</td></tr>\n"; ! } } ! $OUT .= "</table>\n"; ! return $OUT; } |
From: Brian <ch...@us...> - 2009-03-29 12:35:18
|
Update of /cvsroot/crams/crams/js In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4917/js Modified Files: rack.js Log Message: - Added initial code for popup menu - Cleaned up existing code Index: rack.js =================================================================== RCS file: /cvsroot/crams/crams/js/rack.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rack.js 16 Jan 2009 12:07:42 -0000 1.2 --- rack.js 29 Mar 2009 12:35:12 -0000 1.3 *************** *** 1,3 **** --- 1,73 ---- var xmlhttp + var mX + var mY + var ru + + document.onmousemove = mouseMove + document.onload = onload + + function onload(evt) + { + hidediv('pumenu') + hidediv('body') + } + + function mouseX(evt) + { + if (evt.pageX) + return evt.pageX; + else if (evt.clientX) + return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); + else return null; + } + + function mouseY(evt) + { + if (evt.pageY) + return evt.pageY; + else if (evt.clientY) + return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); + else return null; + } + + function mouseMove(evt) + { + mX = mouseX(evt) + mY = mouseY(evt) + } + + function showdiv(pass) + { + divs = document.getElementsByTagName('div'); + for(i=0;i<divs.length;i++) + { + if(divs[i].id.match(pass)) + { + if (document.getElementById) + divs[i].style.visibility="visible"; + else if (document.layers) + document.layers[divs[i]].display = 'visible'; + else + document.all.divs[i].visibility = 'visible'; + } + } + } + + function hidediv(pass) + { + var divs = document.getElementsByTagName('div'); + for(i=0;i<divs.length;i++) + { + if(divs[i].id.match(pass)) + { + if (document.getElementById) + divs[i].style.visibility="hidden"; + else if (!document.layers) + document.all.divs[i].visibility = 'hidden'; + else + document.layers[divs[i]].display = 'hidden'; + } + } + } function getXMLHTTP() *************** *** 14,27 **** } ! function ruclick(ru) { ! alert("You clicked on "+ru) ! return 1 } function siteChange() { site = document.getElementById('dcselect') siteid = site.options[site.selectedIndex].value getXMLHTTP() --- 84,139 ---- } ! function ruclick(rackunit) { ! hidediv('pumenu') ! ru = rackunit ! site = document.getElementById('dcselect') ! siteid = site.options[site.selectedIndex].value ! rack = document.getElementById('rackselect') ! rackid = rack.options[rack.selectedIndex].value ! document.getElementById('pumenu').innerHTML = '' ! ! getXMLHTTP() ! if (xmlhttp != null) ! { ! xmlhttp.onreadystatechange = ruClickResponse; ! xmlhttp.open("GET", "services/lookupracks.php?action=getpumenu&site="+siteid+"&rack="+rackid+"&ru="+ru, true) ! xmlhttp.send(null) ! } ! else ! { ! alert("Sorry, your browser is not supported by CRAMS."); ! } ! return true ! } ! ! function ruClickResponse() ! { ! pum = document.getElementById('pumenu') ! if (xmlhttp.readyState == 4) ! { // We have loaded. ! if (xmlhttp.status == 200) ! { // http 200 = OK. ! pum.innerHTML = xmlhttp.responseText ! } ! else ! { ! alert("Problem communicating with server. Please try again in a moment or two.\nError code: "+xmlhttp.status) ! return true ! } ! } ! ! pum.style.left = mX+"px" ! pum.style.top = mY+"px" ! showdiv('pumenu') ! return true } function siteChange() { + hidediv('pumenu') site = document.getElementById('dcselect') siteid = site.options[site.selectedIndex].value + document.getElementById('body').innerHTML = '' getXMLHTTP() *************** *** 37,41 **** } ! return 1 } --- 149,153 ---- } ! return true } *************** *** 56,72 **** } ! function state_Change() { ! if (xmlhttp.readyState==4) ! {// 4 = "loaded" ! if (xmlhttp.status==200) ! {// 200 = OK ! // ...our code here... } ! else { ! alert("Problem retrieving XML data"); } ! } } --- 168,211 ---- } ! function rackChange() { ! hidediv('pumenu') ! rack = document.getElementById('rackselect') ! rackid = rack.options[rack.selectedIndex].value ! ! getXMLHTTP() ! if (xmlhttp != null) ! { ! xmlhttp.onreadystatechange = rackChangeResponse; ! xmlhttp.open("GET", "services/lookupracks.php?action=getrackcontent&rack="+rackid, true) ! xmlhttp.send(null) } ! else { ! alert("Sorry, your browser is not supported by CRAMS."); } ! ! return true } + function rackChangeResponse() + { + if (xmlhttp.readyState == 4) + { // We have loaded. + if (xmlhttp.status == 200) + { // http 200 = OK. + body = document.getElementById('body') + body.innerHTML = xmlhttp.responseText + showdiv('body') + } + else + { + alert("Problem communicating with server. Please try again in a moment or two.\nError code: "+xmlhttp.status) + } + } + } + + function popUpMenuClick(mode) + { + hidediv('pumenu') + } |
From: Brian <ch...@us...> - 2009-03-29 12:33:07
|
Update of /cvsroot/crams/crams/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4778 Added Files: popupmenu.php Log Message: - Added popup menu generation code --- NEW FILE: popupmenu.php --- <?php function pumGenerateEntry($icon, $text, $key) { return "<div class='pum'><span class='pumenu' onclick=\"popUpMenuClick('$key')\"><img src='images/$icon')'>$text</span></div>"; } function pumGenerateHeader($title) { return "<div class='pumhead'>$title</div>"; } function pumGenerateMenu($title, $elements) { $menu = pumGenerateHeader($title); foreach ($elements as $e) { $menu .= pumGenerateEntry($e['icon'], $e['text'], $e['key']); } return $menu; } ?> |
From: Brian <ch...@us...> - 2009-03-29 12:31:31
|
Update of /cvsroot/crams/crams/images In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4652 Added Files: add.png del.png edit.png move.png Log Message: - Added images for the popup menu. --- NEW FILE: move.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: add.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: edit.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: del.png --- (This appears to be a binary file; contents omitted.) |
From: Brian <ch...@us...> - 2009-03-29 12:28:34
|
Update of /cvsroot/crams/crams/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4368/include Log Message: Directory /cvsroot/crams/crams/include added to the repository |
From: Brian <ch...@us...> - 2009-01-16 13:16:38
|
Update of /cvsroot/crams/crams/db In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4871/db Modified Files: db_pgsql.php Log Message: - Continued fleshing out the rack selection model. Index: db_pgsql.php =================================================================== RCS file: /cvsroot/crams/crams/db/db_pgsql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db_pgsql.php 25 May 2008 06:14:36 -0000 1.1 --- db_pgsql.php 16 Jan 2009 12:07:42 -0000 1.2 *************** *** 1,3 **** <?php ! ?> \ No newline at end of file --- 1,83 ---- <?php ! function db_Get_Handle() ! { ! $CONN_STR = "host=".$GLOBALS['CRAMS_DB_HOST']." port=".$GLOBALS['CRAMS_DB_PORT']." dbname=".$GLOBALS['CRAMS_DB_NAME']." user=".$GLOBALS['CRAMS_DB_USER']." password=".$GLOBALS['CRAMS_DB_PASS']; ! if ($GLOBALS['CRAMS_DB_PERSIST']) ! { ! return pg_pconnect($CONN_STR); ! } ! else ! { ! return pg_connect($CONN_STR); ! } ! ! // We shouldn't get here so lets return a false. ! return false; ! } ! ! function db_Free_Handle($dbh) ! { ! pg_close($dbh); ! } ! ! function db_Get_Site_List() ! { ! // Get a database handle to work with. ! $dbh = db_Get_Handle(); ! if (!$dbh) ! { ! return FALSE; ! } ! ! // Generate our SQL. ! $SQL = "SELECT id_data_centre as id, description FROM ".$CRAMS_DB_PREFIX."data_centre WHERE enabled=1"; ! ! // Retrieve the results. ! $RESULT = pg_query($dbh, $SQL); ! if (!$RESULT) ! { ! // Query failed. return failure. ! return FALSE; ! } ! ! $DATA = pg_fetch_all($RESULT); ! ! // Close the database handle. ! db_Free_Handle($dbh); ! ! // Return the results. ! return $DATA; ! } ! ! function db_Get_Rack_List_For_Site($siteid) ! { ! // Get a database handle to work with. ! $dbh = db_Get_Handle(); ! if (!$dbh) ! { ! return FALSE; ! } ! ! // Generate our SQL. ! $SQL = "SELECT id_rack as id, reference, description FROM ".$CRAMS_DB_PREFIX."rack WHERE enabled = 1 AND data_centre = ".$siteid; ! ! // Retrieve the results. ! $RESULT = pg_query($dbh, $SQL); ! if (!$RESULT) ! { ! // Query failed. return failure. ! return FALSE; ! } ! ! $DATA = pg_fetch_all($RESULT); ! ! // Close the database handle. ! db_Free_Handle($dbh); ! ! // Return the results. ! return $DATA; ! } ! ! ! ?> |
From: Brian <ch...@us...> - 2009-01-16 13:03:43
|
Update of /cvsroot/crams/crams/services In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4848/services Log Message: Directory /cvsroot/crams/crams/services added to the repository |
From: Brian <ch...@us...> - 2009-01-16 13:03:41
|
Update of /cvsroot/crams/crams In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4871 Modified Files: crams.css index.php Log Message: - Continued fleshing out the rack selection model. Index: crams.css =================================================================== RCS file: /cvsroot/crams/crams/crams.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** crams.css 15 Jan 2009 11:25:04 -0000 1.2 --- crams.css 16 Jan 2009 12:07:42 -0000 1.3 *************** *** 32,35 **** --- 32,36 ---- padding: 0.3em; margin: 0.5em; + display: none; } Index: index.php =================================================================== RCS file: /cvsroot/crams/crams/index.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.php 15 Jan 2009 11:25:04 -0000 1.2 --- index.php 16 Jan 2009 12:07:42 -0000 1.3 *************** *** 8,39 **** $GLOBALS['OUTPUT'].="<meta http-equiv='Content-Script-Type' content='text/javascript'>\n"; $GLOBALS['OUTPUT'].="<script src='js/rack.js'></script>\n"; ! $GLOBALS['OUTPUT'].="<title>$SYS_NAME Rack and Asset Management System</title></head><body>\n"; /* Generate Page Header */ ! $GLOBALS['OUTPUT'].="<div id='header'>$SYS_NAME Rack and Asset Management System</div>\n"; /* Generate Rack Selector */ $GLOBALS['OUTPUT'].="<div id='selector'><form name='frmSelector'>\n"; ! $GLOBALS['OUTPUT'].="Data Centre <select name='dcselect'>\n"; ! $GLOBALS['OUTPUT'].="<option value='1'>Centre 1</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='2'>Centre 2</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='3'>Centre 3</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='4'>Centre 4</option>\n"; $GLOBALS['OUTPUT'].="</select>\n"; ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect'>\n"; ! $GLOBALS['OUTPUT'].="<option value='1'>Rack 1</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='2'>Rack 2</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='3'>Rack 3</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='4'>Rack 4</option>\n"; $GLOBALS['OUTPUT'].="</select>\n"; $GLOBALS['OUTPUT'].="</form></div>\n"; /* Generate Page Body */ ! $GLOBALS['OUTPUT'].="<div id='body'>"; ! ! generateSingleRackHTML(); - $GLOBALS['OUTPUT'].="</div>\n"; - /* Generate Footer */ $GLOBALS['OUTPUT'].="<div id='footer'>C.R.A.M.S. Designed and Created by Brian Cheeseman<br />\n"; --- 8,42 ---- $GLOBALS['OUTPUT'].="<meta http-equiv='Content-Script-Type' content='text/javascript'>\n"; $GLOBALS['OUTPUT'].="<script src='js/rack.js'></script>\n"; ! $GLOBALS['OUTPUT'].="<title>$CRAMS_SYS_NAME Rack and Asset Management System</title></head><body>\n"; /* Generate Page Header */ ! $GLOBALS['OUTPUT'].="<div id='header'>$CRAMS_SYS_NAME Rack and Asset Management System</div>\n"; /* Generate Rack Selector */ + + // Get the list of sites from the database. + $SITES=db_Get_Site_List(); + + // Start the output for the form and site selector. $GLOBALS['OUTPUT'].="<div id='selector'><form name='frmSelector'>\n"; ! $GLOBALS['OUTPUT'].="Data Centre <select name='dcselect' id='dcselect' onchange='siteChange()'>\n"; ! $GLOBALS['OUTPUT'].="<option selected value='-1'></option>\n"; ! ! // Add each of the sites to the drop down box. ! foreach ($SITES as $I => $SITE) ! { ! $GLOBALS['OUTPUT'].="<option value='".$SITE['id']."''>".$SITE['description']."</option>\n"; ! } $GLOBALS['OUTPUT'].="</select>\n"; ! ! // Allow for the rack selection drop down field. As we have no rack yet, we will not place any rack entries in it. ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect' id='rackselect'>\n"; ! $GLOBALS['OUTPUT'].="<option>Select Data Centre</option>\n"; $GLOBALS['OUTPUT'].="</select>\n"; $GLOBALS['OUTPUT'].="</form></div>\n"; /* Generate Page Body */ ! $GLOBALS['OUTPUT'].="<div id='body'></div>"; /* Generate Footer */ $GLOBALS['OUTPUT'].="<div id='footer'>C.R.A.M.S. Designed and Created by Brian Cheeseman<br />\n"; |
From: Brian <ch...@us...> - 2009-01-16 13:03:39
|
Update of /cvsroot/crams/crams/js In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4871/js Modified Files: rack.js Log Message: - Continued fleshing out the rack selection model. Index: rack.js =================================================================== RCS file: /cvsroot/crams/crams/js/rack.js,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rack.js 15 Jan 2009 11:25:04 -0000 1.1 --- rack.js 16 Jan 2009 12:07:42 -0000 1.2 *************** *** 1,2 **** --- 1,17 ---- + var xmlhttp + + function getXMLHTTP() + { + xmlhttp = null + if (window.XMLHttpRequest) + { // code for all new browsers + xmlhttp = new XMLHttpRequest() + } + else if (window.ActiveXObject) + { // code for IE5 and IE6 + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP") + } + } + function ruclick(ru) { *************** *** 4,5 **** --- 19,72 ---- return 1 } + + function siteChange() + { + site = document.getElementById('dcselect') + siteid = site.options[site.selectedIndex].value + + getXMLHTTP() + if (xmlhttp != null) + { + xmlhttp.onreadystatechange = siteChangeResponse; + xmlhttp.open("GET", "services/lookupracks.php?action=getracks&site="+siteid, true) + xmlhttp.send(null) + } + else + { + alert("Sorry, your browser is not supported by CRAMS."); + } + + return 1 + } + + function siteChangeResponse() + { + if (xmlhttp.readyState == 4) + { // We have loaded. + if (xmlhttp.status == 200) + { // http 200 = OK. + rack = document.getElementById('rackselect') + rack.innerHTML = xmlhttp.responseText + } + else + { + alert("Problem communicating with server. Please try again in a moment or two.\nError code: "+xmlhttp.status) + } + } + } + + function state_Change() + { + if (xmlhttp.readyState==4) + {// 4 = "loaded" + if (xmlhttp.status==200) + {// 200 = OK + // ...our code here... + } + else + { + alert("Problem retrieving XML data"); + } + } + } + |
From: Brian <ch...@us...> - 2009-01-16 08:25:37
|
Update of /cvsroot/crams/crams/db In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv22081 Modified Files: db.php Log Message: - Changed to only load the database class required for operation. Index: db.php =================================================================== RCS file: /cvsroot/crams/crams/db/db.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** db.php 25 May 2008 06:14:36 -0000 1.1 --- db.php 16 Jan 2009 08:25:28 -0000 1.2 *************** *** 1,4 **** <?php ! require_once("db_mysql.php"); ! require_once("db_pgsql.php"); ! ?> \ No newline at end of file --- 1,3 ---- <?php ! require_once("db_".$CRAMS_DB_TYPE.".php"); ! ?> |
From: Brian <ch...@us...> - 2009-01-16 08:22:37
|
Update of /cvsroot/crams/crams In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21869 Modified Files: config.php Log Message: - Added additional database connectivity parameters. Index: config.php =================================================================== RCS file: /cvsroot/crams/crams/config.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.php 25 May 2008 06:14:36 -0000 1.1 --- config.php 16 Jan 2009 08:22:31 -0000 1.2 *************** *** 2,13 **** /* Database Settings. */ ! $GLOBALS['DB_TYPE']='mysql'; ! $GLOBALS['DB_USER']='crams'; ! $GLOBALS['DB_PASS']='crams'; ! $GLOBALS['DB_NAME']='crams'; ! $GLOBALS['DB_PREFIX']='crams_'; /* System Settings. */ ! $GLOBALS['SYS_NAME']='Development'; ! ?> \ No newline at end of file --- 2,16 ---- /* Database Settings. */ ! $GLOBALS['CRAMS_DB_TYPE']='pgsql'; ! $GLOBALS['CRAMS_DB_HOST']='localhost'; ! $GLOBALS['CRAMS_DB_PORT']=5432; ! $GLOBALS['CRAMS_DB_USER']='crams'; ! $GLOBALS['CRAMS_DB_PASS']='crams'; ! $GLOBALS['CRAMS_DB_NAME']='crams'; ! $GLOBALS['CRAMS_DB_PREFIX']=''; ! $GLOBALS['CRAMS_DB_PERSIST']=True; /* System Settings. */ ! $GLOBALS['CRAMS_SYS_NAME']='Development'; ! ?> |
From: Brian <ch...@us...> - 2009-01-15 13:12:35
|
Update of /cvsroot/crams/crams In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18901 Removed Files: .project Log Message: - Removed the .project file for eclipse as I am no longer using that IDE. --- .project DELETED --- |
From: Brian <ch...@us...> - 2009-01-15 11:25:15
|
Update of /cvsroot/crams/crams/js In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16720/js Added Files: rack.js Log Message: - Added basic display of a rack to the codebase. --- NEW FILE: rack.js --- function ruclick(ru) { alert("You clicked on "+ru) return 1 } |
From: Brian <ch...@us...> - 2009-01-15 11:25:15
|
Update of /cvsroot/crams/crams In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16720 Modified Files: crams.css index.php Added Files: rack.php Log Message: - Added basic display of a rack to the codebase. Index: index.php =================================================================== RCS file: /cvsroot/crams/crams/index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.php 25 May 2008 06:14:36 -0000 1.1 --- index.php 15 Jan 2009 11:25:04 -0000 1.2 *************** *** 2,39 **** require_once("config.php"); require_once("db/db.php"); ! $GLOBALS['OUTPUT']="<html><head><link rel='stylesheet' href='crams.css' type='text/css' media='screen'>"; ! $GLOBALS['OUTPUT'].="<title>$SYS_NAME Rack and Asset Management System</title></head><body>"; /* Generate Page Header */ ! $GLOBALS['OUTPUT'].="<div id='header'>$SYS_NAME Rack and Asset Management System</div>"; /* Generate Rack Selector */ ! $GLOBALS['OUTPUT'].="<div id='selector'><form name='frmSelector'>"; ! $GLOBALS['OUTPUT'].="Data Centre <select name='dcselect'>"; ! $GLOBALS['OUTPUT'].="<option value='1'>Centre 1</option>"; ! $GLOBALS['OUTPUT'].="<option value='2'>Centre 2</option>"; ! $GLOBALS['OUTPUT'].="<option value='3'>Centre 3</option>"; ! $GLOBALS['OUTPUT'].="<option value='4'>Centre 4</option>"; ! $GLOBALS['OUTPUT'].="</select>"; ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect'>"; ! $GLOBALS['OUTPUT'].="<option value='1'>Rack 1</option>"; ! $GLOBALS['OUTPUT'].="<option value='2'>Rack 2</option>"; ! $GLOBALS['OUTPUT'].="<option value='3'>Rack 3</option>"; ! $GLOBALS['OUTPUT'].="<option value='4'>Rack 4</option>"; ! $GLOBALS['OUTPUT'].="</select>"; ! $GLOBALS['OUTPUT'].="</form></div>"; /* Generate Page Body */ ! $GLOBALS['OUTPUT'].="<div id='body'></div>"; /* Generate Footer */ ! $GLOBALS['OUTPUT'].="<div id='footer'>C.R.A.M.S. Designed and Created by Brian Cheeseman<br />"; ! $GLOBALS['OUTPUT'].="C.R.A.M.S. Copyright © 2008 Brian Cheeseman<br />"; ! $GLOBALS['OUTPUT'].="<a href='http://www.php.net/'><img src='images/php5-power-micro.png' border='0'></a>"; ! $GLOBALS['OUTPUT'].=" <img src='images/valid_xhtml.png'> <img src='images/valid_css.png'></div>"; ! /* Close out the web page. */ ! $GLOBALS['OUTPUT'].="</body></html>"; /* Send output to calling agent. */ --- 2,49 ---- require_once("config.php"); require_once("db/db.php"); + require_once("rack.php"); ! $GLOBALS['OUTPUT']="<html><head>\n"; ! $GLOBALS['OUTPUT'].="<link rel='stylesheet' href='crams.css' type='text/css' media='screen'>\n"; ! $GLOBALS['OUTPUT'].="<meta http-equiv='Content-Script-Type' content='text/javascript'>\n"; ! $GLOBALS['OUTPUT'].="<script src='js/rack.js'></script>\n"; ! $GLOBALS['OUTPUT'].="<title>$SYS_NAME Rack and Asset Management System</title></head><body>\n"; /* Generate Page Header */ ! $GLOBALS['OUTPUT'].="<div id='header'>$SYS_NAME Rack and Asset Management System</div>\n"; /* Generate Rack Selector */ ! $GLOBALS['OUTPUT'].="<div id='selector'><form name='frmSelector'>\n"; ! $GLOBALS['OUTPUT'].="Data Centre <select name='dcselect'>\n"; ! $GLOBALS['OUTPUT'].="<option value='1'>Centre 1</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='2'>Centre 2</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='3'>Centre 3</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='4'>Centre 4</option>\n"; ! $GLOBALS['OUTPUT'].="</select>\n"; ! $GLOBALS['OUTPUT'].=" Rack <select name='rackselect'>\n"; ! $GLOBALS['OUTPUT'].="<option value='1'>Rack 1</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='2'>Rack 2</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='3'>Rack 3</option>\n"; ! $GLOBALS['OUTPUT'].="<option value='4'>Rack 4</option>\n"; ! $GLOBALS['OUTPUT'].="</select>\n"; ! $GLOBALS['OUTPUT'].="</form></div>\n"; /* Generate Page Body */ ! $GLOBALS['OUTPUT'].="<div id='body'>"; ! ! generateSingleRackHTML(); ! ! $GLOBALS['OUTPUT'].="</div>\n"; /* Generate Footer */ ! $GLOBALS['OUTPUT'].="<div id='footer'>C.R.A.M.S. Designed and Created by Brian Cheeseman<br />\n"; ! $GLOBALS['OUTPUT'].="C.R.A.M.S. Copyright © 2008-2009 Brian Cheeseman<br />\n"; ! $GLOBALS['OUTPUT'].="<a href='http://www.php.net/'><img src='images/php5-power-micro.png' border='0'></a>\n"; ! $GLOBALS['OUTPUT'].=" <img src='images/valid_xhtml.png'> <img src='images/valid_css.png'></div>\n"; ! ! /* Generate the host editing page */ ! /* Close out the web page. */ ! $GLOBALS['OUTPUT'].="</body></html>\n"; /* Send output to calling agent. */ Index: crams.css =================================================================== RCS file: /cvsroot/crams/crams/crams.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crams.css 25 May 2008 06:14:36 -0000 1.1 --- crams.css 15 Jan 2009 11:25:04 -0000 1.2 *************** *** 8,12 **** div#header { ! font-size: large; width: 100%; text-align: center; --- 8,12 ---- div#header { ! font-size: x-large; width: 100%; text-align: center; *************** *** 15,18 **** --- 15,19 ---- padding: 0.5em; float: top; + font-style: italic; } *************** *** 31,35 **** padding: 0.3em; margin: 0.5em; - display: none; } --- 32,35 ---- *************** *** 42,44 **** margin-top: 0.5em; float: bottom; ! } \ No newline at end of file --- 42,68 ---- margin-top: 0.5em; float: bottom; ! } ! ! div#body table.racks { ! padding-left: 3.0em; ! } ! ! div#body table.racks tr.ru { ! height: 2.1em; ! } ! ! div#body table.racks tr th { ! font-style: italic; ! font-size: large; ! } ! ! div#body table.racks tr.ru td.ru { ! border: 1px black solid; ! width: 20.0em; ! text-align: center; ! } ! ! div#body table.racks tr.ru td.rb { ! border: none; ! width: 4.8em; ! } --- NEW FILE: rack.php --- <?php function generateSingleRackHTML() { $GLOBALS['OUTPUT'].="<table class='racks'>\n"; $GLOBALS['OUTPUT'].="<tr><th>Front</th><th> </th><th>Rear</th></tr>"; $RUs = 48; for ($i = 0; $i < $RUs; $i++) { $GLOBALS['OUTPUT'].="<tr class='ru'>"; $GLOBALS['OUTPUT'].="<td class='ru' id='fru".($RUs-$i)."' onclick=\"ruclick('fru".($RUs-$i)."')\">".($RUs-$i)."</td>"; $GLOBALS['OUTPUT'].="<td class='rb'> </td>"; $GLOBALS['OUTPUT'].="<td class='ru' id='rru".($RUs-$i)."' onclick=\"ruclick('rru".($RUs-$i)."')\">".($RUs-$i)."</td></tr>\n"; } $GLOBALS['OUTPUT'] .= "</table>\n"; } ?> |
From: Brian <ch...@us...> - 2009-01-15 10:58:04
|
Update of /cvsroot/crams/crams/js In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15375/js Log Message: Directory /cvsroot/crams/crams/js added to the repository |