<%@ Page Title="Plan Forecast & Firm" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="plan_order_home_new.aspx.cs" Inherits="edicenter.plan_order_home_new" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <br /><br /><br /><br />
   <div class="container-fluid">
        <div class="row row-offcanvas row-offcanvas-right">

        <div class="col-xs-12 col-sm-12">
    <div class="row">

         <div class="panel panel-primary">
      <div class="panel-heading">&nbsp&nbsp Plan Forecast & Firm - Vender รายการแผนการผลิตและสั่งสินค้า(SA Number)&nbsp&nbsp&nbsp&nbsp&nbsp[<%= Session["ULogin"].ToString().Trim() %>]</div>
      <div class="panel-body">
        &nbsp&nbsp
        <asp:Label ID="lblVenderID" runat="server" Text="Vender:"></asp:Label>
        <asp:TextBox ID="txtVender" runat="server" ReadOnly = "false" Width="100px"></asp:TextBox>&nbsp&nbsp       
        <asp:DropDownList ID="ddlF" runat="server" Height ="26px">
        </asp:DropDownList>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblFrom" runat="server" Text="From"></asp:Label>
        <asp:TextBox ID="txtSearchDate" runat="server" ReadOnly = "true" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="imgCalendar" runat="server" Height="20px" ImageUrl="~/Resources/calendar.gif" Width="25px" OnClick="imgCalendar_Click" />
        <asp:Calendar ID="Calendar" runat="server" OnSelectionChanged="Calendar_SelectionChanged" OnVisibleMonthChanged="Calendar_VisibleMonthChanged"></asp:Calendar>
        <asp:Label ID="lblTo" runat="server" Text="To"></asp:Label>
        <asp:TextBox ID="txtSearchDateLast" runat="server" ReadOnly = "true" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="imgCalendar2" runat="server" Height="20px" ImageUrl="~/Resources/calendar.gif" Width="25px" OnClick="imgCalendar2_Click" />&nbsp&nbsp&nbsp
        <asp:Calendar ID="Calendar2" runat="server" OnSelectionChanged="Calendar2_SelectionChanged" OnVisibleMonthChanged="Calendar2_VisibleMonthChanged" ></asp:Calendar>
        <asp:Button ID="btnSearch" runat="server" Text="Search" width="150px" OnClick="btnSearch_Click"/>&nbsp
               <br /><br />
        &nbsp&nbsp&nbsp<asp:Label ID="lblResultSearch" runat="server" Text=""></asp:Label>&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp
               <br />
               <br />
        &nbsp&nbsp&nbsp<asp:Label ID="lblResultMonth" runat="server" Text="" Font-Bold="true" ForeColor="blue"></asp:Label>&nbsp
        &nbsp&nbsp&nbsp<asp:Button ID="btnDlMonth" runat="server" Text="Download Format#A-01" Width="170px" OnClick="btnDlMonth_Click"/>&nbsp&nbsp&nbsp
        <asp:Button ID="btnDlMonth2" runat="server" Text="Download Format#A-02" Width="170px" OnClick="btnDlMonth2_Click"/>&nbsp
          <br />
&nbsp;<asp:Repeater id="myRepeater" runat="server">
	<HeaderTemplate>
<table class="table table-bordered">
<tr style="background-color:#fa7b16; color:black; font-weight:bold;height:35px;" align="Left">
                <td width="5%">No.</td>
                <td>Month</td>
                <td>Company</td>
                <td>Quantity</td>
                <td width="10%">Item</td>
                </tr>           	
   </HeaderTemplate>             
	<ItemTemplate>    
			 <tr style="background-color:#FFFFFF; color:black; height:35px;" align="left">
             <td><asp:Label id="Label5" runat="server" Text='<%# myRepeater.Items.Count + 1 %>' ></asp:Label></td>  
             <td><asp:Label id="Label3" runat="server" Text='<%#  valueTB[cntTB].ToString().Trim() %>' ></asp:Label></td>                    
             <td><asp:Label id="Label2" runat="server" Text='<%#  valueTB[cntTB+1].ToString().Trim() %>' ></asp:Label></td>       
             <td><asp:Label id="Label11" runat="server" Text='<%#  Text_Qty(valueTB[cntTB+2].ToString().Trim()) %>' ></asp:Label></td>          
             <td><input id="btnCF_<%# valueTB[cntTB].ToString() %>" type="button" value="Item" onclick="chooseMonth_click(<%# valueTB[cntTB+3].ToString().Trim() %>)" <%# cntTB+=4 %> class="btn-block" /></td>               
             </tr>
   </ItemTemplate>
       
        <AlternatingItemTemplate>          
			 <tr style="background-color:#20B2AA; color:black; height:35px;" align="left">
             <td><asp:Label id="Label2" runat="server" Text='<%# myRepeater.Items.Count + 1 %>' ></asp:Label></td>
             <td><asp:Label id="Label8" runat="server" Text='<%# valueTB[cntTB].ToString().Trim() %>' ></asp:Label></td> 
             <td><asp:Label id="Label7" runat="server" Text='<%# valueTB[cntTB+1].ToString().Trim() %>' ></asp:Label></td>                 
             <td><asp:Label id="Label10" runat="server" Text='<%# Text_Qty(valueTB[cntTB+2].ToString().Trim()) %>' ></asp:Label></td>      
             <td><input id="btnCF_<%# valueTB[cntTB].ToString() %>" type="button" value="Item" onclick="chooseMonth_click(<%# valueTB[cntTB+3].ToString().Trim() %>)" <%# cntTB+=4 %> class="btn-block" style="color:black"/></td>                             
             </tr>		           
	</AlternatingItemTemplate> 
   
	</asp:Repeater> </table>
               <br />
&nbsp;<asp:Repeater id="Repeater1" runat="server">
	<HeaderTemplate>
<table class="table table-bordered">
                <tr style="background-color:#0000FF; color:white; font-weight:bold;height:35px;" align="Left">
                <td>No.</td>
                <td>SA No.</td>
                <td>Item</td>
                <td>Locat.</td>
                <td>Plant</td>
                <td>ArtNo.</td>
                <td>MatNo.</td>
                <td>Description</td>
                <td>Quantity</td>
                <td>Unit</td>
                <td width="10%">Item    </td>
                <td width="10%">Shipping</td>
                </tr>           	
   </HeaderTemplate>             
	<ItemTemplate>    
			 <tr style="background-color:#FFFFFF; color:black; height:35px;" align="left">
             <td><asp:Label id="Label5" runat="server" Text='<%# Repeater1.Items.Count + 1 %>' ></asp:Label></td>  
             <td><asp:Label id="Label9" runat="server" Text='<%#  valueTB2[cntTB2+12].ToString().Trim() %>' ></asp:Label></td>  
             <td><asp:Label id="Label2" runat="server" Text='<%#  valueTB2[cntTB2+1].ToString().Trim() %>' ></asp:Label></td>   
             <td><asp:Label id="Label3" runat="server" Text='<%#  valueTB2[cntTB2+10].ToString().Trim() %>' ></asp:Label></td>
             <td><asp:Label id="Label6" runat="server" Text='<%#  valueTB2[cntTB2+11].ToString().Trim() %>' ></asp:Label></td>    
             <td><asp:Label id="Label12" runat="server" Text='<%#  valueTB2[cntTB2+2].ToString().Trim() %>' ></asp:Label></td>   
             <td><asp:Label id="Label13" runat="server" Text='<%#  valueTB2[cntTB2+3].ToString().Trim() %>' ></asp:Label></td>   
             <td><asp:Label id="Label14" runat="server" Text='<%#  valueTB2[cntTB2+4].ToString().TrimEnd() %>' width="300px" ></asp:Label></td> 
             <td><asp:Label id="Label16" runat="server" Text='<%#  Text_Qty(valueTB2[cntTB2+5].ToString().Trim()) %>' ></asp:Label></td>   
             <td><asp:Label id="Label15" runat="server" Text='<%#  valueTB2[cntTB2+6].ToString().Trim() %>' ></asp:Label></td>      
             <td><input id="btnCF2_<%# valueTB2[cntTB2].ToString() %>" type="button" value="Item" onclick="view_click(<%# valueTB2[cntTB2+12].ToString().Trim()+valueTB2[cntTB2+1].ToString().Trim() %>)" class="btn-block" /></td>           
             <td><input id="btnSH_<%# valueTB2[cntTB2].ToString() %>" type='<%# Type_StatusShip(Session["event_f"].ToString().Trim()) %>' value="Ship" onclick="ship_click(<%# valueTB2[cntTB2+12].ToString().Trim() %>)" <%# cntTB2+=13 %> class="btn-block" /></td>                     
             </tr>
   </ItemTemplate>
      
        <AlternatingItemTemplate>          
			 <tr style="background-color:#20B2AA; color:black; height:35px;" align="left">
             <td><asp:Label id="Label2" runat="server" Text='<%# Repeater1.Items.Count + 1 %>' ></asp:Label></td>
             <td><asp:Label id="Label17" runat="server" Text='<%# valueTB2[cntTB2+12].ToString().Trim() %>' ></asp:Label></td>  
             <td><asp:Label id="Label7" runat="server" Text='<%# valueTB2[cntTB2+1].ToString().Trim() %>' ></asp:Label></td>   
             <td><asp:Label id="Label4" runat="server" Text='<%# valueTB2[cntTB2+10].ToString().Trim() %>' ></asp:Label></td>   
             <td><asp:Label id="Label8" runat="server" Text='<%# valueTB2[cntTB2+11].ToString().Trim() %>' ></asp:Label></td>                  
             <td><asp:Label id="Label10" runat="server" Text='<%# valueTB2[cntTB2+2].ToString().Trim() %>' ></asp:Label></td>  
             <td><asp:Label id="Label18" runat="server" Text='<%# valueTB2[cntTB2+3].ToString().Trim() %>' ></asp:Label></td>                 
             <td><asp:Label id="Label19" runat="server" Text='<%# valueTB2[cntTB2+4].ToString().TrimEnd() %>' width="300px" ></asp:Label></td> 
             <td><asp:Label id="Label21" runat="server" Text='<%# Text_Qty(valueTB2[cntTB2+5].ToString().Trim())  %>' ></asp:Label></td>  
             <td><asp:Label id="Label20" runat="server" Text='<%# valueTB2[cntTB2+6].ToString().Trim() %>' ></asp:Label></td>    
             <td><input id="btnCF2_<%# valueTB2[cntTB2].ToString() %>" type="button" value="Item" onclick="view_click(<%# valueTB2[cntTB2+12].ToString().Trim()+valueTB2[cntTB2+1].ToString().Trim() %>)" class="btn-block" style="color:black"/></td>                             
             <td><input id="btnSH_<%# valueTB2[cntTB2].ToString() %>" type='<%# Type_StatusShip(Session["event_f"].ToString().Trim()) %>' value="Ship" onclick="ship_click(<%# valueTB2[cntTB2+12].ToString().Trim() %>)" <%# cntTB2+=13 %> class="btn-block" style="color:black"/></td>             
             </tr>		           
	</AlternatingItemTemplate> 

	</asp:Repeater> </table>
        
      </div>
    </div>
                
      </div>
            </div>

         </div>

       <script src="css/js/jquery.min.js"></script>
       <script src="css/js/bootstrap.min.js"></script>
       <script type="text/javascript">
           function chooseMonth_click(id)
           {
               //$.post("plan_upload_forecast.aspx", { id: id });
               //window.open("plan_order_item.aspx?DC="+id+"","_self"); 
               //window.open("plan_upload_work.aspx?DC="+id+"","");
               window.open("plan_order_home_new.aspx?id="+id+"","_self"); 
               //$.post("plan_order_home_new.aspx",{ id: id });
               //window.location.reload();
           }
           function ship_click(id)
           {
               //$.post("plan_upload_forecast.aspx", { id: id });
               window.open("plan_vender_label.aspx?DC="+id+"","_self"); 
               //window.open("plan_upload_work.aspx?DC="+id+"",""); 
           }
           function view_click(id)
           {
               //$.post("plan_upload_forecast.aspx", { id: id });
               //window.open("plan_order_item.aspx?DC="+id+"","_self"); 
               //window.open("plan_upload_work.aspx?DC="+id+"",""); 
               window.open("plan_order.aspx?DC="+id,"_self"); 
           }
       </script>
    </div>
</asp:Content>
