@using System.Web.Mvc.Html
@using MrCMS.Web.Apps.Amazon.Models
@model AmazonOrderSearchModel
@{
    ViewBag.Title = "Amazon Orders";
    var amazonManageOrdersUrl = ViewData["AmazonManageOrdersUrl"] as string;
}

@using (Html.BeginForm("Index", "Orders", FormMethod.Get))
{

    <fieldset>
        <legend>
            Amazon Orders
            <span class="btn-group pull-right">
                @Html.ActionLink("Sync", "SyncMany", "Orders", null, new { @class = "btn btn-success" })
                @if (!String.IsNullOrWhiteSpace(amazonManageOrdersUrl))
                {
                    <a href='@amazonManageOrdersUrl' target="_blank" class="btn btn-default">
                        Manage Orders on Amazon
                    </a>
                }
                @Html.ActionLink("Logs", "Index", "Logs", new { type = AmazonLogType.Orders }, new { @class = "btn btn-default" })
                <button type="submit" class="btn btn-primary">Search</button>
            </span>
        </legend>
    </fieldset>


    <div class="row">
        <div class="col-lg-12">
            <div class="form-group">
                @Html.LabelFor(x => x.SearchText, "Search (Order Id, Name or Email)")
                @Html.TextBoxFor(x => x.SearchText, new { @class = "form-control" })
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-4">
            <div class="form-group">
                @Html.LabelFor(x => x.DateFrom)
                @Html.TextBoxFor(x => x.DateFrom, new { @class = "form-control date-time-picker" })
            </div>
        </div>
        <div class="col-lg-4">
            <div class="form-group">
                @Html.LabelFor(x => x.DateTo)
                @Html.TextBoxFor(x => x.DateTo, new { @class = "form-control date-time-picker" })
            </div>
        </div>
        <div class="col-lg-4">
            <div class="form-group">
                @Html.LabelFor(x => x.ShippingStatus)
                @Html.DropDownList("ShippingStatus", ViewData["ShippingStatuses"] as IEnumerable<SelectListItem>, new { @class = "form-control" })
            </div>
        </div>
    </div>

    <hr />
}


<div class="row">
    <div class="col-lg-12">
        @{Html.RenderPartial("Orders", Model); }
    </div>
</div>
