<?php
/**
* @version 2.6.8
* @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
*/

?>

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

		function submitbutton(pressbutton) {

			var form = document.adminForm;

			if (pressbutton == 'cancel_customfield') {

				submitform( pressbutton );

				return;

			}

			// do field validation

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

				alert( "Field must have a name" );

				return;

			}

			var startChar=form.name.value.charAt(0);

			if((startChar>='0') && (startChar <= '9'))

			{

				alert("Cannot start field name with a number");

				return;

			}

			var re = new RegExp("[^a-zA-Z0-9_]");

			if (form.name.value.match(re))

			{

		    	alert("Field name only allow characters a-z,A-Z,0-9 and '_' character");

		    	return;

		  	}

			if (form.type.value == 1 || form.type.value == 3 || form.type.value == 4)

			{

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

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

                    return;

			   }
			   
			   if(form.values.value == ""){
			       
				    alert("<?php echo JText::_( 'DT_FIELD_VALUE_REQUIRED' );?>");

                    return;
				   
			   }

		  	}

			submitform( pressbutton );

		}

		</script>

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

		<table class="adminheading">

		<tr>

			<th>

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

			<small>

			<?php echo $row->id ? 'Edit' : 'New';?>

			</small>

			</th>

		</tr>

		</table>

		<table width="100%" class="adminform" border="1">

      <tbody>

			<tr>

				<th colspan="3" class="dt_heading"><?php echo JText::_( 'DT_DETAILS' );?></th>

			</tr>

			<tr>

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

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

				<input class="text_area" type="text" name="name" size="50" maxlength="250" value="<?php echo $row->name;?>" <?php if($row->id) echo "readonly='true'" ?> onChange="updateFieldName();" />

				</td>

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

			</tr>

			<tr>

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

				<td><?php	echo $lists["type"]; ?></td>

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

			</tr>

			<tr class="typeshow type0 type1 type5 type8">

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

				<td valign="top">

					<input type="text" name="field_size" size="10"  value="<?php echo $row->field_size?>" <?php if(($row->type !=0) && ($row->type !=1)) echo "disabled=true"; ?> />

				</td>

				<td valign="top"><?php echo JHTML::tooltip(JText::_( 'DT_HELP_FIELD_SIZE' ), '', 'tooltip.png', '', '');?></td>

			</tr>
            <tr class="typeshow  type5 ">  
            
               <td align="left" valign="top"><?php echo JText::_( 'DT_DATE_FORMAT' ) ?>:</td>

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

								   <?php

								/* $format_list[] = JHTML::_('select.option','%b %d, %Y', 'Mar 5, 2009' );

								 $format_list[] = JHTML::_('select.option','%d %b %Y', '5 Mar 2009' );

                                 $format_list[] = JHTML::_('select.option','%A, %b %d, %Y', 'Monday, Mar 5, 2009' );

                                 $format_list[] = JHTML::_('select.option','%A, %d %b %Y', 'Monday, 5 Mar 2009' );*/

								 $format_list[] = JHTML::_('select.option','%m-%d-%Y', 'mm-dd-yyyy' );

								 $format_list[] = JHTML::_('select.option','%d-%m-%Y', 'dd-mm-yyyy' );

								 $format_list[] = JHTML::_('select.option','%Y-%m-%d', 'yyyy-mm-dd' );

								 $format_list[] = JHTML::_('select.option','%m.%d.%Y', 'mm.dd.yyyy' );

								 $format_list[] = JHTML::_('select.option','%d.%m.%Y', 'dd.mm.yyyy' );

								 $format_list[] = JHTML::_('select.option','%Y.%m.%d', 'yyyy.mm.dd' );

								/* $format_list[] = JHTML::_('select.option','%m/%d/%Y', 'mm/dd/yyyy' );

								 $format_list[] = JHTML::_('select.option','%d/%m/%Y', 'dd/mm/yyyy' );

								 $format_list[] = JHTML::_('select.option','%Y/%m/%d', 'yyyy/mm/dd' );*/

								 //%b %e , %Y |  %e %b %Y | %m/%d/%Y | %d/%m/%Y | %Y/%m/%d |%m.%d.%Y | %d.%m.%Y | %Y.%m.%d

								   echo JHTML::_('select.genericlist',$format_list,"date_format",'','value','text',isset($row->date_format)?$row->date_format:'%m-%d-%Y');

								   ?>

							   </td>

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

							   </tr>

			<tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<input class="text_area" type="text" name="label" size="50" maxlength="250" value="<?php echo htmlentities(stripslashes($row->label),null,'UTF-8');?>" />

				</td>

				<td valign="top"><?php echo JHTML::tooltip(JText::_( 'DT_HELP_FIELD_LABEL' ), '', 'tooltip.png', '', '');?></td>

			</tr>
            
            <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">
                <?php
                 // $conditionfield = isset($row->conditionfield)?$row->conditionfield:0;
				//echo JHTML::_('select.booleanlist','conditionfield','',$conditionfield);
			//	echo  echo JHTML::_('select.genericlist',$options,"parent_id",'','value','text',$this->row->parent_id);
			echo  $lists['parent_list'];
				?>
                
				<br />
                <span id="parentoptions">
                
                </span>

				</td>

				<td valign="top"><?php echo JHTML::tooltip(JText::_( 'DT_HELP_CONDITION_FIELD' ), '', 'tooltip.png', '', '');?></td>

			</tr>
           
			<tr class="typeshow  type1 type3 type4" >

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

				<td align="center">

					<textarea name="values" rows="3" cols="40" <?php if((!$row->type) || ($row->type==2)) echo  "disabled"; ?>><?php echo $row->values?></textarea>

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

				</td>

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

			</tr>

      <tr class="typeshow  type1 type3 type4" >

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

				<td align="center">

					<textarea name="usagelimit" rows="3" cols="40" ><?php echo $row->usagelimit; ?></textarea>

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

				</td>

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

			</tr>

			<tr class="typeshow type1 type3 type4">

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

				<td align="center">

					<input class="text_area" type="text" name="selected" size="70" maxlength="250" value="<?php echo $row->selected;?>" <?php if((!$row->type) || ($row->type==2)) echo  "disabled"; ?> /> 

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

				</td>

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

			</tr>

			<tr class="typeshow type1 type2 type3 type4">

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

				<td>

					<input type="checkbox" name="fee_field" value="1" <?php if($row->fee_field==1) echo "checked"; ?> <?php if(!$row->type ){ echo  "disabled"; } ?> onClick="changeFeeField();"/>

				</td>

				</td>

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

			</tr>

			<tr class="typeshow  type1 type3 type4">

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

				<td align="center">

					<input class="text_area" type="text" name="fees" size="70" maxlength="" value="<?php echo $row->fees;?>" <?php if((!$row->type) || ($row->type==2)) echo  "disabled"; ?> />

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

				</td>

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

			</tr>

      <tr class="typeshow  type1 type3 type4">

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

				<td align="center">

          <?php

	        $options=array();

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

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

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

          $fee_type = isset($row->fee_type)?$row->fee_type:'1';

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

	        ?>

				</td>

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

			</tr>
<tr class="typeshow  type2">

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

				<td align="center">

					<input class="text_area" type="text" name="textareafee" size="50" maxlength="250" value="<?php echo $row->textareafee;?>" <?php if($row->type!=2) echo  "disabled"; ?> />

				</td>

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

			</tr>
			<tr class="typeshow  type2">

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

				<td align="center">

					<input class="text_area" type="text" name="rows" size="10" maxlength="250" value="<?php echo $row->rows;?>" <?php if($row->type!=2) echo  "disabled"; ?> />

				</td>

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

			</tr>
            
            	

			<tr class="typeshow  type2">

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

				<td align="center">

					<input class="text_area" type="text" name="cols" size="10" maxlength="250" value="<?php echo $row->cols;?>" <?php if($row->type!=2) echo  "disabled"; ?> />

				</td>

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

			</tr>

			<tr class="typeshow type0 type1 type2 type3 type4 type5 type8">

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

			  <td valign="top">

				<textarea name="description" rows="3" cols="40"><?php echo $row->description?></textarea>

			  </td>

			  <td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_DESCRIPTION' )), '', 'tooltip.png', '', '');?></td>

			</tr>

			<tr class="typeshow type6">

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

			  <td valign="top">

				<textarea name="textual" rows="3" cols="40"><?php echo stripslashes($row->textual)?></textarea>

			  </td>

			  <td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_TEXTUAL' )), '', 'tooltip.png', '', '');?></td>

			</tr>

			<tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['published']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_PUBLISHED' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            
      <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['hidden']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_HIDDEN' )), '', 'tooltip.png', '', '');?></td>

			</tr>
			<tr class="typeshow type3 type4">

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

				<td valign="top">

				<?php echo $lists['new_line']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_NEWLINE' )), '', 'tooltip.png', '', '');?></td>

			</tr>
			<tr class="typeshow type7">

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

				<td valign="top">

				<input type="text" name="filesize" size="50" value="<?php echo isset($row->filesize)?$row->filesize:'' ?>" />

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FILE_SIZE' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            
      <tr class="typeshow type7">

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

				<td valign="top">

				<input type="text" name="filetypes" size="50" value="<?php echo isset($row->filetypes)?$row->filetypes:'' ?>" />

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FILE_TYPES' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            
      <tr class="typeshow type7">

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

				<td valign="top">

        <?php
				$upload = isset($row->filetypes)?$row->upload:0;
				echo JHTML::_('select.booleanlist','upload','',$upload);

        ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_UPLOAD_ATTACHMENT' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            <tr class="typeshow type0 type2">

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

				<td valign="top">

				<input type="text" name="maxlength" size="10" value="<?php echo (isset($row->maxlength) && $row->maxlength !=0)?$row->maxlength:'' ?>" />

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_MAXLENGTH' )), '', 'tooltip.png', '', '');?></td>

			</tr>
             <tr class="typeshow type2">

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

				<td valign="top">
               <?php
               
			   $showcharcnt = isset($row->showcharcnt)?$row->showcharcnt:0;
				echo JHTML::_('select.booleanlist','showcharcnt','',$showcharcnt);

			   ?>
				

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_SHOW_CHAR_COUNT' )), '', 'tooltip.png', '', '');?></td>

			</tr>
			<tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">
			
			  <td colspan="3" class="dt_heading"><?php echo JText::_( 'DT_DEFAULT_SETTINGS' );?></td>
			
			</tr>

      <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['allevent']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_ALL_EVENT' )), '', 'tooltip.png', '', '');?></td>

			</tr>
             <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['showed']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_SHOW' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            
      <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['required']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_REQUIRED' )), '', 'tooltip.png', '', '');?></td>

			</tr>
            
      <tr class="typeshow type0 type1 type2 type3 type4 type5 type6 type7 type8">

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

				<td valign="top">

				<?php echo $lists['group_behave']; ?>

				</td>

				<td valign="top"><?php echo JHTML::tooltip((JText::_( 'DT_HELP_FIELD_GROUPOPTIONS' )), '', 'tooltip.png', '', '');?></td>

			</tr>

			</tbody>

		</table>

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

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

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

		</form>

		<script src="../components/com_dtregister/assets/js/jquery.js" ></script>

		<script language="javascript">

			window.addEvent('domready', function(){ var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false}); });

			function updateFieldName()

			{

				var form=document.adminForm;

				var fieldName=form.name;

				if(fieldName.value.indexOf(' ')!=-1)

				{

					//We will replace the space here

					var re = new RegExp("[ ]", "g");

				    fieldName.value= fieldName.value.replace(re,"_");

					alert('Spaces are not allowed in the field name. Your space has been replaced by a _ character');

				}

				var re = new RegExp("[^a-zA-Z0-9_]");

				if (fieldName.value.match(re))

				{

			    	alert("Field name only allow characters a-z,A-Z,0-9 and '_' character");

			    	return;

			  	}

			}

			function changeFieldType(rest)

			{

                if(rest){

				  //document.adminForm.reset();

				}

				var form=document.adminForm;

				var fieldType=form.type.value;

				if(fieldType==6){

					form.values.disabled=true;

					form.label.disabled=false;

					form.selected.disabled=true;

					form.description.disabled=true;

					form.fee_field.disabled=true;

					form.fees.disabled=true;

					form.field_size.disabled=true;

					form.fees.disabled=true;

					form.rows.disabled=true;

					form.textual.disabled=false;

					form.cols.disabled=true;

					form.new_line[0].disabled=true;

					form.new_line[1].disabled=true;

				}else{

					form.textual.disabled=true;

					form.values.disabled=false;

					form.label.disabled=false;

					form.selected.disabled=false;

					form.description.disabled=false;

					form.fee_field.disabled=false;

					form.fees.disabled=false;

					form.field_size.disabled=false;

					form.fees.disabled=false;

					form.rows.disabled=false;

					form.textual.disabled=false;

					form.cols.disabled=false;

					form.new_line[0].disabled=false;

					form.new_line[1].disabled=false;

				}

				if((fieldType!=0) && (fieldType!=1) && (fieldType!=5))

				{

					//Disable size property

					form.field_size.disabled=true;

				}

				else

				{

					form.field_size.disabled=false;

				}

				if ((fieldType==0)  || (fieldType==5))

				{

					form.values.disabled=true;

					form.selected.disabled=true;

					form.fee_field.disabled=true;

					form.fees.disabled=true;

				}

				else if(fieldType !=6)

				{

					form.values.disabled=false;

					form.selected.disabled=false;

					form.fee_field.disabled=false;

					if(form.fee_field.checked==true)

						form.fees.disabled=false;

					else

						form.fees.disabled=true;

				}

				//Check rows and cols enable

				if(fieldType!=2)

				{

					form.rows.disabled=true;

					form.cols.disabled=true;

				}

				else

				{

					form.rows.disabled=false;

					form.cols.disabled=false;

				}

				//

				//Check for new line options

				if(fieldType>=3 && fieldType!=6)

				{

					for(var i=0;i<form.new_line.length;i++)

					{

						form.new_line[i].disabled=false;

					}

				}

				else

				{

					for(var i=0;i<form.new_line.length;i++)

					{

						form.new_line[i].disabled=true;

					}

				}

				$$('.typeshow').setStyles({display:'none'});

				//$$('.type'+fieldType).setStyles({display:'block'});

				if(navigator.appName.indexOf("Micro") >=0){

					display = 'block';

				}else{

					display = 'table-row';

				}

				$$('.type'+fieldType).setStyles({display:display});

				$('published0').setProperty('disabled',false);

				$$('.type'+fieldType).setProperty('value','');

				$('published1').setProperty('disabled',false);
				$('hidden0').setProperty('disabled',false);
				$('hidden1').setProperty('disabled',false);
				
				$('allevent0').setProperty('disabled',false);
				$('allevent1').setProperty('disabled',false);
				$('required0').setProperty('disabled',false);
				$('required1').setProperty('disabled',false);
				$('showed0').setProperty('disabled',false);
				$('showed1').setProperty('disabled',false);

			}

			function changeFeeField()

			{

				var form=document.adminForm;

				if(form.fee_field.checked==1)

				{

					form.fees.disabled=false;
					form.textareafee.disabled=false;

				}

				else

				{

					form.fees.disabled=true;
					form.textareafee.disabled=true;

				}

			}

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

    			changeFieldType(0);

 			});
			<?php
			   
			   if($row->selection_values!=""){
				   ?>
				    var selection_values = <?php echo json_encode(explode(',',$row->selection_values));?> ;
				   <?php
			    }else{
					?>
					var selection_values = [] ;
					<?php
				   	
				}
			 
			?>
			 DTjQuery(function(){
			   
						   
			   DTjQuery('#parent_id').change(function(){
			     
				  if(DTjQuery(this).val()!=""){
				      DTjQuery('#parentoptions').load("index.php?option=com_dtregister&task=fieldoptions&no_html=1&id="+DTjQuery(this).val(),function(){
		 	DTjQuery('#parentoptions').find('input').val(selection_values);
			selection_values = [];
		})
				  }
				 
			   })
			   <?php
			     if(!$row->id){
				?>
				   if(document.adminForm.fee_field.checked){
					  document.adminForm.fee_field.checked = false ;
					   changeFeeField();
				   }
				   
				<?php
				 }
			   
			   ?>
			   DTjQuery('#parent_id').trigger('change');
			   
			})

		</script>