S
shao1234
Bekanntes Mitglied
- Dabei seit
- 11.01.2001
- Beiträge
- 186
- Reaktionspunkte
- 0
hallo leute,
ich habe hier ein script...das daten ausliest mit jeweils einer checkbox am anfang. jetzt hab ich aber ein problem..ich habe die funktion drin das alle checkboxen ausgewählt werden sollen..das tut es aber nicht. weiss jemand woran das liegt?
ich habe hier ein script...das daten ausliest mit jeweils einer checkbox am anfang. jetzt hab ich aber ein problem..ich habe die funktion drin das alle checkboxen ausgewählt werden sollen..das tut es aber nicht. weiss jemand woran das liegt?
PHP:
<?
include("config.php");
$zeit = '2011-07-11';
$zeit1 = '2011-07-11';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Neue Seite 1</title>
<script type="text/javascript" language="JavaScript">
<!-- Begin
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;}
checkflag = "true";
return " keine "; }
else {
for (i = 0; i < field.length; i++) {
field[i].checked = false; }
checkflag = "false";
return " alle "; }
}
// End -->
</script>
</head>
<body>
<table border="1" width="100%">
<tr>
<td>Box</td>
<td>Markt</td>
<td>Aktivierungsdatum</td>
<td>Promotor</td>
<td>Nummer</td>
<td>Tarif</td>
<td>Tarifgruppe</td>
<td>Handy</td>
</tr>
<?php
db_connect();
$abfrage = "SELECT * FROM msisdn WHERE (datum between '$zeit' and '$zeit1') and tarif != 'CallYa' order BY markt";
$ergebnis = mysql_query($abfrage);
while($row = mysql_fetch_object($ergebnis))
{
?>
<tr>
<td><input type="checkbox" name="list" value="1"></td>
<td><font size="2"><?php echo $row->markt; ?></font></td>
<td><font size="2"><?php list($jahr, $monat, $tag) = explode("-", $row->datum); ?><?php echo $tag; echo $zeichen; echo $monat; echo $zeichen; echo $jahr; ?></font></td>
<td><font size="2"><?php echo $row->promotor; ?></font></td>
<td><font size="2"><?php echo $row->nummer; ?></font></td>
<td><font size="2"><?php echo $row->tarif; ?></font></td>
<td><font size="2"><?php echo $row->gruppe; ?></font></td>
<td>x</td>
<?php }
db_disconnect();
?></tr>
</table>
<input type="button" value=" alle auswaehlen "onClick="this.value=check(this.form.list)">
</body>
</html>