Advertisement
gundambison

perbaikan 72

Aug 9th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.37 KB | None | 0 0
  1. <?php
  2. $js     = $this->config->item('js');
  3. $css    = $this->config->item('css');
  4. $img    = $this->config->item('img');
  5. $images = $this->config->item('images');
  6. ?>
  7.  
  8. <!-- header -->
  9.  
  10. <?php
  11. include_once dirname(__FILE__) . '/../layouts/header.php';
  12. ?>    
  13.  
  14.     <div class="content">
  15.    
  16.         <!-- left -->
  17.         <?php
  18. include_once dirname(__FILE__) . '/../layouts/left.php';
  19. ?>        
  20.        
  21.         <div id="middle">
  22.        
  23.        
  24.        
  25.         <!-- ========== pencarian dukcapil-->
  26.                
  27.             <br />
  28.                 <br />
  29.                 <form method="GET" action>
  30.                     <div style="float:left; width:70px;"><strong><font color="000000">DUKCAPIL</font></strong></div>
  31.                     <input type="search" style="width:300px"  placeholder="Masukan nomor nik" name="nik">
  32.                     <button type="submit" value="submit" >CARI</button>
  33.                    
  34.                 </form>
  35.                
  36.                
  37.                 <br />
  38.            
  39. <div>
  40. <?php
  41.  
  42. if (isset($_GET['submit']) || isset($_GET['nik'])) {
  43.    
  44.    
  45.     $url = "http://10.11.4.34/csf-ws/dukcapil/customer/index_get?nik=" . $_GET['nik'];
  46.    
  47.     $ch = curl_init();
  48.    
  49.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  50.    
  51.     curl_setopt($ch, CURLOPT_URL, $url);
  52.    
  53.     $result = curl_exec($ch);
  54.    
  55.     curl_close($ch);
  56.    
  57.     $raw = json_decode($result, TRUE);
  58.     $key = isset($raw['content']) ? $raw['content'] : FALSE;
  59.    
  60.     if (is_array($key)) {
  61. ?>
  62.                     <table>
  63.  
  64.                             <?php
  65.         foreach ($key as $index => $baris):
  66. ?> <!-- Mulai loop -->
  67.                            
  68.                             <tr>
  69.                                 <td><?php
  70.             echo $index;
  71. ?></td>
  72.                                 <td><?php
  73.             echo "<pre>" . print_r($baris, 1) . "</pre>";
  74. ?></td>
  75.                                 <td>
  76.             ..
  77.             </td>
  78.                             </tr>
  79.                            
  80.                             <?php
  81.         endforeach;
  82. ?> <!-- Selesai loop -->
  83.                            
  84.                     </table>
  85. <?php
  86.     }
  87.     //if (is_array($key) )
  88.    
  89.     echo "<div class='col-sm-12'>&nbsp;</div>";
  90.    
  91.    
  92. } else {
  93.     // if (isset($_GET['submit']) || isset($_GET['nik'])) {
  94.    
  95.    
  96.     if (isset($key) && $key != '') {
  97.         echo "
  98.                                          
  99.                                <h4>
  100.                                <div class='col-md-12 alert alert-danger'>
  101.                                        Isikan NIK!
  102.                                </div>
  103.                                </h4>
  104.                                      
  105.                                        ";
  106.     } else {
  107.         echo "
  108.                                          
  109.                                <h4>
  110.                                <div class='col-md-12 alert alert-danger'>
  111.                                Nomor NIK <b>" . "</b> Tidak Ditemukan!
  112.                                </div>
  113.                                </h4>
  114.                                      
  115.                                        ";
  116.     }
  117.     echo "<div class='col-sm-12'>&nbsp;</div>";
  118.    
  119.    
  120.    
  121. }
  122.  
  123.  
  124.  
  125.  
  126. //}//???
  127.  
  128.  
  129. ?>
  130.            
  131.  </div>
  132.    
  133.     </div>
  134.    
  135.     <!-- footer -->
  136.     <?php
  137. include_once dirname(__FILE__) . '/../layouts/footer.php';
  138. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement