Jump to content

aftabn10

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aftabn10's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ignace, silly question but just want to clarify whereabouts to add the code. I am guessing the function code would go towards the top and the buttons code more towards the following: //Here we start building the table heads echo "<table border=0 width=294>"; echo "<tr><th colspan=7> $title $year </th></tr>"; echo "<tr><td width=42>S</td><td width=42>M</td><td width=42>T</td><td width=42>W</td><td width=42>T</td><td width=42>F</td><td width=42>S</td></tr>"; Would that be correct?
  2. Thanks for your response ignace, really appreciate it. Will let you know how i get on. Thanks once again.
  3. Thanks to Angela Bradley, I have managed to get a script to display a monthly calendar. What I would like to know is how i could add a previous and next button to display other months of the calendar. The following is the script I have used: <?php //This gets today's date $date =time () ; //This puts the day, month, and year in seperate variables $day = date('d', $date) ; $month = date('m', $date) ; $year = date('Y', $date) ; //Here we generate the first day of the month $first_day = mktime(0,0,0,$month, 1, $year) ; //This gets us the month name $title = date('F', $first_day) ; //Here we find out what day of the week the first day of the month falls on $day_of_week = date('D', $first_day) ; //Once we know what day of the week it falls on, we know how many blank days occure before it. If the first day of the week is a Sunday then it would be zero switch($day_of_week){ case "Sun": $blank = 0; break; case "Mon": $blank = 1; break; case "Tue": $blank = 2; break; case "Wed": $blank = 3; break; case "Thu": $blank = 4; break; case "Fri": $blank = 5; break; case "Sat": $blank = 6; break; } //We then determine how many days are in the current month $days_in_month = cal_days_in_month(0, $month, $year) ; //Here we start building the table heads echo "<table border=0 width=294>"; echo "<tr><th colspan=7> $title $year </th></tr>"; echo "<tr><td width=42>S</td><td width=42>M</td><td width=42>T</td><td width=42>W</td><td width=42>T</td><td width=42>F</td><td width=42>S</td></tr>"; //This counts the days in the week, up to 7 $day_count = 1; echo "<tr>"; //first we take care of those blank days while ( $blank > 0 ) { echo "<td></td>"; $blank = $blank-1; $day_count++; } //sets the first day of the month to 1 $day_num = 1; //count up the days, untill we've done all of them in the month while ( $day_num <= $days_in_month ) { echo "<td> $day_num </td>"; $day_num++; $day_count++; //Make sure we start a new row every week if ($day_count > 7) { echo "</tr><tr>"; $day_count = 1; } } //Finaly we finish out the table with some blank details if needed while ( $day_count >1 && $day_count <=7 ) { echo "<td> </td>"; $day_count++; } echo "</tr></table>"; ?> Please could somebody help. Thanks in advance.
  4. First post here http://www.phpfreaks.com/forums/index.php/topic,246962.0.html but been told to try and ask on this board as TOPN is a MSSQL command. I have written the following query that returns the top 10 items from a column. I am looking to change this to give me the top 10 Percentage from the same column but dont know how to change my query. Could somebody please help. The following is my query: SELECT "TEST AHT By Agent".RootirID saw_0, "TEST RE Values Dim"."Queue Name" saw_1, "TEST AHT By Agent"."Agent ID" saw_2, "TEST AHT By Agent"."AHT -OM" saw_3 FROM Genesys_TEST WHERE ("TEST RE Values Dim"."Queue Name" LIKE 'Queue 1 ') AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) ORDER BY saw_0, saw_1, saw_2 Currently within my query I have the following: Code: [select]AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) which gives me the top 10 values within the TEST AHT By Agent column. What i would like is for it to give me the top 10% which would mean it gives me a total of 6 values as the total entries within the TEST AHT By Agent column is 56. Hope that makes sense. Thanks in advance.
  5. Yesideez, currently I am using SQL.
  6. Thanks for your reply Yesideez. Currently within my query I have the following: AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) which gives me the top 10 values within the TEST AHT By Agent column. What i would like is for it to give me the top 10% which would mean it gives me a total of 6 values as the total entries within the TEST AHT By Agent column is 56. Hope that makes sense. Thanks once again.
  7. I have written the following query that returns the top 10 items from a column. I am looking to change this to give me the top 10 Percentage from the same column but dont know how to change my query. Could somebody please help. The following is my query: SELECT "TEST AHT By Agent".RootirID saw_0, "TEST RE Values Dim"."Queue Name" saw_1, "TEST AHT By Agent"."Agent ID" saw_2, "TEST AHT By Agent"."AHT -OM" saw_3 FROM Genesys_TEST WHERE ("TEST RE Values Dim"."Queue Name" LIKE 'Queue 1 ') AND (TOPN("TEST AHT By Agent"."AHT -OM", 10) <= 10) ORDER BY saw_0, saw_1, saw_2 Thanks in advance.
  8. I have the following query, but i dont know how i can divide the values of saw_3 by saw_4. Could somebody please help? The following is my query at the moment, but i would like saw_3 to show me values that have been divided by saw_4. SELECT "TEST RE Values Dim"."Queue Name" saw_0, "TEST AHT By Agent"."Agent ID" saw_1, "TEST AHT By Agent"."Transaction Time" saw_2, "TEST AHT By Agent"."AHT -OM" saw_3, "TEST AHT By Agent"."Number Of OM" saw_4 FROM System_TEST WHERE "TEST RE Values Dim"."Queue Name" LIKE 'Queue 1' ORDER BY saw_0, saw_1 Thanks in advance.
  9. Thanks guys for your help. I will let you know how i get on.
  10. Hi, Does any1 know where I can get a tutorial or a guide as to how to create a Calendar that will allow me to select an availability i.e. Available, AM, PM, Not Available. Any ideas? Thanks in advance.
  11. Thanks jonsjava for your reply. The page shows up fine, but this page is accesible even though im not logged in. Im guessing this has something to do with the session? I have a forgotten password page which only works if a user is logged in so I need to be implement the same concept but need a blank template that i could save and reuse for whatever pages are required. This is the code for the forgotten password page: <?php # Script 13.10 - forgot_password.php // This page allows a user to reset their password, if forgotten. // Include the configuration file for error management and such. require_once ('./includes/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Forgot Your Password'; include ('./includes/header.html'); if (isset($_POST['submitted'])) { // Handle the form. require_once ('../mysql_connect.php'); // Connect to the database. if (empty($_POST['email'])) { // Validate the email address. $uid = FALSE; echo '<p><font color="red" size="+1">You forgot to enter your email address!</font></p>'; } else { // Check for the existence of that email address. $query = "SELECT user_id FROM users WHERE email='". escape_data($_POST['email']) . "'"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysql_num_rows($result) == 1) { // Retrieve the user ID. list($uid) = mysql_fetch_array ($result, MYSQL_NUM); } else { echo '<p><font color="red" size="+1">The submitted email address does not match those on file!</font></p>'; $uid = FALSE; } } if ($uid) { // If everything's OK. // Create a new, random password. $p = substr ( md5(uniqid(rand(),1)), 3, 10); // Make the query. $query = "UPDATE users SET pass=SHA('$p') WHERE user_id=$uid"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysql_affected_rows() == 1) { // If it ran OK. // Send an email. $body = "Your password to log into SITENAME has been temporarily changed to '$p'. Please log in using this password and your username. At that time you may change your password to something more familiar."; mail ($_POST['email'], 'Your temporary password.', $body, 'From: admin@sitename.com'); echo '<h3>Your password has been changed. You will receive the new, temporary password at the email address with which you registered. Once you have logged in with this password, you may change it by clicking on the "Change Password" link.</h3>'; mysql_close(); // Close the database connection. include ('./includes/footer.html'); // Include the HTML footer. exit(); } else { // If it did not run OK. echo '<p><font color="red" size="+1">Your password could not be changed due to a system error. We apologize for any inconvenience.</font></p>'; } } else { // Failed the validation test. echo '<p><font color="red" size="+1">Please try again.</font></p>'; } mysql_close(); // Close the database connection. } // End of the main Submit conditional. ?> <h1>Reset Your Password</h1> <p>Enter your email address below and your password will be reset.</p> <form action="forgot_password.php" method="post"> <fieldset> <p><b>Email Address:</b> <input type="text" name="email" size="20" maxlength="40" value="<?php if (isset($_POST['email'])) echo $_POST['email']; ?>" /></p> </fieldset> <div align="center"><input type="submit" name="submit" value="Reset My Password" /></div> <input type="hidden" name="submitted" value="TRUE" /> </form> <?php include ('./includes/footer.html'); ?> Thanks once again, really appreciate it.
  12. Thanks Timmah for your help. This is the full code I have ran and I get the following error: Parse error: syntax error, unexpected '{' in /....../...../.../.....php on line 3 <?php if(isset($_SESSION['first_name']) == FALSE { // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } ?> <p> Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary </p> <? mysql_close(); // Close the database connection. } // End of the main Submit conditional. ?> <?php include ('./includes/footer.html'); ?> Any ideas?
  13. Ok thanks to Larry Ullman and his PHP Book I have managed to write Login/Logout scripts. I am trying to create pages that will only be accesible when a user has logged in but no text shows up, the header and footer do show up tho. Where am i going wrong? The following is a script I have wrote: <?php # Script 13.11 - change_password.php // This page allows a logged-in user to change their password. // Include the configuration file for error management and such. require_once ('./includes/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Change Your Password'; include ('./includes/header.html'); // If no first_name variable exists, redirect the user. if (!isset($_SESSION['first_name'])) { // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } ob_end_clean(); // Delete the buffer. header("Location: $url"); exit(); // Quit the script. require_once ('../mysql_connect.php'); // Connect to the database. ?> <p> Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary Diary </p> <? mysql_close(); // Close the database connection. } // End of the main Submit conditional. ?> <?php include ('./includes/footer.html'); ?> Thanks in advance.
  14. Could somebody please help?
×
×
  • Create New...

Important Information

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