$AppUI->setMsg(db_error()); } else { $AppUI->setMsg($okMsg); if ($action == 'add') { $q->clear(); } $q->addTable('history'); $q->addUpdate('history_item = history_id'); $q->addWhere('history_table = \'history\''); $okMsg = 'History deleted'; } $q->clear(); $AppUI->redirect(); } $history = new CHistory(); $history->load($history_id); $titleBlock = new w2p_Theme_TitleBlock($history_id ? 'Edit history' : 'New history', 'stock_book_blue_48.png', 'history', 'history.' . $a); if ($canDelete) { $titleBlock->addCrumbDelete('delete history', $canDelete, $msg); } $titleBlock->show(); ?> <script language="javascript" type="text/javascript"> function delIt() { document.AddEdit.action.value = 'del'; document.AddEdit.submit(); } function cancel() { if (confirm('<?php