Modify Items <link rel="stylesheet" type="text/css" href="table.css"> <input type="text" id="mySTInput" onkeyup="mySTFunction()" placeholder="Search for .." title="Type for searching..."> <input type="button" value=">" onclick=mySTFunction();> <select id=selecti onchange="newr(this.options[this.selectedIndex].value)"> <option value=30 selected="selected">30</option> <option value=50>50</option> <option value=100>100</option> </select> <span id="pageNavPosition" style="float:right;margin-top:4px;margin-right:15%;"></span> <div class = "outertb"> <?php $packid=$_GET["packid"]; $title=$_GET["title"]; // Include config file require_once "configs.php"; $rows=0; // Attempt select query execution $sql = "select * from fixa where scode like 'q%'"; $sql="SELECT *,lisa.id as lisaid FROM `lisa` join fixa on fixa.id=lisa.fixaid where lisa.packid=".$packid." group by lisa.packid,lisa.id order by lisa.lcode";//group by fixaid"; $sql="SELECT *,lisa.id as lisaid FROM `lisa` join fixa on fixa.id=lisa.fixaid where lisa.packid=".$packid." and lisa.fbox>0 group by lisa.packid,lisa.id order by lisa.lcode "; $res = $db->query($sql); if ($res) { echo "<table id=tble >"; echo "<thead><tr id='tableHeader'>"; echo "<tr>"; echo "<th style='width:3%;'>#</th>"; echo "<th style='width:40%;'>title</th>"; echo "<th style='width:3%;'>code</th>"; echo "<th style='width:3%;'>packid</th>"; echo "<th style='width:3%;'>code</th>"; echo "<th style='width:3%;'>code</th>"; echo "<th style='width:3%;'>FNo</th>"; echo "<th style='width:3%;'>Change</th>"; echo "</tr>"; echo "</thead>"; echo "<tbody>"; while ($row = $res->fetchArray()) { echo "<tr>"; echo "<td>" . $row['lisaid'] . "</td>"; echo "<td>" . $row['title'] . "</td>"; echo "<td>" . $row['scode'] . "</td>"; echo "<td>" . $row['packid'] . "</td>"; echo "<td>" . $row['lcode'] . "</td>"; echo "<td><input type='text' style='width: 5em' maxlength=5 name='b".$row['lisaid']."' placeholder='".$row['lcode']."' value=".$row['lcode']."></td>"; echo "<td><input type='text' style='width: 3em' maxlength=5 name='f".$row['lisaid']."' placeholder='".$row['fbox']."' value=".$row['fbox']."></td>"; $lid=$row['lisaid'];?> <td> <input type="checkbox" name="save" id ="myCheck" value="save" onclick=myfuncf2("lisaupdate.php?lid=<?php echo $lid;?>","rf2","<?php echo $lid;?>",this) > </td> <?php echo "</tr>"; $rows++; } echo "</tbody>"; echo "</table>"; // Free result set // mysqli_free_result($result); } else{ echo "<p class='lead'><em>No records were found.</em></p>"; } ?> </div> <!-- end outertb --> </div></div> <script> function myfuncf2(server,param="",row1,el) { var checkBox = document.getElementById("myCheck"); //var obj = JSON.parse(myJSON); //var drow1 = atob(row1); // var myJSON = JSON.stringify(drow1); er="b"+row1; fr="f"+row1; cmd1=(document.getElementsByName(er)[0].value); cmd2=(document.getElementsByName(fr)[0].value); // alert("update:"+row1+":"+cmd1); // document.getElementById("snackbar2").innerHTML = "Updated record:"+row1+",Lvalue:"+cmd1+",Fvalue:"+cmd2; // snackbar2reload(); alert("Updated record:"+row1+",Lvalue:"+cmd1+",Fvalue:"+cmd2); // var myJSON = JSON.parse(drow1); //alert(myJSON.hbx1+myJSON.hbx2+myJSON.hbx3); // cmd1=(document.getElementsByName(myJSON.hbx1)[0].value); // cmd2=(document.getElementsByName(myJSON.hbx2)[0].value); // cmd3=(document.getElementsByName(myJSON.hbx3)[0].value); //alert(cmd1+cmd2+cmd3); if (el.checked == true){ datapack={}; //dont need this -as issue with special charactor // datapack.name=btoa(en1.value); //decode =atob datapack.lid=row1; datapack.lcode=cmd1; datapack.fbox=cmd2; data=datapack; data=JSON.stringify(datapack); // alert(data); //alert(obj.hbx1); //document.getElementById(param).innerHTML =row1; // alert(row1); // rr="row"+row; //if (row) rr=(document.getElementById(row).value); //cmd1=(document.getElementsByName(row1)[0].value); //cmd2=(document.getElementsByName(row2)[0].value); if (el.checked == true){ //alert(el.attributes["name"].value+"+"+drow1); params="postdata="+data;//+row2+cmd1+cmd2; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //document.getElementById(param).innerHTML = console.log(this.responseText); // alert(this.responseText); } }; xhttp.open("POST",server, true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(params); } } //exit; //alert(el.attributes["name"].value+"+"+row1); } </script>
Edit file:zlisalist2ps-20210911145258.php7095