<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER_IDEA"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<%@ page import = "zr.zrpower.ejb.sys.UserIdeaService" %>


<!--WEB组件引用-->
<link rel="stylesheet" type="text/css" media="all" href="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-blue.css" >
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/gt_grid.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/vista/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/pink/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/mac/skinstyle.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_msg_en.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_const.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_grid_all.js"></script>
<!--WEB组件引用结束-->

<LINK type="text/css" rel="stylesheet" href="../../html5/css/style_tables.css">
<SCRIPT LANGUAGE="JavaScript" src="../../html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../html5/layer/layer.js"></SCRIPT>


<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();

BPIP_USER_IDEA[] ideas = null;
UserIdeaService ideaService =new UserIdeaService();
int intPageSize = user.getUserPageSize();
%>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<link REL="stylesheet" type="text/css" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<!--WEB组件样式和js-->

<!--WEB组件样式和js结束-->
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>

 <%
  //得到查询的记录集
  ideas = ideaService.GetIdeaList1(user.getUserID());
 String strshow_data="";
     if (ideas!=null && ideas.length>0){

        strshow_data = strshow_data + "[";
        for(int i=0;i<ideas.length;i++){

            strshow_data = strshow_data + "[";

            strshow_data = strshow_data + "\""+ideas[i].getID()+"\",";

               if (i <ideas.length-1 )
         {
            strshow_data = strshow_data + "\""+ideas[i].getCONTENT()+"\"],\r\n";
         }else
         {
            strshow_data = strshow_data + "\""+ideas[i].getCONTENT()+"\"]";
         }

        }

        strshow_data = strshow_data + "]";
    }else
    {
        strshow_data = "null";
    }
  %>
  </HEAD>
  <script type="text/javascript" >
var css = "<%=user.getUserCSS()%>";
var skincss = "vista";

if (css=="Blue.css")
{skincss = "vista";}
if (css=="Public.css")
{skincss = "default";}
if (css=="Window.css" || css=="nBlue.css")
{skincss = "mac";}
if (css=="Yellow.css")
{skincss = "pink";}


var grid_demo_id = "myGrid1" ;
var show_data= <%=strshow_data%>;

var dsOption= {

	fields :[
		{name : 'ID'  },
		{name : 'CONTENT'  }
	],

	recordType : 'array',
	data : show_data
}



var colsOption = [
           {id: 'ID' , header: "<center>意见编号</center>" , width :100 , align : 'left'  },
           {id: 'CONTENT' , header: "<center>意见内容</center>" , width :200,  align : 'left' }
                ];


var gridOption={
	id : grid_demo_id,
	width: "99%",
	height: "92%",
	container : 'gridbox',
	replaceContainer : true,
	dataset : dsOption ,
	columns : colsOption,
	pageSize : 2000,
	toolbarContent : null,
        skin : skincss,

        onCellDblClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
           edit();
        },

       showIndexColumn : true
};

<%if(!user.getUserWINDOWTYPE().equals("6")){%>
var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad( Sigma.Grid.render(mygrid));
<%}%>

</script>
  <BODY class="BodyMain">
  <form name="recordfrm" action="List.jsp">

<%if(user.getUserWINDOWTYPE().equals("6")){ %>


<TABLE height='31' cellSpacing='0' cellPadding='0' border='0'>
 <TR>
     <%=userUI.ClickButton("增加意见","JavaScript:add();","IcoAdd.gif",user.getUserImage())%>
     <%=userUI.ClickButton("编辑意见","JavaScript:edit();","IcoEdit.gif",user.getUserImage())%>
  </tr></table>



  <div id="mianRole" style="height: 90%;overflow: auto;">
  <table class="bordered" id="html5_table">

<thead>
<tr>
<th style="width:30%;">意见编号</th>
<th style="width:70%;">意见内容</th>

</tr>
</thead>

<%
  if (ideas!=null && ideas.length>0){
        String scode="";
        String sname="";
        for(int i=0;i<ideas.length;i++){

          scode=ideas[i].getID();
          sname=ideas[i].getCONTENT();

%>
        <tr onclick="click_color(this,'<%=scode%>');">
        <td style="text-align:center;"><%=scode%></td>
        <td style="text-align:center;"><%=sname%></td>

        </tr>

<%
        }
 }
%>

</table>
<br>
</div>

<%}else{%>
     <%=userUI.ShowHeadHtml("处理意见信息管理","IcoTitle.gif",user.getUserImage())%>
     <%=userUI.ShowTitleHtml("","","",user.getUserImage())%>
     <%=userUI.ClickButton("增加意见","JavaScript:add();","IcoAdd.gif",user.getUserImage())%>
     <%=userUI.ClickButton("编辑意见","JavaScript:edit();","IcoEdit.gif",user.getUserImage())%>

<%=userUI.ShowTitleEndHtml()%>
  <%=userUI.ShowBodyStartHtml()%>
<div id="gridbox" style="border:0px solid #cccccc;background-color:#f3f3f3;padding:5px;height:600px;width:800px;" ></div>

<%=userUI.ShowFootHtml()%>


<%}%>
</form>
</BODY>
<script language="JavaScript" type="text/JavaScript">
<!--

var allvalue="";
function clickValue(value){
    allvalue=value;
}

function add(){
    location.href="AddFrm.jsp";
}
function edit(){
  <%if(user.getUserWINDOWTYPE().equals("6")){ %>
     var strID = allvalue;

   <%}else{%>
     var allvalue = mygrid.getSelectedRecords()+",0";
     var strID = allvalue.split(",")[0];
   <%}%>

  if (strID==null||strID=="")
    {
       <%if(user.getUserWINDOWTYPE().equals("6")){ %>
         layer.alert('请先选择编辑的记录!', {icon: 7});
       <%}else{%>
         alert("请先选择编辑的记录!");
       <%}%>
    }else
    {location.href="EditFrm.jsp?SelectedItems="+strID;}
}
//-->
</script>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
ideaService = null;

%>
