2012-11-22 6 views
0

즉시 작동하지 않습니다 ..코드 점화 업데이트 내가이 함께 다소 이상한 문제에 직면하고있어 서버

내가 코드 점화와 MySQL을 사용하여 Yellowpages 웹 사이트에서 일하고 있어요. 모든 것이 내 로컬 컴퓨터에서 제대로 작동하지만 내 서버에 업로드 할 때 문제가 발생합니다.

유일한 문제의 존재 : 나는 일부 변경을 변경하고 업데이트 버튼을 누르면 만들 때

, 변경 사항이 즉시 (유무는 또한 데이터베이스에 업데이트를 얻을 수 있음을 확인) 뷰에 표시됩니다. 그러나 5 ~ 10 초 내에 다시 '편집'버튼을 누르면 변경 사항이 취소됩니다.

하는 가장 흥미로운 사실은 내가 이전의 변화와 갱신을 눌러도, 인 ... 와서 몇 시간에 확인. 나는 새로운 가치를 다시 본다.

나는 정말로 무엇이 잘못 됐는지 모른다.

컨트롤러 초기 도움이 진정으로 이해할 수있을 것이다

 

    function update_data($cond,$data) 
    { 
     $this->db->where($cond)->update('companies',$data); 
     return true; 
    } 

 

    function customerList() 
    { 
     $data = array(); 
     $data = $this->footer_images(); 

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

     if($this->session->userdata('user_role') == "Admin" || $this->session->userdata('user_role') == "Employee") 
     { 
      if($this->session->userdata('user_role') == "Admin") 
       $cond = array('enabled' => 1,'approve' => 1); 
      else if($this->session->userdata('user_role') == "Employee") 
       $cond = array('enabled' => 1,'approve' => 1,'branch' => $this->session->userdata('branch')); 

      $config = array(); 

      $config["base_url"] = base_url() . "home/customerList"; 
      $config["total_rows"] = $this->companies->count_entry($cond,"companies"); 
      $config["per_page"] = 10; 
      $config["uri_segment"] = 3; 
      $config["num_links"] = 3; 
      $config["full_tag_open"] = ''; 
      $config["full_tag_close"] = ''; 
      $config["cond"]=$cond; 

      $this->pagination->initialize($config); 

      $off=$this->uri->segment(3); 

      if($off=="" && !isset($_POST['off'])) 
       $off=0; 
      else if(isset($_POST['off'])) 
       $off=$this->input->post("off"); 
      else 
       $off=$this->uri->segment(3); 

      $data["customers"] = $this->companies->get_data_with_cond_page($config["per_page"], $off, $config["cond"]); 


      $content_data['content'] = $this->load->view("customerList",$data,TRUE); 

      if($this->session->userdata('user_role') == "Admin") 
       $this->load->view('masterTemplate/adminTemplate',$content_data);     
      else if($this->session->userdata('user_role') == "Employee") 
       $this->load->view('masterTemplate/employeeTemplate',$content_data); 
     } 
     else 
     { 
      $data['signup_error'] = "OK"; 
      $content_data['content'] = $this->load->view("home",$data,TRUE); 
      $this->load->view("masterTemplate/template",$content_data); 
     } 
    } 


    function editCompany() 
    { 

     $data = array(); 
     $data = $this->footer_images(); 

     $slno = $this->uri->segment(3); 

     $cond = array('slno' => $slno); 
     $data['results'] = $this->companies->get_data_with_cond($cond); 
     $data['category'] = $this->category->get_all_data(); 
     //// $data['subcategory'] = $this->subcategories->get_all_data(); 

     /* $data['makeColumns'] = $this->makeColumns1(); 
     $data['getTotalData'] = $this->getTotalData("category",""); 
     $data['perPage'] = $this->perPage(); */ 
     $data['category'] = $this->category->get_all_data(); 

     if($this->session->userdata('user_role') == "Admin") 
     { 
      $this->load->view('template/Admin/header'); 
      $this->load->view("edit_company",$data); 
      $this->load->view('template/Admin/footer',$data); 
     } 

    } 

    function updateCompany() 
    { 
     $this->form_validation->set_rules('company_name', 'Company Name', 'required'); 
     $this->form_validation->set_rules('category', 'Category', 'required'); 

     if ($this->form_validation->run() == FALSE) 
     { 
      $sl = $this->input->post('slno'); 
      redirect("home/editCompany/$sl?stat=err");   
     } 
     else 
     { 
       $data = array(
           'company_name' => $this->input->post('company_name'), 
           'contact_person' => $this->input->post('contact_person'), 
           'address' => $this->input->post('address'), 
           'city' => $this->input->post('city'), 
           'state' => $this->input->post('state'), 
           'landmarks' => $this->input->post('landmarks'), 
           'pincode' => $this->input->post('pincode'), 
           'std_code' => $this->input->post('std_code'), 
           'mobile' => $this->input->post('mobile'), 
           'phone' => $this->input->post('phone'), 
           'fax' => $this->input->post('fax'), 
           'cmail' => $this->input->post('cemail'), 
           'website' => $this->input->post('website'), 
           'category_name' => $this->input->post('category') 
          ); 

       $cond = array(
          'slno' => $this->input->post('slno') 
         ); 




         if($this->companies->update_data($cond,$data)) 
         { 
          redirect("home/customerList?stat=ok"); 
         } 
         else 
         { 
          redirect("home/customerList?stat=nok"); 
         } 

     } 
    } 

모델 : 여기

내 코드입니다. 감사! :)

+1

보기 (양식) html을 표시하십시오 ... – bipen

+0

은 (는) 서버 쪽 문제와 비슷합니다 ... 서버 구성을 지우십시오 ... – Learner

+0

헤더의 도움이 필요합니까? – swateek

답변

0

내가 페이지 캐시에 문제가 있었다 것 같다 후 캐시를 새로 컨트롤 + F5 키를 누릅니다. 일단 no-cache 공식을 사용 했더니 ... 지금도 잘 작동했습니다.

0

봅니다 업데이 트

+0

코드에 삽입 할 수 없습니까? 자동 새로 고침과 같은 기능입니까? 그걸 도와 주시면 도와주세요. 문제가 캐시가 – swateek

+0

, 당신은 ' 헤더 ("캐시 제어 : 없음 매장, 노 캐시해야-재 검증")와 같은 헤더를 보내려고 할 수 있습니다; 헤더 ("캐시 제어 : 사후 검사 = 0, 사전 검사 = 0", 거짓). 헤더 ("Pragma : no-cache"); – kaseOga

+0

기능 중 하나에이를 넣어야합니까? 또는 생성자에서 ?? – swateek

관련 문제