File size: 3.65Kb
<?php
/*********************************************************************
*
* WapSite powered by CsC Portal. WapSite[tm] is module of CsC Portal.
*
* (C) 2004. CsC Portal. All rights reserved.
*
* http://cscp.cs-centar.net | http://www.cs-centar.net,
*
********************************************************************/
// File: admin/edit.php
// Desc: Use to edit selected page
// Written on: 23.04.2004
include("../wap_db.php");
include("ad_functions.php");
if ($_GET['substr'] == "news" && $_GET['id'] == "edit") {
$field_str .= " news_name = '$n_name', ";
$field_str .= " news_text = '$n_text', ";
$field_str .= " news_date = '$n_date' ";
include("../db_connect.php");
$f_news_edit = mysql_query("UPDATE cscp_wap_news SET $field_str WHERE news_name='$Name'", $db);
echo "<html><body bgcolor=\"dcdcdc\">";
// checking if email func. is on
$email_send = mysql_query("SELECT * from cscp_wap_options WHERE id = 'news'", $db);
$email_send_f = mysql_fetch_row($email_send);
if ($email_send_f[4] == "yes") {
include("temp/$SiteLang/mail_send.tmp");
mail($AdminEmail, "$lang_sendm[news_edit]", $send_message_e[news]);
echo "<br><br><center><b>$lang_sendm[info]</b></center>";
}
echo "<br><br><center><b>$lang_display_e[success]</b></center><br></body></html>";
exit;
}
if ($_GET['id'] == "edit") {
$field_str .= " page_name = '$p_name', ";
$field_str .= " page_subject = '$p_subject', ";
$field_str .= " page_text = '$p_text' ";
include("../db_connect.php");
$f_edit = mysql_query("UPDATE cscp_wap_page SET $field_str WHERE page_name='$Name'", $db);
echo "<html><body bgcolor=\"dcdcdc\">";
// checking if email func. is on
$email_send = mysql_query("SELECT * from cscp_wap_options WHERE id = 'page'", $db);
$email_send_f = mysql_fetch_row($email_send);
if ($email_send_f[4] == "yes") {
include("temp/$SiteLang/mail_send.tmp");
mail($AdminEmail, "$lang_sendm[page_edit]", $send_message_e[page]);
echo "<br><br><center><b>$lang_sendm[info]</b></center>";
}
echo "<br><br><center><b>$lang_display_e[success]</b></center><br></body></html>";
exit;
}
if ($_GET['substr'] == "news" && $_GET['page'] == $page) {
echo "<html>
<head>
<title>{ CsC Portal WapSite $lang_display[admin_title] }{ $lang_display_ed[edit] }</title>
<LINK REL=\"StyleSheet\" HREF=\"style.css\" TYPE=\"text/css\">
</head>
<body bgcolor=\"dcdcdc\"><table align=\"center\" width=\"95%\" class=\"table_info\"><tr><td>
<center><b>$lang_display_e[page_edit]: $page</b></center>
</td></tr>
</table>
<table width=\"95%\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"gray\" class=\"table_display\"><tr><td bgcolor=\"efefef\">
<form method=\"post\" action=\"edit.php?&substr=news&id=edit\"><input type=\"hidden\" name=\"Name\" value=\"$page\">";
display_edit_news($page);
echo "</form></td></tr></table></body></html>";
exit;
}
if ($_GET['page'] == $page) {
echo "<html>
<head>
<title>{ CsC Portal WapSite $lang_display[admin_title] }{ $lang_display_ed[edit] }</title>
<LINK REL=\"StyleSheet\" HREF=\"style.css\" TYPE=\"text/css\">
</head>
<body bgcolor=\"dcdcdc\"><table align=\"center\" width=\"95%\" class=\"table_info\"><tr><td>
<center><b>$lang_display_e[page_edit]: $page</b></center>
</td></tr>
</table>
<table width=\"95%\" align=\"center\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"gray\" class=\"table_display\"><tr><td bgcolor=\"efefef\">
<form method=\"post\" action=\"edit.php?id=edit\"><input type=\"hidden\" name=\"Name\" value=\"$page\">";
display_edit($page);
echo "</form></td></tr></table></body></html>";
}
?>