'', 'vcvalue' => $answer); } if(count($result) > 0) { $updatequery = "insert into chatresponses (vcvalue,locale,groupid) values "; for($i=0;$i 0) { $updatequery .= ", "; } $updatequery .= "('".mysql_real_escape_string($result[$i]['vcvalue'], $link)."','$locale', NULL)"; } perform_query($updatequery, $link); $result = select_multi_assoc($query, $link); } } mysql_close($link); return $result; } # locales $all_locales = get_available_locales(); $locales_with_label = array(); foreach($all_locales as $id) { $locales_with_label[] = array('id' => $id, 'name' => getlocal_($id,"names")); } $page['locales'] = $locales_with_label; $lang = verifyparam("lang", "/^[\w-]{2,5}$/", ""); if( !$lang || !in_array($lang,$all_locales) ) { $lang = in_array($current_locale,$all_locales) ? $current_locale : $all_locales[0]; } # groups $groupid = ""; if($settings['enablegroups'] == '1') { $groupid = verifyparam( "group", "/^\d{0,8}$/", ""); if($groupid) { $group = group_by_id($groupid); if(!$group) { $errors[] = getlocal("page.group.no_such"); $groupid = ""; } } $link = connect(); $allgroups = get_all_groups($link); mysql_close($link); $page['groups'] = array(); $page['groups'][] = array('groupid' => '', 'vclocalname' => getlocal("page.gen_button.default_group")); foreach($allgroups as $g) { $page['groups'][] = $g; } } # delete if(isset($_GET['act']) && $_GET['act'] == 'delete') { $key = isset($_GET['key']) ? $_GET['key'] : ""; if( !preg_match( "/^\d+$/", $key )) { $errors[] = "Wrong key"; } if( count($errors) == 0 ) { $link = connect(); perform_query("delete from chatresponses where id = $key",$link); mysql_close($link); header("Location: $webimroot/operator/canned.php?lang=$lang&group=$groupid"); exit; } } # get messages $messages = load_canned_messages($lang, $groupid); setup_pagination($messages); # form values $page['formlang'] = $lang; $page['formgroup'] = $groupid; prepare_menu($operator); start_html_output(); require('../view/canned.php'); ?>