File: D:/web/itpartnership/RandomQ/Admin/q_edit.asp
<!--#include file="../config.asp"-->
<%Dim SQL, fldQ, ACT, MESSAGE, MODE, ID, RS
IF NOT Session("RQ_LOGIN") = "True" THEN
Response.Redirect "index.asp"
Response.End
END IF
ID = Request.QueryString("ID")
MODE = Request.Form("mode")
IF MODE = "edit" THEN
If IS_VALID_ID(ID) = True Then
fldQ = APO(Request.Form("des"))
ACT = APO(Request.Form("active"))
IF (ACT = "") or (IsNull(ACT) = True) THEN
ACT = 0
ELSE
ACT = 1
END IF
Call CHECK_INP()
IF MESSAGE = "" THEN
Call OPEN_DB()
SQL = "UPDATE TABLE_Q SET fldMEMO = '" & fldQ & "', fldACTIVE=" & ACT & " WHERE ID = " & ID
MyConn_RQ.Execute(SQL)
MyConn_RQ.close
Set MyConn_RQ = Nothing
Response.Redirect "index_q.asp"
Response.End
END IF
END IF
ELSE
If IS_VALID_ID(ID) = True Then
Call OPEN_DB()
SQL = "SELECT fldMEMO, fldACTIVE FROM TABLE_Q WHERE ID = " & ID
Set RS = MyConn_RQ.Execute(SQL)
IF NOT RS.EOF THEN
fldQ = trim(RS("fldMEMO"))
ACT = trim(RS("fldACTIVE"))
END IF
RS.Close
Set RS = Nothing
MyConn_RQ.Close
Set MyConn_RQ = Nothing
END IF
END IF
PRIVATE SUB CHECK_INP()
IF fldQ = "" OR IsNUll(fldQ) THEN MESSAGE = MESSAGE & "<li />Please enter the quote content."
END SUB
%>
<!--#include file="inc_header.asp"-->
<table width="80%" align="center" cellpadding="2" cellspacing="0" border="0"><tr><td>
<a href="javascript:history.go(-1)"><img src="img/back.gif" width="15" height="15" alt="" border="0"></a>
</td></tr></table>
<br />
<% If NOT MESSAGE = "" THEN %>
<table width="80%" align="center" cellpadding="2" cellspacing="0" border="0"><tr>
<td><%= MESSAGE %></td>
</tr></table>
<br /><br />
<!--#include file="inc_footer.asp"-->
<% Response.End %>
<% End If %>
<script type="text/javascript">
_editor_url = "WYSIWYG/Editor/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="WYSIWYG/Editor/htmlarea.js"></script>
<script type="text/javascript">
var editor = null;
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
function initEditor() {
editor = new HTMLArea("des");
editor.config.pageStyle = 'body { background-color: white; color: black; font-family: Verdana; font-size: 12 } ';
editor.config.toolbar =
[
[ "fontname", "space", "fontsize"],
[ "bold", "italic", "underline", "space", "strikethrough", "subscript", "superscript", "space", "justifyleft", "justifycenter", "justifyright", "justifyfull", "space", "forecolor", "hilitecolor", "space", "inserthorizontalrule", "space", "space", "htmlmode", "space"]
];
editor.generate();
return false;
}
</script>
<body onload="initEditor()">
<form action="q_edit.asp?ID=<%= ID %>" method="post" name="frm">
<table width="80%" align="center" cellpadding="2" cellspacing="0" border="1" bordercolor="WhiteSmoke" style="border-collapse:collapse;">
<tr bgcolor="WhiteSmoke">
<td background="img/bg1.gif">Edit Quote</td>
</tr><tr>
<td>
<Br /><Br />
<table align="center" cellpadding="2" cellspacing="0" border="0">
<tr>
<td colspan="2">
Enter Quote Content:<br /><br />
<table cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse;"><tr><td>
<textarea class="textbox" id="des" style="height: 250px;width: 500px;" rows="3" cols="35" name="des"><%= fldQ %></textarea>
</td></tr></table>
</td>
</tr><tr>
<td><input type="Checkbox" name="active"<%If ACT = "1" Then%> checked<%End If%> value="1" /> Active Quote</td>
<td align="right"><input type="Submit" value="Save Quote" /></td>
</tr></table>
<Br /><Br />
</td>
</tr></table>
<input type="Hidden" name="mode" value="edit" />
</form>
<!--
DEVELOPED BY EXPINION.NET, RELEASED UNDER GPL
NOT FOR SALE
http://www.expinion.net/
-->
<!--#include file="inc_footer.asp"-->