Jump to content

deansaddigh

Members
  • Posts

    440
  • Joined

  • Last visited

    Never

Everything posted by deansaddigh

  1. how can i use substr to change what in $dateResults to a date format, because the db uses varchar for date as appose to DATE as its data type, dont ask me why someones set it to that. Heres the code where im echoing to dates. <td><?= "Check-in: " .$dateResults['arrival_date']. "<br />Checkout: " . $dateResults['departure_date'];?></td>
  2. Many thanks i figured it out cheers for your help.
  3. $dateSQL = "SELECT arrival_date, departure_date FROM bookings WHERE client_id = $clientresults('client_id') Order BY id DESC LIMIT 1"; $dateResults = $db->query($dateSQL); ?> <td><?= $dateresults('arrival_date'); ?></td> <td><?= $dateresults('departure_date');?></td>
  4. <?php include('../lib/scripts/php/functions.php'); $page_title='Clients'; $page_id_top = 'clients'; $page_id = 'viewClients'; include('../lib/includes/header.php'); if (!empty($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $limit = 20; unset($_SESSION['cottage']); ?> <div id="sub_nav"> <? include('subnav.php'); if (!empty($_POST['search'])) { $search = $_POST['search']; $clientSQL = "SELECT * FROM clients WHERE name like '%$search%' OR surname like '%$search%' OR email like '%$search%' OR address1 like '%$search%' OR town like '%$search%' OR postcode like '%$search%'OR county like '%$search%'"; $limit = 500; } else { $clientSQL = "SELECT * FROM clients WHERE name != '0' $cottageSQL $sortSQL"; } $clientsResults = $db->query($clientSQL); echo $clientResults; $total_clients = count ($clientsResults); $total_pages = ceil($total_clients / $limit); $set_limit = 1; $set_limit = $page * $limit - ($limit); $limitSQL = " LIMIT $set_limit,$limit"; $clientSQL = $clientSQL.$limitSQL; $clientsResults = $db->query($clientSQL); ?> </div> <div id="content"> <div id="content_tab"> <!--START OF PAGE TABS--> <? include('tabs.php');?> <!--END OF PAGE TABS--> </div> <div id="content_contents"> <!--START OF PAGE CONTENT--> <? if (!empty ($clientsResults)) { foreach ($clientsResults as $clientsResults2) { ?> <div class="productItem"> <div class="productItemImage"><img src='images/client_icon.gif'></div> <div class="productItemDescription"> <table border='0'> <tr> <td width="130px">Name:</td> <td width="270px"><?=$clientsResults2{'title'}.' '.$clientsResults2{'name'}.' '.$clientsResults2{'surname'}?></td> </tr> <tr><td></td></tr> <tr> <td>Email address:</td> <td><?=$clientsResults2{'email'}?></td> </tr> <tr> <td>Telephone:</td> <td><?=$clientsResults2{'telephone'}?></td> </tr> <tr> <td>Last booking:</td> <td><?=$clientsResults2{'arrival_date'}?></td> This line doesnt do anything <td><?=$clientsResults2{'arrival_date'}?></td> [/code]
  5. <?php echo "<p class="product_description"> . "click image for bigger view</p>";?>
  6. Hi and thanks for all your help. I have now passed my product id to my cart page and performed sql to display the details of that product. Heres the code <?php /*Get the product id from previos page*/ $productid = $_GET['productid']; /*get the product details based on id*/ $query = "select ProductID, ProductName, ProductPrice FROM product WHERE ProductID = ".$productid; $result = mysql_query($query, $conn) or die ("Unable to perform query"); while($row= mysql_fetch_array($result)) { echo $row["ProductName"]; echo $row["ProductPrice"]; } //* Save details to the session*// ?> What i now want to do is save the product details to a session. How do i do the next step of saving every product id thats past to this page to the session variable and not overwrite it, so then when i get to the payment section i can pass the total over to paypal?
  7. How would i now retrieve my id, i have this code but obviously its wrong <?php $productid = mysql_real_escape_string($_POST["productid"]); echo $_POST['productid']; ?>
  8. Thanks guys i got it working with this code echo "<a href=cart.php? '.$productid'>Add to cart</a>";
  9. As above really i want to pass the product id to the shopping cart page i have this is this correct echo "<a href=cart.php? '.$productid.'>Add to cart</a>"
  10. Am i right in thinking padding effects what inside the box where as margin affects outside the box. So i have some text in a in a box and when ever i add padding it makes the actual box bigger and doesnt pad the text, i dont understand. Heres my css. #main{ padding: 5px 5px 5px 20px; margin-top: 10px; margin-left:5px; float:left; width: 620px; background-color: orange; And the html <div id="main"> <p>Search over 400 English language schools, colleges and universities and 1500 language courses in the United Kingdom. If you want to study in Great Britain, UKstudy will answer your questions, and will help you find a school - it's a free service! Since 1999 UKstudy.com has given free and impartial advice to international students who want to learn English in the UK. UKstudy.com will help you to choose the best course for you from over 200 British Council accredited language schools and colleges. If you choose to book a course you will pay all the fees directly to the school. You do not pay any extra for using UKstudy.com, and you do not pay any money to UKstudy.com. </p> </div> Can anyone shed any light on it for me?
  11. Hi sorry im not sure if this is a css or php question. Curious how is this site http://www.mailordercorals.com/ making all its images 4kb for each new product being displayed.?
  12. Thanks, i ideally want to put everything in one div though. can anyone help at all
  13. Hi guys i want help with a form please. I want to make a form that is horizonatal and looks like this can anyone help me [attachment deleted by admin]
  14. I am just curious, how can i delete products from a db, BUT im running like 3 different sql queries to delete the products from its various tables and linker tables. How can i make sure that they only get executed if they all dont fail? Is there away to only run the sql query if they dont fail?
  15. Hi, basically im making a box where i want the h1 tags to take on styling i specify, but whats annoying is it takes on the styling i give it plus the h1 styling i have set for all the other h1 tags, basically i want the h1 tag in the box i have created to have its own attributes. heres the css @charset "utf-8"; /* CSS Document */ /* Heading */ h1{ font: large georgia; line-height: 45px; padding:0; margin:0; color: #FFFFFF; background: url(../images/devider.png) bottom right no-repeat; font-weight: normal; } h2{ font: large georgia; line-height: 45px; padding:0; margin:0; color: #FFFFFF; font-weight: normal; } p{ padding:0; margin:0; font: strong, times, Times New Roman, times-roman, georgia, serif; font-size: 14px; color: #000000; } a:link { color: #FFFFFF; font-weight: 600; font-size:14px; text-decoration: none; } a:visited { color: #FFFFFF; font-weight: 600; font-size:14px; text-decoration: none; } a:hover { font-size:14px; font-weight: bolder; color: #000080; text-decoration: underline; } a:active { color: #333333; text-decoration: none; } a img { border: none; } body { margin: 0; padding: 0; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #1372ce; background-image: url(../images/pagebg.jpg); background-repeat: no-repeat; background-attachment:fixed; } #wrapper { /*Wrapper dont automatically expand to contain floated elements you have you use over flow:auto to do this */ width: 940px; margin-left: auto ; margin-right: auto ; overflow:hidden; } #headerlinks{ width: 940px; background-image:url(../images/tiled.png) ; } #navlist li { display: inline; list-style-type: none; padding-right: 20px; } #header { background-image:url(../images/logo.png); background-repeat :no-repeat; width: 800px; height: 100px; } #left { margin-top: 20px; width: 200px; float:left; } #main { margin-top: 20px; margin-left: 10px; width: 500px; float:left; margin-bottom:2cm; background-image:url(../images/tiled.png) ; overflow:auto; } #right { width:200px; margin-top: 20px; float:right; } #footer{ width: 940px; margin-left: auto ; margin-right: auto ; clear:both; background-image:url(../images/tiled.png) ; } /*****Forms******/ form { margin: 1em; width: 90%; } label { width: 10em; float: left; text-align: right; margin-right: 0.5em; display: block; } .submit input { margin-left: 4.5em; } legend { color: #fff; background: #4169E1; border: 1px solid #007FFF; padding: 2px 6px; } fieldset { border: 1px solid #FFFFFF; } input { padding:0.15em; width:10em; border:1px solid #ddd; background:#fafafa; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } select { background-color: #FFFFFF; color: #000000; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } textarea { width: 300px; height: 120px; color:#FFFFFF; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; background-image: url(../images/formb.jpg); background-position: bottom right; background-repeat: no-repeat; } .submit { font:bold 0.95em arial, sans-serif; border:none; height: 25px; background-color: #63D1F4; } .floatleft { float:left; padding:0px 5px 5px 5px; } .cleardescription { clear:left; } .newproducts { float:left; } ol { margin:0; padding:0; list-style:none; } li { list-style:none; margin-left: 20px ; } /* Boxes */ .box { width: 180px; border: solid #884400; border-width: 8px 3px 8px 3px; background-color: #ccaa77; } .box ul { margin: 0px; padding: 0px; padding-top: 50px; /* presuming the non-list header space at the top of your box is desirable */ } .box ul li { margin: 0px 2px 2px 2px; /* reduce to 1px if you find the separation sufficiently visible */ background-color: #ffffff; list-style-type: none; padding-left: 2px; } h1.box { background-color: #33657c; } So basically i want this line in the css h1.box { background-color: #33657c; } to be uses within the box contrainer what am i doing wrong heres the php <div class="box"> <h1 class="box">Menu</h1> <ul> <li>Lorem</li> <li>Ipsum</li> </ul> </div>
  16. Hahaha you are wonderful. It all works now thanks very much for helping.
  17. Sure heres the whole css code @charset "utf-8"; /* CSS Document */ /* Heading */ h1{ font: large georgia; line-height: 45px; padding:0; margin:0; color: #FFFFFF; background: url(../images/devider.png) bottom right no-repeat; font-weight: normal; } h2{ font: large georgia; line-height: 45px; padding:0; margin:0; color: #FFFFFF; font-weight: normal; } p{ padding:0; margin:0; font: strong, times, Times New Roman, times-roman, georgia, serif; font-size: 14px; color: #000000; } a:link { color: #FFFFFF; font-weight: 600; font-size:14px; text-decoration: none; } a:visited { color: #FFFFFF; font-weight: 600; font-size:14px; text-decoration: none; } a:hover { font-size:14px; font-weight: bolder; color: #000080; text-decoration: underline; } a:active { color: #333333; text-decoration: none; } a img { border: none; } body { margin: 0; padding: 0; font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 12px; background-color: #1372ce; background-image: url(../images/pagebg.jpg); background-repeat: no-repeat; background-attachment:fixed; } #wrapper { /*Wrapper dont automatically expand to contain floated elements you have you use over flow:auto to do this */ width: 940px; margin-left: auto ; margin-right: auto ; overflow:hidden; } #headerlinks{ width: 940px; background-image:url(../images/tiled.png) ; } #navlist li { display: inline; list-style-type: none; padding-right: 20px; } #header { background-image:url(../images/logo.png); background-repeat :no-repeat; width: 800px; height: 100px; } #left { margin-top: 20px; width: 200px; float:left; } #main { margin-top: 20px; margin-left: 10px; width: 500px; float:left; margin-bottom:2cm; background-image:url(../images/tiled.png) ; overflow:auto; } #right { width:200px; margin-top: 20px; float:right; } #footer{ width: 940px; margin-left: auto ; margin-right: auto ; clear:both; background-image:url(../images/tiled.png) ; } /*****Forms******/ form { margin: 1em; width: 90%; } label { width: 10em; float: left; text-align: right; margin-right: 0.5em; display: block; } .submit input { margin-left: 4.5em; } legend { color: #fff; background: #4169E1; border: 1px solid #007FFF; padding: 2px 6px; } fieldset { border: 1px solid #FFFFFF; } input { padding:0.15em; width:10em; border:1px solid #ddd; background:#fafafa; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } select { background-color: #FFFFFF; color: #000000; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } textarea { width: 300px; height: 120px; color:#FFFFFF; font:bold 0.95em arial, sans-serif; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; background-image: url(../images/formb.jpg); background-position: bottom right; background-repeat: no-repeat; } .submit { font:bold 0.95em arial, sans-serif; border:none; height: 25px; background-color: #63D1F4; } } .floatleft { float:left; padding:0px 5px 5px 5px; } .cleardescription { clear:left; } .newproducts { float:left; } ol { margin:0; padding:0; list-style:none; } li { list-style:none; margin-left: 20px ; }
  18. Sure, here is the html being generated <!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=utf-8" /> <link rel="shortcut icon" href="images/animated_favicon1.gif" /> <link rel="stylesheet" type="text/css" href="css/layout.css" /> <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" /> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script> <script type="text/javascript" src="js/lightbox.js"></script> <script type="text/javascript" src="js/mojozoom.js"></script> <link type="text/css" href="css/mojozoom.css" rel="stylesheet" /> <title>Nextdayfrags.co.uk</title> </head> <body> <!--wrapper to hold site--> <div id="wrapper"> <!--Logo holder--> <div id="header"></div> <div id="left"> <div class="nav"> <ul> <li><a href="#">SPS frags</a></li> <li><a href="#">LPS frags</a></li> <li><a href="#">Soft Coral frags</a></li> <li><a href="#">Coral Frag packs</a></li> <li><a href="#">SPS Coral Colonies</a></li> <li><a href="#">LPS Coral Colonies</a></li> <li><a href="#">Anemones</a></li> <li><a href="#">Clean Up Critters/ Inverts</a></li> <li><a href="#">Coral Food</a></li> <li><a href="#">Reef Accesories</a></li> <li><a href="#">Gift Vouchers</a></li> </ul> <div align="center"> <img src="images/paypal.png"/> </div> </div> </div> <div id="main"> <h1>Royal Gramma</h1><p>Category: <font color="#990000">LPS frags</font></p> <p>Product Price: <font color="#990000">123</font></p> <img src="Product_image/RoyalGramma.jpg" class="floatleft" width="100" height="100"/> <p><font color="#990000"> Product Description:</font> he fish begins as a dark purple starting at the head which fades mid-body to yellow at the tail. The royal gramma will also have a small black spot on the front of the dorsal fin. The royal gramma resembles the false gramma (Pseudochromis paccagnellae), with the two main differences between the two being that the false gramma has clear fins and does not fade, but rather has a distinct change in colour. Royal gramma averages slightly over 8 cm (3 inches) and has been tank bred.</p> <div class="cleardescription"><font color="#990000">Hover over image to enlarge</font> <img src="Product_image/RoyalGramma.jpg" data-zoomsrc="Product_image/RoyalGramma.jpg" width="200" height="200"/><br/><br/><br/></div> <p><font color="#990000"> Product Video:</font><br /><object width="445" height="364"><param name="movie" value="http://www.youtube.com/v/4zK1hCn8jBg&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1"></param><param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4zK1hCn8jBg&hl=en_US&fs=1&color1=0x006699&color2=0x54abd6&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="445" height="364"></embed></object> </div> <div id="right"> <p>Some text</p> </div> <div id="footer"> <p>Some text</p> </div> </div> </body> </html>
  19. Ok Basically im displaying an image and a decscription and i want the description to wrap around the image simple using a float left on the image. However it was working an now its not can some one please point me in the right direction please. php code echo '<img src="'.$file.'" class="floatleft" width="100" height="100"/> '; echo '<p><font color="#990000"> Product Description:</font> '; echo $productdescription = $row['ProductDescription']; echo '</p>' And the css where i make the image float left. .floatleft { float:left; padding:0px 5px 5px 5px; } here the image to show you that the description is underneath the image
  20. I want to order my products by the last 10 products entered. hears my sql code $query = "select product.ProductID, product.ProductName, product.ProductCategory, product.ProductPrice, product.ProductQuantity, product.ProductDescription, image.ImageID, image.ImagePath, image.ImageName, product_image.ImageID, product_image.ProductID FROM product JOIN product_image ON product.ProductID = product_image.ProductID JOIN image ON image.ImageID = product_image.ImageID"; How can i do this
  21. Thanks so much im such an idiot some times. Cheers
  22. Basically i wanna put all this code in a seperate file <?php $query = "select product.ProductID, product.ProductName, product.ProductCategory, product.ProductPrice, product.ProductQuantity, product.ProductDescription, image.ImageID, image.ImagePath, image.ImageName, product_image.ImageID, product_image.ProductID FROM product JOIN product_image ON product.ProductID = product_image.ProductID JOIN image ON image.ImageID = product_image.ImageID"; //Use this query below $result = mysql_query($query, $conn) or die ("Unable to perform query"); while($row= mysql_fetch_array($result)) { $productname = $row['ProductName']; $productprice = $row['ProductPrice']; $imagename = $row["ImageName"]; $imagepath = $row["ImagePath"]; //Get the product id so i can pass it $productid =$row["ProductID"]; $file = $imagepath.$imagename; ?> <ol> <li class="newproducts"> <!-- Make the product name clickable and pass through its id --> <?php echo '<a href="product_details.php?productid='.$productid.'">' .$productname.'</a><br />';?> <?php echo '<a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/><br />';?> <?php echo 'Price' . $row ['ProductPrice'].'<br /><br />';?> </li> </ol> <?php }?> Then call it on the index page, how can i do this
×
×
  • 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.