Welcome Guest, Not a member yet? Register   Sign In
[solved] Delay in ajax response time
#5

(This post was last modified: 10-22-2017, 10:01 PM by wolfgang1983.)

(10-22-2017, 03:22 AM)InsiteFX Wrote: You could default your status to 1 in your table and instead of building
a new insert_data array pass the database method the newmembers_info
array, it's already built.

That should help a little on the speed.

I tried that now sill a few seconds delay.

PHP Code:
public function approved() {

$json = array();

if (
$this->input->post('approve')) {

 
  $getMemberInfo $this->get_member($this->input->post('member_id'));

 
  if ($getMemberInfo['member_id'] == $this->input->post('member_id') && $getMemberInfo['approved'] == 0) {

    
$updated $this->db->where('member_id'$this->input->post('member_id'))->update('members', array('approved' => '1''status' => '1'));

    
$json['success'] = true;

    if (
$updated) {

 
           $this->load->library('email');

     
   $this->email->from('*****''Admin');
     
   $this->email->to($getMemberInfo['email']);
     
   $this->email->subject('Riwaka Bowling Account Approved');
     
   $this->email->message('Hi, Just to confirm that your account has now been approved at Riwaka Bowling Club Admin Area');

     
   $this->email->send();
    }
 
   
}

$this->output->set_content_type('application/json');
$this->output->set_output(json_encode($json));


Code:
$(document).ready(function() {
    $(document).on('click', '#button-approve', function() {
        $.ajax({
            url : "<?php echo base_url(); ?>admin/members/dashboard/approved",
            type : "POST",
            dataType : "json",
            data : {
                "approve" : true,
                "member_id" : $(this).attr('data-id')
            },
            success : function(data) {
                if (data['success'] = true)
                {
                    $('#new_member_approve').load(document.URL + ' #new_member_approve');
                }
            },
          
       });
    });

});
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Delay in ajax response time - by InsiteFX - 10-22-2017, 03:22 AM
RE: Delay in ajax response time - by wolfgang1983 - 10-22-2017, 09:57 PM
RE: Delay in ajax response time - by wolfgang1983 - 10-22-2017, 04:01 PM
RE: Delay in ajax response time - by skunkbad - 10-22-2017, 11:02 PM
RE: Delay in ajax response time - by wolfgang1983 - 10-22-2017, 11:28 PM
RE: Delay in ajax response time - by skunkbad - 10-23-2017, 04:32 PM
RE: Delay in ajax response time - by wolfgang1983 - 10-24-2017, 03:50 AM
RE: Delay in ajax response time - by InsiteFX - 10-23-2017, 08:52 AM
RE: Delay in ajax response time - by wolfgang1983 - 10-23-2017, 11:50 AM
RE: Delay in ajax response time - by wolfgang1983 - 10-24-2017, 03:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB