Jump to content

tiota

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tiota's Achievements

Member

Member (2/5)

0

Reputation

  1. tiota

    mysql recover

    MYSQL 5.1.36 hi I have a big problem, I delete all data from one of my table when I typed the command delete from late; How to recover those lost data ? my table structure below +--------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+----------------+ | late_id | int(11) | NO | PRI | NULL | auto_increment | | emp_num | char(20) | NO | MUL | NULL | | | late_date | date | NO | | NULL | | | late_timein | time | NO | | NULL | | | late_reasons | varchar(100) | NO | | NULL | | +--------------+--------------+------+-----+---------+----------------+ Thanks in advance
  2. Hi, I've been wondering if it is possible to load a php page according to certain time. For example at 12:00 pm a php form will pop up automatically informing an employee to fill in something in the form, another form will pop up at 4:00 pm, etc... Thanks in advance
  3. I have a form that enforce users to fill in using java script. My java script checks that the form is filled in otherwise informing the users to fill in text box. Suprisingly, some users manage to bypass this validation when they press Enter button on the keyboard. How can this happen ? Your help is pretty much appreciated. See my code below <script language="javascript"> function Validate() { reasons = document.LateForm.latereasons.value empnum = document.LateForm.empnum.value if (empnum == "") { Message = "Please enter your PF number" + "\n" alert(Message) return false } if (reasons == "") { Message = "Please state your reasons why do you come late" + "\n" alert(Message) return false } else { Message = "" document.LateForm.submit() return true } } </script> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Late Form</title> <LINK REL=StyleSheet HREF="timecardbasic.css" TYPE="text/css" MEDIA=screen> </head> <body> <div id="leftcol"><?php include('TCNavi.inc'); ?></div> <div id="content"> <form method="post" action="late.php" name="LateForm"> <table style="width: 70%; text-align: left; margin-left: auto; margin-right: auto; font-family: Verdana;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr style="font-weight: bold; color: rgb(255, 255, 255);" align="center"> <td style="background-color: rgb(100, 149, 237);" colspan="2" rowspan="1"><big>Late Form</big></td> </tr> <tr> <td style="width: 30%;">PF #:</td> <td><input maxlength="10" size="10" name="empnum"></td> </tr> <tr> <td>Date:</td> <td><?php date_default_timezone_set("Pacific/Tarawa");echo Date('Y-m-d'); ?> <br><br> </td> </tr> <tr> <td>Time In:</td> <td><?php echo date(' g:i A');echo "/"; echo date('H:i:s ',time()); ?> </td> </tr> <tr> <td style="font-family: Verdana; width: 237px;">Late reasons:</td> <td style="width: 460px;"><textarea cols="35" rows="8" name="latereasons"></textarea></td> </tr> <tr align="center"> <td style="width: 100%;" colspan="2" rowspan="1"><input value="SIGN-IN" name="Save" type="submit" onclick="Validate();return false;"></td> </tr> </tbody> </table> <br> </form> </div> <?php //echo (gmstrftime(" %H:%M:%S", mktime())); ?> <br><br> <?php //echo date('Y-m-d'); ?> <br><br> </body> </html>
  4. Problems 1. I install wamp server 2.0 on another computer and it does not work. The installation is sucessful but when i type localhost at the address bar it returns the page http://localhost/localstart.asp that cannot be found this is also happened when i click Localhost from the pop menu from wamp server icon appeared at the bottom right 2. Another problem I encountered is that when I click Localhost or phpMyAdmin from the pop menu from wamp server icon appeared at the bottom right it prompt for the username and password. Thanks in advance
  5. Hi, I managed to install wamp server ver 2.0 on my machine and it worked perfectly. Everyone in my network can access my web sites hosted on my server. The only thing is it cannot be accessed outsite the network(i.e throuth the internet) The wamp server contains the following components mysql 5.3.16 php 5.3.0 appache 2.2.11 Thanks in advance
  6. MYSQL 5.1.36 PHP 5.3.0 This is following my recent post about an hour ago, and thanks to PFMaBiSmAd for the reply... This is my query along the with sample output $qry = "Select employee.dept_num, department.dept_desc, timesheet.ts_timein, timesheet.ts_timeout,timesheet.ts_date From timesheet, employee, department Where timesheet.emp_num = employee.emp_num AND department.dept_num = employee.dept_num AND timesheet.ts_date BETWEEN '$start_date' AND '$end_date' ORDER BY ts_date"; output +----------+----------------+-----------+------------+------------+ | dept_num | dept_desc | ts_timein | ts_timeout | ts_date | +----------+----------------+-----------+------------+------------+ | E2502 | Accounts | 04:16:00 | 16:18:00 | 2010-07-01 | | E2502 | Accounts | 08:06:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:04:00 | 16:16:00 | 2010-07-01 | | E2502 | Accounts | 08:06:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:47:00 | 19:13:00 | 2010-07-01 | | E2502 | Accounts | 09:11:00 | 05:53:00 | 2010-07-01 | | E2502 | Accounts | 08:05:00 | 00:00:00 | 2010-07-01 | | D01 | IT Department | 08:34:00 | 17:25:41 | 2010-07-01 | | E2502 | Accounts | 08:05:00 | 16:20:00 | 2010-07-01 | | E2501 | Administration | 08:48:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:48:00 | 16:22:00 | 2010-07-01 | | E2502 | Accounts | 08:06:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:24:00 | 16:27:00 | 2010-07-01 | | E2502 | Accounts | 08:04:00 | 16:39:00 | 2010-07-01 | | E2502 | Accounts | 09:48:00 | 16:21:00 | 2010-07-01 | | D01 | IT Department | 08:08:00 | 16:30:05 | 2010-07-01 | | E2502 | Accounts | 08:54:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:04:00 | 16:17:00 | 2010-07-01 | | E2502 | Accounts | 09:08:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 04:19:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:05:00 | 16:20:00 | 2010-07-01 | | E2502 | Accounts | 08:06:00 | 16:18:00 | 2010-07-01 | | E2502 | Accounts | 08:04:00 | 16:21:00 | 2010-07-01 | | E2501 | Administration | 08:07:00 | 17:05:00 | 2010-07-01 | | E2501 | Administration | 08:48:00 | 16:27:00 | 2010-07-01 | | E2502 | Accounts | 04:19:00 | 00:00:00 | 2010-07-01 | | E2502 | Accounts | 08:15:00 | 16:19:00 | 2010-07-01 | | E2501 | Administration | 08:54:00 | 00:00:00 | 2010-07-01 | | D01 | IT Department | 08:07:00 | 16:40:41 | 2010-07-01 | | D01 | IT Department | 09:50:00 | 17:53:40 | 2010-07-01 | | E2501 | Administration | 09:19:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:17:00 | 16:14:00 | 2010-07-02 | | E2502 | Accounts | 08:11:00 | 00:00:00 | 2010-07-02 | | D01 | IT Department | 08:32:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:10:00 | 16:15:00 | 2010-07-02 | | E2502 | Accounts | 08:19:00 | 06:54:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:25:00 | 16:21:00 | 2010-07-02 | | E2502 | Accounts | 08:10:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 09:17:00 | 17:40:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 09:54:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:07:00 | 16:16:00 | 2010-07-02 | | E2502 | Accounts | 08:15:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 09:25:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:23:00 | 00:00:00 | 2010-07-02 | | E2501 | Administration | 04:39:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:20:00 | 16:16:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:07:00 | 00:00:00 | 2010-07-02 | | D01 | IT Department | 08:08:00 | 17:30:05 | 2010-07-02 | | D01 | IT Department | 09:37:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:06:00 | 16:17:00 | 2010-07-02 | | E2502 | Accounts | 09:24:00 | 16:18:00 | 2010-07-02 | | E2501 | Administration | 09:35:00 | 16:37:00 | 2010-07-02 | | E2502 | Accounts | 08:13:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 08:09:00 | 16:16:00 | 2010-07-02 | | E2502 | Accounts | 08:08:00 | 16:16:00 | 2010-07-02 | | E2502 | Accounts | 08:09:00 | 16:16:00 | 2010-07-02 | | E2502 | Accounts | 08:09:00 | 16:23:00 | 2010-07-02 | | E2501 | Administration | 07:53:00 | 17:18:00 | 2010-07-02 | | E2502 | Accounts | 08:15:00 | 00:00:00 | 2010-07-02 | | E2502 | Accounts | 12:16:00 | 18:10:00 | 2010-07-03 | | E2502 | Accounts | 02:21:00 | 18:10:00 | 2010-07-03 | | E2502 | Accounts | 10:15:00 | 00:00:00 | 2010-07-03 | | E2502 | Accounts | 20:46:00 | 00:00:00 | 2010-07-04 | | D01 | IT Department | 07:09:00 | 00:00:00 | 2010-07-04 | | E2502 | Accounts | 17:14:00 | 00:00:00 | 2010-07-04 | | E2502 | Accounts | 07:11:00 | 19:13:00 | 2010-07-04 | | E2502 | Accounts | 08:11:00 | 17:10:00 | 2010-07-05 | | E2502 | Accounts | 07:58:00 | 16:18:00 | 2010-07-05 | | E2502 | Accounts | 08:15:00 | 00:00:00 | 2010-07-05 | | D01 | IT Department | 08:31:00 | 16:25:05 | 2010-07-05 | | E2502 | Accounts | 08:18:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:12:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:05:00 | 16:16:00 | 2010-07-05 | | E2502 | Accounts | 08:53:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:48:00 | 00:00:00 | 2010-07-05 | | E2501 | Administration | 08:44:00 | 16:52:00 | 2010-07-05 | | E2502 | Accounts | 08:40:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 09:22:00 | 17:15:00 | 2010-07-05 | | E2502 | Accounts | 08:10:00 | 17:11:00 | 2010-07-05 | | E2502 | Accounts | 08:12:00 | 16:17:00 | 2010-07-05 | | E2502 | Accounts | 07:57:00 | 16:15:00 | 2010-07-05 | | E2501 | Administration | 07:54:00 | 17:30:00 | 2010-07-05 | | E2501 | Administration | 08:47:00 | 16:21:00 | 2010-07-05 | | E2501 | Administration | 08:12:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:12:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:17:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:23:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:23:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:20:00 | 17:32:00 | 2010-07-05 | | E2501 | Administration | 08:13:00 | 16:15:00 | 2010-07-05 | | E2502 | Accounts | 08:11:00 | 16:16:00 | 2010-07-05 | | E2502 | Accounts | 09:37:00 | 16:17:00 | 2010-07-05 | | D01 | IT Department | 08:36:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 10:20:00 | 20:08:00 | 2010-07-05 | | D01 | IT Department | 09:16:00 | 00:00:00 | 2010-07-05 | | D01 | IT Department | 10:34:00 | 20:16:00 | 2010-07-05 | | E2501 | Administration | 08:23:00 | 16:19:00 | 2010-07-05 | | E2502 | Accounts | 07:57:00 | 17:31:00 | 2010-07-05 | | E2502 | Accounts | 07:57:00 | 16:15:00 | 2010-07-05 | | E2502 | Accounts | 08:06:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:12:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:36:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 09:19:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:27:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 09:29:00 | 00:00:00 | 2010-07-05 | | E2502 | Accounts | 08:16:00 | 06:12:00 | 2010-07-05 | | E2501 | Administration | 09:55:00 | 16:19:00 | 2010-07-05 | +----------+----------------+-----------+------------+------------+ Thanks in advance
  7. MSQL 5.1.36 PHP 5.3.0 I have my php script that tried to add number of hours for each division on a particular date. For example , I want to find the number of hours worked by IT division from $start_date = "2010-07-01" to $end_date = "2010-07-04". Lets say there are 4 IT staff working on the start date "2010-07-01", I want to calculate their hours add them up and store it into the array. After that I have to increment date and do another calculation for IT staff i.e calculate their hours and them up and store into the same array.... and I want the output to be somethings like this 2010-07-01 2010-07-02 2010-07-03 2010-07-04 50 hrs 20hrs 43.5hrs 45.2hrs 50 hrs is the total hours by IT in 2010-07-01 20 hrs is the total hours by IT in 2010-07-02 and so on.... This is what i did so far with my code.... $start_date = "2010-07-01"; $end_date = "2010-07-04"; $next_date = $start_date; while ($line = mysql_fetch_array($employee_hrs, MYSQL_ASSOC)) { if($line['dept_num'] == "D01" && $line['ts_date'] == $next_date)//IT { $it_hours = calculateTimeDifference($line['ts_timein'],$line['ts_timeout']); $it_Total_hours = $it_Total_hours + $it_hours; $it_array[] = $it_hours; } $next_date =strftime("%Y-%m-%d", strtotime("$start_date +$i day")); $i++; }//end while loop The problem with the above code is that it cannot calcuate the total hours for each separate date . It only returns a sum of total hours from $start_date up to $end_date. Thanks in advance....
  8. PHP vesion 5.3.0 Hi, Can anyone help me out with this code. I want to print out dates from $start_date up to $end_date but it only returns "2010-07-02" <?php $i=1; $start_date = "2010-07-01"; $end_date = "2010-07-31"; $next_date = $start_date; while($next_date <= $end_date) { $next_date = strtotime("+$i day", strtotime($start_date)); echo date("Y-m-d",$next_date); echo "<br>"; $i++; } ?> Thanks in advance.
  9. MYSQL 5.1.36 PHP 5.3.0 I have a query which extracts dates from a database and I want to determine which dates are week-ends, specifically saturday and sunday. Lets say $start_date = "2010-06-01" and $end_date = "2010-06-30". My query below worked pefectly, but to figure out week-end dates is a bit complicated to me. How to do it in php ? $qry = "Select employee.dept_num, department.dept_desc, timesheet.ts_timein, timesheet.ts_timeout,timesheet.ts_date From timesheet, employee, department Where timesheet.emp_num = employee.emp_num AND department.dept_num = employee.dept_num AND timesheet.ts_date BETWEEN '$start_date' AND '$end_date' "; sample output below if you like +----------+----------------+-----------+------------+------------+ | dept_num | dept_desc | ts_timein | ts_timeout | ts_date | +----------+----------------+-----------+------------+------------+ | E2501 | Administration | 08:48:00 | 00:00:00 | 2010-07-01 | | E2501 | Administration | 08:23:00 | 04:19:00 | 2010-07-05 | | E2501 | Administration | 08:19:00 | 00:00:00 | 2010-07-06 | | E2501 | Administration | 09:01:00 | 04:22:00 | 2010-07-07 | | E2501 | Administration | 08:23:00 | 00:00:00 | 2010-07-08 | | E2501 | Administration | 09:35:00 | 04:37:00 | 2010-07-02 | | E2501 | Administration | 08:44:00 | 04:52:00 | 2010-07-05 | | E2501 | Administration | 08:22:00 | 04:53:00 | 2010-07-06 | | E2501 | Administration | 08:43:00 | 00:00:00 | 2010-07-07 | | E2501 | Administration | 08:19:00 | 04:38:00 | 2010-07-08 | | E2501 | Administration | 09:04:00 | 04:28:00 | 2010-07-09 | | E2501 | Administration | 08:13:00 | 04:15:00 | 2010-07-05 | | E2501 | Administration | 09:33:00 | 00:00:00 | 2010-07-06 | | E2501 | Administration | 10:29:00 | 04:18:00 | 2010-07-07 | | E2501 | Administration | 09:32:00 | 04:18:00 | 2010-07-09 | | E2501 | Administration | 04:39:00 | 00:00:00 | 2010-07-02 | | E2501 | Administration | 09:55:00 | 04:19:00 | 2010-07-05 | Thanks in advance
  10. Hi, I need to change time values in mysql db. If I have the following times stored , and I want to change 08:03:00 to 16:03:00 i.e only the first two digits. 08:03:01 09:08:00 010:08:00 011:31:00 00:23:00 05:18:00 03:08:00 Thanks in advance
  11. Thank you very much for help
  12. I did substract between ts_timeout and ts_timein to find the number of hrs and it gave me strange values guery Select employee.dept_num,department.dept_desc, Sum(abs (ts_timein-ts_timeout)) AS NumOfHrs From timesheet, employee, department Where timesheet.emp_num = employee.emp_num AND department.dept_num = employee.dept_num AND ts_date Between "2010-07-01" AND "2010-07-01" Group By employee.dept_num; output +----------+----------------+----------+ | dept_num | dept_desc | NumOfHrs | +----------+----------------+----------+ | D01 | IT Department | 335027 | | E2501 | Administration | 242500 | | E2502 | Accounts | 1158200 | +----------+----------------+----------+ The values under column 'NumOfHrs' supposed to be the number of hrs spent by each department at a particular date. How to change that to number of hrs Thanks in advance
  13. how to compare $timeout variable with another string. Lets say $timeout = "00:00:00" in my database, and I want to check whether $timeout contains the string value 00:00:00 I tried this in my code it did not work correctly if ($timeout =="00:00:00") { echo "User did not sign-out "; } esle{ echo "User signed out"; }
  14. i installed joomla on my computer and i forgot my password how to reset my password ?
  15. How to calculate the time difference, in my database there were two fields namely timein and timeout. Let's say timein = "08:00:00" and timeout = "04:00:00" on the same day when i did the substraction between timein and timeout it returns 4 hrs which is wrong . it should returns 8 hrs as i expected. I've search on the net and had not found a good guide/solution to my problems
×
×
  • 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.