Jump to content

Alexhoward

Members
  • Posts

    310
  • Joined

  • Last visited

    Never

Everything posted by Alexhoward

  1. cheers techie, Aplogies, on their reports page i'd like a cell that shows there earnings of all time. so, Total Earnings : (a sum of every earnings amount from the table attached to their username) by month: (select a month) (a sum of every earnings amount from the table attached to their username and chosen month)
  2. hey!! i'm soo effing happy!! thanks to everyone for all your help on this one; got it work like this: <?php $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; $test = mysql_query("select wage from dynamitepayrate where username = '".$mysite_username."' AND '$y-$m-$d' between start AND end ") ; $t = mysql_fetch_assoc($test); echo ($hours1 + $hours2) * $t['wage'] ; ?> where $hours1 is the diffence between the 1st set of times, and $hours2 the second sweet!! the second and last question, for this section then, is how to add up all the rows from the table (hours(now including amount earned)), where the username = $mysite_username firstly for all time, secondly by month Thanks again!! p.s. is between saying >= and <= or just > and < ....?
  3. Hi techie, the second way looks good, however i only have the variables: $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; can still do something with these..? also i only have start and end in the payrate table i'd love to do something like <?php $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; $test = mysql_query("select wage from dynamitepayrate where username = '".$mysite_username."' AND $y,'-',$m,'-',$d > start AND $y,'-',$m,'-',$d < end"); ?>
  4. I'd really like to do something like this: <?php $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; $test = mysql_query("select wage from dynamitepayrate where username = '".$mysite_username."' AND start <= '".$y,"-",$m,"-",$d."' AND end >= '".$y,"-",$m,"-",$d."'"); $t = mysql_fetch_assoc($test); echo $t['wage']; ?> it doesn't work, but sure i'm on the right lines...?
  5. thanks a lot, but man this is confusing.... i've jiggled it to match my table, however i'm getting the error "Column 'username' in field list is ambiguous"
  6. hi, i've set the date fields in mysql to date, so: 2008-12-31 the code, $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; echo $y,"-",$m,"-",$d will produce 2008-12-31 (if that's what's chosen) for the moment as there is no pay changes the start date is 2008-01-01 and the end date is 2010-01-01
  7. Hi guys. ok. i was going to just pull it all from the tables (mysql) but decided it's probaly better and easier to calcuate the wage with the hours from the event date in the 1st instance and insert that into the hours table. then add all the wages up together for the total earnings of all time is that a fair assumption?
  8. i've probably just coded it wrong.. $d = $_POST['day']; $m = $_POST['month']; $y = $_POST['year']; if($y,"-",$m,"-",$d >= 'dynamitepayrate'.'start' AND if($y,"-",$m,"-",$d <= 'dynamiterate'.'start' { echo $hours1 + $hours2 * 'dynamitepayrate'.'wage' { else{ echo "0" } i've already defined $hours1 and $hours2 further up the script. they just work out the total hours of the split time actually...looking at it... i don;t think it makes sense
  9. oh, and to sasa i tried it, and i'm getting errors. as i'm guessing i also need to use { and else thanks for your suggestion
  10. ah, ok payrate: name | start date | end date | rate (holding their wage info) hours: name | date | location | day | month | Year | start time1 | end time 1 | start time 2 | end time 2 | total hours | (hours info, as we do split shifts, i have the total hours calc down) i've put a start/end date on the payrate, to allow for pay rises, without effect total earnings. does this help at all...?
  11. Hi thanks for the reply, i'm not sure what you 're after...
  12. Hi guys, i was wondering if anyone could help me. I'm making a page for employees to enter their hours. I have to basics down, but i'm now trying to creat a reports page so they can view their total earnings, and a detailed work record, by selected month. I've got a simlar query in ms access but i'm not sure how to word it in php... basically, to find total earnings from total hours, per day: (in access) iif ([event date] >= [payrate]![start] AND iif [event date] <= [payrate]![end], [payrate]![rate] * [total hours],0) given that there is a table with the |name|start date|end date|rate| i'm just not sure how to do this in php i'll glady give more detail if this is confusing Thanks in advance!
  13. Excellent! thankyou, i shall play with the code and report back thanks again!
  14. Hi, Thanks for the reply yes, they will be entering: Date: day(dropdown 1-31), month(dropdown Jan-Dec), year(dropdown 08 - 15) Location: (textbox) Start Time: (listbox 00:00 - 23:45) End Time : (listbox 00:00 - 23:45) Hours Worked: ???
  15. Hi Guys, i'm trying to create a page for employees to input their hours worked. the part i'm trying to calculate consists of two input boxes: Start Time: Finish Time: i have made these selectable from a list a list box, in the format 00:00, in 15 minute intervals, in 24hr. however, i'm not sure on how to calculate the total hours....? sometimes we may work from 18:00 to 02:00 does anyone have any ideas? thanks in advance!
  16. Excellent, so are you suggesting having a seperate form for every input box, rather than one form around the entire table...?
  17. ah, it's working with $_REQUEST is this the correct one to be using then..?
  18. Hi GuiltyGear thanks for the info i only cut out that section, so that's why there's no form. it's quite big, and everything else posts fine. what i'm trying to do is post the form, and if this the criteria says "whatever", post like this, and if not post like this but it's the picking up before i insert into the database that i'm sruggling with Thanks for your help
  19. ok, but that bit works fine. i get the results, and it doesn't say "there is no data in table.." so don't worry about that it good practice to do that thou
  20. hi, the post form works fine. it's the getting it before i insert it into the table that's the problem, is this what you're pointing at...? cheers
  21. Hi Guys Thanks the speedy replies i'm trying if($_GET['example'] == "boris"){ to work but it's coming back with: Undefined index: example the post fields name is definatly the same... however i'm posting from a drop down, populated from mysql, is this a problem...? <?php include("config.php"); // connect to the mysql server $link = mysql_connect($server, $db_user, $db_pass) or die ("Could not connect to mysql because ".mysql_error()); // select the database mysql_select_db($database) or die ("Could not select database because ".mysql_error()); echo'<select name="example" style="width:327px">'; $res=mysql_query("select examp from examples"); if(mysql_num_rows($res)==0) echo "there is no data in table.."; else for($i=0;$i<mysql_num_rows($res);$i++) { $row=mysql_fetch_assoc($res); echo"<option>$row[cat]</option>"; } ?> Thanks again
  22. Good Evening i'm a bit stumped as was wondering if anyone could help me... what i'm trying to do is look at the contents of the form, once the submit button has been pressed, and say if this field is there do this, and if not do this. i'm trying things like: if ($_GET['example'] == "boris") ; { .... if ($_POST['example'] == "boris") ; { .... am i going about it all the wrong way...? also i'm using php5, so does == still work...? Thanks in advance
  23. Hello. thanks for the post however to file is saved as imageupload.php.... ...
×
×
  • 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.