Jump to content

compgeek83

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

compgeek83's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. that helped in a way, now I get "-0.64999999999998" instead of the error, if I echo out each variable they are identical though
  2. $balance_due = $salesreceipt_grandtotal - $payments_applied; if $balance_due is 0 I get "5.6843418860808E-14" instead of 0. What can I do to return 0 instead of this error?
  3. What is the file name of the code you posted? test.php What URL are you entering into your browser? 192.168.2.2/test.php What is the result you get in the browser window? http://192.168.2.2/test.php What does a 'view source' in your browser show? nothing as the browser thinks I'm viewing an image
  4. this is the code I'm trying, although I get the same results with other php scripts I've tried this isn't specifically what I'm trying to accomplish, just some code I found online, but still it should work <? // show the correct header for the image type header("Content-type: image/jpg"); // an email address in a string $string = "email@example.com"; // some variables to set $font = 4; $width = ImageFontWidth($font) * strlen($string); $height = ImageFontHeight($font); // lets begin by creating an image $im = @imagecreatetruecolor ($width,$height); //white background $background_color = imagecolorallocate ($im, 255, 255, 255); //black text $text_color = imagecolorallocate ($im, 0, 0, 0); // put it all together imagestring ($im, $font, 0, 0, $string, $text_color); // and display imagejpeg ($im); ?> and the results of that script produce nothing but one line of text that contains the url to where the page is at http://192.168.2.2/webapp/testpage.php
  5. I'm running the LAMP stack on ubuntu 10.04. trying to display dynamically generate images using GD or otherwise, even tried off the shelf software for the heck of it, that doesnt work either. All I get, whether I open my test website in IE or Firefox, local or remote, is the filename of the image instead of the desired generated image. any ideas? safe_mode is not on
  6. having a small issue setting up a search, trying to use check boxes, here is my form code <form action="workorder_index.php" method="POST"> <input type="checkbox" name="wos_0" <? if($wos_0 != NULL) { echo "checked"; }?>>0 - Active <input type="checkbox" name="wos_1" <? if($wos_1 != NULL) { echo "checked"; }?>>1 - Completed awaiting pickup <input type="checkbox" name="wos_2" <? if($wos_2 != NULL) { echo "checked"; }?>>2 - Completed and out the door <input type="checkbox" name="wos_3" <? if($wos_3 != NULL) { echo "checked"; }?>>3 - Waiting call back <input type="checkbox" name="wos_4" <? if($wos_4 != NULL) { echo "checked"; }?>>4 - Waiting for parts<br> <input type="checkbox" name="wos_5" <? if($wos_5 != NULL) { echo "checked"; }?>>5 - Parts in waiting for completion <input type="checkbox" name="wos_6" <? if($wos_6 != NULL) { echo "checked"; }?>>6 - not used <input type="checkbox" name="wos_7" <? if($wos_7 != NULL) { echo "checked"; }?>>7 - Overdue for pickup <input type="checkbox" name="wos_8" <? if($wos_8 != NULL) { echo "checked"; }?>>8 - Scrapped per customer <input type="checkbox" name="wos_9" <? if($wos_9 != NULL) { echo "checked"; }?>>9 - Scrapped by overdue<br><br> <input type="hidden" value="1" name="customsearch"> <input type="Submit" value="Update"> </form> here is my handling code $wos_0=$_POST[wos_0]; $wos_1=$_POST[wos_1]; $wos_2=$_POST[wos_2]; $wos_3=$_POST[wos_3]; $wos_4=$_POST[wos_4]; $wos_5=$_POST[wos_5]; $wos_6=$_POST[wos_6]; $wos_7=$_POST[wos_7]; $wos_8=$_POST[wos_8]; $wos_9=$_POST[wos_9]; if(isset($_POST['customsearch'])) { $str=''; if($wos_0 != NULL) { $str.= "'0'"; } if($wos_1 != NULL) { $str.= ",'1'"; } if($wos_2 != NULL) { $str.= ",'2'"; } if($wos_3 != NULL) { $str.= ",'3'"; } if($wos_4 != NULL) { $str.= ",'4'"; } if($wos_5 != NULL) { $str.= ",'5'"; } if($wos_6 != NULL) { $str.= ",'6'"; } if($wos_7 != NULL) { $str.= ",'7'"; } if($wos_8 != NULL) { $str.= ",'8'"; } if($wos_9 != NULL) { $str.= ",'9'"; } $query="SELECT * FROM workorders a INNER JOIN customers b ON a.customer_id = b.customer_id WHERE a.workorder_status IN (".$str.") ORDER BY a.workorder_id"; } everything works as intended as long as the first check box remains checked, the others can be checked or not, if the first box gets unchecked I get this error basically I can't get the commas right, ...? any help is much appreciated
  7. Anyone know of a payment gateway/processor with a PHP ready API that supports card-swiped transactions in a retail store? I'm writing an application to be used internally in a small business as a cash register/customer database/service database.
  8. finally got it to work using the following update query UPDATE tcc_timeclock SET timeout='$currtime' WHERE login='$employee' AND realdate= CURDATE() ORDER BY timein DESC LIMIT 1 turns out I didnt have a primary key assigned, once I did that to my "id" field it took right off, now it only updates the latest or newest record in the database that matches the employee in question and today's date
  9. I believe I have everything down except the above problem, can I make sure I only update 1 record with an update statement such as the following? UPDATE tcc_timeclock SET timeout='$currtime' WHERE login='$employee' AND realdate= CURDATE() ORDER BY timein DESC LIMIT 1 it doesnt seem to work but from what I read it should only update 1 row after it orders all available rows (that match todays date and the employee in question) descending
  10. that works great, but how do I account for someone that takes a lunch break? If the person clocks in and then out and then back in I have 2 entries for that day, when they clock out the second time it updates both entries to the time of the second clock out.
  11. I have made a simple script that has 2 links, one for an employee to clock in and one for them to clock out, this in turn updates a database that has the following fields, "id", "login", "time", "reason", where id is an auto increment, login is the username, time is the time of the "punch" and reason is a code of 1 or 2 (for now), with 1 really meaning clock in and 2 really meaning clock out. What I need is a way to show this on a report, that is I select the employees username and it brings up a list of times worked between the selected dates. Report John Smith Date In Out Total 2010-06-04 09:05 11:32 02:27 any takers? I'm stumped here
×
×
  • 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.