GO HERE timeclock application

Status
Not open for further replies.

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
Actuly this is what i get from asterisk log
-- Executing [8000@from-internal:2] Goto("SIP/101-088d07e8", "timeclock|s|1") in new stack
-- Goto (timeclock,s,1)
-- Executing [s@timeclock:1] Answer("SIP/101-088d07e8", "") in new stack
-- Executing [s@timeclock:2] Wait("SIP/101-088d07e8", "1") in new stack
-- Executing [s@timeclock:3] Read("SIP/101-088d07e8", "user|tm_userid|||3|5") in new stack
-- <SIP/101-088d07e8> Playing 'tm_userid' (language 'en')
-- User entered '101'
-- Executing [s@timeclock:4] NoOp("SIP/101-088d07e8", "101") in new stack
-- Executing [s@timeclock:5] Wait("SIP/101-088d07e8", "2") in new stack
-- Executing [s@timeclock:6] Read("SIP/101-088d07e8", "pass|tm_pass|||3|5") in new stack
-- <SIP/101-088d07e8> Playing 'tm_pass' (language 'en')
-- User entered '101'
-- Executing [s@timeclock:7] NoOp("SIP/101-088d07e8", "101") in new stack
== Spawn extension (timeclock, s, 8) exited non-zero on 'SIP/101-088d07e8'
== Spawn extension (timeclock, h, 1) exited non-zero on 'SIP/101-088d07e8'
 

Bart

Active Member
Joined
Nov 14, 2007
Messages
447
Reaction score
25
It means there is something wrong when it attempts connect to MySQL - check user & password:

exten => s,n,MYSQL(Connect connid localhost timeclock timeclock timeclock)

Bart
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
Bart thank you for your reply. But I still cant get it to work Same problem on. I Am able to login asa admin onphptimeclock and make users and groups.

hire is my config.inc.php file

<?php

/*
****************************************************************************
Be sure to set appropriate permissions on this file as it contains sensitive
username and password information!
****************************************************************************
*/


/* --- REQUIRED CHANGES --- */


/* mysql info --- $db_hostname is the hostname for your mysql server, default is localhost.
--- $db_username is the mysql username you created during the install.
--- $db_password is the mysql password for the username you created during
the install.
--- $db_name is the mysql database you created during the install. */

$db_hostname = "localhost";
$db_username = "timeclock";
$db_password = "timeclock";
$db_name = "timeclock";


/* --- RECOMMENDED CHANGES --- */


/* This adds a prefix to the tablenames in the database. This can be helpful if you
have an existing mysql database that you would like to use with PHP Timeclock.
If you are unaware of what is meant by "table prefix", then please leave this
option as is. Default is to leave it blank. */

$db_prefix = "";


/* Choose "yes" to restrict the ip addresses that can connect to PHP Timeclock. If
"yes" is chosen, you MUST input the allowed networks in the $allowed_networks
array below. Otherwise, choosing "yes" here and leaving $allowed_networks
blank will cause PHP Timeclock to reject everyone attempting to connect to it.
Default is "no". */

$restrict_ips = "no";


/* Insert the networks or ip addresses you wish to allow to connect to PHP Timeclock
into the $allowed_networks array below. There is not a limit on how many networks
or addresses that can be included in this array. This will currently only work for
ipv4 addresses, ipv6 may be supported in a future release. If $restrict_ips is
set to "no", this option is ignored.

* will work:
* xxx.xxx.xxx.xxx (exact)
* xxx.xxx.xxx.[yyy-zzz] (range)
* xxx.xxx.xxx.xxx/nn (CIDR)
*
* will NOT work:
* xxx.xxx.xxx.xx[yyy-zzz] (range, partial octets not supported)
* xxx.xxx.xxx.yyy - xxx.xxx.xxx.zzz (range, entire networks not supported).
* xxx.xxx. (range, less than 4 octets not supported).

example --> $allowed_networks = array("10.0.0.4","192.168.1.[11-20]","192.168.4.0/24","192.0.0.0/8");
*/

$allowed_networks = "array()";


/* Choose "yes" if you want to disable the Edit System Settings page within PHP
Timeclock. This page allows you to make *most* of your changes to the
config.inc.php file through the PHP Timeclock interface instead of editing
the config.inc.php file by hand. Many will view this as a possible security risk
and might would rather disable this functionality. Default is "no". */

$disable_sysedit = "no";


/* Choose whether to use encrypted passwords along with the usernames. Options are
"yes" or "no". If "yes" is chosen, users will be required to enter a password
whenever they change their status. Default is "no". */

$use_passwd = "no";


/* If you only want certain users to have the ability to view and run the reports,
change $use_reports_password to "yes". Default is "no"; */

$use_reports_password = "no";


/* Enable the option to log the ip addresses of the connecting computers when users
punch-in/out, or when a time is manually added, edited, or deleted. Default is
"yes". */

$ip_logging = "yes";


/* An email address to display in the footer (footer.php). Set it to "none" to ignore
this option. */

$email = "none";


/* --- OPTIONAL CHANGES --- */


/* Choose the way dates are displayed. DO NOT EDIT THESE DATE VARIABLES MANUALLY UNLESS YOU
KNOW WHAT YOU ARE DOING. Instead, change these date variables via the Edit System Settings
page in the Administration section of PHP Timeclock (sysedit.php). $datefmt default is
"n/j/y", $js_datefmt default is "M/d/yy", $tmp_datefmt default is "m/d/yy", and
$calendar_style default is "amer". You will need to choose date formats with matching
numbers, ie: if format number 10 is used for $datefmt, then format number 10 will need to
be used for $js_format and $tmp_format as well. "euro" will need to be chosen for date
format numbers 1-6, and "amer" will need to be chosen for date format numbers 7-12.
Again, if you are confused, i urge you to change these settings via the Edit System
Settings page in the Administration Section. Choosing mismatched options will lead to
much confusion and plenty of headaches later.

Possibilities for these variables are:

$calendar_style --> 1) amer
2) euro

$datefmt --> 1) j.n.Y $js_datefmt --> 1) d.M.yyyy $tmp_datefmt --> 1) d.m.yyyy
2) j/n/Y 2) d/M/yyyy 2) d/m/yyyy
3) j-n-Y 3) d-M-yyyy 3) d-m-yyyy
4) j.n.y 4) d.M.yy 4) d.m.yy
5) j/n/y 5) d/M/yy 5) d/m/yy
6) j-n-y 6) d-M-yy 6) d-m-yy
7) n.j.Y 7) M.d.yyyy 7) m.d.yyyy
8) n/j/Y 8) M/d/yyyy 8) m/d/yyyy
9) n-j-Y 9) M-d-yyyy 9) m-d-yyyy
10) n.j.y 10) M.d.yy 10) m.d.yy
11) n/j/y 11) M/d/yy 11) m/d/yy
12) n-j-y 12) M-d-yy 12) m-d-yy */

$datefmt = "n/j/Y";
$js_datefmt = "M/d/yyyy";
$tmp_datefmt = "m/d/yyyy";
$calendar_style = "amer";


/* Choose the way times are displayed. Default is "g:i a".

Possibilities for this variable are:

$timefmt --> 1) G:i
2) H:i
3) g:i A
4) g:i a
5) g:iA
6) g:ia */

$timefmt = "g:i a";


/* Display only activity for the the current day instead of the last entry from each user.
Default is "no". */

$display_current_users = "no";


/* Show a Display Name instead of a Username for each user on the main page.
Default is "no". */

$show_display_name = "no";


/* Display punch-in/out times for only a certain office on the main page of the application.
Replace "all" with the office you wish to display below. Default is "all". */

$display_office = "all";


/* Display punch-in/out times for only a certain group on the main page of the application.
Replace "all" with the group you wish to display below. Default is "all". */

$display_group = "all";


/* Display a column on the main page that shows the office each person is affiliated with.
Default is "no". */

$display_office_name = "no";


/* Display a column on the main page that shows the group each person is affiliated with.
Default is "no". */

$display_group_name = "no";


/* A logo or graphic, this is displayed in the top left of each page.
Set it to "none" to ignore this option. */

$logo = "images/logos/sierra.png";


/* This sets the refresh rate (in seconds) for index.php. If the application is kept open,
it will refresh every $refresh seconds to display the most current info. Default
is 300. Set it to "none" to ignore this option. */

$refresh = "300";


/* This creates a clickable date in the top right of each page. By Default, it links to
"This Day in History" on the historychannel.com website. Set it to "none" to ignore this option. */

$date_link = "http://www.historychannel.com/tdih";


/* These are alternating row colors for the main page and for reports. */

$color1 = "#EFEFEF";
$color2 = "#FBFBFB";


/* Insert/change/delete below the ACTUAL links to websites you wish to display in the
topleft side of each page (leftmain.php). These links can link to anything you want
them to -- websites, other web-based applications, etc. Default number of links is 6.
Set $links to "none" to ignore this option. Ex: $links = "none"; */

$links = array("http://www.highsierrapools.com/");


/* Insert/change/delete below the display names for the links you inserted above.
If $links is set to "none", this option is ignored. */

$display_links = array("High Sierra");


/* --- REPORTING INFO --- */


/* The settings in this section are simply default settings. They can easily be changed each
time you run a report. */

/* Choose whether to paginate the Hours Worked report or not. Setting this option to "yes"
will print the totals for each user on their own page. Default is "yes". */

$paginate = "yes";


/* Choose whether to show the punch-in/out details for each punch for each user on the
Hours Worked report or not. Default is "yes". */

$show_details = "yes";


/* Choose how to round the time worked within the Hours Worked report for each user. This
simply tells the report how to format the total hours worked for the Hours Worked Report.
Default is "0".

Possibilities for this variable are:

$round_time --> 0) Do not round.
1) Round to the nearest 5 minutes.
2) Round to the nearest 10 minutes.
3) Round to the nearest 15 minutes.
4) Round to the nearest 20 minutes.
5) Round to the nearest 30 minutes. */

$round_time = "0";


'
'
'
''
'

''''''''

and the rest as it was
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
And hire is my extensions_custom.conf setings for timeclock


[timeclock]
exten => s,1,Answer
exten => s,n(again),Wait(1)
exten => s,n,Read(user,tm_userid,,,3,5)
exten => s,n,NoOp(${user})
exten => s,n,Wait(2)
exten => s,n,Read(pass,tm_pass,,,3,5)
exten => s,n,NoOp(${pass})

;\\Connect to db, if connection fails goto error context,MYSQL(Connect connid dhhost dbuser dbpass dbname)
exten => s,n,MYSQL(Connect connid localhost timeclock timeclock timeclock)
exten => s,n,NoOp(${connid})
exten => s,n,GotoIf($["${connid}" = ""]?error,1)

;\\check empfullname and employee_passwd in employees table - if yes get tstamp set variable
exten => s,n,MYSQL(Query resultid ${connid} SELECT\ tstamp\ FROM\ employees\ WHERE\ empfullname=\${user}\ AND\ employee_passwd\ =\ encrypt(\"${pass}\"\,\"xy\"))
exten => s,n,MYSQL(Fetch fetchid ${resultid} tstamp)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,NoOp(${fetchid})
exten => s,n,GotoIf($["${fetchid}" = "0"]?fail:next)

exten => s,n(fail),Playback(tm_login_incorrect)
exten => s,n,goto(again)

exten => s,n(next),NoOp("moving On")
exten => s,n,NoOp(${tstamp})

;check tstamp for null, first time login will be null so we set stat to in and jump to n(bad) line to complete Punch In, if not Null the stat will be changed in next section
exten => s,n,Set(stat="in")
exten => s,n,GotoIf($["${tstamp}" = "NULL"]?initial)

;\\check inout status from info where fullname=empfullname and timestamp=tstamp,
exten => s,n,MYSQL(Query resultid ${connid} SELECT\ info.inout\ FROM\ info\ WHERE\ fullname=\${user}\ AND\ timestamp=\${tstamp})
exten => s,n,MYSQL(Fetch fetchid ${resultid} inout)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,NoOp(${inout})

;\\check inout, toggle and set stat, So if their last action was Punch In now Punch Out or reverse
exten => s,n,set(stat=${IF($[ ${inout} = in]?out:in)}) ; Set(foo=${IF($[ ${x} = 7]?tval:fval)})
exten => s,n,NoOp(${stat})

;\\entry from Goto in tstamp was null
exten => s,n(initial),NoOp(initial login)

;\\Make timestamp
exten => s,n,MYSQL(Query resultid ${connid} SELECT\ unix_timestamp( utc_timestamp( ) ) )
exten => s,n,MYSQL(Fetch fetchid ${resultid} time)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,NoOp(${time})

;\\We use caller number to see where the punch comes from
exten => s,n,NoOp("CallerID is "${CALLERID(num)})

;\\insert punch record in info tbl
exten => s,n,MYSQL(Query resultid ${connid} UPDATE\ employees\ SET\ tstamp=\'\${time}\'\ WHERE \empfullname=\${user})
exten => s,n,MYSQL(Clear ${resultid})

;\\then update tstamp in employees tble, this is used to set the users last action
exten => s,n,MYSQL(Query resultid ${connid} INSERT\ INTO\ info\ SET\ fullname=\'\${user}\'\, info.inout=\'\${stat}\'\, timestamp=\'\${time}\'\, ipaddress=\'\${CALLERID(num)}\'\)
exten => s,n,MYSQL(Fetch fetchid ${resultid})
exten => s,n,MYSQL(Clear ${resultid})

;\\Say goodbye
exten => s,n,GotoIf($["${stat}" = "in"]?in:eek:ut)
exten => s,n(in),Playback(tm_clocked_in)
exten => s,n,goto(done)
exten => s,n(out),Playback(tm_clocked_out)
exten => s,n,goto(done)

;\\So we can see if connection id and result id is increasing
exten => s,n(done),NoOp("Connection ID is "${connid})
exten => s,n,NoOp("Result ID is "${resultid})

exten => s,n,Wait(1)
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid})
exten => h,1,mysql(clear ${resultid})
exten => h,n,mysql(disconnect ${connid}

exten => error,1,NoOp,MYSQL(Disconnect ${connid})
exten => error,n,Playback(tm_contact_admin)
exten => error,n,Hangup
;end of timeclock context


My DB timeclock localhost Yes ALL PRIVILEGES Yes have all privlages for user timeclock


Thanks in advance for help in this mater.
 

Bart

Active Member
Joined
Nov 14, 2007
Messages
447
Reaction score
25
Does this user and password exists in MySQL?
If they do, have you restarted MySQL since you added?

Bart
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Authentication Requested from the forum

OK - it just happened to me - and I have not installed this software in any way. I am merely reading this forum thread - in fact I was going from page 1 of 3 to 2 of 3, and I got the pop up dialog box:

lukicwebsip.mine.nu is asking for authentication

I am just on my way out for a bit - so I cant look into it. But I have never heard of that domain before - certainly never visited there, and I have never installed this software on any computer.

So -WTF? Im wondering if the forum software is somehow interpreting part of one of the messages in this thread? Has anyone heard of this domain before? :confused5:

Edit: The authentication query definitely occurs when I go from page two of this message thread to page 3 of this message thread.

-tshif
 

Boolah

Guru
Joined
Nov 16, 2007
Messages
331
Reaction score
20
Looking at the source of this page, I see some hidden code in lukicweb's post:

Code:
My DB timeclock localhost Yes ALL PRIVILEGES Yes <a href="http://lukicwebsip.mine.nu/maint/modules/phpmyadmin/server_privileges.php?token=95f4cc532dc7fc20fdfeae6cf680944b&amp;username=timeclock&amp;hostname=localhost&amp;dbname=&amp;tablename=" target="_blank"><img src="http://lukicwebsip.mine.nu/maint/modules/phpmyadmin/themes/original/img/b_usredit.png" border="0" alt="" /></a>have all privlages for user timeclock<br />
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
This is becouse i have copied
My DB timeclock localhost Yes ALL PRIVILEGES Yes

from myPHP admin page..
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
Yes ,user timeclock and password timeclock exist in mysql . Also I have restarted mysql..
Thanks
 

Bart

Active Member
Joined
Nov 14, 2007
Messages
447
Reaction score
25
Sorry, I have no clue what might be wrong then. For me it pretty much worked out of the box except for changing password and restarting

Bart
 

edisoninfo

Guru
Joined
Nov 19, 2007
Messages
505
Reaction score
4
Just a small FYI, when adding / changing user permissions in MySQL, you do not need to restart MySQL for them to take affect. Just issue the "flush privileges" command.
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
I am still unable to get this to work. When I call 8000 it asks me for user id and password. As soon I enter password and then # it hang up on me.This is the log I am getting from asterisk. Thanks


-- Executing [8000@from-internal:1] NoOp("SIP/101-092d04a0", "Running miscapp 2: Timeclock") in new stack
-- Executing [8000@from-internal:2] Goto("SIP/101-092d04a0", "timeclock|s|1") in new stack
-- Goto (timeclock,s,1)
-- Executing [s@timeclock:1] Answer("SIP/101-092d04a0", "") in new stack
-- Executing [s@timeclock:2] Wait("SIP/101-092d04a0", "1") in new stack
-- Executing [s@timeclock:3] Read("SIP/101-092d04a0", "user|tm_userid|||3|5") in new stack
-- <SIP/101-092d04a0> Playing 'tm_userid' (language 'en')
-- User entered '101'
-- Executing [s@timeclock:4] NoOp("SIP/101-092d04a0", "101") in new stack
-- Executing [s@timeclock:5] Wait("SIP/101-092d04a0", "2") in new stack
-- Executing [s@timeclock:6] Read("SIP/101-092d04a0", "pass|tm_pass|||3|5") in new stack
-- <SIP/101-092d04a0> Playing 'tm_pass' (language 'en')
-- User entered '11111'
-- Executing [s@timeclock:7] NoOp("SIP/101-092d04a0", "11111") in new stack
== Spawn extension (timeclock, s, 8) exited non-zero on 'SIP/101-092d04a0'
== Spawn extension (timeclock, h, 1) exited non-zero on 'SIP/101-092d04a0'
 

Boolah

Guru
Joined
Nov 16, 2007
Messages
331
Reaction score
20
Did you copy all of the sound files into your /var/lib/asterisk/sounds directory? Do they all have the appropriate ownership/permissions?
 

lukicweb

New Member
Joined
May 6, 2009
Messages
9
Reaction score
0
Yes all sound files have been copied to /var/lib/asterisk/sounds directory. How do I set up appropriate ownership/permissions?

Thank you in advance
 

tshif

Guru
Joined
Jan 3, 2008
Messages
1,240
Reaction score
4
Time Clock Application: Possible Module

I have been considering working this program into a FreePBX module if there is any interest in the community.

To all programmer-types reading this - if you might have an interest in working on this project - send me a PM.

-tshif
 

ejconcepcion

New Member
Joined
Apr 4, 2009
Messages
25
Reaction score
0
Thanks for posting this, I have it working great.

Would it be possible to change the menu so the caller has the choice of clocking in or clocking out?

Thanks in advance.
 

jmullinix

Guru
Joined
Oct 21, 2007
Messages
1,263
Reaction score
7
That would require changing the code in the PHP timeclock part of this. Ed and I intentionaly did not change a bit of the PHP TimeClock code. The dial plan we wrote works to write the same flags as the original timeclock program.

I actually think you would not want your staff to choose whether they were clocking in or out. I would think that to be a source of possible time clock fraud. I would want my staff to come to me for a signoff on a missed clock out.
 

Speedy2k

Member
Joined
Oct 11, 2008
Messages
387
Reaction score
0
A new version of the time clock we be avaible soon,
http://www.phptimeclock.com/

I have talked to the developers and we should be able to punch in and out at the begining and at the end of the day like now, but we should be able to punch in and out of a job, and i have asked him to make something possible to leave a voice note on each punch in or out. so some modification should be necesary to make those new things work!
 

MyKroFt

Guru
Joined
Oct 31, 2008
Messages
659
Reaction score
3
Does the report of this program figure overtime after 40 hrs per week etc? I can't tell yet because i don't have enough data input yet.
 
Status
Not open for further replies.

Members online

No members online now.

Forum statistics

Threads
25,779
Messages
167,505
Members
19,199
Latest member
leocipriano
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top