<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 
?>
<div class="g4memo_basic">
    <div class="page-header">
        <h1>보내기</h1>
    </div>
    <div class="btn-box">
        <div class="pull-left">
            <a href="./memo.php?kind=recv" class="btn btn-info" title="받은쪽지">받음</a>
            <a href="./memo.php?kind=send" class="btn btn-default" title="보낸쪽지">보냄</a>
        </div>
        <div class="pull-right" style="text-align: right">
            <a href="./memo.php" class="btn btn-danger" title="취소">취소</a>
        </div>
        <div class="clearfix"></div>
    </div>
    
    
    <form name='fmemoform' method='post' onsubmit="return fmemoform_submit(this);" autocomplete="off" class="form-horizontal well" role="form">
        <fieldset>
            <legend class="hide">쪽지 보내기</legend>
            <div class="form-group">
                <label class="col-sm-3 control-label" for="me_recv_mb_id">받는 회원아이디</label>
                <div class="col-sm-9">
                    <input type='text' id="me_recv_mb_id" name="me_recv_mb_id" class="form-control" required itemname="받는 회원아이디" value="<?php echo $me_recv_mb_id?>" placeholder="아이디"/>
                    <p class="help-block">※여러 회원에게 보낼때는 컴마(,)로 구분</p>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label" for="me_memo">내용</label>
                <div class="col-sm-9">
                    <textarea id="me_memo" name='me_memo' class="form-control" rows='10' required itemname='내용' placeholder="내용을 입력하세요"><?php echo $content?></textarea>
                    <p class="help-block"></p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label" for=""><img id='kcaptcha_image' class="kcaptcha_image"/></label>
                <div class="col-sm-9">
                    <input type="number" size='10' name='wr_key' itemname="자동등록방지" required class="form-control" placeholder="자동등록방지 숫자를 입력하세요"/>
                    <p class="help-block">왼쪽(위)글자입력</p>
                </div>
            </div>
            <div class="form-actions">
                <button class="btn btn-primary btn-100" type="submit" id="btn_submit">보내기</button>
            </div>
        </fieldset>
    </form>
</div>
<script type="text/javascript" src="<?php echo $g4['path']?>/js/md5.js"></script>
<script type="text/javascript" src="<?php echo "{$g4['g4m_path']}/js/jquery.kcaptcha.js"?>"></script>
<script type="text/javascript">
with (document.fmemoform) {
    if (me_recv_mb_id.value == "")
        me_recv_mb_id.focus();
    else
        me_memo.focus();
}

function fmemoform_submit(f)
{
    if (!check_kcaptcha(f.wr_key)) {
        return false;
    }

    document.getElementById("btn_submit").disabled = true;

    f.action = "./memo_form_update.php";
    return true;
}
</script>