<? global $vis_language;
 ?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
	<div class="col-sm-6">
		<h3 class="m-b-xs text-black"><? echo $vis_language['TXTPACKAGE'];?></h3>
		<ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
			<li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME'];?></a></li>
			<li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><? echo $vis_language['TXTSETTINGS'];?></a></li>
			<li><a  class="link" href="#/setting/products_list/<? echo $vis_language['TXTPACKAGE'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTPACKAGE'];?>',{'vis_module':'setting','vis_operation':'products_list'});" class="link"><? echo $vis_language['TXTPACKAGE'];?></a> </li>
			<li class="active"><?echo $vis_language['TXTADDPACKAGE'];?></li>
		</ul>
	</div>
</section>
<section class="padder">
	<section class='panel panel-default'>
		<header class="panel-heading sub_header"><? echo $vis_language['TXTADDPACKAGE']; ?></header>
		<div class="panel-body">
			<form method="post" name="vis_add_product_form" id="vis_add_product_form" class="form-horizontal">
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTDOMAIN']; ?></label>
					<div class='col-sm-10'>
						<select class='form-control input-sm selectpicker'onchange="getCurrency(this.value)" name="vis_domain" id="vis_domain" <? if(count($domain) > 10) echo 'data-live-search="true"' ?> >
							<? for($i=0;$i<count($domain);$i++) echo '<option value="'.$domain[$i]['domain_id'].'">'.$domain[$i]['domain_name'].'</option>'; ?>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTTITLE']; ?></label>
					<div class="col-sm-10">
						<input class="form-control input-sm" type="text" name="vis_title" id="vis_title" value="" >
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTDESCRIPTION']; ?></label>
					<div class="col-sm-10">
						<textarea class="form-control input-sm" name="vis_details" id="vis_details"></textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTDISPLAYORDER']; ?></label>
					<div class="col-sm-10">
						<input class="form-control input-sm" type="text" name="vis_order" id="vis_order" value="0">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTBILLINGCYCLE']; ?></label>
					<div class='col-sm-10'>
						<select class='form-control input-sm selectpicker' name="vis_validity" id="vis_validity">
							<option value="0"><?= $vis_language['TXTVALIDITY0']; ?></option>
                            <option value="1"><?= $vis_language['TXTVALIDITY1']; ?></option>
                            <option value="2"><?= $vis_language['TXTVALIDITY2']; ?></option>
                            <option value="3"><?= $vis_language['TXTVALIDITY3']; ?></option>
                            <option value="4"><?= $vis_language['TXTVALIDITY4']; ?></option>
						</select>
					</div>
				</div>
				<div class="form-group" id="vis_recurring" style="display:none;">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTRECURRING']; ?></label>
					<div class="col-sm-10">
						<div class="radio i-checks pull-left m-r-lg">
						<label>
							<input type="radio" name="vis_recurring" id="vis_recurring_yes" value="1" checked="checked"><i></i>
							<? echo $vis_language['TXTYES']; ?>
						</label></div>
						<div class="radio i-checks pull-left">
						<label>
							<input type="radio" id="vis_recurring_no" name="vis_recurring" value="0" ><i></i>
							<? echo $vis_language['TXTNO']; ?>
						</label></div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTCREDITTYPE']; ?></label>
					<div class="col-sm-10">
						<div class="radio i-checks pull-left m-r-lg">
						<label>
							<input type="radio" name="vis_type" id="vis_type_in" value="1" checked="checked"><i></i>
							<? echo $vis_language['TXTCASHBAL']; ?>
						</label></div>
						<div class="radio i-checks pull-left">
						<label>
							<input type="radio" id="vis_type_ex" name="vis_type" value="0" ><i></i>
							<? echo $vis_language['TXTTKTBAl']; ?>
						</label></div>
					</div>
				</div>
				<div class="form-group" id="vis_show_balance" style="display:none;">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTTKTBAl']; ?></label>
					<div class="col-sm-10">
						<input class="form-control input-sm" type="text" name="vis_tickets" id="vis_tickets" value="0">
					</div>
				</div>
				<div class="form-group" id="vis_show_amount_cr">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTCASHBAL'].'<span id=\'vis_currency_name\'>('.$domain[$i]['currency'].')</span>'; ?></label>
					<div class="col-sm-10">
						<input class="form-control input-sm" type="text" name="vis_amountCr" id="vis_amountCr" value="0">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><?= $vis_language['TXTPRICE'].'<span id=\'price_currency_name\'>('.$domain[$i]['currency'].')</span>'; ?></label>
					<div class="col-sm-10">
						<input class="form-control input-sm" name="vis_amount" id="vis_amount" value="0.00">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><? echo $vis_language['TXTSTATUS']; ?></label>
					<div class="col-sm-1">
						<label class="switch">
						  <input type="checkbox" checked="checked" name="vis_status"  id="vis_status">
						  <span ></span>
						</label>
					</div>
				</div>
				<div class="line b-b line-lg pull-in"></div>
				<br/>
				<div class="form-group">
					<div class="col-sm-4 col-sm-offset-2">
					<button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'add_product', 'vis_form':'vis_add_product_form'})"><? echo $vis_language['TXTADD']; ?></button>
					</div>
				</div>
			</form>
		</div>
	</section>
</section>
<script>
	$('.selectpicker').selectpicker();
	$("#vis_type_in").change( function(){ $("#vis_show_balance").hide();$("#vis_show_amount_cr").show(); });
	$("#vis_type_ex").change( function(){ $("#vis_show_balance").show();$("#vis_show_amount_cr").hide(); });
	$("#vis_validity").change( function(){ ( this.value > 0 ) ? $("#vis_recurring").show() : $("#vis_recurring").hide() });
	getCurrency($('#vis_domain').val());
	function getCurrency(domain_id)
	{
			<?php
			for($i=0;$i<count($domain);$i++)
			{
				?>
				if(<?php echo$domain[$i]['domain_id']; ?> == domain_id )
				{
				    $('#vis_currency_name').html(' (<?php echo $domain[$i]['currency'];?>)');
				    $('#price_currency_name').html(' (<?php echo $domain[$i]['currency'];?>)');

				}
			<?php  } ?>

	}
</script>
