<?xml version="1.0"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2018 OpenLink Software
 -
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -
-->
<v:page name="blog-home-page"
  xmlns:vm="http://www.openlinksw.com/vspx/ods/"
  xmlns:v="http://www.openlinksw.com/vspx/"
  style="index.xsl"
  doctype="-//W3C//DTD XHTML 1.0 Transitional//EN"
  doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<v:method name="do_redirect" arglist="in url varchar"><![CDATA[
  url := vspx_uri_add_parameters (url, '');
  http_request_status ('HTTP/1.1 302 Found');
  http_header ('Location: '||url||'\r\n');
]]></v:method>
  <vm:page>
    <vm:header>
      <vm:title>Report Abuse</vm:title>
    </vm:header>
    <vm:body>
      <table id="MTB" cellspacing="0" cellpadding="0" width="100%">
        <tr id="MB">
          <td colspan="2">
            <table width="100%" border="0">
              <tr>
                <td>
		  <a href="sfront.vspx" class="site_link"><img src="images/ods_banner.jpg" alt="Web Applications" border="0" /></a>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr><td>&nbsp;<br/></td></tr>
        <tr>
          <td colspan="2">
            <font style="color:green"><v:label name="success" value="''"/></font>
          </td>
        </tr>
        <tr><td>&nbsp;<br/></td></tr>
        <tr>
          <td colspan="2">
            Please tell us what you feel violates OpenLinks Terms of Service. Be as detailed and descriptive as you can. Where possible please identify specific content that is the subject of your report. Including web addresses (URLs) is also very helpful. The more you tell us about the circumstances you are reporting, the faster we will be able to investigate.
          </td>
        </tr>
        <tr><td>&nbsp;<br/></td></tr>
        <v:form name="rab" type="simple" method="POST" action="rabuse.vspx">
          <tr>
            <th width="20%"><v:label name="l1" value="'What is your E-Mail Address?'"/></th>
            <td align="left">
              <v:text error-glyph="*" xhtml_id="umail" name="umail" value="" xhtml_style="width:216" xhtml_tabindex="1">
                <v:validator test="length" min="1" max="40" message="E-mail address cannot be empty or longer then 40 chars"/>
                <v:validator test="regexp" regexp="[^@ ]+@([^\. ]+\.)+[^\. ]+" message="Invalid E-mail address" />
              </v:text>
              <div style="display:inline; color:red;"><v:error-summary match="umail" /></div>
            </td>
          </tr>
          <tr>
            <th width="20%"><v:label name="l2" value="'Type your feedback here:'"/></th>
            <td align="left">
              <v:textarea name="feed" value="" xhtml_rows="10" xhtml_cols="60" xhtml_style="width:300" xhtml_tabindex="2"/>
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td>
              <v:button value="Send" action="simple" name="bsend">
                <v:on-post>
                  <![CDATA[
                    if (not self.vc_is_valid) return;

                    declare  aRes any;
                    declare sServer, sSender, sErr varchar;

                    sSender := (select top 1 U_E_MAIL from DB.DBA.SYS_USERS where U_NAME = 'dav');
                    sErr := '';

                    aRes := XMLELEMENT('ReportAbuse', XMLELEMENT('From',self.umail.ufl_value),
                                                       XMLELEMENT('Feedback',self.feed.ufl_value));
                    declare exit handler for sqlstate '*' { self.success.ufl_value := __SQL_MESSAGE; };
                    {
		      WA_SEND_MAIL (sSender, sSender, 'Report', serialize_to_UTF8_xml(aRes));
                      self.success.ufl_value := 'Message has been sent successfully.';
                    };
                  ]]>
                </v:on-post>
              </v:button>
              <v:button value="Reset" action="simple" name="breset">
                <v:on-post>
                  <v:script>
                    <![CDATA[
                      self.do_redirect ('rabuse.vspx');
                    ]]>
                  </v:script>
                </v:on-post>
              </v:button>
            </td>
          </tr>
        </v:form>
      </table>
    </vm:body>
  </vm:page>
</v:page>
