Advertisement
gundambison

perbaikan 73 - controller

Aug 17th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  * To change this license header, choose License Headers in Project Properties.
  5.  * To change this template file, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8. class Kamar extends CI_Controller {
  9.     function index(){
  10.         $post=$this->input->post();
  11.         //asumsikan ini hasil dari model
  12.         $kamar="<option>--pilih--</pilih>";
  13.         for($i=1;$i<10;$i++){
  14.             $kamar.="<option value='{$i}_{$post['kamar']}'>Kamar ";
  15.             $kamar.=$post['kamar']."_".$i;
  16.             $kamar.="</option>";
  17.         }
  18.         $result=array(
  19.             'kamar'=>$kamar
  20.         );
  21.        
  22.         echo json_encode($result);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement