mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
minor: formatting
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@112 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
7427fb4c68
commit
bcc0ad4746
@ -36,16 +36,9 @@ function get_operators() {
|
||||
$link = connect();
|
||||
|
||||
$query = "select * from chatoperator order by vclogin";
|
||||
$result = mysql_query($query,$link) or die(' Query failed: ' .mysql_error().": ".$query);
|
||||
|
||||
$operators = array();
|
||||
while ($op = mysql_fetch_array($result, MYSQL_ASSOC)) {
|
||||
$operators[] = $op;
|
||||
}
|
||||
|
||||
mysql_free_result($result);
|
||||
$result = select_multi_assoc($query, $link);
|
||||
mysql_close($link);
|
||||
return $operators;
|
||||
return $result;
|
||||
}
|
||||
|
||||
function update_operator($operatorid,$login,$password,$localename,$commonname) {
|
||||
@ -65,7 +58,7 @@ function update_operator($operatorid,$login,$password,$localename,$commonname) {
|
||||
|
||||
function create_operator_($login,$password,$localename,$commonname,$link) {
|
||||
$query = sprintf(
|
||||
"insert into chatoperator (vclogin,vcpassword,vclocalename,vccommonname".") values ('%s','%s','%s','%s'".")",
|
||||
"insert into chatoperator (vclogin,vcpassword,vclocalename,vccommonname) values ('%s','%s','%s','%s')",
|
||||
mysql_real_escape_string($login),
|
||||
md5($password),
|
||||
mysql_real_escape_string($localename),
|
||||
|
@ -45,20 +45,20 @@ function setup_pagination($items,$default_items_per_page=15) {
|
||||
|
||||
$start_index = ($curr_page-1)*$items_per_page;
|
||||
$end_index = min($start_index+$items_per_page, count($items));
|
||||
$page['pagination.items'] = array_slice($items, $start_index, $end_index-$start_index);
|
||||
$page['pagination'] =
|
||||
array( "page" => $curr_page, "items" => $items_per_page, "total" => $total_pages,
|
||||
"count" => count($items), "start" => $start_index, "end" => $end_index );
|
||||
$page['pagination.items'] = array_slice($items, $start_index, $end_index-$start_index);
|
||||
$page['pagination'] =
|
||||
array( "page" => $curr_page, "items" => $items_per_page, "total" => $total_pages,
|
||||
"count" => count($items), "start" => $start_index, "end" => $end_index );
|
||||
} else {
|
||||
$page['pagination.items'] = false;
|
||||
$page['pagination'] = true;
|
||||
$page['pagination.items'] = false;
|
||||
$page['pagination'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
function setup_empty_pagination() {
|
||||
global $page;
|
||||
$page['pagination.items'] = false;
|
||||
$page['pagination'] = false;
|
||||
$page['pagination.items'] = false;
|
||||
$page['pagination'] = false;
|
||||
}
|
||||
|
||||
function generate_pagination($pagination) {
|
||||
@ -87,7 +87,6 @@ function generate_pagination($pagination) {
|
||||
$result .= $pagination_spacing;
|
||||
}
|
||||
|
||||
|
||||
if( $curr_page < $pagination['total'] ) {
|
||||
$result .= $pagination_spacing.generate_pagination_link($curr_page+1, generate_pagination_image("nextpage"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user