/    Sign up×
Community /Pin to ProfileBookmark

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

[code=php]
[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]

[/code]

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

[code=php]

[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]

[/code]

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

[upl-file uuid=4610a06f-98d8-4dcd-aeb5-31bba81b6b69 size=36kB]time.jpg[/upl-file]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@zuzupusauthorJul 25.2003 — nobody is there to sort out this problem
Copy linkTweet thisAlerts:
@zuzupusauthorJul 28.2003 — sorry for late response i almost solved the problem of 0:00 in von field when clicking on clock image in bis field,but got another problem hope this is easy for u.

what happening when first time i log in it give correct time in von field after form submission for eg.

Von Bis

10:00 10:02 //this is fine when first time i submit the form

9:50 10:00

but next time(second time form submission) when i clcik clock image in bis field and submit form im getting 2 min less in von field for eg.

Von Bis

10:00 10:07// 2 min less as it must be 10:02

10:00 10:02

[code=php]
[COLOR=royalblue]

function fillDD($min, $max, $selected)
{
$sel_bits = explode(":", $selected);
for($i=$min; $i<24; $i++) {
for($j=$max; $j<60; $j+=5) {
$j = sprintf('%02d', $j);
if($i == $sel_bits[0] && $j <= $sel_bits[1] && $j+5 > $sel_bits[1]) {
print("<option SELECTED value='$i:$j'>$i:$j</option>n");
}
else {
print("<option value='$i:$j'>$i:$j</option>n");
}
}//for($j)
} //for($i)
}
[/COLOR]

[COLOR=orange]
<td nowrap align="center">
<select name="von">
<?if( isset($von) ){
fillDD(0, 0, $bis);
}else{
//Lets try & select the closest time to now.
$mins = date('i');
fillDD(0, 0, date('H') . ":" . $mins);
} ?>
</select>
<img src="../img/clock.gif" onclick="inputTime();calculateIst()" width="16" height="16" alt="Clock">
</td>

<td nowrap align="center">
<select name="bis" onchange="calculateIst()">
<option value="<?=date('H:i')?>"><? echo (date('H:i')); ?></option>//shows time of server as PHP stuff is there and im using local machine to get value
<? fillDD(0, 0, -1); ?>
</select>
<img src="../img/clock.gif" onclick="insertTime();calculateIst()" width="16" height="16" alt="Clock">
</td>

[/COLOR]

[/code]



hopefully u understand this code dont no why it show 2min less in Von field
×

Success!

Help @zuzupus spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...