<?php include '../includes/allpageaj.php'; require_once 'Egoi/Factory.php'; if (strpos($_POST['id_gr'], '-') !== false) { $data = grepGetByGrNumber($_POST['id_gr']); } else { $data = grepGetById($_POST['id_gr']); } //$data = grepGetById(dbInteger($_POST['id_gr'])); require '../sms/bootstrap.php'; $continu = true; if ($data['status_sms'] == 1) { $continu = false; $texto = "O sms já foi entregue ao cliente"; } if ($data['status_sms'] == 0 && strlen($data['date_sms']) < 1) { $continu = false; $texto = "Ainda não foi enviado sms ao cliente"; } $lastsmsid = $data['sms_id']; //numero da sms id "LastSMSID" if (strlen($lastsmsid) > 0 && $continu) { //$versms = verifysms($lastsmsid); //$status = $versms->body->MessageInfo->DeliveryStatus; $result = getreportegoi($lastsmsid); $sent = intval($result['SENT']); $delivered = intval($result['DELIVERED']); $not_delivered = intval($result['NOT_DELIVERED']); $invalid = intval($result['INVALID']); //DeliveryStatus
function insertmodifgr($id, $text) { $fields = array(); $fields['gr_id'] = $id; $fields['us_id'] = $_SESSION['iduser']; $data2 = grepGetById($id); $fields['gr_number'] = dbString($data2['gr_number']); $fields['modif_date'] = dbString(date('Y-m-d H:i:s', time() - 3600)); $fields['modif_text'] = dbString($text); modifgrInsert($fields); unset($fields); }
<?php include '../includes/allpageaj.php'; if (strpos($_GET['campo'], '-') !== false) { $data = grepGetByGrNumber($_GET['campo']); } else { $data = grepGetById($_GET['campo']); } //echo $_GET['campo']; //$where .= $_POST['campo'] . " = " . $_POST['valor']; //$data = grepGetById($_GET['campo']); if (strlen($data['cl_name']) > 0) { ?> <div class="form-group"> <label class="col-sm-2 control-label" for="textinput" >Nome do Cliente</label> <div class="col-sm-10"> <input value="<?php echo $data['cl_name']; ?> " disabled type="text" name="cl_name" class="form-control" maxlength="100" required> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label" for="textinput">Contacto</label> <div class="col-sm-4"> <input type="text" value="<?php echo $data['cl_telefone']; ?> " disabled maxlength="9" name="cl_telefone" id="cl_telefone" class="form-control" required> </div> </div>
function createpdf($id_gr) { require '../fpdf/fpdf.php'; //permite criar uma font a partir das font do windows //require('../fpdf/makefont/makefont.php'); //MakeFont('../fpdf/arial.ttf','iso-8859-1', true); $grepdb = grepGetById($id_gr); $pdf = new FPDF('P', 'mm', 'A4'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('arial', '', 12); $pdf->Cell(0, 10, $pdf->Image('../images/eleclerc.jpg', 6, 10, 50), 0, 0, 'L'); //$pdf->Cell(0,10,utf8_decode('Guia de Reparação nº19') ,0 ,0 ,'R'); $pdf->Cell(0, 10, utf8_decode('Guia de Reparação nº' . $id_gr), 0, 0, 'R'); $pdf->Ln(15); $pdf->Cell(155, 10, utf8_decode($_SESSION['morada_leclerc_pdf']), 0, 0, 'L'); $pdf->Cell(2, 10, utf8_decode('Data: ' . invertedatasemhora($grepdb['date_in'])), 0, 0, 'L'); $pdf->Ln(6); $pdf->Cell(0, 10, utf8_decode($_SESSION['cod_postal_leclerc_pdf']), 0, 0, 'L'); $pdf->Ln(6); $pdf->Cell(0, 10, utf8_decode('Tel: ' . $_SESSION['telefone_leclerc_pdf'] . ' Fax: ' . $_SESSION['fax_leclerc_pdf']), 0, 0, 'L'); $pdf->Ln(6); $pdf->Cell(0, 10, utf8_decode($_SESSION['mail_leclerc_pdf']), 0, 0, 'L'); $pdf->Ln(6); $pdf->Cell(0, 10, utf8_decode('NIF: ' . $_SESSION['nif_leclerc_pdf']), 0, 0, 'L'); //cliente $pdf->Ln(15); $pdf->SetFont('arial', '', 20); $pdf->Cell(0, 10, utf8_decode('Cliente'), 0, 0, 'L'); $pdf->Ln(2); $pdf->Cell(0, 10, utf8_decode('_______________________________________________'), 0, 0, 'L'); $pdf->Ln(10); $pdf->SetFont('arial', '', 12); $pdf->Cell(0, 10, utf8_decode('Nome: ' . $grepdb['cl_name']), 0, 0, 'L'); $pdf->Ln(10); $pdf->Cell(0, 10, utf8_decode('Morada: ' . $grepdb['cl_morada']), 0, 0, 'L'); $pdf->Ln(10); //o multicell permite ser só uma linha ou caso acaba a linha cria logo uma por baixo $pdf->Cell(80, 10, utf8_decode('Localidade: ' . $grepdb['cl_localidade'])); $pdf->Cell(2, 10, utf8_decode('Cod. Postal: ' . codpostalToForm($grepdb['cl_codpostal']))); $pdf->Ln(10); $pdf->Cell(0, 10, utf8_decode('Contacto: ' . $grepdb['cl_telefone']), 0, 0, 'L'); $pdf->Ln(15); $pdf->SetFont('arial', '', 20); //artigo $pdf->Cell(0, 10, utf8_decode('Artigo'), 0, 0, 'L'); $pdf->Ln(2); $pdf->Cell(0, 10, utf8_decode('_______________________________________________'), 0, 0, 'L'); $pdf->Ln(10); $pdf->SetFont('arial', '', 12); $pdf->Cell(80, 10, utf8_decode('Marca: ' . $grepdb['art_marca'])); $pdf->Cell(2, 10, utf8_decode('Tipo: ' . $grepdb['art_type'])); $pdf->ln(10); $pdf->Cell(80, 10, utf8_decode('Modelo: ' . $grepdb['art_modelo'])); $pdf->Cell(2, 10, utf8_decode('EAN: ' . $grepdb['art_ean'])); $pdf->ln(10); $pdf->MultiCell(0, 10, utf8_decode('Nº Série: ' . $grepdb['art_numserie'])); $pdf->MultiCell(0, 10, utf8_decode('Anomalia: ' . $grepdb['art_anomalia'])); $pdf->MultiCell(0, 10, utf8_decode('Acessórios: ' . $grepdb['art_acessor'])); $pdf->MultiCell(0, 10, utf8_decode('Estética: ' . $grepdb['art_estetic'])); //$image_photo = $pdf->Image('../images/euro.jpg',$pdf->GetX(), $pdf->GetY(), 'R'); $pdf->Cell(80, 10, utf8_decode('Talão: ' . $grepdb['art_numtalao'])); $pdf->Cell(2, 10, utf8_decode('Valor: ' . $grepdb['art_valor'])); $pdf->Ln(10); if ($grepdb['art_garantie'] == 1) { $pdf->Cell(80, 10, utf8_decode('Garantia: Sim')); $pdf->Cell(2, 10, utf8_decode('Data: ' . $grepdb['art_dategar'])); } else { $pdf->Cell(0, 10, utf8_decode('Garantia: Não'), 0, 0, 'L'); } $pdf->Ln(10); if ($grepdb['art_orcamento'] == 1) { $pdf->Cell(0, 10, utf8_decode('Orçamento: Sim'), 0, 0, 'L'); } else { $pdf->Cell(0, 10, utf8_decode('Orçamento: Não'), 0, 0, 'L'); } $pdf->Ln(20); $pdf->Cell(20, 10, utf8_decode(' ')); $pdf->Cell(80, 10, utf8_decode('Assinatura Cliente:')); $pdf->Cell(2, 10, utf8_decode('Assinatura Funcionário:')); $pdf->Ln(20); $pdf->Cell(20, 10, utf8_decode(' ')); $pdf->Cell(80, 10, utf8_decode('________________')); $pdf->Cell(2, 10, utf8_decode('____________________')); return $pdf; }
} xhr.open("POST","ajax/ajupdategr.php",true); xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded"); xhr.send("id="+id+"&art_ean="+art_ean+"&obs="+obs+"&cl_morada="+cl_morada+"&art_anomalia="+art_anomalia+"&cl_telefone="+telefone+"&art_acessor="+acessorio+"&art_numserie="+numserie+"&why=Alterou a guia"); } } function viewTalao(url) { window.open(url, '_blank', 'fullscreen=no'); return false; } </script> <?php $data = grepGetById(dbInteger($_GET['id'])); ?> <div class="row"> <div class="col-md-7 col-md-offset-2"> <form name="insertguia" class="form-horizontal" > <fieldset> <!-- Form Name --> <legend>Visualização Guia</legend> <!-- Text input--> <div class="form-group"> <label class="col-sm-2 control-label" for="textinput">Nº Guia</label> <div class="col-sm-4"> <?php