Jump to content

girlzz

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

girlzz's Achievements

Member

Member (2/5)

0

Reputation

  1. hello sir.. i had some problem... i want to make 3 chained selected box but right now i had done just 2 chained select box.. how i want to do another chained box?? <script type="text/javascript" src="ajax.js"></script> <script type="text/javascript"> var ajax = new Array(); function getCityList(sel) { var countryCode = sel.options[sel.selectedIndex].value; document.getElementById('dhtmlgoodies_city').options.length = 0; // Empty city select box if(countryCode.length>0){ var index = ajax.length; ajax[index] = new sack(); ajax[index].requestFile = 'getCities.php?countryCode='+countryCode; // Specifying which file to get ajax[index].onCompletion = function(){ createCities(index) }; // Specify function that will be executed after file has been found ajax[index].runAJAX(); // Execute AJAX function } } function createCities(index) { var obj = document.getElementById('dhtmlgoodies_city'); eval(ajax[index].response); // Executing the response from Ajax as Javascript code } </script> <tr> <td width="131" height="24"><span class="style36">Year</span>: </td> <td width="360"><select name="dhtmlgoodies_country" id="dhtmlgoodies_country" onChange="getCityList(this)"> <option value="">Select a year</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> </td> </tr> <tr> <td height="24"><span class="style36">Block</span>: </td> <td><select name="dhtmlgoodies_city" id="dhtmlgoodies_city"> </select> </td> </tr> <tr> <td class="style28" >Subject Code:</td> <td class="style28" ><select name="s_code" id="s_code"> <option value="-">-</option> <option value="MED 3111">MED 3111</option> <option value="MED 3211">MED 3211</option> <option value="MED 3311">MED 3311</option> <option value="MED 3411">MED 3411</option> <option value="MED 3411">MED 3411</option> <option value="MED 4112">MED 4112</option> <option value="MED 4212">MED 4212</option> <option value="MED 4402">MED 4402</option> <option value="MED 4502">MED 4502</option> <option value="MED 4602">MED 4602</option> <option value="MED 4702">MED 4702</option> <option value="MED 5108">MED 5108</option> <option value="MED 5208">MED 5208</option> <option value="MED 5308">MED 5308</option> <option value="MED 5408">MED 5408</option> <option value="MED 5508">MED 5508</option> </select></td> i had make block is choose from year but i doesn't know how to create select box where subject code is filter from year and block....
  2. thank you sir... but the matric no you set value as '50'..if the matric no want to retrieve from the database,how i want to display those matric no?
  3. <?php do { ?> <tr> <td height="39" scope="col"><input name="matric_no[]" type="text" id="matric_no" value="<?php echo $row_test['matric_no']; ?>" size="10" readonly></td> <td scope="col"><input name="cam" type="int" id="cam" size="8" /></td> <td scope="col" ><input name="final_exam" type="int" id="final_exam" size="8" /></td> <td scope="col"><input name="total" type="int" id="total" size="8" onClick="calculate()" readonly/></td> <td scope="col"><input name="grade" type="text" id="grade" size="8" readonly/></td> </tr> </table>
  4. ook this is my php including html coding <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } if(isset($_POST['matric_no']) && sizeof($_POST['matric_no'])>0){ $matric_no = $_GET[matric_no]; $query_mat = "SELECT matric_no FROM medic_exam WHERE matric_no='$matric_no' "; $mat = mysql_query($query_mat, $mas) or die(mysql_error()); $row_mat = mysql_fetch_assoc($mat); if ($row_mat) { echo("<script type=\"text/javascript\">"); echo("alert('Result already been entered');"); echo("</script>"); } else { for($i=0;$i<count($_POST['matric_no']);$i++){ $insertSQL = sprintf("INSERT INTO medic_exam (matric_no, sessi, `year`, `group`, s_code, title, cam, final_exam,total,grade) VALUES (%s, %s, %s, %s,%s, %s, %s, %s, %s, %s )", GetSQLValueString($_POST['matric_no'][$i], "text"), GetSQLValueString($_POST['sessi'], "text"), GetSQLValueString($_POST['year'], "text"), GetSQLValueString($_POST['group'], "int"), GetSQLValueString($_POST['s_code'], "text"), GetSQLValueString($_POST['s_title'], "text"), GetSQLValueString($_POST['cam'], "int"), GetSQLValueString($_POST['final_exam'], "int"), GetSQLValueString($_POST['total'], "int"), GetSQLValueString($_POST['grade'], "text")); mysql_select_db($database_mas, $mas); $Result = mysql_query($insertSQL, $mas) or die(mysql_error()); $saved = true; } } } $colname_test = "-1"; if (isset($_GET['s_code'])) { $colname_test = $_GET['s_code']; } $session =$_GET['session']; $year = $_GET['year']; if ($session ==0) { echo("<script type=\"text/javascript\">"); echo("alert('Data not found.Please enter the required data.');"); echo("window.location=\"exm.php\""); echo("</script>"); } if ($year ==0) { echo("<script type=\"text/javascript\">"); echo("alert('Data not found.Please enter the required data.');"); echo("window.location=\"exm.php\""); echo("</script>"); } mysql_select_db($database_mas, $mas); $query_test = sprintf("SELECT * FROM medic_registered_course WHERE s_code = %s", GetSQLValueString($colname_test, "text")); $test = mysql_query($query_test, $mas) or die(mysql_error()); $row_test = mysql_fetch_assoc($test); $totalRows_test = mysql_num_rows($test); if ($totalRows_test==0) { echo("<script type=\"text/javascript\">"); echo("alert('Data not found.Please enter the required data.');"); echo("window.location=\"exm.php\""); echo("</script>"); } mysql_select_db($database_mas, $mas); $s_code=$_GET[s_code]; $search=$_GET[search]; $year= $_GET[year]; $sessi= $_GET[session]; $query_test = "SELECT * FROM medic_registered_course WHERE medic_registered_course.s_code='$s_code' AND medic_registered_course.group='$search' and year= '$year' and sessi = '$sessi' "; $test = mysql_query($query_test, $mas) or die(mysql_error()); $row_test = mysql_fetch_assoc($test); if ($row_test==0) { echo("<script type=\"text/javascript\">"); echo("alert('Data not found.Please enter the required data.');"); echo("window.location=\"exm.php\""); echo("</script>"); } mysql_select_db($database_mas, $mas); $query_Recordset2 = sprintf("SELECT medic_subject_offered.s_code, medic_subject_offered.s_title FROM medic_subject_offered WHERE medic_subject_offered.s_code LIKE '%%%s%%'" , $colname_test); $Recordset2 = mysql_query($query_Recordset2, $mas) or die(mysql_error()); $row_Recordset2 = mysql_fetch_assoc($Recordset2); $totalRows_Recordset2 = mysql_num_rows($Recordset2); if ($totalRows_Recordset2==0) { echo("<script type=\"text/javascript\">"); echo("alert('Data not found.Please enter the required data.');"); echo("window.location=\"exm.php\""); echo("</script>"); } ?> <html> <head> <title>List Registered Subject | Medic Assessment System</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="keywords" content="Keywords here"> <meta name="description" content="Description here"> <meta name="Author" content="Joseph De Araujo"> <meta name="Publisher" content="MyFreeTemplates.com"> <meta name="robots" content="index, follow"> <!-- (robot commands: all, none, index, no index, follow, no follow) --> <meta name="revisit-after" content="30 days"> <meta name="distribution" content="global"> <meta name="rating" content="general"> <meta name="content-language" content="english"> <title>Class List View | Medic Assessment System</title> <script language="JavaScript" type="text/JavaScript" src="images/myfreetemplates.js"></script> <style type="text/css"> <!-- .basestyle { color: #FFFFFF; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } h1 { font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; } body, td, p, input { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #333333; } .navlinks { font-size: 14px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; } .style6 { font-size: 12px; color: #000000; font-weight: bold; } .style7 { font-size: 12px; font-weight: bold; } .style10 {color: #000000} a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .style11 {color: #000000; font-size: 12px;} .style12 {font-weight: bold} .style13 { font-size: 12px; color: #000000; background-color: #D6D6D6; height: 22px; width: 72px; outline: 1; border: 1; font-weight: normal; } .style15 {font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; } --> </style> <script type="text/javascript"> function calculate() { var total = (parseInt(document.getElementById("cam").value) + parseInt(document.getElementById("final_exam").value)) / 2; if (total >100) { alert('Total cannot be more than 100.!!'); } else if (total<0) { alert('Total cannot be negative.!!'); } else { document.getElementById("total").value = total; var grade; if (total>=80) { grade = 'A'; } else if(total>=70) { grade = 'B'; } else if(total>=60) { grade = 'C'; } else if(total>=50) { grade = 'D'; } else if(total>=40) { grade = 'E'; } else { grade = 'F'; } document.getElementById("grade").value = grade; } } </script> <script src="../../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script> </head> <body style="margin:0; background-color: #E4E7E6;" <?php if($saved){echo 'onload="alert(\'Records successfully saved.\');"';}?>> <table width=1097 height="100%" border=1 align="center" cellpadding=0 cellspacing=0> <tr align="center" valign="middle"> <td height="34" colspan="2" class="style11">You are here>><a href="main.php">Main Menu</a> >>Examination>>Insert Result </td> </tr> <tr> <td width="202" height = "90%"valign="top"><div align="center" class="style6"> <p class="style30">ASSALAMUALAIKUM</p> </div> <div align="center" class="style7"> EXAMINATION</div> <ul> <li><span> <a href="exm.php">Insert Result </a></span> </li> </ul> <p><span class="style7"><a href="<?php echo $logoutAction ?>">>>LOGOUT</a></span> </p> <p align="center" class="style7">Date: <?php echo date('d-m-Y') ."\n";?></p></td> <td width="889" valign="top" style="padding-left:20px; padding-top:25px; padding-right:40px; padding-bottom:35px; "><p> <form id="form2" name="form2" method="post" action=""> <p align="center" class="style12 style28 style29"><strong>LIST REGISTERED SUBJECTS</strong></p> <p align="center" class="style12"> </p> <blockquote> <blockquote> <blockquote> <blockquote> <p> </p> <table width="601" height="138" border="0"> <tr> <td height="26">Session</td> <td><div align="center">:</div></td> <td><input name="sessi" type="text" id="sessi" value="<?php echo $row_test['sessi']; ?>" size="10" readonly="true" /></td> </tr> <tr> <td height="26">Year</td> <td><div align="center">:</div></td> <td><input name="year" type="text" id="year" value="<?php echo $row_test['year']; ?>" size="10" readonly="true" /></td> </tr> <tr> <td width="92" height="26"><div align="left">Group</div></td> <td width="10"><div align="center">:</div></td> <td width="360"><input name="group" type="text" id="group" value="<?php echo $row_test['group']; ?>" size="10" readonly="true" /></td> </tr> <tr> <td height="22">Subject Code</td> <td><div align="center">:</div></td> <td><input name="s_code" type="text" id="s_code" value="<?php echo $row_test['s_code']; ?>" size="10" readonly="true" /></td> </tr> <tr> <td height="23">Title</td> <td><div align="center">:</div></td> <td><input name="s_title" type="text" id="s_title" size="80" value="<?php echo $row_Recordset2['s_title']; ?>" readonly="true" /></td> </tr> </table> </blockquote> </blockquote> </blockquote> </blockquote> <p> </p> <table width="609" height="54" border="0" align="center"> <tr> <td width="60" height="28" scope="col"><span class="style15">Matric No.</span></td> <td width="48" scope="col"><span class="style15">CAM</span></td> <td width="48" scope="col"><div align="left" class="style15"> <div align="center">Final Exam</div> </div> </td> <td width="48" scope="col"><div align="left" class="style15"> <div align="center">Total Score</div> </div></td> <td width="383" scope="col"><span class="style15">Grade</span></td> </tr> <?php do { ?> <tr> <td height="20" scope="col"><input name="matric_no[]" type="text" id="matric_no[]" value="<?php echo $row_test['matric_no']; ?>" size="10" readonly="true" /></td> <td scope="col"><input name="cam" type="int" id="cam" size="8" /></td> <td scope="col" ><input name="final_exam" type="int" id="final_exam" size="8" /></td> <td scope="col"><input name="total" type="int" id="total" size="8" onClick="calculate()"/></td> <td scope="col"><input name="grade" type="text" id="grade" size="8" onClick="gred()"/></td> </tr> <?php } while ($row_test = mysql_fetch_assoc($test)); ?> </table> <p align="center"> </p> <table width="200" border="0" align="center"> <tr> <th scope="col"><input name="save" type="submit" class="style13" id="save" value="Save" /></th> <th scope="col"><script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','77','height','22','src','exmtry','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor','#E4E7E6','scale','noborder','movie','exmtry' ); //end AC code </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="77" height="22"> <param name="movie" value="exmtry.swf"> <param name="quality" value="high"> <param name="bgcolor" value="#E4E7E6"> <param name="SCALE" value="noborder"> <embed src="exmtry.swf" width="77" height="22" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#E4E7E6" scale="noborder"></embed> </object> </noscript></th> </tr> </table> <div align="center"></div> <p align="center"> </p> <p> </p> <p align="center" class="style8"> </p> </form> </td> </tr> <tr> <td height="58" colspan="2"><table width="100%" height="39" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center" class="basestyle"><span class="style31 style10">© Copyright . All Rights Reserved. <a href="http://www.myfreetemplates.com" class="basestyle"></a></span></td> </tr> </table></td> </tr> </table> </body> <?php mysql_free_result($test); ?> </html>
  5. <script type="text/javascript"> function calculate() var cams = document.getElementByName("cam"); var finals = document.getElementByName("final_exam"); var total = 0; for (i = 0; i < cams.length; i++) { var total = parseInt(cams[i].value) + parseInt(finals[i].value); } document.getElementByName("total").value = total; </script> i had this code for insert many marks but don't work... can anyone help me
  6. i had tried insert the missing one but still came out with error
  7. Parse error: syntax error, unexpected $end in C:\AppServ\www\mas\aug18\aug18\mas\examtry.php on line 377
  8. not working... hurm never mind.. by the way thanks for your help
  9. <script type="text/javascript"> function calculate() { var total = (parseInt(document.getElementById("cam").value) + parseInt(document.getElementById("final_exam").value)) / 2; document.getElementById("total").value = total; } </script> this is my php code: there is do that's mean there is a a lot of data to be calculate <?php do { ?> <tr> <td height="20" scope="col"><input name="matric_no[]" type="text" id="matric_no[]" value="<?php echo $row_test['matric_no']; ?>" size="10" readonly="true" /></td> <td scope="col"><input name="cam" type="int" id="cam" size="8" /></td> <td scope="col" ><input name="final_exam" type="int" id="final_exam" size="8" /></td> <td scope="col"><input name="total" type="int" id="total" size="8" onClick="calculate()" readonly="true"/></td> <td scope="col"><input name="grade" type="text" id="grade" size="8" onClick="gred()" readonly="true"/></td> </tr> <?php } while ($row_test = mysql_fetch_assoc($test)); ?>
  10. <script type="text/javascript"> function calculate() { var total = (parseInt(document.getElementById("cam").value) + parseInt(document.getElementById("final_exam").value)) / 2; document.getElementById("total").value = total; } </script> i got this code..it's work but it work if only there is one data.... what if my data had many to calculate?? i'm so stuck.. i made my form using php also... so it's has repeat region because all my data are retrive from the database..just the calculation insert manually from admin and the total is auto appear..
  11. hello sir, how i want to make a function that can calculate any number that i insert?? very very newbie in javascript...
  12. those two number i have to insert myself then the total of those two number will automatic itself appear.. without using any button...
  13. sory sir...i'm new to this calculation... if there any link so that i can learn step by step about how to calculate, i'm so thankful
  14. dear sir, how can i make calculation then the total will appear automatically in the textfield??? for example: textfield 1 + textfield 2 divide 2 = textfield total... please help me
  15. girlzz

    filter

    sir, i just had this coding for filter... i'm want to filter s_code and group from medic_registered_course... can you give me more detail want you want to see?
×
×
  • 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.