/*
 * Generated by the Jasper component of Apache Tomcat
 * Version: ......
 * Generated at: 2020-04-13 00:06:01 UTC
 * Note: The last modified time of this file was set to
 *       the last modified time of the source file after
 *       generation to assist with modification tracking.
 */
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.net.*;
import wiseoa.*;
import wiseoa.mail.jstl.*;
import wiseoa.formdesign.jstl.*;
import wiseoa.util.*;

public final class workbook_005fconfig_005fautocomplete_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final javax.servlet.jsp.JspFactory _jspxFactory =
          javax.servlet.jsp.JspFactory.getDefaultFactory();

  private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;

  static {
    _jspx_dependants = new java.util.HashMap<java.lang.String,java.lang.Long>(1);
    _jspx_dependants.put("/WEB-INF/c.tld", Long.valueOf(1099983217476L));
  }

  private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fc_005fif_0026_005ftest;

  private volatile javax.el.ExpressionFactory _el_expressionfactory;
  private volatile org.apache.tomcat.InstanceManager _jsp_instancemanager;

  public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
    return _jspx_dependants;
  }

  public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
    if (_el_expressionfactory == null) {
      synchronized (this) {
        if (_el_expressionfactory == null) {
          _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
        }
      }
    }
    return _el_expressionfactory;
  }

  public org.apache.tomcat.InstanceManager _jsp_getInstanceManager() {
    if (_jsp_instancemanager == null) {
      synchronized (this) {
        if (_jsp_instancemanager == null) {
          _jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
        }
      }
    }
    return _jsp_instancemanager;
  }

  public void _jspInit() {
    _005fjspx_005ftagPool_005fc_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
  }

  public void _jspDestroy() {
    _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.release();
  }

  public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
        throws java.io.IOException, javax.servlet.ServletException {

    final javax.servlet.jsp.PageContext pageContext;
    javax.servlet.http.HttpSession session = null;
    final javax.servlet.ServletContext application;
    final javax.servlet.ServletConfig config;
    javax.servlet.jsp.JspWriter out = null;
    final java.lang.Object page = this;
    javax.servlet.jsp.JspWriter _jspx_out = null;
    javax.servlet.jsp.PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\r\n");

		request.setCharacterEncoding("UTF-8");
    	FF.setResponseContentType(response);
		 
        WorkBookRightVerify w= new WorkBookRightVerify( request);
        FF.pageContextSetAttribute(pageContext , "canEdit", w.canEdit);
        
        User user= User.getUserFromRequest(request);
        if(user.getRole()!=1) 
        {
         
        	int id= FF.GetIntFromRequest(request,"id",0); 
        	int reportid=   FF.GetIntFromSQL("", "select * from  oa_report where template_id="+id) ;
        	if( reportid>0)
        	{
        		String url="system_report.jsp?id="+reportid; 
        		int operationid=wiseoa.flow.applet.RBAC_Operation.$formDesign;
        		if( wiseoa.WiseFilter.urlOnCommision(user, url, operationid)) //注意是反的
        		{
        			response.sendRedirect(  "SystemTip.jsp?info=" + URLEncoder.encode("抱歉，您无此权限", "UTF-8"));
        			return ;
        		}
        		
        	}
        }

        FF.pageContextSetAttribute(pageContext , "templatetype", w.type);
     
        FF.pageContextSetAttribute(pageContext , "templateid", w.id);
          
		AutoCompleteInfo si = new AutoCompleteInfo(request , w.type, w.id);
	 
		

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<HTML>\r\n");
      out.write("\t<head><meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\r\n");
      out.write("\r\n");
      out.write("\t\t<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n");
      out.write("\t\t<TITLE></TITLE>\r\n");
      out.write("\r\n");
      out.write("\t\t<META http-equiv=\"pragma\" content=\"no-cache\">\r\n");
      out.write("\t\t<META http-equiv=\"cache-control\" content=\"no-cache\">\r\n");
      out.write("\t\t<META http-equiv=\"expires\" content=\"0\">\r\n");
      out.write("\r\n");
      out.write("\t\t<LINK rel=\"stylesheet\" type=\"text/css\" href=\"css/normal.css\">\r\n");
      out.write(" \r\n");
      out.write("\r\n");
      out.write("\t\t<STYLE>\r\n");
      out.write("   \r\n");
      out.write(" \r\n");
      out.write("\t\tbody {\tmargin-left: 2px;\tmargin-top: 2px;\tmargin-right: 2px; text-align:left}\r\n");
      out.write(" \r\n");
      out.write("     \r\n");
      out.write("\t  .selectspan  { border:1px solid #a0a0a0;overflow:hidden;width:185;}\r\n");
      out.write("\t  .flatselect { width:187; margin:-2;}\r\n");
      out.write("\t    \r\n");
      out.write("\t  \r\n");
      out.write("\t  \r\n");
      out.write("        </STYLE>\r\n");
      out.write("\t\t<LINK rel=\"stylesheet\" type=\"text/css\" href=\"zbutton/zbutton.css\">\r\n");
      out.write("\t\t<SCRIPT type=\"text/javascript\" src=\"zbutton/zbutton.js\"></SCRIPT>\r\n");
      out.write("\r\n");
      out.write("\t\t<SCRIPT type=\"text/javascript\" src=\"js/jsrsClient_rev.js\"></SCRIPT>\r\n");
      out.write("\t\t<SCRIPT type=\"text/javascript\" src=\"js/util.js\"></SCRIPT>\r\n");
      out.write("\t\t<SCRIPT type=\"text/javascript\" src=\"js/prototype14.js\"></SCRIPT>\r\n");
      out.write(" \r\n");
      out.write("\t\t\r\n");
      out.write("\r\n");
      out.write("\t\t<SCRIPT language=\"javascript\">\r\n");
      out.write("\r\n");
      out.write(" \r\n");
      out.write("\t function Save()\r\n");
      out.write("\t {\r\n");
      out.write("\t \tjsrsExecute2(\"servlet/wiseoa.formdesign.rpc.AutoCompleteManage\", callback, \"Save\", \"sqldefine\",false);\r\n");
      out.write("\t }\r\n");
      out.write("\t   \r\n");
      out.write("\t      \r\n");
      out.write("\tfunction  callback(msg)\r\n");
      out.write("\t{\r\n");
      out.write("\t\tif (extractValue(msg ,\"ok\")==\"true\") \r\n");
      out.write("\t\t{\r\n");
      out.write("\t \t\t \r\n");
      out.write("\t\t\t//parent.callback_autocomplate(msg);\r\n");
      out.write("\t\t\talert('保存成功');\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t}else\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t   alert ( extractValue(msg, \"error\"));\r\n");
      out.write("\t\t}\r\n");
      out.write("\t}\r\n");
      out.write("\t\t\r\n");
      out.write("\t \r\n");
      out.write("  \r\n");
      out.write(" \r\n");
      out.write("\t\r\n");
      out.write("\t</SCRIPT>\r\n");
      out.write("\r\n");
      out.write("\t    <style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write(".style2 {color: #666666}\r\n");
      out.write(".style3 {color: #000000}\r\n");
      out.write("-->\r\n");
      out.write("        </style>\r\n");
      out.write("\t</HEAD>\r\n");
      out.write("\r\n");
      out.write("\t<BODY  style=\"margin:0px;\">\r\n");
      out.write("\t\r\n");
      out.write("\t \r\n");
      out.write("\t\t\r\n");
      out.write("        <table width=\"100%\"  border=\"0\" align=\"center\" cellpadding=\"1\" cellspacing=\"0\">\r\n");
      out.write("        <form name=\"sqldefine\" method=\"post\" action=\"\">\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td>说明</td>\r\n");
      out.write("            <td colspan=\"2\"><input type=\"text\" name=\"bz\" id=\"bz\" class=\"textbox\"  value=\"");
      out.print(si.bz);
      out.write("\"></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td width=\"9%\">当工作本</td>\r\n");
      out.write("            <td colspan=\"2\" id=worksheetcontainer>\r\n");
      out.write("\t\t\t");
      out.print(si.workSheetHTML);
      out.write("\r\n");
      out.write("             <script>$('worksheet').value='");
      out.print(si.worksheet);
      out.write("';</script>   \r\n");
      out.write("         </td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td nowrap>中的单元格</td>\r\n");
      out.write("            <td colspan=\"2\"><input type=\"text\" name=\"cellalias\" id=\"cellalias\" class=\"textbox\"  value=\"");
      out.print(si.cellalias);
      out.write("\"></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td>改变时，从指定数据库</td>\r\n");
      out.write("            <td colspan=\"2\">");
      out.print(si.dsnHTML);
      out.write("</td>\r\n");
      out.write("            <script>$('dsn').value='");
      out.print(si.dsn);
      out.write("';</script> \r\n");
      out.write("          </tr>\r\n");
      out.write("         \r\n");
      out.write("          <tr>\r\n");
      out.write("            <td valign=\"top\" title=\"用字符串表达式的结果来定义的一个SQL语句\">按SQL取数</td>\r\n");
      out.write("            <td colspan=\"2\">[<span class=\"asbutton\" onClick=\"parent.function_help();\"><img src=\"image/function.gif\" width=\"16\" height=\"16\" align=\"absmiddle\"  >函数帮助</span>][<span class=\"asbutton\" onClick=\"capture_cellname();\" title=\"定位到需要的工作本上的单元格上，点击这里，将单元格的名称复制到下面的定义框中\"\t>单元格选取</span>]<br>\r\n");
      out.write("            [<span class=\"asbutton\" onClick=\"errorTip();\" title=\"\"\t><img src=\"image/ling.gif\" width=\"16\" height=\"16\" align=\"absmiddle\">常见错误</span>]<span class=\"style2\"><span class=\"style3\">[</span><span class='asbutton' onClick=\"sqlExample();\">示例</span><span class=\"style3\">]</span></span> </td>\r\n");
      out.write("\t\t\t<script language=\"javascript\">\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\tfunction errorTip()\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t\t\tvar s=\"如下问题可能导致定义不合法：\\n\"+\r\n");
      out.write("\t\t\t\t       \"1 在不合适的位置出现中文空格\\n\"+\r\n");
      out.write("\t\t\t\t\t   \"2 不正确地使用引号：sql语句中通常使用单引号\\n\"+\r\n");
      out.write("\t\t\t\t\t   \"3 错把表单或脚本中的函数当作数据库中的函数。\\n如\\\"select * from table1 where id= cint (a3)\\\" 是错误的，\\n正确的应该是\\\"select * from table1 where id= \\\"+cstr(cint (a3)) \";\r\n");
      out.write("\t\t\t     alert(s);\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\t\r\n");
      out.write("\t\t\tfunction capture_cellname()\r\n");
      out.write("\t\t\t{\r\n");
      out.write("\t\t\t\tvar applet=parent.getApplet();\r\n");
      out.write("\t\t\t\tvar sheet = applet.book.getActiveSheet();\r\n");
      out.write("\t\t\t\tvar range= sheet.getSelection();\r\n");
      out.write("\t\t\t\tvar cell=sheet.Cells(range.getStartRow(), range.getStartCol());\r\n");
      out.write("\t\t\t\tvar sheetGuid= sheet.getGUID();\r\n");
      out.write("\t\t\t\tvar cellName=cell.getName();\r\n");
      out.write("\t\t\t\tvar cellAlias= cell.getAlias();\r\n");
      out.write("\t\t\t\tvar s=\"\";\r\n");
      out.write("\t\t\t\tif ( sheetGuid!=$('worksheet').value) s= sheet.getName()+\"!\";\r\n");
      out.write("\t\t\t\tif ( cellAlias==\"\") cellAlias=cellName;\r\n");
      out.write("\t\t\t\ts= cellAlias;\r\n");
      out.write("\t\t\t\tclipboardData.setData('Text',s);\r\n");
      out.write("\t\t\t\t \r\n");
      out.write("\t\t\t\talert('选取的单元格名为：'+s+\"\\n\\n请将光标置于合适的位置，然后按 Ctrl + V 进行粘贴。\"); \r\n");
      out.write("\t\t\t\t \r\n");
      out.write("\t\t\t\t\r\n");
      out.write("\t\t\t}\r\n");
      out.write("\t\t\t</script>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td colspan=\"3\" valign=\"top\"><textarea name=\"sql\" rows=\"8\" class=\"textbox\" id=\"sql\" title=\"用字符串表达式的结果来定义的一个SQL语句\">");
      out.print(si.sql);
      out.write("</textarea></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td nowrap>数据字段</td>\r\n");
      out.write("            <td colspan=\"2\"><input type=\"text\" name=\"datacol\" id=\"datacol\" class=\"textbox\"  value=\"");
      out.print(si.datacol);
      out.write("\"></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td>显示字段</td>\r\n");
      out.write("            <td colspan=\"2\"><input type=\"text\" name=\"showcol\" id=\"showcol\" class=\"textbox\"  value=\"");
      out.print(si.showcol);
      out.write("\"></td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          <tr>\r\n");
      out.write("            <td>\r\n");
      out.write("            <input type=\"hidden\" id=\"ttype\" name=\"ttype\" value=\"");
      out.print(si.ttype);
      out.write("\">\r\n");
      out.write("            <input type=\"hidden\" id=\"template\" name=\"template\" value=\"");
      out.print(si.templateid);
      out.write("\">\r\n");
      out.write("              <input type=\"hidden\" id=\"id\" name=\"id\" value=\"");
      out.print(si.id);
      out.write("\">\r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("            <td width=\"40%\" align=\"left\">\r\n");
      out.write("\t\t\t<span class=\"color_red\">[</span><span style=\"cursor:hand;color:blue\" onClick=\"closeAutoComplete();\"><img src='image/backto16.gif' align=\"absmiddle\">返回</span><span class=\"color_red\">]</span>\t\t\t</td>\r\n");
      out.write("            <td width=\"51%\" align=\"right\"> \r\n");
      out.write("\t\t\t<SCRIPT language=\"javascript\">\r\n");
      out.write("\t\t\t\t\t\tfunction closeAutoComplete()\r\n");
      out.write("\t\t\t\t\t\t{\r\n");
      out.write("\t\t\t\t\t\t   parent.closeAutoComplete(); \r\n");
      out.write("\t\t\t\t\t    }\r\n");
      out.write("\t\t\t\t\t\t\r\n");
      out.write("\t\t \t\t\t\tfunction cb_save_onclick()\r\n");
      out.write("\t\t\t\t\t\t{\r\n");
      out.write("\t\t\t\t\t\t   Save();\r\n");
      out.write("\t\t\t\t\t    }\r\n");
      out.write("\t\t\t\t\t");
      if (_jspx_meth_c_005fif_005f0(_jspx_page_context))
        return;
      out.write("\r\n");
      out.write("        \t</SCRIPT> \r\n");
      out.write("\t\t\t</td>\r\n");
      out.write("          </tr>\r\n");
      out.write("          \t</form>\r\n");
      out.write("        </table>\r\n");
      out.write("\r\n");
      out.write("        \r\n");
      out.write("\t\t<script>\r\n");
      out.write("\t\t");
      if (_jspx_meth_c_005fif_005f1(_jspx_page_context))
        return;
      out.write("\r\n");
      out.write("\t\t \r\n");
      out.write("\t\t\r\n");
      out.write("\t\tfunction sqlExample()\r\n");
      out.write("\t\t{\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\tvar s='\" select QY_ID from DJ_SWDJZB where SWBMBM=\"+currentUnitProperty(\"税务编码\")+\" AND QY_ID LIKE \\'%\"+qyid+\"\\'\"';\r\n");
      out.write("\t\t\tclipboardData.setData('Text',s);\r\n");
      out.write("\t\t\r\n");
      out.write("\t\t\talert( '    用一个字符串表达式的结果描述的SQL语句，在这个表达式中可以使用工作本中的函数或单元格的值。示例：'+s+\r\n");
      out.write("\t\t\t           '\\n\\n    注意：这里的内容是一个表达式，表达式的结果是一个字符串，这个字符串符合select语法。'+\r\n");
      out.write("\t\t\t           '\\n\\n    示例已经复制到剪贴板上，按Ctrl+V可以粘贴示例!!!');\r\n");
      out.write("\t\t}\r\n");
      out.write("\t\t</script>\r\n");
      out.write("\t</BODY>\r\n");
      out.write("</HTML>\r\n");
    } catch (java.lang.Throwable t) {
      if (!(t instanceof javax.servlet.jsp.SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try {
            if (response.isCommitted()) {
              out.flush();
            } else {
              out.clearBuffer();
            }
          } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else throw new ServletException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }

  private boolean _jspx_meth_c_005fif_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:if
    org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_005fif_005f0 = (org.apache.taglibs.standard.tag.el.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.el.core.IfTag.class);
    _jspx_th_c_005fif_005f0.setPageContext(_jspx_page_context);
    _jspx_th_c_005fif_005f0.setParent(null);
    // /workbook_config_autocomplete.jsp(212,5) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fif_005f0.setTest("${param.action!='view'}");
    int _jspx_eval_c_005fif_005f0 = _jspx_th_c_005fif_005f0.doStartTag();
    if (_jspx_eval_c_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
      do {
        out.write("\r\n");
        out.write("\t\t\t\t\t var cb =new zbutton('cb_save','提交','image/disk.gif');\r\n");
        out.write("\t\t\t\t\t ");
        int evalDoAfterBody = _jspx_th_c_005fif_005f0.doAfterBody();
        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
          break;
      } while (true);
    }
    if (_jspx_th_c_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f0);
    return false;
  }

  private boolean _jspx_meth_c_005fif_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  c:if
    org.apache.taglibs.standard.tag.el.core.IfTag _jspx_th_c_005fif_005f1 = (org.apache.taglibs.standard.tag.el.core.IfTag) _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.get(org.apache.taglibs.standard.tag.el.core.IfTag.class);
    _jspx_th_c_005fif_005f1.setPageContext(_jspx_page_context);
    _jspx_th_c_005fif_005f1.setParent(null);
    // /workbook_config_autocomplete.jsp(223,2) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_c_005fif_005f1.setTest("${param.action=='view'}");
    int _jspx_eval_c_005fif_005f1 = _jspx_th_c_005fif_005f1.doStartTag();
    if (_jspx_eval_c_005fif_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
      do {
        out.write("\r\n");
        out.write("\t\t \r\n");
        out.write("\t\t\tDisableAllEditableTag();\r\n");
        out.write("\t\t");
        int evalDoAfterBody = _jspx_th_c_005fif_005f1.doAfterBody();
        if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
          break;
      } while (true);
    }
    if (_jspx_th_c_005fif_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
      return true;
    }
    _005fjspx_005ftagPool_005fc_005fif_0026_005ftest.reuse(_jspx_th_c_005fif_005f1);
    return false;
  }
}
