<?php
/**
* @package ccNewsletter
* @version 1.0.9
* @author  Chill Creations <info@chillcreations.com>
* @link    http://www.chillcreations.com
* @copyright Copyright (C) 2008 - 2010 Chill Creations-All rights reserved
* @license GNU/GPL, see LICENSE.php for full license.
* See COPYRIGHT.php for more copyright notices and details.

This file is part of ccNewsletter.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
**/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

?>

<?php JHTML::_('behavior.tooltip');
 ?>
<script type="text/javascript">
    window.addEvent('domready', function(){
	   //do your tips stuff in here...
	   var zoomTip = new Tips($$('.hasTip3'), {
	      className: 'custom3', //this is the prefix for the CSS class
	      offsets: {
	  		'x': 20,       //default is 16
	  		'y': 30        //default is 16
              },
	      initialize:function(){
	         this.fx = new Fx.Style(this.toolTip, 'opacity',
	        		 {duration: 1000, wait: false}).set(0);
	      },
	      onShow: function(toolTip) {
	         this.fx.start(0,.8);
	      },
	      onHide: function(toolTip) {
	         this.fx.start(.8,0);
	      }
	   });
	});
</script>

<form action="index.php" method="post" name="adminForm" id="adminForm">
<div class="width-100 fltlft">
<!-- sender setting-->
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_SENDER_SETTING' ); ?></legend>
		<table class="admintable">
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_FROM_NAME_EMAIL' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="fromname" id="fromname" size="50" maxlength="250" value="<?php echo $this->configurationrow->fromname; ?>" />
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_FROM_EMAIL_ADDRESS' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="fromemail" id="fromemail" size="50" maxlength="250" value="<?php echo $this->configurationrow->fromemail; ?>" />
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_TEST_EMAIL_ADDRESS' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="testemail" id="testemail" size="50" maxlength="250" value="<?php echo $this->configurationrow->testemail; ?>" />
			</td>
		</tr>
	</table>
	</fieldset>

<!-- batch setting-->
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_BATCH_SETTINGS' ); ?></legend>
		<table class="admintable">
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_EMAIL_PER_BATCH' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="emailbatch" id="emailbatch" size="50" maxlength="250" value="<?php echo $this->configurationrow->emailbatch; ?>" />
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_BATCH_INTERVAL' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="batchinter" id="batchinter" size="50" maxlength="250" value="<?php echo $this->configurationrow->batchinter; ?>" />
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_SCRIPT_TIMEOUT' ); ?>:
				</label>
			</td>
			<td>
				<input class="text_area" type="text" name="scripttimeout" id="scripttimeout" size="50" maxlength="250" value="<?php echo $this->configurationrow->scripttimeout; ?>" />
			</td>
		</tr>
	</table>
	</fieldset>

<!-- email setting-->
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_EMAIL_SETTINGS' ); ?></legend>
		<table class="admintable">
			<tr>
				<td align="right" class="key">
					<label for="Newsletter Name">
						<?php echo JText::_( 'CC_EXTENDED_EMAIL_VALIDATION' ); ?>:
					</label>
				</td>
				<td>

				<?php
					if($this->configurationrow->extendemail == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
				?>
				<table>
					<tr>
					<td><input type="radio" name="extendemail" value="1" <?php echo $selectBEF; ?> /></td>
					<td> Yes&nbsp;</td>
					<td><input type="radio" name="extendemail" value="0" <?php echo $selectAFT; ?> /></td>
					<td> No</td>
					</tr>
				</table>
				</td>
			</tr>
<tr>
				<td align="right" class="key">
					<label for="Newsletter Name">
						<?php echo JText::_( 'CC_EMBEDDED_IMAGES' ); ?>
					</label>
				</td>
				<?php
					if($this->configurationrow->embeddedimages == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
					?>
				<td>
					<table>
						<tr>
						<td><input type="radio" name="embeddedimages" value="1" <?php echo $selectBEF; ?> /></td>
						<td>Yes&nbsp;</td>
						<td><input type="radio" name="embeddedimages" value="0" <?php echo $selectAFT; ?> /></td>
						<td>No</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</fieldset>

<!-- Acknowledgement  setting-->
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_ACKNOWLEDGEMENT_SETTING' ); ?></legend>
		<table class="admintable">
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_TOOLTIP' ) ?>"><?php echo JText::_( 'CC_ACKNOWLEDGEMENT_OFF' ); ?>:</div>
				</label>
			</td>
			<td>
				<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_TOOLTIP' ) ?>">
					<?php
						if($this->configurationrow->acknowledgeoff == "1")
						{
							$selectBEF = "checked";
							$selectAFT = "";

						}else
						{
							$selectBEF = "";
							$selectAFT = "checked";
						}
					?>
					<table>
						<tr>
						<td><input type="radio" name="acknowledgeoff" value="1" <?php echo $selectBEF; ?> /></td>
						<td> Yes&nbsp;</td>
						<td><input type="radio" name="acknowledgeoff" value="0" <?php echo $selectAFT; ?> /></td>
						<td> No</td>
						</tr>
					</table>
				</div>
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_SYNC_TOOLTIP' ) ?>"><?php echo JText::_( 'CC_SYN_ACKNOWLEDGEMENT_ON' ); ?>:</DIV>
				</label>
			</td>
			<td>
				<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_SYNC_TOOLTIP' ) ?>">
					<?php
						if($this->configurationrow->acknowledgeon == "1")
						{
							$selectBEF = "checked";
							$selectAFT = "";

						}else
						{
							$selectBEF = "";
							$selectAFT = "checked";
						}
					?>
					<table>
						<tr>
						<td><input type="radio" name="acknowledgeon" value="1" <?php echo $selectBEF; ?> /></td>
						<td> Yes&nbsp;</td>
						<td><input type="radio" name="acknowledgeon" value="0" <?php echo $selectAFT; ?> /></td>
						<td> No</td>
						</tr>
					</table>

				</DIV>
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_EMAIL_ACTIVATION' ); ?>:
				</label>
			</td>
			<td>
				<?php
					if($this->configurationrow->emailactivation == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
				?>
				<table>
					<tr>
					<td><input type="radio" name="emailactivation" value="1" <?php echo $selectBEF; ?> /></td>
					<td> Yes&nbsp;</td>
					<td><input type="radio" name="emailactivation" value="0" <?php echo $selectAFT; ?> /></td>
					<td> No</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td  align="right" class="key">
				<label for="Newsletter Name">
					<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_EMAIL_DEACT_TOOLTIP' ) ?>"><?php echo JText::_( 'CC_EMAIL_DEACTIVATION' ); ?>:</DIV>
				</label>
			</td>
			<td>
				<div class="hasTip" title="<?php echo JText::_( 'CC_ACKNOWLEDGEMENT_EMAIL_DEACT_TOOLTIP' ) ?>">
				<?php
					if($this->configurationrow->deactivation == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
				?>
				<table>
					<tr>
					<td><input type="radio" name="deactivation" value="1" <?php echo $selectBEF; ?> /></td>
					<td> Yes&nbsp;</td>
					<td><input type="radio" name="deactivation" value="0" <?php echo $selectAFT; ?> /></td>
					<td> No</td>
					</tr>
				</table>
				</DIV>
			</td>
		</tr>

	</table>
	</fieldset>

<!-- SECURITY  setting-->
	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_SECURITY_SETTING' ); ?></legend>
		<table class="admintable">
			<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_CAPTCHA_LBL' ); ?>:
				</label>
			</td>
			<td>
				<?php
					if($this->configurationrow->captcha == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
				?>
				<table>
					<tr>
					<td><input type="radio" name="captcha" value="1" <?php echo $selectBEF; ?> /></td>
					<td> Yes&nbsp;</td>
					<td><input type="radio" name="captcha" value="0" <?php echo $selectAFT; ?> /></td>
					<td> No</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td align="right" class="key">
				<label for="Newsletter Name">
					<?php echo JText::_( 'CC_SHOW_UNSUBSCRIBE_BUTTON' ); ?>:
				</label>
			</td>
			<td>
				<?php
					if($this->configurationrow->unsubscribebt == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
				?>
				<table>
					<tr>
					<td><input type="radio" name="unsubscribebt" value="1" <?php echo $selectBEF; ?> /></td>
					<td> Yes&nbsp;</td>
					<td><input type="radio" name="unsubscribebt" value="0" <?php echo $selectAFT; ?> /></td>
					<td> No</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	</fieldset>

	<fieldset class="adminform">
		<legend><?php echo JText::_( 'CC_OTHER_SETTING' ); ?></legend>
		<table class="admintable">
			<tr>
				<td align="right" class="key">
					<label for="Newsletter Name">
						<?php echo JText::_( 'CC_DATE_FORMAT' ); ?>:
					</label>
				</td>
				<td>
					<table><tr><td>
						<input type="text" name="date_format" value="<?php echo $this->configurationrow->date_format; ?>" size="30"/>
					</td></tr>
					<tr><td>
					<div>
					<?php
						if(@$this->configurationrow->date_format != '')
						{
							$label1 = sprintf ( JText::_( 'CC_CONFIG_DATE_FORMAT_LABEL1' ), strftime($this->configurationrow->date_format, time()));
					 	?>
							<a href="http://php.net/manual/en/function.strftime.php" target="_blank"><?php echo $label1; ?></a>
						<?php
						}else
						{
							$jversion = new JVersion();
							$current_version =  $jversion->getShortVersion();
							$curver= substr($current_version,0,3);

							$label2 = sprintf ( JText::_( 'CC_CONFIG_DATE_FORMAT_LABEL1' ), strftime('%d-%m-%Y', time()));

					 	?>
							<a href="http://php.net/manual/en/function.strftime.php" target="_blank"><?php echo $label2; ?></a>
						<?php
						}
					 ?>
					 </td></tr></table>
				</td>
			</tr>
			<tr>
				<td align="right" class="key">
					<label for="Newsletter Name">
						<div class="hasTip" title="<?php echo JText::_( 'CC_OTHER_SYNC_ALLUSER_TOOLTIP' ) ?>"><?php echo JText::_( 'CC_SYN_ALL_USER' ); ?>:</DIV>
					</label>
				</td>
				<td>
					<div class="hasTip" title="<?php echo JText::_( 'CC_OTHER_SYNC_ALLUSER_TOOLTIP' ) ?>">
					<?php
					if($this->configurationrow->syncalluser == "1")
					{
						$selectBEF = "checked";
						$selectAFT = "";

					}else
					{
						$selectBEF = "";
						$selectAFT = "checked";
					}
					?>
					<table>
						<tr>
						<td><input type="radio" name="syncalluser" value="1" <?php echo $selectBEF; ?> /></td>
						<td> Yes&nbsp;</td>
						<td><input type="radio" name="syncalluser" value="0" <?php echo $selectAFT; ?> /></td>
						<td> No</td>
						</tr>
					</table>
				</td>
			</tr>

		</table>
	</fieldset>


</div>
<div class="clr"></div>
<input type="hidden" name="option" value="com_ccnewsletter" />
<input type="hidden" name="id" value="<?php echo $this->configurationrow->id; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="configuration" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<p class="copyright" style="text-align:center;" >
<?php echo $this->name; ?>&nbsp;<?php echo $this->version; ?>. Copyright (C) 2006 - <?php echo $curYear = date('Y'); ?>  Chill Creations<br/>Joomla! component by <a href="http://www.chillcreations.com" target="_blank">Chill Creations</a>
</p>
