200 lines
10 KiB
Plaintext
200 lines
10 KiB
Plaintext
@model NP.Model.VMCC
|
|
<header class="panel-heading bg-light" id="thistabbox">
|
|
<ul class="nav nav-tabs nav-justified">
|
|
<li><a href="#" onclick="gotab(0);" data-toggle="tab">발송이력</a></li>
|
|
<li class="active"><a href="#" data-toggle="tab">메일발송</a></li>
|
|
</ul>
|
|
</header>
|
|
<form id="mform" method="post">
|
|
<section class="panel panel-default">
|
|
<div class="table-responsive">
|
|
<table class="table b-t b-light viewtable">
|
|
<colgroup>
|
|
<col width="150" />
|
|
<col />
|
|
</colgroup>
|
|
<tbody id="tbody1">
|
|
<tr><th>제목</th><td>@Html.TextBoxFor(m => m.EmailSend.etitle, new { @class = "form-control ff", @maxlength = "250", @style="font-weight: normal;" })</td></tr>
|
|
<tr>
|
|
<th rowspan="2">수신대상선택</th>
|
|
<td>
|
|
<label><input type="radio" id="rcvtype0" name="rcvtype" value="0" checked /> 강좌별 발송</label>
|
|
|
|
<select id="year" class="form-control disp-init">
|
|
<option value="">-년도선택</option>
|
|
@foreach (var y in Model.Terms.Select(s => s.tyear).Distinct())
|
|
{
|
|
<option value="@y" @(DateTime.Now.Year == y ? "selected" : "")>@y 년</option>
|
|
}
|
|
</select>
|
|
<select id="tmno" class="form-control disp-init">
|
|
<option value="">-기수선택</option>
|
|
@foreach(var t in Model.Terms.Where(w=>w.tyear == DateTime.Now.Year))
|
|
{
|
|
<option value="@t.tmno">@t.tseq 기</option>
|
|
}
|
|
</select>
|
|
<select id="EmailSend_cmno" name="EmailSend.cmno" class="form-control disp-init">
|
|
<option value="">-강좌(반)선택</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<label class="data-find-float"><input type="radio" id="rcvtype1" name="rcvtype" value="1" /> 개별 발송</label>
|
|
<a href="#" class="btn btn-info btn-find btn-xs data-find data-find-float" style="margin-left: 20px;" onclick="findusershow()"><i class="fa fa-search"></i> 수신대상 선택</a>
|
|
<ul class="selectgroupul" id="cmprdatabox"></ul>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>첨부파일</th>
|
|
<td><input type="file" name="file2" id="file2" /></td>
|
|
</tr>
|
|
<tr><th>내용</th><td style="text-align: left; font-weight: normal !important;">@Html.TextArea("EmailSend.ehtml", "", new { @class = "form-control disp-init", @style = "resize: none; font-weight: normal;" })</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
@Html.HiddenFor(m=>m.savedata)
|
|
</form>
|
|
<div id="newsletter" style="display: none;"></div>
|
|
<div class="botfixempty"> </div>
|
|
<div class="botfix">
|
|
<a href="#" class="btn btn-default" style="margin-right: 10px;" onclick="save(0);">미리보기</a>
|
|
<a href="#" class="btn btn-primary" style="margin-right: 10px;" onclick="save(1);">발송</a>
|
|
</div>
|
|
<form id="dform" method="post" action="">
|
|
@Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
|
|
</form>
|
|
<div style="position: fixed; display: none; border-radius: 10px; background-color: #fff; text-align: center; padding: 5px 10px;" class="draggable ui-widget-content" id="popbox">
|
|
<div id="popboxtop" style="height: 30px; line-height: 30px; cursor: pointer;">
|
|
<span id="poptitle" style="display: block; margin-right: 50px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;"></span>
|
|
<a href="#" class="btn btn-xxs btn-default f-r" style="margin-top: -25px;" onclick="bglayer(false, true); $('#popbox').hide();">X</a>
|
|
</div>
|
|
<iframe id="ifr01" style="border: 0 none;"></iframe>
|
|
</div>
|
|
@Html.Partial("./Partial/UserBox", "bindUser;사용자 검색;999", new ViewDataDictionary { { "assigns", Model.Assigns },{"userauths",Model.userauths } })
|
|
@section styles{
|
|
@Html.Partial("./Partial/Summernotestyle")
|
|
}
|
|
@section scriptsHeader
|
|
{
|
|
@Html.Partial("./Partial/Summernote")
|
|
}
|
|
@section scripts{
|
|
<script>
|
|
var terms = '@(string.Join(";", Model.Terms.Select(s=>string.Format("{0}:{1}:{2}", s.tmno, s.tyear, s.tseq))))';
|
|
$(document).ready(function () {
|
|
$('#EmailSend_ehtml').summernote({
|
|
height: 300,
|
|
tabsize: 2,
|
|
callbacks: {
|
|
onImageUpload: function (files, editor, welEditable) {
|
|
var fdata = new FormData();
|
|
fdata.append('img', files[0]);
|
|
fdata.append('fd', "Editor");
|
|
uploadeditorimage(files, this, fdata, "cbeditorupload()");
|
|
}
|
|
}
|
|
});
|
|
$("#year").on("change", function () {
|
|
$("#tmno option:gt(0)").remove();
|
|
$("#EmailSend_cmno option:gt(0)").remove();
|
|
var y = $(this).val();
|
|
if (y != "") {
|
|
$.each(terms.split(';'), function (i, t) {
|
|
if (t.split(':')[1] == y) {
|
|
$("#tmno").append("<option value=\"" + t.split(':')[0] + "\">" + t.split(':')[2] + " 기</optoin>");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
$("#tmno").on("change", function () {
|
|
$("#EmailSend_cmno option:gt(0)").remove();
|
|
if ($(this).val() != "") {
|
|
capp("/acommon/cmgetforboard", { tmno: $(this).val() }, "cbget1");
|
|
}
|
|
});
|
|
});
|
|
function cbget1() {
|
|
$.each(capResult.obj, function (i, c) {
|
|
$("#EmailSend_cmno").append("<option value=\"" + c.cmno + "\">" + c.cname + "(" + c.classno + ")</optoin>");
|
|
});
|
|
}
|
|
function bindUser(ui) {
|
|
$.each($(ui.split(';')), function (i, d) {
|
|
if ($("#cmprdatabox li.no" + d.split(':')[0]).length < 1) {
|
|
$("#cmprdatabox").append("<li class=\"no" + d.split(':')[0] + "\" data-no=\"" + d.split(':')[0] + "\">[" + (d.split(':')[1] == 11 ? "강사" : "운영자") + "]" + d.split(':')[2] + "<a href=\"#\" class=\"adel\" onclick=\"ullidel(this)\">x</a></li>")
|
|
}
|
|
});
|
|
}
|
|
function gotab(idx) {
|
|
if (idx == 0) {
|
|
$("#dform").attr("action", "/cc/emails");
|
|
}
|
|
$("#EmailSend_ehtml").val("");
|
|
timesubmit("dform", 1);
|
|
}
|
|
function save(idx) {
|
|
if (idx == 0) {
|
|
$("#poptitle").text($("#EmailSend_etitle").val());
|
|
$("#ifr01").css("height", "800px");
|
|
$("#ifr01").css("width", "800px");
|
|
$("#popbox").css({
|
|
"width": "820px",
|
|
"height": "880px",
|
|
"max-width": ($(window).width() - 100) + "px",
|
|
"max-height": ($(window).height() - 100) + "px",
|
|
"right": "0",
|
|
"bottom": "0",
|
|
"z-index": 10000
|
|
});
|
|
var doc = $("#ifr01")[0].contentWindow.document;
|
|
doc.open();
|
|
doc.write("<head><meta http-equiv='Content-Type' content='text/html;charset=utf-8' /><\/head>" +
|
|
"<body style='margin: 0; border: 1px solid #ddd; border-radius: 5px; padding: 5px 10px;'>" + $('#EmailSend_ehtml').summernote('code') + "<\/body>");
|
|
doc.close();
|
|
bglayer();
|
|
$("#popbox").show();
|
|
}
|
|
else {
|
|
var cdata = $('#EmailSend_ehtml').summernote('code');
|
|
cdata = cdata == "<p><br></p>" ? "" : cdata;
|
|
if (check("EmailSend_etitle", null, "제목을 입력해주세요.")) { }
|
|
else if ($("#rcvtype0").prop("checked") && check("EmailSend_cmno", null, "강좌를 선택해주세요.")) { }
|
|
else if ($("#rcvtype1").prop("checked") && $("#cmprdatabox li").length < 1) { msg("수신대상을 선택해주세요."); }
|
|
else if (cdata.length < 10) { $('#EmailSend_ehtml').summernote('focus'); msg("내용을 입력해주세요."); }
|
|
else if (confirm("메일을 보내시겠습니까?")) {
|
|
if (!$("#rcvtype0").prop("checked")) {
|
|
setv("EmailSend_cmno", "");
|
|
var us = "";
|
|
$.each($("#cmprdatabox li"), function (i, c) {
|
|
us += "," + $(c).attr("data-no");
|
|
});
|
|
setv("savedata", us.substr(1));
|
|
}
|
|
$("#EmailSend_ehtml").val(cdata);
|
|
capfileform("/acommon/emailsend", "mform", "cbsave");
|
|
}
|
|
}
|
|
}
|
|
function cbsave() {
|
|
if (capResult.code == 1000) {
|
|
if (capResult.obj == -1) {
|
|
msg("해당강좌에는 수강생이 없습니다.");
|
|
}
|
|
else {
|
|
msg("발송결과> " + capResult.msg);
|
|
if (capResult.obj > 0) {
|
|
$("#EmailSend_ehtml").val("");
|
|
$("#dform").attr("action", "/cc/emails");
|
|
timesubmitauto("dform");
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
msgadmin();
|
|
}
|
|
}
|
|
</script>
|
|
} |