7,6 → 7,7 |
$id = $_POST['id']; |
$db->begin_transaction(); |
$db->query_params("delete from telbook_categories_export where export_id=$1", array($id)); |
$db->query_params("delete from telbook_persons_export where export_id=$1", array($id)); |
$db->query_params("delete from telbook_entries_export where export_id=$1", array($id)); |
$db->query_params("delete from telbook_export where export_id=$1", array($id)); |
$db->commit_transaction(); |
17,18 → 18,19 |
elseif(array_key_exists('update', $_POST)) { |
$id = $_POST['id']; |
$export_name = $_POST['export_name']; |
$export_type = ($_POST['export_type'] ? $_POST['export_type'] : NULL); |
$export_comment = $_POST['export_comment']; |
|
if($id) { |
$db->query_params("update telbook_export set" |
. " export_name=$2, export_comment=$3" |
. " export_name=$2, export_type=$3, export_comment=$4" |
. " where export_id=$1", |
array($id, $export_name, $export_comment)); |
array($id, $export_name, $export_type, $export_comment)); |
} |
else { |
$db->query_params("insert into telbook_export" |
. " (export_name, export_comment) values ($1, $2)", |
array($export_name, $export_comment)); |
. " (export_name, export_type, export_comment) values ($1, $2, $3)", |
array($export_name, $export_type, $export_comment)); |
} |
|
header("Location: telbook_export_list.php"); |