<?php

/**
* @version 2.8.14
* @package Joomla 2.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

global $mainframe;
$mevent = $this->getModel('event');
$TableUser = $this->getModel('user')->table;
$status = '';
$attend = '';

$event_options = DtHtml::options($mevent->table->optionslist(),JText::_('DT_SELECT_EVENT'));

?>

	<form name="adminForm" id="emailRegitration" method="post" action="index.php">

	  <table cellpadding="4" cellspacing="1" border="0">

        <tr><td colspan="3"><?php echo JText::_( 'DT_EMAIL_REG_INSTRUCTIONS' ); ?></td></tr>
    
		<tr><td><?php echo JText::_( 'DT_SELECT_EVENT' ); ?>:</td>
			<td><?php echo JHTML::_('select.genericlist', $event_options,'event_id',' class="required" ','value','text','');?></td>
			<td></td></tr>

        <tr><td><?php echo JText::_( 'DT_PAYMENT_STATUS' ); ?>:</td>
	        <td>
                <?php  echo JHTML::_('select.genericlist', DtHtml::options(array(1=>JText::_('DT_PAID'),0=>JText::_('DT_NOT_PAID'),2=>JText::_('DT_BOTH'))),'search[fee_status]',' ','value','text',2) ?>
                <?php $options = array('1'=>JText::_('DT_INCLUDE_FREE_RECORDS'));
	                  echo DtHtml::checkboxList('search[free]',$options,array(1));
	            ?>
            </td>
            <td align="left">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EMAILREG_PAYSTATUS_HELP' )), '', 'tooltip.png', '', ''); ?></td>
	    </tr>
    
        <tr><td><?php echo JText::_( 'DT_ATTENDED' ); ?>:</td>
	        <td>
                <?php echo JHTML::_('select.genericlist', DtHtml::options(array(1=>JText::_('DT_ATTENDED'),0=>JText::_('DT_NOT_ATTENDED'),2=>JText::_('DT_BOTH'))),'search[attend]','','value','text',2)?>
            </td>
            <td align="left">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EMAILREG_ATTENDED_HELP' )), '', 'tooltip.png', '', ''); ?></td>
	    </tr>
    
        <tr><td><?php echo JText::_( 'DT_STATUS' ); ?>:</td>
	        <td>
                <?php echo DtHtml::checkboxList('search[status]',$TableUser->statustxt,array(0,1)); ?>
            </td>
            <td align="left">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EMAILREG_STATUS_HELP' )), '', 'tooltip.png', '', ''); ?></td>
	    </tr>

	    <tr><td><?php echo JText::_( 'DT_FROM_NAME' ); ?>:</td>
		    <td><input type="text" name="from_name" size="50" value="<?php echo $mainframe->getCfg('fromname');?>" /></td>
            <td></td>
        </tr>
      
        <tr><td><?php echo JText::_( 'DT_FROM_EMAIL' ); ?>:</td>
	        <td><input type="text" name="from_email" size="50" value="<?php echo $mainframe->getCfg('mailfrom');?>" /></td>
	        <td></td></tr>

		<tr><td><?php echo JText::_( 'DT_SUBJECT' ); ?>:</td>
			<td><input type="text" class="required" name="subject" size="50" /></td>
			<td></td></tr>
        
        <tr><td><?php echo JText::_( 'DT_BCC' ); ?>:</td>
	        <td><input type="text" name="bcc" size="50" /></td>
	        <td align="left">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_BCC_HELP' )), '', 'tooltip.png', '', ''); ?></td></tr>

		<tr>
         <tr>
         <td><?php echo JText::_( 'DT_ATTACHMENT' ); ?>:</td>
           <td>
            <?php echo $this->attachment_field(); ?>
           </td>
         </tr>
			<td valign="top" style="width:100px;"><?php echo JText::_( 'DT_MESSAGE' ); ?>:
				
				<br /><br />
				
				<p>[ <a href="index.php?option=com_dtregister&controller=event&task=showtags&tmpl=component" class="colorbox"><?php echo JText::_('DT_EMAIL_TAGS_HELP'); ?></a> ]</p>
				
			</td>

			<td>

				<?php

					$editor =& JFactory::getEditor();

					if ($mainframe->getCfg('com_show_editor_buttons')) {

                    	$t_buttons = explode(',', $mainframe->getCfg('com_editor_button_exceptions'));

                    } else {

                    	// hide all

                        $t_buttons = false;

                    }

                    echo $editor->display( 'content', isset($row->content)?$row->content:'', '', '340', '70', '20', $t_buttons,'dt_content');

				?>

			</td>
			
			<td>&nbsp;
				
		    </td>

		</tr>

	</table>

	<input type="hidden" name="option" value="com_dtregister" />
    
    <input type="hidden" name="controller" value="registrantemail" />

	<input type="hidden" name="task" value="" />

</form>
<?php
$document =& JFactory::getDocument();

  $document->addScript( JURI::root(true).'/components/com_dtregister/assets/js/dt_jquery.js');
  $document->addScript( JURI::root(true).'/components/com_dtregister/assets/js/form.js');
  $document->addScript( JURI::root(true).'/components/com_dtregister/assets/js/validate.js');
  $document->addStyleSheet(JURI::root(true).'/components/com_dtregister/assets/css/south-street/jquery-ui.css');
?>
     <script language="JavaScript" type="text/javascript">

	   DTjQuery(function(){
		    DTjQuery(".colorbox").live('click',function(e){		

		e.preventDefault();

		var horizontalPadding = 30;

		var verticalPadding = 30;

		DTjQuery('<iframe id="externalSite" class="externalSite" src="'+DTjQuery(this).attr('href')+'" />').dialog({

			title: '<?php echo JText::_('DT_TAG_DETAILS')?>',

			autoOpen: true,

			width: 800,

			height: 500,

			modal: true,

			resizable: true,

			autoResize: true,

			overlay: {

				opacity: 0.5,

				background: "black"

			}

		}).width(800 - horizontalPadding).height(500 - verticalPadding);

			     });
            DTjQuery(document.adminForm).validate({
				success: function(label) {
					label.addClass("success");
				}

	        });
	   });
 
Joomla.submitbutton = function(pressbutton) {
    
	if(pressbutton == "cancel"){
	   	submitform(pressbutton);
		return;
	}
	if(DTjQuery(document.adminForm).valid()){
	  	submitform(pressbutton);
	}
	
	return false;

}
</script>