pop up message?
- nrsh_ram
- Novice


- Joined: Jan 23, 2008
- Posts: 30
- Loc: malaysia
- Status: Offline
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>
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
Code: [ Select ]
<?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>
- <?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>
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
February 8th, 2009, 9:59 pm
- Bogey
- Bogey


- Joined: Jul 14, 2005
- Posts: 8211
- Loc: USA
- Status: Offline
Try this... this is my first attempt at Javascript so... bare with me 
And the HTML for that would be
Well, the only problem with it (at least for me) is that it is opening the download box for the process... it doesn't actually go there and do the process
Maybe someone here would give an answer or solution as to how to fix that...
JAVASCRIPT Code: [ Select ]
function popup(text) {
if (confirm(text))
{
if(!document.form.submit())
{
alert('There was a problem submitting the form.');
}
}
else
{
// Do something here... like redirect user to some place
}
}
if (confirm(text))
{
if(!document.form.submit())
{
alert('There was a problem submitting the form.');
}
}
else
{
// Do something here... like redirect user to some place
}
}
- function popup(text) {
- if (confirm(text))
- {
- if(!document.form.submit())
- {
- alert('There was a problem submitting the form.');
- }
- }
- else
- {
- // Do something here... like redirect user to some place
- }
- }
And the HTML for that would be
HTML Code: [ Select ]
<form method="post" action="jscript_process.php" name="form" onSubmit="popup('Are you sure?');">
Some text: <input type="text" size="45" /><br />
<input type="submit" name="submit" value="Click Here">
</form>
Some text: <input type="text" size="45" /><br />
<input type="submit" name="submit" value="Click Here">
</form>
- <form method="post" action="jscript_process.php" name="form" onSubmit="popup('Are you sure?');">
- Some text: <input type="text" size="45" /><br />
- <input type="submit" name="submit" value="Click Here">
- </form>
Well, the only problem with it (at least for me) is that it is opening the download box for the process... it doesn't actually go there and do the process
Maybe someone here would give an answer or solution as to how to fix that...
"Bring forth therefore fruits meet for repentance:" Matthew 3:8
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 2 posts
- Users browsing this forum: No registered users and 120 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
