Scroll to top

Haloo! Selamat Datang di Komunitas Private Training Web Development (31483 Members, 264 Projects, 2731 Topic, 7539 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time) untuk mengerjakan project/aplikasi anda?, cari disini : Members Area Jobs!
Mohon suhu cara untuk koneksikan ke database belum bisa
Nian Dwi Christianto SW Mengatakan : Members -
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2. berikut syntax dan gambar inputan data yang tertera di bawah ini :
  3.  
  4. kegiatan_insert.php
  5.  
  6. <?php
  7. include'../koneksi.php';
  8. if (isset($_POST['simpan'])){
  9. $noreg_simper = $_POST[ra]."-".$_POST[rb]."-".$_POST[rc]."-".$_POST[rd];
  10. $tgl_pengajuan = $_POST[ta]."-".$_POST[tb]."-".$_POST[tc];
  11. $masa_simper = $_POST[td]."-".$_POST[te]."-".$_POST[tf];
  12. mysql_query("INSERT INTO data_karyawan VALUES('$noreg_simper','$_POST[nik]','$_POST[nama]','$tgl_pengajuan', '$masasimper','$_POST[jabatan]','$_POST[departemen]')");
  13. $nik = mysql_insert_id();
  14. echo "<script>document.location='index.php?view=kegiatan&act=edit&nik=".$nik."';</script>";
  15. }
  16. ?>
  17. <?php
  18. $data = mysql_query("select * from data_karyawan order by nik DESC LIMIT 0,1");
  19. $i= mysql_fetch_array($data) ;
  20. // ID OTOMATIS//***************************************************
  21. $kodeawal=substr($i['nomor'],3,4);
  22. if($kodeawal<10){
  23. $kode='005'.$kodeawal;
  24. }elseif($kodeawal > 9 && $kodeawal <=99){
  25. $kode='1100'.$kodeawal;
  26. }else{
  27. $kode='11000'.$kodeawal;
  28. }
  29. ?>
  30.  
  31. <form action='' class="form-horizontal" method="POST" data-validate="parsley" enctype='multipart/form-data'>
  32. <h4 style='padding-top:15px'>Tambah Data Karyawan</h4>
  33. <!-- Basic Data Tables Example -->
  34. <div class="col-md-12">
  35. <div class="panel panel-default">
  36. <div class="panel-heading">
  37. <strong></strong>
  38. <br>
  39. </div>
  40. <div class="panel-body">
  41. <div class="form-group"><b>                     <i>No. Reg Simper :</i></b>
  42.  
  43. <input type="text" name="ra" value="<?php echo $kode ;?>" size="8" maxlength="4"/>
  44. <strong>/</strong><strong>
  45. <input type="text" name="rb" readonly value="BUMA-BMO" size="8" maxlength="8"/>
  46. /</strong>
  47. <input type="text" name="rc" size="4" value="<?php
  48. $array_bulan = array(1=>"I","II","III", "IV", "V","VI","VII","VIII","IX","X", "XI","XII");
  49. $bulan = $array_bulan[date('n')];
  50.  
  51. echo "$bulan";
  52. ?>"maxlength="4"/>
  53. <strong>/</strong>
  54. <input type="text" name="rd" value="<?php
  55. $tahun_sekarang = date('Y');
  56. $tahun = substr($tahun_sekarang, -2);
  57.  
  58. echo "$tahun";
  59. ?>"size="4" maxlength="2"/>
  60. </div>
  61.  
  62. </div>
  63.  
  64. <div class="form-group">
  65. <label class="col-lg-2 control-label">NIK : </label>
  66. <div class="col-lg-3">
  67. <input type="text" name="nik" placeholder="" class="bg-focus form-control" data-required="true"><span id="pesan"></span>
  68. </div>
  69. </div>
  70.  
  71. <div class="form-group">
  72. <label class="col-lg-2 control-label">Nama : </label>
  73. <div class="col-lg-3">
  74. <input type="text" name="nama" placeholder="" class="bg-focus form-control">
  75. </div>
  76. </div>
  77.  
  78. <div class="form-group">
  79. <div class="col-lg-2"></div>
  80. </div>
  81.  
  82. <div class="form-group">
  83. <div class="col-lg-8"></div>
  84. </div>
  85.  
  86. <div class="form-group">
  87. <label class="col-lg-2 control-label">Tanggal Pengajuan :</label>
  88. <div class="col-lg-8">
  89. <span class="combodate">
  90. <select name='ta' class="day form-control" style="width: auto;">
  91. <?php
  92. echo "<option value='".date("d")."' selected>".date("d")."</option>";
  93. for($n=1; $n<=31; $n++){
  94. echo "<option value='$n'>$n</option>";
  95. }
  96. ?>
  97. </select>  
  98. <select name='tb' class="month form-control" style="width: auto;"><option value=""></option>
  99. <?php
  100. $bln = array('','Januari','Februari','Maret','April','Mei','Juni','Juli','Agustus','September','Oktober','November','Desember');
  101. echo "<option value='".date("n")."' selected>".$bln[date("n")]."</option>";
  102. for($n=2; $n<=12; $n++){
  103. echo "<option value='$n'>$bln[$n]</option>";
  104. }
  105. ?>
  106. </select>  
  107. <select name='tc' class="year form-control" style="width: auto;">
  108. <?php
  109. echo "<option value='".date("Y")."' selected>".date("Y")."</option>";
  110. for($n=2015; $n<=date("Y"); $n++){
  111. echo "<option value='$n'>$n</option>";
  112. }
  113. ?>
  114. </select>
  115. </span>
  116. </div>
  117. </div>
  118.  
  119. <div class="form-group">
  120. <label class="col-lg-2 control-label">Masa Simper :</label>
  121.  
  122. <div class="col-lg-8">
  123. <span class="combodate">
  124. <select name='td' class="day form-control" style="width: auto;">
  125. <?php
  126. echo "<option value='".date("d")."' selected>".date("d")."</option>";
  127. for($n=1; $n<=31; $n++){
  128. echo "<option value='$n'>$n</option>";
  129. }
  130. ?>
  131. </select>  
  132. <select name='te' class="month form-control" style="width: auto;"><option value=""></option>
  133. <?php
  134. $bln = array('','Januari','Februari','Maret','April','Mei','Juni','Juli','Agustus','September','Oktober','November','Desember');
  135. echo "<option value='".date("n")."' selected>".$bln[date("n")]."</option>";
  136. for($n=1; $n<=12; $n++){
  137. echo "<option value='$n'>$bln[$n]</option>";
  138. }
  139. ?>
  140. </select>  
  141. <select name='tf' class="year form-control" style="width: auto;">
  142. <?php
  143. echo "<option value='".date("Y")."' selected>".date("Y")."</option>";
  144. for($n=2013; $n<=date("Y"); $n++){
  145. echo "<option value='$n'>$n</option>";
  146. }
  147. ?>
  148. </select>
  149. </span>
  150. </div>
  151.  
  152. <div class="form-group">
  153. <div class="col-lg-8"></div>
  154. </div>
  155.  
  156.  
  157. <div class="form-group">
  158. <label class="col-lg-2 control-label">Jabatan : </label>
  159. <div class="col-lg-5">
  160. <select class="form-control" name="jabatan" type="text" id="jabatan">
  161. <option value="">-SILAHKAN PILIH-</option>
  162. <?php
  163.  
  164. //mengambil nama-nama departemen yang ada di database
  165. $function= mysql_query("SELECT * FROM departemen ORDER BY position");
  166. while($p=mysql_fetch_array($function)){
  167. echo "<option value=\"$p[id]\">$p[position]</option>\n";
  168. }
  169. ?>
  170.  
  171. </select>
  172. </div>
  173. </div>
  174.  
  175. <div class="form-group">
  176. <p>
  177. <label class="col-lg-2 control-label">Departemen : </label>
  178. <div class="col-lg-5">
  179. <select class="form-control" name="departemen" type="text" id="departemen">
  180. <option value="">-SILAHKAN PILIH-</option>
  181. <?php
  182.  
  183. //mengambil nama-nama departemen yang ada di database
  184. $function= mysql_query("SELECT * FROM function ORDER BY function");
  185. while($p=mysql_fetch_array($function)){
  186. echo "<option value=\"$p[id]\">$p[function]</option>\n";
  187. }
  188. ?>
  189. </select>
  190. </div>
  191. </p>
  192. </div>
  193. </select>
  194. <div class="form-group">
  195. </p>
  196. <p>
  197. <label class="col-lg-2 control-label">Foto KTP : </label>
  198. </p>
  199. <div class="col-lg-5"><form action="upload_file.php" method="post" enctype="multipart/form-data">
  200. <input type="file" name="file" size="50" />
  201. <br />
  202. <input type="submit" value="Upload" />
  203. </form>
  204.  
  205. </p>
  206. </div>
  207. </select>
  208. <div class="form-group">
  209. </p>
  210. <p>
  211. </p>
  212. </div>
  213. <label class="col-lg-2 control-label">Upload Simper 2 : </label>
  214. </p>
  215. <div class="col-lg-5"><form action="upload_file.php" method="post" enctype="multipart/form-data">
  216. <input type="file" name="file" size="50" />
  217. <br />
  218. <input type="submit" value="Upload" />
  219. </form>
  220.  
  221. </p>
  222. </div>
  223. </select>
  224. <div class="form-group">
  225. </p>
  226. </div>
  227.  
  228. <label class="col-lg-2 control-label">Upload Simper 3 : </label>
  229. <div class="col-lg-5"><form action="upload_file.php" method="post" enctype="multipart/form-data">
  230. <input type="file" name="file" size="50" />
  231. <br />
  232. <input type="submit" value="Upload" />
  233. </form>
  234.  
  235. </p>
  236. </div>
  237. </select>
  238. <div class="form-group">
  239. </p>
  240. </div>
  241. <label class="col-lg-2 control-label">Upload Simper 4 : </label>
  242. <div class="col-lg-5"><form action="upload_file.php" method="post" enctype="multipart/form-data">
  243. <input type="file" name="file" size="50" />
  244. <br />
  245. <input type="submit" value="Upload" />
  246. </form>
  247.  
  248. </p>
  249. </div>
  250. </select>
  251. <div class="form-group">
  252. </p>
  253. </div>
  254. <label class="col-lg-2 control-label">Upload Simper 5 : </label>
  255. </p>
  256. <div class="col-lg-5"><form action="upload_file.php" method="post" enctype="multipart/form-data">
  257. <input type="file" name="file" size="50" />
  258. <br />
  259. <input type="submit" value="Upload" />
  260. </form>
  261.  
  262.  
  263. <br><br>
  264. </div>
  265. </p>
  266. </div>
  267.  
  268. <div class="form-group">
  269. <div class="col-lg-10 pull-right">
  270. <button type="submit" name='simpan' class="btn btn-info">Simpan Data</button>
  271. <button type="reset" class="btn btn-default">Reset</button>
  272.  
  273. </div>
  274. </div>
  275. </div>
  276.  
  277. <footer id="footer">
  278. <div class="text-center clearfix">
  279. <p><small>&copy 2018 - Developed by IT Binsua </small>
  280. <br />
  281. </div>
  282. </footer>
  283.  
  284. <p>
  285. </p>
  286. </div>
  287.  
  288. </div>
  289. </form>
  290.  
  291. <?php
  292. if (isset($_POST['simpan'])){
  293. mysql_query("INSERT INTO data_karyawan VALUES('$noreg_simper','$_POST[nik]','$_POST[nama]','tgl_pengajuan',
  294. '$masa_simper','$_POST[jabatan]','$_POST[departemen]')");
  295. echo "<script>document.location='index.php?view=kegiatan&act=edit&nik=".$_POST['nik']."';</script>";
  296. }
  297.  
  298. if (isset($_GET[deletedasar])){
  299. mysql_query("DELETE FROM phpmu_dasar where id_dasar='$_GET[deletedasar]'");
  300. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_GET[id]."';</script>";
  301. }
  302.  
  303. if (isset($_POST[simpanpelaksana])){
  304. mysql_query("INSERT INTO phpmu_pelaksana VALUES('','$_POST[a]','$_POST[id]','$_POST[b]')");
  305. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_POST[id]."';</script>";
  306. }
  307.  
  308. if (isset($_GET[deletepelaksana])){
  309. mysql_query("DELETE FROM phpmu_pelaksana where id_pelaksana='$_GET[deletepelaksana]'");
  310. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_GET[id]."';</script>";
  311. }
  312.  
  313. if (isset($_POST[simpan])){
  314. mysql_query("INSERT INTO phpmu_biaya VALUES('','$_POST[id]','$_POST[a]','$_POST[b]','$_POST[c]')");
  315. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_POST[id]."';</script>";
  316. }
  317.  
  318. if (isset($_GET[deletebiaya])){
  319. mysql_query("DELETE FROM phpmu_biaya where id_biaya='$_GET[deletebiaya]'");
  320. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_GET[id]."';</script>";
  321. }
  322.  
  323. if (isset($_POST[simpanpengikut])){
  324. mysql_query("INSERT INTO phpmu_pengikut VALUES('','$_POST[a]','$_POST[b]','$_POST[c]','$_POST[d]')");
  325. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_POST[id]."';</script>";
  326. }
  327.  
  328. if (isset($_GET[deletepengikut])){
  329. mysql_query("DELETE FROM phpmu_pengikut where id_pengikut='$_GET[deletepengikut]'");
  330. echo "<script>document.location='index.php?view=kegiatan&act=edit&id=".$_GET[id]."';</script>";
  331. }
  332. ?>
  333.  
  334. <div class="modal fade" id="tambahdasar" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  335. <div class="modal-dialog" role="document">
  336. <div class="modal-content">
  337. <div style='margin:0px; padding-top:0px' class="modal-header">
  338. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  339. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Dasar</h4>
  340. </div>
  341. <div class="modal-body">
  342. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  343. <div class="form-group">
  344. <label class="col-sm-3 control-label">Keterangan</label>
  345. <div class="col-sm-8">
  346. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  347. <textarea rows='10' class="form-control" name="a" required></textarea>
  348. </div>
  349. </div>
  350.  
  351. </div>
  352. <div style='clear:both' class="modal-footer">
  353. <button type="submit" name='simpandasar' class="btn btn-info btn-sm">Tambahkan</button>
  354. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  355. </div>
  356. </form>
  357. </div>
  358. </div>
  359. </div>
  360.  
  361. <div class="modal fade" id="tambahpelaksana" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  362. <div class="modal-dialog" role="document">
  363. <div class="modal-content">
  364. <div style='margin:0px; padding-top:0px' class="modal-header">
  365. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  366. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Pelaksana</h4>
  367. </div>
  368. <div class="modal-body">
  369. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  370.  
  371. <div class="form-group">
  372. <label class="col-sm-3 control-label">Pelaksana</label>
  373. <div class="col-sm-8">
  374. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  375. <select class="form-control" name="a">
  376. <option value='0'>- Pilih -</option>
  377. <?php
  378. $pelaksana = mysql_query("SELECT * FROM phpmu_karyawan ORDER BY nama_karyawan");
  379. while ($p = mysql_fetch_array($pelaksana)){
  380. echo "<option value='$p[id_karyawan]'> $p[nip_karyawan] - $p[nama_karyawan]</option>";
  381. }
  382. ?>
  383. </select>
  384. </div>
  385. </div>
  386.  
  387. <div class="form-group">
  388. <label class="col-sm-3 control-label">Keterangan</label>
  389. <div class="col-sm-8">
  390. <textarea rows='10' class="form-control" name="b" required></textarea>
  391. </div>
  392. </div>
  393.  
  394. </div>
  395. <div style='clear:both' class="modal-footer">
  396. <button type="submit" name='simpanpelaksana' class="btn btn-info btn-sm">Tambahkan</button>
  397. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  398. </div>
  399. </form>
  400. </div>
  401. </div>
  402. </div>
  403.  
  404. <div class="modal fade" id="tambahbiaya" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  405. <div class="modal-dialog" role="document">
  406. <div class="modal-content">
  407. <div style='margin:0px; padding-top:0px' class="modal-header">
  408. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  409. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Biaya</h4>
  410. </div>
  411. <div class="modal-body">
  412. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  413.  
  414. <div class="form-group">
  415. <label class="col-sm-3 control-label">Rincan Biaya</label>
  416. <div class="col-sm-8">
  417. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  418. <input type="text" class="form-control" name="a">
  419. </div>
  420. </div>
  421.  
  422. <div class="form-group">
  423. <label class="col-sm-3 control-label">Jumlah</label>
  424. <div class="col-sm-4">
  425. <input type="text" class="form-control" name="b">
  426. </div>
  427. </div>
  428.  
  429. <div class="form-group">
  430. <label class="col-sm-3 control-label">Keterangan</label>
  431. <div class="col-sm-8">
  432. <textarea rows='5' class="form-control" name="c" required></textarea>
  433. </div>
  434. </div>
  435.  
  436. </div>
  437. <div style='clear:both' class="modal-footer">
  438. <button type="submit" name='simpanbiaya' class="btn btn-info btn-sm">Tambahkan</button>
  439. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  440. </div>
  441. </form>
  442. </div>
  443. </div>
  444. </div>
  445.  
  446.  
  447. <div class="modal fade" id="tambahpengikut" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  448. <div class="modal-dialog" role="document">
  449. <div class="modal-content">
  450. <div style='margin:0px; padding-top:0px' class="modal-header">
  451. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  452. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Pengikut</h4>
  453. </div>
  454. <div class="modal-body">
  455. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  456.  
  457. <div class="form-group">
  458. <label class="col-sm-3 control-label">Dari Karyawan</label>
  459. <div class="col-sm-8">
  460. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  461. <input type='hidden' id='bookId' name='a'>
  462. <select class="form-control" name="b">
  463. <option value='0'>- Pilih -</option>
  464. <?php
  465. $pelaksana = mysql_query("SELECT * FROM phpmu_karyawan ORDER BY nama_karyawan");
  466. while ($p = mysql_fetch_array($pelaksana)){
  467. echo "<option value='$p[id_karyawan]'> $p[nip_karyawan] - $p[nama_karyawan]</option>";
  468. }
  469. ?>
  470. </select>
  471. </div>
  472. </div>
  473.  
  474. <div class="form-group">
  475. <label class="col-sm-3 control-label">Nama Pengikut</label>
  476. <div class="col-sm-8">
  477. <input type="text" class="form-control" name="c" placeholder='Tulis Nama Pengikut, Jika Bukan dari Karyawan...'>
  478. </div>
  479. </div>
  480.  
  481. <div class="form-group">
  482. <label class="col-sm-3 control-label">Keterangan</label>
  483. <div class="col-sm-8">
  484. <textarea rows='5' class="form-control" name="d"></textarea>
  485. </div>
  486. </div>
  487.  
  488. </div>
  489. <div style='clear:both' class="modal-footer">
  490. <button type="submit" name='simpanpengikut' class="btn btn-info btn-sm">Tambahkan</button>
  491. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  492. </div>
  493. </form>
  494. </div>
  495. </div>
  496. </div>
Ada 1 File Kiriman :
1. gambar_form_input.JPG (39 KB)
Nian Dwi Christianto SW Mengatakan :
Members -
  1. Assalam,..
  2.  
  3. Ini sambungan gambar untuk menyesuaikan dengan database.
  4.  

Ada 1 File Kiriman :
1. database_mysql.JPG (134 KB)
Robby Prihandaya Mengatakan :
Admin -
  1. Assalam,.. itu masalahnya bukan koneksi ke database mas,..
  2. tapi query insertnya salah, jika menggunakan query insert seperti ini :
  3. mysql_query("INSERT INTO data_karyawan VALUES('$noreg_simper','$_POST[nik]','$_POST[nama]','$tgl_pengajuan', '$masasimper','$_POST[jabatan]','$_POST[departemen]')");
  4.  
  5. maka jumlah values harus sama dengan jumlah kolom/field di database table data_karyawan,
  6. jika tidak maka data tidak akan bisa masuk ke table data karyawan..
  7. harusnya jumlahnya gini :
  8. mysql_query("INSERT INTO data_karyawan VALUES('$noreg_simper','$_POST[nik]','$_POST[nama]','$tgl_pengajuan','$masasimper','0000-00-00','$_POST[jabatan]','$_POST[departemen]','','','','','')");

Nian Dwi Christianto SW Mengatakan :
Members -
  1. Assalam,..
  2. Sudah di coba namun tampilan tahun, jabatan, dan departemen masih salah.
  3. Mohon bantuan mas robby

Ada 1 File Kiriman :
1. hasil_dari_inputan_data.JPG (34 KB)
Robby Prihandaya Mengatakan :
Admin -
  1. Assalam,.. berarti insert data sudah berhasil..
  2. pertanyaan di atas sudah terjawab ya mas, sekarang pertanyaan barunya :
  3. tahun, jabatan, dan departemen masih salah?
  4.  
  5. sebenarnya tidak salah, harusnya data yang masuk memang id_departemen dan id_jabatan
  6. jadi ada relasi antar table data karyawan, departemen dan jabatan seharusnya.
  7. pahami dulu normalisasi database, modulnya ada kita share, cari disini : https://members.phpmu.com/files
  8.  
  9. tapi jika memang mau insert text/nama jabatan dan departemen langsung ke data_karyawan
  10. bisa ubah script berikut pada inputan/combobox departemen dan jabatan dari :
  11. echo "<option value=\"$p[id]\">$p[position]</option>\n";
  12. echo "<option value=\"$p[id]\">$p[function]</option>\n";
  13.  
  14. menjadi seperti ini :
  15. echo "<option value=\"$p[position]\">$p[position]</option>\n";
  16. echo "<option value=\"$p[function]\">$p[function]</option>\n";

Nian Dwi Christianto SW Mengatakan :
Members -
  1. Assalam,..
  2.  
  3. Tombol simpan data masih kendala mas Robby,
  4. bisa tolong bantu ya?
  5.  
  6. </div>
  7. <div style='clear:both' class="modal-footer">
  8. <button type="submit" name='simpanpelaksana' class="btn btn-info btn-sm">Tambahkan</button>
  9. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  10. </div>
  11. </form>
  12. </div>
  13. </div>
  14. </div>
  15.  
  16. <div class="modal fade" id="tambahbiaya" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  17. <div class="modal-dialog" role="document">
  18. <div class="modal-content">
  19. <div style='margin:0px; padding-top:0px' class="modal-header">
  20. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  21. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Biaya</h4>
  22. </div>
  23. <div class="modal-body">
  24. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  25.  
  26. <div class="form-group">
  27. <label class="col-sm-3 control-label">Rincan Biaya</label>
  28. <div class="col-sm-8">
  29. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  30. <input type="text" class="form-control" name="a">
  31. </div>
  32. </div>
  33.  
  34. <div class="form-group">
  35. <label class="col-sm-3 control-label">Jumlah</label>
  36. <div class="col-sm-4">
  37. <input type="text" class="form-control" name="b">
  38. </div>
  39. </div>
  40.  
  41. <div class="form-group">
  42. <label class="col-sm-3 control-label">Keterangan</label>
  43. <div class="col-sm-8">
  44. <textarea rows='5' class="form-control" name="c" required></textarea>
  45. </div>
  46. </div>
  47.  
  48. </div>
  49. <div style='clear:both' class="modal-footer">
  50. <button type="submit" name='simpanbiaya' class="btn btn-info btn-sm">Tambahkan</button>
  51. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. </div>
  57.  
  58.  
  59. <div class="modal fade" id="tambahpengikut" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  60. <div class="modal-dialog" role="document">
  61. <div class="modal-content">
  62. <div style='margin:0px; padding-top:0px' class="modal-header">
  63. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  64. <h4 class="modal-title" id="myModalLabel">Tambahkan Data Pengikut</h4>
  65. </div>
  66. <div class="modal-body">
  67. <form class="form-horizontal" action="index.php?view=kegiatan&act=edit&id=<?php echo $_GET[id]; ?>" method='POST'>
  68.  
  69. <div class="form-group">
  70. <label class="col-sm-3 control-label">Dari Karyawan</label>
  71. <div class="col-sm-8">
  72. <input type='hidden' value='<?php echo $_GET[id]; ?>' name='id'>
  73. <input type='hidden' id='bookId' name='a'>
  74. <select class="form-control" name="b">
  75. <option value='0'>- Pilih -</option>
  76. <?php
  77. $pelaksana = mysql_query("SELECT * FROM phpmu_karyawan ORDER BY nama_karyawan");
  78. while ($p = mysql_fetch_array($pelaksana)){
  79. echo "<option value='$p[id_karyawan]'> $p[nip_karyawan] - $p[nama_karyawan]</option>";
  80. }
  81. ?>
  82. </select>
  83. </div>
  84. </div>
  85.  
  86. <div class="form-group">
  87. <label class="col-sm-3 control-label">Nama Pengikut</label>
  88. <div class="col-sm-8">
  89. <input type="text" class="form-control" name="c" placeholder='Tulis Nama Pengikut, Jika Bukan dari Karyawan...'>
  90. </div>
  91. </div>
  92.  
  93. <div class="form-group">
  94. <label class="col-sm-3 control-label">Keterangan</label>
  95. <div class="col-sm-8">
  96. <textarea rows='5' class="form-control" name="d"></textarea>
  97. </div>
  98. </div>
  99.  
  100. </div>
  101. <div style='clear:both' class="modal-footer">
  102. <button type="submit" name='simpanpengikut' class="btn btn-info btn-sm">Tambahkan</button>
  103. <button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-warning btn-sm"><span aria-hidden="true">Tutup</span></button>
  104. </div>
  105. </form>
  106. </div>
  107. </div>
  108. </div>
  109.  

Ada 1 File Kiriman :
1. tombol_simpan_data.JPG (24 KB)
Bukhari al Muslim Mengatakan :
Admin -
  1. Assalam,.. Tombol simpan data kendala/masalahnya bagaimana mas?

Maaf, Untuk Memberikan Komentar Anda Harus Login !!!