Jump to content

coalduststar

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Everything posted by coalduststar

  1. Thanks- that looks a lot more efficient than what I had in before with all those variables but it didn't really change anything- there aren't any errors but the database isn't updating and the email isn't going out. thanks for taking a look!
  2. Just to continue this monologue... - This no longer produces an error but it doesn't work either. What it's supposed to do is compare the current date to the date in the database and if the current date is equal to or excedes the stored date AND the value in the column page_emailyn is greater than "0", then I want the mailer to send an email to the page owner. Could someone point me in the direction of what i've done wrong- i think the insert a record stuff is wrong but I though the mailer would work at least ??? Please- i'm stumped! <?php require_once('../Connections/ownership.php'); ?> <?php ### current date ### $cur_date = date('Y-m-d'); ### Gets page name and stores it to variable ### $currentFile = $_SERVER["PHP_SELF"]; $parts = Explode('/', $currentFile); $page_name1 = $parts[count($parts) - 1]; ### Recordset filtered to page name ### mysql_select_db($database_ownership, $ownership); $query_owner = "SELECT * FROM arts_ownership_history Where page_name = '$page_name1'"; $owner = mysql_query($query_owner, $ownership) or die(mysql_error()); $row_owner = mysql_fetch_assoc($owner); $totalRows_owner = mysql_num_rows($owner); ### Mail function (if page is out of date?) ### $owner = $row_owner['page_owner_email']; $subject = "Page content expired?"; $text = "Please check the content of the following page- http://www.arts.ulster.ac.uk/".$row_owner['page_name']." as the information/content may be expired. The date set for review of this page was ".$row_owner['page_expdate'].". Please contact the designer responsible for this page (".$row_owner['page_author']."<".$row_owner['page_author_email'].">) to ensure that this page is not removed from the server- Thank You."; $author = $row_owner['page_author']; $email = $row_owner['page_author_email']; if($row_owner['page_expdate'] >= $cur_date && $row_owner['$page_emailyn'] > 0){ mail($owner,$subject,$text,"From: $author <$email>"); $row_owner['$emailyn'] = 1; $insertSQL = sprintf("INSERT INTO arts_ownership_history(page_emailyn) VALUES 1"); mysql_select_db($database_ownership, $ownership); $Result1 = mysql_query($insertSQL, $ownership) or die(mysql_error()); } ?>
  3. ### Mail function (if page is out of date?) ### if($row_owner['page_expdate'] >= $cur_date && $row_owner['$emailyn'] > 0){ mail($row_owner['page_owner_email'], $subject, $text, "From: $row_owner['page_author'] <$row_owner['page_author_email']>"); } Update- changed "strtotime($cur_date)" to "$cur_date" cos it didn't match the "DATE" data type inthe database- still the same error but now it's on the final line of the mail function which is essentially just a "}" no ideas? :-\
  4. Hi I'm trying to write up a script from scratch which will check a database to verify the lifespan of a page and then if the expiry date has been reached and/or exceded, it will email the page owner to warn of an impending deletion. This is probably terrible, inefficient code and if there are any other suggestions- i'll defo listen to them! But for now I keep getting this message when I load the page: Line 22 is the last one beginning "mail($..." I think I'm on the right track but I'm starting to make a bit of a balls of it... <?php ### email variables ### $cur_date = date('Y-m-d'); $subject = "Page content expired?"; $text = "Please check the content of the following page- http://www.coalduststar.com/".$row_owner['page_name']." as the information/content may be expired. The date set for review of this page was ".$expdate.". Please contact the designer responsible for this page (".$row_owner['page_name']."<".$row_owner['page_author_email'].">) to ensure that this page is not removed from the server- Thank You."; ### Gets page name and stores it to variable ### $currentFile = $_SERVER["PHP_SELF"]; $parts = Explode('/', $currentFile); $page_name1 = $parts[count($parts) - 1]; ### Recordset filtered to page name ### mysql_select_db($database_ownership, $ownership); $query_owner = "SELECT * FROM arts_ownership_history Where page_name = '$page_name1'"; $owner = mysql_query($query_owner, $ownership) or die(mysql_error()); $row_owner = mysql_fetch_assoc($owner); $totalRows_owner = mysql_num_rows($owner); ### Mail function (if page is out of date?) ### if($row_owner['page_expdate'] >= strtotime($cur_date) && $row_owner['$emailyn'] > 0){ mail($row_owner['page_owner_email'], $subject, $text, "From: $row_owner['page_author'] <$row_owner['page_author_email']>"); } ?> thanks
  5. i'm a dick by the way. i had my stylesheets listed like this: <link rel="stylesheet" type="text/css" media="screen" title="std" href="../css/newlayout_css.css" /> <link rel="alternate stylesheet" type="text/css" media="screen" title="bigtext" href="../css/newlayout_css_bigtext.css" /> <link rel="alternate stylesheet" type="text/css" media="screen" title="lexic" href="../css/newlayout_css_lexic.css" /> so it was just staying on the one sheet- i've changed it so that all my listed css is alternate stylesheets: <link rel="alternate stylesheet" type="text/css" media="screen" title="std" href="../css/newlayout_css.css" /> <link rel="alternate stylesheet" type="text/css" media="screen" title="bigtext" href="../css/newlayout_css_bigtext.css" /> <link rel="alternate stylesheet" type="text/css" media="screen" title="lexic" href="../css/newlayout_css_lexic.css" /> sorry if i wasted anyone's time
  6. Hi - i've read the other posts deal with this and tried to apply the solutions but they don't work and i'm ready to go schitzo so any help would be pretty good right now I was using the ALA php style switcher but that was an abject disaster: http://www.alistapart.com/articles/phpswitch/ and now i'm trying to implement this one http://gr0w.com/articles/code/css_stylesheet_switcher_using_php_javascript_free/. Suffice to say I feel like an ass but i remember reading on previous posts that there could be a problem with using localhost which is what i'm using- please advise. OK- so i have an include that calls an array for the style sheets: <? $styleSheets = array(); // DEFINE STYLESHEETS $styleSheets[0]["text"]='std'; $styleSheets[0]["title"]='std'; $styleSheets[0]["sheet"]='<link href="../css/newlayout_css.css" rel="stylesheet" type="text/css" />'; $styleSheets[1]["text"]='big'; $styleSheets[1]["title"]='bigtext'; $styleSheets[1]["sheet"]='<link href="../css/newlayout_css_bigtext.css" rel="stylesheet" type="text/css" />'; // DEFAULT STYLESHEET $defaultStyleSheet=0; // SET STYLESHEET if(!isset($_COOKIE["STYLE"])){ if(isset($_SESSION["STYLE"])){ echo $styleSheets[$_SESSION["STYLE"]]["sheet"]; }else{ echo $styleSheets[$defaultStyleSheet]["sheet"]; } }else{ echo $styleSheets[$_COOKIE["STYLE"]]["sheet"]; } ?> And here's the code for the cookie: <? // SET COOKIE FOR 1 YEAR if(isset($_REQUEST["SETSTYLE"])){ if(setcookie("testcookie",true)){ setcookie("STYLE",$_REQUEST["SETSTYLE"],time()+31622400, "/"); }else{ $_SESSION["STYLE"]=$_REQUEST["SETSTYLE"]; } } // RETURN TO CALLER PAGE header("Location: ".$_SERVER["HTTP_REFERER"]); ?> Do I need to put in the domain or anything in here or is it ok to leave "testcookie" as a name? And finally the link, calling the switcher: <? // WRITE OUT SWITCHER LINKS while(list($key, $val) = each($styleSheets)){ echo "<a href='styleswitcher.php?SETSTYLE=".$key."' title='".$val["title"]."'>".$val["text"]."</a>"; } ?> Have I not defined something? I'm a php butcher basically, I try and pick it up as I go along and am relatively competent in doing simple stuff like getting data out of tables for web sites as I'm a web/graphic designer but this has pissed me right off- both tutorials I've looked at seem simple and easy to implement- could someone let me know what i've screwed up?
  7. Thanks, that explains things a bit better- i have a neuron or two firing at some kind of vague recollection of this! So when you're querying that table it will be able to access all that other information, just by having those foreign keys? What I mean is, will that table allow me to access and amend those other tables or is that just for displaying data?
  8. ok- not meaning to sound ignorant here but how would you do that? I always thought the tables had to be linked with foreign keys. Of course I probably wasn't paying attention because I'm a bit lost. So i make a 4th table which combines all the data? Does that affect the databases's referential integrity? I've really only ever used mySQL to make databases that are just like temporary data storage or for dynamic content on a website. Apologies, i'm a total idiot when it comes to this.
  9. Hi, i'm looking if someone can point me in the right direction. I have done database design as part of my course at university and am familiar with most of the terminology but i'm not particularly rational or logical so I can't really progress this schema from what I have with out someone having a look at it. Basically, there's a charity and they send officers to run programs (set of activities) at schools. The database needs officer info, school info and of course program info. Each program runs for a period of time and can be running at more than one school so i think my tables wil be (i think): School, school_ID name program_ID address post_code etc... Program, program_ID officer_ID school_ID name manager date_start date_fin activities comments etc... Officer, officer_ID name etc.. This would be fine if the a program couldn't occur in multiple schools over a period of time. I'm not sure how to proceed from here cos that would mean a program could have multiple school_IDs or that duplicate program_IDs should be allowed. Does this not stuff up the data structure? Hopefully i'm not showing my ignorance up too much but the time for pride has passed!! Any help would be awesome- thanks in advance.
  10. aw man- can't believe it- named it wrong! sometimes it takes another pair of eyes- thanks! ;D
  11. hi- i have been using dreamweaver to create an administration section for my website (as it's really handy). Basically you log in and can, add, remove, edit records which is fine. for deleting records: [list] [*]i have one page that lists all the record's titles next to a radio button. [*]you click a radio button and then submit the form [*]now it should go to a page that displays the record in question, at which point the user can read the record and continue to delete should he/she desire [/list] Instead it just deletes the record anyway without getting the information and displaying it on a second page. How do i get it to wait until the user clicks submit before executing the delete? thats the form on the first page: [code] <div id="admin">   <?php do { ?>     <form action="delnews2.php" method="get" name="delnews">         <p>           <input name="ev_id" type="radio" value="<?php echo $row_delnews1['ev_id']; ?>" />           <?php echo $row_delnews1['ev_title']; ?> <span class="forthcoming">[<?php echo $row_delnews1['ev_date']; ?>]</span>         <hr />         </p><?php } while ($row_delnews1 = mysql_fetch_assoc($delnews1)); ?>       <input name="" type="submit" value="select" />         </form>     </div> <!-- InstanceEndEditable --></div> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($delnews1); ?>[/code] and this is the second page's rescordset and form: [code]<?php require_once('../Connections/contacts.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;   switch ($theType) {     case "text":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;        case "long":     case "int":       $theValue = ($theValue != "") ? intval($theValue) : "NULL";       break;     case "double":       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";       break;     case "date":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;     case "defined":       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;       break;   }   return $theValue; } if ((isset($_GET['ev_id'])) && ($_GET['ev_id'] != "")) {   $deleteSQL = sprintf("DELETE FROM events WHERE ev_id=%s",                       GetSQLValueString($_GET['ev_id'], "int"));   mysql_select_db($database_contacts, $contacts);   $Result1 = mysql_query($deleteSQL, $contacts) or die(mysql_error());   $deleteGoTo = "index.php";   if (isset($_SERVER['QUERY_STRING'])) {     $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";     $deleteGoTo .= $_SERVER['QUERY_STRING'];   }   header(sprintf("Location: %s", $deleteGoTo)); } $colname_delnews2 = "-1"; if (isset($_GET['ev_id'])) {   $colname_delnews2 = (get_magic_quotes_gpc()) ? $_GET['ev_id'] : addslashes($_GET['ev_id']); } mysql_select_db($database_contacts, $contacts); $query_delnews2 = sprintf("SELECT * FROM events WHERE ev_id = %s", $colname_delnews2); $delnews2 = mysql_query($query_delnews2, $contacts) or die(mysql_error()); $row_delnews2 = mysql_fetch_assoc($delnews2); $totalRows_delnews2 = mysql_num_rows($delnews2); ?>[/code] [code] <div id="admin"> <form action="" method="post" name="delnews">         <p>           <input name="ev_id" type="hidden" value="<?php echo $row_delnews2['ev_id']; ?>" />           <?php echo $row_delnews2['ev_title']; ?> <span class="forthcoming">[<?php echo $row_delnews2['ev_date']; ?>]</span>   <p> <?php echo $row_delnews2['ev_desc']; ?></p>                 </p>       <input name="" type="submit" value="select" />     </form>   </div> <!-- InstanceEndEditable --></div> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($delnews2); ?>[/code]
  12. Instant migraine!  :D I'm gonna try and digest this- thanks for the pointer. Not sure what the array's for...
  13. cheers for the replies. I don't think i can use strip_tags or preg_replace function because i want to keep the HTML for formatting purposes but I'm trying to get my string replace to only insert the <span> tags on the text. I'm not particularly any good at this but like- If there's "<...>" then don't use the str_replace. i have something similar to this at the minute: [code]str_replace($SearchString, "<strong>$SearchString</strong>" ,$row_rsSearchResults['title_art'])[/code] but say the user only inputs "h" in the search box- the results are emboldened so a if there's a link in the database it ends up looking like this: [code]< a <strong>h</strong>ref="<strong>h</strong>ttp://www.deftones.com">link></a>[/code] If i use strip_tags it'll pull all the formatting in the results and i think maybe the same with preg_replace - unless i'm thinking of how to use them incorrectly... which is entirely likely.
  14. i was wondering how i'd go about getting a string replace to ignore anything between angle brackets? i have an SQL search that highlights the search string using a <span></span> tag but i need it to ignore any existing HTML otherwise i get all of the link and formatting code displayed. any ideas? ???
  15. i'm using dreamweaver to set up some admin pages for a site that i'm doing. I'm currently doing a page that lists the news items in the database next to radiobuttons that carry the news item ID. The form on that page then submits to a second page which is supposed to display the values from the selected article for editting. For some reason the articles won't display and as far as i can see i've named everything correctly. I don't think it's a permission problem or anything because displaying records done from that same database in other sections of the site- please help! [b]This is editevent.php[/b] [code]<?php require_once('../Connections/contacts.php'); ?> <?php mysql_select_db($database_contacts, $contacts); $query_editnews = "SELECT * FROM events ORDER BY ev_id DESC"; $editnews = mysql_query($query_editnews, $contacts) or die(mysql_error()); $row_editnews = mysql_fetch_assoc($editnews); $totalRows_editnews = mysql_num_rows($editnews); ?>.... <div id="admin">     <h4>Please select an item to edit...</h4> <form action="editevent2.php" method="GET" name="editnews">   <?php do { ?>     <p><input name="ev_ID" type="radio" value="<?php echo $row_editnews['ev_id']; ?>" /><?php echo $row_editnews['ev_title']; ?><hr />     </p>     <?php } while ($row_editnews = mysql_fetch_assoc($editnews)); ?>   <input name="" type="submit" value="display" /> </form> </div>... <?php mysql_free_result($editnews); ?> [/code] [b]which submits to this page:[/b] [code] <?php require_once('../Connections/contacts.php'); ?> <?php mysql_select_db($database_contacts, $contacts); $query_editnews = "SELECT * FROM events ORDER BY ev_id DESC"; $editnews = mysql_query($query_editnews, $contacts) or die(mysql_error()); $row_editnews = mysql_fetch_assoc($editnews); $totalRows_editnews = mysql_num_rows($editnews); ?>... <div id="admin">   <h4>Make the changes...</h4>   <table width="450px"> <form action="<?php echo $editFormAction; ?>" name="addnews" method="POST"> <tr><td align="left">Event Title:</td> <td><input name="ev_title" type="text" value="<?php echo $row_addnews['ev_title']; ?>" /></td></tr> <tr><td align="left">Event Date:</td> <td><input name="ev_date" type="text" id="ev_date" value="<?php echo $row_addnews['ev_date']; ?>" /> <img src="calendar.gif" width="16" height="16" onclick="showChooser(this, 'ev_date', 'chooserSpan', 1950, 2010, 'Y-m-d', false);"> <div id="chooserSpan" class="dateChooser select-free" style="display: none; visibility: hidden; width: 160px;"></div> </td></tr> <tr><td align="left">Event Time:</td> <td><input name="ev_time" type="text" value="<?php echo $row_addnews['ev_time']; ?>" /></td></tr> <tr><td align="left">Event Venue:</td> <td><input name="ev_venue" type="text" value="<?php echo $row_addnews['ev_venue']; ?>" /></td></tr> <tr><td colspan="2"> <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " onclick="bbstyle(0)"  /> <input type="button" class="button" accesskey="i" name="addbbcode2" value=" <h1> " onclick="bbstyle(2)" /> <input type="button" class="button" accesskey="u" name="addbbcode4" value=" <h3> " onclick="bbstyle(4)" /> <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" onClick="bbstyle(14)" /> <input type="button" class="button" accesskey="w" name="addbbcode16" value="Link" onclick="bbstyle(16)" /> <select name="addbbcode18" onchange="bbfontstyle('<span style=color:' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ';>', '</span>');this.selectedIndex=0;"> <option style="color:black; background-color: #" value="#">colour</option> <option style="color:darkred; background-color: #" value="darkred">Dark Red</option> <option style="color:red; background-color: #" value="red">Red</option> <option style="color:orange; background-color: #" value="orange">Orange</option> <option style="color:brown; background-color: #" value="brown">Brown</option> <option style="color:yellow; background-color: #" value="yellow">Yellow</option> <option style="color:green; background-color: #" value="green">Green</option> <option style="color:olive; background-color: #" value="olive">Olive</option> <option style="color:cyan; background-color: #" value="cyan">Cyan</option> <option style="color:blue; background-color: #" value="blue">Blue</option> <option style="color:darkblue; background-color: #" value="darkblue">Dark Blue</option> <option style="color:indigo; background-color: #" value="indigo">Indigo</option> <option style="color:violet; background-color: #" value="violet">Violet</option> <option style="color:white; background-color: #" value="white">White</option> <option style="color:black; background-color: #" value="black">Black</option> </select> <select name="addbbcode20" onchange="bbfontstyle('<span style=font-size:' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ';>', '</span>')"> <option value="7" class="genblack">Tiny</option> <option value="9" class="genblack">Small</option> <option value="12" selected class="genblack">size</option> <option value="18" class="genblack">Large</option> <option  value="24" class="genblack">Huge</option> </select> <a href="javascript:bbstyle(-1)">Close Tags</a> </td></tr> <tr><td align="left">Event Description:</td> <td><textarea name="ev_desc" cols="40" rows="10" wrap="virtual" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"><?php echo $row_addnews['ev_desc']; ?></textarea></td></tr> <tr>   <td colspan="2"><input name="ev_id" type="hidden" value="<?php echo $row_addnews['ev_id']; ?>" /></td> </tr> <tr><td colspan="2" align="center"><input name="" type="submit" value="edit"/></td></tr> <input type="hidden" name="MM_update" value="addnews"> </form> </table> </div>... <?php mysql_free_result($addnews); ?>[/code]
  16. brilliant- this helped me out too! was trying to format just a TIME and DATE separately- THANKS!  ;D
  17. Hi - I have an SQL database with separate fields for time and date stored as time and date datatypes. when I'm pullilng these values out of the database I want to format the date to: dd-mm-yyyy and I want the time to read without the seconds in 12 hour format: hh:ii am/pm. I can get the current time displayed easily enough but I can't seem to be able to format a stored time: [code]         <?php $cream = $row_rsEventsByDate['ev_time'];   echo $cream = date('g:i a'); ?> [/code] **it's ok I did some extensive looking through all the stuff on the forum and found an article eventually thanks!**
  18. I have this form to do a booking for a taxi, to or from an airport. I have a similar form elsewhere in the site with more or less identical update code (i used server behaviours in dreamweaver then modified the code) and that one works correctly. If i leave in the validation funtion it acts as if there have been no values put into the form and if i remove it, the browser says this : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ':10:00, 'Belfast International Airport', 'eaz345', 'executive', I tried debugging the SQL but i probably got that wrong as there was no result when i tried to get the $insertSQL to print- i would appreciate any and all advice! Thanks [code] <?php require_once('../Connections/connEcabs.php'); ?> <?php session_start(); $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {   // For security, start by assuming the visitor is NOT authorized.   $isValid = False;   // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.   // Therefore, we know that a user is NOT logged in if that Session variable is blank.   if (!empty($UserName)) {     // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.     // Parse the strings into arrays.     $arrUsers = Explode(",", $strUsers);     $arrGroups = Explode(",", $strGroups);     if (in_array($UserName, $arrUsers)) {       $isValid = true;     }     // Or, you may restrict access to only certain users based on their username.     if (in_array($UserGroup, $arrGroups)) {       $isValid = true;     }     if (($strUsers == "") && true) {       $isValid = true;     }   }   return $isValid; } $MM_restrictGoTo = "corp_login.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {     $MM_qsChar = "?";   $MM_referrer = $_SERVER['PHP_SELF'];   if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";   if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)   $MM_referrer .= "?" . $QUERY_STRING;   $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);   header("Location: ". $MM_restrictGoTo);   exit; } ?> <?php include "corpairvalidate.php"; function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;   switch ($theType) {     case "text":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;         case "long":     case "int":       $theValue = ($theValue != "") ? intval($theValue) : "NULL";       break;     case "double":       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";       break;     case "date":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;     case "defined":       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;       break;   }   return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) {   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "book") && $_REQUEST['direction'] == "to" && php_validate()) {   $insertSQL = sprintf("INSERT INTO corporate (corp_name, corp_phone, corp_email, corp_pickup_house_no, corp_pickup_add1, corp_pickup_add2, corp_pickup_post_code, corp_dest_add1, corp_people, corp_date, corp_time, corp_airport, corp_flight_no, corp_car_type, corp_wheelchair, corp_info, corp_journey_type, corp_auth) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",                        GetSQLValueString($_POST['corp_name'], "text"),                        GetSQLValueString($_POST['corp_phone'], "text"),                        GetSQLValueString($_POST['corp_email'], "text"),                        GetSQLValueString($_POST['corp_pickup_house_no'], "int"),                        GetSQLValueString($_POST['corp_pickup_add1'], "text"),                        GetSQLValueString($_POST['corp_pickup_add2'], "text"),                        GetSQLValueString($_POST['corp_pickup_post_code'], "text"),                        GetSQLValueString($_POST['corp_airport'], "text"),                        GetSQLValueString($_POST['corp_people'], "int"),                        GetSQLValueString($_POST['year']  . "-" .  $_POST['month'] . "-" .  $_POST['day'], "date"),                        GetSQLValueString($_POST['hours'] . ":" . $_POST['mins'] . ":00", "time"),                        GetSQLValueString($_POST['corp_airport'], "text"),                        GetSQLValueString($_POST['corp_flight_no'], "text"),                        GetSQLValueString($_POST['corp_car_type'], "text"),                        GetSQLValueString(isset($_POST['corp_wheelchair']) ? "true" : "", "defined","1","0"),                        GetSQLValueString($_POST['corp_info'], "text"),                        GetSQLValueString($_POST['corp_journey_type'], "text"),                        GetSQLValueString($_POST['corp_auth'], "text"));          exit;   mysql_select_db($database_connEcabs, $connEcabs);   $Result1 = mysql_query($insertSQL, $connEcabs) or die(mysql_error());   $insertGoTo = "thanks.php";   if (isset($_SERVER['QUERY_STRING'])) {     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";     $insertGoTo .= $_SERVER['QUERY_STRING'];   }   header(sprintf("Location: %s", $insertGoTo)); } else{ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "book") && $_REQUEST['direction'] == "from" && php_validate()) {   $insertSQL = sprintf("INSERT INTO corporate (corp_name, corp_phone, corp_email, corp_pickup_add1, corp_dest_house_no, corp_dest_add1, corp_dest_add2, corp_dest_post_code, corp_people, corp_date, corp_time, corp_airport, corp_flight_no, corp_car_type, corp_wheelchair, corp_info, corp_journey_type, corp_auth) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",                        GetSQLValueString($_POST['corp_name'], "text"),                        GetSQLValueString($_POST['corp_phone'], "text"),                        GetSQLValueString($_POST['corp_email'], "text"),                        GetSQLValueString($_POST['corp_airport'], "text"),                        GetSQLValueString($_POST['corp_dest_house_no'], "int"),                        GetSQLValueString($_POST['corp_dest_add1'], "text"),                        GetSQLValueString($_POST['corp_dest_add2'], "text"),                        GetSQLValueString($_POST['corp_dest_post_code'], "text"),                        GetSQLValueString($_POST['corp_people'], "int"),                        GetSQLValueString($_POST['year']  . "-" .  $_POST['month'] . "-" .  $_POST['day'], "date"),                        GetSQLValueString($_POST['hours'] . ":" . $_POST['mins'] . ":00", "time"),                        GetSQLValueString($_POST['corp_airport'], "text"),                        GetSQLValueString($_POST['corp_flight_no'], "text"),                        GetSQLValueString($_POST['corp_car_type'], "text"),                        GetSQLValueString(isset($_POST['corp_wheelchair']) ? "true" : "", "defined","1","0"),                        GetSQLValueString($_POST['corp_info'], "text"),                        GetSQLValueString($_POST['corp_journey_type'], "text"),                        GetSQLValueString($_POST['corp_auth'], "text"));             mysql_select_db($database_connEcabs, $connEcabs);   $Result1 = mysql_query($insertSQL, $connEcabs) or die(mysql_error());   $insertGoTo = "thanks.php";   if (isset($_SERVER['QUERY_STRING'])) {     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";     $insertGoTo .= $_SERVER['QUERY_STRING'];   }   header(sprintf("Location: %s", $insertGoTo)); } } $colname_corp_details = "1"; if (isset($_POST['login_name'])) {   $colname_corp_details = (get_magic_quotes_gpc()) ? $_POST['login_name'] : addslashes($_POST['login_name']); } mysql_select_db($database_connEcabs, $connEcabs); $query_corp_details = sprintf("SELECT * FROM login WHERE login_name = '$MM_Username'", $colname_corp_details); $corp_details = mysql_query($query_corp_details, $connEcabs) or die(mysql_error()); $row_corp_details = mysql_fetch_assoc($corp_details); $totalRows_corp_details = mysql_num_rows($corp_details); ?> <html> <head> <title>Book an e-CAB Online!</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="description" content="e-CABs Northern Ireland taxi company with online booking facility and corporate account facilities."> <meta name="keywords" content="taxi, airport, travel, e-CAB, eddie, tucker, northern, ireland, cab"> <link rel="stylesheet" type="text/css" href="ecabs.css" /> <!--  <script language='javascript' type='text/javascript' src='validate.js'></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> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/slice9-about_09.gif','images/slice10-service_10.gif','images/slice12-book_12.gif','images/slice14-contact_14.gif','images/almost2_13.gif','images/almost2_14.gif','images/almost2_16.gif','images/almost2_15.gif')"> <!-- Header table begin --> <table id="header" width="821" border="0" cellpadding="0" cellspacing="0">     <tr>         <td>             <img src="images/index_01.gif" width="820" height="50" alt=""></td>         <td>             <img src="images/spacer.gif" width="1" height="50" alt=""></td>     </tr>     <tr>         <td>            <img src="images/index_02.gif" width="820" height="135" alt=""></td>         <td>             <img src="images/spacer.gif" width="1" height="135" alt=""></td>     </tr>     <tr>         <td>             <img src="images/index_03.gif" width="820" height="48" alt=""></td>         <td>             <img src="images/spacer.gif" width="1" height="48" alt=""></td>     </tr>     <tr>         <td>             <img src="images/index_04.gif" width="820" height="36" alt=""></td>   </tr> </table>                          <!-- End of header table -->              <table id="middle" width="821" border="0" cellpadding="0" cellspacing="0">             <tr>             <td valign="top">             <!-- Navigation table begin -->                                        <table id="navigation" width="280" border="0" cellpadding="0" cellspacing="0">                  <tr>                  <td colspan="2" align="right">             <img src="images/index_06.gif" width="169" height="30" alt=""></td>                                    </tr>     <tr>         <td><a href="index.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','images/slice9-about_09.gif',1)"><img src="images/index_09.gif" alt="e-cabs home page" name="about" width="280" height="28" border="0"></a></td>              </tr>          <tr>         <td><a href="service.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('service','','images/slice10-service_10.gif',1)"><img src="images/index_10.gif" alt="a description of our services" name="service" width="280" height="29" border="0"></a></td>     </tr>              <tr>         <td><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('book','','images/slice12-book_12.gif',1)"><img src="images/index_12.gif" alt="book a taxi online!" name="book" width="280" height="29" border="0"></a></td>              </tr>     <tr>         <td><a href="contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact','','images/slice14-contact_14.gif',1)"><img src="images/index_14.gif" alt="contact us" name="contact" width="280" height="29" border="0"></a></td>              </tr>     <tr>         <td colspan="2" class="navback"></td>              </tr>     <tr>                  <td colspan="2" align="right">             <img src="images/index_17.gif" width="169" height="30" alt=""></td>     </tr> </table>          </td>          <!-- End navigation -->          <!-- content table begin -->     <td valign="top">               <table id="content" width="541" border="0" cellpadding="0" cellspacing="0">          <tr>       <td><img src="images/slice7-booktitle_07.gif" width="495" height="58"></td>              </tr>          <tr>         <td class="contentback">         <p> <table border="0" cellpadding="0" cellspacing="0" align="center">         <tr>             <td align="left">                 <img src="images/bookingbtns_12.gif" width="42" height="75">             </td>             <td align="left">                <a href="book.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('one way','','images/almost2_15.gif',1)"><img src="images/bookingbtns_15.gif" alt="Book a one way journey!" name="one way" width="61" height="75" border="0"></a> </td>             <td align="left">                 <a href="bookreturn.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('return','','images/almost2_14.gif',1)"><img src="images/bookingbtns_14.gif" alt="Book a return journey!" name="return" width="51" height="75" border="0"></a>            </td>             <td align="left">                <a href="bookairport.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('airport','','images/almost2_13.gif',1)"><img src="images/bookingbtns_13.gif" alt="Book an airport run!" name="airport" width="63" height="75" border="0"></a> </td>             <td align="left">                 <a href="bookcorp.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('corp','','images/almost2_16.gif',1)"><img src="images/bookingbtns_16.gif" alt="Book a corporate journey!" name="corp" width="65" height="75" border="0"></a>            </td>             <td align="left">                 <img src="images/bookingbtns_17.gif" width="51" height="75">             </td>     </tr> </table>         </p>                  <p>Fill out the form below to book a taxi online. Please ensure all the required fields are filled out.</p>         <p>Please note that bookings MUST be made 24 hours in advance and are only confirmed once you have received an email confirming the details. </p>                           <form name="book" action="<?php echo $editFormAction; ?>" method="POST"  class="form" onSubmit="return jsvalidate(this)">         <table width="350" border="0" cellspacing="0" cellpadding="0">         <tr>       <td colspan="2"><h3>Journey Type</h3></td>   </tr>   <tr>       <td colspan="2" align="center"><select name="corp_journey_type">                     <option value="one way" onclick="document.location='bookcorp.php';">one way</option>                     <option value="return" onclick="document.location='bookcorpreturn.php';">return</option>                     <option selected value="airport" onclick="document.location='bookcorpairport.php';">airport</option>     </select>     </td>   </tr>           <tr>       <td colspan="2"><h3>Customer Details</h3></td>   </tr>   <tr>     <td width="133" align="right">Acc No.</td>     <td width="217" align="left" class="form"><input name="acc_no" type="text" value="<?php echo $row_corp_details['acc_no']; ?>" size="20" disabled></td>   </tr>   <tr>     <td align="right">Name</td>     <td align="left" class="form"><input name="corp_name" type="text" value="<?php echo $row_corp_details['login_name']; ?>" size="20"></td>   </tr>   <tr>     <td align="right">Telephone</td>     <td align="left" class="form"><input name="corp_phone" type="text" id="homphon" value="<?php echo $row_corp_details['login_tel']; ?>" size="20"></td>   </tr>   <tr>     <td align="right">Email Address</td>     <td align="left" class="form"><input name="corp_email" type="text" id="email" size="20"></td>   </tr>   <tr>       <td colspan="2"><h3>Aiport</h3></td>   </tr>           <tr>       <td align="right" class="form">To Airport         <input name="direction" type="radio" value="to" checked></td>     <td align="left" class="form"><input name="direction" type="radio" value="from">From Airport</td>   </tr>   <tr>     <td align="right">Airport</td>     <td align="left" class="form"><select name="corp_airport" id="airportarrive">       <option value="Belfast International Airport" selected>Belfast International Airport</option>       <option value="Belfast City Airport">Belfast City Airport</option>       <option value="City of Derry Airport">City of Derry Airport</option>       <option value="Saint Angelo (Enniskillen) Airport">Saint Angelo (Enniskillen) Airport</option>                   </select>      </tr>          <tr>     <td align="right">Flight No.</td>     <td align="left" class="form"><input name="corp_flight_no" id="flight_no" type="text" maxlength="10" size="10"></td>   </tr>         <tr>       <td colspan="2"><h3>Journey: Pickup/Destination </h3></td>   </tr>   <tr>     <td align="right">House No.</td>     <td align="left" class="form"><input name="corp_pickup_house_no" id="corp_pickup_house_no" type="text" maxlength="5" size="5"></td>   </tr>   <tr>     <td align="right">Street</td>     <td align="left" class="form"><input name="corp_pickup_add1" id="corp_pickup_add1" type="text" maxlength="30" size="20"></td>   </tr>     <tr>     <td align="right">City/Town</td>     <td align="left" class="form"><input name="corp_pickup_add2" id="corp_pickup_add2" type="text" maxlength="30" size="20"></td>   </tr>     <tr>     <td align="right">Postal Code</td>     <td align="left" class="form"><input name="corp_pickup_post_code" id="corp_pickup_post_code" type="text" maxlength="7" size="7"></td>   </tr>              <tr>       <td colspan="2"><h3>Times and Details</h3></td>   </tr>      <tr>   <td align="right">Car Type</td>   <td align="left" class="form"><select name="corp_car_type" id="corp_car_type">           <option selected value="standard">standard</option>         <option value="executive">executive</option>         </select>   </td>   </tr>      <tr>     <td align="right">Number of Passengers</td>     <td align="left" class="form">     <select name="corp_people" id="corp_people">       <option value="01" selected>1</option>       <option value="02">2</option>       <option value="03">3</option>       <option value="04">4</option>       <option value="05">5</option>       <option value="06">6</option>       <option value="07">7</option>       <option value="08">8</option>       <option value="09">9</option>       <option value="10">10</option>       <option value="11">11</option>       <option value="12">12+</option>     </select>     </td>      </tr>   <tr>     <td align="right">Date Required</td>     <td align="left" class="form">     <select name="day">     <option value="01" selected>1</option>     <option value="02">2</option>     <option value="03">3</option>     <option value="04">4</option>     <option value="05">5</option>     <option value="06">6</option>     <option value="07">7</option>     <option value="08">8</option>     <option value="09">9</option>     <option value="10">10</option>     <option value="11">11</option>     <option value="12">12</option>     <option value="13">13</option>     <option value="14">14</option>     <option value="15">15</option>     <option value="16">16</option>     <option value="17">17</option>     <option value="18">18</option>     <option value="18">19</option>     <option value="20">20</option>     <option value="21">21</option>     <option value="22">22</option>     <option value="23">23</option>     <option value="24">24</option>     <option value="25">25</option>     <option value="26">26</option>     <option value="27">27</option>     <option value="28">28</option>     <option value="29">29</option>     <option value="30">30</option>     <option value="31">31</option>     </select>             <select name="month">     <option value="01" selected>January</option>     <option value="02">February</option>     <option value="03">March</option>     <option value="04">April</option>     <option value="05">May</option>     <option value="06">June</option>     <option value="07">July</option>     <option value="08">August</option>     <option value="09">September</option>     <option value="10">October</option>     <option value="11">November</option>     <option value="12">December</option>       </select>          <select name="year">       <option value="2005" selected>2005</option>       <option value="2006">2006</option>       <option value="2007">2007</option>       <option value="2008">2008</option>       <option value="2009">2009</option>       <option value="2010">2010</option>       <option value="2011">2011</option>       <option value="2012">2012</option>       <option value="2013">2013</option>       <option value="2014">2014</option>       <option value="2015">2015</option>       <option value="2016">2016</option>       <option value="2017">2017</option>       <option value="2018">2018</option>       <option value="2019">2019</option>       <option value="2020">2020</option>     </select>     </td>   </tr>   <tr>     <td align="right">Required Time</td>     <td align="left" class="form"><select name="hours">       <option value="00">0</option>       <option value="01">1</option>       <option value="02">2</option>       <option value="03">3</option>       <option value="04">4</option>       <option value="05">5</option>       <option value="06">6</option>       <option value="07">7</option>       <option value="08">8</option>       <option value="09">9</option>       <option value="10">10</option>       <option value="11">11</option>       <option value="12">12</option>       <option value="13" selected>13</option>       <option value="14">14</option>       <option value="15">15</option>       <option value="16">16</option>       <option value="17">17</option>       <option value="18">18</option>       <option value="19">19</option>       <option value="20">20</option>       <option value="21">21</option>       <option value="22">22</option>       <option value="23">23</option>          </select>       :      <select name="mins">        <option value="00" selected>00</option>        <option value="05">05</option>        <option value="10">10</option>        <option value="15">15</option>        <option value="20">20</option>        <option value="25">25</option>        <option value="30">30</option>        <option value="35">35</option>        <option value="40">40</option>        <option value="45">45</option>        <option value="50">50</option>        <option value="55">55</option>      </select>       </td>   </tr>          <tr>     <td align="right">Wheelchair Access</td>     <td align="left" class="form"><input name="corp_wheelchair" type="checkbox" value="wheelchair access">     </td>   </tr>   <tr>     <td align="right">Extra Information</td>     <td align="left" class="form"><textarea name="corp_info" id="corp_info"></textarea></td>   </tr>       <tr>     <td align="right">Authorised by</td>     <td align="left" class="form"><input name="corp_auth" id="corp_auth" type="text" maxlength="30" size="20"></td>   </tr>      <tr>     <td align="right"><a href="terms.html" target="_blank">Terms and Conditions</a></td>     <td align="left" class="form"><input name="corp_terms" type="checkbox" value="terms"></td>   </tr>   <tr>       <td align="center" colspan="2"><input type="submit" value="book now!"></td>   </tr> </table>                <input type="hidden" name="MM_insert" value="book">         </form>                           </td>     </tr>          <tr>         <td>             <img src="images/index_19.gif" width="495" height="25" alt=""></td>              </tr>     </table>     <!-- End content -->     </td>     </tr> </table>      <!-- footer table begin -->      <table id="footer" width="821" border="0" cellpadding="0" cellspacing="0">          <tr>         <td colspan="4">             <img src="images/index_20.gif" width="820" height="226" alt=""></td>   </tr> </table> <!-- End footer --> </body> </html> <?php mysql_free_result($corp_details); ?> [/code]
×
×
  • 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.