<?php

/**
* @version 2.8.16
* @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
*/

 $section = $this->getModel('section')->table;

 $discountcode = $this->getModel('discountcode')->table;

 $row = $this->row;

 $config = $this->getModel('config');

 $paymentmethod = $this->getModel('paymentmethod');

 $cardtype = $this->getModel('cardtype');

 $paylater = $this->getModel('paylater');

 $currency= $this->getModel('currency');

?>

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

   <tr>

      <td>

        <?php echo JText::_("DT_SELECT_PAYMENT_CONFIG");?>

      </td>

      <td>

        <?php 
		  $default = $this->getModel('payoption')->table;
		  $defaultpayment = $default->find(' `default`=1 ');
		  
		  if($defaultpayment){
			  $defaultpayment = $defaultpayment[0];
		   }else{
			   $defaultpayment = new stdClass;
			   $defaultpayment->id = "";
		   }
		    $user = JFactory::getUser();
		echo JHTML::_('select.genericlist',DtHtml::options($this->row->TablePayoption->optionslist('`public`=1 or user_id='.$user->id)),'data[event][payment_id]','','value','text',isset($row->payment_id)?$row->payment_id:$defaultpayment->id );?>

      </td>

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

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

      </td>

   </tr>      
 
        <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::_( 'DT_NO' ));

	     ?>

       <td>

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

       </td>

       <td>

       <?php 

	       echo JHTML::_('select.genericlist', $options,"data[event][partial_payment]","","value","text",$row->partial_payment);

	     ?>

       </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="data[event][partial_amount]" value="<?php echo $row->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" name="data[event][partial_minimum_amount]" id="partial_minimum_amount" value="<?php echo $row->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::_( 'DT_YES' ));

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

	     ?>

       <td>

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

       </td>

       <td>

       <?php 

	       echo JHTML::_('select.genericlist', $options,"data[event][tax_enable]","","value","text",$row->tax_enable);

	     ?>

       </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="data[event][tax_amount]" value="<?php echo $row->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_ALLOW_TAX_EXEMPTION' ); ?>:</td>

    	<td align="left" valign="top">	
         <?php 
           $options=array();

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

	      $options[]=JHTML::_('select.option',"0",JText::_( 'DT_NO' ));
		  
	       echo JHTML::_('select.genericlist', $options,"data[event][tax_exemption_allow]","","value","text",$row->tax_exemption_allow);

	     ?>
       </td>

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

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

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

    	<td align="left" valign="top">	
         <?php 
           $options=array();

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

	       $options[]=JHTML::_('select.option',"text_not_req",JText::_( 'DT_TEXT_NOT_REQUIRED' ));
		   $options[]=JHTML::_('select.option',"dropdown",JText::_( 'DT_DROPDOWN' ));
		  
	       echo JHTML::_('select.genericlist', $options,"data[event][tax_code_field_type]","","value","text",$row->tax_code_field_type);

	     ?>
       </td>

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

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

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

    	<td align="left" valign="top">	
         <input type="text" name="data[event][tax_code_values]" value="<?php echo $row->tax_code_values; ?>" />
       </td>

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

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

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

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

	    <?php

	     $options=array();

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

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

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

         echo JHTML::_('select.genericlist', $options,"data[event][discount_amount]","","value","text",$row->discount_amount);

	    ?>

	    </td>

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

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

      <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'));

         echo JHTML::_('select.genericlist', $options,"data[event][discount_type]","","value","text",$row->discount_type);

	    ?>

	    </td>

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

	  </tr>
     <?php
       if(isset($row->member_discounts) && count($row->member_discounts)) {
		   foreach($row->member_discounts as $key => $discount) {
		       
			    ?>
                <tr align="center" valign="middle" id="discount_settings" class="addmorerate1">
          
                  <td align="left" valign="top"><?php echo JText::_( 'DT_DISCOUNT_AMOUNT' ); ?>:</td>
          
                  <td align="left" valign="top">	<input size="5" type="text" name="data[discount][amount][]" value="<?php echo $discount['amount']; ?>" />
                  
                  <?php 
                    
                      echo JHTML::_('select.genericlist',$this->getUserGroups(),"data[discount][group_id][]","","value","text", $discount['group_id']);  
                  ?>
                  </td>
          
                  <td colspan="2"><?php echo JHTML::tooltip((JText::_( 'DT_DEFAULT_DISCOUNT_AMOUNT_HELP' )), '', 'tooltip.png', '', ''); ?></td>
          
              </tr>
              <?php
			   
		   }
	   } else {
	 ?>
	  <tr align="center" valign="middle" id="discount_settings" class="addmorerate1">

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

    	<td align="left" valign="top">	<input type="text" size="5" name="data[discount][amount][]" value="<?php echo $row->discount_amount; ?>" />
        
        <?php 
		   
		    echo JHTML::_('select.genericlist',$this->getUserGroups(),"data[discount][group_id][]","","value","text");  
	    ?>
        </td>

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

	</tr>
    <?php
	   }
	?>

    <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'));

	    echo JHTML::_('select.genericlist', $options,"data[event][bird_discount_type]","","value","text",$row->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="data[event][bird_discount_amount]" value="<?php echo $row->bird_discount_amount; ?>" /></td>

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

	  </tr>

    <tr>

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

        <td>

        	<?php
                $row->bird_discount_date = ($row->bird_discount_date == '0000-00-00')?"":$row->bird_discount_date ;
        		if(defined('_JEXEC'))

        		{

        			echo JHTML::_("calendar",$row->bird_discount_date,"data[event][bird_discount_date]","bird_discount_date");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="data[event][bird_discount_date]" id="bird_discount_date" size="12" maxlength="10" value="<?php echo $row->bird_discount_date; ?>" />

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

        		<?php

        		}
             $row->bird_discount_time = ($row->bird_discount_time == '00:00:00')?"":$row->bird_discount_time ;
        	?>

          <input type="text" class="timeEntry" id="bird_discount_time" name="data[event][bird_discount_time]" value="<?php echo $row->bird_discount_time; ?>" />

		    </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="left"><?php echo JText::_( 'DT_LATE_FEE' ); ?>:</td>

        	  <td><input class="inputbox" type="text" name="data[event][latefee]" id="latefee" maxlength="10" value="<?php echo $row->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="left"><?php echo JText::_( 'DT_LATE_FEE_DATE' ); ?>:</td>

	  	  <td>

	  	    <?php
                $row->latefeedate = ($row->latefeedate == '0000-00-00')?"":$row->latefeedate ;
              	if(defined('_JEXEC'))

        		{
	
			echo JHTML::_("calendar",$row->latefeedate,"data[event][latefeedate]","latefeedate");

        		}

        		else

        		{

        		?>

        			<input class="inputbox" type="text" name="data[event][latefeedate]" id="latefeedate" size="12" maxlength="10" value="<?php echo $row->latefeedate;?>" />

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

        		<?php

        		}
              $row->latefeetime = ($row->latefeetime == '00:00:00')?"":$row->latefeetime ;
	  	    ?>

  <input type="text" class="timeEntry" id="latefeetime" name="data[event][latefeetime]" value="<?php echo $row->latefeetime; ?>" />
    </td>

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

      </tr>

	<tr>

	    <td colspan="4" class="dt_heading"><b><?php echo JText::_( 'DT_EVENT_PRICING' ); ?>:</b></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="data[group][0][member]" value="1" /></td>

      <td>

          <input class="inputbox" type="text" name="data[group][0][amount]" size="20" maxlength="10" value="<?php echo(isset($row->group[0]->amount))? htmlspecialchars( $row->group[0]->amount, 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_RATE_TYPE_INSTRUCTION' ); ?></li>

           </ul></td>

    </tr>

    <?php

        $options=array();

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

	      $options[]=JHTML::_('select.option',"per_person",JText::_( 'DT_PER_PERSON' ));
	
	     ?>

   <tr>

     <td colspan="3">
     
      <span>
        <table>
          <tr>
            <td width="20%"><?php echo JText::_('DT_NUMBER_MEMBERS');?></td>
            <td width="20%"><?php echo JText::_('DT_RATE_TYPE');?></td>
            <td width="20%"><?php echo JText::_('DT_AMOUNT');?></td>
            <td width="40%" align="left">&nbsp;</td>
          </tr>
        </table>
      </span>

      <?php

	  if(!$row->group){

		?>

          <span class="addmorerate">

      <table>

      <tr>

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

      <td width="20%">

         <?php 

	       echo JHTML::_('select.genericlist', $options,"data[group][1][type]","","value","text",isset($group->type)?$group->type:'');

	     ?>

      <td width="20%" align="left"><input class="inputbox" id="groupamount" type="text" name="data[group][1][amount]" size="20" maxlength="10" value="<?php echo isset($group->amount)?$group->amount:'';?>" /></td>

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

    </tr>

      </table>

      </span>

        <?php

	  }
      if(isset($row->group) && is_array($row->group))
      foreach($row->group as $key=>$group){

	   if($key==0){

	      continue;

	   }

	  ?>

       <span class="addmorerate">

      <table>

      <tr>

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

      <td width="20%">

         <?php 

	       echo JHTML::_('select.genericlist', $options,"data[group][1][type]","","value","text",$group->type);

	     ?>

      <td width="20%" align="left"><input class="inputbox" id="groupamount" type="text" name="data[group][1][amount]" size="20" maxlength="10" value="<?php echo $group->amount;?>" /></td>

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

    </tr>

      </table>

      </span>

       <?php } ?>

     </td>

   </tr>

    <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::_( 'DT_NO'));

        $options[]=JHTML::_('select.option',"1",JText::_( 'DT_YES_OPTIONAL'));
		
		$options[]=JHTML::_('select.option',"2",JText::_( 'DT_YES_REQUIRED'));
	      echo JHTML::_('select.genericlist',$options,"data[event][use_discountcode]","","value","text",$row->use_discountcode);

		    ?>

      </td>

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

	  </tr>
       <tr id="discount_code_usage">
       <td>
           <?php echo JText::_('DT_CODE_GROUP_OPTIONS');?>:
       </td>
       <td>
       		<?php	
			        
			        $row->discount_code_usagetype = ($row->discount_code_usagetype == "" || $row->discount_code_usagetype =='0')?2:$row->discount_code_usagetype;
					$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.genericlist', $options, "data[event][discount_code_usagetype]",' class="fields" ','value','text',$row->discount_code_usagetype);
						
			?>
       </td>
       <td colspan="2">
          <?php echo JHTML::tooltip((JText::_( 'DT_CODE_GROUP_OPTIONS_HELP' )), '', 'tooltip.png', '', ''); ?>
       </td>
      </tr>
        <?php

         echo "<tr><th colspan='4' class='dt_heading'>". JText::_( 'DT_DISCOUNT_CODES') ."
		       <input id='check_discountcode' type='checkbox' />".JText::_('DT_CHECKALL')."</th></tr>";

         $options = $discountcode->optionslist('publish=1',' name asc ');

		 echo  DtHtml::checkboxListrows('data[discountcode]',$options,3,$row->discountcode,' class = " eventmanange_discountcode " ');

        ?>

     </table>

     <script type="text/javascript">
      var display;
		if(navigator.appName.indexOf("Micro") >=0){
		
			display = 'block';
		
		}else{
		
			display = 'table-row';
		
		}
	  DTjQuery(function(){
		  DTjQuery("#check_discountcode").click(function(){
			   
			   DTjQuery(".eventmanange_discountcode").attr('checked',this.checked);
			   
			});
		  DTjQuery("#dataeventdiscount_amount").live('change',function(){
		      
			  if(DTjQuery(this).val() == "2") {
			     
				 DTjQuery("tr[id='discount_settings']").css({display:display});;
			   
			} else {
			     DTjQuery("tr[id='discount_settings']").css({display:'none'});
			}

		  });
		  DTjQuery("#dataeventdiscount_amount").trigger('change');
		  DTjQuery(".addmorerate").EnableMultiField(
		  {linkText:'<?php echo JText::_('DT_ADD_MORE')?>',
		  removeLinkText:'<?php echo JText::_('DT_REMOVE');?>',
		  confirmationMsgOnRemove : '<?php echo JText::_('DT_CONFIRM_MEMBER_DISCOUNT_REMOVAL'); ?>'});
		  
		  DTjQuery(".addmorerate1").EnableMultiField(
		  {linkText:'<?php echo JText::_('DT_ADD_MORE')?>',
		  removeLinkText:'<?php echo JText::_('DT_REMOVE');?>',
		  confirmationMsgOnRemove : '<?php echo JText::_('DT_CONFIRM_MEMBER_DISCOUNT_REMOVAL'); ?>'});
		  
		  DTjQuery("#dataeventpartial_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);
				   DTjQuery("#partial_minimum_amount").css('backgroundColor','#cccccc');
				   DTjQuery("#partial_amount").css('backgroundColor','#cccccc');
				break;
				case 1:
				   DTjQuery("#partial_amount").val('');
				   //jQuery("#partial_minimum_amount").val('');
				   DTjQuery("#partial_amount").attr('disabled','disabled');
				   DTjQuery("#partial_minimum_amount").removeAttr('disabled');
				   DTjQuery("#partial_amount").css('backgroundColor','#cccccc');
				   DTjQuery("#partial_minimum_amount").css('backgroundColor','#ffffff');
				break;
				case 2:
				  // jQuery("#partial_amount").val('');
				   DTjQuery("#partial_minimum_amount").val('');
				   DTjQuery("#partial_amount").removeAttr('disabled');
				   DTjQuery("#partial_amount").css('backgroundColor','#ffffff');
				   DTjQuery("#partial_minimum_amount").attr('disabled',true);
				   DTjQuery("#partial_minimum_amount").css('backgroundColor','#cccccc');
				break;
			 
			 }
		   
		});
		
		    DTjQuery("#dataeventpartial_payment").trigger('change');
		   
		    DTjQuery('#dataeventuse_discountcode').change(function(){
      
				  if(DTjQuery(this).val() != "0") {
					  if(navigator.appName.indexOf("Micro") >=0){
		  
							  display = 'block';
		  
						  }else{
		  
							  display = 'table-row';
		  
						  }
						  DTjQuery("#discount_code_usage").css({display:display});
				  } else {
						 DTjQuery("#discount_code_usage").hide();
				  }
					
			})
  
   		    DTjQuery('#dataeventuse_discountcode').trigger('change');
		     
	  });
	  
	 </script>
     