<?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));
}
}
Back to: dev forms/develop custom forms