<?php include("class.upload.php"); ?>
<?php include ("class.upload.inc.php") ?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php include ("db.php") ?>
<?php include ("phpmkrfn.php") ?>
<?php

// debug
//error_reporting( E_ALL );
error_reporting( 0 );

ini_set( "include_path", "../" );
include 'includes/pnAPI.php';
pnInit();
ini_set( "include_path", "/medialisting/" );

define("PRINT_LISTING", 1);
define("PSD_LISTING", 2);

function handleImagesUpload()
{
  // handle upload image
  $x_submit_image_error = '';
  $x_medialisting_image = '';
  $file_upload_error_text = '';

  $x_submit_image = @$_POST['submit_image'];
  if ( isset( $x_submit_image ) )
  {
    $MyObject = new upload($_FILES['image_field']);
    $MyObject->mime_check = false;
    $MyObject->image_convert = false;

    $x_submit_image_error .= $MyObject->log;
    $x_submit_image_error .= '<hr>';
    if ( $MyObject->uploaded )
    {
      $images_file_name = $MyObject->file_src_name_body;
      $images_file_name = str_replace ( array ( ' ' ), array ( '_' ), $images_file_name );

      // save unconverted image
      $MyObject->file_new_name_body     = $images_file_name;
      $MyObject->process( IMAGE_PATH );

      if ($MyObject->processed)
      {
        $x_medialisting_image = $MyObject->file_dst_name;
        $_SESSION['medialisting_image'] = $x_medialisting_image;

        $x_submit_image_error .= 'original image<br />';
        $x_submit_image_error .= '<b>file_src_pathname</b>:  ' . $MyObject->file_src_pathname . '<br>';
        $x_submit_image_error .= '<img src="' . IMAGE_URL . $x_medialisting_image . '"><br>';


        $x_submit_image_error .= 'image resized<br />';
        $x_submit_image_error .= $MyObject->log;
        $x_submit_image_error .= '<b>file_dst_pathname</b>:  ' . $MyObject->file_dst_pathname . '<br>';
        $x_submit_image_error .= '<img src="' . IMAGE_URL . $MyObject->file_dst_name . '"><br>';

        $MyObject->clean();
      }
      else
      {
        $x_submit_image_error .= 'error : ' . $MyObject->error;
        $x_submit_image_error .= $MyObject->log;
      }
    }
    else
    {
      $x_submit_image_error .= 'error : ' . $MyObject->error;
      $x_submit_image_error .= $MyObject->log;
    }

    if ( !$MyObject->processed || !$MyObject->uploaded )
    {
      $file_upload_error_text = $MyObject->error;
    }
  }

//  echo "<h1>Log</h1>";
//  echo "x_submit_image_error: $x_submit_image_error<br />";
//  echo "x_medialisting_image: $x_medialisting_image<br />";
//  echo "file_upload_error_text: $file_upload_error_text<br />";
//  echo "image:        " . $_SESSION['medialisting_image'] . "<br />";

}

function getRegionText( $region_id )
{
  $returnText = "";
  switch ( $region_id )
  {
  case 0:   
    $returnText = "Everywhere";
    break;
  case 1:   
    $returnText = "Denver Metro/Boulder";
    break;
  case 2:   
    $returnText = "Northern Colorado";
    break;
  }
  return $returnText;
}

function getMediaText( $media_id )
{
  $returnText = "";
  switch ( $media_id )
  {
  case 1:   
    $returnText = "Print Listing";
    break;
  case 2:   
    $returnText = "PSD Activity Guide Listing";
    break;
  }
  return $returnText;
}

function getIssueText( $issue_id )
{
  $returnText = "";
  switch ( $issue_id )
  {
  case 1:   
    $returnText = "September -- Classes/Lessons";
    break;
  case 2:   
    $returnText = "October -- Family Health Guide";
    break;
  case 3:   
    $returnText = "November -- Thanksgiving to GO!";
    break;
  case 4:   
    $returnText = "Holiday Guide issue -- Photo or Gift Card Photo";
    break;
  case 5:   
    $returnText = "February -- Special Delivery! Baby/New Mom Guide";
    break;
  case 6:   
    $returnText = "March -- Super Summer Camp Guide";
    break;
  case 7:   
    $returnText = "April -- Best Birthday Parties Guide";
    break;
  case 8:   
    $returnText = "May -- Home Sweet Home Services Guide";
    break;
  case 9:   
    $returnText = "Summer -- Schools/Academic Guide";
    break;
  case 10:  
    $returnText = "August 2007";
    break;
  case 11:  
    $returnText = "January 2008";
    break;
  case 12:  
    $returnText = "March 2008";
    break;
  case 13:  
    $returnText = "All 2007-2008";
    break;
  }
  return $returnText;
}

function getAccountManagerText( $account_manager_id )
{
  $returnText = "";
  switch ( $account_manager_id )
  {
  case 0:   
    $returnText = "I don't know";
    break;
  case 1:   
    $returnText = "Dondee";
    break;
  case 2:   
    $returnText = "Ellen";
    break;
  case 3:   
    $returnText = "Kara";
    break;
  case 4:   
    $returnText = "Laura";
    break;
  case 5:   
    $returnText = "Marcia";
    break;
  case 6:   
    $returnText = "Mary";
    break;
  }
  return $returnText;
}

function getAccountManagerEmail( $account_manager_id )
{
  $account_manager_email = "";
  switch ( $account_manager_id )
  {
  case 0: // I don't know
    $account_manager_email = "";
    break;
  case 1: // Dondee
    $account_manager_email = "dondee@kidspages.org";
    break;
  case 2: // Ellen
    $account_manager_email = "";
    break;
  case 3: // Kara
    $account_manager_email = "kara@kidspages.org";
    break;
  case 4: // Laura
    $account_manager_email = "laura@kidspages.org";
    break;
  case 5: // Marcia
    $account_manager_email = "marcia@kidspages.org";
    break;
  case 6: // Mary
    $account_manager_email = "mary@kidspages.org";
    break;
  }
  return $account_manager_email;
}


//  $listing_type = @$_GET['listing_type'];

  $listing_type = @$_REQUEST['listing_type'];
  if ( empty( $listing_type ) )
  {
//  echo "redir: error 001";
    pnRedirect("http://kidspages.org");
  }

//  echo "listing_type: " . $listing_type . "<br />";


// get action
$a = @$_POST["a"];
if (empty($a))
{
  $key = @$_GET["key"];
  if ($key <> "")
  {
    $a = "C"; // copy record
  }
  else
  {
    $a = "I"; // display blank record
  }
}

// open connection to the database
$conn = mysql_connect(HOST, USER, PASS);
mysql_select_db(DB);
switch ($a)
{
  case "A": // add
    handleImagesUpload();

    $x_image_form = @$_FILES['image_field']['name'];

    // get the form values
    $x_image              = @$_SESSION['medialisting_image'];

//    $x_listing_type       = @$_POST["x_listing_type"];
    $x_company_name       = @$_POST["x_company_name"];
    $x_region_id          = @$_POST["x_region_id"];
    $x_issue_id           = @$_POST["x_issue_id"];
    $x_media_id           = @$_POST["x_media_id"];
    $x_account_manager_id = @$_POST["x_account_manager_id"];
    $x_description        = @$_POST["x_description"];
    $x_website_address    = @$_POST["x_website_address"];
    $x_address1           = @$_POST["x_address1"];
    $x_address2           = @$_POST["x_address2"];
    $x_city               = @$_POST["x_city"];
    $x_state              = @$_POST["x_state"];
    $x_zip                = @$_POST["x_zip"];
    $x_phone              = @$_POST["x_phone"];
    $x_email_address      = @$_POST["x_email_address"];

    // company_name
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_company_name) : $x_company_name;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`company_name`"] = $theValue;

    // image
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_image) : $x_image;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`image`"] = $theValue;

    // description
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_description) : $x_description;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`description`"] = $theValue;

    // region_id
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_region_id) : $x_region_id;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "'0'"; // can't be null
    $fieldList["`region_id`"] = $theValue;

    // issue_id
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_issue_id) : $x_issue_id;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`issue_id`"] = $theValue;

    // media_id
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_media_id) : $x_media_id;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`media_id`"] = $theValue;

    // account_manager_id
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_account_manager_id) : $x_account_manager_id;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`account_manager_id`"] = $theValue;

    // website_address
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_website_address) : $x_website_address;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`website_address`"] = $theValue;

    // address1
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_address1) : $x_address1;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`address1`"] = $theValue;

    // address2
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_address2) : $x_address2;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`address2`"] = $theValue;

    // city
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_city) : $x_city;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`city`"] = $theValue;

    // state
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_state) : $x_state;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`state`"] = $theValue;

    // zip
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_zip) : $x_zip;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`zip`"] = $theValue;

    // phone
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_phone) : $x_phone;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`phone`"] = $theValue;

    // email_address
    $theValue = (!get_magic_quotes_gpc()) ? addslashes($x_email_address) : $x_email_address;
    $theValue = ($theValue != "") ? " '" . $theValue . "'" : "NULL";
    $fieldList["`email_address`"] = $theValue;

    // insert into database
    $strsql = "INSERT INTO `kpl_listings` (";
    $strsql .= implode(",", array_keys($fieldList));
    $strsql .= ") VALUES (";
    $strsql .= implode(",", array_values($fieldList));
    $strsql .= ")";

    mysql_query($strsql, $conn) or die(mysql_error());
    mysql_close($conn);

/////////////////////////////////////////////////////////////
    $subject = "Listing Submission";

    $submitdate = date("F j, Y, g:i a");
    $submitip = getenv("REMOTE_ADDR");

    $message = "";
    $message .= $submitdate . "\n";
    $message .= $submitip . "\n";
    $message .= "\n\n";

    $account_manager_text     = getAccountManagerText( $x_account_manager_id );
    $issue_text               = getIssueText( $x_issue_id );
    $media_text               = getMediaText( $x_media_id );
    $region_text              = getRegionText( $x_region_id );
    $account_manager_email    = getAccountManagerEmail( $x_account_manager_id );

    $message .= "Company_name:    \n$x_company_name\n\n";
    $message .= "Address1:        \n$x_address1\n\n";
    $message .= "Address2:        \n$x_address2\n\n";
    $message .= "City:            \n$x_city\n\n";
    $message .= "State:           \n$x_state\n\n";
    $message .= "Zip:             \n$x_zip\n\n";
    $message .= "Phone:           \n$x_phone\n\n";
    $message .= "Email:           \n$x_email_address\n\n";
    $message .= "Website:         \n$x_website_address\n\n";

    $message .= "Region:          \n$region_text\n\n";
    $message .= "Issue:           \n$issue_text\n\n";
    $message .= "Media:           \n$media_text\n\n";
    $message .= "Account Manager: \n$account_manager_text\n\n";
    $message .= "Image:           \n$x_image\n\n";
    $message .= "Description:     \n$x_description\n\n";

    // To send HTML mail, you can set the Content-type header.
    $headers  = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
    $headers .= "From: Listing Submission <home@kidspages.org>\r\n";

    // and now mail it
    @mail( 'contest@kidspages.org', $subject, $message, $headers);
    @mail( 'home@kidspages.org', $subject, $message, $headers);
    @mail( 'marcia@kidspages.org', $subject, $message, $headers);
    if ( !empty( $account_manager_email ) )
    {
      @mail( $account_manager_email, $subject, $message, $headers);
    }

    if ( !empty( $x_email_address ) )
    {
      $message = "Thank you for your $media_text submission. Here's what we received:\n";

      if ( !empty( $x_company_name ) ) $message .= $x_company_name . "\n";
      if ( !empty( $x_address1 ) )     $message .= $x_address1 . "\n";
      if ( !empty( $x_address2 ) )     $message .= $x_address2 . "\n";
      if ( !empty( $x_city ) )         $message .= $x_city;
      if ( !empty( $x_state ) )        $message .= ", " . $x_state;
      if ( !empty( $x_zip ) )          $message .= "  " . $x_zip;
      $message .= "\n\n";


      if ( !empty( $x_phone ) )                  $message .= "Phone: " . $x_phone . "\n";
      if ( !empty( $x_email_address ) )          $message .= "E-Mail: " . $x_email_address . "\n";
      if ( !empty( $x_website_address ) )        $message .= "Website: " .  $x_website_address . "\n";
      $message .= "\n";

      if ( !empty( $x_description ) )            $message .= "Description:\n" . $x_description . "\n";
      $message .= "\n";

      if ( !empty( $x_image ) )                  $message .= "Image: " . $x_image . "\n";

      if ( !empty( $issue_text ) )               $message .= "Issue: " . $issue_text . "\n";
      if ( !empty( $account_manager_text ) )     $message .= "Account Manager: " . $account_manager_text . "\n";

      if ( $x_media_id == PRINT_LISTING && !empty( $region_text ) )  $message .= "Region: " . $region_text . "\n";

      $subject = "Kids' Pages $media_text Submission";

      $headers  = "MIME-Version: 1.0\r\n";
      $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
      $headers .= "From: Kids' Pages <home@kidspages.org>\r\n";

      @mail( $x_email_address, $subject, $message, $headers);
    }


/////////////////////////////////////////////////////////////

    ob_end_clean();
    unset( $_SESSION['medialisting_image'] );

// echo "<hr />";
// echo "<hr />";
// echo $strsql;
// echo "<hr />";
// echo "<hr />";
// 
// echo $message;

    header("Location: thankyou.php");
    break;
}

  $psdlisting_check = @$_SESSION['psdlisting_check'];
  $printlisting_check = @$_SESSION['printlisting_check'];

  $x_media_id = 0;
  $max_words = 60;

  if ( $listing_type == "psd" && $psdlisting_check == '1' )
  {
    $x_media_id = PSD_LISTING;
    $max_words = 25;
  }
  else if ( $listing_type == "print" && $printlisting_check == '1' )
  {
    $x_media_id = PRINT_LISTING;
    $max_words = 60;
  }
  else
  {
//  echo "redir: error 002<br />";
    pnRedirect("http://kidspages.org");
  }


  if ( empty( $x_region_id ) )
  {
    $x_region_id = "1";
  }

  if ( empty( $x_issue_id ) )
  {
    if ( $x_media_id == PRINT_LISTING )
    {
      $x_issue_id = "1";
    }
    else
    {
      $x_issue_id = "10";
    }
  }

  if ( empty( $x_media_id ) )
  {
    $x_media_id = "0";
  }

  if ( empty( $x_account_manager_id ) )
  {
    $x_account_manager_id = "0";
  }

  if ( empty( $x_image_form ) )
  {
    $x_image_form = "";
  }

?>
<?php include ("header.php") ?>
<?php

  switch ( $x_media_id )
  {
    case PRINT_LISTING:
      showHeader( "Print Listing", $max_words );
      break;

    case PSD_LISTING:
      showHeader( "PSD Activity Guide Listings", $max_words );
      break;

    default:
      showHeader( "Listing", $max_words );
      break;
  }
?>

<script language="JavaScript" src="ew.js"></script>
<script language="JavaScript">
<!-- start Javascript
function  EW_checkMyForm(EW_this) {
return true;
}

var wordsToGo = <?php echo $max_words; ?>;
function checkSmallPrint()
{
  var the_box = window.document.kplisting.x_small_print;
  var the_switch = "";
  if (the_box.checked == true && wordsToGo >= 0 ) {
    document.kplisting.action1.disabled = false;
    document.kplisting.action2.disabled = false;
  } else {
    document.kplisting.action1.disabled = true;
    document.kplisting.action2.disabled = true;
  }
}

// end JavaScript -->
</script>
<script language="JavaScript">
// Toggles the layer visibility on
function showLayer(layerName)
{
  document.getElementById(layerName).style.visibility="visible";
}

// Toggles the layer visibility off
function hideLayer(layerName)
{
  document.getElementById(layerName).style.visibility="hidden";
}

function word_count(text, doc)
{
  text = text.replace(/^\s*|\s*$/g,''); //removes whitespace from front and end
  var count_array = text.split(" ");
  wordsToGo = <?php echo $max_words; ?> - count_array.length;
  if ( wordsToGo < 0 )
  {
    doc.value = (-wordsToGo) + " words over!";
    doc.style.backgroundColor = "red";
    doc.style.color = "white";
  }
  else
  {
    doc.value = wordsToGo;
    doc.style.backgroundColor = "white";
    doc.style.color = "black";
  }
  checkSmallPrint();
}

</script>

<form name="kplisting" onSubmit="return EW_checkMyForm(this);"  action="medialisting.php" method="post" enctype="multipart/form-data">
<input type="submit" name="action1" value="Submit Listing" disabled="true">
<br /><br />

<input type="hidden" name="a" value="A">

<?php
    echo "<input name=\"x_media_id\" value=\"$x_media_id\" type=\"hidden\" />";
    echo "<input name=\"listing_type\" value=\"$listing_type\" type=\"hidden\" />";

?>

<table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC">


<!--
<tr>
  <td bgcolor="#00CCFF" valign="top"><font color="#000000"><font class="phpmaker">Media</font>&nbsp;</font></td>
  <td bgcolor="#F5F5F5">
  <font class="phpmaker">
    <input type="radio" id="media_id_1" name="x_media_id"<?php if ($x_media_id == "1") { echo " checked"; } ?> value="<?php echo htmlspecialchars("1"); ?>"><label for="media_id_1"><?php echo "Print"; ?></label><br />
    <input type="radio" id="media_id_2" name="x_media_id"<?php if ($x_media_id == "2") { echo " checked"; } ?> value="<?php echo htmlspecialchars("2"); ?>"><label for="media_id_2"><?php echo "PSD Activity Guide Listings"; ?></label>
  </font>&nbsp;</td>
</tr>
-->

<?php
if ( $x_media_id == PRINT_LISTING )
{
?>

<tr>
  <td bgcolor="#00CCFF" valign="top"><font color="#000000"><font class="phpmaker">Region</font>&nbsp;</font></td>
  <td bgcolor="#F5F5F5">
  <font class="phpmaker">
    <input type="radio" id="region_id_0" name="x_region_id"<?php if ($x_region_id == "0") { echo " checked"; } ?> value="<?php echo htmlspecialchars("0"); ?>"><label for="region_id_0"><?php echo "Everywhere"; ?></label><br />
    <input type="radio" id="region_id_1" name="x_region_id"<?php if ($x_region_id == "1") { echo " checked"; } ?> value="<?php echo htmlspecialchars("1"); ?>"><label for="region_id_1"><?php echo "Denver Metro/Boulder"; ?></label><br />
    <input type="radio" id="region_id_2" name="x_region_id"<?php if ($x_region_id == "2") { echo " checked"; } ?> value="<?php echo htmlspecialchars("2"); ?>"><label for="region_id_2"><?php echo "Northern Colorado"; ?></label>
  </font>&nbsp;</td>
</tr>

<tr>
  <td bgcolor="#00CCFF" valign="top"><font color="#000000"><font class="phpmaker">Issue</font>&nbsp;</font></td>
  <td bgcolor="#F5F5F5">
  <font class="phpmaker">
<!--
    <input type="radio" id="issue_id_1" name="x_issue_id"<?php if ($x_issue_id == "1") { echo " checked"; } ?> value="<?php echo htmlspecialchars("1"); ?>"><label for="issue_id_1"><?php echo "September -- Classes/Lessons"; ?></label><br />
    <input type="radio" id="issue_id_2" name="x_issue_id"<?php if ($x_issue_id == "2") { echo " checked"; } ?> value="<?php echo htmlspecialchars("2"); ?>"><label for="issue_id_2"><?php echo "October -- Family Health Guide"; ?></label><br />
-->
    <input type="radio" id="issue_id_3" name="x_issue_id"<?php if ($x_issue_id == "3") { echo " checked"; } ?> value="<?php echo htmlspecialchars("3"); ?>"><label for="issue_id_3"><?php echo "November -- Thanksgiving to GO!"; ?></label><br />
    <input type="radio" id="issue_id_4" name="x_issue_id"<?php if ($x_issue_id == "4") { echo " checked"; } ?> value="<?php echo htmlspecialchars("4"); ?>"><label for="issue_id_4"><?php echo "Holiday Guide issue -- Photo or Gift Card Photo"; ?></label><br />
    <input type="radio" id="issue_id_5" name="x_issue_id"<?php if ($x_issue_id == "5") { echo " checked"; } ?> value="<?php echo htmlspecialchars("5"); ?>"><label for="issue_id_5"><?php echo "February -- Special Delivery! Baby/New Mom Guide"; ?></label><br />
    <input type="radio" id="issue_id_6" name="x_issue_id"<?php if ($x_issue_id == "6") { echo " checked"; } ?> value="<?php echo htmlspecialchars("6"); ?>"><label for="issue_id_6"><?php echo "March -- Super Summer Camp Guide"; ?></label><br />
    <input type="radio" id="issue_id_7" name="x_issue_id"<?php if ($x_issue_id == "7") { echo " checked"; } ?> value="<?php echo htmlspecialchars("7"); ?>"><label for="issue_id_7"><?php echo "April -- Best Birthday Parties Guide"; ?></label><br />
    <input type="radio" id="issue_id_8" name="x_issue_id"<?php if ($x_issue_id == "8") { echo " checked"; } ?> value="<?php echo htmlspecialchars("8"); ?>"><label for="issue_id_8"><?php echo "May -- Home Sweet Home Services Guide"; ?></label><br />
    <input type="radio" id="issue_id_9" name="x_issue_id"<?php if ($x_issue_id == "9") { echo " checked"; } ?> value="<?php echo htmlspecialchars("9"); ?>"><label for="issue_id_9"><?php echo "Summer -- Schools/Academic Guide"; ?></label><br />
  </font>&nbsp;</td>
</tr>

<?php
}
else
{
?>

<tr>
  <td bgcolor="#00CCFF" valign="top"><font color="#000000"><font class="phpmaker">Issue</font>&nbsp;</font></td>
  <td bgcolor="#F5F5F5">
  <font class="phpmaker">
    <input type="radio" id="issue_id_10" name="x_issue_id"<?php if ($x_issue_id == "10") { echo " checked"; } ?> value="<?php echo htmlspecialchars("10"); ?>"><label for="issue_id_10"><?php echo "August 2007"; ?></label><br />
    <input type="radio" id="issue_id_11" name="x_issue_id"<?php if ($x_issue_id == "11") { echo " checked"; } ?> value="<?php echo htmlspecialchars("11"); ?>"><label for="issue_id_11"><?php echo "January 2008"; ?></label><br />
    <input type="radio" id="issue_id_12" name="x_issue_id"<?php if ($x_issue_id == "12") { echo " checked"; } ?> value="<?php echo htmlspecialchars("12"); ?>"><label for="issue_id_12"><?php echo "March 2008"; ?></label><br />
    <input type="radio" id="issue_id_13" name="x_issue_id"<?php if ($x_issue_id == "13") { echo " checked"; } ?> value="<?php echo htmlspecialchars("13"); ?>"><label for="issue_id_13"><?php echo "All 2007-2008"; ?></label><br />
  </font>&nbsp;</td>
</tr>

<?php
}
?>

<tr>
  <td bgcolor="#00CCFF" valign="top"><font color="#000000"><font class="phpmaker">Account Manager</font>&nbsp;</font></td>
  <td bgcolor="#F5F5F5">
  <font class="phpmaker">
    <input type="radio" id="account_manager_id_0" name="x_account_manager_id"<?php if ($x_account_manager_id == "0") { echo " checked"; } ?> value="<?php echo htmlspecialchars("0"); ?>"><label for="account_manager_id_0"><?php echo "I don't know"; ?></label><br />
    <input type="radio" id="account_manager_id_1" name="x_account_manager_id"<?php if ($x_account_manager_id == "1") { echo " checked"; } ?> value="<?php echo htmlspecialchars("1"); ?>"><label for="account_manager_id_1"><?php echo "Dondee"; ?></label><br />
    <input type="radio" id="account_manager_id_2" name="x_account_manager_id"<?php if ($x_account_manager_id == "2") { echo " checked"; } ?> value="<?php echo htmlspecialchars("2"); ?>"><label for="account_manager_id_2"><?php echo "Ellen"; ?></label><br />
    <input type="radio" id="account_manager_id_3" name="x_account_manager_id"<?php if ($x_account_manager_id == "3") { echo " checked"; } ?> value="<?php echo htmlspecialchars("3"); ?>"><label for="account_manager_id_3"><?php echo "Kara"; ?></label><br />
    <input type="radio" id="account_manager_id_4" name="x_account_manager_id"<?php if ($x_account_manager_id == "4") { echo " checked"; } ?> value="<?php echo htmlspecialchars("4"); ?>"><label for="account_manager_id_4"><?php echo "Laura"; ?></label><br />
    <input type="radio" id="account_manager_id_5" name="x_account_manager_id"<?php if ($x_account_manager_id == "5") { echo " checked"; } ?> value="<?php echo htmlspecialchars("5"); ?>"><label for="account_manager_id_5"><?php echo "Marcia"; ?></label><br />
    <input type="radio" id="account_manager_id_6" name="x_account_manager_id"<?php if ($x_account_manager_id == "6") { echo " checked"; } ?> value="<?php echo htmlspecialchars("6"); ?>"><label for="account_manager_id_6"><?php echo "Mary"; ?></label><br />
  </font>&nbsp;</td>
</tr>


<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Company Name</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_company_name" size="50" maxlength="255" value="<?php echo htmlspecialchars(@$x_company_name); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Website</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_website_address" size="50" maxlength="255" value="<?php echo htmlspecialchars(@$x_website_address); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Address</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_address1" size="50" maxlength="255" value="<?php echo htmlspecialchars(@$x_address1); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Address Line 2</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_address2" size="50" maxlength="255" value="<?php echo htmlspecialchars(@$x_address2); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">City</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_city" size="50" maxlength="50" value="<?php echo htmlspecialchars(@$x_city); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">State</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_state" size="2" maxlength="2" value="<?php echo htmlspecialchars(@$x_state); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Zip</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_zip" size="12" maxlength="12" value="<?php echo htmlspecialchars(@$x_zip); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Phone</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_phone" size="50" maxlength="50" value="<?php echo htmlspecialchars(@$x_phone); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">E-Mail</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><input type="text" name="x_email_address" size="50" maxlength="50" value="<?php echo htmlspecialchars(@$x_email_address); ?>"></font>&nbsp;</td>
</tr>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Description</font>&nbsp;</font></td>

<td bgcolor="#F5F5F5">
  <font class="phpmaker"><textarea  onkeyup="word_count(this.value, textcount)" name="x_description" cols="50" rows="8"><?php echo @$x_description ?></textarea></font>
  <div style="font-size:10px;padding-bottom:2px;">Words to go: <input type="text" name="textcount" value="<?php echo $max_words; ?>" style="background-color:white;width:95px;font-size:10px;" disabled /><br /></div>
</td>
</tr>

<?php
if ( $x_media_id == PRINT_LISTING )
{
?>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">Image</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5">
  <font class="phpmaker">
    Browse to the image you want to upload.<br />
    <input name="submit_image" value="1" type="hidden" />
    <input type="file" size="50" name="image_field" value="<?php echo @$x_image_form ?>" />
  </font>
</td>
</tr>

<?php
}
?>

<tr>
<td bgcolor="#00CCFF"><font color="#000000"><font class="phpmaker">The Small Print</font>&nbsp;</font></td>
<td bgcolor="#F5F5F5"><font class="phpmaker"><div style="float:left;height:55px;"><input type="checkbox" name="x_small_print" value="1" id="smprt" onClick="checkSmallPrint();"></div><label for="smprt">I acknowledge that it is my responsibility to meet the listing deadlines. I understand that if I do not submit the listings written in third person and send them in the format as indicated above, that my submitted listings will be edited and I’ll receive no proof of this edited copy.</label></font>&nbsp;</td>
</tr>

</table>

<br />
<input type="submit" name="action2" value="Submit Listing" disabled="true">
</form>


<?php include ("footer.php") ?>
<?php // show_vars(); ?>
