Search the Community
Showing results for tags 'report'.
-
Code: jQuery code $(document).ready(function(){ setInterval(checkChat, 3000); }); function new_message(){ var val = $(".chat_box").attr('id'); var id_reciver = val.substr(val.indexOf("_") + 1) $(".chat_box").bind('keydown', function(e){ alert(e.keyCode); e.preventDefault(); }); } html code <textarea class='chat_box' id='input_"+chatuser+"' placeholder='type message' onkeyup='new_message()'></textarea> Problem description (time line of problem): 1) The first time when i press any key on the keyboard, i do not have alert(e.keyCode) 2) The second time when i press any key on the keyboard, i have correct alert(e.keyCode) 3) The third time when I press the button on the keyboard, i have correct alert(e.keyCode), but 2 time alert`s 4) ..... i have correct alert(e.keyCode), but 3 time alert`s 5) ... and so on .... Why this happens? Alert instead, there should be standing at the mysql_query("insert into.... posts for inserting message in database, but, this code will be insert message "N" times in row... and that is not ok. PS: You can see the message box on attached picture (i have 2 same message in row) (i try to upgrade chat box application, and i m try to be like chat on Facebook, everything that I had planned I've done, I've just not about sending this message -... i send messages, but the few times one and the same :S)
-
hello, I have an employee in / out board that someone else coded, and I am trying to generate a report from a table of data. I have the logic in my head, just not sure how to get it down to work correctly. It's currently written in PHP with a mysql database backend. For example. Data Table: ---------------------------------------------------------------- ID - NAME - DIRECTION - DATED - DATET ---------------------------------------------------------------- 37 Employee1 2 2012-09-09 20:53:25 37 Employee1 1 2012-09-09 20:53:33 39 Employee2 2 2012-09-10 07:58:51 37 Employee1 2 2012-09-10 09:08:56 39 Employee2 1 2012-09-10 17:03:29 37 Employee1 1 2012-09-10 17:10:47 37 Employee1 2 2012-09-11 08:14:14 39 Employee2 2 2012-09-11 08:14:22 37 Employee1 1 2012-09-11 12:51:59 39 Employee2 1 2012-09-11 12:53:12 37 Employee1 2 2012-09-11 14:44:26 39 Employee2 2 2012-09-11 14:44:36 39 Employee2 1 2012-09-11 14:44:36 39 Employee2 2 2012-09-11 14:44:36 39 Employee2 1 2012-09-11 16:43:59 37 Employee1 1 2012-09-11 17:16:26 ---------------------------------------------------------------- Direction (From Above) 1 = Out 2 = In ----------------------------------------------------- I'm going to create a couple of different reports, but the first one will look like: Name Date Time In Time Out Time In Time Out Total Time: --------------------------------------------------------------------------------------- Employee1 9/9/12 20:53 20:53 0:00 9/10/12 09:08 17:10 8:02 9/11/12 08:14 12:51 14:44 17:16 7:09 ----------- 15:11 Employee2 9/10/12 7:58 17:03 9:05 9/11/12 8:14 12:53 14:44 16:43 7:11 ----------- 16:16 can someone point me in the right direction for this ? thanks