Guest User

Untitled

a guest
Jul 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.91 KB | None | 0 0
  1. --------/controllers/home.php-----------------
  2.     function processListRates(){
  3.         $this->load->helper('url');
  4.         $this->load->database();
  5.             $this->load->model('Eazyteldb');//load model       
  6.                                    
  7.         $sql = "SELECT  * FROM eazytel_web_rate WHERE destination  
  8.                        LIKE'''%".$this->input->post("textInserted")."')";
  9.         $this->db->query($sql);                            
  10.     }                                  
  11.  
  12.  
  13. ---------/views/home.php------------------------
  14.  
  15. $(document).ready(function(){
  16.        
  17.  
  18.     //SEND DATA                                
  19.        jQuery('#countryrate').keypress(function(){
  20.            $.post("home/processListRates","textInserted="+jQuery('#countryrate').val(),processResponse);      
  21.     });//end keypress
  22.  
  23.  
  24.  
  25.        //RECEIVE DATA
  26.        function processResponse(data){
  27.                     .......        
  28.                                                                                                    
  29.      };                                                
  30.                                          
  31.                                          
  32.                                          
  33.                                          
  34.                            
  35.                
  36. });//END ready
Add Comment
Please, Sign In to add comment