$render=explode(" ",$_POST["partial_render"]);
if($render[0]=="organograma"){
$resposta="
<div id="organograma" class="ui-widget ui-organigram" style="".$_POST["largura"]."">
<div id="organograma_target" class="target"></div>
<ul id="organograma_source">
<li data-rowkey="root" style="border-radius: 10px;" class="droppable root">
<div class="ui-organigram-node-content">CommerceBay GmbH</div>
<ul>
<li data-rowkey="0" data-parent-rowkey="root" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Software Development</div>
<ul>
<li data-rowkey="0_0" data-parent-rowkey="0" class="draggable leaf selectable selected collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Ridvan Agar</div>
</li>
<li data-rowkey="0_1" data-parent-rowkey="0" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Team JavaEE</div>
<ul>
<li data-rowkey="0_1_0" data-parent-rowkey="0_1" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">JSF</div>
<ul>
<li data-rowkey="0_1_0_0" data-parent-rowkey="0_1_0" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Thomas Andraschko</div>
</li>
</ul>
</li>
<li data-rowkey="0_1_1" data-parent-rowkey="0_1" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Backend</div>
<ul>
<li data-rowkey="0_1_1_0" data-parent-rowkey="0_1_1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Marie Louise</div>
</li>
</ul>
</li>
</ul>
</li>
<li data-rowkey="0_2" data-parent-rowkey="0" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Team Mobile</div>
<ul>
<li data-rowkey="0_2_0" data-parent-rowkey="0_2" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Android</div>
<ul>
<li data-rowkey="0_2_0_0" data-parent-rowkey="0_2_0" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Andy Ruby</div>
</li>
</ul>
</li>
<li data-rowkey="0_2_1" data-parent-rowkey="0_2" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">iOS</div>
<ul>
<li data-rowkey="0_2_1_0" data-parent-rowkey="0_2_1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Stevan Jobs</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li data-rowkey="1" data-parent-rowkey="root" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Managed Services</div>
<ul>
<li data-rowkey="1_0" data-parent-rowkey="1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Thorsten Schultze</div>
</li>
<li data-rowkey="1_1" data-parent-rowkey="1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Sandra Becker</div>
</li>
</ul>
</li>
<li data-rowkey="2" data-parent-rowkey="root" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Marketing</div>
<ul>
<li data-rowkey="2_0" data-parent-rowkey="2" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Social Media</div>
<ul>
<li data-rowkey="2_0_0" data-parent-rowkey="2_0" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Ali Mente</div>
</li>
<li data-rowkey="2_0_1" data-parent-rowkey="2_0" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Lisa Boehm</div>
</li>
</ul>
</li>
<li data-rowkey="2_1" data-parent-rowkey="2" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Press</div>
<ul>
<li data-rowkey="2_1_0" data-parent-rowkey="2_1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Michael Gmeiner</div>
</li>
<li data-rowkey="2_1_1" data-parent-rowkey="2_1" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Hans Peter</div>
</li>
</ul>
</li>
</ul>
</li>
<li data-rowkey="3" data-parent-rowkey="root" class="draggable droppable selectable collapsible division division" data-icon="pi pi-briefcase" data-icon-pos="left">
<div class="ui-organigram-node-content">Management</div>
<ul>
<li data-rowkey="3_0" data-parent-rowkey="3" class="draggable leaf selectable collapsible employee employee" data-icon="pi pi-user">
<div class="ui-organigram-node-content">Hassan El Manfalouty</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<script id="organograma_s" type="text/javascript">
DinarteCoelho.cw("Organigram", "organigram", {
id: "organograma"
, zoom:";if(isset($_POST["ampliar_input"])){$resposta.="true";}else{$resposta.="false";}
$resposta.=", leafNodeConnectorHeight:"".$_POST["altura"].""
, autoScrollToSelection:"; if(isset($_POST["rolagem_input"])){$resposta.="true";}else{$resposta.="false";}
$resposta.=", behaviors: {
expand: function (ext, event) {
DinarteCoelho.ab({
s: "organograma"
, e: "expand"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, select: function (ext, event) {
DinarteCoelho.ab({
s: "organograma"
, e: "select"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, collapse: function (ext, event) {
DinarteCoelho.ab({
s: "organograma"
, e: "collapse"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, dragdrop: function (ext, event) {
DinarteCoelho.ab({
s: "organograma"
, e: "dragdrop"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, contextmenu: function (ext, event) {
DinarteCoelho.ab({
s: "organograma"
, e: "contextmenu"
, f: "formulario"
, p: "organograma"
}, ext);
}
}
});
</script>
";
}
if($render[0]=="alerta"){
$no=$_POST["organograma_selectNode"];
$resposta="
<span id="alerta" class="ui-growl-pl" data-widget="widget_alerta" data-summary="data-summary" data-detail="data-detail" data-severity="all,error" data-redisplay="true"></span>
<script id="alerta_s" type="text/javascript">
DinarteCoelho.cw("Growl", "widget_alerta", {
id: "alerta",
sticky: false,
life: 6000,
escape: true,
keepAlive: false,
msgs: [{
summary: "Selecinado",
detail: "".$no."",
severity: "info",
severityText: "Information"
}]
});
</script>
";
}
dc.cw("Growl", "widget_alerta", {
id: "alerta"
, sticky: false
, life: 6000
, escape: true
, keepAlive: false
, msgs: []
});
dc.cw("Organigram", "organigram", {
id: "organograma"
, zoom: false
, leafNodeConnectorHeight: 0
, autoScrollToSelection: false
, behaviors: {
expand: function (ext, event) {
dc.ab({
s: "organograma"
, e: "expand"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, select: function (ext, event) {
dc.ab({
s: "organograma"
, e: "select"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, collapse: function (ext, event) {
dc.ab({
s: "organograma"
, e: "collapse"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, dragdrop: function (ext, event) {
dc.ab({
s: "organograma"
, e: "dragdrop"
, f: "formulario"
, p: "organograma"
, u: "alerta"
}, ext);
}
, contextmenu: function (ext, event) {
dc.ab({
s: "organograma"
, e: "contextmenu"
, f: "formulario"
, p: "organograma"
}, ext);
}
}
});
dc.cw("ContextMenu", "widget_menuFire", {
id: "menuFire"
, target: "organograma"
, targetWidgetVar: "organigram"
, nodeType: "employee"
});
dc.cw("ContextMenu", "widget_menuAdd", {
id: "menuAdd"
, target: "organograma"
, targetWidgetVar: "organigram"
, nodeType: "division"
});
dc.cw("InputText", "widget_funcionario", {
id: "funcionario"
});
dc.cw("CommandButton", "widget_BtnAdicionar", {
id: "BtnAdicionar"
});
dc.cw("Dialog", "addEmployeeDialog", {
id: "addEmployeeDialog"
});
dc.cw("SelectBooleanCheckbox", "widget_ampliar", {
id: "ampliar"
});
dc.cw("SelectBooleanCheckbox", "widget_rolagem", {
id: "rolagem"
});
dc.cw("InputText", "widget_altura", {
id: "altura"
});
dc.cw("InputText", "widget_largura", {
id: "largura"
});
dc.cw("CommandButton", "widget_BtnRolagem", {
id: "BtnRolagem"
});
dc.cw("CommandButton", "widget_BtnAtualizar", {
id: "BtnAtualizar"
});
dc.cw("Panel", "widget_painel", {
id: "painel"
});