Autor Zpráva
Elrohir
Profil
Ahojte,
hladal som to tu na fore a kade tade este, ale nikde nebolo popisane to co potrebujem , teda aspon sa mi tak zdalo.Prosim Vas teda o pomoc.
...
mam spravena ze checkboxi sa mi zaskrtavaju podla toho ci je napisane v db phpmyadmin nieco ak nie tak nie su checked.
no a ja potrebujem este k tomu pridat toto :
1. po manualnom odskrtnuti a zaskrtnuti checkboxu a naslednom odoslani cez button save , update v mysql
2. pri manualnom zaskrtavani automaticke zaskrtnutie checboxov , mam 4 checkboxi 1,2,3,4 a ked zaskrtnem 1 tak sa mi automaticky zaskrtne aj 3, pokial zaskrtnem 2 tak automaticky sa zaskrtne aj 4.

<body>
    <div id="window">
    <input id="close" class="close" name="close" value="close" type="button" style="cursor: pointer;" onclick=" return closeWin();" />
    <input id="save" class="save" name="save" value="save" type="button" style="cursor: pointer;" onclick=" return ;" />
      <table border="1px" id="chb" name="chb">
              <tr>
                <td style="background-color: #808080;"><b>Date</b></td>
                <td style="background-color: #808080;"><b>Name</b></td>
                <td style="background-color: #808080;"><b>Reason</b></td>
                <td style="background-color: #808080;"><b>Waiting</b></td>
                <td style="background-color: #228b22;"><b>OK</b></td>
                <td style="background-color: #228b22;"><b>Name</b></td>
                <td style="background-color: #228b22;"><b>Datum</b></td>
                <td style="background-color: #1e90ff;"><b>NG</b></td>
                <td style="background-color: #1e90ff;"><b>Error</b></td>
                <td style="background-color: #1e90ff;"><b>Name</b></td>
                <td style="background-color: #1e90ff;"><b>Datum</b></td>
                <td style="background-color: #f0e68c;"><b>Repair date OK</b></td>
                <td style="background-color: #f0e68c;"><b>Name</b></td>
                <td style="background-color: #ba55d3;"><b>Release</b></td>
                <td style="background-color: #ba55d3;"><b>Release WOR</b></td>
              </tr>
              <?php
include ('../db.php');
function safe($value)
{
   return mysql_real_escape_string($value);
} 
$con="SELECT * FROM  db_sn JOIN projekt ON db_sn.IDx=projekt.ID WHERE db_sn.IDx = ".$num."";
$vypis2=mysql_query($con) or die($con."<br/>".mysql_error());

while ($data = mysql_fetch_array($vypis2)){//(list( , $datum, $sn) = mysql_fetch_row($vypis2))
        
               ?>
              <tr>
                <td><input id="d" type="text" name="datum" size="15" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['datum']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="meno" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['meno']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="reason" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['reason']))))) ?>" readonly="readonly" /></td>
                <td><input id="wait" type="checkbox" name="wait" value="wait" <?php if($data['waiting'] == 'wait') {echo ' checked="checked"';} 
                                                                                    if($data['ng'] == 'ng') {echo ' checked="checked"';} ?> /></td>
                <td><input id="win_ok" type="checkbox" name="win_ok" value="win_ok" <?php if($data['ok'] == 'ok') {echo ' checked="checked"';} ?> /></td>
                <td><input id="d" type="text" name="ok_meno" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['ok_meno']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="ok_datum" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['ok_datum']))))) ?>" readonly="readonly" /></td>
                <td><input id="win_ng" type="checkbox" name="win_ng" value="win_ng" <?php if($data['ng'] == 'ng') {echo ' checked="checked"';} ?> /></td>
                <td><textarea id="win_area" name="win_area" class="win_area" cols="20" rows="1" readonly="readonly"> <?php echo(stripslashes(htmlspecialchars(trim(safe($data['remark']))))) ?> </textarea></td>
                <td><input id="d" type="text" name="ng_meno" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['ng_meno']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="ng_datum" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['ng_datum']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="oprava_datum" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['oprava_datum']))))) ?>" readonly="readonly" /></td>
                <td><input id="d" type="text" name="op_meno" size="20" value="<?php echo(stripslashes(htmlspecialchars(trim(safe($data['op_meno']))))) ?>" readonly="readonly" /></td>
                <td><input id="release" type="checkbox" name="release" value="release" <?php if($data['ok'] == 'ok') {echo ' checked="checked"';} ?> /></td>
                <td><input id="wor" type="checkbox" name="wor" value="wor" /></td>
              </tr>
              <?php
            } mysql_close();
              ?>
      </table>
    </div>
</body>
skusal som nieco taketo ale to moc nepomohlo a predpokladam ze to nie je dobre pre to co potrebujem ...
js
$(document).ready(function() 
    {
    //set initial state.
        $('#chb').val($(this).is(':checked'));

        $('#checkbox').change(function() 
        {
            if($(this).is(":checked")) 
            {
                var returnVal = confirm("Are you sure?");
                $(this).attr("checked", returnVal);
            }
            $('#chb').val($(this).is(':checked'));        
        });
    });
za rady, pomoc vopred dakujem

Vaše odpověď


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: