<?php
session_start();
ob_start();
?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) { // PHP5 with register_long_arrays off
$HTTP_POST_VARS = &$_POST;
$HTTP_GET_VARS = &$_GET;
$HTTP_SERVER_VARS = &$_SERVER;
$HTTP_COOKIE_VARS = &$_COOKIE;
$HTTP_ENV_VARS = &$_ENV;
$HTTP_POST_FILES = &$_FILES;
if (isset($_SESSION)) $HTTP_SESSION_VARS = &$_SESSION;
}
?>
<?php include ("ewconfig.php") ?>
<?php include ("db.php") ?>
<?php include ("tipo_autoreinfo.php") ?>
<?php include ("advsecu.php") ?>
<?php include ("phpmkrfn.php") ?>
<?php include ("ewupload.php") ?>
<?php
if (!IsLoggedIn() && (@$HTTP_COOKIE_VARS[ewCookieAutoLogin] == "autologin" && @$HTTP_COOKIE_VARS[ewCookiePassword] <> "")) {
ob_end_clean();
header("Location: login.php");
exit();
}
LoadUserLevel();
$ewCurSec = (IsLoggedIn())? CurrentUserLevelPriv("tipo_autore") : GetAnonymousPriv("tipo_autore");
if (($ewCurSec & ewAllowView) <> ewAllowView) {
ob_end_clean();
header("Location: tipo_autorelist.php");
exit();
}
?>
<?php
// Initialize common variables
$x_id_tipo_autore = NULL;
$ox_id_tipo_autore = NULL;
$z_id_tipo_autore = NULL;
$ar_x_id_tipo_autore = NULL;
$ari_x_id_tipo_autore = NULL;
$x_id_tipo_autoreList = NULL;
$x_id_tipo_autoreChk = NULL;
$cbo_x_id_tipo_autore_js = NULL;
$x_tipo_autore = NULL;
$ox_tipo_autore = NULL;
$z_tipo_autore = NULL;
$ar_x_tipo_autore = NULL;
$ari_x_tipo_autore = NULL;
$x_tipo_autoreList = NULL;
$x_tipo_autoreChk = NULL;
$cbo_x_tipo_autore_js = NULL;
?>
<?php
// Get key
$x_id_tipo_autore = @$HTTP_GET_VARS["id_tipo_autore"];
if (($x_id_tipo_autore == "") || ($x_id_tipo_autore == NULL)) {
ob_end_clean();
header("Location: tipo_autorelist.php");
exit();
}
if (!is_numeric($x_id_tipo_autore)) {
ob_end_clean();
header("Location: tipo_autorelist.php");
exit();
}
// Get action
$sAction = @$HTTP_POST_VARS["a_view"];
if (($sAction == "") || (($sAction == NULL))) {
$sAction = "I"; // Display record
}
// Open connection to the database
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
switch ($sAction)
{
case "I": // Display record
if (!LoadData($conn)) { // Load record
$HTTP_SESSION_VARS[ewSessionMessage] = "No records found";
phpmkr_db_close($conn);
ob_end_clean();
header("Location: tipo_autorelist.php");
exit();
}
}
?>
<?php include ("header.php") ?>
<script type="text/javascript">
<!--
EW_LookupFn = "ewlookup.php"; // ewlookup file name
EW_AddOptFn = "ewaddopt.php"; // ewaddopt.php file name
EW_MultiPagePage = "Page"; // multi-page Page Text
EW_MultiPageOf = "of"; // multi-page Of Text
//-->
</script>
<script type="text/javascript" src="ewp.js"></script>
<p><span class="phpmaker">View TABLE: Type of author<br><br>
<a href="tipo_autorelist.php">Back to List</a>
<?php if (($ewCurSec & ewAllowEdit) == ewAllowEdit) { ?>
<a href="<?php if ($x_id_tipo_autore <> "") {echo "tipo_autoreedit.php?id_tipo_autore=" . urlencode($x_id_tipo_autore); } else { echo "javascript:alert('Invalid Record! Key is null');";} ?>">Edit</a>
<?php } ?>
<?php If (($ewCurSec & ewAllowAdd) == ewAllowAdd) { ?>
<a href="<?php if ($x_id_tipo_autore <> "") {echo "tipo_autoreadd.php?id_tipo_autore=" . urlencode($x_id_tipo_autore); } else { echo "javascript:alert('Invalid Record! Key is null');";} ?>">Copy</a>
<?php } ?>
<?php if (($ewCurSec & ewAllowDelete) == ewAllowDelete) { ?>
<a href="<?php if ($x_id_tipo_autore <> "") {echo "tipo_autoredelete.php?id_tipo_autore=" . urlencode($x_id_tipo_autore); } else { echo "javascript:alert('Invalid Record! Key is null');";} ?>">Delete</a>
<?php } ?>
</span></p>
<p>
<form>
<table class="ewTable">
<tr>
<td class="ewTableHeader"><span>id tipo autore</span></td>
<td class="ewTableAltRow"><span>
<?php echo $x_id_tipo_autore; ?>
</span></td>
</tr>
<tr>
<td class="ewTableHeader"><span>tipo autore</span></td>
<td class="ewTableAltRow"><span>
<?php echo $x_tipo_autore; ?>
</span></td>
</tr>
</table>
</form>
<p>
<?php include ("footer.php") ?>
<?php
phpmkr_db_close($conn);
?>
<?php
//-------------------------------------------------------------------------------
// Function LoadData
// - Variables setup: field variables
function LoadData($conn)
{
global $HTTP_SESSION_VARS;
global $x_id_tipo_autore;
$sFilter = ewSqlKeyWhere;
if (!is_numeric($x_id_tipo_autore)) return false;
$x_id_tipo_autore = (get_magic_quotes_gpc()) ? stripslashes($x_id_tipo_autore) : $x_id_tipo_autore;
$sFilter = str_replace("@id_tipo_autore", AdjustSql($x_id_tipo_autore), $sFilter); // Replace key value
$sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, $sFilter, "");
$rs = phpmkr_query($sSql,$conn) or die("Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql);
if (phpmkr_num_rows($rs) == 0) {
$bLoadData = false;
} else {
$bLoadData = true;
$row = phpmkr_fetch_array($rs);
// Get the field contents
$GLOBALS["x_id_tipo_autore"] = $row["id_tipo_autore"];
$GLOBALS["x_tipo_autore"] = $row["tipo_autore"];
}
phpmkr_free_result($rs);
return $bLoadData;
}
?>