<?php

/*

 osCommerce, Open Source E-Commerce Solutions 
http://www.oscommerce.com 

Copyright (c) 2003 osCommerce 

osCommRes, Services Oline 
http://www.oscommres.com 
Copyright (c) 2005 osCommRes 

Freeway eCommerce 
http://www.zac-ware.com/freeway 
Copyright (c) 2007 ZacWare

Released under the GNU General Public License
*/

  require('includes/application_top.php');
  tep_get_last_access_file();require(DIR_WS_CLASSES . 'currencies.php');
  require(DIR_FS_ADMIN . 'includes/languages/'. $language .'/admin_letters.php');
  $server_date = getServerDate(true);	
  $currencies = new currencies();
  
  $command=isset($HTTP_GET_VARS['command'])?$HTTP_GET_VARS['command']:'';
	
 if($command!=''){
     if($command=='preview'){
	 
	 		 if ((!$HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['email_to']) ) {
			  	   echo ERROR_NO_CUSTOMER_SELECTED;
				  exit;
  				}
	 		   echo 'preview';
			    if ( !$HTTP_POST_VARS['amount'])  echo '#'.ERROR_NO_AMOUNT_SELECTED;
				
			switch ($HTTP_POST_VARS['customers_email_address']) {
			  case '***':
				$mail_sent_to = TEXT_ALL_CUSTOMERS;
				break;
			  case '**D':
				$mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
				break;
			  default:
				$mail_sent_to = $HTTP_POST_VARS['customers_email_address'];
				if ($HTTP_POST_VARS['email_to']) {
				  $mail_sent_to = $HTTP_POST_VARS['email_to'];
				}
				break;
			}
?>
          <tr><?php //echo tep_draw_form('mail', FILENAME_GV_MAIL, 'action=send_email_to_user'); ?>
            <td>
				<table border="0" width="100%" cellpadding="0" cellspacing="2">
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_CUSTOMER; ?></b><br><?php echo $mail_sent_to; ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_FROM; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['from'])); ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_SUBJECT; ?></b><br><?php echo htmlspecialchars(stripslashes($HTTP_POST_VARS['subject'])); ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b><?php echo TEXT_AMOUNT; ?></b><br><?php echo nl2br(htmlspecialchars(stripslashes($HTTP_POST_VARS['amount']))); ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="smallText"><b>  <?php if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Enable') { echo (stripslashes($HTTP_POST_VARS['message'])); } else { echo htmlspecialchars(stripslashes($HTTP_POST_VARS['message'])); } ?></td>
              </tr>
              <tr>
                <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td>
<?php
/* Re-Post all POST'ed variables */
    reset($HTTP_POST_VARS);
    while (list($key, $value) = each($HTTP_POST_VARS)) {
      if (!is_array($HTTP_POST_VARS[$key])) {
        echo tep_draw_hidden_field($key.'_h', htmlspecialchars(stripslashes($value)));
      }
    }
?>
                <table border="0" width="100%" cellpadding="0" cellspacing="2">
                  <tr>
                    <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_MAIL) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a> ' .'<a href="javascript:send_mail()">' . tep_image_button('button_send_email.gif', IMAGE_SEND_EMAIL) .'</a>'; ?></td>
                    </tr>
                    <td class="smallText">
                <?php if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Disable'){echo tep_image_button('button_back.gif', IMAGE_BACK, 'name="back"');
                } ?><?php if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Disable') {echo(TEXT_EMAIL_BUTTON_HTML);
                 } else { 
				 			 echo TEXT_EMAIL_BUTTON_TEXT ; 
						} ?>
                    </td>
                  </tr>
                </table></td>
             </tr>
            </table></td>
          </tr>
<?php
	 }else if($command=='send_email_to_user'){
	 	     echo 'mail_sent';
		switch ($HTTP_POST_VARS['customers_email_address_h']) {
		  case '***':
			$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS);
			$mail_sent_to = TEXT_ALL_CUSTOMERS;
			break;
		  case '**D':
			$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");
			$mail_sent_to = TEXT_NEWSLETTER_CUSTOMERS;
			break;
		  default:
			$customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address_h']);
	
			$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($customers_email_address) . "'");
			$mail_sent_to = $HTTP_POST_VARS['customers_email_address_h'];
			if ($HTTP_POST_VARS['email_to_h']) {
			  $mail_sent_to = $HTTP_POST_VARS['email_to_h'];
			}
			break;
		}
			echo $mail_sent_to;
			$from = tep_db_prepare_input($HTTP_POST_VARS['from_h']);
			$subject = tep_db_prepare_input($HTTP_POST_VARS['subject_h']);
			while ($mail = tep_db_fetch_array($mail_query)) {
			  $id1 = create_coupon_code($mail['customers_email_address_h']);
			  $message = $HTTP_POST_VARS['message_h'];
			  $message .= "\n\n" . TEXT_GV_WORTH  . $currencies->format($HTTP_POST_VARS['amount_h']) . "\n\n";
			  $message .= TEXT_TO_REDEEM;
			  $message .= TEXT_WHICH_IS . $id1 . TEXT_IN_CASE . "\n\n";
			  if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {
				$message .= HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '/gv_no,'.$id1 . "\n\n";
			  } else {
				$message .= HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1 . "\n\n";
			  }
			  $message .= TEXT_OR_VISIT . HTTP_SERVER  . DIR_WS_CATALOG . TEXT_ENTER_CODE;
		
			  //Let's build a message object using the email class
			  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
			  // add the message to the object
			  $mimemessage->add_text($message);
			  $mimemessage->build_message();
			
			  $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', $from, $subject);
			  if($HTTP_POST_VARS['amount_h']=="") $HTTP_POST_VARS['amount_h']=0;
			  // Now create the coupon main and email entry
			  $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $HTTP_POST_VARS['amount_h'] . "',' " . $server_date . "')");
			  $insert_id = tep_db_insert_id($insert_query);
			  $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $mail['customers_email_address'] . "',' " . $server_date . " ')"); 
			}
			if ($HTTP_POST_VARS['email_to_h']) {
			  $id1 = create_coupon_code($HTTP_POST_VARS['email_to_h']);
			  $message = tep_db_prepare_input($HTTP_POST_VARS['message_h']);
			  $message .= "\n\n" . TEXT_GV_WORTH  . $currencies->format($HTTP_POST_VARS['amount_h']) . "\n\n";
			  $message .= TEXT_TO_REDEEM;
			  $message .= TEXT_WHICH_IS . $id1 . TEXT_IN_CASE . "\n\n";
			  $message .= HTTP_SERVER  . DIR_WS_CATALOG . 'gv_redeem.php' . '?gv_no='.$id1 . "\n\n";
			  $message .= TEXT_OR_VISIT . HTTP_SERVER  . DIR_WS_CATALOG  . TEXT_ENTER_CODE;
			 
			  //Let's build a message object using the email class
			  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
			  // add the message to the object
		// MaxiDVD Added Line For WYSIWYG HTML Area: BOF (Send TEXT Email when WYSIWYG Disabled)
			if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Disable') {
			$mimemessage->add_text($message);
			} else {
			$mimemessage->add_html($message);
			}
		// MaxiDVD Added Line For WYSIWYG HTML Area: EOF (Send HTML Email when WYSIWYG Enabled)
		
			  $mimemessage->build_message();
			  $mimemessage->send('Friend', $HTTP_POST_VARS['email_to_h'], '', $from, $subject);
			  // Now create the coupon email entry
			  $insert_query = tep_db_query("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $HTTP_POST_VARS['amount_h'] . "','" . $server_date . "')");
			  $insert_id = tep_db_insert_id($insert_query);
			  $insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, emailed_to, date_sent) values ('" . $insert_id ."', '0', 'Admin', '" . $HTTP_POST_VARS['email_to_h'] . "', '" . $server_date . "' )"); 
			}
		//    tep_redirect(tep_href_link(FILENAME_GV_MAIL, 'mail_sent_to=' . urlencode($mail_sent_to)));
			 }else if($command=='tbl_write'){
			 		echo 'tbl_write';
					table_write();
			 }
	 
	 exit;
 }

  if ( ($HTTP_GET_VARS['action'] == 'send_email_to_user') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) && (!$HTTP_POST_VARS['back_x']) ) {}

  if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['customers_email_address']) && (!$HTTP_POST_VARS['email_to']) ) {
    $messageStack->add(ERROR_NO_CUSTOMER_SELECTED, 'error');
  }

  if ( ($HTTP_GET_VARS['action'] == 'preview') && (!$HTTP_POST_VARS['amount']) ) {
    $messageStack->add(ERROR_NO_AMOUNT_SELECTED, 'error');
  }

  if ($HTTP_GET_VARS['mail_sent_to']) {
    $messageStack->add(sprintf(NOTICE_EMAIL_SENT_TO, $HTTP_GET_VARS['mail_sent_to']), 'notice');
  }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/menu.js"></script>
<script language="javascript" src="includes/http.js"></script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="htmlarea/editor.js"></script>
</head>
      <!-- <script language="JavaScript" src="htmlarea/validation.js"></script>-->
       <script language="JavaScript">
<!-- Begin
       function init() {
define('customers_email_address', 'string', 'Customer or Newsletter Group');
} <!-- start of validaton.js -->
// Generic Form Validation
// Jacob Hage (jacob@hage.dk)
var checkObjects        = new Array();
var errors                = "";
var returnVal                = false;
var language                = new Array();
language["header"]        = ""
language["start"]        = "Please Select a ";
language["field"]        = "";
language["require"]        = " from the drop down list to proceed.";
language["min"]                = " and must consist of at least ";
language["max"]                = " and must not contain more than ";
language["minmax"]        = " and no more than ";
language["chars"]        = " characters";
language["num"]                = " and must contain a number";
language["email"]        = " must contain a valid e-mail address";
// -----------------------------------------------------------------------------
// define - Call this function in the beginning of the page. I.e. onLoad.
// n = name of the input field (Required)
// type= string, num, email (Required)
// min = the value must have at least [min] characters (Optional)
// max = the value must have maximum [max] characters (Optional)
// d = (Optional)
// -----------------------------------------------------------------------------
function define(n, type, HTMLname, min, max, d) { 
var p;
var i;
var x;
if (!d) d = document;
if ((p=n.indexOf("?"))>0&&parent.frames.length) {
d = parent.frames[n.substring(p+1)].document;
n = n.substring(0,p);
}
if (!(x = d[n]) && d.all) x = d.all[n];
for (i = 0; !x && i < d.forms.length; i++) {
x = d.forms[i][n];
}
for (i = 0; !x && d.layers && i < d.layers.length; i++) {
x = define(n, type, HTMLname, min, max, d.layers[i].document);
return x;
}
eval("V_"+n+" = new formResult(x, type, HTMLname, min, max);");
checkObjects[eval(checkObjects.length)] = eval("V_"+n);
}
function formResult(form, type, HTMLname, min, max) {
this.form = form;
this.type = type;
this.HTMLname = HTMLname;
this.min  = min;
this.max  = max;
}
function validate() {  
if (checkObjects.length > 0) {
errorObject = "";
for (i = 0; i < checkObjects.length; i++) {
validateObject = new Object();
validateObject.form = checkObjects[i].form;
validateObject.HTMLname = checkObjects[i].HTMLname;
validateObject.val = checkObjects[i].form.value;
validateObject.len = checkObjects[i].form.value.length;
validateObject.min = checkObjects[i].min;
validateObject.max = checkObjects[i].max;
validateObject.type = checkObjects[i].type;
if (validateObject.type == "num" || validateObject.type == "string") {
if ((validateObject.type == "num" && validateObject.len <= 0) || (validateObject.type == "num" && isNaN(validateObject.val))) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['require'] + language['num'] + "\n";
} else if (validateObject.min && validateObject.max && (validateObject.len < validateObject.min || validateObject.len > validateObject.max)) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['require'] + language['min'] + validateObject.min + language['minmax'] + validateObject.max+language['chars'] + "\n";
} else if (validateObject.min && !validateObject.max && (validateObject.len < validateObject.min)) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['require'] + language['min'] + validateObject.min + language['chars'] + "\n";
} else if (validateObject.max && !validateObject.min &&(validateObject.len > validateObject.max)) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['require'] + language['max'] + validateObject.max + language['chars'] + "\n";
} else if (!validateObject.min && !validateObject.max && validateObject.len <= 0) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['require'] + "\n";
   }
} else if(validateObject.type == "email") {
// Checking existense of "@" and ".".
// Length of must >= 5 and the "." must
// not directly precede or follow the "@"
if ((validateObject.val.indexOf("@") == -1) || (validateObject.val.charAt(0) == ".") || (validateObject.val.charAt(0) == "@") || (validateObject.len < 6) || (validateObject.val.indexOf(".") == -1) || (validateObject.val.charAt(validateObject.val.indexOf("@")+1) == ".") || (validateObject.val.charAt(validateObject.val.indexOf("@")-1) == ".")) { errors += language['start'] + language['field'] + validateObject.HTMLname + language['email'] + "\n"; }
      }
   }
}
if (errors) {
alert(language["header"].concat("\n" + errors));
errors = "";
returnVal = false;
} else {
command="";
command="<?php echo tep_href_link(FILENAME_GV_MAIL,'command=preview');?>";
//alert(document.getElementById('customers_email_address').value);
do_post_command('mail',command);

//returnVal = true;
   }
}

function send_mail(){
command="";
command="<?php echo tep_href_link(FILENAME_GV_MAIL,'command=send_email_to_user');?>";
do_post_command('mail',command);

}

function do_result(result){ 

		if(result.substr(0,7)=='preview'){
			if(document.getElementById('preview')) {
					result = result.substr(7);
					if(result.indexOf("#")!= -1){ 
						var error;
						error = result.substr(1,35);
						result=result.substr(35);
						document.getElementById('error').innerHTML=error;
						document.getElementById('error').style.display='';
						document.getElementById('error').className='main';
						document.getElementById('preview').innerHTML=result;
						document.getElementById('preview').style.display='';
						document.getElementById('phase1').style.display='none';
					}else {
						document.getElementById('preview').innerHTML=result;
						document.getElementById('preview').style.display='';
						document.getElementById('phase1').style.display='none';
					}
			}
		} 
		else  if(result.substr(0,9)=='mail_sent') { 
				document.getElementById('sent_to').value = result.substr(9);
				command ="<?php echo tep_href_link(FILENAME_GV_MAIL,'command=tbl_write');?>";
				do_get_command(command);
		}
		else if(result.substr(0,9)=='tbl_write'){
			if(document.getElementById('phase1')) {
					document.getElementById('phase1').innerHTML='';
					document.getElementById('phase1').innerHTML=result.substr(9);
					document.getElementById('phase1').style.display='';
					document.getElementById('preview').style.display='none';
					document.getElementById('error').innerHTML="<?php echo 'Notice: Email sent to: '; ?>"+ document.getElementById('sent_to').value;
					document.getElementById('error').className='main';
					document.getElementById('error').style.display='';
					initEditor('message');
					init();
				}
		}else if(result.substr(0,5)=='Error'){
		 document.getElementById('error').innerHTML = result;
		 document.getElementById('error').className='main';
		 }
}

//  End -->
</script>
</head>
<body OnLoad="init()" marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<script>initEditor('message');</script>
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
 <?php echo tep_draw_form('mail', FILENAME_GV_MAIL, 'action=preview'); ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
  <tr> 
<!-- body_text //-->
    <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <!--<td class="pageHeading"><?php //echo HEADING_TITLE; ?></td>
            <td class="pageHeading" align="right"><?php //echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>!-->
          </tr>
        </table></td>
      </tr>
	  <tr><td id="error"></td>
	  <tr><td id="preview"></td> </tr>
	 
      <tr>
	  <input type="hidden" id="sent_to">
        <td id="phase1"><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
  if ( ($HTTP_GET_VARS['action'] == 'preview') && ($HTTP_POST_VARS['customers_email_address'] || $HTTP_POST_VARS['email_to']) ) {} else { echo table_write(); }
  
  function table_write(){
?>	<table border="0" cellpadding="0" cellspacing="2">
          <tr>
            <td><table border="0" cellpadding="0" cellspacing="2">
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
<?php
    $customers = array();
    $customers[] = array('id' => '', 'text' => TEXT_SELECT_CUSTOMER);
    $customers[] = array('id' => '***', 'text' => TEXT_ALL_CUSTOMERS);
    $customers[] = array('id' => '**D', 'text' => TEXT_NEWSLETTER_CUSTOMERS);
    $mail_query = tep_db_query("select customers_email_address, customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " order by customers_lastname");
    while($customers_values = tep_db_fetch_array($mail_query)) {
      $customers[] = array('id' => $customers_values['customers_email_address'],
                           'text' => $customers_values['customers_lastname'] . ', ' . $customers_values['customers_firstname'] . ' (' . $customers_values['customers_email_address'] . ')');
    }
?>
              <tr>
                <td class="main"><?php echo TEXT_CUSTOMER; ?></td>
                <td><?php echo tep_draw_pull_down_menu('customers_email_address', $customers, $HTTP_GET_VARS['customer']);?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
               <tr>
                <td class="main"><?php echo TEXT_TO; ?></td>
                <td><?php echo tep_draw_input_field('email_to'); ?><?php echo '&nbsp;&nbsp;' . TEXT_SINGLE_EMAIL; ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
             <tr>
                <td class="main"><?php echo TEXT_FROM; ?></td>
                <td><?php echo tep_draw_input_field('from', EMAIL_FROM); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td class="main"><?php echo TEXT_SUBJECT; ?></td>
                <td><?php echo tep_draw_input_field('subject'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_AMOUNT; ?></td>
                <td><?php echo tep_draw_input_field('amount'); ?></td>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                <td valign="top" class="main"><?php echo TEXT_MESSAGE; ?></td>
                <td><?php echo tep_draw_textarea_field('message', 'soft', '90', '24','','id="message"'); ?></td>
          </script>
              </tr>
              <tr>
                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
              </tr>
              <tr>
                 <td colspan="2" align="right">
                 <?php if (HTML_AREA_WYSIWYG_DISABLE_EMAIL == 'Enable'){ echo tep_image_submit('button_send_email.gif', IMAGE_SEND_EMAIL, 'onClick="validate();return returnVal;"');
                   } else {
                echo tep_image_submit('button_send_email.gif', IMAGE_SEND_EMAIL); }?>
                </td>
              </tr>
            </table></td>
         </tr></table>
<?php
  }
?>
<!-- body_text_eof //-->
        </table></td>
      </tr>
    </table></td>
  </tr>
</table></form>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
