control.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <button onclick="getExcel()">
  2. Get excel
  3. </button>
  4. <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
  5. <script>
  6. async function getExcel() {
  7. const res = await fetch('supervisor_excel.php', {
  8. method: 'POST',
  9. headers: {
  10. 'Content-Type': 'application/json'
  11. },
  12. body: JSON.stringify([
  13. {
  14. "profesor_id": 1089,
  15. "estado_supervisor_id": 1,
  16. "horario_id": 3538,
  17. "registro_id": 1,
  18. "registro_fecha": null,
  19. "registro_retardo": null,
  20. "registro_justificada": null,
  21. "registro_fecha_ideal": "2023-08-03",
  22. "comentario": "Hola mundo",
  23. "registro_fecha_supervisor": "2023-08-03 12:21:38.336147",
  24. "supervisor_id": 6,
  25. "justificacion": null,
  26. "fecha_justificacion": null,
  27. "horario_hora": "12:00:00",
  28. "horario_fin": "13:30:00",
  29. "horario_grupo": "MG 45030102",
  30. "horario_dia": 4,
  31. "dia": "jueves",
  32. "duracion_id": 2,
  33. "duracion": "01:30:00",
  34. "carrera_id": 439,
  35. "carrera": "LICENCIATURA EN INGENIERÍA ELECTRÓNICA PARA SISTEMAS INTELIGENTES",
  36. "facultad_id": 28,
  37. "facultad": "FACULTAD DE INGENIERÍA",
  38. "periodo_id": null,
  39. "periodo": "LICENCIATURA: agosto - noviembre 2023",
  40. "materia_id": 191,
  41. "materia": "Dinámica",
  42. "nivel_id": 1,
  43. "nivel": "Licenciatura",
  44. "salon_id": 1245,
  45. "salon": "ING MM 208",
  46. "nombre": "Asistencia",
  47. "estado_color": "success",
  48. "estado_icon": "ing-autorizar",
  49. "profesor_nombre": "ISRAEL WOOD CANO",
  50. "profesor_clave": "008999",
  51. "profesor_correo": "israel.wood@lasallistas.org.mx",
  52. "profesor_grado": null,
  53. "usuario_id": 6,
  54. "usuario_nombre": "Francisco Javier Garrido Alfaro",
  55. "usuario_correo": null,
  56. "usuario_admin": false,
  57. "usuario_clave": "ad011538",
  58. "rol_id": 7
  59. }
  60. ])
  61. });
  62. const blob = await res.blob();
  63. saveAs(blob, 'excel.xlsx');
  64. }
  65. </script>