Jenling
Members-
Posts
12 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Jenling's Achievements
Newbie (1/5)
0
Reputation
-
Can anyone tell me when this happen? the page keep show this error: "Warning: mail() [function.mail]: SMTP server response: 503 Incomplete envelope information in C:\xampp\xampp\htdocs\meetingRoom\adminNotify.php on line 32" What's wrong?? I hope dear all expert can help me with this problem. Thanks!! Here are my code: <?php require_once('connections/connect.php');?> <? session_start(); ?> <? $username=$_POST[hiddenusername]; $staffID=$_POST[hiddenstaffID]; //$staff=$_POST['staff']; $adminID=$_POST[hiddenadminID]; $Email=$_POST['Email']; $problem=$_POST['problem']; $admin=$_POST['admin']; //$username=$_POST['username']; $query= "Select username From booking "; $result=mysql_query($query, $connect) or die ("ERROR in query: $query" .mysql_error()); $row_Recordset=mysql_fetch_assoc($result); //echo $row_Recordset[username]; $query2= "Select Email,staffID,username From userdetails where username= '$row_Recordset[username]'"; $result2=mysql_query($query2, $connect) or die ("ERROR in query: $query2" .mysql_error()); $row_Recordset2=mysql_fetch_assoc($result2); $query3= "Select adminID From adminlogin "; $result3=mysql_query($query3, $connect) or die ("ERROR in query: $query3" .mysql_error()); $row_Recordset3=mysql_fetch_assoc($result3); mail( "$Email", "SKTM Online Booking System", "Staff ID: Matter: ", "From:webmaster@example.com" );?> <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>SKTM Online Booking System</title> <script language="JavaScript" src="gen_validatorv2.js" type="text/javascript"></script> </head> <body background="img/adminBG.jpg"> <table align="center" border="0" width="800" cellspacing="0" cellpadding="0"> <tr> <td rowspan="2" width="10%"> <img border="0" src="img/UMS.jpg" width="105" height="107" align="right"></td> <td width="89%" height="84"> <p align="center"><font face="Century Gothic" size="6" color="#CC0099"> SKTM Online Booking System</font></td> </tr> <tr> <td width="89%" bgcolor="#CC0099" height="15"> <font color="#FFFFFF">Welcome! You are currently log on as <? echo "$adminID";?> </font></font></td> </tr> <tr> <td colspan="2" bordercolor="#CC0099"> <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#CC0099"> <tr> <td> <p align="center"> </p> <p align="center"><font size="2" face="Verdana">To notify user regarding the booking, please click the 'send' button </font></p> <form name="myform" method="POST" action="adminNotify2.php"> <div align="center"> <table border="0" width="367" cellpadding="0"> <tr> <td bgcolor="#CC0099"> <p style="margin-top: 0; margin-bottom: 0"> <font color="#FFFFFF" face="Verdana" size="2"> Staff ID</font></td> <td width="270"> <input type="text" name="staffID" id="staffID"size="20" maxlength="5" value="<? echo $row_Recordset2[staffID] ?>"><p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="1"> </font></td> </tr> <tr> <td bgcolor="#CC0099"> <p style="margin-top: 0; margin-bottom: 0"> <font color="#FFFFFF" face="Verdana" size="2"> username </font></p> </td> <td width="270"> <input type="text" name="username" size="20" id="username" maxlength="30" value="<? echo $row_Recordset[username] ?>"> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="1"> </font></td> </tr> <tr> <td bgcolor="#CC0099"> <p style="margin-top: 0; margin-bottom: 0"> <font color="#FFFFFF" face="Verdana" size="2"> Email </font></td> <td width="270"> <input type="text" name="Email" value=" <? echo $row_Recordset[username] ?>@localhost "> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="1"> </font></td> </tr> <tr> <td bgcolor="#CC0099"> <p style="margin-top: 0; margin-bottom: 0"> <font color="#FFFFFF" face="Verdana" size="2"> Admin ID </font></p> </td> <td width="270"> <input type="text" name="adminID" size="20" id="adminID" maxlength="20" value="<? echo "$adminID";?>"> <p style="margin-top: 0; margin-bottom: 0"><font face="Verdana" size="1"> </font></td> </tr> <tr> <td bgcolor="#CC0099"> <p style="margin-top: 0; margin-bottom: 0"> <font color="#FFFFFF" face="Verdana" size="2"> Requested</font></p> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="2" color="#FFFFFF"> Statement</font></td> <td width="270"> <textarea rows="14" name="problem" cols="30">Your booking recently for meeting room has been confirmed</textarea></td> </tr> </table> </div> <p align="center"> <input type="submit" value="Send" name="submit" id="submit"> <input type="reset" value="Clear" name="reset" id="reset"></p> <input type="hidden" name="hiddenadminID" value="<? echo $row_Recordset3[adminID] ?>" /> </form> I think there's stg wrong with the variable i post. Can anyone check out for me and tell me as soon as possible?? Thanks!!!!
-
It still cant work...I wonder why. can u give me more idea? I want to display the particular column with array..
-
Dear expert, I want to use array to do the system. I want to get the query from database and use array to display the data. How can I do that? My code is as below: <? $sql="select MRname from meetingroom"; $resu = mysql_query($sql, $connect) or die('Error when running command<br>'.$sql); $num=@mysql_num_rows($resu); while($row_Recordset=mysql_fetch_array($resu, MYSQL_BOTH)){ $m=array($row_Recordset[MRname]); } $meeting = array($m);
-
Thanks for your help~~
-
Recently, I'm creating a booking system where user can view their bookings from a table. If the booking is confirmed, it will show with color image. However, if user book for 3 hours, that's mean the table will show 3 hours rowspan for the table. But my image now only can't do so...anyone can help me with this? Below is my code: if($cycle[$g] == 0) { $contents .= '<td class="concell"><a href="booking.php?&date='.$date[$g].'&startTimeHour='.$first_num.'&endTimeHour='.$sec_first_num.'&MRname='.$select.'&username='.$username.' "><img border="0" src="img/fairpink.gif" height="40" width="100"></a>'; $contents.= "</td>\n"; } elseif($begin == 1) { $contents .= "<td class=\"setcell\" rowspan=\"".$cycle[$g]."\">"; if($not_found) { if($s_result['status']==Pending) $contents .='<img border="0" src="img/green.gif" height="40" width="100" >'; elseif ($s_result['status']==Confirm) $contents .='<img border="0" src="img/orange.gif" height="40" width="100">'; $begin = 0; } }
-
Hello, thanks for your reply. How if the id I want to pass is depend on the user key in?how can i pass the value then? ???
-
Hello to all expert!I want to ask how to pass my variable to the next page by a link?How it works?Can someone help me? For example, I want to pass the value of id, day, month, year and start_time, end_time to another page, what can I do with this??? ???
-
Its me again! I want to ask if there is a way to loop the query in the database? Im building a booking system recently. I wanted to make a table to show all the status of occupied or available in the column of the table. However, I need to compare the startTime_of_booking,end_time_of_booking and the room in my database in order to show the value on the table. Can somebody help me with this? This is my code: <?php require_once('connections/connect.php'); session_start(); ?> <script type="text/javascript"> <!-- function redirect() { window.location = "index.php" } //--> </script> <? if(!session_is_registered(username)) { echo "<script type=\"text/javascript\">". "alert('Unauthorized access to this page. Please Log In');". "redirect()". "</script>"; } ?> <html> <head> <meta http-equiv="Content-Language\" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>SKTM Online Booking System</title> <script> <language="javascript" type="text/javascript"> function switchpage(select) { var index; for(index=0; index<select.options.length; index++) if(select.options[index].selected) { if(select.options[index].value!="") window.location.href=select.options[index].value; break; } } </script> <SCRIPT language=Javascript> function displayMenu(currentMenu) { var thisMenu = document.getElementById(currentMenu).style if (thisMenu.display == "block") { thisMenu.display = "none" } else { thisMenu.display = "block" } return false } </script> <style type="text/css"> <!-- .cornercell { text-align: center; border: 1px solid black; height: 20px; background-color: #DCDCDC; } .daycell { text-align: center; width: 12%; height: 20px; border-bottom: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; background-color: #DCDCDC; } .timecell { text-align: center; border-bottom: 1px solid black; border-right: 1px solid black; border-left: 1px solid black; background-color: #DCDCDC; width: 11%; height: 20px; } .concell { border-right: 1px solid black; border-bottom: 1px solid black; background-color: #F2F2F2; text-align: center; } .setcell { border-right: 1px solid black; border-bottom: 1px solid black; background-color: #EFEFEF; text-align: center; } --> </style> <body background="img/bg_bar.jpg"> <table align="center" border="0" width="989" cellspacing="0" cellpadding="0"> <tr> <td rowspan="2" width="10%"> <img border="0" src="img/UMS.jpg" width="107" height="108"></td> <td width="89%" height="84"> <p align="center"><font face="Century Gothic" size="6" color="#0099FF">SKTM Online Booking System</font></td> </tr> <tr> <td width="89%" bgcolor="#0099FF" height="15"><font face="Tw Cen MT"> <font color="#FFFFFF">Welcome! You are currently log on as <? echo "$username";?></font></font></td> </tr> <tr> <td colspan="2" bordercolor="#0099FF"> <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#0099FF"> <tr> <td valign="top" width="182" height="660"><p> </p> <? include "siteBar.php"; ?></td> <td valign="top" width=""> <table border="1" width="100%" height="38"> <tr> <? include "MRBar.php"; ?> </tr> </table> <table width= "100%" height="208" border="0"> <tr> <td width="77%" height="204" valign="top"> <h3>Meeting Room >> View Availability</h3> <form action="" method="post" name="form1" target="_self" id="form1"> <label> <div align="center" ><h3>Select a meeting room to view :<h3> </font> <select name="select"> <option value="Meeting Room 1">Meeting Room 1</option> <option value="Meeting Room 2">Meeting Room 2</option> <option value="Meeting Room 3">Meeting Room 3</option> <option value="Meeting Room 4">Meeting Room 4</option> <option value="Meeting Room 5">Meeting Room 5</option> <option value="Meeting Room 6">Meeting Room 6</option> <option value="Eksekutif">Eksekutive</option> <option value="Seminar Room">Seminar Room</option> </select> <input type="submit" name="Submit" value="Select" /> </form> <div align="center"><?php if($_POST[select]==$select1) { echo ("Meeting Room 1"); } else if ($_POST[select]==$select2) { echo ("Meeting Room 2");} else if ($_POST[select]==$select3) { echo ("Meeting Room 3");} else if ($_POST[select]==$select4) { echo ("Meeting Room 4");} else if ($_POST[select]==$select5) { echo ("Meeting Room 5");} else if ($_POST[select]==$select6) { echo ("Meeting Room 6");} else if ($_POST[select]==$select7) { echo ("Eksekutive");} else if ($_POST[select]==$select8) { echo ("Seminar Room");} $select=$_POST[select];?> <?php $start = 800; $stop = 2230; //$number_of_rooms = 7; $http = $_SERVER['PHP_SELF']; $week_days = array("Mon","Tue","Wed","Thur","Fri","Sat","Sun"); $result = array(); $cycle = array(); Function search_between($val, $arr) { $rtn = false; foreach($arr as $array) { if($array['startTime'] <= $val && $array['endTime'] > $val) { $rtn = $array; break; } } return $rtn; } Function get_last_monday($day,$month,$year) { $timestamp = mktime(0,0,0,$month,$day,$year); While(date('w',$timestamp) != 1) $timestamp -= 60*60*24; return $timestamp; } $day = $_GET['day']; $month = $_GET['month']; $year = $_GET['year']; if(empty($_GET['day'])) $day = date('d'); if(empty($_GET['month'])) $month = date('m'); if(empty($_GET['year'])) $year = date('Y'); $last_monday = get_last_monday($day,$month,$year); $forward['day'] = date("d", ($last_monday+(8*24*3600))); $forward['month'] = date("m", ($last_monday+(8*24*3600))); $forward['year'] = date("Y", ($last_monday+(8*24*3600))); $back['day'] = date("d", ($last_monday-(6*24*3600))); $back['month'] = date("m", ($last_monday-(6*24*3600))); $back['year'] = date("Y", ($last_monday-(6*24*3600))); if(isset($_POST['confi'])) // If 'jump to day' button has been pressed { // Error notifications if ($_POST['day'] > 31) die("Error! There can't be that many days in a month"); if ($_POST['month'] > 12) die("Error! There can't be that many months in a day"); if ($_POST['year'] < 2007) die("Error! You can't set a reservation event in the past"); } elseif(isset($_POST['confirm'])) { if ($_POST['day'] > 31) die("Virhe! Montakos päivää voi olla kuukaudessa..?"); if ($_POST['month'] > 12) die("Virhe! Montakos kuukautta olikaan vuodessa?"); if ($_POST['year'] < 2003) die("Virhe! Onko varaus kenties menneisyydessä?"); if ($_POST['hour'] > 24) die("Virhe! Montakos tuntia päivässä olikaan?"); if ($_POST['minute'] > 60) die("Virhe! Montakos niitä minuutteja olikaan?"); if ($_POST['hour2'] > 24) die("Virhe! Montakos tuntia päivässä olikaan?"); if ($_POST['minute2'] > 60) die("Virhe! Montakos niitä minuutteja olikaan?"); if ($_POST['hour'] > $_POST['hour2']) die("Virhe! Aloitustunti on suurempi kuin lopetustunti!"); $contents .= ' <table cellpadding="6" border="0" width="100%"> <tr> <td align="left"> Today Date: '.date("d.m.Y", $last_monday).' - '.date("d.m.Y", ($last_monday+6*24*3600)).'<br> <a href="MRview.php?day='.$back['day'].'&month='.$back['month'].'&year='.$back['year'].'">[Previous Day]</a> <a href="MRview.php?day='.date('d').'&month='.date('m').'&year='.date('Y').'">[This Day]</a> <a href="MRview.php?day='.$forward['day'].'&month='.$forward['month'].'&year='.$forward['year'].'">[Next Day]</a><br> </td> <td align="right"> <form method="get" action="MRview.php" style="margin: 0px;"> Jump To: <input type="text" size="2" value="'.$day.'" maxlength="2" name="day"> <b>.</b> <input type="text" size="2" value="'.$month.'" maxlength="2" name="month"> <b>.</b> <input type="text" size="4" value="'.$year.'" maxlength="4" name="year"> <input type="submit" value=">>"> </form> </td> </tr> </table> <table cellspacing="0" cellpadding="1" width="100%"> <tr> <td class="cornercell"> Time </td> '; for($f=0;$f<7;$f++) { $contents .= " <td class=\"daycell\"> ".$week_days[$f]." ".date("d.m.Y",$last_monday+($f*60*60*24))." </td>\n"; $set[$g] = 0; } $contents .= " </tr>\n"; for($i=$start; $i<$stop; $i=$i+50) { $contents .= " <tr>\n"; $first_num = substr($i, 0, -2); if(substr($i, -2) == 50) $last_num = '30'; else $last_num = '00'; if($last_num == 30) { $sec_last_num = '00'; $sec_first_num = $first_num+1; } else { $sec_last_num = '30'; $sec_first_num = $first_num; } $contents .= " <td class=\"timecell\">".$first_num.":".$last_num."-".$sec_first_num.":".$sec_last_num."</td>\n"; $query1 = "SELECT MRname FROM booking WHERE MRname='$select'"; $result1 = mysql_query($query1); $row=mysql_fetch_assoc($result1); do{ for($g=0; $g<7; $g++) { $seek_time = $g*24*60*60+$last_monday+($first_num*60*60+$last_num*60); $s_result = search_between($seek_time, $result); if(!$s_result) { $MRview = " "; $not_found = false; } else { $not_found = true; $MRname = stripslashes($s_result['MRname']); if($cycle[$g] == 0 && (($s_result['endTime'] - $s_result['startTime'])/60/30) >= 1) { $cycle[$g] = ($s_result['endTime'] - $s_result['startTime'])/60/30; $begin = 1; } } if($cycle[$g] == 0) { $contents .= " <td class=\"concell\"> </td>\n"; } elseif($begin == 1) { $contents .= " <td class=\"setcell\" rowspan=\"".$cycle[$g]."\">"; if($not_found) $contents .= '<a href="'.$http.'?act=poista&id='.$s_result['id'].'&day='.$day.'&month='.$month.'&year='.$year.'">[D]</a> '; $contents .= $MRname."</td>\n"; $begin = 0; } if($cycle[$g] > 0) { $cycle[$g]--; } } $contents .= " </tr>\n"; } while($row=mysql_fetch_assoc($result1)); /* $contents .= ' </table><br> <form action="'.$http.'?day='.$day.'&month='.$month.'&year='.$year.'" method="post" name="form"> <table border="0" cellpadding="3" cellspacing="0" width="98%"> <tr> <td valign="middle" align="left">Varattava aika</td> <td valign="middle" align="left"> <input type="text" size="2" value="'.$day.'" maxlength="2" name="day"> <b>.</b> <input type="text" size="2" value="'.$month.'" maxlength="2" name="month"> <b>.</b> <input type="text" size="4" value="'.$year.'" maxlength="4" name="year"> klo: <select name="hour" size="1"> '; for($r=substr($start, 0, -2); $r<=substr($stop, 0, -2); $r++) $contents .= ' <option value="'.$r.'">'.$r."</option>\n"; $contents .= ' </select> <b>:</b> <select name="minute" size="1"> <option value="00">00</option> <option value="30">30</option> </select> - <select name="hour2" size="1"> '; for($r=substr($start, 0, -2); $r<=substr($stop, 0, -2); $r++) $contents .= ' <option value="'.$r.'">'.$r."</option>\n"; */ $contents .= ' </table> </form> '; print $contents; ?> </table> </td> </tr> </td> </tr> </table> <table align="center" border="0" width="800" cellspacing="0" cellpadding="0"> <td rowspan="1" width="30%"> <p align="center" style="margin-top: 0; margin-bottom: 0"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <font size="2" face="Times New Roman">© </font> <font face="Lucida Console" size="2">UMS Copyright 2007. All Rights Reserved.</font></p> <p align="center" style="margin-top: 0; margin-bottom: 0"> </p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <font face="Lucida Console" size="2">University Malaysia Sabah</font></p> <p align="center" style="margin-top: 0; margin-bottom: 0"> <font face="Lucida Console" size="2">88450 Kota Kinabalu</font></p> </table></td> </body> </html>
-
Hello, Im building a booking system recently. The booking system is able to view the book the room and user is able to see if the room is available during the time. I know that the loop in half and hour range is something like this: for($i=$start; $i<$stop; $i=$i+50) { $contents .= " <tr>\n"; $first_num = substr($i, 0, -2); if(substr($i, -2) == 50) $last_num = '30'; else $last_num = '00'; if($last_num == 30) { $sec_last_num = '00'; $sec_first_num = $first_num+1; } else { $sec_last_num = '30'; $sec_first_num = $first_num; } $contents .= " <td class=\"timecell\">".$first_num.":".$last_num."-".$sec_first_num.":".$sec_last_num."</td>\n"; for($g=0; $g<7; $g++) { $seek_time = $g*24*60*60+$last_monday+($first_num*60*60+$last_num*60); $s_result = search_between($seek_time, $result); if(!$s_result) { $MRname = " "; $not_found = false; } else { $not_found = true; $MRname = stripslashes($s_result['MRname']); if($cycle[$g] == 0 && (($s_result['endTime'] - $s_result['startTime'])/60/30) >= 1) { $cycle[$g] = ($s_result['endTime'] - $s_result['startTime'])/60/30; $begin = 1; // Kerrotaan, että täytyy aloittaa solu } } However, i dont know how to loop it if I want the range to be in one hour range, for example, 0800-0900 and so on till 1700-1800. Can anyone help me with this? ???
-
actually, i wan the english version of the original coding to help me in my recent project. I hope someone can help me...
-
what do you mean?I not really understand...Can you explain in more details?
-
Hello, recently I'm working on the coding that is somehow look like the original coding of your link. Do you have english version of the original coding as I not really understand the words of the coding. Can you please help me?