GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Jul-2003, 07:13
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

time Problem


hi,
how i can get time which i selected from bis field on von field on the very next time when i clcik on save button

for eg

Von Bis
12:20 23:40 u can see from the url which i already posted
if u clearly notice this link u will see the new line VOn showing time 13:03
instead of 23:40 as i used echo (date('H:i')) thats why im getting always system time

thats why i asked any modification in php so that i can ge something like
Von Bis
15:03 15 :03//new field user get once clcik on Save button
15:02 15:07 //this time may be from select or click on '>' button which acts as clock

how to get 15:07 Bis time in Von field in new field once form submitted please modify the code as im newbie to PHP

still any problem to understood server2.vitodesign.com

or any other way of script will welcome

if anybody sort out this problem will be appreciable

thanks
Attached Files
File Type: txt log.txt (14.2 KB, 7 views)
  #2  
Old 17-Jul-2003, 08:27
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Okay, lemme get this straight.

You want the value of "bis" to be the default selected value of "von" once submitted?

If so, I've done very little. In your fillDD() function, you don't make use of the selected bit. So I changed it to accept time in 12:30 format, and then when if loops, if 12:30 comes up, it will be set as default.

See attachment. I've not got PHP access at the mo, so you'll have to check my syntax. My changes are marked with ###.

GF
Attached Files
File Type: txt log.txt (14.2 KB, 7 views)
  #3  
Old 17-Jul-2003, 08:51
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
awesome excellent,no doubt about it.........

is it possible that when user login first time he will get system time in von field as i seen u removed
<option value="<?=date('H:i')?>"><? echo (date('H:i')); ?></option>
from von field thats when i login i always see 0:00 in von field
is it possible to get system
but when i use this date('H:i')
then same problem exists or is it possible to allow user to fill von time when he logins for first time

anyway its appreciable

thanks
  #4  
Old 17-Jul-2003, 10:20
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Oh, yes.

Just replace that bit with an if statement checking if $von is set or not. So something like:

PHP Code:

<? if( isset($bis) ){
         echo $bis;
}else{
         echo (date('H:i')); 
}


Presumably, when a user logs in first, the variable $HTTP_POST_VARS['bis'] certainly won't be set. So just check if it (or simply $bis) is set of not.

You're welcome!

Garth Farley
  #5  
Old 18-Jul-2003, 01:19
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
thanks for your feedback but still its not workign may be i misunderstood ur post i tried like this

<td nowrap align="center">
<select name="von">
<?if( isset($bis) ){//where shall i put this piece of code
echo $bis;
}else{
echo (date('H:i'));
} ?>
<? fillDD(0, 0, $bis); ?>
</select>
</td>

thanks in advance
  #6  
Old 18-Jul-2003, 02:26
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Almost there:

PHP Code:

<td nowrap align="center">
          <select name="von">
       <?if( isset($bis) ){
               fillDD(0, 0, $bis);
           }else{
                           //Lets try & select the closest time to now.
         $mins = date('i');
         $mins -= ($mins % 5);  //subtracts the remainder when divided by 5, from the original number

               fillDD(0, 0, date('H') . ":" . $mins);  
       } ?>                   
             </select>
</td> 


See if that works

GF
  #7  
Old 18-Jul-2003, 02:42
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
sorry unfortunately still its not working only change is instead of 0:00 now im getting system time i can give you the result im getting in form

first time i login i get time in von and bis field
10:30 10:30 //now i changed this into 10:55
so as new line on top of these time
10:55 11:00//upto this it works fine

but when i close the browser and login as second time i get von time as system time instead of 11:00 in bis field

hope it will be clear for u the result in form show like this when i login second time in same date,for more clear

server2.vitodesign.com

sys time 10:45 instead of systime it must be 11:00
10:55 11:00
10:30 10:55

thanks for understanding
  #8  
Old 18-Jul-2003, 05:29
Garth Farley Garth Farley is offline
Invalid Email Address
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Yup, you would like the "von" time to persist when you log out & in again.

If you look at the code, you see that $bis - what is set to be $von once submitted - is got from $HTTP_POST_VARS['bis']. When you log out, this value disappears, so it defaults back to system time.

So the question is, how to get this value remembered?

The best way, I think, would be to look at the information in the database. See which value of "bis" for today is greatest, and set it as the von in the form.

BTW, your script isn't working at the mo. Insertion failed.

GF
  #9  
Old 18-Jul-2003, 05:32
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
sorry once again i found one bug hope you will help me out
when i use this button
<input type="button" name="now" size="1" value=">" onclick="insertTime();calculateIst()">
it will give me system time and it will show in bis field then i m not able to get this value in von field in new line

0:00 13:23
13:00 13:28 //initally it was 13:25 when i clcik on now buton then it display sysem time in bis field
but in new line its not showing 13:28
13:28 13:23

another thing bis field time always show 5 min less than system due to $mins -= ($mins % 5); is it necessary to do that
//this field is diff. between bis and von time
<input size="1" type="text" value="00:00" name="ist" readonly></td>//i hadcoded value as 00:00 how i can get the actual change this field shows diff only when i change bis field
onchange="calculateIst()"

if possible just visit the link
server2.vitodesign.com
  #10  
Old 24-Jul-2003, 07:02
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
hi,

sorry again for trouble still im getting trouble with time fields for von and bis 2 time fields
1. then i select time from BIS field and click on save then i get bis time in VON field its fine but when i click clock image on bis field to get system and click on save then i,m getting 0:00 i dont no why actually i already discussed this topic and i also get feedback but unfortunately my brain didnt digest this one----that when i chaneg time it works fine but what happen when

PHP Code:

[color=blue]
<? if (!isset($HTTP_POST_VARS["Save"])) { ?>
     <td  nowrap align="center">
            <select name="von">
    <?if( isset($bis) ){
        fillDD(0, 0, $bis);
              }else{
                   $mins = date('i');
                   $mins -= ($mins % 5); 
                               fillDD(0, 0, date('H') . ":" . $mins);
                         } ?>
          </select>
          <img src="../img/clock.gif" onclick="inputTime();calculateIst()" width="16" height="16"  alt="Clock">
   </td>

[/color]

[color=orange]

      <td  nowrap align="center">
                   <select name="bis" onchange="calculateIst()">
                  <option  value="<?=date('H:i')?>"><? echo (date('H:i')); ?></option>
                 <? fillDD(0, 0, -1); ?>
                  </select>
                   <img src="../img/clock.gif" onclick="insertTime();calculateIst()" width="16" height="16"  alt="Clock">
    </td>

[/color] 


2.whn i login second time i m not getting the bis time in von time last entered for eg.
Von Bis
13:21 14:30 // this si fine
13:20 13:21

but when i login im getting system time in Von field instead of 14:30 in Von field in same date i check in database but it only inserts and then select from database

PHP Code:

[color=green]
if (isset($HTTP_POST_VARS["bis"]))
        {
                          $von = $HTTP_POST_VARS["von"];
            $bis = $HTTP_POST_VARS["bis"];
       }
$query = "INSERT INTO t_emp";
$query.="(von,bis) values ";
$query.="('$von','$bis')";
mysql_query($query) or die("Query failed: Insert new row");
[/color] 



please bear with this code as im new bie in this session kind of
things anyone modify this code will really be appreciated or need full code i will send ,hope it is clear

sorry for ur inconvenience

thanks in advance
arun
Attached Images
File Type: jpg time.jpg (36.0 KB, 3 views)
 
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11
Display Size and maybe download time BobbyDouglas MySQL / PHP Forum 5 08-Nov-2003 00:18
Time Problem in Program MrSmiley C Programming Language 1 03-Nov-2003 12:00
unwanted scrollbar problem kelly001 Web Design Forum 3 24-Oct-2003 10:44
ambiguity in time field zuzupus MySQL / PHP Forum 9 28-Jul-2003 08:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:48.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.