YNICTE/BO/Views/Shared/Partial/semscript.cshtml

53 lines
2.2 KiB
Plaintext

<div id="sembox" class="findbox draggable regbox" style="width: 500px; z-index: 1041; top: 60px; overflow: auto;">
<h4><i class="fa fa-bars"></i> <span id="pcap">메시지 발송</span><a href="#" class="btn btn-default btn-xs f-r closethisbox">닫기</a></h4>
<div style="margin: 20px 0 5px 0;">
<textarea id="semmsg" class="form-control" style="resize: none; height: 120px; padding: 15px 20px;" onkeyup="semcount()"></textarea>
</div>
<div>
※ 글자수 : <span id="semcount"></span>
</div>
<div class="text-center">
<a href="#" class="btn btn-primary" onclick="semsend();">발송</a>
</div>
<br />
</div>
<script>
var _script_sem_type;
var _script_sem_usernos;
var _script_sem_title;
function sem(type, boxid,title) {
_script_sem_type = type;
_script_sem_title = title;
if ($(boxid).find("input.autocheck:checked").length < 1) {
msg("대상자를 선택해주세요.");
} else {
_script_sem_usernos = "";
$.each($(boxid).find("input.autocheck:checked"), function (i, c) {
_script_sem_usernos += "," + $(c).attr("data-userno");
});
_script_sem_usernos = _script_sem_usernos.substr(1);
setv("semmsg", "");
$("#semcount").text("0");
bglayer(); $("#sembox").slideDown("fast", function () { $("#semmsg").focus(); });
}
}
function semcount() {
$("#semcount").text(getBytes($("#semmsg").val()));
}
function semsend() {
if (getBytes($("#semmsg").val()) < 1) {
focus("semmsg");
msg2("메시지 내용을 입력해주세요.");
} else if (confirm("발송하시겠습니까?")) {
capp("/acommon/sem", { type: _script_sem_type, usernos: _script_sem_usernos, title: _script_sem_title, msg: val("semmsg") }, "cbsem", null, null, null, true);
}
}
function cbsem() {
if (capResult.code == 1000) {
msg2(capResult.msg);
$('#sembox').slideUp('fast'); $('#bglayer').hide();
} else {
msgadmin2();
}
}
</script>