Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.73 KB | None | 0 0
  1. <script type="text/javascript" language="javascript">
  2.  
  3. $(document).ready(function () {
  4.  
  5.         oTable = $('#ActivityGrid').dataTable({
  6.             "bJQueryUI": false,
  7.             "bPaginate": true,
  8.             "bLengthChange": true,
  9.             "bFilter": true,
  10.             "bSort": false,
  11.             "bInfo": true,
  12.             "bAutoWidth": false,
  13.             "iDisplayLength": 25,
  14.             "oLanguage": {
  15.                 "sLengthMenu": '@Html.Lang("SLG_MN")',
  16.                 "sInfo": '@Html.Lang("SLG_VN")',
  17.                 "sInfoEmpty": '@Html.Lang("SLG_NN")',
  18.                 "sZeroRecords": '@Html.Lang("SLG_NN")',
  19.                 "sInfoFiltered": '@Html.Lang("SLG_FD")',
  20.                 "sSearch": '@Html.Lang("SLG_RI")'
  21.             },
  22.             "responsive": true
  23.         });
  24.  
  25.     });
  26.  
  27. function ExportTable()
  28. {
  29.     var table = $('#ActivityGrid').dataTable();
  30.     var flt=""; //I need the filter text here, only the value
  31.  
  32.     $.ajax({
  33.         cache: false,
  34.         type: "POST",
  35.         url: '@Url.Action("exportTable", "Activity")',
  36.         data:
  37.         {
  38.             'filter': flt
  39.         },
  40.         success: function () {
  41.             alert("Success");
  42.         },
  43.         error: function () {
  44.             alert("Error");
  45.  
  46.         }
  47.     });
  48. }
  49.  
  50. </script>
  51.  
  52. <div class="container-fluid">
  53.  
  54.     <div class="row">
  55.         <div class="col-md-12">
  56.             <div class="page-header" style="margin-top: 0px;">
  57.                 <h2 style="color: rgb(0,65,146)">@Html.Lang("SLG_C2") <small>@Html.Lang("SLG_A2")</small></h2>
  58.             </div>
  59.         </div>
  60.     </div>
  61.  
  62.     @if (TempData["Message"] != null)
  63.     {
  64.         <div class="alert alert-warning">
  65.             @TempData["Message"]
  66.         </div>
  67.         <br />
  68.     }
  69.  
  70.     @using (Html.BeginForm("Archive", "Activity", FormMethod.Post, new { name = "myForm", id = "myForm" }))
  71.     {
  72.         <div class="row">
  73.             <div class="col-md-12">
  74.                 <div class="clearfix">
  75.                     <div class="pull-left">
  76.                         <div class="form-inline">    
  77.                             <div class="form-group">
  78.                                 <label>@Html.Lang("SLG_F")</label>
  79.                             </div>
  80.                             <div class="form-group">
  81.                                 <label class="sr-only" for="filterDate">Filtro data</label>
  82.                                 @Html.DropDownList("cmbDate", null, new { @class = "form-control input-sm" })
  83.                             </div>
  84.                             <div class="form-group">
  85.                                 <label class="sr-only" for="filterType">Filtro tipo</label>
  86.                                 @Html.DropDownList("cmbSearchType", null, new { @class = "form-control input-sm" })
  87.                             </div>
  88.                             <div class="form-group">
  89.                                 @Html.TextBox("txtSearch", null, new { @class = "form-control input-sm" })
  90.                             </div>
  91.                             <button type="button" class="btn btn-default btn-sm" onclick="Search();"><span class="glyphicon glyphicon-search"></span>&nbsp;@Html.Lang("SLG_C")</button>                        
  92.                            
  93.                             <button type="button" class="btn btn-default btn-sm" onclick="PopupCenter('@Url.Action("DateSelection", "Activity")', 'Activity', 1);"><span class="fa fa-file-excel-o"></span>&nbsp;@Html.Lang("SLG_E1")</button>
  94.                             <button type="button" class="btn btn-default btn-sm" onclick="PopupCenter('@Url.Action("DateSelection", "Activity")', 'Activity', 2);"><span class="fa fa-file-excel-o"></span>&nbsp;@Html.Lang("SLG_E2")</button>
  95.                             <button type="button" class="btn btn-default btn-sm" onclick="PopupCenter('@Url.Action("DateSelection", "Activity")', 'Activity', 3);"><span class="fa fa-file-excel-o"></span>&nbsp;@Html.Lang("SLG_E3")</button>
  96.  
  97.                             <button type="button" class="btn btn-sm btn-primary" onclick="ActionLink('Activity','Edit','ActivityId', @newActivity)" title="@Html.Lang("SLG_NC")"><span class="fa fa-plus"></span>&nbsp;@Html.Lang("SLG_NC")</button>
  98.                         </div>
  99.                     </div>
  100.                 </div>
  101.             </div>
  102.         </div>
  103.     }
  104.  
  105.     <br />
  106.  
  107.  
  108.     <div class="row">
  109.         <div class="col-md-12">            
  110.             <table class="table table-condensed table-striped table-bordered table-responsive table-hover" id="ActivityGrid">
  111.                 <thead>
  112.                     <tr>
  113.                         <th style="white-space: nowrap;">@Html.Lang("SLG_A")</th>
  114.                         <th style="white-space: nowrap;">@Html.Lang("SLG_DATA")</th>
  115.                         <th style="white-space: nowrap;">@Html.Lang("SLG_OI")</th>  
  116.                         <th style="white-space: nowrap;">@Html.Lang("SLG_OF")</th>
  117.                         <th style="white-space: nowrap;">@Html.Lang("SLG_C")</th>
  118.                         <th style="white-space: nowrap;">@Html.Lang("SLG_O")</th>
  119.                         <th style="white-space: nowrap;">@Html.Lang("SLG_F")</th>
  120.                         <th class="all">&nbsp;</th>
  121.                     </tr>
  122.                 </thead>
  123.                 <tbody>
  124.                     @for (int i = 0; i < Model.Count; i++)
  125.                    {
  126.                        <tr class="active" ondblclick="javascript:ActionLink('Activity','Edit','ActivityId', @Model[i].Id);">
  127.                             <td>@Model[i].Activity</td>
  128.                             <td>@Model[i].DateActivity.ToString(WebAppSettings.DateFormat, CultureInfo.InvariantCulture)</td>    
  129.                             <td>@Model[i].StartTime.ToString("HH:mm", CultureInfo.InvariantCulture)</td>
  130.                             <td>@Model[i].EndTime.ToString("HH:mm", CultureInfo.InvariantCulture)</td>                
  131.                             @if (Model[i].IdContact > 0)
  132.                             {
  133.                                 ContactModel Contact = new ContactModel().LoadById(Model[i].IdContact);
  134.                                 <td>@Contact.CompanyName</td>
  135.                             }
  136.                             else
  137.                             {
  138.                                 <td></td>
  139.                             }
  140.                             @if (Model[i].IdOperator > 0)
  141.                             {
  142.                                 OperatorModel Operator = new OperatorModel().LoadById(Model[i].IdOperator);
  143.                                 <td>@Operator.Description</td>
  144.                             }
  145.                             else
  146.                             {
  147.                                 <td></td>
  148.                             }
  149.                             <td width="5px" align="center">
  150.                                 @if (Model[i].ExtraTime)
  151.                                 {<i class="fa fa-check text-primary fa-lg" aria-hidden="true"></i> }
  152.                             </td>
  153.                             <td width="40px" class="text-right" style="white-space: nowrap;">
  154.                                 <a title="@Html.Lang("SLG_MC")" href="javascript:ActionLink('Activity','Edit','ActivityId', @Model[i].Id);" class="btn btn-xs btn-link"><span class="fa fa-pencil" title="@Html.Lang("SLG_MC")"></span></a>
  155.                                 <a title="@Html.Lang("SLG_EC")" href="javascript:ActionLink('Activity','Delete','ActivityId', @Model[i].Id);" class="btn btn-link btn-xs"><span title="@Html.Lang("SLG_EC")" class="fa fa-trash"></span></a>
  156.                             </td>    
  157.                         </tr>
  158.                     }
  159.                 </tbody>
  160.             </table>
  161.         </div>
  162.     </div>
  163.    
  164. </div>
  165.  
  166. <div id="dialogContact"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement