<?php session_start(); ?>
<?php require_once('../Connections/telmanik_press.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

if ((isset($_GET['iddelete'])) && ($_GET['iddelete'] != "") && (isset($_POST['iddelete']))) {
  $deleteSQL = sprintf("DELETE FROM content WHERE id=%s",
                       GetSQLValueString($_GET['iddelete'], "int"));

  mysql_select_db($database_telmanik_press, $telmanik_press);
  $Result1 = mysql_query($deleteSQL, $telmanik_press) or die(mysql_error());

  $deleteGoTo = "delete-confirmed.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}

$colname_deleteconfirm = "-1";
if (isset($_GET['iddelete'])) {
  $colname_deleteconfirm = $_GET['iddelete'];
}
mysql_select_db($database_telmanik_press, $telmanik_press);
$query_deleteconfirm = sprintf("SELECT * FROM content WHERE id = %s", GetSQLValueString($colname_deleteconfirm, "int"));
$deleteconfirm = mysql_query($query_deleteconfirm, $telmanik_press) or die(mysql_error());
$row_deleteconfirm = mysql_fetch_assoc($deleteconfirm);
$totalRows_deleteconfirm = mysql_num_rows($deleteconfirm);
?>
<?php require('assets/wrapper/header.php'); ?>
  <p>&nbsp;  </p>
  <div id="editload">
<form id="form1" name="form1" method="post" action="">
  <table width="900" border="1">
    <tr>
      <td><?php echo $row_deleteconfirm['title']; ?></td>
    </tr>
    <tr>
      <td><?php echo $row_deleteconfirm['block_content']; ?></td>
    </tr>
    <tr>
      <td><?php echo $row_deleteconfirm['page_name']; ?></td>
    </tr>

  </table>
  <p>&nbsp;  </p>
  
    <input type="submit" name="iddelete" id="iddelete" value="<?php echo $translate->__('Confirm Delete');?>" />
  
</form></div>
<p>&nbsp;  </p><p>&nbsp;  </p>
<?php
mysql_free_result($deleteconfirm);
?>
<?php require('assets/wrapper/footer.php'); ?>