define(function(require){
	var $ = require('jquery');
	require('uriTemplate')($);
	$(function(){
		$("#edit").bind('click',function(){
			var urlTemplate=$("#editUrl").val();
			var urlString=new $.Template(urlTemplate);
			var urlParam = {"id":$("#userId").val()};
			var url=urlString.expand(urlParam);
			location.href=url;
		});
        $("#close").bind('click',function(){
			location.href=$("#indexUrl").val();
		});
        showDriverJobNumber();
	});
	//显示相关联的司机工号
	function showDriverJobNumber(){
		   var peopleId = $('#peopleId').val();
	        if(peopleId){
	            param={"peopleId":peopleId};
	            $.ajax({
	            	type:"POST",
	            	data:param,
	    			url:$("#queryDriver").val()+'.json',
	    			success:function(response){
	    				$('#driver').html(response.driver.jobNumber);
	    			}
	            });
	        }
	}
});