<?php
include ('conexao.php');
//if(isset($_REQUEST['cod'])&&($_REQUEST['cod']!="")) {
$id = $_REQUEST['cod'];

$proc_m=mysqli_query($mysqli,"SELECT * FROM instituicao");
$res2m=mysqli_fetch_array($proc_m);
$autarquia=$res2m['instituicao'];
$nuit=$res2m['nuit'];
$telef=$res2m['telefone'];
$celular=$res2m['celular'];

$data = date('Y-m-d h:m:i');
	
$d = new DateTime("now", new DateTimeZone("Africa/Maputo"));
$data= $d->format("r");	
$d = date("d");
$m = date("m");
$ano = date("Y");

$sqlx = mysqli_query($mysqli,"SELECT * FROM pagtonresgistado WHERE id='$id'");

while($ver =mysqli_fetch_array($sqlx))
{
 
$agente=$ver['agente'];

//$image="1";
$content="\n";
$content.=$autarquia."\n";
$content.=$nuit."\n";
$content.=$telef."/".$celular."\n";
$content.="Taxa de Mercado Nr ".$id. " \n";
$content.="--------------------------------";
$content.=$data." ";
$content.="Taxa                  ".number_format($ver['taxa'],2)."MT \n";
$content.="Multa                   ".number_format($ver['multa'],2)."MT\n";
$content.="--------------------------------";
$content.="Total Cobrado         ".number_format($ver['pago'],2)."MT  \n";
$content.="--------------------------------";
$content.="Operador: ".$agente."\n\n";
$content.="MUITO OBRIGADO \n";
$content.="Pague sempre!!\n";
$content.="===== SiGA Software ====\n\n";
$valor=$ver['pago'];

}
		
//you can print text and image by sending request from your website
$a = array();

//sending text entry	
$obj1 = new stdClass(); 
$obj1->type = 0;//text
$obj1->content = $content;//any string	
$obj1->bold = 1;//0 if no, 1 if yes
$obj1->align =0;//0 if left, 1 if center, 2 if right
$obj1->format = 0;//0 if normal, 1 if double Height, 2 if double Height + Width, 3 if double Width
array_push($a,$obj1);


echo json_encode($a,JSON_FORCE_OBJECT);

?>
