<?php
require 'acesso.php';
	$res = array();
	
	//$afirma   = $_POST['afirma'];
	
	/*if ($afirma == '') {
		$ret = $con->prepare("SELECT arcodrot, arnomrot FROM re12 WHERE sr_deleted != 'T'");
	} else {
		$ret = $con->prepare("SELECT arcodrot, arnomrot FROM re12 WHERE afirma = '$afirma' and sr_deleted != 'T'");
	}*/
	$ret = $con->prepare("SELECT * FROM mobile_romaneio_emb WHERE desativado = 0 ORDER BY descricao");
	$ret->execute();
	$mensagem = $ret->errorInfo();
	if ($ret->rowCount() > 0) {
	    $res["contagem"] = $ret->rowCount();
	    $res["emb"] = array();
	    while ($row = $ret->fetch(PDO::FETCH_ASSOC)) {
	    	array_push($res["emb"], $row);
	    }
	    $res["sucesso"] = 1;
	    echo json_encode($res);
	} else {
	    $res["sucesso"] = 0;
	    $res["mensagem"] = $mensagem[2];
	    echo json_encode($res);
	}
?>