<?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
*/

$editor =& JFactory::getEditor();
$row = $this->row;
?>

<table class="adminform" width="100%" cellpadding="10" cellspacing="10">
	
    <tr align="center" valign="middle">
      <td align="left" valign="top"><strong><?php echo JText::_( 'DT_EVENT_ADMIN_EMAIL' ); ?>:</strong>
      	<br /><br />
		<div class="dtenable"><?php echo JText::_( 'DT_EVENT_ADMIN_EMAIL_FEATURE' );?>: </div>
		<?php echo JHTMLSelect::booleanlist("data[event][event_admin_email_set]","",$row->event_admin_email_set); ?>
      </td>
      <td align="left" valign="top">
      		<br />
            <table style="padding:2px; border:0">
	        <tr><td align="left">
			<?php echo JText::_( 'DT_FROM_NAME' ); ?>: 
			</td>
			<td align="left">
			<input type="text" class="" name="data[event][event_admin_email_from_name]" value="<?php echo $row->event_admin_email_from_name; ?>" size="50" />
            </td></tr>
            <tr><td align="left">
            <?php echo JText::_( 'DT_FROM_EMAIL' ); ?>: 
            </td>
            <td align="left">
            <input type="text" name="data[event][event_admin_email_from_email]" value="<?php echo $row->event_admin_email_from_email; ?>" size="50" />
            </td></tr>
            </table>
      </td>
      <td colspan="2" align="left" valign="top">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_ADMIN_EMAIL_HELP' )), '', 'tooltip.png', '', ''); ?>
      </td>
	</tr>
	
	<tr><td colspan="3"><hr></td></tr>
    
    <tr align="center" valign="middle">

     <td align="left" valign="top"><strong><?php echo JText::_( 'DT_CUSTOM_THANKS' ); ?>:</strong>

      	<br /><br /><div class="dtenable"><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: </div>
                 <?php echo JHTMLSelect::booleanlist("data[event][thksmsg_set]","",$row->thksmsg_set); ?>
                 
                 <p><br />[ <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 align="left" valign="top">
       <?php echo $editor->display("data[event][thksmsg]",stripslashes($row->thksmsg),'','340','70','20','0'); ?>
     </td>

		 <td colspan="2" align="left" valign="top">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_CUSTOM_THANKS_HELP' )), '', 'tooltip.png', '', ''); ?>

     </td>

	  </tr>
    
    <tr align="center" valign="middle">

      	<td align="left" valign="top"><strong><?php echo JText::_( 'DT_EVENT_ADMIN_NOTIFICATION' ); ?>:</strong>
             		<br /><br /><div class="dtenable"><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: </div>
                    <?php echo JHTMLSelect::booleanlist("data[event][admin_notification_set]","",$row->admin_notification_set); ?>
  <p><br />[ <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 align="left" valign="top">
		      <?php echo $editor->display("data[event][admin_notification]",stripslashes($row->admin_notification),'','340','70','20','0'); ?>
      </td>

		<td colspan="2" align="left" valign="top">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_ADMIN_NOTIFICATION_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>
      
    <tr>

		      <th colspan="4" style="background: #d3e8c1; padding:5px;"><?php echo JText::_( 'DT_EMAIL_FILE_ATTACHMENT' ); ?></th>

		    </tr>

		 <tr>

       		 <td>

       		    <?php echo JText::_( 'DT_SELECT_FILE' ); ?>:&nbsp;

             	<script type="text/javascript">

                 DTjQuery(function(){
                        
						//jQuery('.fields').trigger('click');
						
				        DTjQuery(".remove_file").click(function(event){

					        event.preventDefault();

						    element = this;

					    	DTjQuery.get(DTjQuery(this).attr('href'), function(data){

								DTjQuery(element).parent().parent().remove();

						    });

						    return false;

					});

                	var fileMax = 10;

                	DTjQuery("input#upload").change(function(){

                		doIt(this, fileMax);

                	});

                });	

                function doIt(obj, fm) {

                	if(DTjQuery('input[id="upload"]').size() > fm) {alert('Max files is '+fm); obj.value='';return true;}

                	//DTjQuery(obj).hide();

                	//DTjQuery(obj).parent().prepend('<input type="hidden" class="upload" name="event_files[]" value="'+obj.value+'" />').find("input:first").change(function() {doIt(this, fm)});

                	var v = obj.value;
                    obj.value = "";
               		 if(v != '') {

                		DTjQuery("div#files_list").append('<div><input type="hidden" class="upload" name="event_files[]" value="'+v+'" />'+v+' <input type="button" class="remove" value="Delete" /></div>')

                		.find("input").click(function(){

               			 	DTjQuery(this).parent().remove();

                			//DTjQuery(obj).remove();

                			return true;

                		});

                	}

                };


	</script>

    <span>
			<!--input type="file" name="event_files[]" class="upload"/ -->
  <?php echo $this->email_attachment(); ?>
            <div id="files_list">

            </div>

            </span>

        	</td>

        	<td>

        	  <?php echo JText::_( 'DT_FILE_ATTACHMENT_HELP' ); ?>

        	</td>
        	
        	<td colspan="2">&nbsp;</td>

        </tr>

     <?php 
	  
	  if($row->slabId==""){
	      echo $this->loadTemplate('copyfile');
	  }else{
	   echo $this->loadTemplate('editfile');
	  }
       
	 ?>
</table>