Jump to content

RLAArtistry

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by RLAArtistry

  1. Ignace- love the site. Ninjakreborn- I too like the logo you are leaning towards. Without the laptop #3 looks unbalance and #4 too vertical and #5-6 is retro. For the home page, the section under the header I would make it fill the screen (more awesome if the text where actual links). Use Ignace's suggestion to showcase projects and do away with the scroll.
  2. Ads are a great way to generate income on your site, but there's a time and place for everything. I would suggest removing the banner from your home page or placing it at the bottom. Sell your site, not someone else's. People read from left to right, top to bottom. Therefore, put your most important content at the top and work from there. Borders makes your page look confined. To create the illusion that your page is bigger, remove the border. Most websites today are going for a full page look (better use of cyber real estate). I like the background. After removing the borders, put some space between the boxes and add a shadow (this will create the illusion the boxes are floating). Fix the header (css: position:fixed) and add the navigation (not enough links to have its own row). Thats my $0.02, good luck.
  3. I am not sure what happened to my coding. I did noticed however, that I didn't get the usual popup when I clicked on the code icon, just got the tags, figured it was because I was using a tablet. The code you posted worked perfectly, you are a genius Christian F., but I have 1 question. I like to get an understanding of a code so I can figure the thought process behind it. Why did you use "intval"? The code seem to work without it.
  4. Thank you Christian F. but I've already read up on it and realized it wasnt recommended. Therefore I had a change of plans and came up with this bit of code. $currentproduct = $_GET[[color="#800000"]'pid'[/color]]; $_SESSION[[color="#800000"]'productID'[/color]][] = $currentproduct; [color="#00008b"]foreach[/color]($_SESSION[[color="#800000"][color="#800000"]'productID'[/color][/color]] [color="#00008b"]as[/color] $key=>$value) { [indent=1]echo [color="#800000"]'The value of $_SESSION['[/color].[color="#800000"]"'"[/color].$key.[color="#800000"]"'"[/color].[color="#800000"]'] is '[/color].[color="#800000"]"'"[/color].$value.[color="#800000"]"'"[/color].[color="#800000"]' <br />'[/color]; } [/indent] This code save my product viewed in an array. Now I need help with a code that will check the array to see if the current pid exist, if it does or if it is greater than 1 then it wont update the views counter. I tried array_count_value to see if the value exist greater than 1, but keep getting an error. Basically I need a code that will check the array and if the the current product pid exist it will update or not update the views. Can someone please help me. Thanks in advance
  5. I totally get what you guys are saying but I only need the views. The views I will store in a database. What I don't need is the session id, ip or anything else. Now, I am not that knowledgeable about the push array method. Can anyone help me with that?
  6. That is true akphidelt2007 but i didnt want to do another sql query for this. Seem a little extreme for such a small task.
  7. Let me see if I understood you correctly. 1. Create like a session array 2. Store viewed products ID in that array 3. when someone click on a product, the script will check if the current product id is already in the array 4. If not add 1 to the database. Is that what you're suggesting?
  8. Hey guys, its me again. I want to add a counter for every time a product is viewed (this counter is stored in the same database table as the product itself). That way I can generate a most viewed product list. I added this bit of code UPDATE products SET viewCount=viewCount+1 WHERE pid='$pid The problem is, every time the page refresh the counter adds 1, how can I make it add 1 per session without having to save the session id to my database? Thank you, any suggestion will be appreciated.
  9. This works fine. If both images have the same width and height the the top and the left should be "0". { position: absolute; z-index: 2; top: 0; left: 0;} Are you trying to do a CSS rollover image?
  10. Once again thank you guys very much for your help. I combined the suggestions of Zane and Requinix to come up with a solution. As I mentioned before I considered using a table but could not figure out how to set the condition that indicates that the record is before the current one. Zane's code gave me the idea to use the "<" and ">" to get the next and previous record. Here is the code: ///////////////////////// NEXT QUERY /////////////////////////////////////// $nextbtn = ""; $prevbtn = ""; $next = ""; $prev = ""; $browse = "SELECT * FROM products WHERE pro_name>'$pro_name' ORDER BY pro_name ASC LIMIT 1"; $browse_query = mysqli_query($Connection, $browse) or die (mysqli_error()); $result = mysqli_num_rows($browse_query); // count the output amount if ($result == 1) { while($row = mysqli_fetch_array($browse_query)){ $pro_name = $row["pro_name"]; $pro_id = $row["id"]; } $nextbtn = "NEXT"; }else{ $nextbtn = ""; } $next = "inventory_edit.php?pid=$pro_id"; /////////////////////////// PREVIOUS QUERY //////////////////////////////// $browse = "SELECT * FROM products WHERE pro_name<'$pro_name' ORDER BY pro_name DESC LIMIT 1"; $browse_query = mysqli_query($Connection, $browse) or die (mysqli_error()); $result = mysqli_num_rows($browse_query); // count the output amount if ($result == 1) { while($row = mysqli_fetch_array($browse_query)){ $pro_name = $row["pro_name"]; $pro_id = $row["id"]; } $prevbtn = "PREVIOUS"; }else{ $prevbtn = ""; } $prev = "inventory_edit.php?pid=$pro_id"; Currently this works and even if I delete an item from the inventory it goes on to the next or previous one. The next/previous links appears and disappears when the results from the query = 0 or 1. If anyone have any other suggestions or modifications please do share, otherwise this post is "SOLVED". Thank you
  11. Thanks for your replies. Apparently I didn't search hard enough. Here I thought I made a break-through in php coding. The thought did came to mind if an item was deleted from the database then that would throw off the sequence. I did also thought about using another table but could not come up with something to do this = "some condition indicating the record is before the current one".
  12. Hey guys and gals, it me again. I need help with my php coding. OBJECTIVE I have a form that will allow me to edit products in my inventory. I want to add a next and a prev link to browse the inventory. When the last item in the inventory is reached the next link disappears and visa versa. So far I query the database if (isset($_GET['pid'])) {// the id for the product to be edited is passed via URL $thisID = $_GET['pid']; $sql = "SELECT * FROM products WHERE id='$thisID' LIMIT 1"; $query = mysqli_query($Connection, $sql) or die (mysqli_error()); $productCount = mysqli_num_rows($query); // count the output amount if ($productCount == 1) { while($row = mysqli_fetch_array($query)){ $pid = $row["id"]; $name = $row["name"]; $price = $row["price"]; $desc = $row["desc"]; $cat = $row["cat"]; $subcat = $row["subcat"]; } } else { echo "There was an error processing your request"; exit(); } } The above I am good with... It renders the information of the product to be edited in the form and I have another bit of code that UPDATES the database. Now I just need help on the next and previous link to browse the database. I came up with this lame bit.. <a href="?pid=<?php echo ++$pid; ?>">Next</a> <a href="?pid=<?php echo --$targetID; ?>">Prev</a> I don't think "--$targetID" is even legal. I search php.net and haven't seen anything remotely looking like it, but strange enough it allows me to decrease "$pid" value. Any idea will be appreciated. Thanks in advance.
  13. Is it possible for you to post a picture of the layout you want? From what I get from the CSS and the HTML code you want contents in the div with header class to be inline, therefore you have to float logo, middle, slogo, search and map class to the left. float: left; Try and avoid using AP div, use normal divs, and use margins and floats for positioning.
  14. Not sure if you still want this, but here is a starter for you. You should take Christian F advice and change the color scheme of the body, especially the font. Here is the CSS body { font-family: impact; background-color: #666464; margin: 0; padding: 0; text-align: center; height: 100%; } .cuplinTemp #container{ width: 100%; background-color: #F7F7F7; text-align: center; min-height: 100%; } #headerWrapper { width: 100%; text-align: left; background-image: url(../images/BG_header.jpg); background-repeat: repeat; height: 175px; } #contentWrapper { width: 100%; text-align: center; } .content { width: 97%; margin: 0 auto; text-align: left; background-color: #f8a71a; } #footerWrapper { width: 100%; text-align: center; background-color: #FFFFFF; min-height: 100%; } There are some inline CSS in the HTML section of the page, that way you can have an idea of which styling is for what. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd%22>"]http://www.w3.org/TR...nsitional.dtd">[/url] <html xmlns="[url="http://www.w3.org/1999/xhtml%22>"]http://www.w3.org/1999/xhtml">[/url] <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="css/cuplintemp.css" rel="stylesheet" type="text/css" /> <body class="bakerTemp"> <div id="container"> <div id="headerWrapper"> <div class="logo" style="margin-left:20px; float: left;"><img src="images/logo.jpg" alt="cuplin logo" /></div> <div class="linksBtns" style="float: right;"> <ul style="list-style-type: none; margin-top: 29px;"> <li style="float:left; margin-right: 20px;"><img src="images/calendar.png" alt="Calendar" /></li> <li style="float:left; margin-right: 20px;"><img src="images/preference.png" width="143" height="142" alt="Preference" /></li> <li style="float:left; margin-right: 20px;"><img src="images/question.png" width="143" height="142" alt="Question" /></li> <li style="float:left; margin-right: 20px;"><img src="images/social.png" width="143" height="142" alt="Social" /></li> </ul> </div> <!-------------------------------- end #headerWrapper -------------------------------------></div> <div id="contentWrapper"> <div id="listings" style="height: 70px"> <ul style="list-style-type: none; margin-bottom: 50px"> <li style="float:left; margin-right: 20px;"><img src="images/listItem-1.jpg" width="228" height="53" /></li><!-- This does not have to be an image, you can use <span></span> around your text; set width, height, font and font color --> <li style="float:left; margin-right: 20px;"><img src="images/listItem-1.jpg" width="228" height="53" /></li> <li style="float:left; margin-right: 20px;"><img src="images/listItem-2.jpg" width="228" height="53" /></li> <li style="float:left; margin-right: 20px;"><img src="images/listItem-3.jpg" width="228" height="53" /></li> </ul> </div> <div class="content"> <table width="100%" border="0"> <tr> <td> </td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> </div> <!------------------------------- end #contentWrapper -------------------------------------></div> <div id="footerWrapper"> <div class="footerContent"> </div> <!------------------------------- end #footerWrapper --------------------------------------></div> <!--------------------------------- end #container ----------------------------------------></div> </body> </html> The images are too large, you will have to reduce their size by at least 50%. Here are the images you need for this sample. I am not sure if you will be using PHP to render dynamic information into the content area or if it is static. You can use tables for that, some people don't like using tables but it is the easiest option.
  15. I got it!!! Thank you very much ChristianF. You have been extremely helpful and informative. I definitely will start coding better thanks to your tips. I will still hang around on this site, maybe I can help someone with my CSS and design know-hows one day. Here is the final code $newSQL = mysql_query("SELECT (SELECT COUNT(*) FROM survey1 WHERE Q3=1 OR Q3=2) / (SELECT COUNT(*) FROM survey1) * 100 AS `percent`"); $sqlpercent = mysql_result($newSQL,0); $satrate = number_format($sqlpercent, 0,'',''); echo "$satrate %"; If something is off please let me know. Thank you again.
  16. Hey ChristianF, Does this means I have to create a column name percent? Notice: Use of undefined constant percent - assumed 'percent' in D:\hosting\8594549\html\customercenter\Survey\survey_ratings.php on line 20 70.0000 How do I remove the .0000?
  17. this is what I did $newSQL = mysql_query("SELECT (SELECT COUNT(*) FROM survey1 WHERE Q3=1 OR Q3=2) / (SELECT COUNT(*) FROM survey1) * 100 AS `percent`"); $newValue = mysql_num_rows($newSQL);
  18. Thank you for your reply; I got a Resource id #7 Did I leave something off?
  19. OK, I tried COUNT but for some reason the total the exercise on the site got I wasn't. Since I don't know how to get both Q3 (1 or 2) and Q3 total from one sql_query, I decided to do 2 and get the percentage from there. I vary the quantity of Q3 1s and 2s and the answer is correct. My concern now is; is it efficient, will it be slow? $nop = ""; $Q3 = ""; /* Retrieve from database, where (Q3 = 1 or Q3 = 2)*/ $sql_satvalue = mysql_query("SELECT * FROM survey1 WHERE (Q3='1' OR Q3='2')"); $satvalue = mysql_num_rows($sql_satvalue); /* Retrieve from database survey1 total */ $sql_surveyTotal = mysql_query("SELECT * FROM survey1"); $surveyTotal = mysql_num_rows($sql_surveyTotal); $satpercent = $satvalue/$surveyTotal*100; echo "$satpercent %";
  20. NOP is what I was using to get my number of rows, but now that you mention it, it doesn't make sense to me either. Let me use up my COUNT knowledge and see what i get. Thanks christian F, BRB.
  21. Hey ChristianF, thanks for your reply. To answer your question, no. It wouldn't be possible for anyone to avoid answering any of the questions. Question 1 is used to evaluate question 3 and question 2 is just a buffer. The psychology behind it is to separate emotions from logics. If a customer is highly likely to recommend our service, however, was disappointed with the website, then that would indicate that no thought was put into answering the questions (they just randomly clicked on the answers). I don't think one can write a script that can determine ones frame of mind so this is something that a person has to do. Steps 1 was what I was going for... Step 2, I also wanted to fetched NOP... this is where I lost it. My intention for step 3 was to give me the total number of NOP. I visited the link you gave me and is playing around with COUNT to see if I can get a good understanding of it.
  22. ____________________________________________________________________________ | NOP | Q1 | Q2 | Q3 | IP ADDRESS | DATE | |__________|____________ |_____________|_____________|____________ |___________| | | | | | | | |__________|____________ |_____________|_____________|____________ |___________| NOP is auto_increment and Q1, Q2 & Q3 are the 3 questions, IP ADDRESS is collected to check if that person has already participated in the survey and DATE is date. Answer value for question 3 = 1-5, where 1 & 2 are favorable responses, hence a satisfied customer. Answer values 3, 4, 5 are negative response, hence, dissatisfied customers. Collect the total of satisfied values: $sql_satvalue query = gives the total of satisfied customers The while loop was an attempt to get NOP (which didn't work). I was echoing the $nop to check if I was getting the correct value for NOP (that will later be removed). I thought mysql_num_rows() would give me the number of row with the values set in $sql_satvalue... WHERE (Q3='1' OR Q3='2'). BTW, thanks for your end notes. I will read up on COUNTS. Thank you
  23. Hey ChristianF, I really appreciate all the help you have given me. I did take your advice (I hope I executed it correctly). I got the correct value for my Q3 but I cannot get my NOP to give me the correct value. There are 10 entries in the database, NOP is auto increment and Q3 = 7. I've Googled and tried everything possible for 2 days and Im not getting any further. I am neither comfortable with PHP or MYSQL but by working with PHP over the years I kinna get an understanding of it. Give me some guidelines as to what I am missing and how to get the NOP display the correct value. When I am done with this I was wondering if you could also share with me that bit of code to get the database calculate percentage for me. Thank you $nop = ""; $Q3 = ""; /* Retrieve count from database, where (response == 1 or response == 2) and question == 3. Not familiar with count so I used select */ $sql_satvalue = mysql_query("SELECT NOP, Q3 FROM survey1 WHERE (Q3='1' OR Q3='2')"); /* Retrieve count of total answers from database, where question == 3*/ $satvalueTotal = mysql_num_rows($sql_satvalue); while($row = mysql_fetch_array($sql_satvalue)){ /* Here is where Im stuck. When echo $nop I get a value of 9 when it should be 10. My satvalueTotal is correct just my NOP is off*/ $nop = $row['NOP']; }
×
×
  • 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.