Jump to content

CBR

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by CBR

  1. In addition, when I close IE9 and reaload it loads the latest status page with the correct content. Makes me think that caching is preventing this from working.
  2. I have a PHP file that I have running several queries to update status indicators (ApplicationsStatus.php) that is linked with in my index.php file included below. This code below goes and checks to see if that file has been updated wityh new content and will reflect that update in the page. For some reason it is not working in Internet Explorer 9 but works in Firefox and Chrome. Any ideas why? Or do you know of another simpler method? My code is old so maybe things are better in the latest Ajax calls that I am not aware of. <script language="javascript"> function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert("Your Browser Does Not Support This Script - Please Upgrade Your Browser ASAP"); } return req; } // Make the XMLHttpRequest object var http = createRequestObject(); function sendRequest(page) { // Open PHP script for requests http.open('get', page); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4 && http.status == 200){ // Text returned FROM the PHP script var response = http.responseText; if(response) { // UPDATE ajaxTest content document.getElementById("appstatus").innerHTML = response; } } } function repeatloop() { sendRequest('ApplicationStatusLoad.php'); // Load actual app status URL setTimeout("repeatloop()", 10000); } window.onload=function() { repeatloop(); } </script> </head><body> <span id="appstatus"></span>
  3. FYI. I am willing to kick some money for help on this. I'm a bit confused on how this is accomplished.
  4. the foreach usage is so poorly documented. Anyone have any examples of what I am trying to do above with usage of foreach? Not sure what the hell I am doing wrong. <dataset seriesName='Total Alerts'> <?php $con1 = mysql_connect(edited,false,65536); mysql_select_db('reporting'); //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); $master_data_set = array(); while ($myrow1 = mysql_fetch_array($result1)) $master_data_set[] = $myrow1; foreach($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} } ?> </dataset> <!--<dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'>--> <dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'> <?php foreach ($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} } ?> </dataset> <dataset lineThickness='2' seriesName='Percent Handled' parentYAxis='S'> <?php foreach ($master_data_set) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} } ?> </dataset>
  5. It isnt that simple. Each myrow could have hundreds of results. Maybe I am not understanding what you are saying. Take a look at my code. It is a bit more to it. <dataset seriesName='Total Alerts'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["total_handled"]."' />";} } ?> </dataset> <dataset color='FF0000' seriesName='Violations' renderAs='Area' parentYAxis='P'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["violations"]."' />";} } ?> </dataset> <dataset lineThickness='2' seriesName='Percent Handled' parentYAxis='S'> <?php //Call the proc() procedure $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); mysql_close($con1); while ($myrow1 = mysql_fetch_array($result1)) { if ($myrow1['month1'] == '1' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '2' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '3' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '4' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '5' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '6' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '7' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '8' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '9' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '10' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '11' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} elseif ($myrow1['month1'] == '12' && $myrow1['year1'] == '2009'){ echo " <set value='".$myrow1["percent"]."' />";} } ?> </dataset> <trendLines> <line startValue='90' color='00FF00' displayvalue='90% Target OLA' valueOnRight='1' parentYAxis='S'/> </trendLines> </chart>
  6. So I have this issue. I am calling a query and would like to display the result 3 times in 3 different ways. It is the same data in the 1 query I would like to display but in different orders. For instance. $result1= mysql_query("CALL noc_quality_report_sum('jbuhlman');") or die(mysql_error()); while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["total_handled"]."' />";} } while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["percent"]."' />";} } while ($myrow1 = mysql_fetch_array($result1)) { echo " <set value='".$myrow1["data1"]."' />";} } ... However this does not unless I run the query again before the while statements. IT is a performance problem executing the query 3 times instead of just once to get the same data. Is this possible?
  7. I got it working! It would help if I had a .php extension now wouldnt uit? Thanks for all of your help!
  8. when I do that, it does not load the javascript? Here is my entire code. <?php $myid = 85; ?> <script type="text/javascript" src="js/prototype/prototype.js"></script> <script type="text/javascript" src="js/bramus/jsProgressBarHandler.js"></script> <div class="percentImage1" id="element6">[ Loading Progress Bar ]</div> <script type="text/javascript"> Event.observe(window, 'load', function() { manualPB2 = new JS_BRAMUS.jsProgressBar( $('element6'), <?php echo $myid; ?>, { barImage : Array( 'images/bramus/percentImage_back4.png', 'images/bramus/percentImage_back3.png', 'images/bramus/percentImage_back2.png', 'images/bramus/percentImage_back1.png' ) } ); }, false); </script>
  9. Take a look at the top code. It has a place where it has an 85. I would like to get the number out of a mysql query for instance 88, and populate that new number where the 85 is. Does that make sense? This is for a progress bar that I plan to use to show status of some goals.
  10. <script type="text/javascript"> Event.observe(window, 'load', function() { manualPB2 = new JS_BRAMUS.jsProgressBar( $('element6'), 85, { barImage : Array( 'images/bramus/percentImage_back4.png', 'images/bramus/percentImage_back3.png', 'images/bramus/percentImage_back2.png', 'images/bramus/percentImage_back1.png' ) } ); }, false); </script> In the above code I would like to insert an array where 85 is listed. for instance I would like to put in there the below. $arrayname = 'arraynameresult'; So putting in $arrayname where the 85 is will not work, I have tried over and over. any ideas?
  11. My manual "Programming PHP - Oreilly"says.. then I referenced my other book and it says for a lower case i it is the same so I guess this book has a misprint. thanks!
  12. for instance it is using a 10:01 AM timestamp as we speak for all DB entries, it is 10:21 AM where I am.
  13. It is the same as the computer I am on now. that is what I thought. Only thing I can think is is it cacheing somewhere.
  14. I have the following code. $currentdate = date("Y-m-d h:I:s"); and it isnot using the correct current date, like it is cached. Can someone tell me how to make it display the current datestamp instead? It is using IIS 6 and PHP Version 5.2.5.
  15. I am locking records in a database by setting a flag. I want the record to be unlocked if for some reason the editor/submitter clicks on any other buttons that leave a page.
  16. I want to execute a query when someone clicks on any menu items that will exit to another part of a site. Is this possible?
  17. I have an array that has 1-100 values depending on the amount of results that are selected in a multiple form box which then created an array. I am able to display each array by echoing $array[0]-[whatever]. What I have done is then counted the array for the number of results using the following code. $tcount = count($toBox3); echo "$tcount"; Simple enough there but now I am stumped. I need for each array, run an exec command but I need it to stop at the end of the last array. It need to be dynamically done so if they select 10 results, or 100 results it builds the code needed and executes that number of time and also counts 1-whatever. So is there a way of doing this? Hope this makes sense. I will include an example of what I am attempting but with an echo statement. if ( $toBox[0] != "" ) { echo "$array[0]<br>"; } elseif ( $array[1] != "" ) { echo "$array[1]<br>"; } elseif ( $array[2] != "" ) { echo "$array[2]<br>"; } Thanks in advance for any help.
  18. I am an absolute idiot. I answered my own question above.
  19. Ok... So here is what I am getting now. HD123456 ***-***-**** test subject test message Array ( [0] => SWAT_pages [1] => SWAT_emails ) Array ( [0] => ID-FACILITIES [1] => ID-IT [2] => ID-IT ) Array ( [0] => Adam [1] => Al [2] => Alan [3] => Alan ) Looks like anything after the <space> is not being carried over which I can work around. I can't use this data with the formatting it has now. Would prefer to call it using something like $select[1] or $select[2], etc. Is this possible?
  20. Ok, I have done that but now my echo results for those select fields are just showing HD *************** test subject test msg Array Array Array
  21. I got a multiple result form from dhtmlgoodies.com that looked like it was working great, but for some reason it will not send the multiple selected results to the process file. Below is the actual form file and a screen capture of what it is. then below that will be the example basic process file that should grab the arrays and echo them back. THIS IS swat.php <html> <head> <title>Problem Coordination Notification Console</title> </head> <body bgcolor="#2B3E4D" vlink="#FFFFFF" link="#FFFFFF" font="black"> <?php require_once('Connections/proweb.php'); // include database connection file ?> <table width="100%" border=0 cellpadding=0 cellspacing=0> <tr><td bgcolor=#FFFFFF> <table width="100%" cellpadding=1 cellspacing=0> <tr><td bgcolor="#FFFFFF"> <table width=100% cellpadding=1 cellspacing=0><tr> <td> <img border=0 src="images/swatheader.jpg"><br> <form name="theForm" enctype="multipart/form-data" action="process-swat.php" method="post" onsubmit="multipleSelectOnSubmit()"> <font face="arial" size=2 color="#21455F"> <table> <tr><td> </td><td width=400></td><td> </td><td><b><font face="arial" size=2 color="#21455F"> <input type="image" name="prev" src="images/preview.jpg" value="Preview" onclick="preview()"> <input type='image' src="images/send.jpg"></b> </tr> </table> <font face="arial" size=2 color="#21455F"><i>This is a description of each step. <table> <tr> <td> <style type="text/css"> .multipleSelectBoxControl span{ /* Labels above select boxes*/ font-family:arial; font-size:11px; font-weight:bold; } .multipleSelectBoxControl div select{ /* Select box layout */ font-family:arial; height:100%; } .multipleSelectBoxControl input{ /* Small butons */ width:25px; } .multipleSelectBoxControl div{ float:left; } .multipleSelectBoxDiv </style> <script type="text/javascript"> /************************************************************************************************************ (C) www.dhtmlgoodies.com, October 2005 This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. Terms of use: You are free to use this script as long as the copyright message is kept intact. However, you may not redistribute, sell or repost it without our permission. Thank you! www.dhtmlgoodies.com Alf Magne Kalleland ************************************************************************************************************/ var fromBoxArray = new Array(); var toBoxArray = new Array(); var selectBoxIndex = 0; var arrayOfItemsToSelect = new Array(); function moveSingleElement() { var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,''); var tmpFromBox; var tmpToBox; if(this.tagName.toLowerCase()=='select'){ tmpFromBox = this; if(tmpFromBox==fromBoxArray[selectBoxIndex])tmpToBox = toBoxArray[selectBoxIndex]; else tmpToBox = fromBoxArray[selectBoxIndex]; }else{ if(this.value.indexOf('>')>=0){ tmpFromBox = fromBoxArray[selectBoxIndex]; tmpToBox = toBoxArray[selectBoxIndex]; }else{ tmpFromBox = toBoxArray[selectBoxIndex]; tmpToBox = fromBoxArray[selectBoxIndex]; } } for(var no=0;no<tmpFromBox.options.length;no++){ if(tmpFromBox.options[no].selected){ tmpFromBox.options[no].selected = false; tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value); for(var no2=no;no2<(tmpFromBox.options.length-1);no2++){ tmpFromBox.options[no2].value = tmpFromBox.options[no2+1].value; tmpFromBox.options[no2].text = tmpFromBox.options[no2+1].text; tmpFromBox.options[no2].selected = tmpFromBox.options[no2+1].selected; } no = no -1; tmpFromBox.options.length = tmpFromBox.options.length-1; } } var tmpTextArray = new Array(); for(var no=0;no<tmpFromBox.options.length;no++){ tmpTextArray.push(tmpFromBox.options[no].text + '___' + tmpFromBox.options[no].value); } tmpTextArray.sort(); var tmpTextArray2 = new Array(); for(var no=0;no<tmpToBox.options.length;no++){ tmpTextArray2.push(tmpToBox.options[no].text + '___' + tmpToBox.options[no].value); } tmpTextArray2.sort(); for(var no=0;no<tmpTextArray.length;no++){ var items = tmpTextArray[no].split('___'); tmpFromBox.options[no] = new Option(items[0],items[1]); } for(var no=0;no<tmpTextArray2.length;no++){ var items = tmpTextArray2[no].split('___'); tmpToBox.options[no] = new Option(items[0],items[1]); } } function sortAllElement(boxRef) { var tmpTextArray2 = new Array(); for(var no=0;no<boxRef.options.length;no++){ tmpTextArray2.push(boxRef.options[no].text + '___' + boxRef.options[no].value); } tmpTextArray2.sort(); for(var no=0;no<tmpTextArray2.length;no++){ var items = tmpTextArray2[no].split('___'); boxRef.options[no] = new Option(items[0],items[1]); } } function moveAllElements() { var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,''); var tmpFromBox; var tmpToBox; if(this.value.indexOf('>')>=0){ tmpFromBox = fromBoxArray[selectBoxIndex]; tmpToBox = toBoxArray[selectBoxIndex]; }else{ tmpFromBox = toBoxArray[selectBoxIndex]; tmpToBox = fromBoxArray[selectBoxIndex]; } for(var no=0;no<tmpFromBox.options.length;no++){ tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value); } tmpFromBox.options.length=0; sortAllElement(tmpToBox); } /* This function highlights options in the "to-boxes". It is needed if the values should be remembered after submit. Call this function onsubmit for your form */ function multipleSelectOnSubmit() { for(var no=0;no<arrayOfItemsToSelect.length;no++){ var obj = arrayOfItemsToSelect[no]; for(var no2=0;no2<obj.options.length;no2++){ obj.options[no2].selected = true; } } } function createMovableOptions(fromBox,toBox,totalWidth,totalHeight,labelLeft,labelRight) { fromObj = document.getElementById(fromBox); toObj = document.getElementById(toBox); arrayOfItemsToSelect[arrayOfItemsToSelect.length] = toObj; fromObj.ondblclick = moveSingleElement; toObj.ondblclick = moveSingleElement; fromBoxArray.push(fromObj); toBoxArray.push(toObj); var parentEl = fromObj.parentNode; var parentDiv = document.createElement('DIV'); parentDiv.className='multipleSelectBoxControl'; parentDiv.id = 'selectBoxGroup' + selectBoxIndex; parentDiv.style.width = totalWidth + 'px'; parentDiv.style.height = totalHeight + 'px'; parentEl.insertBefore(parentDiv,fromObj); var subDiv = document.createElement('DIV'); subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px'; fromObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px'; var label = document.createElement('SPAN'); label.innerHTML = labelLeft; subDiv.appendChild(label); subDiv.appendChild(fromObj); subDiv.className = 'multipleSelectBoxDiv'; parentDiv.appendChild(subDiv); var buttonDiv = document.createElement('DIV'); buttonDiv.style.verticalAlign = 'middle'; buttonDiv.style.paddingTop = (totalHeight/2) - 50 + 'px'; buttonDiv.style.width = '30px'; buttonDiv.style.textAlign = 'center'; parentDiv.appendChild(buttonDiv); var buttonRight = document.createElement('INPUT'); buttonRight.style.marginTop='34px'; buttonRight.type='button'; buttonRight.value = '>'; buttonDiv.appendChild(buttonRight); buttonRight.onclick = moveSingleElement; var buttonLeft = document.createElement('INPUT'); buttonLeft.type='button'; buttonLeft.value = '<'; buttonLeft.onclick = moveSingleElement; buttonDiv.appendChild(buttonLeft); var subDiv = document.createElement('DIV'); subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px'; toObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px'; var label = document.createElement('SPAN'); label.innerHTML = labelRight; subDiv.appendChild(label); subDiv.appendChild(toObj); parentDiv.appendChild(subDiv); toObj.style.height = (totalHeight - label.offsetHeight) + 'px'; fromObj.style.height = (totalHeight - label.offsetHeight) + 'px'; selectBoxIndex++; } </script> <?php require_once('Connections/pro_test.php'); // include database connection file ?> </td> </tr> </table> <table> <tr> <td><font face="arial" size=2 color="#21455F"><b>HDC</td><td><font face="arial" size=2 color="#21455F"><b>Conference Bridge</td> </tr> <tr> <td><textarea name="hdc" rows=1 cols=10>HD</textarea></td> <td><select name="number"><option value="866-448-6758">866-448-6758 (participant 494047) (host 1790)<option value="866-448-6758">866-448-6758 (participant 979147) (host 8777)<option value="866-448-6758">866-448-6758 (participant 927279) (host 1766)</select></td> </tr> </table> <table> <tr><td><font face="arial" size=2 color="#21455F"><b>Subject:</td></tr> <tr> <td><textarea name="subject" rows=1 cols=67></textarea></td> <tr><td><font face="arial" size=2 color="#21455F"><b>Message: </td></tr> <tr> <td><textarea name="messagebody" rows=3 cols=67></textarea></td> </tr> <tr> <td> <br><br><b><small><font face="arial" size=2 color="red">You move elements by clicking on the buttons or by double clicking on select box items</b></small></font><br><br> <select multiple name="fromBox1" id="fromBox1"> </select> <select multiple name="toBox1" id="toBox1"> <option value="SWAT pages">SWAT pages</option> <option value="SWAT emails">SWAT emails</option> </select> <script type="text/javascript"> createMovableOptions("fromBox1","toBox1",500,110,'Available Broadcast Groups','Selected Broadcast Groups'); </script> </td></tr> <tr><td> <select multiple name="fromBox2" id="fromBox2"> <?php $resultb = mysql_query("SELECT DISTINCT * FROM arsgroups order by arsgroups asc"); while ($myrow = mysql_fetch_array($resultb)) { echo "<option>".$myrow["arsgroups"]."</option>"; } ?> </select> <select multiple name="toBox2" id="toBox2"> </select> <script type="text/javascript"> createMovableOptions("fromBox2","toBox2",500,110,'Available Escalation Groups','Selected Escalation Groups'); </script> <b><small><font face="arial" size=2 color="#000000"></b></small> </tr></td> <tr><td> <select multiple name="fromBox3" id="fromBox3"> <?php $resultc = mysql_query("SELECT * FROM afnames order by name asc"); while ($myrow = mysql_fetch_array($resultc)) { echo "<option>".$myrow["name"]."</option>"; } ?> </select> <select multiple name="toBox3" id="toBox3"> </select> <script type="text/javascript"> createMovableOptions("fromBox3","toBox3",500,110,'Available Individual Names','Selected Individual Names'); </script> <b><small><font face="arial" size=2 color="#000000"></b></small> </td> </tr> </table> </tr> </table> <table> </table> <table> <tr> <td></td><td></td> </form> </table> </tr></td></table> this is process-swat.php <?php include("global.inc.php"); $errors=0; $error="The following errors occured while processing your form input.<ul>"; pt_register('POST','hdc'); pt_register('POST','number'); pt_register('POST','subject'); pt_register('POST','messagebody'); pt_register('POST','toBox1'); pt_register('POST','toBox2'); pt_register('POST','toBox3'); echo "$hdc<br><br>"; echo "$number<br><br>"; echo "$subject<br><br>"; echo "$messagebody<br><br>"; echo "$toBox1<br><br>"; echo "$toBox2<br><br>"; echo "$toBox3<br><br>"; ?> Any help is greatly appreciated.
  22. Can anyone suggest any good books to be used as a reference guide for PHP and MS SQL design? I have PHP and MySQL Web Development - Second Edition Programming PHP by O'Reilly Nether really go in depth with MS SQL stuff although they are similar, but some stuff just doesn't work with MS SQL and I would like to dive in to this a bit more. thx
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.