func (VS *Server) toViewWorkerOrdersWorkersView(c *gin.Context, sliceOrders []WorkerOrder) []WorkerOrderHTML {
	var sliceOrdersHTML []WorkerOrderHTML
	var prov WorkerOrderHTML
	for i := 0; i < len(sliceOrders); i++ {
		prov.ID = sliceOrders[i].ID

		//This adds the photo
		product, _ := VS.getVideoCourseByID(c, sliceOrders[i].IDProduct, "h_view", "toViewWorkerOrdersWorkersView", "product, _ := VS.getVideoCourseByID(c, sliceOrders", true)
		//err = v.DataBase.Find(&product, bolthold.Where("ID").Eq(sliceOrders[i].ProductID))
		prov.Photo = "/local/video-courses/" + product.Name + "/" + product.Photo
		prov.ItemName = product.Name

		//This adds the date
		prov.DateUnix = time.Unix(sliceOrders[i].Date, 0).UnixNano()
		prov.Date = strconv.Itoa(time.Unix(sliceOrders[i].Date, 0).Day()) + "/" + strconv.Itoa(int(time.Unix(sliceOrders[i].Date, 0).Month()))

		//This adds the Quantity and AlreadyMade
		prov.Quantity = sliceOrders[i].Quantity
		prov.AlreadyMade = sliceOrders[i].AlreadyMade

		//This adds the image to show
		percent := (prov.AlreadyMade * 100) / prov.Quantity
		if percent == 0 {
			prov.Status = "/static/svg/status0.svg"
		} else if percent < 25 {
			prov.Status = "/static/svg/status25.svg"
		} else if percent < 50 {
			prov.Status = "/static/svg/status40.svg"
		} else if percent == 50 {
			prov.Status = "/static/svg/status50.svg"
		} else if percent < 75 {
			prov.Status = "/static/svg/status75.svg"
		} else if percent > 86 && percent < 90 {
			prov.Status = "/static/svg/status86.svg"
		} else if prov.AlreadyMade == prov.Quantity {
			prov.Status = "/static/svg/status-complete.svg"
		}
		sliceOrdersHTML = append(sliceOrdersHTML, prov)
	}
	return sliceOrdersHTML
}
// This converts the array of the Worker Orders into an array of WorkerOrdersHTML
This converts the array of the Worker Orders into an array of WorkerOrdersHTML
// This converts the array of the Worker Orders into an array of WorkerOrdersHTML
func (VS *Server) toViewWorkerOrdersWorkersView(c *gin.Context, sliceOrders []WorkerOrder) []WorkerOrderHTML {
	var sliceOrdersHTML []WorkerOrderHTML
	var prov WorkerOrderHTML
	for i := 0; i < len(sliceOrders); i++ {
		prov.ID = sliceOrders[i].ID
		product, _ := VS.getVideoCourseByID(c, sliceOrders[i].IDProduct, "h_view", "toViewWorkerOrdersWorkersView", "product, _ := VS.getVideoCourseByID(c, sliceOrders", true)
		prov.Photo = "/local/video-courses/" + product.Name + "/" + product.Photo
		prov.ItemName = product.Name
		prov.DateUnix = time.Unix(sliceOrders[i].Date, 0).UnixNano()
		prov.Date = strconv.Itoa(time.Unix(sliceOrders[i].Date, 0).Day()) + "/" + strconv.Itoa(int(time.Unix(sliceOrders[i].Date, 0).Month()))
		prov.Quantity = sliceOrders[i].Quantity
		prov.AlreadyMade = sliceOrders[i].AlreadyMade
		percent := (prov.AlreadyMade * 100) / prov.Quantity
		if percent == 0 {
			prov.Status = "/static/svg/status0.svg"
		} else if percent < 25 {
			prov.Status = "/static/svg/status25.svg"
		} else if percent < 50 {
			prov.Status = "/static/svg/status40.svg"
		} else if percent == 50 {
			prov.Status = "/static/svg/status50.svg"
		} else if percent < 75 {
			prov.Status = "/static/svg/status75.svg"
		} else if percent > 86 && percent < 90 {
			prov.Status = "/static/svg/status86.svg"
		} else if prov.AlreadyMade == prov.Quantity {
			prov.Status = "/static/svg/status-complete.svg"
		}
		sliceOrdersHTML = append(sliceOrdersHTML, prov)
	}
	return sliceOrdersHTML
}
func ( VS * Server ) toViewWorkerOrdersWorkersView ( c * gin . Context , sliceOrders [ ] WorkerOrder ) [ ] WorkerOrderHTML { var sliceOrdersHTML [ ] WorkerOrderHTML var prov WorkerOrderHTML for i := 0 ; i < len ( sliceOrders ) ; i ++ { prov . ID = sliceOrders [ i ] . ID product , _ := VS . getVideoCourseByID ( c , sliceOrders [ i ] . IDProduct , " " , " " , " " , true ) prov . Photo = " " + product . Name + " " + product . Photo prov . ItemName = product . Name prov . DateUnix = time . Unix ( sliceOrders [ i ] . Date , 0 ) . UnixNano ( ) prov . Date = strconv . Itoa ( time . Unix ( sliceOrders [ i ] . Date , 0 ) . Day ( ) ) + " " + strconv . Itoa ( int ( time . Unix ( sliceOrders [ i ] . Date , 0 ) . Month ( ) ) ) prov . Quantity = sliceOrders [ i ] . Quantity prov . AlreadyMade = sliceOrders [ i ] . AlreadyMade percent := ( prov . AlreadyMade * 100 ) / prov . Quantity if percent == 0 { prov . Status = " " } else if percent < 25 { prov . Status = " " } else if percent < 50 { prov . Status = " " } else if percent == 50 { prov . Status = " " } else if percent < 75 { prov . Status = " " } else if percent > 86 && percent < 90 { prov . Status = " " } else if prov . AlreadyMade == prov . Quantity { prov . Status = " " } sliceOrdersHTML = append ( sliceOrdersHTML , prov ) } return sliceOrdersHTML }
This converts the array of the Worker Orders into an array of WorkerOrdersHTML
This converts the array of the Worker Orders into an array of WorkerOrdersHTML
//This adds the photo //err = v.DataBase.Find(&product, bolthold.Where("ID").Eq(sliceOrders[i].ProductID)) //This adds the date //This adds the Quantity and AlreadyMade //This adds the image to show