<?php

/**
* @version 2.6.9
* @package Joomla 1.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
*/

  jimport('joomla.html.pane');

  $pane =& JPane::getInstance('tabs');

	$database = &JFactory::getDBO();
  $editor =& JFactory::getEditor();
  require("../components/com_dtregister/config.dtregister.php");

	$event_id = isset($eventcopy->eventId)?$eventcopy->eventId:'';
  global $usetimecheck ;
	$dt_evt =  new Event($event_id);

	$dt_evt->over_ride_global(true);
	
	$prerequisite = $dt_evt->findall();
	
  $cardtypearr=explode(",",$cardtype);

	jimport('joomla.html.select');

	$document	=& JFactory::getDocument();

	$document->addScript( JURI::root(true).'/components/com_dtregister/assets/js/jquery.js');

	$options=array();

	$options[]=JHTML::_('select.option',"individual","Individual");

  $options[]=JHTML::_('select.option',"group","Group");

  $options[]=JHTML::_('select.option',"both","Both");

  $registration_type = isset($eventcopy->registration_type)?$eventcopy->registration_type:'individual';

	$lists["registration_type"]=JHTML::_('select.genericlist', $options,'registration_type','','value','text',$registration_type);

	error_reporting(1);

	 	 $sql = "SELECT DISTINCT e.evdet_id, e.summary, e.dtstart , e.dtend FROM #__jevents_vevdetail e inner join #__jevents_vevent je on je.detail_id = e.evdet_id inner join #__jevents_rrule r on je.ev_id = r.eventid left join #__dtregister_group_event g on e.evdet_id=g.eventId WHERE g.slabID is null and e.dtend > ".time()."  and r.freq = 'none' and je.state > 0 ";

	  	$database->setQuery($sql);

	  	$rows = $database->loadObjectList();

	    $events=array();

	    $events[]=JHTML::_('select.option',"","Select Event");

	    for ($i=0,$n=count($rows);$i<$n;$i++){

	    	$row = $rows[$i];

	    	$catId = $row->evdet_id;

	    	$catName = tmpl_event_name($event_show_date,$row->summary,get_date($row->dtstart));

	    	$events[]=JHTML::_('select.option',$catId,$catName);

	    }

     $loc = new DTlocation($database);

	   $locations = $loc->find();

	   $locationsOpts[]=JHTML::_('select.option',"",JText::_( 'DT_SELECT_LOCATION' ));

	   foreach($locations as $key => $location){

	      $locationsOpts[]=JHTML::_('select.option',$location->id,stripslashes($location->name));

	   }

	  ?>

    <!--<script language="javascript" type="text/javascript" src="../components/com_dtregister/lightbox/scripts/jquery.js">-->

<div>

   <script language="javascript" type="text/javascript">

	DTjQuery.noConflict();
    DTjQuery(function(){
	    
		DTjQuery("#cancel_refund_status").change(function(){
		   
		   if(DTjQuery(this).val()==1){
		      
			  DTjQuery(".cancel_refund").removeAttr('disabled');
              
		   }else{
		      
			  DTjQuery(".cancel_refund").val('');
              DTjQuery(".cancel_refund").attr('disabled',true);

		   }
		   
		}); 
		DTjQuery("#partial_payment").change(function(){
		
			 switch(parseInt(DTjQuery(this).val())){
			    
				case 0:
				   DTjQuery("#partial_amount").val('');
				   DTjQuery("#partial_minimum_amount").val('');
				   DTjQuery("#partial_amount").attr('disabled',true);
				   DTjQuery("#partial_minimum_amount").attr('disabled',true);
				break;
				case 1:
				   DTjQuery("#partial_amount").val('');
				   DTjQuery("#partial_minimum_amount").val('');
				   DTjQuery("#partial_amount").attr('disabled','disabled');
				   DTjQuery("#partial_minimum_amount").removeAttr('disabled');
				break;
				case 2:
				   DTjQuery("#partial_amount").val('');
				   DTjQuery("#partial_minimum_amount").val('');
				   DTjQuery("#partial_amount").removeAttr('disabled');
				   DTjQuery("#partial_minimum_amount").attr('disabled',true);
				break;
			 
			 }
		   
		});
		
		DTjQuery("#partial_payment").trigger('change');
		
	});
    function submitbutton(pressbutton) {

      var form = document.adminForm;

      if (pressbutton == 'cancel') {

        submitform( pressbutton );

        return;

      }

       if(form.email.value==''){

	   alert("Please enter event manager email");

	   return;

	   }

      // do field validation

      if (form.slabId.value == ""){

        alert( 'You must select an event first.' );

      } else if (form.date.value == ""){

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

      } else {

        submitform( pressbutton );

      }

    }

    </script>

    <form action="index2.php?option=com_dtregister&act=save" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">

   <table width="100%">

   <tr><td width="100%">

    <?php	

	    echo $pane->startPane('event');

 			echo $pane->startPanel(JText::_( 'DT_REGISTER_GENERAL' ),'dtregister1');

 	  ?>

    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
  
      <tr>

        <td width="10%"><?php echo JText::_( 'DT_EVENT_TITLE' ); ?>:</td>

        <td width="400">

 			  <?php 

			   $slabId = isset($eventcopy->slabId)?$eventcopy->slabId:'';

			   echo JHTML::_('select.genericlist', $events,"slabId","","value","text",$slabId); ?></td>

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

      </tr>

      <tr>

      	<td align="right"><?php echo JText::_( 'DT_EVENT_PUBLISH' ); ?>:</td>

      	<td>

			<?php

				 		$options=array();

						$options[]=JHTML::_('select.option',"0",JText::_( 'No' ));

						$options[]=JHTML::_('select.option',"1",JText::_( 'Yes' ));

            $publish =  isset($eventcopy->publish)?$eventcopy->publish:'0';

            echo JHTML::_('select.radiolist', $options, 'publish','','value','text',$publish);

			?>

      	</td>

      	<td colspan="2" align="left">

      		&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_PUBLISH_HELP' )), '', 'tooltip.png', '', ''); ?>

      	</td>

      </tr>

      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_REGISTRATION_TYPE' ); ?>:</td>

        <td>

 		    <?php echo $lists['registration_type'];?></td>

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

      </tr>
      
      <tr>

	  <?php

	  	$sql = "SELECT categoryId, categoryName ,parent_id FROM #__dtregister_categories order by ordering";

	  	$database->setQuery($sql);

	  	$rows = $database->loadObjectList();

	    $children = array();
        foreach ($rows as $v )
		{
			$pt = $v->parent_id;
			$list = @$children[$pt] ? $children[$pt] : array();
			array_push( $list, $v );
			$children[$pt] = $list;
		}
		
	  $options=array();
		$options[]=JHTML::_('select.option',"0",JText::_( 'DT_NONE'));
		if(isset($children[0]) && is_array($children[0]))
		foreach($children[0] as $pcategory){
		   $options[]=JHTML::_('select.option',$pcategory->categoryId,$pcategory->categoryName);
		   if(isset($children[$pcategory->categoryId])){
		       foreach($children[$pcategory->categoryId] as $childcat){
			       $options[]=JHTML::_('select.option',$childcat->categoryId,"--".$childcat->categoryName);
			   }
		   }
		}
		$cat_options = $options ;
	  ?>

	  <td width="10%" align="right"><?php echo JText::_( 'DT_EVENT_CATEGORY' ); ?>:</td>
    
    <td><?php 

	   $category = isset($eventcopy->category)?$eventcopy->category:'0';

	   echo JHTML::_('select.genericlist', $options,"category","","value","text",$category ); ?></td>

    <td colspan="2">&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_CATEGORY_HELP' )), '', 'tooltip.png', '', ''); ?></td>
    </tr>
   
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_SELECT_LOCATION' ); ?>:</td>

        <td>

 			  <?php 

			   $location_id = isset($eventcopy->location_id)?$eventcopy->location_id:'';

			  echo JHTML::_('select.genericlist', $locationsOpts,"location_id","","value","text",$location_id); ?></td>

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

   </tr>
   
      <tr>

      <td width="10%" align="right"><?php echo JText::_( 'DT_PUBLIC_LIST' ); ?>:</td>

      <td align="left" valign="top">

	    <?php

	    $options=array();

	    $options[]=JHTML::_('select.option',"1",JText::_( 'DT_PUBLIC' ));

	    $options[]=JHTML::_('select.option',"0",JText::_( 'DT_PRIVATE' ));

      $public = isset($eventcopy->public)?$eventcopy->public:'1';

	    echo JHTML::_('select.genericlist', $options,"public","","value","text",$public);

	    ?>

	    </td>

      <td colspan="2" align="left">

      		&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_PUBLIC_LIST_HELP' )), '', 'tooltip.png', '', ''); ?>

      </td>

      </tr>
         
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_EVENT_MAX_REGISTRATION' ); ?>:</td>

        <td>
            <?php  $max_registrations = isset($eventcopy->max_registrations)?$eventcopy->max_registrations:'';?>
        	<input type="text" name="max_registrations" size="15" value="<?php echo  $max_registrations ;?>" />

		    </td>

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

      </tr>
      
      <tr align="center" valign="middle">  <td align="left" valign="top"><?php echo JText::_( 'DT_MAX_GROUP_SIZE' ); ?>:</td>

    <?php $max_group_size = isset($eventcopy->max_group_size)?$eventcopy->max_group_size:''; ?>

		    <td align="left" valign="top">	<input type="text" name="max_group_size" value="<?php echo $max_group_size; ?>" /></td>

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

	 </tr>
      
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_REGISTRATION_OPEN_DATE' ); ?>:</td>

        <td>

        	<?php

            $startdate = isset($eventcopy->startdate)?$eventcopy->startdate:'';

        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$startdate,"startdate","startdate");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="startdate" id="startdate" size="12" maxlength="10" value="<?php echo startdate; ?>" />

            	<input type="reset" class="button" value="..." onclick="return showCalendar('startdate', 'y-mm-dd');" />

        		<?php

        		}

        	?>

		    </td>

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

      </tr>
      
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_CUT_OFF_DATE' ); ?>:</td>

        <td>

        	<?php

            $cutOffDate = isset($eventcopy->cut_off_date)?$eventcopy->cut_off_date:'';

        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$cutOffDate,"cut_off_date","cut_off_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="cut_off_date" id="cut_off_date" size="12" maxlength="10" value="<?php echo $cutOffDate; ?>" />

            	<input type="reset" class="button" value="..." onclick="return showCalendar('cut_off_date', 'y-mm-dd');" />

        		<?php

        		}

        	?>

		    </td>

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

      </tr>
      
      <tr>

      <td width="10%" align="right"><?php echo JText::_( 'DT_WAITING_LIST' ); ?>:</td>

      <td align="left" valign="top">

	    <?php

	    $options=array();

	    $options[]=JHTML::_('select.option',"0",JText::_( 'DT_ENABLE' ));

	    $options[]=JHTML::_('select.option',"1",JText::_( 'DT_DISABLE' ));

      $waiting_list = isset($eventcopy->waiting_list)?$eventcopy->waiting_list:'1';

	    echo JHTML::_('select.genericlist', $options,"waiting_list","","value","text",$waiting_list);

	    ?>

	    </td>

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

      </tr>
       
    <tr>
    <td width="10%" valign="top"><?php echo JText::_( 'DT_EVENT_CATEGORY_PREREQUISITE' ); ?>:</td>
    <td><?php 
       
	   $selection = array();
		if(isset($eventcopy)){
		   
		   $prerequisite_cat = $dt_evt->get_prerequisite_category();
			foreach($prerequisite_cat as $select){
			  
		      $selection[] = $select->prerequisite_id ;
		   }
			
	   }
	 
       unset($cat_options[0]);
	   echo JHTML::_('select.genericlist', $cat_options,"prerequisite_category[]", 'multiple="multiple" size="5"',"value","text",$selection ); ?></td>

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

   </tr>
      <tr>

        <td width="10%" valign="top"><?php echo JText::_( 'DT_PREREQUISITE' ); ?>:</td>

        <td>

 			  <?php 
            
	       $options = array();
			   foreach($prerequisite as $pre_evt){
				 $options[]=JHTML::_('select.option',$pre_evt->eventId,$pre_evt->summary." (".get_date($pre_evt->dtstart,$pre_evt->dtend).")");
				}
				$selection = array();
				if(isset($eventcopy)){
				   
				   $prerequisite = $dt_evt->get_prerequisite();
				    foreach($prerequisite as $select){
			          
				   $selection[] = $select->prerequisite_id ;
				    
			   }
				}
			  
              echo JHTML::_( 'select.genericlist', $options, 'prerequisite[]', 'multiple="multiple" size="5"',"value","text",$selection);
              $options = array();
			  
        ?></td>

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

      </tr>
      
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_ARTICLE' ); ?>:</td>

        <td>

			<?php

        $options=array();

				$options[]=JHTML::_('select.option',"",JText::_( 'DT_SELECT_SECTION' ));

				$query = "Select * from #__sections";

				$database->setQuery($query);

				$sections = $database->loadObjectList();

				foreach($sections as $section){

				$options[]=JHTML::_('select.option',$section->id,$section->title);

				}

				$section_html =  JHTML::_('select.genericlist', $options,"section","","value","text");

				$options=array();

				$options[]=JHTML::_('select.option',"",JText::_( 'DT_SELECT_CATEGORY' ));

				$category_html =  JHTML::_('select.genericlist', $options,"section","","value","text");

				$options=array();

				$options[]=JHTML::_('select.option',"",JText::_( 'DT_SELECT_ARTICLE' ));

				$article_html =  JHTML::_('select.genericlist', $options,"article_id","","value","text");

			?>

			  <span id="section_id" ><?php echo $section_html; ?></span>

        <span id="category_id" ><?php echo $category_html; ?></span>

        <span id="article_id" ><?php echo $article_html; ?></span>

 		    </td>

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

      </tr>

	    <tr>
         
       <tr>

      	<td align="right"><?php echo JText::_( 'DT_DETAILS_ITEMID' ); ?>:</td>

      	<td>
         <?php $detail_itemid = isset($eventcopy->detail_itemid)?$eventcopy->detail_itemid:''; ?>
            <input type="text" id="" name="detail_itemid" value="<?php echo $detail_itemid; ?>" />
			
      	</td>

      	<td colspan="2" align="left">

      		&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_DETAILS_ITEMID_HELP' )), '', 'tooltip.png', '', ''); ?>

      	</td>

      </tr>
      
      	<td align="right"><?php echo JText::_( 'DT_EVENT_DETAIL_LINK_DISPLAY' ); ?>:</td>

      	<td>

			<?php

				 		$options=array();

						$options[]=JHTML::_('select.option',"0",JText::_( 'NO' ));

						$options[]=JHTML::_('select.option',"1",JText::_( 'YES' ));

            $detail_link_show = isset($eventcopy->detail_link_show)?$eventcopy->detail_link_show:'1';

            echo JHTML::_('select.radiolist', $options, 'detail_link_show','','value','text',0);

			?>

      	</td>

      	<td colspan="2" align="left">

      		&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_DETAIL_LINK_DISPLAY_HELP' )), '', 'tooltip.png', '', ''); ?>

      	</td>

      </tr>

	  <tr>

      	<td align="right"><?php echo JText::_( 'DT_EVENT_SHOW_REGISTRANT' ); ?>:</td>

      	<td>

			<?php

				 		$options=array();

						$options[]=JHTML::_('select.option',"0",JText::_( 'NO' ));

						$options[]=JHTML::_('select.option',"1",JText::_( 'YES' ));

            $show_registrant = isset($eventcopy->show_registrant)?$eventcopy->show_registrant:'0';

            echo JHTML::_('select.radiolist', $options, 'show_registrant','','value','text',$show_registrant );

			?>

      	</td>

      	<td colspan="2" align="left">

      		&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EVENT_SHOW_REGISTRANT_HELP' )), '', 'tooltip.png', '', ''); ?>

      	</td>

      </tr>

      <tr>

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

        <td>

                   <?php

								   $options=array();

								   $options[]=JHTML::_('select.option', '1', JText::_( 'No' ));

								   $options[]=JHTML::_('select.option', '0', JText::_( 'Yes' ));
                   $prevent_duplication = (isset($prevent_duplication) && $prevent_duplication !="")?$prevent_duplication:1;
								   echo JHTML::_('select.radiolist', $options,'config[prevent_duplication]','','value','text',$prevent_duplication);

								   ?>

					</td>

					<td>&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_DUPLICATION_OVERRIDE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

				</tr>
                               
        <tr>

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

          <td>

                   <?php

								   $options=array();

								   $options[]=JHTML::_('select.option', '0', JText::_( 'No' ));

								   $options[]=JHTML::_('select.option', '1', JText::_( 'Yes' ));
                   $usetimecheck = (isset($usetimecheck) && $usetimecheck !="")?$usetimecheck:0;
								   echo JHTML::_('select.radiolist', $options,'config[usetimecheck]','','value','text',$usetimecheck);

								   ?>

					</td>

					<td>&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_OVERRIDE_OVERLAP_HELP' )), '', 'tooltip.png', '', ''); ?></td>

			 </tr>
                               
       <tr>

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

          <td>

                   <?php

								   $options=array();

								   $options[]=JHTML::_('select.option', '0', JText::_( 'No' ));

								   $options[]=JHTML::_('select.option', '1', JText::_( 'Yes' ));
                   $excludeoverlap = (isset($excludeoverlap) && $excludeoverlap !="")?$excludeoverlap:0;
								   echo JHTML::_('select.radiolist', $options,'config[excludeoverlap]','','value','text',$excludeoverlap);

								   ?>

					</td>

					<td>&nbsp;&nbsp;<?php echo JHTML::tooltip((JText::_( 'DT_EXCLUDE_OVERLAP_HELP' )), '', 'tooltip.png', '', ''); ?></td>

				</tr>
      
      <tr>

	    <td valign="top" align="right">&nbsp;</td>

	    <td>&nbsp;</td>

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

     </tr>

      <tr>

	  	    <td><?php echo JText::_( 'DT_SEND_NOTIFICATION_TO' ); ?>:</td>

           <?php $email = isset($eventcopy->email)?$eventcopy->email:''; ?>

	  	    <td align="left"><input class="inputbox" type="text" name="email" id="email" size="60" value="<?php echo $email; ?>" /></td>

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

      </tr>

    <tr><td>

    <input type="hidden" name="id" value="<?php echo $row->slabId; ?>" />

    <input type="hidden" name="option" value="<?php echo $option;?>" />

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

    <input type="hidden" name="date" value="<?php echo date("m/d/Y");?>" />

    <input type="hidden" name="date" value="<?php echo date(); ?>" />

    </td></tr>

</table>

     <?php

	 	    echo $pane->endPanel();

        echo $pane->startPanel(JText::_( 'DT_DISCOUNT_FEE' ),'dtregister2');

     ?>

     <table class="adminform" width="100%" cellpadding="10" cellspacing="10">
       
        <tr>
	   <?php
        $options=array();

	      $options[]=JHTML::_('select.option',"1",JText::_( 'DT_EVENT_PARTIAL_PAYMENT_YES_OPTIONAL' ));

	      $options[]=JHTML::_('select.option',"2",JText::_( 'DT_EVENT_PARTIAL_PAYMENT_YES_REQUIRED' ));

	      $options[]=JHTML::_('select.option',"0",JText::_( 'NO' ));
	     ?>
       <td>
          <?php echo JText::_( 'DT_EVENT_PARTIAL_PAYMENT_ALLOW' ); ?>:
       </td>
       <td>
       <?php 
	       echo JHTML::_('select.genericlist', $options,"partial_payment","","value","text",0);
	     ?>
       </td>
       <td colspan="2" align="left">
         <?php echo JHTML::tooltip((JText::_( 'DT_EVENT_PARTIAL_PAYMENT_ALLOW_HELP' )), '', 'tooltip.png', '', ''); ?>
       </td>
      </tr>
      
      <tr align="center" valign="middle">

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

    	 <td align="left" valign="top">	<input type="text" id="partial_amount" name="partial_amount" value="<?php echo isset($eventcopy->partial_amount)?$eventcopy->partial_amount:''; ?>" /></td>

		   <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_PARTIAL_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>

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

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

    	 <td align="left" valign="top">	<input type="text" id="partial_minimum_amount" name="partial_minimum_amount" value="<?php echo isset($eventcopy->partial_minimum_amount)?$eventcopy->partial_minimum_amount:''; ?>" /></td>

		   <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_PARTIAL_MINIMUM_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	    </tr>
       <tr>
	   <?php
        $options=array();

	      $options[]=JHTML::_('select.option',"1",JText::_( 'YES' ));

	      $options[]=JHTML::_('select.option',"0",JText::_( 'NO' ));

	     ?>
       <td>
          <?php echo JText::_( 'DT_TAX_ALLOW' ); ?>:
       </td>
       <td>
       <?php 
	       echo JHTML::_('select.genericlist', $options,"tax_enable","","value","text",isset($eventcopy->tax_enable)?$eventcopy->tax_enable:0);
	     ?>
       </td>
       <td colspan="2" align="left">
         <?php echo JHTML::tooltip((JText::_( 'DT_TAX_ALLOW_HELP' )), '', 'tooltip.png', '', ''); ?>
       </td>
      </tr>
      <tr align="center" valign="middle">

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

    	 <td align="left" valign="top">	<input type="text" id="tax_amount" name="tax_amount" value="<?php echo isset($eventcopy->tax_amount)?$eventcopy->tax_amount:''; ?>" /></td>

		   <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_TAX_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>

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

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

	    <td align="left" valign="top">

	    <?php

	    $options=array();

	    $options[]=JHTML::_('select.option',"0",JText::_( 'DT_NONE'));

	    $options[]=JHTML::_('select.option',"1",JText::_( 'DT_AMOUNT'));

	    $options[]=JHTML::_('select.option',"2",JText::_( 'DT_PERCENTAGE'));

      $discount_type = isset($eventcopy->discount_type)?$eventcopy->discount_type:'0';

	    echo JHTML::_('select.genericlist', $options,"discount_type","","value","text",$discount_type);

	    ?>

	    </td>

			<td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_DISCOUNT_TYPE_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>

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

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

    	<td align="left" valign="top">	<input type="text" name="discount_amount" value="<?php echo isset($eventcopy->discount_amount)?$eventcopy->discount_amount:''; ?>" /></td>

		  <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_DISCOUNT_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>

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

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

	    <td align="left" valign="top">

	    <?php

	    $options=array();

	    $options[]=JHTML::_('select.option',"0",JText::_( 'DT_NONE'));

	    $options[]=JHTML::_('select.option',"1",JText::_( 'DT_AMOUNT'));

	    $options[]=JHTML::_('select.option',"2",JText::_( 'DT_PERCENTAGE'));

      $bird_discount_type = isset($eventcopy->bird_discount_type)?$eventcopy->bird_discount_type:'';

	    echo JHTML::_('select.genericlist', $options,"bird_discount_type","","value","text",$bird_discount_type);

	    ?>

	    </td>

			<td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_BIRD_DISCOUNT_TYPE_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>

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

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

    	<td align="left" valign="top">	<input type="text" name="bird_discount_amount" value="<?php echo isset($eventcopy->bird_discount_amount)?$eventcopy->bird_discount_amount:'' ; ?>" /></td>

		  <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_BIRD_DISCOUNT_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>

    <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_BIRD_DISCOUNT_DATE' ); ?>:</td>

        <td>

        	<?php

            $bird_discount_date = isset($eventcopy->bird_discount_date)?$eventcopy->bird_discount_date:'';

        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$bird_discount_date,"bird_discount_date","bird_discount_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="bird_discount_date" id="bird_discount_date" size="12" maxlength="10" value="<?php echo $bird_discount_date; ?>" />

            	<input type="reset" class="button" value="..." onclick="return showCalendar('bird_discount_date', 'y-mm-dd');" />

        		<?php

        		}

        	?>

		    </td>

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

      </tr>

      <tr>

	  	  <td valign="top" align="right"><?php echo JText::_( 'DT_LATE_FEE' ); ?>:</td>

        <?php $latefee = isset($eventcopy->latefee)?$eventcopy->latefee:''; ?>

	  	  <td><input class="inputbox" type="text" name="late_fee" id="late_fee" maxlength="10" value="<?php echo $latefee; ?>" /></td>

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

     </tr>

     <tr>

	  	  <td valign="top" align="right"><?php echo JText::_( 'DT_LATE_FEE_DATE' ); ?>:</td>

	  	  <td>

	  	    <?php

            $latefeedate = isset($eventcopy->latefeedate)?$eventcopy->latefeedate:''; 

	  	    	if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$latefeedate,"late_fee_date","late_fee_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="late_fee_date" id="late_fee_date" size="12" maxlength="10" value="<?php echo $latefeedate;?>" />

              <input type="reset" class="button" value="..." onclick="return showCalendar('late_fee_date', 'y-mm-dd');" /></td>

        		<?php

        		}

	  	    ?>

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

      </tr>

    <tr>

	    <td colspan="4"><b><?php echo JText::_( 'DT_INDIVIDUAL_RATE' ); ?>:</b></td>

    </tr>

    <tr>

      <td valign="top" align="right"><?php echo JText::_( 'DT_INDIVIDUAL' ); ?>:<input type="hidden" name="member[0]" value="1" /></td>

      <td>

          <?php $regAmountIndividual = isset($eventcopy->registerAmountIndividual)?$eventcopy->registerAmountIndividual:''; ?>

          <input class="inputbox" type="text" name="amount[0]" size="20" maxlength="10" value="<?php echo htmlspecialchars( $regAmountIndividual, JText::_( 'ENT_QUOTES' ) );?>" />

		  </td>

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

    </tr>

    <tr>

	    <td colspan="4"><b><?php echo JText::_( 'DT_GROUP_REGISTRATION_RATE' ); ?>:</b></td>

    </tr>

    <tr><td colspan="4"><?php echo JText::_( 'DT_GROUP_RATE_INSTRUCTION' ); ?>

           <ul><li><?php echo JText::_( 'DT_NUMBER_MEMBERS_EXPLANATION' ); ?></li>

           <li><?php echo JText::_( 'DT_GROUP_RATE_EXPLANATION' ); ?></li>

           <li><?php echo JText::_( 'DT_RATE_PERSON_INSTRUCTION' ); ?></li>

           <li>[<?php echo JText::_( 'DT_RATE_PER_PERSON' ); ?>] x [<?php echo JText::_( 'DT_NUMBER_MEMBERS' ); ?>] = [<?php echo JText::_( 'DT_GROUP_RATE' ); ?>]</li></ul></td>

    </tr>

    <tr>

	    <td valign="top" align="right"><?php echo JText::_( 'DT_NUMBER_MEMBERS' ); ?>:</td>

	    <td><?php echo JText::_( 'DT_GROUP_RATE' ); ?>:</td>

	    <td colspan="2" align="left"><?php echo JText::_( 'DT_RATE_PER_PERSON' ); ?>:</td>

    </tr>

	   <?php 

	   $slabs = $dt_evt->getAllslabs();

	   for($i=1;$i<=10;$i++) { 

		 $members  = "";

		 $amount   = "";

		 $amountper = "" ;

		 if(isset($slabs[$i-1])){

		  $members = $slabs[$i-1]->memberTotal ;

			$amount = $slabs[$i-1]->regGroupRate ;

			$amountper = $slabs[$i-1]->regGroupPerRate  ;

		 }

	   ?>

    <tr>

      <td width="20%" valign="top" align="right"><input class="inputbox" type="text" name="member[<?php echo $i?>]" size="20" maxlength="10" value="<?php echo $members; ?>" onBlur="if(parseInt(this.value)==1){alert('Group must have members more than 1');this.value='';}" /></td>

      <td width="20%">

        <input class="inputbox" type="text" name="amount[<?php echo $i?>]" size="20" maxlength="10" value="<?php echo $amount;?>" /></td>

      <td width="20%" align="left"><input class="inputbox" type="text" name="amountper[<?php echo $i?>]" size="20" maxlength="10" value="<?php echo $amountper; ?>" /></td>

      <td width="40%" align="left">&nbsp;</td>

    </tr>

	  <?php } ?>

    <tr>

	  	  <td align="left" colspan="4">&nbsp;</td>

    </tr>

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

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

    	<td align="left" valign="top"><?php

        $options = array();

		    $options[]=JHTML::_('select.option',"0",JText::_( 'NO'));

        $options[]=JHTML::_('select.option',"1",JText::_( 'YES'));

        $use_discountcode = isset($eventcopy->use_discountcode)?$eventcopy->use_discountcode:'0';

	      echo JHTML::_('select.genericlist',$options,"use_discountcode","","value","text",$use_discountcode);

		    ?>

      </td>

		  <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_USE_DISCOUNT_CODE_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>

        <?php

         $eventId = isset($eventcopy->eventId)?$eventcopy->eventId:'';

		     echo HTML_groups::discount_codes_list($eventId);

        ?>

     </table>

       <?php

	 	    echo $pane->endPanel();

        echo $pane->startPanel(JText::_( 'DT_REGISTER_PAYMENT' ),'dtregister3');

       ?>

     <table class="adminform" width="100%" cellpadding="10" cellspacing="10">

                <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'DT_GENERAL_PAY_OPTIONS' );?></td></tr>

								 <!-- ********** General Payment Options ******************	-->

								<tr align="center" valign="middle"> 
                
                  <td width="15%" align="left" valign="top"><strong><?php echo JText::_( 'DT_EVENT_PAYMENT_OPTIONS' );?>:</strong></td>

							    <td width="400" align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', '1', JText::_( 'DT_GLOBAL' ));

								    $options[]=JHTML::_('select.option', '2', JText::_( 'DT_UNIQUE' ));

                    $payment_option = isset($eventcopy->payment_option)?$eventcopy->payment_option:'1';

								    echo JHTML::_('select.genericlist', $options,'payment_option','','value','text',$payment_option);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'DT_EVENT_PAYMENT_OPTIONS_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

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

							   <td align="left" valign="top">

								   <?php

								   $options=array();

								   $options[]=JHTML::_('select.option',"USD","U.S. Dollars");

								   $options[]=JHTML::_('select.option',"AUD","Australian Dollars");

								   $options[]=JHTML::_('select.option',"BRL","Brazilian Real");

								   $options[]=JHTML::_('select.option',"GBP","British Pounds Sterling");

								   $options[]=JHTML::_('select.option',"CAD","Canadian Dollars");

								   $options[]=JHTML::_('select.option',"CZK","Czech Koruny");

								   $options[]=JHTML::_('select.option',"DKK","Danish Kroner");

								   $options[]=JHTML::_('select.option',"EUR","Euros");

								   $options[]=JHTML::_('select.option',"HKD","Hong Kong Dollars");

								   $options[]=JHTML::_('select.option',"HUF","Hungarian Forints");
								   
								   $options[]=JHTML::_('select.option',"INR","Indian Rupees");

								   $options[]=JHTML::_('select.option',"ILS","Israeli New Shekels");

								   $options[]=JHTML::_('select.option',"JPY","Japanese Yen");
								   
								   $options[]=JHTML::_('select.option',"MYR","Malaysian Ringgit");

								   $options[]=JHTML::_('select.option',"MXN","Mexican Pesos");

								   $options[]=JHTML::_('select.option',"NZD","New Zealand Dollars");

								   $options[]=JHTML::_('select.option',"NOK","Norwegian Kroner");
								   
								   $options[]=JHTML::_('select.option',"PHP","Philippine Pesos");

								   $options[]=JHTML::_('select.option',"PLN","Polish Zlotych");
								   
                   $options[]=JHTML::_('select.option',"RUB","Russian Ruble");

								   $options[]=JHTML::_('select.option',"SGD","Singapore Dollars");

								   $options[]=JHTML::_('select.option',"ZAR","South African Rand");

								   $options[]=JHTML::_('select.option',"SEK","Swedish Kronor");

								   $options[]=JHTML::_('select.option',"CHF","Swiss Francs");
								   
								   $options[]=JHTML::_('select.option',"TWD","Taiwan New Dollars");
								   
								   $options[]=JHTML::_('select.option',"THB","Thai Baht");

								   if($currency_code==""){$currency_code='USD';}

								   echo JHTML::_('select.genericlist', $options,'config[currency_code]','','value','text',$currency_code);

								   ?>

							   </td>

								<td><?php echo JHTML::tooltip((JText::_( 'DT_CURRENCY_CODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							</tr>

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

							   <td align="left" valign="top">

                  <?php

                   	$options=array();

							   		$options[]=JHTML::_('select.option', '1', JText::_( 'COMMA' )." ( , )");

							   		$options[]=JHTML::_('select.option', '2', JText::_( 'DOT' )." ( . )");

					  				echo JHTML::_('select.genericlist', $options, 'config[currency_separator]',' ', 'value','text', $currency_separator);

							   ?>

							   </td>

								 <td><?php echo JHTML::tooltip((JText::_( 'CURRENCY_SEPARATOR_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

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

							     <td align="left" valign="top">

							     <!-- Here we will need to select payment methods-->

							     <?php

							   		$options=array();

							   		$options[]=JHTML::_('select.option', 'authorizenet', JText::_( 'AUTH_NET' ));
							   		$options[]=JHTML::_('select.option', 'echeck', JText::_( 'ECHECK' ));
									  $options[]=JHTML::_('select.option', 'GoogleCheckout', JText::_( 'DT_GOOGLE_CHECKOUT' )); 
							   		$options[]=JHTML::_('select.option', 'paypal', JText::_( 'PAYPAL' ));
									  $options[]=JHTML::_('select.option', 'Eway', JText::_( 'DT_EWAY' ));
                    $options[]=JHTML::_('select.option', 'ideal', JText::_( 'DT_PAY_IDEAL_MOLLIE' ));
					          $options[]=JHTML::_('select.option', 'idealRabo', JText::_( 'DT_PAY_IDEAL_LITE' ));
							      $options[]=JHTML::_('select.option', 'NetDeposit', JText::_( 'DT_NETDEPOSIT' ));
					          $options[]=JHTML::_('select.option', 'pay_later', JText::_( 'DT_PAY_LATER' ));
							   		$arrPaymentMethod=explode(",",$paymentmethod);

							   		//Create the selected array

							   		$selectedOptions=array();

							   		for($i=0,$n=count($arrPaymentMethod);$i<$n;$i++)

							   		{

							   			$selectedOptions[]=JHTML::_('select.option', $arrPaymentMethod[$i], JText::_( $arrPaymentMethod[$i] ));

							   		}

							   		$lists["payment_methods"]=JHTML::_('select.genericlist', $options,'config[paymentmethod][]',' multiple=true ', 'value','text',$selectedOptions);

							   		echo $lists["payment_methods"];

							     ?>

							     </td>

								   <td><?php echo JHTML::tooltip((JText::_( 'DT_PAYMENT_METHOD_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							   </tr> 
							  
							   <!-- *************** Authorize.net Options **************** -->

                 <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'AUTH_NET' );?></td></tr>

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

                     <td align="left" valign="top">

										 <strong><?php echo JText::_( 'DT_MERCHANT_ID' ); ?>:</strong>

										 </td>

									   <td align="left" valign="top"> <input type="text" name="config[merchid]" value="<?php echo $merchid; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_MERCHANT_ID' )), '', 'tooltip.png', '', ''); ?> </td>

								 </tr>

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

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

									   <td align="left" valign="top">	<input type="text" name="config[transkey]" value="<?php echo $transkey; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_TRANS_KEY' )), '', 'tooltip.png', '', ''); ?> </td>

								</tr>

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

							    <td align="left" valign="top"><input type="checkbox" name="config[cardtype][]" value="Visa" <?php if(in_array("Visa",$cardtypearr)) echo "checked"; ?>/> Visa <input type="checkbox" name="config[cardtype][]" value="Discover" <?php if(in_array("Discover",$cardtypearr)) echo "checked"; ?> /> Discover <input type="checkbox" name="config[cardtype][]" value="MasterCard" <?php if(in_array("MasterCard",$cardtypearr)) echo "checked"; ?> /> MasterCard <input type="checkbox" name="config[cardtype][]" value="AmericanExpress" <?php if(in_array("AmericanExpress",$cardtypearr)) echo "checked"; ?> /> American Express </td>

									<td><?php echo JHTML::tooltip((JText::_( 'DT_CARD_TYPE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

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

							    <td align="left" valign="top">

							    <select name="config[authnetmode]">

							     <option value="test" <?php echo ($authnetmode=='test')?'selected':'';?> ><?php echo JText::_( 'DT_TEST' );?></option>

							     <option value="live" <?php echo ($authnetmode=='live')?'selected':'';?> ><?php echo JText::_( 'DT_LIVE' );?></option>

							    </select>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'AUTH_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

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

							    <td align="left" valign="top">

							    <select name="config[echecknetmode]">

							     <option value="test" <?php echo ($echecknetmode=='test')?'selected':'';?> ><?php echo JText::_( 'DT_TEST' );?></option>

							     <option value="live" <?php echo ($echecknetmode=='live')?'selected':'';?> ><?php echo JText::_( 'DT_LIVE' );?></option>

							    </select>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'ECHECK_NET_MODE' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>
							  
							  <!-- *************** Google Checkout Options **************** -->
							   
                 <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'GOOGLECHECKOUT' ); ?></td></tr>
                                 
                 <tr align="center" valign="middle">

                     <td width="30%" align="left" valign="top">

										 <strong><?php echo JText::_( 'DT_GOOGLE_MERCHANT_ID' ); ?>:</strong>

										 </td>

									   <td align="left" valign="top"> <input type="text" name="config[googlemerchid]" value="<?php echo $googlemerchid; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_GOOGLE_MERCHANT_ID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

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

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

									   <td align="left" valign="top">	<input type="text" name="config[googleapikey]" value="<?php echo $googleapikey; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_GOOGLE_TRANS_KEY_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

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

							    <td align="left" valign="top">

							    <select name="config[googlemode]">

							     <option value="test" <?php echo ($googlemode=='test')?'selected':'';?> >Test</option>

							     <option value="live" <?php echo ($googlemode=='live')?'selected':'';?> >Live</option>

							    </select>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'DT_GOOGLE_CHECKOUT_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

		  					<!-- *************** PayPal Options ***************	-->

							  <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'PAYPAL' );?></td></tr>

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

							    <td align="left" valign="top"><input type="text" name="config[paypalid]" value="<?php echo stripslashes($paypalid); ?>"></td>

								  <td><?php echo JHTML::tooltip((JText::_( 'PAYPAL_ID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

							    <td align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', 'test', JText::_( 'DT_TEST' ));

								    $options[]=JHTML::_('select.option', 'live', JText::_( 'DT_LIVE' ));

								    echo JHTML::_('select.genericlist', $options,'config[paypalmode]','','value','text',$paypalmode);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'PAYPAL_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>
							  
							  <!-- **************** eWay Options ****************** -->
                                
                  <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'DT_EWAY' ); ?></td></tr>
                                 
                  <tr align="center" valign="middle">

                     <td align="left" valign="top">

										 <strong><?php echo JText::_( 'DT_EWAY_CUSTOMERID' ); ?>:</strong>

										 </td>

									   <td align="left" valign="top"> <input type="text" name="config[eway_customerid]" size="30" value="<?php echo $eway_customerid; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_EWAY_CUSTOMERID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>
										 
								 </tr>
                                                
								<tr align="center" valign="middle">  <td align="left" valign="top"><strong><?php echo JText::_( 'DT_EWAY_MODE' );?>:</strong></td>

							    <td align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', 'test', JText::_( 'DT_TEST' ));

								    $options[]=JHTML::_('select.option', 'live', JText::_( 'DT_LIVE' ));

								    echo JHTML::_('select.genericlist', $options,'config[ewaymode]','','value','text',$ewaymode);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'DT_EWAY_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

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

							    <td align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', 'hosted', JText::_( 'DT_SHARED' ));

								    $options[]=JHTML::_('select.option', 'live', JText::_( 'DT_HOSTED' ));

								    echo JHTML::_('select.genericlist', $options,'config[ewaytype]','','value','text',$ewaytype);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'DT_EWAY_TYPE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

							<!-- **************** iDeal Options *************	-->

                <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'DT_PAY_IDEAL_MOLLIE' );?></td></tr>

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

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

							    <td align="left" valign="top"><input type="text" name="config[partner_id]" value="<?php echo stripslashes($partner_id); ?>"></td>

								  <td><?php echo JHTML::tooltip((JText::_( 'IDEAL_ID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

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

							    <td align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', 'test', JText::_( 'DT_TEST' ));

								    $options[]=JHTML::_('select.option', 'live', JText::_( 'DT_LIVE' ));

								    echo JHTML::_('select.genericlist', $options,'config[idealmode]','','value','text',$idealmode);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'IDEAL_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>
							  
                <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'DT_PAY_IDEAL_LITE' ); ?></td></tr>

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

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

							    <td align="left" valign="top"><input type="text" name="config[idealLiteMerchantId]" value="<?php echo stripslashes($idealLiteMerchantId); ?>"></td>

								  <td><?php echo JHTML::tooltip((JText::_( 'IDEAL_LITE_MERCHANT_ID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

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

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

							    <td align="left" valign="top"><input type="text" name="config[idealLiteHashKey]" value="<?php echo stripslashes($idealLiteHashKey); ?>"></td>

								  <td><?php echo JHTML::tooltip((JText::_( 'IDEAL_LITE_HASH_KEY_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

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

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

							    <td align="left" valign="top">

							    <?php

								    $options=array();

								    $options[]=JHTML::_('select.option', 'test', JText::_( 'DT_TEST' ));

								    $options[]=JHTML::_('select.option', 'live', JText::_( 'DT_LIVE' ));

								    echo JHTML::_('select.genericlist', $options,'config[idealLiteMode]','','value','text',$idealLiteMode);

							     ?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'IDEAL_LITE_MODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>
							  
							  <!-- ************** Net Deposit Options ***************** -->
                          
                 <tr valign="middle"><td align="left" class="dt_heading" colspan="4"><?php echo JText::_( 'DT_NETDEPOSIT' ); ?></td></tr>
                                 
                 <tr align="center" valign="middle">

                     <td align="left" valign="top">

										 <strong><?php echo JText::_( 'DT_NETDEPOSIT_CLIENTID' ); ?>:</strong>

										 </td>

									   <td align="left" valign="top"> <input type="text" name="config[netdeposit_clientid]" size="30" value="<?php echo $netdeposit_clientid; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_NETDEPOSIT_CLIENTID_HELP' )), '', 'tooltip.png', '', ''); ?> </td>
										 
								 </tr>
                                 
                 <tr align="center" valign="middle">

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

									   <td align="left" valign="top">	<input type="text" name="config[netdeposit_clientcode]" size="30" value="<?php echo $netdeposit_clientcode; ?>" /> </td>

										 <td><?php echo JHTML::tooltip((JText::_( 'DT_NETDEPOSIT_CLIENTCODE_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

								 </tr>

							<!-- ******************* Pay Later Options ****************	-->

							   <?php

							   		if($pay_later_options!="")

							   		{

							   			$selecteds=explode(",",$pay_later_options);

							   		}

							   		else

							   		{

							   			$selecteds=array();

							   		}

							   		$options=array();

							   		$options[]=JHTML::_('select.option', '1', JText::_( 'DT_PAY_AT_DOOR' ));

							   		$options[]=JHTML::_('select.option', '2', JText::_( 'DT_MAILIN_PAYMENT' ));

							   		$options[]=JHTML::_('select.option', '3', JText::_( 'DT_CALLIN_PAYMENT' ));

							   		$arrSelecteds=array();

							   		for($i=0,$n=count($selecteds);$i<$n;$i++)

							   		{

							   			$arrSelecteds[]=JHTML::_('select.option', $selecteds[$i],JText::_($selecteds[$i]));

							   		}

							   		$lists['pay_later_options']=JHTML::_('select.genericlist', $options, 'config[pay_later_options][]',' multiple=true ', 'value','text', $arrSelecteds);

							   ?>

                <tr valign="middle"><td align="left" class="dt_heading" colspan="3"><?php echo JText::_( 'DT_PAY_LATER_OFFLINE_PAYMENTS' ) ;?></td></tr>

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

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

							    <td align="left" valign="top">

							   	<?php

							   		echo $lists['pay_later_options'];

							   	?>

							    </td>

								  <td><?php echo JHTML::tooltip((JText::_( 'DT_PAY_LATER_OPTIONS_HELP' )), '', 'tooltip.png', '', ''); ?> </td>

							  </tr>

	 						 </table>

   <?php

	 	echo $pane->endPanel();

    echo $pane->startPanel(JText::_( 'DT_REGISTER_EMAIL' ),'dtregister4');

	 ?>

     <table class="adminform" width="100%" cellpadding="10" cellspacing="10">

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

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

        <?php $topmsg = isset($eventcopy->topmsg)?$eventcopy->topmsg:''; ?>

       <td width="400" align="left" valign="top"><?php echo $editor->display("topmsg",stripslashes($topmsg),'','','20','20','0'); ?></td>

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

	  </tr>

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

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

          <?php $event_describe_set = isset($eventcopy->event_describe_set)?$eventcopy->event_describe_set:'0'; ?>

      		<br /><br /><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: <?php echo JHTMLSelect::booleanlist("event_describe_set","",$event_describe_set); ?>

      </td>

      <?php $event_describe = isset($eventcopy->event_describe)?$eventcopy->event_describe:''; ?>

     	<td align="left" valign="top"><?php echo $editor->display("event_describe",stripslashes($event_describe),'','','20','20','0'); ?></td>

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

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

      	<td align="left" valign="top"><strong><?php echo JText::_( 'DT_EVENT_THANK' ); ?>:</strong>
          <?php $thanksmsg_set = isset($eventcopy->thanksmsg_set)?$eventcopy->thanksmsg_set:0; ?>
      		<br /><br /><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: <?php echo JHTMLSelect::booleanlist("thanksmsg_set","",$thanksmsg_set); ?>
 
          <div style="padding:5px 5px 5px 15px;">

            <br /><?php echo JText::_( 'DT_TAG_INSERT_TEXT' );?>:

            <br />[EVENT_NAME] - <?php echo JText::_( 'DT_TAG_EVENT_NAME' );?>

            <br />[EVENT_DATE] - <?php echo JText::_( 'DT_TAG_EVENT_DATE' );?>

          </div>
 
      	</td>

     	<td align="left" valign="top">
		  <?php $thanksmsg = isset($eventcopy->thanksmsg)?$eventcopy->thanksmsg:'';	?>
      <?php echo $editor->display("thanksmsg",stripslashes($thanksmsg),'','','20','20','0'); ?>
      </td>

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

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

      <td align="left" valign="top"><strong><?php echo JText::_( 'DT_EVENT_PAYLATER_THANK' ); ?>:</strong>
      <?php $pay_later_thk_msg_set = isset($eventcopy->pay_later_thk_msg_set)?$eventcopy->pay_later_thk_msg_set:'0'; ?>
      <br /><br /><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: <?php echo JHTMLSelect::booleanlist("pay_later_thk_msg_set","",$pay_later_thk_msg_set); ?>
      
         <div style="padding:5px 5px 5px 15px;">

            <br /><?php echo JText::_( 'DT_TAG_INSERT_TEXT' );?>:

            <br />[EVENT_NAME] - <?php echo JText::_( 'DT_TAG_EVENT_NAME' );?>

            <br />[EVENT_DATE] - <?php echo JText::_( 'DT_TAG_EVENT_DATE' );?>

        </div>
      
      </td>

     	<td align="left" valign="top">
	  	<?php $pay_later_thk_msg = isset($eventcopy->pay_later_thk_msg)?$eventcopy->pay_later_thk_msg:''; ?>
      <?php echo $editor->display("pay_later_thk_msg",stripslashes($pay_later_thk_msg),'','','20','20','0'); ?>
      </td>

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

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

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

        <?php $terms_conditions_set = isset($eventcopy->terms_conditions_set)?$eventcopy->terms_conditions_set:''; ?>

        <br /><br /><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: <?php echo JHTMLSelect::booleanlist("terms_conditions_set","",$terms_conditions_set); ?>

      </td>

        <?php $terms_conditions_msg = isset($eventcopy->terms_conditions_msg)?$eventcopy->terms_conditions_msg:''; ?>

     	<td align="left" valign="top">
        <?php echo $editor->display("terms_conditions_msg",stripslashes($terms_conditions_msg),'','','20','20','0'); ?>
      </td>

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

	  </tr>

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

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

       <?php $thksmsg_set = isset($eventcopy->thksmsg_set)?$eventcopy->thksmsg_set:'0'; ?>

      	<br /><br /><?php echo JText::_( 'DT_ENABLE_FEATURE' );?>: <?php echo JHTMLSelect::booleanlist("thksmsg_set","",$thksmsg_set); ?>

                 <div style="padding:5px 5px 5px 15px;">

                 <br /><?php echo JText::_( 'DT_TAG_INSERT_TEXT' );?>:

                 <br />[TITLE] - <?php echo JText::_( 'DT_TAG_TITLE' );?>

                 <br />[NAME] - <?php echo JText::_( 'DT_TAG_NAME' );?>
                 
                 <br />[FIRSTNAME] - <?php echo JText::_( 'DT_TAG_FIRSTNAME' );?>

                 <br />[ORGANIZATION] - <?php echo JText::_( 'DT_TAG_ORGANIZATION' );?>

                 <br />[EVENT_NAME] - <?php echo JText::_( 'DT_TAG_EVENT_NAME' );?>

                 <br />[EVENT_DATE] - <?php echo JText::_( 'DT_TAG_EVENT_DATE' );?>
                 
                 <br />[LOCATION] - <?php echo JText::_( 'DT_TAG_LOCATION' );?>
                 
                 <br />[LOCATION_DETAILS] - <?php echo JText::_( 'DT_TAG_LOCATION_DETAILS' );?>

                 <br />[CONTACT_DETAILS] - <?php echo JText::_( 'DT_TAG_CONTACT_DETAILS' );?>

                 <br />[GROUP_NAMES] - <?php echo JText::_( 'DT_TAG_GROUP_NAMES' );?>

                 <br />[GROUP_NUMBER] - <?php echo JText::_( 'DT_TAG_GROUP_NUMBER' );?>

                 <br />[AMOUNT] - <?php echo JText::_( 'DT_TAG_AMOUNT' );?>
                 
                 <br />[AMOUNT_PAID] - <?php echo JText::_( 'DT_TAG_AMOUNT_PAID' );?>

                 <br />[AMOUNT_DUE] - <?php echo JText::_( 'DT_TAG_AMOUNT_DUE' );?>

                 <br />[AMOUNT_NOTAX] - <?php echo JText::_( 'DT_TAG_AMOUNT_NOTAX' );?>

                 <br />[TAX] - <?php echo JText::_( 'DT_TAG_TAX' );?>

                 <br />[PAYMENT_TYPE] - <?php echo JText::_( 'DT_TAG_PAYMENT_TYPE' );?>

                 <br />[CONTACT_CUSTOM_FIELDS] - <?php echo  JText::_( 'DT_TAG_CONTACT_CUSTOM_FIELDS' );?>

                 <br />[GROUP_CUSTOM_FIELDS] - <?php echo  JText::_( 'DT_TAG_GROUP_CUSTOM_FIELDS' );?>

                 <br />[FIELDX] - <?php echo JText::_( 'DT_TAG_FIELDS' );?>

                 <br />[CONFIRM_NUM] - <?php echo JText::_( 'DT_TAG_CONFIRM_NUM' );?>

                 <br />[BARCODE] - <?php echo JText::_( 'DT_TAG_BARCODE' );?>

                 <br />[STATUS] - <?php echo JText::_( 'DT_TAG_STATUS' );?>

                 <br />[PAID_STATUS] - <?php echo JText::_( 'DT_TAG_PAID_STATUS' );?>

                 <br />[USERNAME] - <?php echo JText::_( 'DT_TAG_USERNAME' );?>

                 <br />[PASSWORD] - <?php echo JText::_( 'DT_TAG_PASSWORD' );?>

                 <br />[DATE_REGISTERED] - <?php echo JText::_( 'DT_TAG_DATE_REGISTERED' );?>

                 </div>

     </td>

     <?php $thksmsg = isset($eventcopy->thksmsg)?$eventcopy->thksmsg:''; ?>

     <td align="left" valign="top">
       <?php echo $editor->display("thksmsg",stripslashes($thksmsg),'','340','20','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>

		      <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(){
                        
						 DTjQuery('.fields').click(function (){
						
						   var fieldname = DTjQuery(this).attr('name').substr(5);
						
						   if(DTjQuery(this).val()==2){
							  
							 DTjQuery("input[name^='required_field"+fieldname+"']").attr('disabled',true)
						
							 DTjQuery("input[name^='group"+fieldname+"']").attr('disabled',true)
						
						   }else{
							  DTjQuery("input[name^='required_field"+fieldname+"']").removeAttr('disabled');
						
						      DTjQuery("input[name^='group"+fieldname+"']").removeAttr('disabled');
						   }
						  
						});
						
						//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.upload').size() > fm) {alert('Max files is '+fm); obj.value='';return true;}

                	DTjQuery(obj).hide();

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

                	var v = obj.value;

               		 if(v != '') {

                		DTjQuery("div#files_list").append('<div>'+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"/>

            <div id="files_list">

            </div>

            </span>

        	</td>

        	<td>

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

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

        </tr>

     <?php 

	   $files = $dt_evt->get_files();	

	   foreach($files as $file){

	    echo '<tr>

		           <td>

				       <input name="copy_files[]" type="checkbox" checked value="'.$file->path.'" />

				   </td>

				   <td>

				       '.basename($file->path).'

				   </td>

		      </tr>';

	   }

	 ?>

      </table>

     <?php

	  echo $pane->endPanel();

	  echo $pane->startPanel(JText::_( 'DT_REGISTER_FIELDS' ),'dtregister5');

	 ?>

     <table class="adminform" width="100%" cellpadding="10" cellspacing="10">

      <?php

      	$database = &JFactory::getDBO();

      	$sql="Select * From #__dtregister_fields Where published=1 and (parent_id=0 || parent_id='' || parent_id is NULL) order by ordering";

      	$database->setQuery($sql);

      	$rowFields=$database->loadObjectList();

      	if(count($rowFields)>0)

      	{

      	?>

      		<tr>

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

		      </tr>

<tr>

          <th><?php echo JText::_( 'DT_CUSTOM_FIELD_NAME' ); ?></th>

		  <th><?php echo JText::_( 'DT_CUSTOM_FIELD_USED' ); ?></th>

          <th><?php echo JText::_( 'DT_REQUIRED' ); ?></th>

          <th><?php echo JText::_( 'DT_CUSTOM_FIELD_GROUPOPTIONS' ); ?></th>

</tr>

		      <?php

			   $fields = $dt_evt->getAllFields();

		      	for($i=0,$n=count($rowFields);$i<$n;$i++)

		      	{

		      		$rowField=$rowFields[$i];

                     $showed = 0;

					 $required = 0 ;

					 $group = 0 ;

                     if(isset($fields[$rowField->id])){

				        $showed = $fields[$rowField->id]->showed ;

						$required = $fields[$rowField->id]->required ;

						$group = $fields[$rowField->id]->group_behave ;

				     }

		      		$name=$rowField->name;

		      	?>

		      		<tr>

		      			<td><?php	echo $rowField->name; ?></td>

		      			<td><?php	
						    $options=array();

						    $options[]=JHTML::_('select.option',"0",JText::_( 'DT_NONE' ));
   $options[]=JHTML::_('select.option',"1",JText::_( 'DT_INDIVIDUAL' ));
   $options[]=JHTML::_('select.option',"2",JText::_( 'DT_GROUP' ));
   $options[]=JHTML::_('select.option',"3",JText::_( 'DT_BOTH'));
						    $options[]=JHTML::_('select.option',"-1",JText::_( 'DT_DEFAULT'));
						 echo JHTML::_('select.radiolist', $options, "field_".$name,' class="fields" ','value','text',$showed);
						
						?></td>

                        <td><?php  echo JHTMLSelect::booleanlist("required_field_".$name,"",$required); ?></td>

                <td>

		      		  <?php

					 		$options=array();

						    $options[]=JHTML::_('select.option',"1",JText::_( 'DT_EACH_MEMBER' ));

						    $options[]=JHTML::_('select.option',"2",JText::_( 'DT_BILLING_ONLY' ));

						    $options[]=JHTML::_('select.option',"3",JText::_( 'DT_MEMBERS_BILLING'));

							  echo JHTML::_('select.radiolist', $options, 'group_'.$name,'','value','text',$group);

							  ?>

		      			</td>

		      		</tr>

		      	<?php	} ?>

      	<?php

      	}

	?>

     </table>

      <?php

	     echo $pane->endPanel();
     
	     echo $pane->startPanel(JText::_( 'DT_USER_PANEL' ),'dtregister6');
      ?>
      <table class="adminform" width="100%" cellpadding="10" cellspacing="10">
      <tr align="center" valign="middle">

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

	    <td width="300" align="left" valign="top">

	    <?php

	    $options=array();
      $options[]=JHTML::_('select.option',"0",JText::_( 'NO'));
	    $options[]=JHTML::_('select.option',"1",JText::_( 'YES'));

      $cancel_refund_status = isset($eventcopy->cancel_refund_status)?$eventcopy->cancel_refund_status:'0';

	    echo JHTML::_('select.radiolist', $options,"cancel_refund_status","","value","text",$cancel_refund_status);

	    ?>

	    </td>

			<td><?php echo JHTML::tooltip((JText::_( 'DT_CANCEL_REFUND_HELP' )), '', 'tooltip.png', '', ''); ?></td>

	  </tr>
       
       <tr>
       <td>
          <?php echo JText::_( 'DT_EDIT_OPTION' ); ?>:
       </td>
       <td>
       <?php 
	       $edit_fee = isset($eventcopy->edit_fee)?$eventcopy->edit_fee:'';
	       echo JHTML::_('select.booleanlist',"edit_fee","",$edit_fee);
	     ?>
       </td>
       <td align="left">
         <?php echo JHTML::tooltip((JText::_( 'DT_EDIT_OPTION_HELP' )), '', 'tooltip.png', '', ''); ?>
       </td>
      </tr>
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_CHANGE_DATE' ); ?>:</td>

        <td>

        	<?php

            $change_date = isset($eventcopy->change_date)?$eventcopy->change_date:'';

        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$change_date,"change_date","change_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="change_date" id="change_date" size="12" maxlength="10" value="<?php echo $change_date; ?>" />

            	<input type="reset" class="button" value="..." onclick="return showCalendar('change_date', 'y-mm-dd');" />

        		<?php

        		}

        	?>

	    	</td>

        <td align="left"><?php echo JHTML::tooltip((JText::_( 'DT_CHANGE_DATE_HELP' )), '', 'tooltip.png', '', ''); ?></td>

      </tr>
      <tr>
       <td>
          <?php echo JText::_( 'DT_CANCEL_OPTION' ); ?>:
       </td>
       <td>
       <?php 
	       $cancelfee_enable = isset($eventcopy->cancelfee_enable)?$eventcopy->cancelfee_enable:'';
	       echo JHTML::_('select.booleanlist',"cancelfee_enable","",$cancelfee_enable);
	     ?>
       </td>
       <td align="left">
         <?php echo JHTML::tooltip((JText::_( 'DT_CANCEL_OPTION_HELP' )), '', 'tooltip.png', '', ''); ?>
       </td>
      </tr>
      
      <tr>

        <td width="10%" align="right"><?php echo JText::_( 'DT_CANCEL_DATE' ); ?>:</td>

        <td>

        	<?php

            $cancel_date = isset($eventcopy->cancel_date)?$eventcopy->cancel_date:'';

        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$cancel_date,"cancel_date","cancel_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="cancel_date" id="cancel_date" size="12" maxlength="10" value="<?php echo $cancel_date; ?>" />

            	<input type="reset" class="button" value="..." onclick="return showCalendar('cancel_date', 'y-mm-dd');" />

        		<?php

        		}

        	?>

	    	</td>

        <td align="left"><?php echo JHTML::tooltip((JText::_( 'DT_CANCEL_DATE_HELP' )), '', 'tooltip.png', '', ''); ?></td>

      </tr>
      
      </table>
  <?php
      echo $pane->endPanel();
	  echo $pane->endPane();

	?>

   </td></tr>

   </table>

 </form>

<script>

DTjQuery(function(){
    
	window.addEvent('domready', function() {

		DTjQuery(".mceEditor").each(function(){
		   
		   var ele_id =  DTjQuery(this).attr('id');
		  
		   var eclass = DTjQuery(this).attr('class') ;
		   if(eclass=='mceEditor'){
		    
		     tinyMCE.execCommand('mceRemoveControl', false, ele_id);
		     tinyMCE.execCommand('mceAddControl', false, ele_id);
		   }
		   
		}); });
	
	DTjQuery('#section').change(function(){

			DTjQuery('#category_id').load("index.php?option=com_dtregister&no_html=1&sectionId="+DTjQuery(this).val()+"&task=getcategory",null,function(){
			
			  	DTjQuery('#categorylist').change(function(){

			DTjQuery('#article_id').load("index.php?option=com_dtregister&no_html=1&categoryId="+DTjQuery(this).val()+"&task=getarticle");

		});
			
			});

		});
		
		 DTjQuery('.fields').click(function (){
						
						   var fieldname = DTjQuery(this).attr('name').substr(5);
						
						   if(DTjQuery(this).val()==-1){
							  
							 DTjQuery("input[name^='required_field"+fieldname+"']").attr('disabled',true)
						
							 DTjQuery("input[name^='group"+fieldname+"']").attr('disabled',true)
						
						   }else{
							  DTjQuery("input[name^='required_field"+fieldname+"']").removeAttr('disabled');
						
						      DTjQuery("input[name^='group"+fieldname+"']").removeAttr('disabled');
						   }
						  
						});
						
						DTjQuery('.fields').each(function(){
						    
							if(this.checked){
							    DTjQuery(this).trigger('click');
							}
							
						});
				DTjQuery('#tax_enable').change(function(){
				   
				   if(DTjQuery(this).val()==0){
				      DTjQuery('#tax_amount').attr('disabled',true);
				   }else{
				      DTjQuery('#tax_amount').removeAttr('disabled');
				   }
				   
				});
				DTjQuery('#tax_enable').trigger('change');
					   
 });

</script>

</div>

<?php

?>