Forum Moderators: coopster
<?php
session_start();
if(!isset($_SESSION['loggedin'])) {
header('Location: '.$domain.'index.php?error=1');
exit();
}
?>
<html>
<head>
<script type="text/javascript">
var form_id;
function confirm_delete(go_url)
{
var answer = confirm("Jeni te sigurte per fshirjen e ketij evenimenti?");
if (answer)
{
location=go_url;
}
}
</script>
</head>
<body>
<?php
include '/includet/variabla.php';
include (BPATH_ADM . 'includet/dbconfig.php');
include (BPATH_ADM . 'includet/dblidhja.php');
$query="SELECT * FROM `ndeshje` ORDER BY `ndeshje`.`ora`,`data`";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<br /><br /><center><div class="ndeshjeshfaq">
<table width="598" border="0" align="center" class="ndeshjekoka">
<tr>
<td width="25" class="ndshfaqid">ID</td>
<td width="35" class="ndshfaqsporti">Sporti</td>
<td width="265" class="ndshfaqndeshja">Ndeshja</td>
<td width="50" class="ndshfaqmenyra">Menyra</td>
<td width="50" class="ndshfaqora">Ora</td>
<td width="90" class="ndshfaqdata">Data</td>
<td width="110" class="ndshfaqmod">X - Mod</td>
</tr>
</table></center>
<?php
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"ID");
$ndeshja=mysql_result($result,$i,"ndeshja");
$ora=mysql_result($result,$i,"ora");
$data=mysql_result($result,$i,"data");
$menyra=mysql_result($result,$i,"menyra");
$sporti=mysql_result($result,$i,"sporti");
?>
<center>
<table width="598" border="0" class="ndeshjetabela">
<tr>
<td width="25" class="ndshfaqid"><?php echo $id; ?></td>
<td width="35" class="ndshfaqsporti"><img src="..<?php echo $sporti; ?>" width="13"></td>
<td width="265" class="ndshfaqndeshja"><?php echo $ndeshja; ?></td>
<td width="50" class="ndshfaqmenyra"><?php echo $menyra; ?></td>
<td width="50" class="ndshfaqora"><?php echo $ora; ?></td>
<td width="90" class="ndshfaqdata"><?php echo $data; ?></td>
<?php
include (BPATH_ADM . 'includet/dbconfig.php');
include (BPATH_ADM . 'includet/dblidhja.php');
$query="SELECT * FROM `ndeshje` ORDER BY `ndeshje`.`ID`";
$result=mysql_query($query);
while ($row = mysql_fetch_array($result)){
$id = $row['ID'];
}
?>
<td width="110" class="ndshfaqmod"><a href="#" onClick="confirm_delete('modulet/ndeshje/fshij.php?fshij=true&id=<?php echo $id;?>');">Fshije</a> - <a href="link-for-edit-entry.php">Mod</a></td>
</tr>
</table></center>
</div>
<?php
$i++;
}
?>
</body>
</html> <html>
<body>
<?php
include '/includet/variabla.php';
include (BPATH_ADM . 'includet/dbconfig.php');
include (BPATH_ADM . 'includet/dblidhja.php');
$sql = "delete from ndeshje WHERE ID = '$_GET[id]'";
$result = mysql_query($sql);
//print $sql;
if (!$result) {
echo "<div align ='center' class='error'>Fshirja e ndeshjes deshtoi!";
echo "<br>";
echo "<br>";
echo '<form><input type="button" class="buton" value="Kthehu Mbrapa"
ONCLICK="history.go(-1)"></form>';
} else {
echo "<div align ='center' class='header2'>Ndeshja u fshi me sukses!";
echo "<br>";
echo "<br>";
echo '<form><input type="button" class="buton" value="Kthehu Mbrapa"
ONCLICK="history.go(-1)"></form>';
}
?>
</body>
</html> $sql = "delete from ndeshje WHERE ID = '$_GET[id]'"; $sql = "delete from ndeshje WHERE id='" . mysql_real_escape_string($_GET['id']) . "'";
$sqlid = $_GET['id'];
$sqlid = mysql_real_escape_string($sqlid);
$sql = "delete from ndeshje WHERE id = '$sqlid' LIMIT 1";
$sqlid = $_GET['id'];
$sqlid = mysql_real_escape_string($sqlid); $sqlid = mysql_real_escape_string($_GET['id']); <script type="text/javascript">
<!--
function delconfirmation() {
var delanswer = confirm("Delete message?")
if (delanswer) {
return true;
} else {
return false;
}
}
//-->
</script>
<form method="get" action="/whatever.php" onsubmit="delconfirmation()">
<input type="hidden" name="id" value="3" />
<input type="submit" value="Delete" />
</form>
<a href="whatever.php?id=3" onclick="delconfirmation()">Delete</a>