Advertisement
mwalo

Untitled

Jun 18th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.77 KB | None | 0 0
  1. @model Aims.Areas.ModProject.ViewModels.ProjectDetail
  2. @{
  3. Layout = null;
  4. Response.AddHeader("content-disposition", "attachment;filename=ProjectListRepository_" + DateTime.Now.ToString(@"dd\/MM\/yyyy") + "." + ViewBag.fileExtension);
  5. Response.Cache.SetCacheability(HttpCacheability.NoCache);
  6. Response.ContentType = "application/" + ViewBag.contentType;
  7. ViewBag.Title = "ExportData";
  8.  
  9. int i = 0;
  10. string classval = "";
  11. }
  12.  
  13. <!DOCTYPE html>
  14.  
  15. <html>
  16. <head>
  17. <meta name="viewport" content="width=device-width" />
  18. <title>Print Project Detail Excel</title>
  19.  
  20. <script src="~/Scripts/jquery-1.8.3.js"></script>
  21. <script src="~/Scripts/jquery-ui-1.9.2.custom.min.js"></script>
  22.  
  23. <link href="~/Content/ui-lightness/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" />
  24. <script type="text/javascript">
  25. $(document).ready(function () {
  26.  
  27. $(".btnAdd").button({
  28. icons: {
  29. primary: "ui-icon-circle-plus"
  30. },
  31. text: false,
  32. label: "Add"
  33. });
  34. $(".btnEdit").button({
  35. icons: {
  36. primary: "ui-icon-circle-check"
  37. },
  38. text: false,
  39. label: "Save"
  40. });
  41. });
  42.  
  43. </script>
  44.  
  45. <script type="text/javascript">
  46. $(document).ready(function () {
  47. $(".sdName").autocomplete({
  48. source: function (request, response) {
  49. $.ajax({
  50. url: "../Project/LoadStrategicDirections",
  51. type: "POST",
  52. dataType: "json",
  53. data: { term: request.term },
  54. success: function (data) {
  55. response($.map(data, function (item) {
  56. return { label: item.sdName, value: item.sdName, strategicDirectionId: item.strategicDirectionId };
  57. }))
  58.  
  59. }
  60. })
  61. },
  62. minLength: 3,
  63. select: function (event, ui) {
  64. var inp = $('.strategicDirectionId');
  65. var index = inp.index(".sdName");
  66. $(inp[index + 1]).val(ui.item.strategicDirectionId);
  67. }
  68.  
  69. });
  70. $(".countryName").autocomplete({
  71. source: function (request, response) {
  72. $.ajax({
  73. url: "../Project/LoadCountries",
  74. type: "POST",
  75. dataType: "json",
  76. data: { term: request.term },
  77. success: function (data) {
  78. response($.map(data, function (item) {
  79. return { label: item.countryName, value: item.countryName, countryId: item.countryId };
  80. }))
  81.  
  82. }
  83. })
  84. },
  85. minLength: 3,
  86. select: function (event, ui) {
  87. var inp = $('.Id');
  88. var index = inp.index(".countryName");
  89. $(inp[index + 1]).val(ui.item.countryId);
  90. }
  91.  
  92. });
  93.  
  94. $(".donorName").autocomplete({
  95. source: function (request, response) {
  96. $.ajax({
  97. url: "../ProjectDetail/LoadDonors",
  98. type: "POST",
  99. dataType: "json",
  100. data: { term: request.term },
  101. success: function (data) {
  102. response($.map(data, function (item) {
  103. return { label: item.donorName, value: item.donorName, donorId: item.donorId };
  104. }))
  105.  
  106. }
  107. })
  108. },
  109. minLength: 3,
  110. select: function (event, ui) {
  111. var inp = $('.donorId');
  112. var index = inp.index(".donorName");
  113. $(inp[index + 1]).val(ui.item.donorId);
  114. }
  115.  
  116. });
  117.  
  118. $(".officeName").autocomplete({
  119. source: function (request, response) {
  120. $.ajax({
  121. url: "../ProjectDetail/LoadOffices",
  122. type: "POST",
  123. dataType: "json",
  124. data: { term: request.term },
  125. success: function (data) {
  126. response($.map(data, function (item) {
  127. return { label: item.officeNamme, value: item.officeNamme, amrefOfficeId: item.amrefOfficeId };
  128. }))
  129.  
  130. }
  131. })
  132. },
  133. minLength: 3,
  134. select: function (event, ui) {
  135. var inp = $('.amrefOfficeId');
  136. var index = inp.index(".officeName");
  137. $(inp[index + 1]).val(ui.item.amrefOfficeId);
  138. }
  139.  
  140. });
  141. $(".locName").autocomplete({
  142. source: function (request, response) {
  143. $.ajax({
  144. url: "../ProjectDetail/LoadLocations",
  145. type: "POST",
  146. dataType: "json",
  147. data: { term: request.term },
  148. success: function (data) {
  149. response($.map(data, function (item) {
  150. return { label: item.LocationName, value: item.LocationName, locationId: item.locationId };
  151. }))
  152.  
  153. }
  154. })
  155. },
  156. minLength: 3,
  157. select: function (event, ui) {
  158. var inp = $('.locationId');
  159. var index = inp.index(".locName");
  160. $(inp[index + 1]).val(ui.item.locationId);
  161. }
  162.  
  163. });
  164. $(".openDialog").button({
  165. icons: {
  166. primary: "ui-icon-trash"
  167. },
  168. text: false,
  169. label: "Delete Item"
  170. });
  171.  
  172.  
  173. })
  174. </script>
  175.  
  176. <script type="text/javascript">
  177.  
  178. $.ajaxSetup({ cache: false });
  179.  
  180. $(document).ready(function () {
  181. $(".openDialog").live("click", function (e) {
  182. e.preventDefault();
  183.  
  184. $("<div></div>")
  185. .addClass("dialog")
  186. .attr("id", $(this).attr("data-dialog-id"))
  187. .appendTo("body")
  188. .dialog({
  189. title: $(this).attr("data-dialog-title"),
  190. close: function () { $(this).remove() },
  191. modal: true,
  192. height: 500,
  193. width: 600,
  194. left: 0
  195. })
  196. .load(this.href);
  197. });
  198.  
  199. $(".close").live("click", function (e) {
  200. e.preventDefault();
  201. $(this).closest(".dialog").dialog("close");
  202. });
  203. });
  204. </script>
  205. <script type="text/javascript">
  206. $(document).ready(function () {
  207.  
  208. $("#dialog").dialog();
  209.  
  210. })
  211. jQuery(function ($) {
  212. var focusedElementId = "";
  213. var prm = Sys.WebForms.PageRequestManager.getInstance();
  214.  
  215. prm.add_beginRequest(function (source, args) {
  216. var fe = document.activeElement;
  217. if (fe != null) {
  218. focusedElementId = fe.id;
  219. } else {
  220. focusedElementId = "";
  221. }
  222. });
  223.  
  224. prm.add_endRequest(function (source, args) {
  225. if (focusedElementId != "") {
  226. $("#" + focusedElementId).focus();
  227. }
  228. });
  229. });
  230.  
  231. </script>
  232. <script type="text/javascript">
  233. //$(document).ready(function () {
  234. // $("#projectLesson").submit(function () {
  235. // var f = $("#projectLesson");
  236. // var action = f.attr("action");
  237. // var serializedForm = f.serialize();
  238. // $.post(action, serializedForm,
  239. // function (data) {
  240. // $("#ajaxDiv").html(data.Text);
  241. // });
  242. // return false;
  243. // });
  244. //});
  245. $(document).ready(function () {
  246.  
  247. // Hide the "busy" Gif at load:
  248. //$("#divProcessing").hide();
  249.  
  250. // Attach click handler to the submit button:
  251. $("#process").click(function () {
  252. $("#projectLesson").submit();
  253. });
  254.  
  255. // Handle the form submit event, and make the Ajax request:
  256.  
  257. })
  258. </script>
  259.  
  260.  
  261.  
  262.  
  263. <p>
  264.  
  265. </p>
  266. <div class="panel panel-default">
  267.  
  268.  
  269. <div class="panel-heading"><strong>Project Profile</strong></div>
  270. <div class="panel-body" style="font-size:small">
  271. @if (TempData["SuccessMessage"] != null)
  272. {
  273. <div class="alert alert-success alert-dismissable">
  274. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  275. <strong>@TempData["SuccessMessage"]</strong>
  276. </div>
  277. }
  278. @if (TempData["FailMessage"] != null)
  279. {
  280. <div class="alert alert-danger alert-dismissable">
  281. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  282. <strong>@TempData["FailMessage"]</strong>
  283. </div>
  284. }
  285. @if (TempData["WarningMessage"] != null)
  286. {
  287. <div class="alert alert-warning alert-dismissable">
  288. <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
  289. <strong>@TempData["WarningMessage"]</strong>
  290. </div>
  291. }
  292. <div class="panel panel-default">
  293. <div class="panel-heading"><strong>PROJECT BASIC INFO</strong></div>
  294. <table style="width:100%;font-size:small" class="table table-striped">
  295. <tr>
  296. <th>
  297. Project Description
  298. </th>
  299.  
  300. @{
  301. ViewBag.projectId = Model.project.Id;
  302. }
  303.  
  304. </tr>
  305. <tr>
  306. <td>
  307. <table class="table table-bordered">
  308. <tr>
  309. <th>Project short Title</th>
  310. <td>@Html.DisplayFor(modelItem => Model.project.projectShortTitle)</td>
  311. <th>Project Official/Long Title</th>
  312. <td colspan="3">@Html.DisplayFor(modelItem => Model.project.projectLongTitle)</td>
  313.  
  314. </tr>
  315. <tr>
  316. <th>Description</th>
  317. <td colspan="5">@Html.DisplayFor(modelItem => Model.project.projectDescription)</td>
  318. </tr>
  319. <tr>
  320. <th>Goal</th>
  321. <td colspan="5">@Html.DisplayFor(modelItem => Model.project.projectGoal)</td>
  322. </tr>
  323. <tr>
  324. <th>Open Date</th>
  325. <td>@Html.DisplayFor(modelItem => Model.project.startDate)</td>
  326. <th>Close Date</th>
  327. <td>@Html.DisplayFor(modelItem => Model.project.endDate)</td>
  328. <th>Current Status</th>
  329. <td>@Html.DisplayFor(modelItem => Model.project.projectStatuses.projectStatusName)</td>
  330.  
  331. </tr>
  332. <tr>
  333. <th>Overall Budget</th>
  334. <td>@Html.DisplayFor(modelItem => Model.project.totalBudget) @Html.DisplayFor(modelItem => Model.project.currencyType)</td>
  335. <th>Receient Type</th>
  336. <td>@Html.DisplayFor(modelItem => Model.project.projectRecepientTypes.recepientTypeName)</td>
  337. <th>Donors</th>
  338. <td>
  339. @foreach (var item in Model.donors)
  340. {
  341. @item.Donors.donorName
  342. <br />
  343. }
  344. </td>
  345. </tr>
  346. </table>
  347.  
  348.  
  349.  
  350. </td>
  351.  
  352. </tr>
  353. <tr>
  354. <th>Administrative Information</th>
  355. </tr>
  356. <tr>
  357. <td>
  358. <table class="table table-bordered">
  359. <tr>
  360. <th>Project Manager</th>
  361. <td><a href="mailto:@Html.DisplayFor(modelItem=>Model.project.managerEmail)" style="color:blue">@Html.DisplayFor(modelItem => Model.project.Persons.FullName)</a></td>
  362. <th>Cost Centre</th>
  363. <td>@Html.DisplayFor(modelItem => Model.project.costCentre)</td>
  364. </tr>
  365. </table>
  366. </td>
  367. </tr>
  368. <tr>
  369. <th>Project Objectives</th>
  370. </tr>
  371. <tr>
  372. <td>
  373. <table class="table table-bordered">
  374.  
  375.  
  376.  
  377. @foreach (var item in Model.projectObjectives)
  378. {
  379.  
  380. <tr>
  381. <td>
  382. @item.projectObjectiveName
  383.  
  384. </td>
  385. </tr>
  386.  
  387.  
  388. }
  389. </table>
  390. </td>
  391. </tr>
  392. <tr>
  393. <th>Project Budget: Total @Html.DisplayFor(modelItem => Model.project.totalBudget) @Html.DisplayFor(model => Model.project.currencyType)</th>
  394. </tr>
  395. <tr>
  396. <td>
  397. <table class="table table-bordered">
  398.  
  399. <tr>
  400. <td colspan="5" align="left"><b>Annual Budgets</b></td>
  401.  
  402. </tr>
  403.  
  404. <tr>
  405.  
  406. <th>
  407. FINANCIAL YEAR
  408. </th>
  409. <th> Currency</th>
  410. <th colspan="2">
  411. AMOUNT
  412. </th>
  413.  
  414. </tr>
  415.  
  416. @foreach (var item in Model.annualBudgets)
  417. {
  418. <tr>
  419.  
  420. <td style="width:45%">
  421. @item.FinancialYears.financialYearName
  422. </td>
  423. <td style="width:15%">
  424. @item.currencyType
  425. </td>
  426. <td style="width:30%">
  427.  
  428. @item.amount
  429.  
  430. </td>
  431.  
  432.  
  433.  
  434. </tr>
  435. }
  436. </table>
  437. </td>
  438. </tr>
  439. <tr>
  440. <th>Project Stakeholders</th>
  441. </tr>
  442. <tr>
  443. <td>
  444. <table class="table table-bordered">
  445. <tr>
  446. <th colspan="3">Donors</th>
  447.  
  448. </tr>
  449. <tr>
  450.  
  451.  
  452. <td>
  453. <b>
  454. DONOR NAME
  455. </b>
  456. </td>
  457. <td style="width:30%"><b>Donor Type</b></td>
  458.  
  459. </tr>
  460.  
  461. @foreach (var item in Model.donors)
  462. {
  463. <tr>
  464. <td style="width:88%">
  465. @item.Donors.donorName
  466. </td>
  467. <td style="width:5%">
  468. @item.Donors.DonorCategoryTypes.categoryName
  469. </td>
  470. </tr>
  471. }
  472.  
  473. </table>
  474.  
  475. <table class="table table-bordered">
  476. <tr>
  477. <th colspan="5">Project Co-Recepients(Prime recepients, sub-recepients etc) </th>
  478. </tr>
  479.  
  480.  
  481. <tr>
  482. <td><b>Name of Co-Recepient</b></td>
  483. <td><b>Amount Received</b></td>
  484. <td><b>Type of Recepient</b></td>
  485.  
  486. </tr>
  487. @foreach (var item in Model.projectCoRecepients)
  488. {
  489.  
  490. <tr>
  491. <td>
  492. @item.projectCoRecepientName
  493. </td>
  494. <td>@item.AmountReceived ( @item.Currency )</td>
  495. <td>@item.ProjectRecepientTypes.recepientTypeName</td>
  496. </tr>
  497. }
  498.  
  499. </table>
  500.  
  501. <table class="table table-bordered">
  502. <tr>
  503. <th style="width:11%" colspan="3">
  504. Other Partners(eg MOH, etc)
  505. </th>
  506.  
  507. </tr>
  508.  
  509. </td>
  510.  
  511.  
  512. <tr>
  513.  
  514. <td>
  515. <b> Partner Name</b>
  516. </td>
  517.  
  518. </tr>
  519.  
  520. @foreach (var item in Model.projectPartners)
  521. {
  522. <tr>
  523. <td style="width:94%">
  524. @item.partnerName
  525.  
  526. </td>
  527.  
  528. </tr>
  529. }
  530. </table>
  531.  
  532.  
  533. <tr>
  534. <th>Stakeholder Offices</th>
  535. </tr>
  536. <tr>
  537. <td>
  538.  
  539.  
  540. <div class="panel panel-default" style="width:49%;float:left;overflow:hidden">
  541. <div class="panel-heading"><strong>PROJECT IMPLEMENTING OFFICES</strong></div>
  542. <div class="panel-body" style="font-size:small">
  543.  
  544. <table style="width:100%">
  545. <tr valign="top">
  546. <td style="width:0%">
  547. <label for="name" style="width:auto"><b>PROJECT IMPLEMENTING OFFICE: </b></label>
  548. </td>
  549. <td style="width:89%">
  550. <table style="width:100%" class="table table-bordered" id="">
  551. <thead>
  552. <tr>
  553.  
  554. <th>
  555. OFFICE NAME
  556. </th>
  557.  
  558. <th>Programme</th>
  559.  
  560.  
  561. </tr>
  562. </thead>
  563. <tbody>
  564. @foreach (var item in Model.implementingOffices)
  565. {
  566. <tr>
  567. <td style="width:90%">
  568. @item.AmrefOffices.amrefOfficeName
  569. </td>
  570.  
  571. <td style="width:5%">
  572. <ol>
  573. @foreach (var prog in Model.getProjectOfficeProgrammes(@item.AmrefOffices.Id, Model.project.Id))
  574. {
  575. <li>@prog.programme</li>
  576. }
  577. </ol>
  578. </td>
  579. </tr>
  580. }
  581. </tbody>
  582. </table>
  583. </td>
  584. </tr>
  585. </table>
  586. </div>
  587. </div>
  588.  
  589.  
  590. <div class="panel panel-default" style="width:49%;float:right;overflow:hidden">
  591. <div class="panel-heading"><strong>PROJECT SUPPORTING OFFICES</strong></div>
  592. <div class="panel-body" style="font-size:small">
  593. <table style="width:100%">
  594. <tr>
  595. <td style="width:11%">
  596. <label for="name" style="width:auto"><b>SUPPORT OFFICE: </b></label>
  597. </td>
  598. <td style="width:89%">
  599. <table style="width:100%" class="table table-bordered" id="">
  600. <thead>
  601. <tr>
  602.  
  603. <th>
  604. OFFICE NAME
  605. </th>
  606. <th>
  607.  
  608. </th>
  609.  
  610. </tr>
  611. </thead>
  612. <tbody>
  613. @foreach (var item in Model.supportOffices)
  614. {
  615. <tr>
  616. <td style="width:90%">
  617. @item.AmrefOffices.amrefOfficeName
  618. </td>
  619.  
  620. <td style="width:5%">
  621. <ol>
  622. @foreach (var prog in Model.getProjectOfficeProgrammes(@item.AmrefOffices.Id, @Model.project.Id))
  623. {
  624. <li>@prog.programme</li>
  625. }
  626. </ol>
  627.  
  628. </td>
  629. </tr>
  630. }
  631. </tbody>
  632. </table>
  633. </td>
  634. </tr>
  635. </table>
  636.  
  637. </div>
  638. </div>
  639. </td>
  640. </tr>
  641.  
  642. <tr>
  643. <td>Project Staff Members</td>
  644. </tr>
  645. <tr>
  646. <td>
  647.  
  648. <table class="table table-bordered">
  649. <tr>
  650. <th> Name</th>
  651. <th>Photo</th>
  652. <th>Role</th>
  653. <th>Status</th>
  654. </tr>
  655.  
  656. @foreach (var item in Model.projectMembers)
  657. {
  658.  
  659. <tr>
  660. <td>@item.People.FullName</td>
  661. <td>@item.photo</td>
  662. <td>@item.ProjectRoles.role</td>
  663. @if (item.active == true)
  664. {
  665. <td>Active</td>
  666. }
  667. else
  668. {
  669. <td>Deactivated</td>
  670. }
  671. </tr>
  672. }
  673. </table>
  674. </td>
  675. </tr>
  676. </table>
  677.  
  678.  
  679. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement