Table -order- Field -ID, Order_Type, Order_No,Item,Size, Color, Dyeing_Qty_KG, 
Color_approval, Priority_of_Order, Status. 
Table -dyeing_planning, field - Id , Order_No, Machine_No,
Item, Size, Color, Dyeing_Qty_Kg, Batch_Start, Batch_End, Batch_no, Batch_Date, Week_End,
Status. table machine _capacity, field - Id, 
Machine_No, Machine_Capacity_KG, Batch_Time. 
Write auto dyeing planning PHP sample code . include option 
Option 0- set connection of database. 
Option 1- set working days Saturday to Thursday .
Option 2- set working hours 8am to 8pm. 
Option -3 get order from table -order where 
Color_Approval=OK and status=New and Priority_Of_Order wise . 
option -4  get Machine data from Dyeing_Machine_Capacity Table 
and calculate  Order_Qty_KG nearest Machine_Capacity_KG And get Batch_Time and check dyeing_planning table for chosen Machine_No available.
Options 5 -Add code for If Order_Qty_KG greeter then  Machine_Capacity_KG divide
 and calculate remaining quantity left after 1St Batch , 
remaining quantity find nearest Machine_Capacity_KG and auto planning 
option 6- auto Calculate Batch_Start and Batch_End .
option 7-  suppose 1st
Batch_Start time 8am and Batch_End time 12pm ,2nd Batch_Start time 12pm to 4pm
 in same Machine and 3rd Batch start 4pm to 8pm in other machine here is the problem ,
1st and 2nd batch run my 130kg machine its not available between 8am to 4pm but my 
other Machine was available in 8am so choose Machine_No schedule 8am .
Option 8- Prevent Batch_Start tine And Batch_End time don't cross
 before 8am and after 8pm in table - order . 
option 9- if today no machine available auto planning next day it's 
continues before end all order . 
option 10- remaining quantity insert as partial quantity if Dyeing_Qty_KG greater than Machine_Capacty_KG .
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence