Advertisement
Guest User

Untitled

a guest
May 28th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  1.  
  2. <form role="form" id='registration-form' method="post" action="act-customer.php" onSubmit="return validasi(this)">
  3. <h5>Nama Penerima</h5>
  4. <input type='text' name='penerima' class='form-control' required>
  5. </p>
  6. <h5>Nomor Contact</h5>
  7. <input type='text' name='telpon' class='form-control' required>
  8. </p>
  9. <h5>Alamat</h5>
  10. <textarea name='alamat'class="form-control" rows="3" required></textarea>
  11. </p>
  12. <h5>Kode Pos</h5>
  13. <input type='text' name='kodepos' class='form-control' required>
  14. </p>
  15. <?php
  16. include "config/con_db.php";
  17. echo" <h5>Kota Tujuan</h5>
  18. <select name='kota' class=form-control required>
  19. <option value=0 selected>- Pilih Kota -</option>";
  20. $tampil=mysql_query("SELECT * FROM ongkoskirim ORDER BY KotaTujuan");
  21. if ($r[IdKota]==0){
  22. echo "<option value=0 selected>- Pilih Kota -</option>"; }
  23. while($w=mysql_fetch_array($tampil)){
  24. if ($r[IdKota]==$w[IdKota]){
  25. echo "<option value=$w[IdKota] selected>$w[KotaTujuan]</option>";
  26. }
  27. else{
  28. echo "<option value=$w[IdKota]>$w[KotaTujuan]</option>"; }
  29. }
  30. echo"</select>";
  31. ?>
  32. </p>
  33. <?php include "config/con_db.php";
  34. echo" <h5>Jasa Pengiriman</h5>
  35. <select name='kurir' id='kategori' class=form-control required>
  36. <option value=0 selected>- Pilih Jasa Pengiriman -</option>";
  37. $tampil=mysql_query("SELECT * FROM kurir ORDER BY NamaPerusahaan");
  38. if ($r[IdPerusahaan]==0){
  39. echo "<option value=0 selected>- Pilih Jasa Pengiriman -</option>"; }
  40. while($w=mysql_fetch_array($tampil)){
  41. if ($r[IdPerusahaan]==$w[IdPerusahaan]){
  42. echo "<option value=$w[IdPerusahaan] selected>$w[NamaPerusahaan]</option>";
  43. }
  44. else{
  45. echo "<option value=$w[IdPerusahaan]>$w[NamaPerusahaan]</option>";
  46. }
  47. }
  48. echo"</select>";
  49. ?>
  50. </div>
  51. </div>
  52. <div class="row" >
  53. <div class="col-md-5" >
  54. <hr style="margin-top: 10px;"/>
  55. <input type="submit" class="btn btn-sm btn-danger pull-right" style="color: #fff;" value="Lanjut Ke Pembayaran"></a>
  56. <a href="index.php" class="btn btn-sm btn-danger pull-right" style="margin-right: 10px; color: #fff;">Kembali Belanja</a>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. --------------------------------------------------------------------------------------
  63. act-customer.php
  64. <?php
  65.  
  66. /**
  67. * @author lutfi
  68. * @copyright 2015
  69. */
  70. include "config/con_db.php";
  71. mysql_query("insert into customer (NamaLengkap,
  72. Telpon,
  73. Alamat,
  74. Kodepos,
  75. IdKota,
  76. IdPerusahaan)
  77. VALUES('$_POST[namalengkap]',
  78. '$_POST[telpon]',
  79. '$_POST[alamat]',
  80. '$_POST[kodepos]',
  81. '$_POST[kota]',
  82. '$_POST[kurir]')");
  83. header('location:index.php');
  84.  
  85. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement