<?php

/**
* @version 2.8.10
* @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 $Itemid;

$mMember = $this->mMember->table;
//include(JPATH_SITE.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'user'.DS.'tmpl'.DS.'event_header.php');
include(DTreg::get_template_path('user'.DS.'tmpl'.DS.'event_header.php'));
?>
<div id="price_header">
<?php
  //include(JPATH_SITE.DS.'components'.DS.'com_dtregister'.DS.'views'.DS.'event'.DS.'tmpl'.DS.'price_header.php');
?>
</div>
<form name="frmcart" method="post" action="index.php" enctype="multipart/form-data">

   <div style="clear:both">

     <?php

	   echo $this->form;

	 ?>
	
   </div>

   <div style="clear:both; padding:10px 0px 0px 0px">

      <input onclick='window.location="<?php echo JRoute::_("index.php?option=com_dtregister&controller=member&task=index&userId=".$mMember->groupUserId); ?>"' name="" type="button" class="button" value="<?php echo JText::_( 'DT_BACK' ); ?>" />&nbsp;&nbsp;<input type="submit" id="next" class="button" name="savemember" value="<?php echo JText::_( 'DT_SAVE' );?>" />

   </div>

   <input type="hidden" name="Member[groupMemberId]" value="<?php echo $mMember->groupMemberId; ?>" />

   <input type="hidden" name="Member[groupUserId]" value="<?php echo $mMember->groupUserId; ?>" />

   <input type="hidden" name="formsubmit" value="edit" />
   <input type="hidden" name="key" value="<?php echo $this->key; ?>" />
   <input type="hidden" name="option" value="com_dtregister" />

   <input type="hidden" name="controller" value="member" />

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

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

</form>

<div id="debug">

</div>

<script type="text/javascript">

 DTjQuery(function(){

   //DTjQuery.validator.messages.required = " ";

    DTjQuery(document.frmcart).validate({

	        success: function(label) {

				label.addClass("success");

			}

	});	

 })
 var disabled = [];
  DTjQuery('#next').click(function(){
  	  if(DTjQuery(document.frmcart).valid()){
        var disabled = DTjQuery(':disabled');
        DTjQuery.each(disabled, function(){
		     DTjQuery(this).removeAttr('disabled');  
	   	})
	  	
	}
  })
 Joomla.submitbutton = function(pressbutton) {

	if(DTjQuery(document.frmcart).valid()){

	  	submitform(pressbutton);

	}

	return false;

}

</script>
<script type="text/javascript">
  var DT_disabled = [];
 DT_disabled = DTjQuery(':disabled');
 var updateFee = function(){
	    
	  // var prevtask = DTjQuery(document.frmcart.task).val();
	  // var prevcontroller = DTjQuery(document.frmcart.controller).val();
	   var options = {
		   				beforeSubmit : function () {
						              	 DTjQuery.each(DT_disabled, function(){
		     									 DTjQuery(this).removeAttr('disabled','disabled');  
	   								         })
									  },
		               url : "<?php echo JRoute::_("index.php?no_html=1");?>",
					    data : {task:'price_header',controller:'user'},
					   success : function(responseText){
						             DTjQuery("#price_header").html(responseText);
									  DTjQuery.each(DT_disabled, function(){
		     									DTjQuery(this).attr('disabled','disabled');  
	   								         })
					              }
		   }
	  // DTjQuery(document.frmcart.task).val('price_header');
	  // DTjQuery(document.frmcart.controller).val('user');
	   DTjQuery(document.frmcart).ajaxSubmit(options);
	  // DTjQuery(document.frmcart.task).val(prevtask);
	  // DTjQuery(document.frmcart.controller).val(prevcontroller);
	     
  }
  
  updateFee();
</script>