<script type="text/javascript">

	$(function () {
		$('#reset').click(function(){
			$('#mancode').val(""); 
			$('#kcode').val(""); 
			$('#keitaicode').val(""); 
			$('#yakushokucode').val(""); 
			$('#shokushucode').val(""); 
			$('#tankacode').val(""); 
			$('#kotei').prop("checked",false);
		});

		$('#pickup').click(function(){
			var msg ="where (`給与形態コード` != 21 and `給与形態コード` != 51 ) ";

			if($('#mancode').val())
				msg = msg + " And (itai_users.login_name='" +  $('#mancode').val() + "') ";

			if($('#kname').val())
				msg = msg + " And (itai_users.uname like '%" +  $('#kname').val() + "%') ";

			if($('#kcode').val())
				msg = msg + " And (itai_users.所属課コード='" +  $('#kcode').val() + "') ";
			if($('#keitaicode').val())
				msg = msg + " And (itai_users.給与形態コード='" +  $('#keitaicode').val() + "') ";
			if($('#yakushokucode').val())
				msg = msg + " And (itai_users.役職コード='" +  $('#yakushokucode').val() + "') ";
			if($('#shokushucode').val())
				msg = msg + " And (itai_users.職種コード='" +  $('#shokushucode').val() + "') ";

			var flg = $('#kotei').prop('checked');
			if(flg==true)
				msg = msg + " And (itai_users.通勤手当固定分<>0) ";

			var flg2 = $('#zaishoku').prop('checked');
			if(flg2==true)
				msg = msg + " And (itai_users.退社日<>＇＇) ";

			alert(msg);

			jQuery.post(
				'skojin_pickup.php',
				{ cond: msg, mtitle:'<{$mtitle}>'},
				function( data, textStatus ) {
					$( '#mylist' ) . html( data );
				}
				,'html'
	       	);

		});


		$('#backmenu2').click(function(){
		    window.location.href = '/modules/master';
		});

		$('#excel2').click(function(){
			jQuery.post(
				'skojin_excel.php',
				{ cond: mycond },
					function( data, textStatus ) {
				   		window.location.href = data;
					}
				,'html'
	       	);
		});

		$('#newd2').click(function(){
			var mylink = 'personal.php';
			window.location.href = mylink;
		});

	});

</script>

<h3><{$mtitle}></h3>

<table id="listtable">
<tr>
<td style="width:300px;" valign="top">
<table>
<tr>
<td class="head">勤務者コード</td>
<td class="odd">
	<select name="mancode" id="mancode">
	<option value="">  </option>
	<{foreach item=mes from=$mykinmusha}>
		<option value="<{$mes.login_name}>"><{$mes.login_name}>:<{$mes.uname}></option>
	<{/foreach}>
	</select>
</td>
</tr>
<tr>
<td class="head">勤務者名<br />(あいまい)</td>
<td class="odd">
	<input type="text" size="20" name="kname" id="kname">
</td>
</tr>
<tr>
<td class="head">所属課コード</td>
<td class="odd">
	<select name="kcode" id="kcode">
	<option value="">  </option>
	<{foreach item=mes from=$myshozokuka}>
		<option value="<{$mes.code}>"><{$mes.code}>:<{$mes.name}></option>
	<{/foreach}>
	</select>
</td>
</tr>
<tr>
<td class="head">給与形態コード</td>
<td class="odd">
	<select name="keitaicode" id="keitaicode">
	<option value="">  </option>
	<{foreach item=mes from=$mykkeitai}>
		<option value="<{$mes.code}>"><{$mes.code}>:<{$mes.name}></option>
	<{/foreach}>
	</select>
</td>
</tr>
<tr>
<td class="head">役職コード</td>
<td class="odd">
	<select name="yakushokucode" id="yakushokucode">
	<option value="">  </option>
	<{foreach item=mes from=$myyakushoku}>
		<option value="<{$mes.code}>"><{$mes.code}>:<{$mes.name}></option>
	<{/foreach}>
	</select>
</td>
</tr>
<tr>
<td class="head">職種コード</td>
<td class="odd">
	<select name="shokushucode" id="shokushucode">
	<option value="">  </option>
	<{foreach item=mes from=$myshokushu}>
		<option value="<{$mes.code}>"><{$mes.code}>:<{$mes.name}></option>
	<{/foreach}>
	</select>
</td>
</tr>

<tr>
<td colspan=2 class="head"><input type="checkbox" id="kotei" name="kotei" value="固定">&nbsp;通勤費固定分が入力されている勤務者</td>
</tr>
<tr>
<td colspan=2 class="head"><input type="checkbox" id="zaishoku" name="zaishoku" value="在職">&nbsp;在職者</td>
</tr>

<tr>
<td colspan=2 class="head"><input type="button" id="pickup" name="pickup" value="抽出">&nbsp;<input type="button" id="reset" name="reset" value="リセット"></td>
</tr>


</table>



</td>
<td valign="top">
<div id="mylist">
<table>
<tr><td colspan='9' class='head' align='right'><input type='button' id='excel2' value='確認表'><span id='kekkalink2'></span>&nbsp;&nbsp;<input type='button' id='newd2' value='新規登録'>&nbsp;&nbsp;<input type='button' id='backmenu2' value='メニューに戻る'></td></tr>
</table>

</div>
</td>
</tr>
</table>




</div>

