Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1398 → Rev 1399

//asterisk-stats/trunk/telbook_categories_update.php
23,6 → 23,10
$db->begin_transaction();
 
if($id) {
$db->query_params("delete from telbook_categories_export where category_id=$1", array($id));
$db->query_params("update telbook_persons set person_category=NULL"
. " where person_category=$1", array($id));
 
$db->query_params("update telbook_categories set"
. " category_name=$2, category_comment=$3"
. " where category_id=$1",
39,9 → 43,7
}
}
 
$db->query_params("delete from telbook_categories_export where category_id=$1", array($id));
 
# save entries
# save export targets
foreach($_POST as $key => $value) {
if(substr($key, 0, strlen('export_title-')) == 'export_title-') {
$export_id = substr($key, strlen('export_title-'));
55,6 → 57,17
}
}
 
# save persons
foreach($_POST as $key => $value) {
if(substr($key, 0, strlen('person-')) == 'person-') {
$person_id = substr($key, strlen('person-'));
 
$db->query_params("update telbook_persons set person_category=$1"
. " where person_id=$2",
array($id, $person_id));
}
}
 
$db->commit_transaction();
 
header("Location: telbook_categories_list.php");