<td style="font-weight: bold;">Folding</td>
 </tr> 
 <?php
 //$enteredPlot = EnteredPlotRecipients($company_id_view_plot, $user_id_add_set);
 $enteredPlot = EnteredPlotRecipientsCurrentOption($current_option[0]['id']);
 $i = 1;
 foreach ($enteredPlot as $entered) {
     $rowColor = ($i % 2 != 0) ? '#ffeee1' : '#fff6f0';
     $binding = strtoupper($entered['binding']);
     $folding = strtoupper($entered['folding']);
     $order_type = ($entered['plot_arch'] == '1') ? 'Plotting on Bond' : 'Copies';
     $type = ($entered['plot_arch'] == '1') ? '1' : '0';
     $available_order = ($entered['plot_arch'] == '1') ? EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '1') : EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '0');
     $needed_sets = ($entered['plot_arch'] == '1') ? PlotSetsNeededNew($company_id_view_plot, $user_id_add_set, $entered['options']) : ArchSetsNeededNew($company_id_view_plot, $user_id_add_set, $entered['options']);
     $plot_exist = EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '1');
     $copy_exist = EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '0');
     ?>
     <?php
     if ($entered['plot_arch'] == '1') {
         ?>
         <input type="hidden" id="option_id" value="<?php echo $entered['options']; ?>" />
         <tr bgcolor="#ffeee1">
             <td>Plotting on Bond</td>
             <td><?php echo $available_order[0]['origininals']; ?></td>
             <td><input style="width: 25px;float: left;padding: 2px;" type="text" name="avl_sets_8" id="avl_sets_1" class="avl_sets"  value="<?php echo ($available_order[0]['print_ea'] - $needed_sets); ?>" /><div class="increse_act"><img src="images/plus_icon.png" style="cursor: pointer;" onclick="return increase_qty_avl_plot('8', '<?php echo $user_id_add_set; ?>', '<?php echo $company_id_view_plot; ?>', '1');" title="Increase Quantity" alt="Increase Quantity" /><img src="images/minus_icon.png" style="cursor: pointer;" onclick="return decrease_qty_avl('<?php echo $i; ?>', '<?php echo $user_id_add_set; ?>', '<?php echo $company_id_view_plot; ?>', '<?php echo $type; ?>', '<?php echo $entered['id']; ?>');" title="Decrease Quantity" alt="Decrease Quantity" /></div></td>
             <td><input style="width: 25px;float: left;padding: 2px;" type="text" name="need_sets_8" id="need_sets_1" class="need_sets" value="<?php echo $available_order[0]['print_ea']; ?>" /><div class="increse_act"><img src="images/plus_icon.png" style="cursor: pointer;" onclick="return increase_qty('<?php echo $i; ?>');" title="Increase Quantity" alt="Increase Quantity" /><img src="images/minus_icon.png" style="cursor: pointer;" onclick="return decrease_qty('<?php echo $i; ?>');" title="Decrease Quantity" alt="Decrease Quantity" /></div></td>
             <td><?php echo $entered['size']; ?><input type="hidden" name="size_sets_<?php echo $i; ?>" id="size_sets_<?php echo $i; ?>" value="<?php echo $entered['size']; ?>" /></td>
             <td><?php echo $entered['output']; ?><input type="hidden" name="output_sets_<?php echo $i; ?>" id="output_sets_<?php echo $i; ?>" value="<?php echo $entered['output']; ?>" /></td>
             <td><?php echo $entered['media']; ?><input type="hidden" name="media_sets_<?php echo $i; ?>" id="media_sets_<?php echo $i; ?>" value="<?php echo $entered['media']; ?>" /></td>
             <td><?php echo $binding; ?><input type="hidden" name="binding_sets_<?php echo $i; ?>" id="binding_sets_<?php echo $i; ?>" value="<?php echo $binding; ?>" /></td>
             <td><?php echo $folding; ?><input type="hidden" name="folding_sets_<?php echo $i; ?>" id="folding_sets_<?php echo $i; ?>" value="<?php echo $folding; ?>" /></td>
         <td style="font-weight: bold;">Size</td>
         <td style="font-weight: bold;">Output</td>
         <td style="font-weight: bold;">Media</td>
         <td style="font-weight: bold;">Binding</td>
         <td style="font-weight: bold;">Folding</td>
     </tr> 
     <?php
     $enteredPlot = EnteredPlotRecipients($company_id_view_plot, $user_id_add_set);
     $i = 1;
     foreach ($enteredPlot as $entered) {
         $rowColor = ($i % 2 != 0) ? '#ffeee1' : '#fff6f0';
         $binding = strtoupper($entered['binding']);
         $folding = strtoupper($entered['folding']);
         $order_type = ($entered['plot_arch'] == '1') ? 'Plotting on Bond' : 'Architectural Copies';
         $type = ($entered['plot_arch'] == '1') ? '1' : '0';
         $available_order = ($entered['plot_arch'] == '1') ? EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '1') : EnteredPlotRecipientsCount($company_id_view_plot, $user_id_add_set, '0');
         $needed_sets = ($entered['plot_arch'] == '1') ? PlotSetsNeeded($company_id_view_plot, $user_id_add_set) : ArchSetsNeeded($company_id_view_plot, $user_id_add_set);
         ?>
         <tr bgcolor="<?php echo $rowColor; ?>">
             <td><?php echo $order_type; ?></td>
             <td><?php echo $available_order[0]['print_ea']; ?></td>
             <td><input style="width: 25px;float: left;padding: 2px;" type="text" class="avl_sets" name="avl_sets_<?php echo $i; ?>" id="avl_sets_<?php echo $i; ?>"  value="<?php echo ($available_order[0]['print_ea'] - $needed_sets); ?>" /><div class="increse_act"><img src="images/plus_icon.png" style="cursor: pointer;" onclick="return increase_qty_avl('<?php echo $i; ?>', '<?php echo $user_id_add_set; ?>', '<?php echo $company_id_view_plot; ?>', '<?php echo $type; ?>', '<?php echo $entered['id']; ?>');" title="Increase Quantity" alt="Increase Quantity" /><img src="images/minus_icon.png" style="cursor: pointer;" onclick="return decrease_qty_avl('<?php echo $i; ?>', '<?php echo $user_id_add_set; ?>', '<?php echo $company_id_view_plot; ?>', '<?php echo $type; ?>', '<?php echo $entered['id']; ?>');" title="Decrease Quantity" alt="Decrease Quantity" /></div></td>
             <td><input style="width: 25px;float: left;padding: 2px;" type="text" class="need_sets" name="need_sets_<?php echo $i; ?>" id="need_sets_<?php echo $i; ?>" value="1" /><div class="increse_act"><img src="images/plus_icon.png" style="cursor: pointer;" onclick="return increase_qty('<?php echo $i; ?>');" title="Increase Quantity" alt="Increase Quantity" /><img src="images/minus_icon.png" style="cursor: pointer;" onclick="return decrease_qty('<?php echo $i; ?>');" title="Decrease Quantity" alt="Decrease Quantity" /></div></td>
             <td><?php echo $entered['size']; ?><input type="hidden" name="size_sets_<?php echo $i; ?>" id="size_sets_<?php echo $i; ?>" value="<?php echo $entered['size']; ?>" /></td>
             <td><?php echo $entered['output']; ?><input type="hidden" name="output_sets_<?php echo $i; ?>" id="output_sets_<?php echo $i; ?>" value="<?php echo $entered['output']; ?>" /></td>
             <td><?php echo $entered['media']; ?><input type="hidden" name="media_sets_<?php echo $i; ?>" id="media_sets_<?php echo $i; ?>" value="<?php echo $entered['media']; ?>" /></td>
             <td><?php echo $binding; ?><input type="hidden" name="binding_sets_<?php echo $i; ?>" id="binding_sets_<?php echo $i; ?>" value="<?php echo $binding; ?>" /></td>
             <td><?php echo $folding; ?><input type="hidden" name="folding_sets_<?php echo $i; ?>" id="folding_sets_<?php echo $i; ?>" value="<?php echo $folding; ?>" /></td>
         </tr>
 <?php
 $i++;