<?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 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); if (strpos($id_gr, '-') !== false) { $grepdb = grepGetByGrNumber($id_gr); } else { $grepdb = grepGetById($id_gr); } //$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'); if ($grepdb['gr_number'] == "") { $pdf->Cell(0, 10, utf8_decode('Guia de Reparação nº' . $grepdb['id']), 0, 0, 'R'); } else { $pdf->Cell(0, 10, utf8_decode('Guia de Reparação nº' . $grepdb['gr_number']), 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; }
<?php include '../includes/allpageaj.php'; $table = ""; if (strpos($_POST['gr_id'], '-') !== false) { $data = grepGetByGrNumber($_POST['gr_id']); $table = modifgrGet($data['id']); } else { //$data = grepGetById($_POST['id_gr']); $table = modifgrGet($_POST['gr_id']); } /*if(is_numeric($_POST['gr_id'])) { $table = modifgrGet($_POST['gr_id']); }else{ $table = modifgrGet(999999999); }*/ ?> <table class="table table-striped table-hover"> <thead> <tr> <th>Nº Guia</th> <th>Nome Utilizador</th> <th>data Modificação</th> <th>Motivo</th> </tr> </thead> <tbody> <?php if (is_bool($table) === false) { if (mysql_num_rows($table) > 0) {
<?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>
<?php include '../includes/allpageaj.php'; $return = grepGetByGrNumber(dbInteger($_POST['gr'])); if ($return) { //print_r($return); echo $return['id']; } else { echo 'nok'; } closeDataBase();