コード例 #1
0
ファイル: pedido_lista.php プロジェクト: jonathanbugs/anselmi
/* Total data set length */
$sQuery = "\r\n        SELECT COUNT(ID_PEDIDO)\r\n        FROM   \r\n            e_PEDIDO PEDI,\r\n            e_PEDIDO_PAGAMENTO PEPA,\r\n            e_FORMA_PAGAMENTO FOPA,\r\n            e_PEDIDO_ITEM_SITUACAO PISI,\r\n            e_PESSOA PESS,\r\n            e_TIPO_FRETE TIFR\r\n        WHERE\r\n            PEDI.ID_PEDIDO = PEPA.PEDI_ID_PEDIDO\r\n        AND PEPA.FOPA_ID_FORMA_PAGAMENTO = FOPA.ID_FORMA_PAGAMENTO\r\n        AND fn_situacao_pedido(PEDI.ID_PEDIDO) = PISI.ID_PEDIDO_ITEM_SITUACAO\r\n        AND PEDI.PESS_ID_PESSOA = PESS.ID_PESSOA\r\n        AND PEDI.LOJA_ID_LOJA = " . ID_LOJA . "\r\n        AND PEDI.TIFR_ID_TIPO_FRETE = TIFR.ID_TIPO_FRETE\r\n        AND PEPA.ATIVO = 'S'\r\n    ";
$rResultTotal = $mysqli->ExecutarSQL($sQuery);
$aResultTotal = mysqli_fetch_array($rResultTotal);
$iTotal = $aResultTotal[0];
/*
 * Output
 */
//$_GET['sEcho'] = 1;
//if(isset($_GET['sEcho'])) $_GET['sEcho'] = $_GET['sEcho']; else $_GET['sEcho'] = 1;
$output = array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $iTotal, "iTotalDisplayRecords" => $iFilteredTotal, "aaData" => array());
while ($aRow = mysqli_fetch_array($rResult)) {
    $row = array();
    for ($i = 0; $i < count($aColumns); $i++) {
        if ($aColumns[$i] == "version") {
            /* Special output formatting for 'version' column */
            $row[] = $aRow[$aColumns[$i]] == "0" ? '-' : $aRow[$aColumns[$i]];
        } else {
            if ($aColumns[$i] != ' ') {
                /* General output */
                $row[] = $aRow[$aColumns[$i]];
            }
        }
    }
    $row = array_map("utf8_encode", $row);
    $row = str_replace($row[4], fnFormataCpfCnpj($row[4]), $row);
    $row = str_replace($row[6], fnFormataPreco($row[6]), $row);
    //printr($row);
    $output['aaData'][] = $row;
}
echo json_encode($output);
コード例 #2
0
ファイル: menu_topo.php プロジェクト: jonathanbugs/anselmi
				</ul>
				<!--<div class="ofertaDia">
					<a class="categoriasLink" href="javascript:;">Oferta do dia</a>
					<div class="bannerOfertaDia">
						<a class="ofertaDiaLink" href="' . ROOT_DIR . $valueProdutoPromoDia['URL_AMIGAVEL'] . '.html">
							<img alt="" src="https://www2.lojaspr.com.br/midia/produtos/detalhe/' . $valueProdutoPromoDia['IMAGEM_PRINCIPAL'] . '">
						</a>
						<div class="descricaoOfertaDia">
							<a class="ofertaDiaLink" href="' . ROOT_DIR . $valueProdutoPromoDia['URL_AMIGAVEL'] . '.html">
								<span class="produtoTitulo">
									' . $valueProdutoPromoDia['DESCRICAO_VENDA'] . '
								</span>
								<div class="valoresOfertaDia">
									<span class="valorDe">De R$ ' . fnFormataPreco($valueProdutoPromoDia['PRECO_VENDA']) . '</span>
									<span class="parcelas">Por R$</span>
									<span class="valorPor">' . fnFormataPreco($valueProdutoPromoDia['PRECO_PROMOCIONAL']) . '</span>
								</div>
							</a>
							<a class="btConfira" href="' . ROOT_DIR . $valueProdutoPromoDia['URL_AMIGAVEL'] . '.html">CONFIRA</a>
						</div>
					</div>
				</div>-->
				';
$smarty->assign('menuTopo', $menuTopo);
/*$menuTopo4 = '<ul class="categoriasUl">
<li class="categoriasLi">
						<a class="categoriasLink" href="javascript:;">Util. Dom&eacute;sticas</a>
						
						<ul class="subMenuUl subMenuBlocoUlUtilidades clearfix">
							<li>
								<!-- CASO HOUVER NECESSIDADE DE DUAS COLUNAS ADICIONAR A CLASSE "subMenuBlocosUlFirst" COMO ABAIXO -->
コード例 #3
0
								<th><strong>SITUACAO</strong></th>
								<th><strong>DATA</strong></th>
								<th><strong>NUMERO_PEDIDO</strong></th>
								<th><strong>DESCRICAO_FORMA_PAGAMENTO</strong></th>
								<th><strong>NUMERO_PARCELAS</strong></th>
								<th><strong>NOME</strong></th>
								<th><strong>SOBRENOME</strong></th>
								<th><strong>CPF</strong></th>
								<th><strong>EMAIL</strong></th>
								<th><strong>DESCRICAO_PROMOCAO</strong></th>
								<th><strong>URL_ORIGEM</strong></th>
							 </tr>');
        $i = 1;
        while ($rowPedido = @mssql_fetch_array($resultPedido)) {
            $i % 2 == 0 ? $cor = "bgcolor=\"#F5F5F5\"" : ($cor = "");
            $i++;
            $escreve = @fwrite($fp, "<tr " . $cor . ">" . "<td>" . fnFormataPreco($rowPedido["VALOR_TOTAL"]) . "</td>" . "<td>" . utf8_encode($rowPedido["SITUACAO"]) . "</td>" . "<td>" . utf8_encode($rowPedido["DATA"]) . "</td>" . "<td>" . utf8_encode($rowPedido["NUMERO_PEDIDO"]) . "</td>" . "<td>" . utf8_encode($rowPedido["DESCRICAO_FORMA_PAGAMENTO"]) . "</td>" . "<td>" . utf8_encode($rowPedido["NUMERO_PARCELAS"]) . "</td>" . "<td>" . utf8_encode($rowPedido["NOME"]) . "</td>" . "<td>" . utf8_encode($rowPedido["SOBRENOME"]) . "</td>" . "<td>" . fnFormataCpfCnpj($rowPedido["CPF"]) . "</td>" . "<td>" . utf8_encode($rowPedido["EMAIL"]) . "</td>" . "<td>" . utf8_encode($rowPedido["DESCRICAO_PROMOCAO"]) . "</td>" . "<td>" . utf8_encode($rowPedido["URL_ORIGEM"]) . "</td>" . "</tr>");
        }
        @fwrite($fp, '</table>');
        if (@file_exists($nomeArquivo)) {
            $retorno = '{ "cod": "sucesso", "mensagem": "' . PEDIDO_EXPORTADO . '", "nomeArquivo": "' . BASE_DIR . 'exportacao/download.php?arquivo=' . $arquivo . '" }';
        } else {
            $retorno = '{ "cod": "erro", "mensagem": "' . PEDIDO_NAO_EXPORTADO . '" }';
        }
        @fclose($fp);
        echo $retorno;
        break;
    default:
        # code...
        break;
}