Jump to content

nrsh_ram

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nrsh_ram's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi there, I need a help whereby i am wondering if SQL can perform calculation on statistics? i am looking an sql command to genarate all the sample space ..for an example the user key in 123.. so the sql command muct be able to generate the sample space {123,132,213,2} is this can be done in sql? kindly advice.
  2. i have create forgetpassword.php <?php $msg=""; if(isset($_POST['Submit'])) { if(empty($_POST['studentname'])) { $msg="Mentee Name cannot be empty."; } elseif(empty($_POST['Loginid'])) { $msg="Mentee Login id cannot be empty."; } elseif(empty($_POST['comments'])) { $msg="comments cannot be empty."; } else { $to = "smiiledaa@gmail.com"; $subject = 'MSU - Fogot Password'; $message = "\n Mentee Name:".$_POST['studentname']."\n Mentee Login id :".$_POST['Loginid']."\n".$_POST['comments']; $headers = "From: MSI\r\n"; mail($to, $subject, $message, $headers); header("Location: mindex.php"); } } ?> when i run this page ...it show the error...how to fix this error? Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\xampp\htdocs\nrsh\forgetpassword.php on line 24 Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\nrsh\forgetpassword.php:24) in C:\Program Files\xampp\htdocs\nrsh\forgetpassword.php on line 25
  3. hi to all, i want create the link to call page in same page example: in tat page i have personal details,results,family details...so i want put a link when i click on "personal details" it will show the personal details, when i click "results" it will show the result... how to create this link?
  4. how to i add the coding? plz guide me
  5. actually i want run the localhost witout internet connection...what shall i do? mozilla cannot use witout internet?
  6. hi to all... i have run the php file in localhost by using xamp.. but when my internet its going to disconnect, the mozilla browser cannot run the localhost... it message said..mozilla is offline.. why i recieve this kind of message? then, when i try the IE its can run the localhost... what shall i do? somemore, in mozila the php page`s allignment is different than run the same page in IE, why this happend...how to fix the allignment, i want the both browser show the same allignment. plz help me
  7. good morning, i have create a form where mentor can preview,edit,delete and save.. here i want put a pop up message where i click another tab this pop up message will appear when tat form in edit and new... i want the pop up message "are u want save it?" here i show the a2.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); $view = 0; $aa = 0; $cur_login = $_SESSION["username"]; if($_GET["f"]=="newform" or $_GET["f"]=="edit" or $_GET["f"]=="preview"){ // click on NEW or EDIT button $view = 1; } if($_GET["f"]=="newform"){ // click on NEW FORM button $save_mode = "save_new"; } if($_GET["f"]=="edit"){ // click on EDIT button /* if($_SESSION['userlevel'] == 2 and $_GET["chklock"] == "Y"){ $view = 0; ?> <SCRIPT LANGUAGE="Javascript"> alert('This record is locked!'); </SCRIPT> <?php }else{ */ $save_mode = "save_edit"; $tmp_id = $_GET["rid"]; //$rid = $_GET["rid"]; //$rid = $_GET["rid"]; $view = 1; $conn3 = db_connect(); $query3 = "select * from attendance where atd_id = $tmp_id "; $result3 = $conn3->query($query3); //echo $query3; if($result3->num_rows >0){ $row3 = mysqli_fetch_assoc($result3); $lecturer = $row3["lecturer"]; $lec_username = $row3["lec_username"]; $date_taken = $row3["date_taken"]; $list_mentee = $row3["list_mentee"]; $ttl_mentee = $row3["ttl_mentee"]; $mentee_abs = $row3["mentee_abs"]; $p_lockyn = $row3["lockyn"]; } //} } if($_GET["f"]=="preview"){ // click on PREVIEW button /* if($_SESSION['userlevel'] == 2 and $_GET["chklock"] == "Y"){ $view = 0; ?> <SCRIPT LANGUAGE="Javascript"> alert('This record is locked!'); </SCRIPT> <?php }else{ */ $rid = $_GET["rid"]; $view = 1; $conn3 = db_connect(); $query3 = "select * from attendance where atd_id = $rid "; $result3 = $conn3->query($query3); //echo $query3; if($result3->num_rows >0){ $row3 = mysqli_fetch_assoc($result3); $lecturer = $row3["lecturer"]; $lec_username = $row3["lec_username"]; $date_taken = $row3["date_taken"]; $list_mentee = $row3["list_mentee"]; $ttl_mentee = $row3["ttl_mentee"]; $mentee_abs = $row3["mentee_abs"]; $p_lockyn = $row3["lockyn"]; //$p_c_date_prev = $p_c_date; } //} } if($_GET["f"]=="lock"){ // click on LOCK @ UNLOCK button //echo ">>> ".$_GET["f"]; if($_SESSION['userlevel'] == 3 or $_SESSION['userlevel'] == 2){ $rid = $_GET["rid"]; $lockyn = $_GET["locked"]; $view = 0; if($lockyn == "N"){ $newlockyn = "Y"; } if($lockyn == "Y"){ $newlockyn = "N"; } $conn4 = db_connect(); $query4 = "update attendance set lockyn = '$newlockyn' where atd_id = $rid "; $result4 = $conn4->query($query4); if($result4){ ?> <SCRIPT LANGUAGE="Javascript"> alert('The change has been done!'); </SCRIPT> <?php }else{ ?> <SCRIPT LANGUAGE="Javascript"> alert('The change has NOT been done!'); </SCRIPT> <?php } }else{?> <SCRIPT LANGUAGE="Javascript"> alert('Your user level has NOT access right to change the lock mode!'); </SCRIPT> <?php } } if($_GET["f"]=="delete"){ // click on DELETE button /* if($_SESSION['userlevel'] == 2 and $_GET["chklock"] == "Y"){ $view = 0; ?> <SCRIPT LANGUAGE="Javascript"> alert('This record is locked!'); </SCRIPT> <?php }else{ */ $rid = $_GET["rid"]; $view = 0; $conn5 = db_connect(); $query5 = "delete from attendance where atd_id = $rid "; $result5 = $conn5->query($query5); //echo $query5; if($result5){ ?> <SCRIPT LANGUAGE="Javascript"> alert('The record has been deleted!'); </SCRIPT> <?php }else{ ?> <SCRIPT LANGUAGE="Javascript"> alert('The record has NOT been deleted!'); </SCRIPT> <?php } //} } if($_POST["submitvalue2"]){ $view = 1; $loadsubj = 1; //$tmp_id = $_POST["cons_id"]; $tmp_id = $_POST["qqid"]; $save_mode = $_POST["h_save_mode2"]; $lecturer = $_POST["lecturer"]; $lec_username = $_POST["lec_username"]; $stud_username = $_POST["student"]; // is username of student $conn11 = db_connect(); $query11 = "select * from user where username='$stud_username' "; echo $query11; $result11 = $conn11->query($query11); if($result11->num_rows > 0){ $row11 = mysqli_fetch_assoc($result11); $student = $row11["name"]; } $subject = $_POST["subject"]; $c_date = $_POST["c_date"]; $time_from = $_POST["time_from"]; $time_to = $_POST["time_to"]; $report_comment = $_POST["comments"]; $bk_date = $_POST["bk_date"]; if($_POST["rd_lock"] <> "N" and $_POST["rd_lock"] <> "Y"){ $lockyn = "N"; }else{ $lockyn = $_POST["rd_lock"]; } } if($_POST['submitvalue1']){ $view = 0; $lecturer = $_POST["lecturer"]; $lec_username = $_POST["lec_username"]; $date_taken = $_POST["date_taken"]; $list_mentee = $_POST["list_mentee"]; $ttl_mentee = $_POST["ttl_mentee"]; $mentee_abs = $_POST["mentee_abs"]; $atd_adddte = date('Y-m-d'); if($mentee_abs < 0 or $ttl_mentee < 0){?> <SCRIPT LANGUAGE="Javascript"> alert('Minimun value of attendance is zero!'); </SCRIPT> <?php }else{ if($mentee_abs > $ttl_mentee){ ?> <SCRIPT LANGUAGE="Javascript"> alert('Number of absence is MORE than total mentee!'); </SCRIPT> <?php }else{ if($_POST["rd_lock"] <> "N" and $_POST["rd_lock"] <> "Y"){ $lockyn = "N"; }else{ $lockyn = $_POST["rd_lock"]; } $conn = db_connect(); if($_POST["h_save_mode"]=="save_edit"){ $rid = $_POST["cons_id"]; $chk_remaindte = $_POST["chk_remaindte"]; // determine to update the DATE field if($chk_remaindte == 1){ // NOT update if($_SESSION['userlevel'] == 3){ $query = " update attendance set ". " lecturer = '$lecturer', ". " lec_username = '$lec_username', ". //" date_taken = '$date_taken', ". " list_mentee = '$list_mentee', ". " ttl_mentee = '$ttl_mentee', ". " mentee_abs = '$mentee_abs', ". " lockyn = '$lockyn' ". " where atd_id = $rid "; }else{ $query = " update attendance set ". " lecturer = '$lecturer', ". " lec_username = '$lec_username', ". //" date_taken = '$date_taken', ". " list_mentee = '$list_mentee', ". " ttl_mentee = '$ttl_mentee', ". " mentee_abs = '$mentee_abs', ". " lockyn = '$lockyn' ". " where atd_id = $rid "; } }else{ // update if($_SESSION['userlevel'] == 3){ $query = " update attendance set ". " lecturer = '$lecturer', ". " lec_username = '$lec_username', ". " date_taken = '$date_taken', ". " list_mentee = '$list_mentee', ". " ttl_mentee = '$ttl_mentee', ". " mentee_abs = '$mentee_abs', ". " lockyn = '$lockyn' ". " where atd_id = $rid "; }else{ $query = " update attendance set ". " lecturer = '$lecturer', ". " lec_username = '$lec_username', ". " date_taken = '$date_taken', ". " list_mentee = '$list_mentee', ". " ttl_mentee = '$ttl_mentee', ". " mentee_abs = '$mentee_abs', ". " lockyn = '$lockyn' ". " where atd_id = $rid "; } } //echo $query; $result = $conn->query($query); if(!$result){ ?> <SCRIPT LANGUAGE="Javascript"> alert('Update form is fail!'); </SCRIPT> <?php }else{ ?> <SCRIPT LANGUAGE="Javascript"> alert('Update form is success!'); </SCRIPT> <?php } } if($_POST["h_save_mode"]=="save_new"){ $query = "insert into attendance ". "(lecturer,lec_username,date_taken,list_mentee,ttl_mentee,mentee_abs,atd_adddte,lockyn) values ". "('$lecturer','$lec_username','$date_taken','$list_mentee','$ttl_mentee','$mentee_abs','$atd_adddte','$lockyn') "; $result = $conn->query($query); //echo $query; if(!$result){ ?> <SCRIPT LANGUAGE="Javascript"> alert('Submission attendance form is fail!'); </SCRIPT> <?php }else{?> <SCRIPT LANGUAGE="Javascript"> alert('Submission attendance form is success!'); </SCRIPT> <?php } } } } } $conn2 = db_connect(); $query2 = "select * from attendance where lec_username='$cur_login' "; $result2 = $conn2->query($query2); /* if($_POST["Go"]){ $u_mentee_list = $_POST['mentee_list']; $u_mentor = $_POST['mentor']; $conn = db_connect(); $query1 = "select * from user where username = '$u_mentor' "; $result1 = $conn->query($query1); if($result1->num_rows > 0){ $row1 = mysqli_fetch_assoc($result1); $name_mentor = $row1["name"]; } if( is_array($u_mentee_list)){ while (list ($key, $u_mentee) = each ($u_mentee_list)) { $query = "select * from user where username = '$u_mentee' "; $result = $conn->query($query); if($result->num_rows > 0){ $row = mysqli_fetch_assoc($result); $name_mentee = $row["name"]; } //$query2 = "update mentormentee set mentor= '$name_mentor' , username_mentor= '$u_mentor' WHERE username_mentee='$u_mentee' "; //$result2 = $conn->query($query2); } } } */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <script LANGUAGE="JavaScript"> <!-- // Nannette Thacker http://www.shiningstar.net function confirmSubmit() { var agree=confirm("Are you sure you wish to continue?"); if (agree) return true ; else return false ; } // --> </script> <script type="text/javascript" src="calendarDateInput.js"> /*********************************************** * Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm * Script featured on and available at http://www.dynamicdrive.com * Keep this notice intact for use. ***********************************************/ </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <script type="text/javascript"> <!-- ddaccordion.init({ headerclass: "submenuheader", //Shared CSS class name of headers group contentclass: "submenu", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["suffix", "<img src='image/images/plus_n.gif' class='statusicon' />", "<img src='image/images/minus_n.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } }) //--> </script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <link href= "2col_leftNav1.css" rel="stylesheet" type="text/css" /> <link href= "pink_menu_left.css" rel="stylesheet" type="text/css" /> <link href="dropdowntabfiles/ddcolortabs.css" rel="stylesheet" type="text/css" /> <link href="dropdowntabfiles/dropdowntabs.js" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style2 {color: #FF0000} --> </style> </head> <body onLoad="MM_preloadImages('image/images/pre_icon_03.gif','image/images/edit_icon_03.gif','image/images/delete_icon_03.gif')"> <div id="masthead"> <div align="left"></div> </div> <div id="masthead_1"> <table width="300" border="0" align="right"> <tr> <td bgcolor="#CCCCCC"><font class=label face="Verdana" size="2"><?php echo $_SESSION["name"]; ?> | time |<a href="nlogout.php"> Logout</a> </font></td> </tr> </table> <div id="colortab_1"> <div id="colortab" class="ddcolortabs"> <ul> <li><a href="nprofile1.php" title="profile" ><span>PROFILE</span></a></li> <li><a href="nforms.php" title="froms" ><span>FORMS</span></a></li> <li><a href="view_report_menu.php" title="mentor" ><span>MENTOR</span></a></li> <li><a href="nmanagementee.php" title="mentee" ><span>MENTEE</span></a></li> <li><a href="mentor_setting.php" title="mysetting" ><span>MY SETTING</span></a></li> </ul> </div> </div> <div class="ddcolortabsline"> </div> <!--1st drop down menu --> <div id="dropmenu1_a" class="dropmenudiv_a"> <a href="./?pg=consult">Consultation</a> <a href="./?pg=activity">Activity</a> <a href="discussion.html">Discussion</a> <a href="">Attendance</a></div> <!--2nd drop down menu --> <div id="dropmenu2_a" class="dropmenudiv_a" style="width: 150px;"> <a href="javascript:load()">Update</a> <a href="">Preview</a> <a href="">Save</a></div> </div> <div id="content"> <div class="story"><form name="form" id="form" method="post" action="a2.php"> <table width="741" border="0"> <tr> <td width="735"><table width="884" border="0" align="left"> <tr> <td height="56"><div align="center"><a href="a2.php?f=newform" onmouseover="MM_swapImage('Image6','','image/images/new_icon_03.gif',1)" onMouseOut="MM_swapImgRestore()"> <img src="image/images/new_icon-shadow_03.gif" name="Image6" width="34" height="35" border="0" id="Image6" /></a> <input type=hidden name="submitvalue1"> <input type=hidden name="h_save_mode"> <input type=hidden name="cons_id"> <input type=hidden name="bk_date"> <a <?php if($view==1){ ?> href="javascript:rem()" onmouseout="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','image/images/save_icon_03.gif',1)" <?php } ?> > <img src="image/images/save_icon_shaddow_03.gif" width="34" height="35" border="0" class="img" /></a> <a href="javascript:window.print()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','image/images/save_icon_print_03.gif',1)"> <img src="image/images/save_icon_print_shadow_03.gif" name="Image2" width="34" height="35" border="0" id="Image2" /></a> </div></td> <td width="13"> </td> </tr> </table></td> </tr> <tr> <td><table width="884" class="style1" height="20" border="0" align="left"> <tr> </tr> <tr> <td width="51" bgcolor="#FFD9D9" class="style1"><div align="center" class="style13"> <div align="center"><span class="style12">No</span></div> </div></td> <td width="350" bgcolor="#FFD9D9" class="style1"><div align="center" class="style13"><span class="style12">Date</span></div></td> <td colspan="2" bgcolor="#FFD9D9" class="style1"><div align="center" class="style13"><span class="style12">Action</span></div></td> </tr> <tr> <?php while ($row2 = mysqli_fetch_assoc($result2)){ $aa = $aa + 1; ?> <td height="27" class="style1"><?php echo $aa; ?> <div align="center"></div> <div align="center"></div></td> <td class="style1"><?php echo $row2["date_taken"]; ?></td> <td class="style1"><div align="center"> <?php //$tmp_id = $row2["rid"]; //echo ">>>tmp_id: ".$tmp_id; ?> <a href="a2.php?f=preview&rid=<?php echo $row2["atd_id"]; ?>&chklock=<?php echo $row2["lockyn"]; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','image/images/pre_icon_03.gif',1)"><img src="image/images/pre_icon_shadow_03.gif" name="Image4" width="27" height="27" border="0" id="Image4" /></a> <a href="a2.php?f=edit&rid=<?php echo $row2["atd_id"]; ?>&chklock=<?php echo $row2["lockyn"]; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','image/images/edit_icon_03.gif',1)"><img src="image/images/edit_icon_shadiow_03.gif" name="Image3" width="27" height="27" border="0" id="Image3" /></a> <a href="a2.php?f=lock&rid=<?php echo $row2["atd_id"]; ?>&locked=<?php echo $row2["lockyn"]; ?>"> <img src=<?php if($row2["lockyn"]=="Y"){ ?>"image/images/lock_03.gif"<?php }else{ ?>"image/images/unlock_icon_03.gif"<?php } ?> name="Image8" width="27" height="27" border="0" id="Image8" /></a> <a onClick="return confirmSubmit()" href="a2.php?f=delete&rid=<?php echo $row2["atd_id"]; ?>&chklock=<?php echo $row2["lockyn"]; ?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','image/images/delete_icon_03.gif',1)"><img src="image/images/delete_icon_s_03.gif" name="image2" width="27" height="27" border="0" id="image2" /></a></div> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td></td> </tr> </table></td> </tr> <?php } ?> </table></td> </tr> <tr> <td height="356"> <?php if($view == 1) { ?> <table width="69%" border="0" align="center" cellpadding="2" cellspacing="2" bordercolor="#111111" id="AutoNumber2" style="border-collapse: collapse"> <tr valign="top"> <td width="161" height="26" align=left class="style1"><font class=label face="Verdana" size="2">Name of Lecturer </font></td> <td width="13" class="style1"><font class=label face="Verdana" size="2">:</font></td> <td width="469" class="style1"><font face="Verdana"> <?php if($_GET["f"]=="preview"){ echo "<B>".$lecturer; ?> <?php }else{ ?> <input name="lecturer" type="text" id="lecturer" value="<?php echo $_SESSION["name"]; ?>" readonly/> <input name="lec_username" type="hidden" id="lec_username" value="<?php echo $_SESSION["username"]; ?>"> <?php } ?> </font><font size="2" face="Verdana"> </font></td> </tr> <tr valign="top"> <td height="26" align=left class="style1"><font size="2" face="Verdana">Date</font></td> <td width="13" class="style1"><font class=label face="Verdana" size="2">:</font></td> <td class="style1"> <?php if($_GET["f"]=="preview"){ echo "<B>".$date_taken; ?> <?php }else{ if($_GET["f"]=="edit"){ //$p_c_date_prev = $p_c_date; ?> <script> //DateInput('c_date', true, 'YYYY-MM-DD', <?php if($_GET["f"]=="edit"){ echo $p_c_date; } ?>) DateInput('date_taken', true, 'YYYY-MM-DD') </script> <?php }else{ ?> <script> //DateInput('c_date', true, 'YYYY-MM-DD', <?php if($_GET["f"]=="edit"){ echo $p_c_date; } ?>) DateInput('date_taken', true, 'YYYY-MM-DD') </script> <?php } }?> <?php if($_GET["f"]=="edit"){ ?> <input name="chk_remaindte" type="checkbox" id="chk_remaindte" value="1" /> <span class="style14 style2">Check this if do NOT want to update the DATE field. </span> <?php } ?> </td> </tr> <tr valign="top"> <td height="23" align="left" class="style1"> </td> <td class="style1"> </td> <td class="style1"> </td> </tr> <tr valign="top"> <td height="23" align="left" class="style1"><font face="Verdana" size="2"><font class=label>Name List Of Mentee</font></font></td> <td width="13" class="style1"><font face="Verdana" size="2"><font class=label>:</font></font> </td> <td class="style1"><font face="Verdana"> <?php if($_GET["f"]=="preview"){ echo "<B>".$list_mentee; ?> <?php }else{ ?> <!--<textarea name="list_mentee" cols="40" rows="5" class="textbox" id="list_mentee"><?php echo $list_mentee; ?> </textarea> --> <?php $conn = db_connect(); $query = "SELECT * FROM mentormentee where username_mentor = '$cur_login'"; $result = $conn->query($query); while($row = mysqli_fetch_assoc($result)){ ?> <!--<input name="mentee_list[]" type="checkbox" ><?php echo $row["mentee"]; ?><br />--> <!--<input name="mentee_list[]" type="checkbox" value="1" multiple="multiple" option><?php echo $row["mentee"]; ?><br /></option>--> <!--from net--> <input type="checkbox" name="mentee_list[]" value="1" onclick="return TotalCheckboxes(this.form.elements['mentee_list[]'], total_field)"><?php echo $row["mentee"]; ?><br /> <script language="javascript"> function TotalCheckboxes(grp, total) { var x, sub = 0, len = grp.length; for (x=0; x<len; ++x) { if (grp[x].checked) sub += Number(grp[x].value); } total.value = sub; return true; }</script> <?php } ?> </select> <?php } ?> <label><a href="php_doc_xls_gen.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','image/images/delete_icon_03.gif',1)"></a></label> </font></td> </tr> <tr valign="top"> <td height="26" align=left class="style1">list</td> <td class="style1">:</td> <td class="style1"> <?php if($_GET["f"]=="preview"){ echo "<B>".$p_subject; ?> <?php }else{ ?> <input type=hidden name="submitvalue2"> <input type=hidden name="h_save_mode2"> <input type=hidden name="cons_id2"> <input name="nama_list" type="text" id="name_list" value="<?php if($_GET["f"]=="edit"){ echo $name_list; } ?>" size="30" maxlength="100" /> <input name="name_list" type="button" id="name_list" value=" Name List " onClick="open_gen_list_window();" /> <?php } ?></td> </tr> <tr valign="top"> <td height="26" align=left class="style1"><font face="Verdana" size="2"><font class=label>Total Mentee</font></font></td> <td class="style1"><font class=label face="Verdana" size="2">:</font></td> <td class="style1"><FONT face=Verdana> <?php if($_GET["f"]=="preview"){ echo "<B>".$ttl_mentee; ?> <?php }else{ ?> <input type="text" name="total_field" size="10" > <!--<INPUT name="ttl_mentee" class=textbox id="ttl_mentee" size=10 maxLength=5 value="<?php echo $total; ?>">--> <!--<INPUT name="ttl_mentee" class=textbox id="ttl_mentee" size=10 maxLength=5 value="<?php echo $ttl_mentee; ?>"> <INPUT name="ttl_mentee" class=textbox id="ttl_mentee" size=10 maxLength=5 value="<?php echo $c; ?>" />--> <?php } ?> </FONT></td> </tr> <tr valign="top"> <td height="26" align=left class="style1"><font size="2" face="Verdana">Mentee Absance</font></td> <td class="style1"><font class=label face="Verdana" size="2">:</font></td> <td class="style1"><font face=Verdana> <?php if($_GET["f"]=="preview"){ echo "<B>".$mentee_abs; ?> <?php }else{ ?> <input name="mentee_abs" class=textbox id="mentee_abs" size=10 maxlength=5 value="<?php echo $mentee_abs; ?>"> <?php } ?> </font><font size="2" face="Verdana"> </font></td> </tr> <tr valign="top"> <td height="26" align=left class="style1"> </td> <td class="style1"> </td> <td class="style1"> </td> </tr> <?php if($_SESSION["userlevel"] == 3 or $_SESSION['userlevel'] == 2 or $_GET["f"]=="preview"){ ?> <tr valign="top"> <td height="23" colspan="3" align="left" class="style1"> <?php if($_GET["f"]=="preview"){ if($p_lockyn == "Y"){ echo "<B>"."<font color=red>"."*** LOCK ***"; }else{ echo "<B>"."<font color=red>"."*** UNLOCK ***"; } }else{ ?> <input name="rd_lock" type="radio" value="N" <?php if($p_lockyn == "N"){ ?>checked="checked" <?php } ?> /> Unlock <input name="rd_lock" type="radio" value="Y" <?php if($p_lockyn == "Y"){ ?>checked="checked" <?php } ?> /> Lock <?php } ?> </td> </tr> <?php } ?> <tr valign="top"> <td height="6" colspan="3" align="left" class="style1"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" id="AutoNumber10" style="border-collapse: collapse"> </table> </tr> </table> <? } ?> </td> </tr> </table> <p> </p> </form> <script> function rem() { document.getElementById('form').submitvalue1.value="1"; document.getElementById('form').h_save_mode.value="<?php echo $save_mode; ?>"; document.getElementById('form').cons_id.value="<?php echo $tmp_id; ?>"; // document.getElementById('form').bk_date.value="<?php echo $p_c_date_prev; ?>"; document.getElementById('form').submit(); } </script> </div> <div id="breadCrumb_1"></div> </div> <div id="navBar"> <div id="search"></div> <div class="relatedLinks"> <h3> <div class="glossymenu"> <a href="#" class="menuitem">Attendance</a></div> </h3> </div> </div> </body> </html>
  8. i have check the query and database, have problem there. all.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $aa=0; $query = "SELECT mm.mentee, mm.username_mentee, mp.major ". "FROM mentormentee mm LEFT JOIN mentee_personal_details mp ". "ON mp.mentee_id = mm.username_mentee ". "WHERE mm.username_mentor = '$cur_login' AND mp.mentee_id = mm.username_mentee"; $result = $conn->query($query); ?> <?php while ($row = mysqli_fetch_assoc($result)){ $aa = $aa + 1; ?> <td><?php echo $aa ?> </td> <td><a href="view_profile.php?mentee=<?php echo $row['mentee']; ?>"><?php echo $row['mentee']; ?></a> </td> <td><?php echo $row['username_mentee']; ?> </td> <td><?php echo $row['major']; ?> </td> </tr><?php }?> view_profile.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $m_mentee = $_GET['mentee']; $query1 = "SELECT * FROM mentee_personal_details where mentee_id = '$m_mentee'"; echo $query1; $result1 = $conn->query($query1); /* $query1 = "SELECT * FROM mentee_personal_details where mentee_id = '$m_mentee'"; $result1 = $conn->query($query1); */ $row1 = mysqli_fetch_assoc($result1);{ $mentee_id = $row1["mentee_id"]; $s_fullname = $row1["fullname"]; $s_postal_address1 = $row1["postal_address1"]; $s_postal_address2 = $row1["postal_address2"]; $s_postal_address3 = $row1["postal_address3"]; $s_postal_zip = $row1["postal_zip"]; $s_post_telephone = $row1["post_telephone"]; $s_degree = $row1["degree"]; $s_major = $row1["major"]; $s_race = $row1["race"]; $s_marital_status = $row1["marital_status"]; $s_hobbies = $row1["hobbies"]; $s_permanent_address1 = $row1["permanent_address1"]; $s_permanent_address2 = $row1["permanent_address2"]; $s_permanent_address3 = $row1["permanent_address3"]; $s_per_zip = $row1["per_zip"]; $s_per_telephone = $row1["per_telephone"]; } ?> <td><?php echo $mentee_id; ?><font face="Verdana" size="2"> </font></td> here in my database, for each mentee have mentee_id, where username_mentee == mentee_id now in my query i have call the mentee, and get mentee. actually i want mentee_id=username_mentee what shall i do? where i have to change it? plz guide me...
  9. when i run it, its show the select mentee name like this: SELECT * FROM mentee_personal_details where mentee_id = 'siti' but its still return "0" and wrong output.. its not the correct mentee_id. plz guide me, where i have to change?
  10. i changed is as u said..... no errors, but the output is wrong... here i post the whole view_profile.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $aa=0; $query = "SELECT mm.mentee, mm.username_mentee, mp.major ". "FROM mentormentee mm LEFT JOIN mentee_personal_details mp ". "ON mp.mentee_id = mm.username_mentee ". "WHERE mm.username_mentor = '$cur_login' AND mp.mentee_id = mm.username_mentee"; $result = $conn->query($query); $row = mysqli_fetch_assoc($result); $m_mentee = $row['mentee']; $m_mentee = $_GET['mentee']; $query1 = "SELECT * FROM mentee_personal_details where mentee_id = '$m_mentee'"; $result1 = $conn->query($query1); $row1 = mysqli_fetch_assoc($result1);{ $mentee_id = $row1["mentee_id"]; $s_fullname = $row1["fullname"]; $s_postal_address1 = $row1["postal_address1"]; $s_postal_address2 = $row1["postal_address2"]; $s_postal_address3 = $row1["postal_address3"]; $s_postal_zip = $row1["postal_zip"]; $s_post_telephone = $row1["post_telephone"]; $s_degree = $row1["degree"]; $s_major = $row1["major"]; $s_race = $row1["race"]; $s_marital_status = $row1["marital_status"]; $s_hobbies = $row1["hobbies"]; $s_permanent_address1 = $row1["permanent_address1"]; $s_permanent_address2 = $row1["permanent_address2"]; $s_permanent_address3 = $row1["permanent_address3"]; $s_per_zip = $row1["per_zip"]; $s_per_telephone = $row1["per_telephone"]; } ?> <td width="142" align="left"><font class="label" face="Verdana" size="2">Student ID </font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $mentee_id; ?><font face="Verdana" size="2"> </font></td> <td > </td> <td> </td> <td> </td> </tr> <tr valign="top"> <td height="26" align="left" ><font class="label" face="Verdana" size="2"><span class="style3">*</span></font></td> <td height="26" align="left" ><font class="label" face="Verdana" size="2">Name</font></td> <td width="8"><font class="label" face="Verdana" size="2">:</font></td> <td width="298"><?php echo $fullname; ?><font face="Verdana" size="2"></font></td> <td align="left" width="151"> </td> <td width="7"> </td> <td width="273"> </td> </tr> <tr valign="top"> <td height="24" align="left"><font face="Verdana" size="2"><font class="label"><span class="style3">*</span></font></font></td> <td height="24" align="left"><font face="Verdana" size="2"><font class="label">Postal address</font></font></td> <td><font face="Verdana" size="2">:</font></td> <td><?php echo $row['postal_address1']; ?> </td> <td align="left"><font face="Verdana" size="2"><font class="label">Permanent address</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $s_permanent_address1; ?> </td> </tr> <tr valign="top"> <td height="24" colspan="2" align="left"> </td> <td> </td> <td><?php echo $s_postal_address2; ?> </td> <td align="left"> </td> <td> </td> <td><?php echo $s_permanent_address2; ?> </td> </tr> <tr valign="top"> <td height="24" colspan="2" align="left"> </td> <td> </td> <td><?php echo $s_postal_address3; ?> </td> <td align="left"> </td> <td> </td> <td><?php echo $s_permanent_address3; ?> </td> </tr> <tr valign="top"> <td height="26" align="left"><font face="Verdana" size="2"><font class="label"><span class="style3">*</span></font></font></td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Postcode</font></font></td> <td><font face="Verdana" size="2">:</font></td> <td><?php echo $s_postal_zip; ?> </td> <td align="left"><font face="Verdana" size="2"><font class="label">Postcode</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $s_per_zip; ?> </td> </tr> <tr valign="top"> <td height="26" align="left"><font face="Verdana" size="2"><font class="label"><span class="style3">*</span></font></font></td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Telephone</font></font></td> <td> </td> <td><?php echo $s_post_telephone; ?><font face="Verdana" size="2"> </font></td> <td align="left"><font face="Verdana" size="2"><font class="label">Telephone</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $s_per_telephone; ?> </td> </tr> <tr valign="top"> <td height="26" align="left"> </td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Degree</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $s_degree; ?> </td> <td align="left"> </td> <td> </td> <td> </td> </tr> <tr valign="top"> <td height="26" align="left"> </td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Major</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><?php echo $s_major; ?> </td> <td align="left"> </td> <td> </td> <td> </td> </tr> <tr valign="top"> <td height="26" align="left"> </td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Race</font></font></td> <td><font class="label" face="Verdana" size="2">:</font></td> <td><font face="Verdana"> <!--<select name="department" id="department"> <option selected><?php echo $row["department"]; ?></option> <option>ISC</option> <option>MSG</option> <option>ENT</option> </select>--> <option selected><?php echo $s_race; ?></option> <!--<select name="race" class="selectbox10" id="race"> <option value="MALAY">MALAY</option> <option value="CHINESE">CHINESE</option> <option value="INDIAN">INDIAN</option> <option value="BUMIPUTRA SABAH">BUMIPUTRA SABAH</option> <option value="BUMIPUTRA SARAWAK">BUMIPUTRA SARAWAK</option> <option value="OTHERS">OTHERS</option> </select>--> </font><font face="Verdana" size="2"> </font></td> <td align="left"> </td> <td> </td> <td> </td> </tr> <tr valign="top"> <td height="26" align="left"> </td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Marital status</font></font></td> <td><font face="Verdana" size="2">:</font></td> <td><font face="Verdana"> <option selected><?php echo $s_marital_status; ?></option> <!--<select name="marital_status" class="selectbox11" id="marital_status"> <option value="Single" selected="selected">Single</option> <option value="Married">Married</option> </select>--> </font><font face="Verdana" size="2"> </font></td> <td align="left"> </td> <td> </td> <td> </td> </tr> <tr valign="top"> <td height="26" align="left"> </td> <td height="26" align="left"><font face="Verdana" size="2"><font class="label">Hobbies</font></font></td> <td><font face="Verdana" size="2">:</font></td> <td><?php echo $s_hobbies; ?> </td> <td align="left"> </td> <td> </td> <td> </td> </tr> </table></td> </tr> </table> </div> </form>
  11. all.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $aa=0; $query = "SELECT mm.mentee, mm.username_mentee, mp.major ". "FROM mentormentee mm LEFT JOIN mentee_personal_details mp ". "ON mp.mentee_id = mm.username_mentee ". "WHERE mm.username_mentor = '$cur_login' AND mp.mentee_id = mm.username_mentee"; $result = $conn->query($query); ?> <?php while ($row = mysqli_fetch_assoc($result)){ $aa = $aa + 1; ?> <td><?php echo $aa ?> </td> <td><a href="view_profile.php?mentee=<?php echo $row['mentee']; ?>"><?php echo $row['mentee']; ?></a> </td> <td><?php echo $row['username_mentee']; ?> </td> <td><?php echo $row['major']; ?> </td> </tr><?php }?> view_profile.php <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $aa=0; $query = "SELECT mm.mentee, mm.username_mentee, mp.major ". "FROM mentormentee mm LEFT JOIN mentee_personal_details mp ". "ON mp.mentee_id = mm.username_mentee ". "WHERE mm.username_mentor = '$cur_login' AND mp.mentee_id = mm.username_mentee"; $result = $conn->query($query); $row = mysqli_fetch_assoc($result);{ $m_mentee = $row['mentee']; } $query1 = "SELECT * FROM mentee_personal_details where mentee_id = '$m_mentee'"; $result1 = $conn->query($query1); $row = mysqli_fetch_assoc($result1);{ $mentee_id = $row["mentee_id"]; $s_fullname = $row["fullname"]; $s_postal_address1 = $row["postal_address1"]; $s_postal_address2 = $row["postal_address2"]; $s_postal_address3 = $row["postal_address3"]; $s_postal_zip = $row["postal_zip"]; $s_post_telephone = $row["post_telephone"]; $s_degree = $row["degree"]; $s_major = $row["major"]; $s_race = $row["race"]; $s_marital_status = $row["marital_status"]; $s_hobbies = $row["hobbies"]; $s_permanent_address1 = $row["permanent_address1"]; $s_permanent_address2 = $row["permanent_address2"]; $s_permanent_address3 = $row["permanent_address3"]; $s_per_zip = $row["per_zip"]; $s_per_telephone = $row["per_telephone"]; } ?> <td><?php echo $mentee_id; ?><font face="Verdana" size="2"> </font></td> no errors but, the mentee_id its read "0"...wrong output.. plz help me
  12. i do like this. <td><a href="view_profile.php?mentee=<?php echo $row['mentee']; ?>"><?php echo $row['mentee']; ?></a> </td> view_profile.php what shall i do? like this? $result = mysql_query("SELECT * FROM mentee_personal_details where mentee_id = $row['mentee']");
  13. i want when we click on mentee name its open theirs profile...
  14. if my coding is like this...how to do the link? <?php require_once('include/session.php'); require_once('include/user_auth_fns.php'); require_once('include/db_fns.php'); $cur_login = $_SESSION["username"]; $conn= db_connect(); $aa=0; $query = "SELECT mm.mentee, mm.username_mentee, mp.major ". "FROM mentormentee mm LEFT JOIN mentee_personal_details mp ". "ON mp.mentee_id = mm.username_mentee ". "WHERE mm.username_mentor = '$cur_login' AND mp.mentee_id = mm.username_mentee"; $result = $conn->query($query); ?> <?php while ($row = mysqli_fetch_assoc($result)){ $aa = $aa + 1; ?> <td><?php echo $aa ?> </td> <td><?php echo $row['mentee']; ?> </td> <td><?php echo $row['username_mentee']; ?> </td> <td><?php echo $row['major']; ?> </td> </tr><?php }?>
×
×
  • 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.