<%  @calendar_select_interval = 2     %>
	<%
		#	gt - Глобальная таблица
		@pre_part="<div id=\"user_perf_summ_container\">
				<div class=\"user_perf_info_block\">
					#{image_tag("normal.png", class: "user_perf_summ_image")}
					<div class=\"user_perf_summ_text\"> <b id=\"user_perf_sum_norm\">0</b></div>
				</div>
				<div class=\"user_perf_info_block\">
					#{image_tag("warning.png", class: "user_perf_summ_image")}
					<div  class=\"user_perf_summ_text\"> <b id=\"user_perf_sum_warn\">0</b></div>
				</div>
				<div class=\"user_perf_info_block\">
					#{image_tag("error.png", class: "user_perf_summ_image")}
					<div  class=\"user_perf_summ_text\"\"> <b id=\"user_perf_sum_err\">0</b></div>
				</div>
				<div class=\"user_perf_info_block\" style=\"width:210px\">
					<div class=\"user_perf_summ_text\" style=\"left:10px\">#{t(:unique_users)}: <b id=\"user_perf_uniqe_user\">0</b></div>
				</div>
				<div class=\"user_perf_info_block\" style=\"width:200px\">
					<div  class=\"user_perf_summ_text\" style=\"left:10px\">#{t(:all_opers)}: <b id=\"user_perf_all_oper\">0</b> </div>
				</div>
				<div class=\"user_perf_search_field\">
				"
		@post_part='</div></div>'
		@container="#{@pre_part}#{render partial: "shared/search_list", locals: {
				select_id:'login',
				select_name:t(:login_search),
				search_command:'login_sort',
				drop_direction:'up',
				delete_function:0
			}}#{@post_part}"
			@gt_structure=[]
						
						image_cell='status'
						@gt_structure.push({:onclick => "", :row_name => t(:offices), :value => "'+data.data[i].office_name+'", :width => "width:120px", :filter => 'office_name' })
						@gt_structure.push({:onclick => "", :row_name => t(:login), :value => "'+data.data[i].login_name+'", :width => "", :filter => 'login_name' })
						@gt_structure.push({:onclick => "", :row_name => t(:count), :value => "'+data.data[i].count+'", :width => "width:120px", :filter => 'count' })
						@gt_structure.push({:onclick => "", :row_name => t(:status), :value => "'+build_status_view(data.data[i])+'", :width => "width:150px", :filter => 'red' })
						@gt_structure.push({:onclick => "", :row_name => t(:full_time), :value => "'+second_to_hour_converter(data.data[i].duration_sum)+'", :width => "width:200px", :filter => 'duration_sum' })
						@gt_structure.push({:onclick => "", :row_name => t(:user_time), :value => "'+second_to_hour_converter(data.data[i].user_time_sum)+'", :width => "width:200px", :filter => 'user_time_sum' })
						@gt_structure.push({:onclick => "", :row_name => t(:sys_time), :value => "'+second_to_hour_converter(data.data[i].sys_time_sum)+'", :width => "width:200px", :filter => 'sys_time_sum' })
						@gt_structure.push({:onclick => "", :row_name => "", :value => "'+link_login_map(data.data[i].login_id)+'", :width => "width:80px", :filter => 'none' })
	%>
	<%= render partial: "shared/table", locals: {
		name:"login_table",
		header:@gt_structure,
		query:"get_user_perfomance",
		action_after:1,
		time:1,
		add_params:', loginid:login_perf_selected_foid',
		offset:50,
		first_sort:'count;DESC',
		additional_field:@container
	} %>
<script>
login_select_onchange=1
function login_perf_status_field(data){
	result='<b style="color:<%= $green %>">'+data.green+'</b>'+
		'/'+
		'<b style="color:<%= $yellow %>">'+data.yellow+'</b>'+
		'/'+
		'<b style="color:<%= $red %>">'+data.red+'</b>'
	return result
}
function login_select_onchage_execute(){
	if (document.getElementById('login_select_field').value == 0){
		login_perf_selected_foid=0
		gt_build_table_login_table(gt_last_sort_login_table)
	}
}
var login_perf_selected_foid = 0
function login_select_search(foid){
	//if (foid>0){
		login_perf_selected_foid=foid
		gt_last_page_login_table=1
		gt_build_table_login_table(gt_last_sort_login_table)
		
		//}
}

function calendar_update(){
	gt_last_page_operation_table=1
	gt_build_table_login_table(gt_last_sort_login_table)
}
function gt_action_after_build_login_table(data){
	document.getElementById('user_perf_sum_norm').innerHTML=data.detailed_info.green
	document.getElementById('user_perf_sum_warn').innerHTML=data.detailed_info.yellow
	document.getElementById('user_perf_sum_err').innerHTML=data.detailed_info.red
	document.getElementById('user_perf_uniqe_user').innerHTML=data.detailed_info.unique
	document.getElementById('user_perf_all_oper').innerHTML=data.detailed_info.count
}
function login_perf_open_map_window(loginid){
	console.log(loginid)
	get_to_page_with_parametr('/logins/map','loginid='+loginid)
}



//<img height="28" width="28" style="position:absolute;top:5px;left:5px" src="/assets/.png" alt="">


</script>