function imprimirTicket() { //validacion para identificar tipo de usuario y desglosar info $user = $this->session->userdata('user'); $op['info'] = array(); if ($user['uid'] != '') { $tipo = 'info_' . $user['tipoUsuario']; $op['info'] = $this->data_model->{$tipo}($user['uid']); } $s_trans_referencia = $this->session->userdata('trans_referencia'); $s_trans_error = $this->session->userdata('trans_error'); $s_trans_tipo = $this->session->userdata('trans_tipo'); $s_trans_msg = $this->session->userdata('trans_msg'); $s_trans_url = $this->session->userdata('trans_url'); $s_trans_id = $this->session->userdata('trans_id'); $s_trans_respuesta = $this->session->userdata('s_trans_respuesta'); $creacionDate = $this->session->userdata('s_creacionDate'); $info2 = $this->carrito_model->infoComprador($s_trans_referencia); $montoPagar = 0; $nomCliente = ''; $emailCliente = ''; if ($info2) { $montoPagar = $info2[0]->total . ' MXN'; $nomCliente = $info2[0]->alias . ' ' . $info2[0]->name; $emailCliente = $info2[0]->email; } $valoresR = array(); if ($s_trans_respuesta != "") { $valoresR = explode("#", $s_trans_respuesta); } $fechaCreacion = ""; $horaCreacion = ""; $fechaExp = ""; $horaExp = ""; $barCode = ""; $htmlPayu = ''; $text = ''; if (count($valoresR) > 0) { $fecha_crea = explode("T", $creacionDate); $fecha_exp = explode("T", $valoresR[1]); $fechaCreacion = $fecha_crea[0]; $horaCreacion = $fecha_crea[1]; $fechaExp = $fecha_exp[0]; $horaExp = $fecha_exp[1]; $barCode = $valoresR[2]; } $op['trans_referencia'] = $s_trans_referencia; $op['trans_error'] = $s_trans_error; $op['trans_tipo'] = $s_trans_tipo; $op['trans_msg'] = $s_trans_msg; $op['trans_url'] = $s_trans_url; $op['s_trans_respuesta'] = $s_trans_respuesta; if ($s_trans_error == 0) { switch ($s_trans_tipo) { case 'OXXO': $imgSuc = '<img id="img_oxxo" style="float: left; width: 255px; margin-left: 80px;" src="http://www.plazadelatecnologia.com/assets/graphics/payu_oxxo.png" alt="oxxo" />'; break; case '7ELEVEN': $imgSuc = '<img id="eleven" style="float: left; margin-left: 80px; width: 185px; padding: 0px 20px; margin-bottom: 20px;" src="http://www.plazadelatecnologia.com/assets/graphics/payu_7eleven.png" alt="7-eleven" />'; break; } $htmlPayu .= '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body> <table width="700" align="center" border="0" cellpadding="2" cellspacing="0" style="border:3px solid #ccc"> <tr><td> <p> Apreciable Cliente: ' . $nomCliente . ' <br/><br/> Imprime y presenta este comprobante en cualquier tienda ' . $s_trans_tipo . ' del país para realizar el pago por tu compra. <strong>Indica al cajero de la tienda el valor exacto</strong> que figura en el presente comprobante. De lo contrario es probable que no podamos validar correctamente la compra.<br/><br/> </p> </td></tr> <tr><td> <table width="700" border="0" cellpadding="2" cellspacing="0"> <tr><td width="290" valign="top">' . $imgSuc . '</td> <td width="410"> <table width="400" border="0" cellpadding="2" cellspacing="0" style="float: left;"> <tr> <td colspan="4" bgcolor="#666666" style="color:#FFF; text-align: center;">DATOS PARA REALIZAR EL PAGO</td> </tr> <tr> <td width="130" bgcolor="#CCCCCC">Número de pago:</td> <td colspan="3">' . $s_trans_id . '</td> </tr> <tr> <td bgcolor="#CCCCCC">Valor:</td> <td colspan="3">' . $montoPagar . '</td> </tr> <tr> <td bgcolor="#CCCCCC">Nombre Comercio:</td> <td colspan="3">PASAJE DE ELECTRONICA EL SALVADOR SA DE CV</td> </tr> <tr> <td bgcolor="#CCCCCC">Fecha de creación:</td> <td width="79">' . $fechaCreacion . '</td> <td width="144" bgcolor="#CCCCCC">Hora:</td> <td width="79">' . $horaCreacion . '</td> </tr> <tr> <td bgcolor="#CCCCCC">Fecha de expiración:</td> <td>' . $fechaExp . '</td> <td bgcolor="#CCCCCC">Hora:</td> <td>' . $horaExp . '</td> </tr> </table> </td></tr></table> </td></tr> <tr><td> <p> ¡TEN EN CUENTA! <br/> <br/> 1) El presente recibo solo es válido para el pago que estás efectuando y se verá reflejado en la cuenta del comercio 24 horas después de haberse realizado. <br/><br/> 2) Si tienes dudas sobre tu compra comunicate con PASAJE DE ELECTRONICA EL SALVADOR SA DE CV, es responsababilidad del Comercio aclarar cualquier reclamo sobre la compra del producto o servicio que estás pagando. <br/><br/> 3) Una vez recibido tu pago en ' . $s_trans_tipo . ', PayU informará al comercio PASAJE DE ELECTRONICA EL SALVADOR SA DE CV, el cual procederá a hacer entregar del producto/servicio que estás adquieriendo. <br/><br/> </p> </td></tr> '; define("IN_CB", true); include $_SERVER["DOCUMENT_ROOT"] . "/barcodegen/html/include/function.php"; $filetype = "PNG"; $dpi = 72; $scale = 2; $rotation = 0; $font_family = "0"; $font_size = 10; $start = "C"; $text = $barCode; registerImageKey("filetype", $filetype); registerImageKey("dpi", $dpi); registerImageKey("scale", $scale); registerImageKey("rotation", $rotation); registerImageKey("font_family", $font_family); registerImageKey("font_size", 0); registerImageKey("text", $text); registerImageKey("start", $start); registerImageKey("code", "BCGcode128"); $finalRequest = ""; foreach (getImageKeys() as $key => $value) { $finalRequest .= "&" . $key . "=" . urlencode($value); } if (strlen($finalRequest) > 0) { $finalRequest[0] = "?"; } $htmlPayu .= '<tr><td align="center">'; //if ($imageKeys["text"]!== "") { if ($s_trans_tipo == 'OXXO') { $htmlPayu .= '<img width="231" height="80" src="http://www.plazadelatecnologia.com/barcodegen/html/image.php'; $htmlPayu .= $finalRequest; $htmlPayu .= '"/>'; } else { $htmlPayu .= '<img width="319" height="80" src="http://www.plazadelatecnologia.com/barcodegen/html/image.php'; $htmlPayu .= $finalRequest; $htmlPayu .= '"/>'; } //} $htmlPayu .= '<br/>' . $barCode; $htmlPayu .= '</td></tr></table></body></html>'; echo $htmlPayu; } }
<?php if (!defined('IN_CB')) { die('You are not allowed to access to this page.'); } ?> <section class="output"> <h3>Гаралт</h3> <?php $finalRequest = ''; foreach (getImageKeys() as $key => $value) { $finalRequest .= '&' . $key . '=' . urlencode($value); } if (strlen($finalRequest) > 0) { $finalRequest[0] = '?'; } ?> <div id="imageOutput"> <?php if ($imageKeys['text'] !== '') { ?> <img src="image.php<?php echo $finalRequest; ?> " alt="Barcode Image" /><?php } else { ?> Бар код үүсгэх утга оруулна уу.<?php } ?> </div>