PageRenderTime 32ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Sistem Informasi Sekolah Online - Server/soap_sis_entry_siswa_spp.php

http://sistem-informasi-sekolah-online.googlecode.com/
PHP | 159 lines | 106 code | 24 blank | 29 comment | 4 complexity | 1cc162336229e518321a512cf39dcc2a MD5 | raw file
  1. <?php
  2. /**
  3. * Ini adalah project open source yang dikembangkan oleh Impossible Team
  4. *
  5. * Copyright (c) 2011 ekoindri. <ekoindri@ekoindri.com>
  6. *
  7. * Versi: 1.2
  8. * Developed by: Impossible Team
  9. * Leader: Eko Indriyawan
  10. *
  11. * This library is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU Lesser General Public
  13. * License as published by the Free Software Foundation; either
  14. * version 2.1 of the License, or (at your option) any later version.
  15. *
  16. * This library is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * Lesser General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Lesser General Public
  22. * License along with this library; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  24. * USA
  25. *
  26. */
  27. require_once("rpcl/rpcl.inc.php");
  28. require_once("soap_sis_common.php");
  29. require_once("soap_sis_common_input.php");
  30. //Includes
  31. use_unit("webservices.inc.php");
  32. use_unit("forms.inc.php");
  33. use_unit("extctrls.inc.php");
  34. use_unit("stdctrls.inc.php");
  35. function DATA_SISWA(
  36. $connection_string){
  37. mysql_connect($connection_string[server_host], $connection_string[server_username], $connection_string[server_password]);
  38. mysql_select_db($connection_string[server_database]) or die(mysql_error());
  39. $sql = "
  40. SELECT ID,
  41. SISWA_KODE,
  42. SISWA_NAMA_AWAL,
  43. SISWA_NAMA_TENGAH,
  44. SISWA_NAMA_AKHIR
  45. FROM TABEL_SISWA
  46. ORDER BY SISWA_NAMA_AWAL ASC
  47. ";
  48. $result = mysql_query($sql);
  49. $numrows = mysql_num_rows($result);
  50. $siswalist = array();
  51. for($x = 0; $x < $numrows; $x++){
  52. $siswalist[] = mysql_fetch_array($result);
  53. }
  54. mysql_close();
  55. return array('Berhasil', $siswalist);
  56. }
  57. function SISWA_SIMPAN_SPP_DATASET($connection_string, $daftarspp){
  58. mysql_connect($connection_string[server_host], $connection_string[server_username], $connection_string[server_password]);
  59. mysql_select_db($connection_string[server_database]) or die(mysql_error());
  60. for($x = 0; $x < 100; $x++){
  61. $spp = $daftarspp[$x];
  62. if($spp[SISWA_ID] != '') {
  63. $query = "
  64. INSERT INTO TABEL_SISWA_SPP
  65. (
  66. SISWA_ID,
  67. SPP_TGL,
  68. SPP_NILAI,
  69. SPP_KETERANGAN
  70. )
  71. VALUES
  72. (
  73. '" . $spp[SISWA_ID] . "',
  74. '" . $spp[SPP_TGL] . "',
  75. '" . $spp[SPP_NILAI] . "',
  76. '" . $spp[SPP_KETERANGAN] . "'
  77. )
  78. ";
  79. $result = mysql_query($query);
  80. $query = "
  81. INSERT INTO TABEL_JURNAL
  82. (
  83. SUBJECT_ID,
  84. JURNAL_SUMBER,
  85. JURNAL_TGL,
  86. JURNAL_DEBIT,
  87. JURNAL_KETERANGAN
  88. )
  89. VALUES
  90. (
  91. '" . $spp[SISWA_ID] . "',
  92. 'UANG SPP',
  93. '" . $spp[SPP_TGL] . "',
  94. '" . $spp[SPP_NILAI] . "',
  95. '" . $spp[SPP_KETERANGAN] . "'
  96. )
  97. ";
  98. $result = mysql_query($query);
  99. }
  100. }
  101. }
  102. //Class definition
  103. class DM_ENTRY_SISWA_SPP extends DataModule{
  104. public $SIS_ENTRY_SISWA_SPP = null;
  105. function SIS_ENTRY_SISWA_SPPAddComplexTypes($sender, $params){
  106. RegisterCommonComplexType_InfoServer($this->$SIS_ENTRY_SISWA_SPP);
  107. RegisterCommonComplexType_InfoSiswa_Combo($this->$SIS_ENTRY_SISWA_SPP);
  108. RegisterCommonComplexType_DataSPPInput($this->$SIS_ENTRY_SISWA_SPP);
  109. }
  110. function SIS_ENTRY_SISWA_SPPRegisterServices($sender, $params){
  111. $this->$SIS_ENTRY_SISWA_SPP->register(
  112. "DATA_SISWA",
  113. array(
  114. 'connection_string'=>'tns:TInfoServer'),
  115. array('return'=>'xsd:string',
  116. 'siswalist'=>'tns:TInfoDaftarSiswa')
  117. );
  118. $this->$SIS_ENTRY_SISWA_SPP->register
  119. (
  120. "SISWA_SIMPAN_SPP_DATASET",
  121. array(
  122. 'connection_string'=>'tns:TInfoServer',
  123. 'daftarspp'=>'tns:TDataSPPInput'),
  124. array('return'=>'xsd:string'),
  125. 'http://localhost/'
  126. );
  127. }
  128. }
  129. global $application;
  130. global $DM_ENTRY_SISWA_SPP;
  131. //Creates the form
  132. $DM_ENTRY_SISWA_SPP = new DM_ENTRY_SISWA_SPP($application);
  133. //Read from resource file
  134. $DM_ENTRY_SISWA_SPP->loadResource(__FILE__);
  135. ?>