Re: [PHP] PHP Timer + Java

2002-11-12 Thread Ernest E Vogelsinger
At 22:28 11.11.2002, Mohsin Rahman said:
[snip]
>1) How to pass the STARTTIME only when the START TASK button is pressed?
>
>Apprently using
>
>echo "onclick=\"window.open('popup.html?clientid=$starttime=strtotime(\"now\")&$th
>isclientid&projectid=$thisclientid','TEST','height=200,width=300,resizable=y
>es,toolbar=no,status=no,menubar=no,scrollbars=no')\">";
>
>does not pass the unixtime (now) to the popup.

You're merging the function call "strtotime()" into a string - that won't
work. The other query parameters seem also not to be correctly identified.
Try this:

$starttime = =strtotime('now');
$uri = 'popup.html?' .
   "clientid=$thisclientid" .
   "&projectid=$thisprojectid" .
   "&starttime=$starttime";

echo '';

>2). Since this is a Java popup, how do I get the close form action back
>and insert my endtime into the database from the popup?

I don't know - this depends on how the Java applet is written. Basically it
should issue a request to an URI passing either the time, or the elapsed
time, as a parameter.

Caution - this would pass the time at the client workstation which might
differ considerably from the server time. I'd suggest a solution where the
server generates some kind of client token that's passed to the Java
applet. The server would then associate this token with what he knows as
"project start time". Upon hitting the stop button at the client's the
applet would just pass back this token, annotated by the action (stop,
reset, cancel, whatever). The server would then have a chance to take the
appropriate action.

>3). How do I mix php in a Java function?

You don't. PHP is a server side issue, Java runs at the client's (at least
in this scenario). The client browser starts the Java applet on behalf of
the HTML code your server-side application outputs. The Java applet can
only communicate with the server using URI requests.


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Timer + Java

2002-11-11 Thread Mohsin Rahman
OK.. probably a easy thing, but I am complicating it too much. Here is
what I am
trying to accomplish.

Using PHP4.0.2 and PostgreSQL 7.1.

I am creating a time tracking system where a user, based on their login,
gets a  list
of open projects. I have clientid, projectid, description, estimate
time, and actual time
spent on the project. it is the "Actual Time" data that I am trying to
collect. I give the
user a list of all their tasks, and want them to click a FORM BUTTON
(can be
anything as long as it accomplishes what I am doing) that passes
variables like clientid,
projectid, startime, description to the popup. What I want to do is use
that popup
window to show how much time they have spent since the click on "START
TASK" form button is pressed. I then want to show them a running time
starting from
00:00:00 upwards. Sort of like a stopwatch. The popup has a STOP/CLOSE
link
that, when pressed, will update the database with the unixtime stamp of
the start and
end of the project.

I have the 00:00:00 counter going no problem, but the problem I run
into:

1) How to pass the STARTTIME only when the START TASK button is pressed?

Apprently using

echo "";

does not pass the unixtime (now) to the popup.

2). Since this is a Java popup, how do I get the close form action back
and insert
my endtime into the database from the popup?

3). How do I mix php in a Java function?

Any help and pointers appreciated. Thanks.

Mohsin Rahman
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php