Jump to content

ianhaney

Members
  • Posts

    330
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ianhaney

  1. Hi I have built a sign up form which works perfect and a login form that works perfect but if I try to add the id number into the url using php, it makes the login form load the same page and not redirect to the profile page, below is the code I have on the login form processing page <?php ob_start(); session_start(); $username = $_POST['username']; $password = $_POST['password']; $_SESSION['username'] = $username; $conn = mysqli_connect('localhost', '********', '*******', '*******'); $id=$_GET['id']; $username = mysqli_real_escape_string($conn, $username); $query = "SELECT password, salt FROM recruiters WHERE username = '$username' AND id=$id;"; $result = mysqli_query($conn, $query); if(mysqli_num_rows($result) == 0) // User not found. So, redirect to login_form again. { header('Location: recruiter-login.php'); } $userData = mysqli_fetch_array($result, MYSQL_ASSOC); $hash = hash('sha256', $userData['salt'] . hash('sha256', $password) ); if($hash != $userData['password']) // Incorrect password. So, redirect to login_form again. { header('Location: recruiter-login.php'); }else{ // Redirect to home page after successful login. header('Location: recruiter-profile.php?id=$id'); } ?> I put error reporting in and is not displaying any errors so is one good thing If I take out AND id=$id from the sql query, the login works and logs me in Hope someone can help Thank you in advance Ian
  2. Sorry got it all sussed and working perfect now
  3. Sorry I enabled php error reporting on the file include/user/open.inc.php and that returned the following errors Notice: Undefined index: name in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 32 Notice: Undefined index: email in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 44 Notice: Undefined index: phone in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 51 Notice: Undefined index: subject in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 88 Notice: Undefined index: message in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 97 Notice: Undefined index: captcha in /home/sites/it-doneright.co.uk/public_html/support-tickets/include/user/open.inc.php on line 142 Could they be the reason the captcha is not working? Thank you in advance Ian Below is the code from that file <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); if(!defined('KTKUSERINC')) die('Adiaux amikoj!'); //Say bye to our friends. $info=($_POST && $errors)?Format::input($_POST):array(); //on error...use the post data ?> <div> <?php if($errors['err']) { ?> <p align="center" id="errormessage"><?=$errors['err']?></p> <?php }elseif($msg) { ?> <p align="center" id="infomessage"><?=$msg?></p> <?php }elseif($warn) { ?> <p id="warnmessage"><?=$warn?></p> <?php }?> </div> <div><?= _('Please fill in the form below to open a new ticket and provide as much detail as possible, so we can best assist you.')?><br /> <?= _('To update a previously submitted ticket, please go to ')?><a href="tickets.php"><?= _('Ticket Status')?></a>. </div><br /> <form action="open.php" method="POST" enctype="multipart/form-data"> <div class="input"> <span class="label"><?= _('Full Name:')?></span> <span> <?php if ($thisuser && ($name=$thisuser->getName())) { ?> <input type="hidden" name="name" value="<?=$name?>"><?=$name?> <?php }else { ?> <input type="text" name="name" size="30" maxlength="32" value="<?=$info['name']?>"> <?php } ?> <span class="error">* <?=$errors['name']?></span> </span> </div> <div class="input"> <span class="label"><?= _('Email Address:')?></span> <span> <?php if ($thisuser && ($email=$thisuser->getEmail())) { ?> <input type="hidden" name="email" size="30" value="<?=$email?>"><?=$email?> <?php }else { ?> <input type="text" name="email" size="30" maxlength="120" value="<?=$info['email']?>"> <?php } ?> <span class="error">* <?=$errors['email']?></span> </span> </div> <div class="input"> <span class="label-optional"><?= _('Telephone:')?></span> <span><input type="text" name="phone" size="30" maxlength="28" value="<?=$info['phone']?>"> <span class="error"> <?=$errors['phone']?></span> </span> </div> <div><span> </span></div> <?php // Present the topic selection menu if enabled if($cfg && $cfg->enableTopic()) {?> <div class="input"> <span class="label"><?= _('Help Topic:')?></span> <span> <select name="topicId"> <option value="" selected><?= _('Select One')?></option> <?php $services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic'); if($services && db_num_rows($services)) { while (list($topicId,$topic) = db_fetch_row($services)){ $selected = ($info['topicId']==$topicId)?'selected':''; ?> <option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option> <?php } }else{?> <option value="0" ><?= _('General Inquiry')?></option> <?php } ?> </select> <span class="error">* <?=$errors['topicId']?></span> </span> </div> <?php } else {?> <input type="hidden" name="topicId" value="0"> <?php } ?> <div class="input"> <span class="label"><?= _('Subject:')?></span> <span> <input type="text" name="subject" size="38" maxlength="64" value="<?=$info['subject']?>"> <span class="error">* <?=$errors['subject']?></span> </span> </div> <div class="input"> <span class="label"><?= _('Message:')?> <?php if($errors['message']) {?> <br /><span class="error">* <?=$errors['message']?></span><?php } ?> </span> <span> <textarea name="message" cols="40" rows="8" style="width:80%"><?=$info['message']?></textarea> </span> </div> <?php if($cfg->allowPriorityChange() ) { $sql='SELECT priority_id,priority_desc FROM '.PRIORITY_TABLE.' WHERE ispublic=1 ORDER BY priority_urgency DESC'; if(($priorities=db_query($sql)) && db_num_rows($priorities)){ ?> <div> <span class="label-optional"><?= _('Priority:')?></span> <span> <select name="pri"> <?php $info['pri']=$info['pri']?$info['pri']:$cfg->getDefaultPriorityId(); //use system's default priority. while($row=db_fetch_array($priorities)){ ?> <option value="<?=$row['priority_id']?>" <?=$info['pri']==$row['priority_id']?'selected':''?> ><?=$row['priority_desc']?></option> <?php } ?> </select> </span> </div> <?php } }?> <?php if(($cfg->allowOnlineAttachments() && !$cfg->allowAttachmentsOnlogin()) || ($cfg->allowAttachmentsOnlogin() && ($thisuser && $thisuser->isValid()))){ ?> <div class="input"> <span class="label-optional"><?= _('Attachment:')?></span> <span> <input type="file" id="multiattach" name="attachment[]" /> <span class="warning">(max <?=$cfg->getMaxFileSize()?> bytes)</span><span class="error"> <?=$errors['attachment']?></span> </span> <div id="files_list" class="files_list"></div> <?php // sorry but the script must be here, in order to be executed after the DOM is loaded ?> <script> //<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files --> var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 10 ); //<!-- Pass in the file element --> multi_selector.addElement( document.getElementById( 'multiattach' ) ); </script> </div> <?php } ?> <div class="input"> <span class="label"><?= _('Captcha Text:')?></span> <span><img src="captcha.php" alt="captcha" border="0"></span> <span style="vertical-align:top"> <input type="text" name="captcha" size="7" value=""> <i><?= _('Enter the text shown on the image.')?></i> <span class="error">* <?=$errors['captcha']?></span> </span> </div> <div align="right"> <input class="button" type="submit" name="submit_x" value="<?= _('Submit Ticket')?>"> <input class="button" type="button" name="cancel" value="<?= _('Cancel')?>" onClick='window.location.href="index.php"'> </div> </form>
  4. Hi I am using katak support which is a ticket system script and is all installed and working perfect apart from the php captcha is not working on the new ticket page I have been looking it and saw it could be the gd library not installed or enabled, the freetype is not installed or enabled, a file permissions issue or a htaccess issue I have a phpinfo file and says gd library is enabled as well as freetype is enabled, I checked the file permissions and is ok as well as the htaccess file, I even removed the htaccess file and is still the same I don't get it, if I visit the captcha.php file itself in the browser I get a 502 Bad gateway message if it helps but not sure how to fix it I am using php version 5.5.30 I am not sure which code to post here to have a look, below is my captcha.php code <?php /********************************************************************* captcha.php Simply returns captcha image. Copyright (c) 2012-2013 Katak Support http://www.katak-support.com/ Released under the GNU General Public License WITHOUT ANY WARRANTY. Derived from osTicket by Peter Rotich. See LICENSE.TXT for details. $Id: $ **********************************************************************/ require_once('main.inc.php'); require(INCLUDE_DIR.'class.captcha.php'); $captcha = new Captcha(5,12,ROOT_DIR.'images/captcha/'); echo $captcha->getImage(); ?> Below is the code from the class.captcha.php file <?php /********************************************************************* class.captcha.php Very basic captcha class. Copyright (c) 2012-2013 Katak Support http://www.katak-support.com/ Released under the GNU General Public License WITHOUT ANY WARRANTY. Derived from osTicket by Peter Rotich. See LICENSE.TXT for details. $Id: $ **********************************************************************/ class Captcha { var $hash; var $bgimages=array('cottoncandy.png','grass.png','ripple.png','silk.png','whirlpool.png', 'bubbles.png','crackle.png','lines.png','sand.png','snakeskin.png'); var $font = 10; function Captcha($len=6,$font=7,$bg=''){ $this->hash = strtoupper(substr(md5(rand(0, 9999)),rand(0, 24),$len)); $this->font = $font; if($bg && !is_dir($bg)){ //bg file provided? $this->bgimg=$bg; }else{ //assume dir provided or defaults to local. $this->bgimg=rtrim($bg,'/').'/'.$this->bgimages[array_rand($this->bgimages, 1)]; } } function getImage(){ if(!extension_loaded('gd') || !function_exists('gd_info')) //GD ext required. return; $_SESSION['captcha'] =''; //Clear list($w,$h) = getimagesize($this->bgimg); $x = round(($w/2)-((strlen($this->hash)*imagefontwidth($this->font))/2), 1); $y = round(($h/2)-(imagefontheight($this->font)/2)); $img= imagecreatefrompng($this->bgimg); imagestring($img,$this->font, $x, $y,$this->hash,imagecolorallocate($img,0, 0, 0)); Header ("(captcha-content-type:) image/png"); imagepng($img); imagedestroy($img); $_SESSION['captcha'] = md5($this->hash); } } ?> Thank you in advance Ian
  5. Thank you Barand, Merry Christmas to you too and Happy New Year if not on here before New Year
  6. Thank you so much, is perfect
  7. I just realised its cause got now() in the SQL query what would the query be to make it a full 3 months so starts at the 1st of the month and not the 24th
  8. Ahh ok no I don't want that, want it from 1st October 2015 to 31st December 2015 so is a full 3 months of data
  9. Think I have it now, if ok to quickly check it over to make sure is all ok, it does seem to be on the php page <?php $servername = "localhost"; $username = ""; $password = ""; $dbname = ""; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT MONTHNAME(exrdate) as month, SUM(job_cost) as job_cost, SUM(profit) as profit FROM repairs WHERE exrdate BETWEEN DATE_SUB(now(), INTERVAL 3 MONTH) AND now() GROUP BY YEAR(exrdate), MONTH(exrdate) ORDER BY MONTH(exrdate) DESC"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table class='dashboard'> <tr> <th colspan='5'>Total Repairs Cost and Profit Made(Month)</th> </tr> <tr> <th>Month</th> <th>Total Repairs Costs</th> <th>Total Profit Made</th> </tr>"; // output data of each row while($row = $result->fetch_assoc()) { echo "<tr> <td>".$row["month"]."</td> <td>" . '£' .$row["job_cost"]."</td> <td>" . '£' .$row["profit"]."</td> </tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?>
  10. I thought that too so now got the following in my query SELECT MONTHNAME(exrdate), job_cost as job_cost FROM repairs WHERE exrdate BETWEEN DATE_SUB(now(), INTERVAL 3 MONTH) AND now() October 0.00 November 65.00 November 40.50 November 30.00 December 115.00 December 25.00 December 89.95 December 67.49 December 30.00 December 29.99 December 15.00 and it works but it does it displays the costs individually so added SUM into it and made it output like the following October 507.93 The query I got to output the above is below SELECT MONTHNAME(exrdate), SUM(job_cost) as job_cost FROM repairs WHERE exrdate BETWEEN DATE_SUB(now(), INTERVAL 3 MONTH) AND now() I thought that was how the SUM was added into a SQL query?
  11. Just to confirm will the SQL query just return the past 3 months or do I need to add INTERVAL 3 month into it?
  12. Sorry think I sussed it using the following code <?php $servername = "localhost"; $username = ""; $password = ""; $dbname = ""; // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT MONTHNAME(exrdate) as month, SUM(job_cost), SUM(profit) FROM repairs GROUP BY YEAR(exrdate), MONTH(exrdate) ORDER BY MONTH(exrdate) DESC"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table class='dashboard'> <tr> <th colspan='5'>Total Repairs Cost and Profit Made(Month)</th> </tr> <tr> <th>Month</th> <th>Total Repairs Costs</th> <th>Total Profit Made</th> </tr>"; // output data of each row while($row = $result->fetch_assoc()) { echo "<tr> <td>".$row["month"]."</td> <td>" . '£' .$row["SUM(job_cost)"]."</td> <td>" . '£' .$row["SUM(profit)"]."</td> </tr>"; } echo "</table>"; } else { echo "0 results"; } $conn->close(); ?> I know is not PDO but it works
  13. Ah sorry got the group back in now and is outputting perfect SELECT MONTHNAME(exrdate), SUM(job_cost) FROM repairs GROUP BY YEAR(exrdate), MONTH(exrdate) ORDER BY MONTH(exrdate) DESC It is outputting in phpmyadmin the following December £amount November £amount October £amount Just need to work out the php coding, I will be honest and say I'll get stuck on this bit but taking a guess, I would need the while loop before the echo part That right?
  14. I have the following SELECT MONTHNAME(exrdate), SUM(job_cost) FROM repairs ORDER BY MONTH(exrdate) ASC but is outputting October £507.93 it is not showing the past 3 months? do I need the group back in?
  15. I have the following now SELECT MONTHNAME(exrdate), SUM(job_cost) FROM repairs GROUP BY YEAR(exrdate), MONTH(exrdate) ORDER BY YEAR(exrdate) AND MONTH(exrdate) ASC That outputs it as November December October I tried DESC and put it in descending order so thought ASC would do it with December first then November then October I''ll also get stuck on the php coding but am guessing I will need a while loop before the echo of the data?
  16. Sorry I just worked out that the SQL query above would show all months and not just the previous 3 months so trying to alter it but is outputting wrong within phpmyadmin, I am trying the following SELECT MONTHNAME(exrdate), SUM(job_cost) as job_cost FROM repairs WHERE `exrdate` >= last_day(now()) + interval 1 day - interval 3 month; That is outputting the following October £507.93 I need it like below December £job costs figure £profit figure November £job costs figure £profit figure October £job costs figure £profit figure
  17. Hi I see my post has been moved to the mysql forum which is cool, is just a update as need help with the php coding so thought here is the best place I have got the 3 months data SQL query sorted as tested the following in phpmyadmin, I just need help with the php coding and how it would go Below is the SQL query I have and that works I got the SQL query correct using the following as tested it in the phpmyadmin SELECT MONTHNAME(exrdate), SUM(job_cost) FROM repairs GROUP BY YEAR(exrdate), MONTH(exrdate) How do I now get the php coding to show the following output December £job costs figure £profit figure November £job costs figure £profit figure October £job costs figure £profit figure Thank you in advance Ian
  18. I got the SQL query correct using the following as tested it in the phpmyadmin SELECT MONTHNAME(exrdate), SUM(job_cost) FROM repairs GROUP BY YEAR(exrdate), MONTH(exrdate) How do I now alter the php coding to show the following output December £job costs figure £profit figure November £job costs figure £profit figure October £job costs figure £profit figure
  19. Hi Sorry just a quick one, I was wondering how can I retrieve data from the last 3 months to show the costs and profit and display in PHP I currently have the following <?php $hostname="localhost"; $username=""; $password=""; $db = ""; $dbh = new PDO("mysql:host=$hostname;dbname=$db", $username, $password); foreach($dbh->query('SELECT SUM(job_cost) as job_cost, SUM(profit) as profit, MONTHNAME(exrdate) as month FROM repairs WHERE MONTH(exrdate) = MONTH(CURDATE()) AND YEAR(exrdate) = YEAR(CURDATE())') as $row) { ?> <tr> <td><?php echo $row['month']; ?></td> <td><?php echo '£' . $row['job_cost']; ?></td> <td><?php echo '£' . $row['profit']; ?></td> </tr> <?php } ?> That outputs the following December £costs £profit What I am aiming for is something like the following if possible December £costs for december £profit made in december November £costs for november £profit made in november October £costs for october £profit made in october I found the following code, is it similar to this select * from table where timestamp >= last_day(now()) + interval 1 day - interval 3 month;
  20. Hi I have a invoice script that I got from the following link https://css-tricks.com/editable-invoice-v2/ I am trying to get the invoice stored in a mysql database which it is doing but the prices are being added into the database as 0.00 and found out that it is because it just needs to be numeric but the javascript is adding a £ of the price I tried removing £ from the javascript code but it makes it appear on the page as NaN as the javascript updates the totals itself Is there a way to remove the £ from the javascript so the price gets stored correctly in the mysql database? below is the coding from the javascript file function print_today() { // *********************************************** // AUTHOR: WWW.CGISCRIPT.NET, LLC // URL: http://www.cgiscript.net // Use the script, just leave this message intact. // Download your FREE CGI/Perl Scripts today! // ( http://www.cgiscript.net/scripts.htm ) // *********************************************** var now = new Date(); var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December'); var date = ((now.getDate()<10) ? "0" : "")+ now.getDate(); function fourdigits(number) { return (number < 1000) ? number + 1900 : number; } var today = months[now.getMonth()] + " " + date + ", " + (fourdigits(now.getYear())); return today; } // from http://www.mediacollege.com/internet/javascript/number/round.html function roundNumber(number,decimals) { var newString;// The new rounded number decimals = Number(decimals); if (decimals < 1) { newString = (Math.round(number)).toString(); } else { var numString = number.toString(); if (numString.lastIndexOf(".") == -1) {// If there is no decimal point numString += ".";// give it one at the end } var cutoff = numString.lastIndexOf(".") + decimals;// The point at which to truncate the number var d1 = Number(numString.substring(cutoff,cutoff+1));// The value of the last decimal place that we'll end up with var d2 = Number(numString.substring(cutoff+1,cutoff+2));// The next decimal, after the last one we want if (d2 >= 5) {// Do we need to round up at all? If not, the string will just be truncated if (d1 == 9 && cutoff > 0) {// If the last digit is 9, find a new cutoff point while (cutoff > 0 && (d1 == 9 || isNaN(d1))) { if (d1 != ".") { cutoff -= 1; d1 = Number(numString.substring(cutoff,cutoff+1)); } else { cutoff -= 1; } } } d1 += 1; } if (d1 == 10) { numString = numString.substring(0, numString.lastIndexOf(".")); var roundedNum = Number(numString) + 1; newString = roundedNum.toString() + '.'; } else { newString = numString.substring(0,cutoff) + d1.toString(); } } if (newString.lastIndexOf(".") == -1) {// Do this again, to the new string newString += "."; } var decs = (newString.substring(newString.lastIndexOf(".")+1)).length; for(var i=0;i<decimals-decs;i++) newString += "0"; //var newNumber = Number(newString);// make it a number if you like return newString; // Output the result to the form field (change for your purposes) } function update_total() { var total = 0; $('.price').each(function(i){ price = $(this).html().replace("£",""); if (!isNaN(price)) total += Number(price); }); total = roundNumber(total,2); $('#subtotal').html("£"+total); $('#total').html("£"+total); update_balance(); } function update_balance() { var due = $("#total").html().replace("£","") - $("#paid").val().replace("£",""); due = roundNumber(due,2); $('.due').html("£"+due); } function update_price() { var row = $(this).parents('.item-row'); var price = row.find('.cost').val().replace("£","") * row.find('.qty').val(); price = roundNumber(price,2); isNaN(price) ? row.find('.price').html("N/A") : row.find('.price').html("£"+price); update_total(); } function bind() { $(".cost").blur(update_price); $(".qty").blur(update_price); } $(document).ready(function() { $('input').click(function(){ $(this).select(); }); $("#paid").blur(update_balance); $("#addrow").click(function(){ $(".item-row:last").after('<tr class="item-row"><td class="item-name"><div class="delete-wpr"><textarea>Item Name</textarea><a class="delete" href="javascript:;" title="Remove row">X</a></div></td><td class="description"><textarea name="description">Description</textarea></td><td><textarea class="cost" name="unit_cost">£0</textarea></td><td><textarea class="qty" name="qty">1</textarea></td><td><span class="price"><textarea class="price" name="price">£0</textarea></span></td></tr>'); if ($(".delete").length > 0) $(".delete").show(); bind(); }); bind(); $(".delete").live('click',function(){ $(this).parents('.item-row').remove(); update_total(); if ($(".delete").length < 2) $(".delete").hide(); }); $("#cancel-logo").click(function(){ $("#logo").removeClass('edit'); }); $("#delete-logo").click(function(){ $("#logo").remove(); }); $("#change-logo").click(function(){ $("#logo").addClass('edit'); $("#imageloc").val($("#image").attr('src')); $("#image").select(); }); $("#save-logo").click(function(){ $("#image").attr('src',$("#imageloc").val()); $("#logo").removeClass('edit'); }); $("#date").val(print_today()); }); Thank you in advance Ian I can paste the HTML if needed
  21. Ahh ok, I got the date sorted and saving in the database just got to sort the £ issue now as that is being added in the javascript coding, if I take it out from that, it comes up NaN on the invoice Is there a way to work around it, should I paste it in the javascript forum or keep it here as is bit of both javascript and PHP
  22. Hi I am trying to make this invoice script store in a database https://css-tricks.com/editable-invoice-v2/ I have managed to get invoice_id, customer_name, item, description and qty stored in the database but cant get the following saved date unit_cost price subtotal total amount_paid balance_due the date gets stored as 0000-00-00 and the rest gets stored as 0.00 it uses javascript as well for the totals to update themselves when new lines are added in the invoice When I click submit, I get the following errors Notice: Undefined index: price in /home/sites/it-doneright.co.uk/public_html/admin/sale-items/new-invoice.php on line 78 Notice: Undefined index: subtotal in /home/sites/it-doneright.co.uk/public_html/admin/sale-items/new-invoice.php on line 78 Notice: Undefined index: balance_due in /home/sites/it-doneright.co.uk/public_html/admin/sale-items/new-invoice.php on line 79 Below is the coding I have so far <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); ?> <?php if(isset($_POST["submit"])){ $hostname='localhost'; $username=''; $password=''; try { $dbh = new PDO("mysql:host=$hostname;dbname=dbname",$username,$password); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // <== add this line $sql = "INSERT INTO invoices (invoice_id, customer_name, date, item, description, unit_cost, qty, price, subtotal, amount_paid, balance_due) VALUES ('".$_POST["invoice_id"]."','".$_POST["customer_name"]."','".$_POST["date"]."','".$_POST["item"]."','".$_POST["description"]."','".$_POST["unit_cost"]."','".$_POST["qty"]."','".$_POST["price"]."','".$_POST["subtotal"]."', '".$_POST["amount_paid"]."','".$_POST["balance_due"]."')"; if ($dbh->query($sql)) { echo "<script type= 'text/javascript'>alert('New Record Inserted Successfully');</script>"; } else{ echo "<script type= 'text/javascript'>alert('Data not successfully Inserted.');</script>"; } $dbh = null; } catch(PDOException $e) { echo $e->getMessage(); } } ?> <div id="page-wrap"> <form action="" method="post"> <textarea id="header">INVOICE</textarea> <div id="identity"> <textarea id="address"> </textarea> <div id="logo"> <div id="logoctr"> <a href="javascript:;" id="change-logo" title="Change logo">Change Logo</a> <a href="javascript:;" id="save-logo" title="Save changes">Save</a> | <a href="javascript:;" id="delete-logo" title="Delete logo">Delete Logo</a> <a href="javascript:;" id="cancel-logo" title="Cancel changes">Cancel</a> </div> <div id="logohelp"> <input id="imageloc" type="text" size="50" value="" /><br /> (max width: 540px, max height: 100px) </div> <img id="image" src="images/logo/it-done-right.jpg" /> </div> </div> <div style="clear:both"></div> <div id="customer"> <textarea id="customer-title" name="customer_name"> Widget Corp. c/o Steve Widget </textarea> <table id="meta"> <tr> <td class="meta-head">Invoice #</td> <td><textarea name="invoice_id">000123</textarea></td> </tr> <tr> <td class="meta-head">Date</td> <td><textarea id="date" name="date">December 15, 2009</textarea></td> </tr> <tr> <td class="meta-head">Amount Due</td> <td><div class="due">£875.00</div></td> </tr> </table> </div> <table id="items"> <tr> <th>Item</th> <th>Description</th> <th>Unit Cost</th> <th>Quantity</th> <th>Price</th> </tr> <tr class="item-row"> <td class="item-name"><div class="delete-wpr"><textarea name="item">Web Updates</textarea><a class="delete" href="javascript:;" title="Remove row">X</a></div></td> <td class="description"><textarea name="description">Monthly web updates for http://widgetcorp.com (Nov. 1 - Nov. 30, 2009)</textarea></td> <td><textarea class="cost" name="unit_cost">£650.00</textarea></td> <td><textarea class="qty" name="qty">1</textarea></td> <td><span class="price"><textarea class="price" name="price">£650.00</textarea></span></td> </tr> <tr id="hiderow"> <td colspan="5"><a id="addrow" href="javascript:;" title="Add a row">Add a row</a></td> </tr> <tr> <td colspan="2" class="blank"> </td> <td colspan="2" class="total-line">Subtotal</td> <td class="total-value"><div id="subtotal"><textarea name="subtotal">£875.00</textarea></div></td> </tr> <tr> <td colspan="2" class="blank"> </td> <td colspan="2" class="total-line">Total</td> <td class="total-value"><div id="total"><textarea name="total">£875.00</textarea></div></td> </tr> <tr> <td colspan="2" class="blank"> </td> <td colspan="2" class="total-line">Amount Paid</td> <td class="total-value"><textarea id="paid" name="amount_paid">£0.00</textarea></td> </tr> <tr> <td colspan="2" class="blank"> </td> <td colspan="2" class="total-line balance">Balance Due</td> <td class="total-value balance"><div class="due"><textarea name="balance_due">£875.00</textarea></div></td> </tr> </table> <div id="terms"> <h5>Terms</h5> <textarea>NET 30 Days. Finance Charge of 1.5% will be made on unpaid balances after 30 days.</textarea> </div> <div style="clear: both;"> <input type="submit" value=" Submit " name="submit"/> </div> </form> </div> I know I have to do more code to prevent SQL attacks but just want to get it fully working first and will then do the SQL attack coding
  23. I am not using it in a wordpress site though, is just in a hand coded php website
  24. Hi I was just seeing if anyone has had any experience with open web analytics as looking to make it so that the login part is removed and the admin user stays logged in as am looking to integrate it into my own admin panel I built in PHP I saw a post about it and they said to look how the wordpress plugin does it so looked at that file and they said to looked at the following line, they said to set the auth status of the current user from PHP. $dispatch->attachFilter('auth_status', 'owa_wpAuthUser',0); But am unsure what to do with that line and to alter it? Thank you in advance Ian
  25. Think I have it working now as got I am logged in as and got the account, property and view in select menus and is pointing to the site I want to see the data for but is only outputting sessions graph, how do I add extra components so can see all the other bits like bounce rate, browser, operating system users etc like it is when logging into google analytics the normal way?
×
×
  • 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.