Advertisement
Guest User

Index.php

a guest
Nov 5th, 2012
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.32 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <link href="Site.css" rel="stylesheet" type="text/css" />
  4.     <link href="../themes/redmond/jquery-ui-1.8.23.custom.css" rel="stylesheet" type="text/css" />
  5.     <link href="../jt/themes/lightcolor/gray/jtable.css" rel="stylesheet" type="text/css" />
  6.    
  7.     <script src="../scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
  8.     <script src="../scripts/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
  9.     <script src="../jt/jquery.jtable.js" type="text/javascript"></script>
  10.    
  11.   </head>
  12.   <body>
  13.  
  14.     <div id="ClientTableContainer" style="width: 950px; " align="center"></div>
  15.     <script type="text/javascript">
  16.  
  17.         $(document).ready(function () {
  18.        
  19.                         var spanishMessages = {
  20.             serverCommunicationError: 'Error conectando al servidor',
  21.             loadingMessage: 'Cargando...',
  22.             noDataAvailable: 'Datos no disponibles!',
  23.             addNewRecord: '+ Nuevo registro',
  24.             editRecord: 'Editar',
  25.             areYouSure: '¿Está seguro?',
  26.             deleteConfirmation: 'Desea borrar los elementos seleccionados?',
  27.             save: 'Guardar',
  28.             saving: 'Guardando ...',
  29.             cancel: 'Cancelar',
  30.             deleteText: 'Borrar',
  31.             deleting: 'Borrando',
  32.             error: 'Error',
  33.             close: 'Cerrar',
  34.             cannotLoadOptionsFor: 'No se pueden cargar opciones para el campo {0} ',
  35.             pagingInfo: 'Mostrando de {0} a {1} de {2} registros',
  36.             canNotDeletedRecords: 'No se puede eliminar {0} de {1} registros!',
  37.             deleteProggress: 'Borrando {0} de {1} registros, procesando...'
  38.             };
  39.            
  40.             var spanishMessages2 = {
  41.             serverCommunicationError: 'Error conectando al servidor',
  42.             loadingMessage: 'Cargando...',
  43.             noDataAvailable: 'Datos no disponibles!',
  44.             addNewRecord: '+ Añadir producto',
  45.             editRecord: 'Editar',
  46.             areYouSure: '¿Está seguro?',
  47.             deleteConfirmation: 'Desea borrar los elementos seleccionados?',
  48.             save: 'Guardar',
  49.             saving: 'Guardando ...',
  50.             cancel: 'Cancelar',
  51.             deleteText: 'Borrar',
  52.             deleting: 'Borrando',
  53.             error: 'Error',
  54.             close: 'Cerrar',
  55.             cannotLoadOptionsFor: 'No se pueden cargar opciones para el campo {0} ',
  56.             pagingInfo: 'Mostrando de {0} a {1} de {2} registros',
  57.             canNotDeletedRecords: 'No se puede eliminar {0} de {1} registros!',
  58.             deleteProggress: 'Borrando {0} de {1} registros, procesando...'
  59.             };
  60.  
  61.             //Prepare jTable
  62.             $('#ClientTableContainer').jtable({
  63.                 title: 'Catalogo de Ventas  ',
  64.                 messages: spanishMessages,
  65.                 paging: true,
  66.                 pageSize: 1000,
  67.                 sorting: true,
  68.                 selecting: false, //Enable selecting
  69.             //  multiselect: true, //Allow multiple selecting
  70.             //  selectingCheckboxes: true, //Show checkboxes on first column
  71.             //  selectOnRowClick: false, //Enable this to only select using checkboxes
  72.                 defaultSorting: 'Fecha_Venta DESC',
  73.                 openChildAsAccordion: true,
  74.                 actions: {
  75.                     listAction: 'ventas_sql.php?action=list',
  76.                     createAction: 'ventas_sql.php?action=create',
  77.                     updateAction: 'ventas_sql.php?action=update',
  78.                     deleteAction: 'ventas_sql.php?action=delete'
  79.                 },
  80.                 fields: {
  81.                    
  82.                     //CHILD TABLE DEFINITION FOR "DATOS-CLIENTE"
  83.                     Datos: {
  84.                     title: '',
  85.                     messages: spanishMessages2,
  86.                     width: '5%',
  87.                     sorting: false,
  88.                     edit: false,
  89.                     create: false,
  90.                     display: function (clientData) {
  91.                         //Create an image that will be used to open child table
  92.                         var $img = $('<img src="note.png" title="Editar Venta" />');
  93.                         //Open child table when user clicks the image
  94.                         $img.click(function () {
  95.                             $('#ClientTableContainer').jtable('openChildTable',
  96.                                     $img.closest('tr'), //Parent row
  97.                                     {
  98.                                     title: 'Nº'+ clientData.record.ID_Venta + ' - Detalle de Venta',
  99.                                     messages: spanishMessages,
  100.                                     create: false,
  101.                                     actions: {
  102.                                     //  listAction: '/Demo/ExamList?StudentId=' + clientData.record.StudentId,
  103.                                     //  listAction: 'clientes_sql_list.php?ID=' + clientData.record.ID_Cliente,
  104.                                     listAction: 'ventas_sql_sub.php?action=list&ID=' + clientData.record.ID_Venta,
  105.                                     //listAction: 'clientes_sql_list.php',
  106.                                        
  107.                                         deleteAction: 'ventas_sql_sub.php?action=delete',
  108.                                     //    updateAction: 'ventas_sql_sub.php?action=update&ID=' + clientData.record.ID_Venta,
  109.                                         createAction: 'ventas_sql_sub.php?action=create&ID=' + clientData.record.ID_Venta,
  110.                                        
  111.                                     },
  112.                                     fields: {
  113.                                         ID_Venta: {
  114.                                             type: 'hidden',
  115.                                             defaultValue: clientData.record.ID_Venta
  116.                                         },
  117.                                         Cantidad: {
  118.                                         title: 'Cantidad',
  119.                                        
  120.                                         width: '1%'
  121.                                         },
  122.                                         Descripcion: {
  123.                                             title: 'Producto',
  124.                                             width: '10%',
  125.                                             create: false,
  126.                                             //edit: false,
  127.                                             //options: 'ventas_sql_sub.php?action=dropdown_producto',
  128.  
  129.                                         },
  130.                                         DD_Producto: {
  131.                                            
  132.                                             list: false,
  133.                                             edit: false,
  134.                                             title: 'Producto',
  135.                                             width: '10%',
  136.                                             options: 'ventas_sql_sub.php?action=dropdown_producto',
  137.                                         },
  138.                                         IDT: {
  139.                                             type: 'hidden',
  140.                                             key: true,
  141.                                            
  142.                                         },
  143.                                         Impuesto: {
  144.                                             title: 'Impuesto',
  145.                                         //  width: '10%',
  146.                                            
  147.  
  148.                                         },
  149.                                         Descuento: {
  150.                                             title: 'Descuento',
  151.                                         //  width: '10%',
  152.                                            
  153.  
  154.                                         },
  155.                                         Precio_Venta: {
  156.                                             title: 'Precio de Venta',
  157.                                         //  width: '10%',
  158.  
  159.                                         },
  160.                                         Subtotal: {
  161.                                             title: 'Subtotal',
  162.                                             create: false,
  163.                                             edit: false,
  164.                                         //  width: '10%',
  165.  
  166.                                         },
  167.                                        
  168.                                     }
  169.                                 }, function (data) { //opened handler
  170.                                     data.childTable.jtable('load');
  171.                                 });
  172.                         });
  173.                         //Return image to show on the person row
  174.                         return $img;
  175.                     }
  176.                 },
  177.                     ID_Venta: {
  178.                         key: true,
  179.                         create: false,
  180.                         edit: true,
  181.                         title: 'ID',
  182.                         width: '4%',
  183.                         //list: false
  184.                     },
  185.                    
  186.                     Nombre: {
  187.                         title: 'Cliente',
  188.                         width: '25%',
  189.                         create: false,
  190.                         edit: false,
  191.                         //options: 'ventas_sql_sub.php?action=dropdown_cliente',
  192.                     },
  193.                    
  194.                     DD_Cliente: {
  195.                                            
  196.                         list: false,
  197.                         title: 'Cliente',
  198.                         width: '10%',
  199.                         options: 'ventas_sql.php?action=dropdown_cliente',
  200.                     },
  201.                    
  202.                    
  203.                     Fecha_Venta: {
  204.                         title: 'Fecha de Venta',
  205.                         width: '12%',
  206.                         type: 'date',
  207.                         displayFormat: 'yy-mm-dd'
  208.                     //  sorting: false,
  209.                    
  210.                        
  211.  
  212.                     },
  213.                     Nombre_Moneda: {
  214.                         title: 'Moneda',
  215.                         width: '10%',
  216.                         sorting: false,
  217.                         create: false,
  218.                         edit: false,
  219.                         //options: 'ventas_sql.php?action=dropdown_moneda',
  220.                         //defaultValue: 'ventas_sql.php?action=list'
  221.  
  222.                     },
  223.                    
  224.                     DD_Moneda: {
  225.                                            
  226.                         list: false,
  227.                         title: 'Moneda',
  228.                         width: '10%',
  229.                         options: 'ventas_sql.php?action=dropdown_moneda',
  230.                     },
  231.                     Precio_Total: {
  232.                         title: 'Importe Total',
  233.                         width: '15%',
  234.                         sorting: true,
  235.                         create: false,
  236.                         edit: false,
  237.                         //options: 'ventas_sql.php?action=dropdown_moneda',
  238.                         //defaultValue: 'ventas_sql.php?action=list'
  239.  
  240.                     }
  241.                 }
  242.             });
  243.  
  244.             //Load person list from server
  245.             $('#ClientTableContainer').jtable('load');
  246.  
  247.         });
  248.  
  249.     </script>
  250.    
  251.  
  252.   </body>
  253. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement