SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 217 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5. $dbname = "tempahperalatan";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11.     die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. if(isset($_POST['submit']))
  15. {
  16.  
  17.     $noID = $_GET['noID'];
  18.     $pemohon = $_POST['pemohon'];      
  19.     $trkhMula = $_POST['trkhMula'];
  20.     $trkhAkhir = $_POST['trkhAkhir'];
  21.     $n_program = $_POST['n_program'];
  22.     $lokasi = $_POST['lokasi'];
  23.     $n_anjuran = $_POST['n_anjuran'];
  24.     $catatan = $_POST['catatan'];
  25.  
  26.  
  27.     $sql = "UPDATE daftartempah SET pemohon = '".$pemohon."', trkhMula = '".$trkhMula."', trkhAkhir = '".$trkhAkhir."', n_program = '".$n_program."', lokasi = '".$lokasi."', n_anjuran = '".$n_anjuran."'  WHERE noID = '$noID'";
  28.  
  29.  
  30.  
  31.     if ($conn->query($sql) === TRUE) {
  32.         echo "Record updated successfully";
  33.     } else {
  34.         echo "Error updating record: " . $conn->error;
  35.     }
  36. }
  37. $conn->close();
  38. ?>
  39.    
  40. <form action="page9.php" method="POST">
  41.  
  42. <ul class="errorMessages"></ul>
  43.  
  44.         <div class="form-group row text-left">
  45.           <label for="example-text-input" class="col-3 col-form-label">Nama Pemohon: </label>
  46.           <div class="col-8">
  47.             <input class="form-control" type="text" name="pemohon" id="pemohon" value="<?=$row['pemohon'];?>" required>
  48.           </div>
  49.         </div>  
  50.  
  51.         <div class="form-group row text-left">
  52.           <label for="example-date-input" class="col-3 col-form-label">Tarikh Mula: </label>
  53.           <div class="col-8">
  54.             <input class="form-control" type="date" value="0000-00-00" name="trkhMula" id="tmula" value="<?=$row['trkhMula'];?>" required>
  55.           </div>
  56.         </div>
  57.  
  58.         <div class="form-group row text-left">
  59.           <label for="example-date-input" class="col-3 col-form-label">Tarikh Akhir: </label>
  60.           <div class="col-8">
  61.             <input class="form-control" type="date" value="0000-00-00" name="trkhAkhir" id="takhir" value="<?=$row['trkhAkhir'];?>" required>
  62.           </div>
  63.         </div>  
  64.  
  65.         <div class="form-group row text-left">
  66.           <label for="example-text-input" class="col-3 col-form-label">Nama Program: </label>
  67.           <div class="col-8">
  68.             <input class="form-control" type="text" name="n_program" id="namaProgram" value="<?=$row['n_program'];?>" required>
  69.           </div>
  70.         </div>
  71.  
  72.         <div class="form-group row text-left">
  73.           <label for="example-text-input" class="col-3 col-form-label">Lokasi: </label>
  74.           <div class="col-8">
  75.             <input class="form-control" type="text" name="lokasi" id="lokasi" value="<?=$row['lokasi'];?>" required>
  76.           </div>
  77.         </div>              
  78.  
  79.  
  80.  
  81.         <div class="form-group row text-left">
  82.           <label for="example-text-input" class="col-3 col-form-label">Dept/Kelab/Anjuran: </label>
  83.           <div class="col-8">
  84.             <select class="form-control" name="n_anjuran" id="namaAnjuran" value="<?=$row['n_anjuran'];?>" required>
  85.             <option name="" value=""></option>
  86.               <option name="K1" value="B. Kewangan">BK - B. Kewangan</option>
  87.               <option name="K2" value="B. Pentadbiran">BP - B. Pentadbiran</option>
  88.               <option name="K3" value="B. Perancangan Hal Ehwal Korporat">BPK - B. Perancangan Hal Ehwal Korporat</option>
  89.               <option name="K4" value="B. Pemb. Penilaian Projek">BPPP - B. Pemb. Penilaian Projek</option>
  90.               <option name="K5" value="B. Pemb. Projek Sosial">BPPS - B. Pemb. Projek Sosial</option>
  91.               <option name="K6" value="Unit Audit Dalaman">UAD - Unit Audit Dalaman</option>
  92.               <option name="K7" value="Pej. wilayah Temerloh">PWT - Pej. wilayah Temerloh</option>
  93.               <option name="K8" value="Pej. Wilayah Barat">PWB - Pej. Wilayah Barat</option>
  94.               <option name="K9" value="Koperasi LKPP">KOOP - Koperasi LKPP</option>
  95.               <option name="K10" value="KSK LKPP Negeri Pahang">KSKLKPP - KSK LKPP Negeri Pahang</option>          
  96.               <option name="K11" value="KSK LKPP Cawangan Ibu Pejabat">KSKCIP - KSK LKPP Cawangan Ibu Pejabat</option>
  97.               <option name="K12" value="IBU PEJABAT">IBUPEJ - IBU PEJABAT</option>  
  98.               <option name="K13" value="KESATUAN SEKERJA">KESATUAN - KESATUAN SEKERJA</option>                                  
  99.             </select>
  100.           </div>
  101.         </div>
  102.  
  103.         <div class="form-group row text-left">
  104.         <label for="exampleTextarea" class="col-3 col-form-label">Catatan: </label>
  105.             <div class="col-8">
  106.             <textarea class="form-control" id="exampleTextarea" rows="3" name="catatan" id="catatan" value="<?=$row['catatan'];?>" required></textarea>
  107.             </div>
  108.         </div>      
  109.  
  110.         <div class="form-group">            
  111.             <textarea class="form-control sr-only"  name="id" id="txtbox2" rows="3" ><?php echo $row['id'];?></textarea>
  112.         </div>                      
  113.  
  114.         <center><button type="submit" name="submit" class="btn btn-info">Submit</button></center>                      
  115.  
  116. </form>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top