<link rel="stylesheet" type="text/css" href="table.css"> <div class = "outertb"> <table id="tble" align="center"> <thead><tr id='tableHeader'> <th style='width:5%;' onclick=sortTableX(0);>id</th><th style='width:30%;' onclick=sortTableX(1);>Title</th><th onclick=sortTableX(2); style='width:45%;'>Score</th><th style='width:10px;'>⚙Tool </th> </tr></thead> <tr> <?php // Include config file require_once "configs.php"; $sql = "select * from fixa where scode like 'p%' order by id desc"; $res = $db->query($sql); $i=0; while ($row = $res->fetchArray()) { $nmb=str_pad($row["id"], 4, '0', STR_PAD_LEFT); echo "<td>".$nmb."</td>"; // echo "<td>" . $row['id'] . "</td>"; // echo "<td>" . $row['title'] . "</td>"; if ($_SESSION['lang']=="en") $title=$row['title']; else $title=$row['title_th']; echo "<td>" . $title. "</td>"; echo "<td><a href=zlisalist2p.php?packid=".$row['id']."&title=".urlencode($row['title'] )." style='color:inherit;' class='button1 blue'>" . "📑Question</a> "; echo "<a href=zuseraddp.php?packid=".$row['id']."&title=".urlencode($row['title'] )." style='color:inherit;' class='button1 blue'>" . "👤User</a> "; echo "<a href=zfixalist4p.php?packid=".$row['id']."&title=".urlencode($row['title'] )." style='color:inherit;' class='button1 blue'>" . "⥮Mod</a> "; echo "<a href=zlisalist2pa.php?packid=".$row['id']."&title=".urlencode($row['title'] )." style='color:inherit;' class='button1 blue'>" . "+Question</a> "; $crurl= (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; echo "<a href=zlisalist2ps.php?packid=".$row['id']."&title=".urlencode($row['title'] )." style='color:inherit;' class='button1 blue'>" . "📑Score</a></td>"; echo '<td><button class="button0 red" style="color:inherit;" onclick=d3o("' . $row['id'] . '","' . urlencode($row['username']) .'")>❌DEL</button></td>'; //echo "<a href='items_dell.php?back=".$crurl."&id=". $row['id'] ."' title='DEL Record' data-toggle='tooltip' class='button0 red' >DELX</a>"; $i++; echo "</tr>"; } ?> </table> </div> <!-- end outertb --> <script> function d3o(delid,title){ if (confirm("Do you want to Remove "+title+delid) == true) { userPreference = "Data saved successfully!"; d3lr(delid); } else { userPreference = "Canceled!"; } } function d3lr(delid) { //var x = document.getElementById("iusername"); //var y = document.getElementById("iemail"); //var z = document.getElementById("ipassword"); //alert("delete "+delid); //return; server="z_dellisa.php"; // snackbar2reload(); // snackbar2; datapack={}; //dont need this -as issue with special charactor // datapack.name=btoa(en1.value); //decode =atob // datapack.x=x.value; // datapack.y=y.value; // datapack.z=z.value; datapack.z=delid; data=JSON.stringify(datapack); params="postdata="+data;//+row2+cmd1+cmd2; var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { //document.getElementById(param).innerHTML = this.responseText; // document.getElementById("snackbar2").innerHTML = this.responseText; //reloadme(); if (this.response == "OK") { alert(delid+" Deleted");reloadme(); } else { alert(this.response); } //closeme6("snackbar6"); // snackbar2reload(); } }; xhttp.open("POST",server, true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(params); } function reloadme(){ location.reload(); return false; } </script>
Edit file:zprog_listd-20210911135701.php5012