CSCCHART.jsp 3.58 KB
Newer Older
Thitichaipun Wutthisak committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
๏ปฟ<%@page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.csc.library.orgchart.JQuiryGenDataForChart" %>
<%@ page import="com.csc.library.utilities.UProfile" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ include file="../CHECKPROFILE.jsp" %>
<%
		JQuiryGenDataForChart m= new JQuiryGenDataForChart(uprofile);
		m.setTablelist("memployee");
		m.setLevel(4);
		m.setReportTo("employeeid", "bossid");
		m.setShowField("picture,employeeid,fullname");
		m.setDBXML("MEMPLOYEEHELP");
    	String orgChartData = m.genChartData();

%>
<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset='utf-8">
    <title>CSC Org chart.</title>
    <link rel="stylesheet" href="../CSS/orgchart/bootstrap.min.css"/>
    <link rel="stylesheet" href="../CSS/orgchart/jquery.jOrgChart.css"/>
    <link rel="stylesheet" href="../CSS/orgchart/custom.css"/>
    <link href="../CSS/orgchart/prettify.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="../JS/orgchart/prettify.js"></script>

    <!-- jQuery includes -->
    <!--script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script-->

    <script type="text/javascript" src="../JS/orgchart/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../JS/orgchart/jquery-ui-1.8.21.custom.min.js"></script>
    <script src="../JS/orgchart/jquery.jOrgChart.js"></script>
    <script>
    jQuery(document).ready(function() {
        $("#org").jOrgChart({
            chartElement : '#chart',
            dragAndDrop  : true
        });
    });
    </script>
    </head>

    <body onLoad="prettyPrint();">
<div class="topbar">
      <div class="topbar-inner">
    <div class="container"> <a class="brand" href="#">CSC Organisation Chart</a> 
          <!--ul class="nav">
                    <li><a href="http://github.com/wesnolte">Github</a></li>
                    <li><a href="http://twitter.com/wesnolte">Twitter</a></li>                  
                    <li><a href="http://th3silverlining.com">Blog</a></li>      
                </ul--> 
          <!--div class="pull-right">
                    <div class="alert-message info" id="show-list">Show underlying list.</div>
                    
<pre class="prettyprint lang-html" id="list-html" style="display:none"></pre>       
                </div--> 
        </div>
  </div>
    </div>
<%=orgChartData%>
<div id="chart" class="orgChart"></div>
<script>
        jQuery(document).ready(function() {
            
            /* Custom jQuery for the example */
            $("#show-list").click(function(e){
                e.preventDefault();
                
                $('#list-html').toggle('fast', function(){
                    if($(this).is(':visible')){
                        $('#show-list').text('Hide underlying list.');
                        $(".topbar").fadeTo('fast',0.9);
                    }else{
                        $('#show-list').text('Show underlying list.');
                        $(".topbar").fadeTo('fast',1);                  
                    }
                });
            });
            
            $('#list-html').text($('#org').html());
            
            $("#org").bind("DOMSubtreeModified", function() {
                $('#list-html').text('');
                
                $('#list-html').text($('#org').html());
                
                prettyPrint();                
            });
        });
    </script>
</body>
</html>