Example #1
0
 public function handle()
 {
     $vl = knl_view_Loader::getInstance();
     $menu = knl_lib_perm_Menu::getInstance()->montaMenu();
     $vl->setVar("menu", $menu);
     $vl->display("index");
 }
Example #2
0
 public function monta_Add($view, $nomespace, array $arrValues)
 {
     $nome = str_replace(" ", "", $nomespace);
     $vl = knl_view_Loader::getInstance();
     $id_ini = 1;
     $delHtml = "<a onclick=\"del_div{$nome}(***);\">Del</a>";
     $this->FormEditHtml[$nome] = "<div id=\"div_add{$nome}\">";
     foreach ($arrValues as $v) {
         $vl->setVar("recursos", $v);
         $delHtmlDiv = str_replace("***", "'{$id_ini}'", $delHtml);
         $this->FormEditHtml[$nome] .= "<div id=\"div_add{$nome}{$id_ini}\">" . $vl->display($view, false, true) . $delHtmlDiv . "</div>\n\n";
         $id_ini++;
     }
     $vl->setVar("recursos", "x");
     $delHtmlDiv = str_replace("***", "'{$id_ini}'", $delHtml);
     $this->FormEditHtml[$nome] .= "<div id=\"div_add{$nome}{$id_ini}\">" . $vl->display($view, false, true) . $delHtmlDiv . "</div>\n\n";
     $id_ini++;
     $html = $vl->display($view, false, true);
     $html = str_replace("\"", "\\\"", $html);
     $stringlimpa = $html;
     $stringlimpa = str_replace("\n", " ", $stringlimpa);
     $stringlimpa = str_replace("\v", " ", $stringlimpa);
     $stringlimpa = str_replace("\f", " ", $stringlimpa);
     $stringlimpa = str_replace("\r", " ", $stringlimpa);
     $stringlimpa = str_replace("", " ", $stringlimpa);
     $html = $stringlimpa;
     $del = str_replace("\"", "\\\"", $delHtml);
     $del = str_replace("***", "\"+id{$nome} +\"", $del);
     $this->FormEditJs .= "\n<script>\nvar id{$nome} = {$id_ini};\n\nfunction del_div{$nome} (id) {\n    filho = document.getElementById('div_add{$nome}' + id);\n\tdocument.getElementById('div_add{$nome}').removeChild(filho);\n}\n\nfunction add_div{$nome} () {\n\tvar html = \"{$html}\";\n    var del = \"{$del}\";\n    var div_add = document.createElement('div');\n    div_add.setAttribute('id','div_add{$nome}' + id{$nome});\n\tdocument.getElementById('div_add{$nome}').appendChild(div_add);\n\tdocument.getElementById('div_add{$nome}' + id{$nome}).innerHTML = html + del ;\n\treturn id{$nome}++;\n}\n</script>";
     $this->FormEditHtml[$nome] .= "</div>\n\n";
     $this->FormEditBtn[$nome] = "<input type=\"button\" onclick=\"add_div{$nome}();\" value=\"{$nomespace}\">\n\n";
 }
Example #3
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #4
0
 public function monta_DocTipoDiv($tipos)
 {
     $vl = knl_view_Loader::getInstance();
     $this->DocTipoDiv = "";
     foreach ($tipos as $v) {
         $this->DocTipoDiv .= $vl->display($v->get_classe() . "/formfind", false, true);
     }
 }
Example #5
0
 public function monta_Desanexar($actions, $id, $anexoTop)
 {
     if (key_exists("desanexar", $actions)) {
         $vl = knl_view_Loader::getInstance();
         $vl->setVar("anexoTop", $anexoTop);
         $vl->setVar("id", $id);
         $this->BtnDesanexar = $vl->display('show/BtnDesanexar', false);
     }
 }
Example #6
0
 public function FornFindChar()
 {
     $request = knl_lib_Registry::getRequestObj();
     $str_parte = $request->getGet('nome');
     $cotacao_cli = knl_extensions_cadastronf_cotDao::getInstance()->selectByParteNome($str_parte);
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("cotacao_cli", $cotacao_cli);
     $vl->display("cadastronf/CotVwAjx", true, true);
 }
Example #7
0
 public function monta_PendBtn($pendencias)
 {
     $vl = knl_view_Loader::getInstance();
     $PendTipo = knl_dao_doc_pendencia_tipo::getInstance();
     $this->PendBtnHtml = "";
     foreach ($pendencias as $p) {
         $mPendTipo = $PendTipo->selectById($p->get_id_doc_pendencia_tipo());
         $this->PendBtnHtml .= $vl->display("pendlist/Btn" . $mPendTipo->get_descricao(), false);
     }
 }
Example #8
0
 public function monta_DesanexaBtn($arrayFull)
 {
     $this->DesanexaBtn = "X";
     if (key_exists("desanexar", $arrayFull['docActions'])) {
         $vl = knl_view_Loader::getInstance();
         $vl->setVar("anexoTop", $arrayFull['anexoTop']);
         $vl->setVar("id", $arrayFull['doc']->get_id());
         $this->DesanexaBtn = "<center>" . $vl->display('show/BtnDesanexar', false) . "</center>";
     }
 }
Example #9
0
 public function mostraEmpresas()
 {
     $session = knl_lib_Registry::getSession();
     $Empresas = knl_dao_empresa::getInstance();
     $lista = $Empresas->selectAll();
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("lista", $lista);
     $vl->setVar("empresa_ativa", $Empresas->selectById($session->get_id_empresa()));
     $vl->display("EmpresaList");
 }
Example #10
0
 public function lstdepto()
 {
     $request = knl_lib_Registry::getRequestObj()->getInstance();
     $usuario = knl_dao_knl_usuario::getInstance()->selectById($request->GetGet("id_usu"));
     $Deptos = knl_dao_knl_depto::getInstance();
     $arrayDpto = $Deptos->selectAll();
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("deptos", $arrayDpto);
     $vl->setVar("usuario", $usuario);
     $vl->display("UserDepto");
 }
Example #11
0
 public function formadd()
 {
     $dDocTp = knl_dao_doc_tipo::getInstance();
     $lstDocTp = $dDocTp->selectAll();
     $dGrupo = knl_dao_knl_grupo::getInstance();
     $lstGrupo = $dGrupo->selectAll();
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("doctipo", $lstDocTp);
     $vl->setVar("grupos", $lstGrupo);
     $vl->display("DocTipoCredForm");
 }
Example #12
0
 public function formadd()
 {
     $dPendTipo = knl_dao_doc_pendencia_tipo::getInstance();
     $array_PendTp = $dPendTipo->selectAll();
     $array_DocSubTp = knl_dao_doc_sub_tipo::getInstance()->selectAll();
     $array_grupos = knl_dao_knl_grupo::getInstance()->selectAll();
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("pendtipo", $array_PendTp);
     $vl->setVar("docsubtipo", $array_DocSubTp);
     $vl->setVar("grupos", $array_grupos);
     $vl->display("RegraPendForm");
 }
Example #13
0
    public function monta_FormsSpec($tipos)
    {
        $vl = knl_view_Loader::getInstance();
        $js_show = "";
        foreach ($tipos as $v) {
            $this->FormSpec .= "";
            $js_show .= "\t\tcase '" . $v->get_id() . "':\n";
            $js_show .= '			$("#' . $v->get_classe() . '").clone().appendTo("#formpp");';
            $js_show .= "\t\tbreak;\n";
        }
        $this->FormsSpec .= '
<script>
function mostraFormpp(formppName){
	$("#formpp > div").remove();
	switch(formppName){
' . $js_show . '
	}
}
</script>
';
    }
Example #14
0
 public function monta_Cabecalho($cabecalho)
 {
     $vl = knl_view_Loader::getInstance();
     $this->Cabecalho .= $vl->display("newanexo/" . $cabecalho[0]->get_classe(), false);
 }
Example #15
0
 public function MailSend()
 {
     $request = knl_lib_Registry::getRequestObj();
     $DocShow = knl_lib_doc_DocShow::getInstance();
     $doc = $DocShow->getDocumento($request->getPost('doc_id'));
     $cabecalho = $DocShow->getDocumentoFull($doc);
     knl_lib_doc_DocMail::getInstance()->enviaMail($doc, $request->getPost("destinatario"), $request->getPost("corpo"));
     $vl = knl_view_Loader::getInstance();
     $vl->setVar("doc", $doc);
     $vl->setVar("cabecalho", $cabecalho);
     $vl->display("MailSend");
 }
Example #16
0
 public function monta_Cabecalho($cabecalho)
 {
     $vl = knl_view_Loader::getInstance();
     $this->Cabecalho = $vl->display("" . $cabecalho['docTipo']->get_classe() . "/cabshow", false, true);
 }
Example #17
0
 public function formLogin()
 {
     $vh = knl_view_Loader::getInstance();
     $vh->display("formlogin");
 }
Example #18
0
 public function monta_FormSpec($cabecalho)
 {
     $vl = knl_view_Loader::getInstance();
     $this->FormSpec .= $vl->display($cabecalho['docTipo']->get_classe() . "/formedit", false, true);
 }
Example #19
0
 public function ExtNewForm()
 {
     $vl = knl_view_Loader::getInstance();
     $vl->display("ExtensionNewForm");
 }
Example #20
0
<?php

$helperFormEdit = knl_view_w3c_hlp_FormEdit::getInstance();
$pedvenda = $knl_helper->getVar('cabecalho');
$fornecedor = $pedvenda['dpedvendaFull']['forn'];
$knl_helper->setVar("head", "<script type=\"text/javascript\" src=\"./extensions/cadastronf/cadcnpj.js\"></script>\n");
$helperFormEdit->monta_Add('dpedvenda/formAddDataEntrega', 'Add', $pedvenda['dpedvendaFull']['dataentrega']);
?>
<td valign="top" align="right">Data entrega:<br><?php 
echo $helperFormEdit->html_btn_Add('Add');
?>
</td><td valign="top"><?php 
echo $helperFormEdit->html_Add('Add');
?>
</td>
<?php 
$vl = knl_view_Loader::getInstance();
$vl->setVar('fornecedor', $fornecedor);
$vl->setVar('cnpj', $fornecedor->get_cnpj());
echo $vl->display('cadastronf/cadeditcnpjform', false, true);
echo $vl->display("cadastronf/cadeditform", false, true);
Example #21
0
 public function formadd()
 {
     $vl = knl_view_Loader::getInstance();
     //$vl->setVar("deptos",$lstDpto);
     $vl->display("DeptoForm");
 }