Jump to content

ankycooper

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by ankycooper

  1. Hey Thanks for replying... But How did you get the number.....24192000. i want to pull up $months intervals.... $months can be 10 Months or 1 Month Or 12 Months ... I mean Anything Looking Forward For help
  2. hi ??? I Have a table named prop_tbl with a lot of feilds, one of the feilds is create_date which stores the timestamp of the record creation. Now i want to pull up the records which are x months old. please help $months=10; $nowstamp=time(); $expirestamp=strtotime("-$months month",$nowstamp); "SELECT * FROM prop_tbl WHERE create_date<='$expirestamp'" but it simply thows all the records Please help I just want records whose create_date is greater than equal to $months
  3. as per the time stamps the difference is more than 10 hours so more than 600 min but it does not give the desired results Please Help
  4. Sorry There was a Typo But still The Result is absurd <?php $f_clkin=1183405223; $f_clkbrkin=1183405451; $f_clkbrkout=1183440836; /// set here $f_clkout=1183441924; // and here:: why are you setting this 2x? $t1=$f_clkbrkout-$f_clkbrkin; $t2=$f_clkout-$f_clkin; // $f_clkout .. not defined in this code piece $min=$t2-$t1; $min=$min/60; ?>
  5. I'm calculating Time Difference (in min) and it is giving me a absurd value $f_clkin=1183405223; $f_clkbrkin=1183405451; $f_clkbrkout=1183440836; $f_clkbrkout=1183441924; $t1=$f_clkbrkout-$f_clkbrkin; $t2=$f_clkout-$f_clkin; $min=$t2-$t1; $min=$min/60; So Now $min has a value of 21.933333333333 min How is it possible?? am i doing something wrong.... :-\ :-\ Please help
  6. Hi i have installed PHP 5.2.2 and Mysql 5.1.18 Beta. now on evey php page i get Error in my_thread_global_end(): 2 threads didn't exit it listed as a mysql bug and there is a patch for it but i cant find the download and install instructions for it Please Help
  7. ankycooper

    TKS

    Time Keeping System Can u Suggest me some Time keeping and attendence PHP application
  8. Hi I'm Making a basic Clock In Clock Out Application In which every employee Has an Emp ID/username When he comes to the office he needs to do clock in if he takes a break he need to do break in and break out when he returns from the break finally clock out when he leaves for the day the table is something like this shift is the date of the shift, username=empid, nameemp=name header=(woff, Leave, Working), clkin=clockin_timestamp, clkbrkin=breakin_timestamp, clkbrkout=breakin_timestamp, clkout=clockout_timestamp, hours=no of hours excluding break and comments will have a leave Id if on a leave table 1 pid | shift | username | nameemp | header | clkin | clkbrkin | clkbrkout | clkout | hours | comments Now if the employee works after 00:00Am the date will change and will not look for the old rec....Its confusing Also The user can apply leaves and the admin can approve them table 2 lid | username | name | fdate | edate | reason | status if the manager aproves the following should also create a leave rec in table 1 also the user table has a feild woff=weekly off which should also create a rec for the emp if a weekly off Please give suggestions, links or example apps Thanks
  9. hi i have 2 time stamps i want to calculate the Difference in minutes please help Thanks In Advance
  10. hi my system clock is in IST but My php code gives an output in GMT/UTC how to set my timezone in php.ini there is date.timezone = i tried +5.5 and also IST but none of them work Need Help
  11. Hi Is there a class or a script by which i can let users upload thier excel data to mysql. if the record already exists it will update it Thanks
  12. hey the following gives me time in GMT Code: $today = date("F j, Y, g:i a"); However my time zone is IST and and my Machine is SET To IST Please Help 
  13. hey the following gives me time in GMT [code] $today = date("F j, Y, g:i a"); [/code] However my time zone is IST and and my Machine is SET To IST Please Help
  14. I Think no one is a real Guru Who can solve this
  15. while repeats the entire thing i just want the last column to be repeated Please help
  16. hi i have a database in which there are following fields name month startdate enddate starttime endtime wf1 wf2 wf3 lets take a sample data jay peter march 2006-09-03 2006-09-24 07:00 16:00 Saturday Sunday NA there are sevral such records i want to populate a table like this (see the attachment) Need some help But The code only populates 1st  record [code]<html> <link rel="stylesheet" type="text/css" href="../scripts/main.css" > <head> <title>Roster Management System</title> </head> <body bgcolor="#C7E1F4"> <div align="center">   <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#EEEEEE">   <tr style="font-size: 12px; color: #ffffff; font-family: Arial, Helvetica, sans-serif">         <td class="info" style='border:1px solid #C7E1F4; background-color: #2955B5' width="100" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Date&nbsp;&nbsp;</font></b></td> <td class="info" style="border:1px solid #C7E1F4; background-color: #2955B5" width="65" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Day&nbsp;&nbsp;</font></b></td> <td class="info" style="border:1px solid #C7E1F4; background-color: #2955B5" width="100" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Time&nbsp;&nbsp;</font></b></td> <?php function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($day, $month, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$day/$month/$year"; return $date; } } $mmyy=$_GET['mmyy']; include '../config/dbinfo.inc.php'; @mysql_connect($host,$user_name,$pass_word); @mysql_select_db($database) or die( "Unable to select database"); $sql = "SELECT * FROM emproster where mmyy='$mmyy'"; $sql = "SELECT * FROM emproster where mmyy='$mmyy'";   $res = mysql_query($sql) or die (mysql_error());   $r = mysql_fetch_assoc($res);   echo "<td class='info' style='border:1px solid #C7E1F4; background-color: #2955B5' width='150' height='1'>     <p align='left'><b><font color='#FFFFFF'>&nbsp;".$r['name']."</font></b></td>"; echo "</tr>";   $days = (date("j", strtotime($r['edate'])) - date("j", strtotime($r['sdate']))) + 1;   $sdate = date("Y-m-d", strtotime($r['sdate']));   for($i=0; $i<$days; $i++){     $day = date("D", strtotime($sdate));     $fullday = date ("l", strtotime($sdate));       if($fullday == $r['wf1'])   {         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   elseif($fullday == $r['wf2'])   {         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   elseif($fullday == $r['wf3']){         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   else {         $st_time = "<b><font color='#2955B5'><span style='background-color: #FFFF99'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$r['stime']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font></b>";         $e_time = "<b><font color='#2955B5'><span style='background-color: #CCFF99'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$r['etime']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font></b>";       }   $sdate=dateconvert($sdate, 1);   echo "<tr>";   echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF' rowspan=2><b><font color='#2955B5'>&nbsp;$sdate</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF' rowspan=2><b><font color='#2955B5'>&nbsp;$day</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'><b><font color='#2955B5'>&nbsp;Report Time</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'>$st_time</td>";     echo "</tr>";     echo "<tr>";   echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'><b><font color='#2955B5'>&nbsp;Drop Time</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'>$e_time</td>";     echo "</tr>";     $sdate = date("Y-m-d", strtotime("$sdate +1 day"));   }   echo "</table>"; ?>   </center></div>[/code] [attachment deleted by admin]
  17. This Code Works For ME But it only shows the 1st record and does not populate all of them [code]<html> <link rel="stylesheet" type="text/css" href="../scripts/main.css" > <head> <title>Roster Management System</title> </head> <body bgcolor="#C7E1F4"> <div align="center">   <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#EEEEEE">   <tr style="font-size: 12px; color: #ffffff; font-family: Arial, Helvetica, sans-serif">         <td class="info" style='border:1px solid #C7E1F4; background-color: #2955B5' width="100" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Date&nbsp;&nbsp;</font></b></td> <td class="info" style="border:1px solid #C7E1F4; background-color: #2955B5" width="65" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Day&nbsp;&nbsp;</font></b></td> <td class="info" style="border:1px solid #C7E1F4; background-color: #2955B5" width="100" height="1">     <p align="left"><b><font color='#FFFFFF'>&nbsp;Time&nbsp;&nbsp;</font></b></td> <?php function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($day, $month, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$day/$month/$year"; return $date; } } $mmyy=$_GET['mmyy']; include '../config/dbinfo.inc.php'; @mysql_connect($host,$user_name,$pass_word); @mysql_select_db($database) or die( "Unable to select database"); $sql = "SELECT * FROM emproster where mmyy='$mmyy'"; $sql = "SELECT * FROM emproster where mmyy='$mmyy'";   $res = mysql_query($sql) or die (mysql_error());   $r = mysql_fetch_assoc($res);   echo "<td class='info' style='border:1px solid #C7E1F4; background-color: #2955B5' width='150' height='1'>     <p align='left'><b><font color='#FFFFFF'>&nbsp;".$r['name']."</font></b></td>"; echo "</tr>";   $days = (date("j", strtotime($r['edate'])) - date("j", strtotime($r['sdate']))) + 1;   $sdate = date("Y-m-d", strtotime($r['sdate']));   for($i=0; $i<$days; $i++){     $day = date("D", strtotime($sdate));     $fullday = date ("l", strtotime($sdate));       if($fullday == $r['wf1'])   {         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   elseif($fullday == $r['wf2'])   {         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   elseif($fullday == $r['wf3']){         $st_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";         $e_time = "<span style='background-color: #FF0000'><b><font color='#FFFFFF'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WOFF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></b></span>";       }   else {         $st_time = "<b><font color='#2955B5'><span style='background-color: #FFFF99'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$r['stime']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font></b>";         $e_time = "<b><font color='#2955B5'><span style='background-color: #CCFF99'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$r['etime']."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></font></b>";       }   $sdate=dateconvert($sdate, 1);   echo "<tr>";   echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF' rowspan=2><b><font color='#2955B5'>&nbsp;$sdate</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF' rowspan=2><b><font color='#2955B5'>&nbsp;$day</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'><b><font color='#2955B5'>&nbsp;Report Time</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'>$st_time</td>";     echo "</tr>";     echo "<tr>";   echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'><b><font color='#2955B5'>&nbsp;Drop Time</b></font></td>";     echo "<td class='back2' style='border:1px solid #C7E1F4; background-color: #CED7EF'>$e_time</td>";     echo "</tr>";     $sdate = date("Y-m-d", strtotime("$sdate +1 day"));   }   echo "</table>"; ?>   </center></div>[/code]
  18. Still No Good Does Any one Knows How To Do It
  19. Populate as a table in the browser Please Help
  20. hi i have a database in which there are following fields name month startdate enddate starttime endtime wf1 wf2 wf3 lets take a sample data jay peter march 2006-09-03 2006-09-24 07:00 16:00 Saturday Sunday NA there are sevral such records i want to populate a table like this (see the attachment) Need some help [attachment deleted by admin]
  21. hi i have a form with fields name age gender email. i want to insert multiple records into a dataase with 1 form Need some help Good informative links are welcome This is my script and i'm trying to insert mutiple data rows with 1 form [code]<?php session_start(); if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true || !isset($_SESSION['role']) || $_SESSION['role'] !=="Manager") { // not logged in, move to login page header('Location: ../login.php'); exit; } include '../config/dbinfo.inc.php'; @mysql_connect($host,$user_name,$pass_word)or die( "Unable to Connect to database"); @mysql_select_db($database) or die( "Unable to select database"); $specialty=$_GET['specialty']; $mmyy=$_GET['mmyy']; $query = "SELECT * FROM emp WHERE specialty = '$specialty' and role='Engineer' or specialty = '$specialty' and role='TL-ATL' order by mgr"; $result = mysql_query($query) or die('Error : ' . mysql_error()); if (isset($_POST['sdate*']) && isset($_POST['edate*']) && isset($_POST['now*'])){ function dateconvert($date,$func) { if ($func == 1){ //insert conversion list($day, $month, $year) = split('[/.-]', $date); $date = "$year-$month-$day"; return $date; } if ($func == 2){ //output conversion list($year, $month, $day) = split('[-.]', $date); $date = "$day/$month/$year"; return $date; } } $specialty=$_GET['specialty']; $mmyy=$_GET['mmyy']; $sdate=$_POST['sdate*']; $sdate=dateconvert($sdate, 1); $edate=$_POST['edate*']; $edate=dateconvert($edate, 1); $now=$_POST['now*']; while(list($id) = mysq[/code]
  22. hi i have a form with fields name age gender email. i want to insert multiple records into a dataase with 1 form Need some help Good informative links are welcome
  23. i want to learn it. and not get it done alraedy searched google cant find any clue
  24. hey i need a form fom which i can insert multiple records for each of the fields need help empid, name, phone, address
×
×
  • 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.