<?php
	include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
//	include $_SERVER['DOCUMENT_ROOT'].'/common/auth_chk.php';

?>
<? include("../inc/inc_top.php"); ?>
<!-- s : header -->
<? include("../inc/inc_header.php"); ?>
<!-- // e : header -->

<!-- s : container -->
<section id="container">
	<section id="visual" class="visual_sell">
		<h2>내차팔기</h2>
		<p>쉽고 간편한 내차팔기, 견적산출,<br>최종 매각까지 어떤 수수료도 요구하지 않습니다.</p>
	</section>
    
    
     <form id="frmMember" name="frmMember" method="post" action="proc.php" enctype="multipart/form-data">
        <input type="hidden" name="mode" id="mode" value="sellNoMember"/>

	<section id="content">
		<div class="clause_chk_list">
			<p class="all"><span class="check_wrap"><input type="checkbox" id="all_agree"><i></i><label for="all_agree">전체 약관동의</label></span></p>
			<ul>
				<li>
					<span class="check_wrap"><input type="checkbox" name="ds_agree1" id="ds_agree1" value="Y"><i></i><label for="ds_agree1">[필수] 회원 이용약관</label></span>
					<span class="detail">자세히보기</span>
					<div>
						<textarea cols="100" rows="10" readonly><? include("../inc/clause_txt1.txt"); ?></textarea>
					</div>
				</li>
				<li>
					<span class="check_wrap"><input type="checkbox"  name="ds_agree2" id="ds_agree2" value="Y"><i></i><label for="ds_agree2">[필수] 개인정보 수집이용</label></span>
					<span class="detail">자세히보기</span>
					<div>
						<textarea cols="100" rows="10" readonly><? include("../inc/clause_txt2.txt"); ?></textarea>
					</div>
				</li>
			<!--	<li>
					<span class="check_wrap"><input type="checkbox" id="agree3"><i></i><label for="agree3">[선택] 마케팅 목적 개인정보 수집/이용</label></span>
					<span class="detail">자세히보기</span>
					<div>
						<textarea cols="100" rows="10"><? include("../inc/clause_txt3.txt"); ?></textarea>
					</div>
				</li>
				<li>
					<span class="check_wrap"><input type="checkbox" id="agree4"><i></i><label for="agree4">[선택] 개인정보 제3자 제공</label></span>
					<span class="detail">자세히보기</span>
					<div>
						<textarea cols="100" rows="10"><? include("../inc/clause_txt4.txt"); ?></textarea>
					</div>
				</li>-->
			</ul>
		</div>

		<h3>정보입력</h3>
        
       

		<table class="tbl_w">
			<tr>
				<td><input type="text" class="inp_txt" style="width:100%;" placeholder="이름" name="nm_name" id="nm_name"></td>
			</tr>
			<tr>
				<td>
					<input type="text" class="inp_txt" style="width:100%;" placeholder="핸드폰" name="nm_hp" id="nm_hp">
					<span class="td_txt">(숫자만 입력)</span>
				</td>
			</tr>
			<tr>
				<td><input type="text" class="inp_txt" style="width:100%;" placeholder="차량번호" name="nm_number" id="nm_number"></td>
			</tr>
            <tr>
				<td><select name="ds_area" id="ds_area" class="select" style="width:100%;"></select></td>
			</tr>
		</table>

		<div class="btn_center">
        <input type="submit" class="button" title="비회원 차량등록" value="비회원 차량등록" id="btn_write">
			<!--<a href="#" class="button"  id="btn_write" value="비회원 차량등록">비회원 차량등록</a>-->
		</div>
        </form>
	</section>
</section>
<!-- e : container -->
<script laguage="javascript" type="text/javascript">
    $(document).ready(function() {
        
        setCodeSelect("listcode","ds_area", "member_master","ds_area","<?=$ds_area?>","선택하세요","");
    
        $("#all_agree").bind("click",function(){
			$("#ds_agree1,#ds_agree2").attr('checked',$("#all_agree").is(":checked"));
        });        
    
        $("#btn_write").bind("click",function(){
            
            var fieldlist = [["nm_name","이름"],["nm_hp","휴대번호"],["nm_number","차량번호"],["ds_area","지역"]]
			
            if (!fnCheckForm(fieldlist)){
                return false;
            }else{

                if(!ChkNum($("#nm_hp").val())){
                    alert("휴대폰 번호는 숫자만 입력하세요.");
                    $("#nm_hp").focus();
                    return false;
                }

				if(!document.getElementById("ds_agree1").checked){
					alert('[필수] 회원 이용약관에 동의해 주세요.');
                    $("#ds_agree1").focus();
					return false;
				}
				
				if(!document.getElementById("ds_agree2").checked){
					alert('[필수] 개인정보 수집이용 에 동의해 주세요.');
                    $("#ds_agree2").focus();
					return false;
				}
				
				var c=confirm("정보를 등록하시겠습니까?");
                if(c){
                    $("#btn_write").hide();
                    $("#frmMember").submit();
                }else{
                    $("#btn_write").show();
                    return false;
                }
            }
        });        
    });

</script>
<!-- s : footer -->
<? include("../inc/inc_footer.php"); ?>
<!-- // e : footer -->


<?
mysql_close($connect);
?>

</body>
</html>