Edit File: pj.php
<?php echo "<table style='table-layout:fixed; font-family:helvetica; font-size:9pt; word-wrap: break-word;text-align: center; width: 100%; height:6%; margin-left: auto; margin-right: auto; border-style: solid; border-width: 0.1em; background-color: #81BEF7;' border-color='#81BEF7' border='0' cellpadding='3' cellspacing='4''> <tr style='height:100%'> <th style='width:5%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word; class='active' >" . "<img style='border: 0px solid ; width: auto; height: 10%; cursor:pointer' alt='Dodaj zapis' title='Dodavanje zapisa' src='../image/add.png' onclick='dodajpj()'>" . "</th> <th style='width:15%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'>NAZIV</th> <th style='width:15%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'>MJESTO</th> <th style='width:15%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'>AKTIVNA</th> <th style='width:15%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'>Radi</th> <th style='width:5%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'> UREDI </th> <th style='width:0.8%; height:100%; th-layout:fixed; font-family:helvetica; font-size:9pt;word-wrap: break-word'></th> </tr> </table>"; echo "<table width='100%'>"; require_once('../configdb.php'); $con=mysqli_connect($configdb['db_server'],$configdb['db_korisnik'],$configdb['db_lozinka'],$configdb['db_ime']); // Check connection if (mysqli_connect_errno()) { echo "Ne mogu se povezati na bazu: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM pj"); while($row = mysqli_fetch_array($result)) { echo "<tr style='height:10px; width:100% border-style: solid; border-width: 0.1em '>"; echo "<td style='width:15%;height:20px;text-align: left;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> ". $row['naziv']." </td>"; echo "<td style='width:15%;height:20px;text-align: left;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> ". $row['mjesto']." </td>"; echo "<td style='width:15%;height:20px;text-align: left;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> ". $row['aktivna']." </td>"; echo "<td style='width:15%;height:20px;text-align: left;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> ". $row['prijavljen']." </td>"; // SELECT `ID`, `idfirme`, `idpj`, `naziv`, `adresa`, `mjesto`, `postanskibroj`, `regija`, `drzava`, `jib`, `telefon`, `aktivna`, `poruka`, `brojslika` FROM `pj` WHERE 1 echo "<td style='width:5%;height:20px;text-align: center;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> " . "<img style='border: 0px solid ; width: auto; height: 80%; cursor:pointer;' alt='Uredi zapis' title='Uredjivanje zapisa' src='../image/edit.png' name=". $row['ID']." onclick='uredi(name,1)'>" . " </td>"; echo "<td style='width:0.8%;height:20px;text-align: left;word-wrap: break-word; font-family:Helvetica;font-size:9pt;background-color: rgb(255, 255, 255);'> </td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?>
Back