| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- <?php
- $strModulo = 'PRUEBA';
- $boolError = true;
- $arrOrdenes = [
- "0100" => [
- "cTrab" => "#315",
- "maq" => "Rechazadora ZENN",
- "fol" => "0100",
- "fIni" => "22/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de rulina de trabajo",
- "prio" => "Muy alta",
- "tMan" => "Preventivo",
- "nEmp" => "88516",
- "obse" => "Se hizo el cambio de la rulina de trabajo al observarse un desgaste importante en la pieza.",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Rulina de trabajo",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "795.00",
- "cTot" => "795.00"
- ],
- "rTiem" => [
- "fech" => "22/10/21",
- "hIni" => "10:00:00",
- "hFin" => "10:30:00",
- "tUti" => "00:30:00",
- "cosH" => "1,500.00",
- "impT" => "1,500.00"
- ]
- ],
- "0098" => [
- "cTrab" => "#613",
- "maq" => "Paneladora Salvagnini",
- "fol" => "0098",
- "fIni" => "19/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de el láser",
- "prio" => "Muy alta",
- "tMan" => "Preventivo",
- "nEmp" => "88550",
- "obse" => "Se hizo el cambio de el láser ya que se rompio.",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Láser",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "1000.00",
- "cTot" => "1000.00"
- ],
- "rTiem" => [
- "fech" => "22/10/21",
- "hIni" => "10:00:00",
- "hFin" => "10:30:00",
- "tUti" => "00:30:00",
- "cosH" => "1,500.00",
- "impT" => "1,500.00"
- ]
- ],
- "0095" => [
- "cTrab" => "#613",
- "maq" => "Paneladora Salvagnini",
- "fol" => "0095",
- "fIni" => "22/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de rulina de trabajo",
- "prio" => "Muy alto",
- "tMan" => "Preventivo",
- "nEmp" => "88516",
- "obse" => "Cambio en la Bastidora Punzonadora",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Bastidora Punzonadora",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "1200.00",
- "cTot" => "1200.00"
- ],
- "rTiem" => [
- "fech" => "28/10/21",
- "hIni" => "11:00:00",
- "hFin" => "12:30:00",
- "tUti" => "00:40:00",
- "cosH" => "1,800.00",
- "impT" => "1,800.00"
- ]
- ],
- "0080" => [
- "cTrab" => "#315",
- "maq" => "Rechazadora ZENN",
- "fol" => "0080",
- "fIni" => "22/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de rulina de trabajo",
- "prio" => "Muy alta",
- "tMan" => "Preventivo",
- "nEmp" => "88516",
- "obse" => "Se hizo el cambio de la rulina de trabajo al observarse un desgaste importante en la pieza.",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Rulina de trabajo",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "795.00",
- "cTot" => "795.00"
- ],
- "rTiem" => [
- "fech" => "22/10/21",
- "hIni" => "10:00:00",
- "hFin" => "10:30:00",
- "tUti" => "00:30:00",
- "cosH" => "1,500.00",
- "impT" => "1,500.00"
- ]
- ],
- "0075" => [
- "cTrab" => "#613",
- "maq" => "Paneladora Salvagnini",
- "fol" => "0075",
- "fIni" => "22/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de rulina de trabajo",
- "prio" => "Muy alta",
- "tMan" => "Preventivo",
- "nEmp" => "88516",
- "obse" => "Se hizo el cambio de la rulina de trabajo al observarse un desgaste importante en la pieza.",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Rulina de trabajo",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "795.00",
- "cTot" => "795.00"
- ],
- "rTiem" => [
- "fech" => "22/10/21",
- "hIni" => "10:00:00",
- "hFin" => "10:30:00",
- "tUti" => "00:30:00",
- "cosH" => "1,500.00",
- "impT" => "1,500.00"
- ]
- ],
- "0065" => [
- "cTrab" => "#023",
- "maq" => "Punzonadora",
- "fol" => "0065",
- "fIni" => "22/10/21",
- "fFin" => "22/10/21",
- "desc" => "Cambio de rulina de trabajo",
- "prio" => "Muy alta",
- "tMan" => "Preventivo",
- "nEmp" => "88516",
- "obse" => "Se hizo el cambio de la rulina de trabajo al observarse un desgaste importante en la pieza.",
- "eva" => "Excelente",
- "cau" => "Mecánica",
- "mat" => [
- "conc" => "Rulina de trabajo",
- "uni" => "Pieza",
- "cant" => "1",
- "imp" => "795.00",
- "cTot" => "795.00"
- ],
- "rTiem" => [
- "fech" => "22/10/21",
- "hIni" => "10:00:00",
- "hFin" => "10:30:00",
- "tUti" => "00:30:00",
- "cosH" => "1,500.00",
- "impT" => "1,500.00"
- ]
- ],
- ];
- $arrCampos = [
- "cTrab" => "Centro de Trabajo",
- "maq" => "Máquina",
- "fol" => "Folio",
- "fIni" => "Fecha de Inicio",
- "fFin" => "Fecha de Termino",
- "desc" => "Descripción del Servicio de Mantenimiento",
- "prio" => "Prioridad",
- "tMan" => "Tipo de Mantenimiento",
- "nEmp" => "ID del Técnico",
- "obse" => "Observaciones",
- "eva" => "Evaluación del servicio",
- "cau" => "Causa de la falla",
- "mat" => [
- "conc" => "Concepto",
- "uni" => "Unidad",
- "cant" => "Cantidad",
- "imp" => "Importe",
- "cTot" => "Costo total"
- ],
- "rTiem" => [
- "fech" => "Fecha",
- "hIni" => "Hora Inicio",
- "hFin" => "Hora Termino",
- "tUti" => "Tiempo utilizado",
- "cosH" => "Costo HH",
- "impT" => "Importe"
- ],
- ];
- if($_SERVER['REQUEST_METHOD'] == "POST"){
- $numOrden = $_POST["numOrden"];
- $boolError = empty($numOrden);
- $detallesOrden = [];
- if(array_key_exists("pdf", $_POST)){
- $datos = json_encode($arrOrdenes[$_POST["pdf"]]);
- $fields = array("infoPDF" => base64_encode($datos));
- $fieldsStr = http_build_query($fields);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://smart.solerpalau.mx/QA/api/pdfIOS/crearPdfTmp.php");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $fieldsStr);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $data = curl_exec($ch);
- curl_close($ch);
- $strInfo = base64_decode($data);
- $arrInfo = json_decode($strInfo, true);
- $filename = $arrInfo["name"];
- $fileinfo = $arrInfo["content"];
- // Header content type
- header('Content-type: application/pdf');
- header('Content-Disposition: inline; filename="' . $filename . '"');
- header('Content-Transfer-Encoding: binary');
- header('Accept-Ranges: bytes');
- // Read the file
- echo base64_decode($fileinfo);
- exit;
- }
- if(!$boolError){
- $detallesOrden = $arrOrdenes[$numOrden];
- $link = $_POST["from"];
- $cont = 0;
- $strOut = "";
- foreach($detallesOrden as $key=>$val){
- if($cont == 0 && !is_array($val)){
- $strOut .= "<tr> \n";
- $strOut .= "<td width=\"15%\" colspan=\"3\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<label class=\"noTopPadding\" for='". $key ."'>". $arrCampos[$key] ."</label> \n";
- $strOut .= "</td> \n";
- $strOut .= "<td width=\"30%\" colspan=\"6\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<input id='". $key ."' name='" . $key . "' value='" . $detallesOrden[$key] . "' data-dojo-type=\"dijit/form/ValidationTextBox\" style=\"width:100%\" required=\"false\" data-dojo-props=\"placeHolder:'Automático.'\"/> \n";
- $strOut .= "</td> \n";
- $cont++;
- }else if(!is_array($val)){
- $strOut .= "<td width=\"20%\" colspan=\"4\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<label class=\"noTopPadding\" for='". $key ."'>". $arrCampos[$key] ."</label> \n";
- $strOut .= "</td> \n";
- $strOut .= "<td width=\"35%\" colspan=\"7\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<input id='". $key ."' name='" . $key . "' value='" . $detallesOrden[$key] . "' data-dojo-type=\"dijit/form/ValidationTextBox\" style=\"width:100%\" required=\"false\" data-dojo-props=\"placeHolder:'Automático.'\"/> \n";
- $strOut .= "</td> \n";
- $strOut .= "</tr> \n";
- $cont = 0;
- }else{
- $bandName = $key == "mat" ? "Materiales y/o refacciones" : "Registro de tiempo";
- $strOut .= "<tr> \n";
- $strOut .= "<td> </td> \n";
- $strOut .= "</tr> \n";
- $strOut .= "<tr> \n";
- $strOut .= "<td width=\"100%\" colspan=\"20\" bgcolor=\"#FF0000\" style=\"height:23px;color:#FFFFFF;padding-left:5px;\">$bandName</td> \n";
- $strOut .= "</tr> \n";
- $strOut .= "<tr> \n";
- $strOut .= "<td> </td> \n";
- $strOut .= "</tr> \n";
- $cont1 = 0;
- foreach($val as $key0=>$val0){
- if($cont1 == 0){
- $strOut .= "<tr> \n";
- $strOut .= "<td width=\"15%\" colspan=\"3\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<label class=\"noTopPadding\" for='". $key0 ."'>". $arrCampos[$key][$key0] ."</label> \n";
- $strOut .= "</td> \n";
- $strOut .= "<td width=\"30%\" colspan=\"6\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<input id='". $key0 ."' name='" . $key0 . "' value='" . $detallesOrden[$key][$key0] . "' data-dojo-type=\"dijit/form/ValidationTextBox\" style=\"width:100%\" required=\"false\" data-dojo-props=\"placeHolder:'Automático.'\"/> \n";
- $strOut .= "</td> \n";
- $cont1++;
- }else{
- $strOut .= "<td width=\"20%\" colspan=\"4\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<label class=\"noTopPadding\" for='". $key0 ."'>". $arrCampos[$key][$key0] ."</label> \n";
- $strOut .= "</td> \n";
- $strOut .= "<td width=\"35%\" colspan=\"7\" class=\"etiquetaFormulario\"> \n";
- $strOut .= "<input id='". $key0 ."' name='" . $key0 . "' value='" . $detallesOrden[$key][$key0] . "' data-dojo-type=\"dijit/form/ValidationTextBox\" style=\"width:100%\" required=\"false\" data-dojo-props=\"placeHolder:'Automático.'\"/> \n";
- $strOut .= "</td> \n";
- $strOut .= "</tr> \n";
- $cont1 = 0;
- }
- }
- $cont = 0;
- }
- }
- }
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="imagetoolbar" content="no" />
- <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Poppins:400,500,700,300,600">
- <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans">
- <link media="screen" rel="stylesheet" type="text/css" href="css/principal.css" />
- <!--<link media="screen" rel="stylesheet" type="text/css" href="css/pagination.css" />--> <!--Paginador-->
- <link rel="shortcut icon" type="image/x-icon" href="css/layout/global/sp.ico" />
- <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/dojo/1.14.1/dijit/themes/claro/claro.css">
- <script src="//ajax.googleapis.com/ajax/libs/dojo/1.14.1/dojo/dojo.js" data-dojo-config="async: true, parseOnLoad:true"></script>
- <script type="application/javascript">
- // Cargamos los complementos de dojo
- require(["dojo/dom", "dojo/_base/fx", "dojo/_base/array", "dojo/query", "dojo/dom-construct", "dijit/registry", "dojo/dom-style", "dojo/ready", "dojo/on", "dojo/window",
- "dojo/store/Memory", "dijit/form/FilteringSelect", "dijit/form/Button", "dojo/dom-class", "dijit/Dialog",
- "dojo/_base/lang", "dojox/grid/DataGrid", "dojo/data/ItemFileWriteStore", "dojox/grid/enhanced/plugins/DnD", "dojox/grid/EnhancedGrid", "dojox/grid/enhanced/plugins/Selector", "dojox/grid/enhanced/plugins/IndirectSelection", "dojox/grid/enhanced/plugins/NestedSorting",
- "dijit/ProgressBar", "dijit/ConfirmDialog", "dojo/dom-style", "dijit/form/ComboButton", "dijit/Menu", "dijit/MenuItem", "dijit/MenuSeparator", "dijit/Tooltip", "dijit/form/Form", "dijit/form/TextBox",
- "dojox/grid/enhanced/plugins/Filter", "dijit/form/ValidationTextBox", "dijit/form/NumberSpinner", "dojo/request", "dojo/parser"],
- function(dom, fx, array, query, domConstruct, dijit, style, ready, on, win,
- Memory, FilteringSelect, Button, domClass, Dialog,
- lang, DataGrid, ItemFileWriteStore, DnDConfig, EnhancedGrid, Selector, indirectSelection, nestedSorting,
- ProgressBar, ConfirmDialog, style, ComboButton, Menu, MenuItem, MenuSeparator, Tooltip, Form, TextBox, filter, ValidationTextBox, NumberSpinner, request) {
- const urlPeticiones = "plantillaEjemplo_DO.php";
- const idModulo = "<?php echo($strModulo);?>";
- // Para Mostrar de Mensajes de "error o éxito"
- var dgEjecuta = new Dialog({title: 'Procesando...', style: 'width:300px'});
- var pbMarcar = new ProgressBar({value: Number.POSITIVE_INFINITY, layoutAlign: 'left'});
- dgEjecuta.setContent(pbMarcar);
- dgResultadoError = new ConfirmDialog({ title:"<b>Error</b>", style: "min-width:300px; heigth; auto" });
- style.set(dgResultadoError.cancelButton.domNode, 'display', 'none');
- dgResultadoExito = new ConfirmDialog({ title:"<b>Éxito</b>", style: "min-width:300px; heigth; auto" });
- style.set(dgResultadoExito.cancelButton.domNode, 'display', 'none');
- /****************************************************************** Botones ******************************************************************/
- // Limpiar
- new Button({
- label: "Regresar",
- iconClass: "dijitEditorIcon dijitEditorIconUndo",
- showLabel: true,
- onClick: function() {
- window.parent.frames.app_modulo.location.href = '<?php echo $link; ?>';
- }
- }, "BTNCERRAR").startup();
- /****************************************************************** Acciones ******************************************************************/
- realizaAccion = function (accion){
- dgEjecuta.set("title", "Consultando...");
- dgEjecuta.show();
- request.post(urlPeticiones, {
- data: {
- accion: accion,
- idModulo: idModulo,
- dato1: "prueba"
- }
- }).then(
- function (response) {
- var objResponse = JSON.parse(response);
- if (objResponse['estatus'] == "ERROR") {
- dgEjecuta.hide();
- dgResultadoError.setContent(objResponse['errorDescripcion']);
- dgResultadoError.show();
- } else {
- let datosRecibidos = objResponse["datosRecibidos"];
- console.log(datosRecibidos);
- dgEjecuta.hide();
- }
- }
- );
- };
- ready(function() {
- // Actualizar el tamaño del TabContainer en función del tamaño de página
- var ventana = win.getBox();
- var strVentana = (ventana.h-75-100)+"px";
- style.set(dijit.byId("djTab").id, { height:strVentana });
- dijit.byId("djTab").resize();
- // Actualizar el tamaño del TabContainer en función del tamaño de página
- on(window, "resize", function() {
- var ventana = win.getBox();
- var strVentana = (ventana.h-75-100)+"px";
- style.set(dijit.byId("djTab").id, { height:strVentana });
- dijit.byId("djTab").resize();
- });
- // Eliminar la cortina de entrada
- fx.fadeOut({node: dom.byId("loadingOverlay"), duration: 1}).play();
- setTimeout(function () {
- domConstruct.destroy("loadingOverlay");
- }, 1);
- });
- });
- </script>
- </head>
- <body class="claro">
- <div id="loadingOverlay" class="loadingOverlay pageOverlay">
- <div class="loadingMessage">Espere...</div>
- </div>
- <div id="wrapper_container_module">
- <div id="wrapper_table" style="position:relative;">
- <div data-dojo-type="dijit/form/Form" id="frm" data-dojo-id="frm" encType="multipart/form-data"
- action="<?php echo($_SERVER['PHP_SELF']); ?>" method="post" style="position:relative;">
- <script type="dojo/on" data-dojo-event="submit">return true;</script>
- <div id="wrapper_table_head">Órden de Mantenimiento</div>
- <div id="wrapper_table_body_mod_app">
- <table width="100%" height="auto">
- <tr>
- <td width="100%" colspan="20" align="center">
- </tr>
- <tr>
- <td width="100%" colspan="20" align="center">
- <button id="BTNCERRAR" type="button"></button>
- </td>
- </tr>
- </table>
- <div id="djTab" data-dojo-type="dijit/layout/TabContainer" data-dojo-props="tabPosition:'top'" style="width:100%;">
- <div data-dojo-type="dijit/layout/ContentPane" title="Detalles" data-dojo-props="selected:true">
- <table width="100%" heifght="auto">
- <?php echo $strOut; ?>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
|