<? 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['TXTCLIENTS']; ?></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="#/client/view_clients/<? echo $vis_language['TXTCLIENTS']; ?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTCLIENTS']; ?>',{'vis_module':'client','vis_operation':'view_clients'});"><? echo $vis_language['TXTCLIENTS']; ?></a></li>
            <li class="active"><?=$vis_language['TXTIMPORT']?></li>
        </ul>
    </div>
</section>
<section class="padder">
    <section class="panel panel-default">
        <header class="panel-heading sub_header"><?=$vis_language['TXTIMPORT']?></header>
        <div class="panel-body">
            <form class="form-horizontal" role="form" id="vis_client_import_form" name="vis_client_import_form" method="post">
				<input type="hidden" name="vis_client_id" id="vis_client_id" value="<? echo $operation['vis_client_id']; ?>" />
				<div class="form-group">
					<label for="vis_domain" class="col-sm-2 control-label"><? echo $vis_language['TXTDOMAIN']; ?></label>
					<div class="col-sm-10">
						<select class="form-control selectpicker" name="vis_domain" id="vis_domain"<? if(count($domain_details)>10) echo ' data-live-search="true"';?>>
						<?
							for($i=0;$i<count($domain_details);$i++){
								echo '<option value="'.$domain_details[$i]['domain_id'].'">'.$domain_details[$i]['domain_name'].'</option>';
							} ?>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><? echo $vis_language['TXTORGANIZATION']; ?></label>
					<div class="col-sm-10">
						<select name="vis_group" id="vis_group" class="form-control input-sm selectpicker"<? if(count($client_group)>10) echo ' data-live-search="true"';?>>
							<?
							for($i=0;$i<count($client_group);$i++) echo '<option value="'.$client_group[$i]['group_id'].'">'.$client_group[$i]['group_name'].'</option>'; ?>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label for="vis_csvfile" class="col-sm-2 control-label"><? echo $vis_language['TXTSELECTCSV']; ?></label>
					<div class="col-sm-10">
						<input type="file" name="files[]" multiple="multiple" onchange="$(this).visExecution('upload_file', {'vis_static_area':'#vis_csv_attachments', 'vis_form':'vis_client_import_form', 'vis_form_attachment_area':'#vis_import_attachments'})" class="filestyle" data-input="false" data-icon="true" data-iconName="vh-chat" data-buttonText="<?=$vis_language['TXTCLICKHERE']?>" data-badge="true"/><input type="hidden" name="vis_location" value="<? echo VIS_DOMAIN; ?>" /><input type="hidden" name="vis_import_attachments" id="vis_import_attachments" value="" /><input type="hidden" name="vis_attachments" id="vis_attachments" value="" /><div id="vis_csv_attachments"></div>
                  <input type="hidden" name="vis_parent_type" value="4" />
					</div>
				</div>

            </form>

           <div class="b-2x b-t m-b-md"></div>
				<div class="col-sm col-sm-offset-2">
				<button type="button" class="btn btn-primary" onclick="$('#vis_global_msg_div').visExecution('submit_form', {'vis_module':'client', 'vis_operation':'import_client_list',
        'vis_form':'vis_client_import_form','view_title' : '<?php echo $vis_language['TXTCLIENTIMPORT']; ?>'});"><? echo $vis_language['TXTADD']; ?></button>
				</div> <br/>  </div>
    </section>
</section>

</section>
<style>
.wrapper-xxs {
    padding: 7px 5px 0 0!important;
}
</style>
<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>
<script language="javascript">
    function vis_remove_attachment(ticket_id, attach_location){
        var loc = '';
        loc = (attach_location != "" && typeof(attach_location) != "undefined") ? attach_location : "vis_image_attachments";
        $("#" + loc).val( $("#" + loc).val().replace(ticket_id + ',', '') );
    }
    $(document).ready(function () {
		$(":file").filestyle({input: false});
	});
</script>
<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>
