discourse-legacysite-perl/site/slowtwitch.com/www/adio/include_buttons.php
2024-06-17 22:30:36 +10:00

83 lines
3.8 KiB
PHP

<?PHP
if(is_logged_in($user)){
//Get user's uid
//$testresults = mysql_query("SELECT user_id FROM ".$prefix."User WHERE user_username=\"$username\"") or die(mysql_error());
//$testrow = mysql_fetch_array($testresults);
//$useruid = $testrow[user_id];
$useruid = base64_decode($_SESSION['user_id']);
// is the current user the owner of the advertiser?
$advertiser_submitted_by = FALSE;
if($useruid == $row[account_user_id_fk]){
$advertiser_submitted_by = TRUE;
}
if (eregi("advertiser_account.php", $_SERVER['SCRIPT_NAME'])) {
?>
<div>
<? if(is_admin($user)){ ?>
<form method="post" action="<? echo "advertiser_edit.php?account_id=$row[account_id]"; ?>" style="display: inline;">
<input type="submit" value="Edit account" class="btn" />
</form>
<form method="post" action="delete_X.php" style="display: inline;">
<input type="hidden" name="account_id" value="<? echo($row[account_id]); ?>" />
<input type="submit" value="Delete this advertiser" class="btn" onclick="return confirm('Are you sure you want to DELETE this advertiser?');" />
</form>
<? } ?>
</div>
<? } elseif (eregi("campaign_detail.php", $_SERVER['SCRIPT_NAME'])) { ?>
<div>
<? if(is_admin($user)){ ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="invoice" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as invoiced" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as INVOICED?');" />
</form>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="screenshot" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as screenshot" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as SCREENSHOT?');" />
</form>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="deploy" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Mark as deployed" class="btn" onclick="return confirm('Are you sure you want to mark this campaign as DEPLOYED?');" />
</form>
<br /><br />
<form method="post" action="<? echo "campaign_edit.php?campaign_id=$row[campaign_id]"; ?>" style="display: inline;">
<input type="submit" value="Edit campaign" class="btn" />
</form>
<form method="post" action="delete_X.php" style="display: inline;">
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="Delete this campaign" class="btn" onclick="return confirm('Are you sure you want to DELETE this campaign?');" />
</form>
<? if ($row[campaign_archive] == 1) { ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="unarchive" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="*UN*archive this campaign" class="btn" onclick="return confirm('Are you sure you want to *UN*ARCHIVE this campaign?');" />
</form>
<? } else { ?>
<form method="post" action="campaign_quick_edit_X.php" style="display: inline;">
<input type="hidden" name="action" value="archive" />
<input type="hidden" name="campaign_id" value="<? echo($row[campaign_id]); ?>" />
<input type="submit" value="archive this campaign" class="btn" onclick="return confirm('Are you sure you want to ARCHIVE this campaign?');" />
</form>
<? } ?>
<? } ?>
</div>
<? } } ?>