public function testParse() { $file = __DIR__ . '/_files/jsPhrasesForTest.js'; $this->jsPhraseCollector->parse($file); $expectation = [['phrase' => 'text double quote', 'file' => $file, 'line' => 1, 'quote' => '"'], ['phrase' => 'text single quote', 'file' => $file, 'line' => 2, 'quote' => '\''], ['phrase' => 'text "some', 'file' => $file, 'line' => 3, 'quote' => '\'']]; $this->assertEquals($expectation, $this->jsPhraseCollector->getPhrases()); }
$o->set("int_percentual" , $hos->get("hos_percentual")); $o->set("int_valor_absoluto" , $valor_absoluto); $o->set("int_valor_contraste" , $valor_contraste); $o->set("int_ch" , $ch); $o->set("int_filme" , $filme); $o->set("int_valor_ch" , $valor_ch); $o->set("int_valor_filme" , $valor_filme); $o->set("int_valor_final" , strval(floatval($valor_absoluto) > 0 ? $valor_absoluto : floatval($valor_contraste) + (floatval($ch) * floatval($valor_ch)) + (floatval($filme) * floatval($valor_filme)))); $o->propertiesClearConfig(); if ($new_id = $o->add()){ if ($_POST[mesmo_paciente] != "1") { Js::goto(array("url" => "index.php?s=interpretacao&acao=add")); } else { unset($_POST[form]); unset($_POST[exa_id]); unset($_POST[int_opcional]); Js::goto(array("url" => "index.php?s=interpretacao&acao=add", "post_vars" => $_POST)); } } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } $tpl->assign("mesmo_paciente", $_POST["mesmo_paciente"]); $template_html = $path_tpl."formulario_add_bandalarga.tpl"; ?>
<? Util::VerificaChamada(); $o = new TextoPadrao(); $_POST["med_id"] = $_SESSION["med_id"]; foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $_POST[$campo]); $o->set($campo, $_POST[$campo]); } if ($_POST[form] == "ok"){ //$o->propertiesDump(true); if ($new_id = $o->add()){ Js::goto(array("url" => "index.php?s=texto_padrao")); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } $template_html = $path_tpl."formulario.tpl"; ?>
$sql = "SELECT * FROM hospital, medico WHERE hos_login='******' AND hos_senha = '".addslashes($senha)."' and hospital.med_id = medico.med_id"; $rs = Db::sql($sql); if (mysql_num_rows($rs) == 0){ $tpl->assign("login", "Informações Incorretas."); } else { $_SESSION = mysql_fetch_assoc($rs); $_SESSION[medico] = "0"; $_SESSION[hospital] = "1"; Js::code("document.location.href = 'index.php';"); exit(); } } else { $_SESSION = mysql_fetch_assoc($rs); $_SESSION[medico] = "1"; $_SESSION[hospital] = "0"; Js::code("document.location.href = 'index.php';"); exit(); } } else { $tpl->assign("login", "Informações Incorretas."); } } $template_html = $path_tpl."index.tpl"; } else { Js::code("document.location.href = 'index.php';"); } } else { Js::code("document.location.href = 'ie.htm';"); } ?>
require_once("content/classes/class.Exame.php"); require_once("content/classes/class.Hospital.php"); require_once("content/classes/class.Interpretacao.php"); require_once("content/classes/class.TextoPadrao.php"); require_once("content/classes/class.ValorExame.php"); //cria as variáveis que determinarão o caminho para o arquivo solicitado $s = (!empty($_GET["s"]) ? $_GET["s"] : "home"); $ss = (!empty($_GET["ss"]) ? $_GET["ss"] : ""); $sss = (!empty($_GET["sss"]) ? $_GET["sss"] : ""); $ssss = (!empty($_GET["ssss"]) ? $_GET["ssss"] : ""); $sssss = (!empty($_GET["sssss"]) ? $_GET["sssss"] : ""); //verifica se o usuário está logado if ($_SESSION["med_id"] == "" && $s != "autenticacao"){ Js::code("document.location.href = 'index.php?s=autenticacao';"); } //cria a variável que determinará a ação (add, upate, show, etc) $acao = (!empty($_GET["acao"]) ? $_GET["acao"] : ""); //define o caminho GET do script atual, incluindo todos as outras variaveis enviadas via GET $self = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $self .= "?" . htmlentities($_SERVER['QUERY_STRING']); define("SELF", $self); } //define o caminho GET da seçao atual. somente as variaveis GET que determinam o caminho $vars_secao = "?"; $vars_secao .= (!empty($s)? "s=".$s : "");
<? Util::VerificaChamada(); if($_GET[id]){ $o = new Exame($_GET[id]); $_POST["med_id"] = $_SESSION["med_id"]; foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, (empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo])); $o->set($campo, $_POST[$campo]); } if ($_POST[form] == "ok"){ if ($o->update()){ Js::goto(array("url" => "index.php?s=exame")); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } } else { Js::goto(array("url" => "index.php?s=exame")); } $template_html = $path_tpl."formulario.tpl"; ?>
if($_GET[id]){ $o = new ValorExame($_GET[id]); //$o->setDependences(); //util::prt("", get_class_methods($o)); foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $o->get($campo)); } $exa = new Exame($o->get("exa_id")); $tpl->assign("exa_nome", $exa->get("exa_nome")); $con = new Convenio($o->get("con_id")); $tpl->assign("con_nome", $con->get("con_nome")); $hos = new Hospital($con->get("hos_id")); $tpl->assign("hos_nome", $hos->get("hos_nome")); if ($_GET[del] == "1" || $_POST[del] == "1"){ if ($o->delete($_GET[delete_dependences])){ Js::goto(array("url" => "index.php?s=valor_exame")); } else { $dep = $o->getDependences(); if (sizeof($dep)){ $tpl->assign("dependences", $dep); } } } } else { Js::goto(array("url" => "index.php?s=convenio")); } $template_html = $path_tpl."show.tpl"; ?>
$o->set("int_paciente_nascimento" , Formatacao::formatData($_POST["datas"][$i])); $o->set("int_paciente_prontuario" , $_POST["prontuarios"][$i]); $o->set("int_opcional" , $_POST["opcionais"][$i]); $o->set("int_tecnico_rx" , $_POST["tecnicos"][$i]); $o->set("int_requisitante" , $_POST["requisitantes"][$i]); $valor_absoluto = $exa->getValorAbsoluto($_POST["convenios"][$i]); $valor_contraste = $exa->getValorContraste($_POST["convenios"][$i]); $ch = $exa->getCh($_POST["convenios"][$i]); $filme = $exa->getFilme($_POST["convenios"][$i]); $valor_ch = $con->get("con_valor_ch"); $valor_filme = $con->get("con_valor_filme"); $o->set("int_percentual" , $hos->get("hos_percentual")); $o->set("int_valor_absoluto" , $valor_absoluto); $o->set("int_valor_contraste" , $valor_contraste); $o->set("int_ch" , $ch); $o->set("int_filme" , $filme); $o->set("int_valor_ch" , $valor_ch); $o->set("int_valor_filme" , $valor_filme); $o->set("int_valor_final" , strval(floatval($valor_absoluto) > 0 ? $valor_absoluto : floatval($valor_contraste) + (floatval($ch) * floatval($valor_ch)) + (floatval($filme) * floatval($valor_filme)))); $o->propertiesClearConfig(); $new_id = $o->add(); } Js::goto(array("url" => "index.php?s=interpretacao")); } $template_html = $path_tpl."formulario_add_discado.tpl"; ?>
<? Util::VerificaChamada(); $o = new Convenio(); foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $_POST[$campo]); $o->set($campo, $_POST[$campo]); } $tpl->assign("vet_hospitais", Hospital::getOptions()); //util::prt("",$o->exists()); if ($_POST[form] == "ok"){ //$o->propertiesDump(true); if ($new_id = $o->add()){ Js::goto(array( "url" => "index.php?s=convenio&acao=add", "post_vars" => array( "hos_id" => $_POST[hos_id] ) )); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } $template_html = $path_tpl."formulario.tpl"; ?>
public function handleRequest($pathArray) { // handel Frame Requests $urlRequestObject = new UrlRequestObject(); if (isset($pathArray[0])) { $urlRequestObject->setNamespace($pathArray[0]); } if (isset($pathArray[1])) { $urlRequestObject->setCommand($pathArray[1]); } if (count($pathArray) > 2) { $params = array(); for ($i = 2; $i < count($pathArray); $i++) { $params[] = $pathArray[$i]; } $urlRequestObject->setParams($params); } $namespaceExtension = ExtensionMaster::getInstance()->getExtensionForNamespace($urlRequestObject->getNamespace()); if (isset($namespaceExtension)) { if ($urlRequestObject->getCommand() == "") { $urlRequestObject->setCommand($namespaceExtension->getDefaultCommandName($urlRequestObject->getNamespace())); } $command = $namespaceExtension->getCommand($urlRequestObject->getCommand()); if ($command == null) { if (strtolower($urlRequestObject->getCommand()) == "asset") { $command = new Asset(); } else { if (strtolower($urlRequestObject->getCommand()) == "css") { $command = new Css(); } else { if (strtolower($urlRequestObject->getCommand()) == "js") { $command = new Js(); } } } } if ($command == null) { if (DEVELOPMENT_MODE) { throw new Exception("Command {$urlRequestObject->getCommand()} not found."); } else { ExtensionMaster::getInstance()->send404Error(); } } //init commands extension $command->getExtension(); if ($command->httpAuth($urlRequestObject)) { include_once PATH_LIB . "http_auth_handling.inc.php"; if (!http_auth()) { die("Bitte anmelden."); } } $frame = lms_portal::get_instance(); if ($command instanceof IResourcesCommand) { if ($command->validateData($urlRequestObject)) { if ($command->isGuestAllowed($urlRequestObject)) { $frame->initialize(GUEST_ALLOWED, $command->workOffline($urlRequestObject)); } else { $frame->initialize(GUEST_NOT_ALLOWED, $command->workOffline($urlRequestObject)); } ExtensionMaster::getInstance()->getExtensionById("Chronic")->setCurrentObject($namespaceExtension->getCurrentObject($urlRequestObject)); $command->processData($urlRequestObject); $command->resourcesResponse(); die; } } else { if ($command instanceof IFrameCommand) { if ($command->validateData($urlRequestObject)) { if ($command->isGuestAllowed($urlRequestObject)) { $frame->initialize(GUEST_ALLOWED, $command->workOffline($urlRequestObject)); } else { $frame->initialize(GUEST_NOT_ALLOWED, $command->workOffline($urlRequestObject)); } ExtensionMaster::getInstance()->getExtensionById("Chronic")->setCurrentObject($namespaceExtension->getCurrentObject($urlRequestObject)); $command->processData($urlRequestObject); $frameResponeObject = $command->frameResponse(new FrameResponseObject()); if ($command->embedContent($urlRequestObject)) { $data = \Widgets\Widget::getData($frameResponeObject->getWidgets()); $frame->add_css_style($data["css"]); $frame->add_javascript_code("Widgets", $data["js"]); $frame->set_page_main($frameResponeObject->getHeadline(), $data["html"] . "<script type=\"text/javascript\">{$data["postjs"]}</script>", ""); $frame->set_page_title($frameResponeObject->getTitle()); $frame->set_confirmation($frameResponeObject->getConfirmText()); $frame->set_problem_description($frameResponeObject->getProblemDescription(), $frameResponeObject->getProblemSolution()); $frame->show_html(); die; } else { $data = \Widgets\Widget::getData($frameResponeObject->getWidgets()); echo $data["html"]; die; } } } } if (DEVELOPMENT_MODE) { throw new Exception("Command {$urlRequestObject->getCommand()} execution error."); } else { ExtensionMaster::getInstance()->send404Error(); } } ExtensionMaster::getInstance()->send404Error(); }
<? Util::VerificaChamada(); $o = new Exame(); $_POST["med_id"] = $_SESSION["med_id"]; foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, $_POST[$campo]); $o->set($campo, $_POST[$campo]); } if ($_POST[form] == "ok"){ if ($new_id = $o->add()){ Js::goto(array( "url" => "index.php?s=exame&acao=add" )); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } $template_html = $path_tpl."formulario.tpl"; ?>
$o->set($campo, $_POST[$campo]); } $tpl->assign("vet_exames", Exame::getOptions()); $tpl->assign("vet_convenios", Convenio::getOptions()); if ($_POST[con_id]){ $con = new Convenio($_POST[con_id]); $tpl->assign("con_valor_ch", $con->get("con_valor_ch")); $tpl->assign("con_valor_filme", $con->get("con_valor_filme")); } if ($_POST[form] == "ok"){ //$o->propertiesDump(true); if ($new_id = $o->add()){ Js::goto(array( "url" => "index.php?s=valor_exame&acao=add", "post_vars" => array( "exa_id" => $_POST["exa_id"], "con_id" => $_POST["con_id"] ) )); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } $template_html = $path_tpl."formulario.tpl"; ?>
<? Util::VerificaChamada(); if($_GET[id]){ $o = new Hospital($_GET[id]); $_POST["med_id"] = $_SESSION["med_id"]; foreach($o->propertiesGetConfig() as $campo => $config){ $tpl->assign($campo, (empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo])); $o->set($campo, $_POST[$campo]); } if ($_POST[form] == "ok"){ //$o->propertiesDump(); if ($o->update()){ Js::goto(array("url" => "index.php?s=hospital")); } else { foreach($o->errors as $campo => $erro){ $tpl->assign($campo."_erro", $erro); $tpl->assign($campo, ""); } } } } else { Js::goto(array("url" => "index.php?s=hospital")); } $template_html = $path_tpl."formulario.tpl"; ?>
<title><?php echo $pagTitle; ?> </title> <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script> <script src="/js/jquery.plugins.js"></script> <script src="/js/site.js"></script> <script src="/js/rsv-2.5.2.js"></script> <script src="/js/prettify.js"></script> <script> "use strict"; var CurrentUser = { isLogged: <?php echo Js::BoolString($currentUser->isLogged()); ?> }; </script> <link rel="stylesheet" href="/css/mfglabs_iconset.css"> <link rel="stylesheet" href="/css/prettyprint.css" /> <link rel="stylesheet" href="/css/style.css" /> </head> <body> <div id="container"> <div id="nav-panel"> <div id="nav-panel-container"> <ul> <li class="left"> <?php
<? Util::VerificaChamada(); session_unset(); Js::goto(array("url" => "index.php")); ?>