Jump to content

flemingmike

Members
  • Posts

    472
  • Joined

  • Last visited

Everything posted by flemingmike

  1. i was just taking a few different fields and making the timestamp. i have now made it include the year and it is almost working. it is giving me the difference in time, but not days. im getting a difference on 60minutes. is there a different way to do this so the whole timestamp gets subtracted?
  2. hello, im trying to figure out the difference between 2 numbers in minutes. here is what i have: $tsignin="09-05 10:30:00"; $tsignina="09-06 11:30:00"; $log_in_time_stringsa = strtotime($tsignin); $log_out_time_stringsa = strtotime($tsignina); $difference_in_secondssa = ($log_out_time_stringsa - $log_in_time_stringsa); $tsigna = ($difference_in_secondssa / 60); $tsigna2 = number_format(round($tsigna)); the 09-05 is sept 5, and 09-06 is sept 6. this works if the month and date are not included. any ideas for me so i can figure out the total difference between date/times?
  3. Hi All, i use the following to send me calendar appointments. does anyone know what i can do to remove a calendar event? note: the uid and job times are genterated for each event. $to = "[email protected]"; $subject = "JOB"; $message = "BEGIN:VCALENDAR\r\n"; $message .= "METHOD:PUBLISH\r\n"; $message .= "VERSION:2.0\r\n"; $message .= "BEGIN:VEVENT\r\n"; $message .= "SEQUENCE:0\r\n"; $message .= "DESCRIPTION:ABCDEFGH\r\n"; $message .= "LOCATION:Downtown\r\n"; $message .= "DTSTART:20110815T173300\r\n"; $message .= "DTSTAMP:20110815T145100\r\n"; $message .= "SUMMARY:JOB SUMMARY\r\n"; $message .= "UID:EC9439B1-FF65-11D6-9973-787957F99D04\r\n"; $message .= "DTEND:20110815T193300\r\n"; $message .= "BEGIN:VALARM\r\n"; $message .= "TRIGGER;RELATED=START:-PT120M\r\n"; $message .= "ACTION:DISPLAY\r\n"; $message .= "END:VALARM\r\n"; $message .= "END:VEVENT\r\n"; $message .= "END:VCALENDAR\r\n"; $headers = "From: [email protected]\r\n"; $headers .= "MIME-version: 1.0\r\n"; $headers .= "Content-type: text/calendar; method=PUBLISH; charset=UTF-8\r\n"; $headers .= "Content-transfer-encoding: 7bit"; mail($to,$subject,$message,$headers);
  4. hmm.. what im trying to do is have people check in with there start and end dates. at the end i want someone to be able to query to see if anybody else will be checked in on overlapping dates. so if im checked in from may 5-10, and you are checked in may 7-12, i want that to show up in the query so i can see that you and i will be checked in between may 7-10. is that possible?
  5. problem 1: field 1 - id field 2 - start date field 3 - end date example data field 1 - 22 field 2 - 2011-05-12 field 3 - 2011-05-16 im trying to figure out how to populate all dates between field 2 and field 3 and have them as the column header in a table. maybe something like: echo "<table border='0' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='90%' align='center'>"; echo "<tr> <th>2011-05-12</th> <th>2011-05-13</th> <th>2011-05-14</th> <th>2011-05-15</th> <th>2011-05-16</th> </tr>";
  6. hello all, i have 2 fields in a table. one as startdate and one as enddate. i was wondering if there is a way to make a table with all the dates from start to end as the column headers. then i want to check the table to see if there are any other entries that exist within those dates. and make a new row under with a Y in the cell that it exists in. any direction/help is much appreciated. thanks, mike
  7. shit. when i was testing with a batch file in the root of c that just changed directories, it was working. now i am trying exec('c:\WINDOWS\system32\cmd.exe /c START D:\Scripts\rh.bat'); here is rh.bat cd\ net stop "FireDaemon Service: Helium7" net start "FireDaemon Service: Helium7" exit Any ideas why this may not work?
  8. thanks guys. i just found this also: http://www.iis-aid.com/articles/trouble_shooting/warning_exec_function_exec_unable_to_fork if anyone is having issues with this, you need to give permissions.
  9. how would i properly write a shutdown restart with a time of 45 seconds exec ('c:\\WINDOWS\\system32\\shutdown.exe /r /t 45');
  10. Hello all. Is it possible to have a link that can start and stop a service on the web server? It is a windows 2003 server. Thanks, Mike
  11. do you have any direction for me? what might i google?
  12. hello, since php is run server side, can i launch a program (.exe) on the server from a link?
  13. hello, im wondering how to properly code the following. $stdate = date( 'Ymd', strtotime($pdate) ); $sttime = date( 'His', strtotime($tstart1) ); $dtStart = ".$stdate.'T'.$sttime.'Z'"; echo "$dtStart"; i would like the echo to read 20110309T050000Z
  14. kind of like how i just typed that address, but it detected that it was a url and made it a link.
  15. hello, is there a way to check a query to see if a link is in it? like if i have $description=$row['description']; and $description says something like Mikes bio is at http://www.website.com/mike/ i want to be able to click that link is this possible?
  16. awesome. thanks!
  17. thanks, but no luck.
  18. hello, have a question. im trying to do a select * where id exists in array $id8 here is my array $result8 = mysql_query("SELECT * FROM customers WHERE whosclient = 'Lansoft'"); while($row8 = mysql_fetch_array($result8)) { $id8=$row8['id']; } here is my select code. it is only returning results for the highest number in the array $result = mysql_query("SELECT * FROM timesheets WHERE status = 3 AND billable = 1 AND client = '$id8' ORDER BY date, starttime"); while($row = mysql_fetch_array($result)) { Thanks for any help!
  19. when i do it that way, it gets rid of the error, but it isnt adding up the values. it is only showing me that $total1p is equal to the newest entry in the table.
  20. so in this case, echo "<td align='center'>"; echo "<table border='0' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='100%' align='center'>"; $result7 = mysql_query("SELECT * FROM parts WHERE timesheet = '$id'"); while($row7 = mysql_fetch_array($result7)) { $partdescription=$row7['description']; $partprice=$row7['price']; $partprice = number_format($partprice, 2, '.', ','); $replacementp = array(","); $pnonep = array(""); $pplainp = str_replace($replacementp, $pnonep, $partprice); $totalp += $pplainp; $total1p = number_format($totalp, 2, '.', ','); echo "<tr>"; echo "<td>" . $partdescription . "</td>"; echo "<td align='center' width='30'>$" . $partprice . "</td>"; echo "</tr>"; } echo "</table>"; echo "</td>"; id want it to look like echo "<td align='center'>"; echo "<table border='0' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='100%' align='center'>"; $result7 = mysql_query("SELECT * FROM parts WHERE timesheet = '$id'"); $totalp=0; while($row7 = mysql_fetch_array($result7)) { $partdescription=$row7['description']; $partprice=$row7['price']; $partprice = number_format($partprice, 2, '.', ','); $replacementp = array(","); $pnonep = array(""); $pplainp = str_replace($replacementp, $pnonep, $partprice); $totalp += $pplainp; $total1p = number_format($totalp, 2, '.', ','); echo "<tr>"; echo "<td>" . $partdescription . "</td>"; echo "<td align='center' width='30'>$" . $partprice . "</td>"; echo "</tr>"; } echo "</table>"; echo "</td>";
  21. im trying to add all of the $pplain together
  22. where would i put that?
  23. so a $total=0 at the start should solve i imagine?
  24. hello, is anybody able to help me with why i am getting an undefined variable "total" on line 109? <?php include '../auth5.php'; include '../config.php'; include '../javascript.php'; include 'style.php'; echo "<br />"; echo "<table border='1' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='98%' align='center'>"; echo "<tr><td width='100%' colspan='7' align='center'><b>Unbilled Work</b></td></tr>"; echo "<tr> <th align='center'>Date</th> <th align='center'>Client</th> <th align='center'>Tech</th> <th align='center'>Service Report</th> <th align='center'>Hours Billed</th> <th align='center'>Total</th> <th align='center'>Parts Used</th> </tr>"; $result = mysql_query("SELECT * FROM timesheets WHERE status = 3 AND billable = 1 ORDER BY date, starttime"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $tech=$row['tech']; $date=$row['date']; $date1=date( 'M d', strtotime($date) ); $date2=date( 'D M j, Y', strtotime($date) ); $starttime=$row['starttime']; $starttime1=date( 'g:i a', strtotime($starttime) ); $esttime=$row['esttime']; $esttime1=date( 'g:i a', strtotime("$esttime hours, $starttime") ); $endtime=$row['endtime']; $endtime1=date( 'g:i a', strtotime($endtime) ); $client=$row['client']; $description=$row['description']; $description=nl2br($description); $status=$row['status']; $report=$row['report']; //$report=nl2br($report); $billable=$row['billable']; $remote=$row['remote']; $parts=$row['parts']; if($endtime == "01:11:00") { $tbilled3 = ""; $endtime1 = ""; } elseif(empty($endtime)) { $tbilled3 = ""; $endtime1 = ""; } else { $log_in_time_string = strtotime($starttime); $log_out_time_string = strtotime($endtime); $difference_in_seconds = ($log_out_time_string - $log_in_time_string); $tbilled = ($difference_in_seconds / 3600); if($tbilled < 0) { $tbilled1 = $tbilled + 24; } else { $tbilled1=$tbilled; } $tbilled2 = number_format(round($tbilled1*4)/4,2); if($remote == 1) { if($tbilled2 < 1.5) { $tbilled3 = "2"; } else { $tbilled3 = $tbilled2 + 0.5; } } else { $tbilled3 = $tbilled2; } } $result5 = mysql_query("SELECT * FROM customers WHERE id = '$client'"); while($row5 = mysql_fetch_array($result5)) { $clientname=$row5['name']; $rate=$row5['rate']; } $result6 = mysql_query("SELECT * FROM staff WHERE id = '$tech'"); while($row6 = mysql_fetch_array($result6)) { $tech=$row6['name']; } $nlength = strlen($report); $nremove = 30 - $nlength; $report1 = substr($report, 0, $nremove); $jobbill=$tbilled3*$rate; $jobbill = number_format($jobbill, 2, '.', ','); $replacement = array(","); $pnone = array(""); $pplain = str_replace($replacement, $pnone, $jobbill); $total += $pplain; $total1 = number_format($total, 2, '.', ','); echo "<tr>"; echo "<td align='center'>" . $date2 . "</td>"; echo "<td align='center'>" . $clientname . "</td>"; echo "<td align='center'>" . $tech . "</td>"; echo "<td>" . $report1 . "</td>"; echo "<td align='center'>" . $tbilled3 . "</td>"; echo "<td align='center'>$" . $jobbill . "</td>"; echo "</tr>"; } echo "<tr>"; echo "<td colspan='5' align='right'><b>Total :</td>"; echo "<td align='right'><b>$" . $total1 . "</td>"; echo "<tdcolspan='2'></td>"; echo "</tr>"; echo "</table>"; ?>
  25. im sorry, i completely screwed that up.. i know for that i use mysql_real_escape_string. its when im trying to echo my data, it is all coming on one line.
×
×
  • 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.