                                <div class="form form-profile" style='width:100%'>

                               <form action="exportCsvToPayViaAuthorize" method="post">

                               <table class="admintable" id="projects_table" style="width: 95%">
                                    <tr>
										<th>Img</th>
										<th>Title</th>
										<th>Author</th>
										<th>Date Posted</th>
										<th>Feat</th>
										<th>Feat2</th>
										<th>Backed | Goal | Paid
											<FORM>
												<INPUT TYPE="button" onClick="history.go(0)" VALUE="Ref">
											</FORM>
										</th>

										<th>Export</th>
										<th>$ Payout.</th>
										<th>Actions</th>
									</tr>

                                    <?php

                                    foreach ($projects as $project) {
                                        if ($project['is_featured'] & FLAG_FEATURED) {
											$featured = 'checked="checked"';
										} else {
											$featured = '';
										}
										if ($project['is_featured'] & FLAG_STAFFPICK) {
											$staffpick = 'checked="checked"';
										} else {
											$staffpick = '';
										}

										if ($project['backed_amount']>=$project['budget']&FLAG_GOAL) {
											$goal = 'checked="checked"';
										} else {
											$goal = '';
										}
										$todayPay='';

										$backed_amount=$project['backed_amount'];
										
										$ptite = substr($project['title'],0,20).'...';							
										
										if(is_null($backed_amount)){$backed_amount=0.00;}

                                        echo
                                        "<tr>
											<td style='max-width:50px;'>
												<img src='/{$project['main_img']}' alt='img'
												onerror=\"this.src='/static/system/placeholderthumb.jpg'\" 
												style='max-width:50px;' />
											</td>
                                            <td style='max-width:150px; overflow:hidden; line-height:22px;'>
												{$ptite}
											</td>
                                            <td>{$project['user']['name']}</td>
                                            <td>{$project['timestamp_posted']}</td>
                                            <td style='text-align:center'><input flag='" . FLAG_FEATURED . "' type='checkbox' class='featured' $featured id='{$project['id']}' /></td>
                                            <td style='text-align:center'><input flag='" . FLAG_STAFFPICK . "' type='checkbox' class='featured' $staffpick id='{$project['id']}' /></td>
                                            <td>";

                                        echo sprintf("%.2f" . " | ", $backed_amount);
                                       echo  "{$project['budget']} | {$project['already_paid']}</td>
                                            <td style='text-align:center'>

                                             <input id='{$project['id']}' value='{$project['id']}' type='checkbox' name='export_list[]' $goal  />

                                             <input type='hidden' name='backed_amount[]' value='{$project['backed_amount']}'/>
                                             <input type='hidden' name='already_paid[]' value='{$project['already_paid']}'/>
                                            <input type='hidden' name='id[]' value='{$project['id']}'/>
                                            </td>
                                            <td style='text-align:center'>
                                            <input style='width: 100px;' name='todaypay' class='todayPay' value='$todayPay' id='{$project['id']}' /></td>
                                            </td>
                                            <td><a href='/project/{$project['id']}/edit' class='confirm'>edit</a> | <a href='?delete={$project['id']}' class='confirm'>delete</a></td>
                                        </tr>";
                                    }

                                    ?>


                                </table>
								<br />
                                <em>$ Payout = fill this in to pay a different amount than the goal or balance</em><br />
                                <em>Check Export column if you want to add this amount to the csv to be exported to Authorize.net and paid out</em>

                                 <br /><br />
                                 <input type="submit" value="Export to csv" /> &nbsp;
                                 <input id='markpaid' value='' type='checkbox' name='payChecked' />
                                 <label for='markpaid'>Mark as Paid</label>
                                    </form>



                                </div><div class="clear;"></div>
                            