$state_waiting, "nextagent" => 0, "groupid" => $nextid, "agentId" => 0, "agentName" => "''"), $link); post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)),$thread['locale']), $link); mysql_close($link); } else { $errors[] = getlocal("chat.redirect.cannot"); } } else { $errors[] = "Unknown group"; } } else { $nextid = verifyparam( "nextAgent", "/^\d{1,8}$/"); $nextOperator = operator_by_id($nextid); if( $nextOperator ) { $page['message'] = getlocal2("chat.redirected.content",array(topage(get_operator_name($nextOperator)))); if( $thread['istate'] == $state_chatting ) { $link = connect(); $threadupdate = array("istate" => $state_waiting, "nextagent" => $nextid, "agentId" => 0); if($thread['groupid'] != 0) { if(FALSE === select_one_row("select groupid from chatgroupoperator where operatorid = $nextid and groupid = ".$thread['groupid'], $link)) { $threadupdate['groupid'] = 0; } } commit_thread( $threadid, $threadupdate, $link); post_message_($thread['threadid'], $kind_events, getstring2_("chat.status.operator.redirect", array(get_operator_name($operator)),$thread['locale']), $link); mysql_close($link); } else { $errors[] = getlocal("chat.redirect.cannot"); } } else { $errors[] = "Unknown operator"; } } setup_logo(); if( count($errors) > 0 ) { expand("../styles", getchatstyle(), "error.tpl"); } else { expand("../styles", getchatstyle(), "redirected.tpl"); } ?>