$records = array_reverse(json_decode($rawlog), true); $reg[0] = $_POST['item_id']; $tabs = array('email_template' => '', 'result_data' => '', 'server_info' => '', 'request_info' => '', 'env_info' => '', 'result_metadata_output' => '', 'cookie_info' => '', 'query_string' => ''); foreach ($tabs as $tab => $_null) { $reg[1] = $tab; $data[$tab] = $history->switch_log($reg, $records); } $tpl = new tpl(); echo $tpl->render($tpl->html_tabs_history, $data); die; } break; case 'delete_history_item': if (isset($_POST['delete_history_item'])) { $history = new history(); $history->delete_history_item(); } break; case 'textarea_email_template': if (isset($_POST['textarea_email_template'])) { $rawlog = file_get_contents('createacct_log'); $records = json_decode($rawlog); $records[$_POST['mail_id']]->email_template = $_POST['textarea_email_template']; $rawlog = json_encode($records); file_put_contents('createacct_log', $rawlog); echo $_POST['textarea_email_template']; die; } break; default: break;