User Tools

Site Tools


tech2018:edit_account_controller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech2018:edit_account_controller [2018/05/14 08:04]
Gianluca Pelliccioli
— (current)
Line 1: Line 1:
-===== Edit_account_data FORM CONTROLLER ===== 
  
- 
-<code> 
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
- 
-class Account_change extends CI_Controller { 
- 
- public function __construct() 
- { 
- parent::__construct(); 
- $this->load->model('account_changes'); 
- } 
-  
-  
- /** 
- * Index Page for this controller. 
- */ 
- public function index() 
- { 
-  
- //POST VALUES 
- if($this->input->post()){ 
- $post_data = $this->input->post(); 
- $save_state = $this->account_changes->update_accounts($post_data['account_id']);  
- } 
-  
- //based on save do var update 
- if($save_state){ 
- if($this->input->post('status') == 'DONE') $data['RESULT'] = 'OK'; 
- $data['STATUS'] = $this->input->post('status'); 
- $this->core_actions->update_var('ACTIVITY',$this->input->post('activity'),'ACTIVITY',$this->input->post('activity'),$data,NULL); 
- } 
-  
- //handle errors according to business logic 
- $result = true; 
- $message = ''; 
-  
- $return = array( 
- 'result' => $save_state, 
- 'error' => $message 
- ); 
-  
- $this->output->set_content_type('application/json')->set_output(json_encode($return)); 
-  
- } 
-  
-}  
- 
-</code> 
tech2018/edit_account_controller.1526285067.txt.gz ยท Last modified: 2018/05/14 08:04 by Gianluca Pelliccioli