Welcome Guest, Not a member yet? Register   Sign In
JavaScript Help
#1

[eluser]R_Nelson[/eluser]
I hope this is the right place to ask this. I have a DB that has all my karaoke songs in it and i can display the list just fine i have it paginated what i would like to do is when i type in a word in the search bar it will display the List where my list is atm.

so far i have this for the view
Code:
<br /><br />
<div id="container">
        &lt;?= form_fieldset('Search our Song List'); ?&gt;
        &lt;?= form_open('karaoke/search');?&gt;
        &lt;?= form_input('querry','','class="textinput"');?&gt;
        &lt;?= form_fieldset_close();?&gt;
        <br>            
        <h1>White Tiger Karaoke List</h1>
        <h1>There are &lt;?= $songs ?&gt; Karaoke Songs</h1>
        &lt;?php echo $this->pagination->create_links(); ?&gt;
        &lt;?php echo $this->table->generate($records); ?&gt;
        &lt;?php echo $this->pagination->create_links(); ?&gt;
     </div>
    
[removed]
    $('tr:even').css('background', '#ffffff');
    $('tr:even').css('color', '#000000');
[removed]
<br /><br /><br /><br />

and the controller looks like this
Code:
&lt;?php
class Karaoke extends CI_Controller {
    
    function index()
    {
        $this->load->library('pagination');
        $this->load->library('table');
        
        $this->table->set_heading('', 'Song Name', 'Artist');
        
        $config['base_url'] = 'http://whitetigerdj.com/karaoke/index/';
        $config['total_rows'] = $this->db->get('karaoke')->num_rows();
        $config['per_page'] = 20;
        $config['num_links'] = 10;
        $config['full_tag_open'] = '<div id="pagination">';
        $config['full_tag_close'] = '</div>';        
        $this->pagination->initialize($config);
        $str = $config['total_rows'];        
        $data['songs'] = $this->_limitchars($str);
        $data['records'] = $this->db->get('karaoke', $config['per_page'], $this->uri->segment(3));    
        $data['title'] = 'Karaoke List';    
        $data['discription'] = '';
        $data['keyword'] = '';
        $data['main_content'] = 'karaoke_list';
        $this->load->view('includes/template', $data);
    }
    
    function search()
    {
        $querry = $this->input->post('querry');
        
    }
// Private Functions
    
    function _is_divisible($num, $numtwo)
    {
        $divide = $num % $numtwo;
        if($divide!= 0)
        {
            return FALSE;
        }else{
            if($num == 0)
            {
                return false;
            }else{
                return true;
            }
        }
    }
    
    function _limitchars($str)
    {
        $chars = strlen($str);
        $str = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY);
        $particle = "";
        $k=0;
        $remainder = $chars % 3;
        $charsleft = $chars;
        while($k < $chars)
        {
            if($this->_is_divisible($charsleft, 3))
            {
                if($k!= 0)
                {
                    $quotient = $chars - $k;
                }else{
                    $quotient = 0;
                }
                if($this->_is_divisible($quotient, 3))
                {
                    $particle = $particle.",".$str[$k];
                }else{
                    $particle = $particle.$str[$k];
                }
            }else{
                $charsleft--;
                if($k == $remainder)
                {
                    $particle = $particle.",".$str[$k];
                }else{
                    $particle = $particle.$str[$k];
                }
            }
            $k++;
        }
        return $particle;
    }
    
}// end class Karaoke

so what my question is do i need another java library or can it be done with with the jquery library? what library will i need or commands do i need to look up and learn to use?




Theme © iAndrew 2016 - Forum software by © MyBB