Welcome Guest, Not a member yet? Register   Sign In
callback problem
#5

[eluser]fuji2009[/eluser]
my view :

Code:
<div id="ploran" title="i">
    &lt;?php echo form_open('profile/pre_loran/'.$user_id,'name="loran"');?&gt;
            <table width="400px">
                <tr>
                    
                    <td>&lt;?php if ($photos == false): ?&gt;
                        <img width="65px" height="65px;" src="../../../users/Default/Hfdrtgrdegdf1.gif"/>
                        &lt;?php else: ?&gt;
                        <img width="65px" height="65px;"src="&lt;?php echo $photos[0]['thumbs'];?&gt;"/>
                        &lt;?php endif;?&gt;
                    </td>
                </tr>
                <tr>
                    <td>&lt;input type="text" name="info" id="info" size="20" value="" /&gt;&lt;/td>
                    &lt;input type="hidden" name="user_login_id" value="&lt;?php echo $user_login_id;?&gt;"&gt;
                    &lt;input type="hidden" name="user_id" value="&lt;?php echo $user_id;?&gt;"&gt;
                    &lt;input type="hidden" name="photos" value="&lt;?php echo $photos[0]['thumbs'];?&gt;"&gt;
                </tr>
                <tr><td>&lt;?php echo form_error('info','<div class="error">','</div>');?&gt;</td></tr>
                <tr>
                    <td>&lt;?php echo form_submit('valid_loran','Valider');?&gt;</td>
                </tr>
    &lt;?php echo form_close();?&gt;
            </table>
</div>


and my controller

Code:
function pre_loran($user_id){
        $data['page'] = 'person_error';
        $data['title'] = 'Erreur';
        
        $data['username'] = $this->session->userdata('username');
        
        $data['user_id'] = '';
        $data['user2_id'] = '';
        
        $this->load->model('profile_model');

        $this->form_validation->set_rules('info','Info','callback_check_infos|trim|required|valid_email|xss_clean');

        if ($this->form_validation->run())
        {
            $data['page'] = 'person_success';
            $data['title'] = 'pre loran';
            extract($_POST);
            
            $username = $this->profile_model->get_username_by_id($user_login_id);
            $username_profil=$this->profile_model->get_username_by_id($user_id);
            $email_profil=$this->profile_model->get_email($user_id);
            $this->email->from('[email protected]', 'Presn');
            $this->email->to($email_profil);
            $this->email->subject('pre_loran');
            $this->email->message(''.$username.' <img src="'.$photos.'" />
                                    <a href="#">Click</a>
                                ');
            $this->email->send();
            
            $pre_loran = array(
                'user1_id' => $user_login_id,
                'user2_id' => $user_id,
                'user3_id' => '',
                'email' => $info,
                'type' => 'present',
                'valide' => 0,
                'created_at' => date('Y-m-d h:i:s',now())
            );
            $this->profile_model->pre_loran($pre_loran);
            $data['demande'] = 'Mee';
        }
        $data['die']='Already do this action';
        $this->load->view('layout/application', $data);    
    }

function check_infos($str)
    {
                extract($_POST);
                $this->db->select('*');
                $this->db->from('meeting');
                $this->db->where('email', $str);
                $this->db->where('user1_id', $user_login_id);
                $this->db->where('user2_id', $user_id);
                $query = $this->db->get();
                if($query->num_rows() > 0)
                    {
                        $this->form_validation->set_message('check_infos', 'Already do');
                        return false;
                    }
                    else
                    {
                        return true;
                    }
    }


thanks for your help


Messages In This Thread
callback problem - by El Forum - 01-18-2011, 09:52 AM
callback problem - by El Forum - 01-18-2011, 09:58 AM
callback problem - by El Forum - 01-18-2011, 10:24 AM
callback problem - by El Forum - 01-18-2011, 10:34 AM
callback problem - by El Forum - 01-18-2011, 10:44 AM
callback problem - by El Forum - 01-18-2011, 12:55 PM
callback problem - by El Forum - 01-18-2011, 12:59 PM
callback problem - by El Forum - 01-18-2011, 01:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB