<?PHP 

include("config.php");

if(!is_admin($user)){
  header('Location:'.$site_url.'/');
}

$account_idhere = mysql_escape_string($_GET[account_id]);
$results = mysql_query("SELECT * FROM io_account WHERE account_id=".$account_idhere." LIMIT 1");
$row = mysql_fetch_array($results);
if (!$row){header('Location: '.$site_url.'/?error=invalid_id');}

// set the page title
$pagetitle = $row[account_advertiser];

// set meta tags

?>

<? include("include_common_head.php"); ?>

<body class="listings">
  <? include($common_path . "/ads/ad_wallpaper.html"); ?>

  <div class="container">
    <? include($common_path . "/templates/include_header.php"); ?>
    <div class="main">
      <div class="contentwrapper clearfix">
        <? include("include_breadcrumb.php"); ?>

        <section class="section listings section-has-widgets section-static remove-sidebar">
          <div class="sidebar-b">
            <? include("include_sidebar.php"); ?>
          </div>

          <div class="content content-has-widgets">
            <div class="grid">

              <div class="clearfix">
                <h1 class="float-left">Advertisers: Individual Account</h1>
                <? if ($user) { ?>
                <form method="post" action="account_edit.php?account_id=<? echo $row[account_id] ?>">
                  <input type="submit" value="Edit" class="nobutton btn btn-white float-right">
                </form>
                <? } ?>
                <a href="" class="btn btn-white float-right">Back</a>
                <hr class="line" />
                <div class="details grid">
                  <div class="col-6-12">
                    <h2><? echo stripslashes(stripslashes($row[account_advertiser])) ; echo " "; ?></h2>
                  </div>
                  <div class="col-6-12 address">
                  </div>
                  <div class="col-6-12 contact">
                    
                  </div>
                  <div class="clearfix"></div>
                  
                  <br />
                  <div class="col-1-1">
                    <? include("include_buttons.php"); ?>
                  </div>
                  <div class="col-1-1 detail-block">
                    <h3>Main Point(s) of Contact</h3>
                    <div class="highlight-block">
                      Contact Name: <? echo stripslashes(htmlspecialchars($row[account_contact])); ?>
                      <br />
                      Email: <a href="mailto:<? echo $row[account_email]; ?>"><? echo stripslashes(htmlspecialchars($row[account_email])); ?></a><br />
                      Phone: <? echo stripslashes(htmlspecialchars($row[account_phone])); ?>
                    </div>
                  </div>
                  <div class="col-1-1 detail-block">
                    <h3>Mailing Address</h3>
                    <div class="highlight-block">
                     <? echo stripslashes(htmlspecialchars($row[account_address])); ?><br />
                    <? if ( $row[account_address_two] )  { echo stripslashes(htmlspecialchars($row[account_address_two]) . "<br />"); } ?>
                    <? echo stripslashes(htmlspecialchars($row[account_city])); ?>, <? echo stripslashes(htmlspecialchars($row[account_state])); ?> <? echo stripslashes(htmlspecialchars($row[account_zip])); ?><br />
                    </div>
                  </div>
                  <div class="col-1-1 detail-block">
                    <h3>Campaigns</h3>
                    <div class="highlight-block">
                      <strong>Active Campaigns:</strong>
                      <br />
                      <strong>Archived Campaigns:</strong>
                      
                    </div>
                  </div>
                  <div class="col-1-1 detail-block">
                    <h3>Account Notes</h3>
                    <div class="highlight-block">
                      <strong>Invoice Via:</strong> 
                      <? 	
						$certification_list = "";
						$temp[] = $row[account_invoice];
						foreach($temp as $value) {
							if ($value == "0") $certification_list = $certification_list."Snail, ";
							if ($value == "1") $certification_list = $certification_list."Email";
						};
	
						$certification_list = rtrim($certification_list, ', ');
	
						echo $certification_list; 
					  ?><br />
                      <strong>Notes:</strong> <? echo stripslashes(htmlspecialchars($row[account_notes])); ?><br />
                    </div>
                  </div>
                </div>

                <div class="content-divider-bottom"></div>
                <? include ('comments_show.php'); ?>

              </div><!-- end col-2/3 -->

            </div><!-- end grid -->
          </div><!-- end content -->
        </section>

      </div><!-- end contentwrapper -->
    </div> <!-- end main -->

  <? include($common_path . "/templates/include_footer.php") ?>
  </div> <!-- container  -->
</body>
<? include($common_path . "/templates/include_global_js.php") ?>
</html>
