Jump to content

DeX

Members
  • Posts

    258
  • Joined

  • Last visited

Everything posted by DeX

  1. That's crazy, good job. How did you do it? Which language? Which architecture? Did you use web services? Beans? Any API? Tell me everything!
  2. You just want to send an email right? http://php.net/manual/en/function.mail.php bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) This will work as long as your host has a working SMTP server set up. For example: mail("computerguy81@gmail.com", "Need PHP mail help!", "Hi, can you please help me with PHP?"); When this runs it will send an email. Format the message with the values from the form and presto. Done.
  3. PHP has a mail function, use that.
  4. Because the pages are implemented in the database and then populated depending on the ?page= string. This was done so that he could access the admin area and alter pages, but due to the size of the image on owners.. I couldn't get the image to work right with the system that uses a 4:3 Aspect Ratio on images. That was done to make the images look more professionally inserted, instead of having the images come up to different sizes and looking weird. I could have done it better, but since the client doesn't know anything about html or knows how to work FTP.. I did the site in the best way possible to allow him to add pages, remove pages, edit pages, and such. Which would be a bit difficult to do if the pages were loaded via their own .php file. I am not very good at coding the htaccess file so I don't know how to make a www.site.com/page url to be www.site.com/index.php?page=page when working with it in php. If I could figure that out, then I could at least make the pages appear to be different. So why not use Wordpress? It would have been much easier for you and give him a much better admin area for adding pages.
  5. This is raifly easy if you don't want to follow any sort of proper MVC methods. Set up a form for input on your page with some input text boxes and checkboxes: <form action = "new-page.php" method = "post"> <input type = "text" name = "input1" /> <input type = "text name = "input2" /> <input type = "checkbox" name = "checkbox1" value = "false" /> </form> And in your new-page.php you can get the values that are passed like so: <?php $input1Value = $_POST['input1']; $input2Value = $_POST['input2']; $checkboxValue = $_POST['checkbox1']; ?> Then put them into the database. Send me some money and I'll code it for you.
  6. I'd charge $2000 - $2500 for that here in Canada, including the lightbox. Why do you have all the pages loading from index.php instead of their own separate PHP page? Actually why is the owners.php page the only one that is separate?
  7. I'm working on another JSP project where I was shown the brilliance of web services, beans and struts to manage form entry, persistence and validation. I think this is very efficient for taking customer input from a web page, can this same idea be done in another web based language such as PHP? Or for something like this should I convert over to Java/JSP?
  8. If I use <h:button> then the output is <input type = "button"> If I use <h:submit> then the output is <input type = "submit"> How do I get an element of type <button>?
  9. Ya, exactly. The main thing you're going to want to know is that the <% %> symbols are going to be replaced with <?php ?>.
  10. I have everything set up to share a contest with a friend by clicking a button and inputting your friend's email address but I can't seem to get the body of that email to contain the HTML web content I want. Basically I have it set up right now that the body of the email just contains some simple HTML code but I would like it to embed the content from another html file that I have on the server so it essentially displays that HTML webpage inside the email and the recipient can click the links. It's easy enough to manually create the email but if I'm doing it with JSP, how can I pull in that external HTML file from the server to include in the body?
  11. Well then, it's a good thing I'm the boss! Another reason to tell my clients not to use that dinosaur of a browser.
  12. I found a bunch of samples on this site - http://forums.pinstack.com/f214/html5_animation_examples-118598/ It looks like I can use HTML5 and CSS3 to achieve exactly what I want without any Flash/javascript at all.
  13. I have an image of a map of the city and I'm trying to incorporate a train going down the tracks and stopping at designated stops on the same timeline as the city transit. What's the best way to incorporate this animation? Can it be coded directly into the HTML5? Should I have an animator create a video file and have that portion of the image be an embedded video? Should I create a .gif and have that portion of the image be an embedded gif? What's best? It's only a portion of the city map with only 1 or 2 stops and the train will enter from the top of the image and exit the bottom, it doesn't need to go all around. Thanks.
  14. I'm using a lightbox which currently only blacks out the visible portion of the screen. The problem is if you scroll down while the lightbox is showing, the portion you're scrolling down to isn't under the lightbox. How do I have the lightbox cover the entire page top to bottom? <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>LIGHTBOX EXAMPLE</title> <style> .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute; top: 25%; left: 25%; width: 50%; height: 50%; padding: 16px; border: 16px solid orange; background-color: white; z-index:1002; overflow: auto; } </style> </head> <body> <p>This is the main content. To display a lightbox click <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a></p> <div id="light" class="white_content">This is the lightbox content. <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div> <div id="fade" class="black_overlay"></div> <div style = "height: 2000px;">Very large div</div> </body> </html>
  15. Nice one, I'll try the div and let you know, it'll be a day or two before I get back to that project. But yes, I would like a scroll bar to appear in the browser if it's narrower than the 2 images.
  16. I want them to stay side by side even when the browser window is resized. Currently if the browser is not as wide as both images, it'll move one below the other. I want them to stay side by side no matter what. Is it possible without a table?
  17. F ya, got it thanks to a Google newsgroup. I need to pass in the entire HTML page including the CSS includes to DomPDF so this needs to be my PHP file: <?php ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <link rel="stylesheet" type="text/css" href="test1.css" media="screen" /> </head> <body> <div class = 'row0'>div 1</div> <div class = 'row1'>div 2</div></body> </html> <?php require_once("d/dompdf_config.inc.php"); $dompdf = new DOMPDF(); $dompdf->load_html(ob_get_clean()); $dompdf->render(); file_put_contents('customers/a.pdf', $dompdf->output()); ?>
  18. Any ideas why this would be? The question seems to be all over the internet but nothing seems to work. I installed the latest version (0.6.0 beta) and I have had this working fine for months.....with the exception of the CSS. For some reason when it creates the PDF, it leaves out the external stylesheet and doesn't style anything. Inline styling works fine but it's supposed to access the external CSS. I created a simplified PHP snippet for you that shows my issue: <html> <?php $quote = " <div class = 'row0'>div 1</div> <div class = 'row1'>div 2</div>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <link rel="stylesheet" type="text/css" href="test1.css" media="screen" /> </head> <body> <?php echo $quote; // save file to server require_once("d/dompdf_config.inc.php"); $dompdf = new DOMPDF(); // $dompdf->set_base_path("admin3/"); echo "base path: " . $dompdf->get_base_path(); $dompdf->load_html($quote); $dompdf->render(); file_put_contents('customers/a.pdf', $dompdf->output()); ?> </body> </html> And the external test1.css file: .row1 { background: #000; } .row0 { background: #bbb; } Any ideas how to get this to reference the CSS file? I've tried every combination of absolute/relative paths in the set_base_path() function but nothing seems to work there. The test1.css file is in the same directory as the PHP file and is displaying properly on the screen.
  19. I've been using DomPDF very successfully except I cannot, after days and days, get it to reference an external stylesheet. There is no way. I tried TCPDF and it's too limited in the CSS it actually supports. It doesn't even do float so that's no good for me. I am willing to buy PrinceXML but that has to be installed onto the server into a non web-accessible directory and I'm using shared hosting. That doesn't work at all. I need someone to suggest a HTML->PDF converter that I can call from within PHP on the fly and store the PDF on the server for future reference. And the PDF needs to be styled using an external stylesheet. Does anything do this?
  20. I've come to another problem. In the very first form for filling out building options there are a series of doors where you can choose a width, height, quantity and some other miscellaneous options for each. Then there's another type of door which only has a quantity to select and then some windows which only have quantities. Would you store these in the same product table even though they have their own specific set of attributes? When someone is looking at a quote they have the ability to edit it and land back on the same form page with all the fields filled out with the database values from that quote. It would have to display all the correct widths/lengths/heights and other options in the <select> boxes supplied. And each option has the ability to click a + button at the end of a row to show a new row which can then be filled out as well. All extra rows must also be populated when editing the quote. I already have all this working right now, I'm just wondering how I would normalize the database and make things more efficient. Right now I have tables to store each type of option with all their own attributes as columns in that table, then store the quote ID with it. I'm stuck on this one, thanks.
  21. That's some good ideas, that actually helps a lot, thanks. So I spent the evening redesigning the database and putting some normalization into it. Here's what I have now: table_products ------------------ id product_id type_id purchase_order_type_id colour_type_id name material_price_per_piece labour_price_per_piece price_per_k board_feet sku weight product_types ------------------ id type_id name colours ------------------ id name colour_types ----------------- id type_id name match_quote_colour ------------------- id quote_id colour_type_id colour_id purchase_orders ------------------ id type_id name quote ------------------- id customer_id building_type_id salesman_id price width length height gable_post_spacing eve_post_spacing pitch heel_height double_ply_rafters perma_columns insulated markup ridge date match_building_product --------------------- id quote_id building_product_id building_product_quantity building_product_length building_type --------------------- id name customer --------------------- id first_name last_name address_1 address_2 phone fax email city province postal_code user (salesman) -------------------- id first_name last_name username password (hash) phone email access_level commission_rate Does that look a lot better? Am I using the match tables correctly? To go through this quickly, table_products and product_types match up if the product is lumber or metal or whatever else. The colours are to put on the purchase order, the client chooses a door colour, roof colour, wall colour and all the rest. So any pieces that are trim will be associated with colour_type of trim and therefore will show up on the purchase order with the trim colour next to them. The quote has all the quoted information for the building. The match_building_product table matches the quote with which building products will be used for it and the quantity of each as well as length. Table building_type is used to store which kinds of buildings they offer (hayshed, riding arena...) and then it's displayed on the quote so the associated ID is stored in the quote table. Customer holds the customer's details and user holds the salesman's details and access level. I have a few questions with the left over fields that I couldn't put in anywhere. 1. Quotes are given out by the bucket full but only some are confirmed to be made into actual buildings and there's a button on the quote page to confirm it. When that gets confirmed should I have a record in the quote table get changed from 0 to 1 or should I have a confirmed table that has quote_id listed in it for confirmed quotes? 2. Should I be storing absolutely everything in the quote table? For example there is a certain labour rate that is given to buildings between certain ranges of square footage. I can derive the labour rate for any given quote by looking at the square footage and getting it from some labour_rate table but what if the labour_rates were changed since the quote was done? Should I be storing what the labour rate was at the time of quote? That would mean I would have to store every variable used in the calculation of the building including the markup percentage, profit margin, any buffers, salesman commission rate, everything. 3. There's a place on the quote page to add a custom charge for anything the salesman wants to charge for like if they have to rent a Bobcat for a week and add that to the quote price, something one off. This is not going to be in the building_product table so where would I store the cost and discription for it? In the quote table? In its own table? 4. There are 4 different kinds of posts which can be used in a building, 3ply, 4ply, 3plyconcrete, 4plyconcrete. Would I add these as 4 separate rows in the building_products tables or would I add a separate posts table and use a match table? 5. Purchase orders are huge, this application is going to auto create the purchase orders and fire out a PDF with a button click. To decide which products go to which purchase order I think I would add another column to the building_products table titled purchase_order_id and then have a purchase order table that lists all the different purchase orders they want to create, matching each product with the correct purchase order it falls onto. Then how would I specify the column names for the purchase order? Hard code them? Put them into a table? Add them as another column to the building_products table?
  22. I've been watching some of the videos, looking at database normalization, researching MVC and looking at J2EE/struts, thanks you guys helped a lot. Now I have another question. It would be easy enough to add a certain number of 2x4 for every specific option chosen to be added to the building but the calculations we're using are more complicated. Without hard coding the calculation, how can I allow new materials to be added to a building? For example, I just added the cost of caulking to the building prices so that's calculated at a half tube for every door and full tube for every 50 feet of building, rounded up to the nearest tube. Or extra labour that's added at the cost of (squareFootage / postSpacing - 1) * 0.65? The way it is now I had to go in and add the caulking to the database, then add the calculation into the cost of the building, how could I make all materials dynamic so the admin can change the calculations on the fly? Without knowing how to code.
  23. Figured this out. Instead of element.setAttribute("class", "row"); I should have used element.setAttribute("className", "row"); for Internet Explorer 7 support.
×
×
  • 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.