Example #1
0
function Execute($filename, $xparams, $querystring)
{
    $xDoc = new DOMDocument();
    $xDoc->load($filename);
    $result = $xDoc->createElementNS("http://www.agencexml.com/txs", "txs:result");
    $transf = $xDoc->createElementNS("http://www.agencexml.com/txs", "txs:transform");
    $transf->setAttribute("stylesheet", "#main");
    $param = $xDoc->createElementNS("http://www.agencexml.com/txs", "txs:with-param");
    $param->setAttribute("name", "now");
    $m = microtime();
    $m = substr($m, 0, strpos($m, " "));
    $m = substr($m, strpos($m, "."));
    $today = getdate();
    $param->setAttribute("value", sprintf("%04d-%02d-%02dT%02d:%02d:%02d%sZ", $today["year"], $today["mon"], $today["mday"], $today["hours"], $today["minutes"], $today["seconds"], $m));
    $param2 = $xDoc->createElementNS("http://www.agencexml.com/txs", "txs:with-param");
    $param2->setAttribute("name", "querystring");
    $param2->setAttribute("value", $querystring);
    $input = $xDoc->createElementNS("http://www.agencexml.com/txs", "txs:input");
    $xPar = new DOMDocument();
    $xPar->loadXML($xparams);
    $input->appendChild($xDoc->importNode($xPar->documentElement, true));
    $transf->appendChild($param);
    $transf->appendChild($param2);
    $transf->appendChild($input);
    $result->appendChild($transf);
    $xDoc->documentElement->appendChild($result);
    Script($result);
    $xRes = new DOMDocument();
    $xRes->loadXML("<dummy/>");
    $xRes->documentElement->parentNode->replaceChild($xRes->importNode($result->firstChild, true), $xRes->documentElement);
    return $xRes->saveXML();
}
Example #2
0
    <!--///////////////////////////////////////////////////////////////////////////////////-->


<section  id="cadastrar">
    <link rel="stylesheet" href="estilo.css"/>
    <div class="form-box">

        <form id="form" method="post" action="" enctype="multipart/form-data" >

            <?php 
function Script()
{
    return " var Class = data.class; " . "setTimeout(function(){ " . "\$('.checkbox').html(''); " . "if(Class == 'success'){ " . "location.href=data.page;  " . "}; " . "},3000); " . "if(Class ==='success'){ " . "\$('.checkbox').html(data.msg);" . "}; " . "if(Class ==='warning' ){ " . "\$('.checkbox').html(data.msg); " . "}  ";
}
$form = FormWidget::widget($model, ['id' => 'form', 'ajax' => ['url' => $this->createUrl('cadastro'), 'type' => 'POST', 'dataType' => 'json', 'success' => function ($data) {
    return Script();
}, 'error' => function ($data) {
}]]);
?>

            <div class="login-container">
                <div id="output"></div>
                <style>
                    html,body{
                        position: relative;
                        height: 100%;
                    }

                    .login-container{
                        position: relative;
                        width: 300px;