Jump to content

drewdan

Members
  • Posts

    47
  • Joined

  • Last visited

About drewdan

  • Birthday 12/03/1989

Contact Methods

  • MSN
    andy_arscott@msn.com
  • Website URL
    http://www.hostiau.co.uk
  • Skype
    andrew.arscott1

Profile Information

  • Gender
    Male
  • Location
    United Kingdom
  • Interests
    Web Design
    Hosting
    Being a Parent
    Music

drewdan's Achievements

Newbie

Newbie (1/5)

2

Reputation

  1. What code are you using to query your database? <?php $conn = mysqli_connect("localhost", "yourusername", "yourpassword") or die(mysqli_error($conn)); mysqli_select_db($conn, "yourdb") or die(mysqli_error($conn)); $client = $_GET['client']; $query = "select * from tablename where client='$client'"; $result = mysqli_query($conn, $query); $count = mysqli_num_rows($result); if($count==0) { echo "No Results Found"; } else { $table = '<table>'; while($array=mysqli_fetch_array($result)) { $table .= '<tr><td>' . $array['name'] . '</td><td>' . $array['otherdetail'] . '</td></tr>' } $table .= '</table>'; } echo $table; ?> or something like that anyway is what you will need to write to query a database and generate a html table to be output into the browser
  2. Hi, Thanks for the information, very helpful. The tutorial I am following is here: http://docs.joomla.org/J3.2:Developing_a_MVC_Component/Adding_backend_actions For some reason the data is duplicated on save instead of being updated. Very annoying!
  3. Hi All, Currently building a Joomla component. Having an issue with data being duplicated when I click the save button. Instead of the item in the database being updated a new item is being created, has anyone faced this issue before? I am wondering if it might be to do with my database design. I have named the primary key as journal_id, but I see in the tutorial it is set just to id, is this a requirement for Joomla to function properly? Any help with this issue would be gratefully received. Andrew
  4. Cheers for the info, I will relay it back to my client and let them know
  5. Hey there, slow reply I know. I was not missing the point, I understand that it is downloadable. What I meant was I would look for a way to make it more difficult to download the PDF. My thought so far is to convert the PDF into JPG images. This means I can put them on the page and use jQuery to create a navigation system to "turn the page" I would then have a transparent div over the top of the jpg so if anyone tried to right click and save the image they would just get a empty transparent gif. I would also implement some hotlink protection too. Of course the images would still be downloaded into the cache and anyone who viewed the source code could find the location of the image to download it, but it would be a little more difficult to do!
  6. Hi All, I am currently trying to learn how to build Joomla Components. I am building a component which will function as a "Magazine Library". I have been following the guide found here and modifying it accordingly to fit my needs: http://docs.joomla.org/J3.2:Developing_a_MVC_Component/Adding_backend_actions I am doing quite well, but I seem to have hit a snag, during development I changed the name of one of the views from journallibraries to journallibrarys, just to make it a little easier to follow the guide. I have the first view which outputs a list of the magazine articles in a table and has a menu at the top to "Add", "Edit" and "Delete". When clicking the Add and Edit function the next view loads fine which shows the form to allow adding or editing of an item. The menu also appears so you can save & close or just close. When I click Save & Close or indeed Close, it redirects to a form which does not exist, which is the "journallibraries" form which was originally in this component. I have been through all of the code and I cannot find a single reference to this view, what I want to know is if anyone has had a similar problem to this, or if anyone knows where the code might be which is responsible for the actions that occur when "Save" is selected. I have uploaded the component admin part (which is all I have done so far), so if anyone has 5 minutes to help me identify this problem I would be eternally grateful! Cheers, Andrew com_journallibrary.zip
  7. Hi Psycho, Thanks for the quick response, the majority of the users of this website will not be tech savvy, so hopefully there wont be much risk involved. I think the best scenario is to make it as difficult as possible for the user to gain access and download the PDF, my customer does not want watermarking or anything like, so I think I will have to get creative! Thanks for your help!
  8. Hi All, I have a question for you all. My client would like a component developed for Joomla that will allow them to upload PDF magazines to the website and then it be output on the PDF in a secure format so they cannot be downloaded or copied. Does anyone know of an open source solution that might enable me to do this. The requirement is that this not be made using flash so that it will work on iOS devices. There are two ways I can see this working, either when the PDF is uploaded it gets converted into a different format so it can simply be integrated into the page when output, or the PDF gets uploaded as it, and it output in some wrapper that will protect it, im really not quite sure, you any advice will be great! Thanks for your help! I look forward to hearing your responses.
  9. Also on line 87 you have @mail($email_to, $email_subject, $email_message, $headers); change that to: mail($email_to, $email_subject, $email_message, $headers); and see what that does
  10. Have you got error reporting turned on? error_reporting(E_ALL); Insert that into your script and run it again and see if any errors are produced and let us know what they are.
  11. Im not sure, as I have never used this before, but something like this might work? $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "website not found"; } else { echo "website found"; }
  12. Thank you very much, this worked a treat!
  13. if you want to do this without refreshing the page you will need to use jQuery (AJAX). PHP script execute before the page loads, to make things change without a page refreshing you will need to use jQuery as that runs client side.
  14. You set the errors to E_ALL, which displays everything, even errors that do not actually mean much. Because your variable was undefined, the error was pointing this out. For example, if you have a form on a page and you have some php script on the same page that will receive the data and process it with a line of code like: $variable = $_GET['form_item']; If the $_GET is not collecting any data because the form has not been submitted, you will get a nice error. I often use this: $action= isset($_REQUEST['action']) ? $_REQUEST['action'] : null; That stops the error for me. Hope that helps!
  15. Hi Guys, I am trying to create a script which send a customer an invoice when they place an order. I have written the following code and this works when sent to an email address which is opened using gmail or the iPhone email client, but Microsoft Outlook screams a great big no at me, and just shows me the html in plain text. Any thoughts anyone? I have included the code below: <?php include("includes/conn.php"); $id=1; $random_hash = md5(date('r', time())); $subject="Red Van Tool Sales - Invoice: "; $headers = "From: sales@redvantoolsales.co.uk" . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n"; /*$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $user=isset($_COOKIE['user']) ? $_COOKIE['user'] : null; $sql="select * from user where user_email='$user'"; $sql_res=mysqli_query($conn, $sql) or die(mysqli_error($conn)); while($array=mysqli_fetch_array($sql_res)) { $uid=$array['user_id']; } */ $sql="select * from orders inner join payment_options on orders.payment_options_id=payment_options.payment_options_id inner join postage_options on orders.delivery_id=postage_options.postage_options_id inner join user_address on orders.delivery_address_id=user_address.user_address_id inner join user on orders.user_id=user.user_id where orders.orders_id='$id'"; $sql_res=mysqli_query($conn, $sql) or die(mysqli_error($conn)); $count=mysqli_num_rows($sql_res); if($count==0) { //header("Location:noauth.php"); echo "fail"; } else { while($array=mysqli_fetch_array($sql_res)) { $order_id=$array['orders_id']; $subject .= $order_id; $order_date=date("d/m/Y", $array['orders_date']); $orders_total=number_format($array['orders_total'],2); $order_subtotal=number_format($orders_total/1.2,2); $vat=number_format($orders_total-$order_subtotal,2); $shipping_total=number_format($array['shipping_total'],2); $payment_fee=number_format($array['payment_fee'],2); $payment_options_name=$array['payment_options_name']; $postage_options_name=$array['postage_option_name']; $user_forename=$array['user_forename']; $user_surname=$array['user_surname']; $address_address=$array['address_address']; $address_city=$array['address_city']; $address_postcode=$array['address_postcode']; $shipping_time=$array['postage_option_shipping_time']; $shipping_time = $shipping_time*86400; $expected_arrival=$array['orders_date']+$shipping_time; $expected_arrival=date("d/m/Y", $expected_arrival); $emailto = $array['user_email']; } } ob_start(); //Turn on output buffering ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="http://www.redvantoolsales.co.uk/invoice.css" media="print"> <link rel="stylesheet" type="text/css" href="http://www.redvantoolsales.co.uk/invoice.css" media="screen"> </head> <body> <div id="cont"> <div id="container"> <div id="topbar"> <img class="logo" src="http://www.redvantoolsales.co.uk/images/logo.png"> <div id="companyaddress">Red Van Tools<br>Address<br>City<br>Postcode<br>VAT: 000000000<br>sales@redvantoolsales.co.uk<br>01633 000000<br>www.redvantoolsales.co.uk</div> </div> <div id="nextbar"> <div id="customeraddress"><?php echo $user_forename . " " . $user_surname; ?><br><?php echo $address_address; ?><br><?php echo $address_city; ?><br><?php echo $address_postcode; ?></div> <div id="invoicedetail">INVOICE <?php echo $order_id; ?><br><?php echo $order_date; ?></div> </div> <div id="orderdetailbar"> <table> <tr><th width="333">Payment Method</th><th width="333">Order Date</th><th width="333">Estimated Delivery Date</th></tr> <tr><td><?php echo $payment_options_name; ?></td><td><?php echo $order_date; ?></td><td><?php echo $expected_arrival; ?></td></tr> </table> </div> <div id="orderitembar"> <table> <tr><th width="120">Quantity</th><th width="500">Details</th><th width="120">Unit Price (£)</th><th width="120">VAT</th><th width="120">Net Subtotal (£)</th></tr> <?php $sql="select * from order_item inner join products on order_item.product_id=products.product_id inner join price on products.product_id=price.product_id where orders_id='$id'"; $sql_res=mysqli_query($conn, $sql) or die(mysqli_error($conn)); while($array=mysqli_fetch_array($sql_res)) { $total = number_format($array['product_price']*$array['product_qty'],2); echo "<tr><td>" . $array['product_qty'] . "</td><td>" . $array['product_name'] . "</td><td>" . number_format($array['product_price'],2) . "</td><td>20%</td><td align=\"right\">" . $total . "</td></tr>"; } ?> </table> </div> <div id="totals"> <table> <tr><td>Net Total</td><td><?php echo $order_subtotal; ?></td></tr> <tr><td>VAT</td><td><?php echo $vat; ?></td></tr> <tr><td><b>GBP Total</b></td><td><b>£<?php echo $orders_total; ?></b></td></tr> </table> </div> </div> </div> </body> </html> <?php $message1 = ob_get_clean(); mail( $emailto, $subject, $message1, $headers ); ?> Thanks guys!
×
×
  • 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.