<?php /* Smarty version Smarty-3.1.19, created on 2019-03-07 13:49:15
         compiled from "template__system/admin_admin:/home/itjobboard/public_html/constructionjobboard.co.uk/templates/_system/admin/listing_import/user_fields.tpl" */ ?>
<?php /*%%SmartyHeaderCode:13772145745c81215b19e203-67774034%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '4c69195007de30e8cc4e7dff7880c12e8fd75b73' => 
    array (
      0 => 'template__system/admin_admin:/home/itjobboard/public_html/constructionjobboard.co.uk/templates/_system/admin/listing_import/user_fields.tpl',
      1 => 1483999076,
      2 => 'template__system/admin_admin',
    ),
  ),
  'nocache_hash' => '13772145745c81215b19e203-67774034',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'id' => 0,
    'selecteduser' => 0,
    'one' => 0,
    'a_selecteduser' => 0,
    'tree' => 0,
    'username' => 0,
    'main_key' => 0,
    'fields' => 0,
    'field' => 0,
    'idField' => 0,
    'user_default_value' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.19',
  'unifunc' => 'content_5c81215b1fa5a8_64859447',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5c81215b1fa5a8_64859447')) {function content_5c81215b1fa5a8_64859447($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_replace')) include '/home/itjobboard/public_html/constructionjobboard.co.uk/system/ext/Smarty/libs/plugins/modifier.replace.php';
?><script type="text/javascript">
	function in_array(what, where)
	{
		for(var i=0; i<where.length; i++) {
			if (what == where[i])
				return i;
		}
		return -1;
	}

	var id = <?php echo $_smarty_tpl->tpl_vars['id']->value;?>
;

	var selecteduser = [];
	<?php  $_smarty_tpl->tpl_vars['one'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['one']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['selecteduser']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['one']->key => $_smarty_tpl->tpl_vars['one']->value) {
$_smarty_tpl->tpl_vars['one']->_loop = true;
?>
		selecteduser.push('<?php echo $_smarty_tpl->tpl_vars['one']->value;?>
');
	<?php } ?>

	var a_selecteduser = [];
	<?php  $_smarty_tpl->tpl_vars['one'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['one']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['a_selecteduser']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['one']->key => $_smarty_tpl->tpl_vars['one']->value) {
$_smarty_tpl->tpl_vars['one']->_loop = true;
?>
		a_selecteduser.push('<?php echo $_smarty_tpl->tpl_vars['one']->value;?>
');
	<?php } ?>

	$(function() {
		if (id > 0){
			$(".draggableuser").each(function(i){
				var drag = $(this);
				var isset = in_array(drag.attr('id'), selecteduser);
				  if (isset >= 0)
				  {
					  var drop = $("#user_"+a_selecteduser[isset] + ".droppableuser");
					  var input = "<input type='hidden' class='mapped_user' name='mapped_user[]' value='"+drop.attr('id')+':'+drag.attr('id')+"'>";
					  $("#defaultValueUser_"+drag.attr('id')).css("display", "none");
					  drop.html(input);
					  drop.append(drag);
				  }
			});
		}

		$(".draggableuser").draggable({
			revert: 'invalid',
			cursor: 'move'
		});

		$(".droppable2user").droppable({
			activeClass: 'ui-state-highlight2',
			hoverClass: 'ui-state-drophover2',
			accept: '.draggableuser',
			drop: function(event, ui) {
				$(ui.draggable).css("top", $(this).position().top + 5);
				$(ui.draggable).css("left", $(this).position().left +5);
			}
		});

		$(".droppableuser").droppable({
			activeClass: 'ui-state-highlight',
			hoverClass: 'ui-state-drophover',
			accept: '.draggableuser',
			out: function(event, ui) {
				if ($(this).children("input").val() == $(this).attr('id')+':'+ui.draggable.attr('id')) {
					$(this).children("input").remove();
					$("#defaultValueUser_"+ui.draggable.attr('id')).css("display", "block");
				}
			},
			drop: function(event, ui) {
				if ($(this).children("input").size() > 0) {
					alert('Field can access only one item');
				} else {
					var iner = "<input type='hidden' class='mapped_user' name='mapped_user[]' value='"+$(this).attr('id')+':'+ui.draggable.attr('id')+"'>";
					$("#defaultValueUser_"+ui.draggable.attr('id')).css("display", "none");
					//$("#iduser_"+ui.draggable.html()).val('');
					$(this).append(iner);
				}
				$(ui.draggable).css("top", $(this).position().top + 5);
				$(ui.draggable).css("left", $(this).position().left +5);
			}
		});

	});
</script>

<table class="manage_table">
	<thead>
		<tr>
			<th width="34%" class="text-center"><strong><?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
User Profile Fields<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</strong></th>
			<th width="34%" class="text-center"><strong><?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Default Value<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</strong></th>
			<th class="text-center"	><strong><?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
XML Data Fields<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</strong></th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td valign="top" colspan='3' class="td-header">
				<table width="100%">
					<tr>
						<td class="td-header"><div class="droppable2Username" ><div style='line-height: 34px; height: 34px;'><strong><?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
email<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
</strong></div></td>
						<td class="td-wide td-header">&nbsp;</td>
						<td align='right' class="td-header">
							<div class="droppableusername">
								<div class="xml-data-fields">
									<select name='username' style="width: 190px;">
											<?php  $_smarty_tpl->tpl_vars['one'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['one']->_loop = false;
 $_smarty_tpl->tpl_vars['main_key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['tree']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['one']->key => $_smarty_tpl->tpl_vars['one']->value) {
$_smarty_tpl->tpl_vars['one']->_loop = true;
 $_smarty_tpl->tpl_vars['main_key']->value = $_smarty_tpl->tpl_vars['one']->key;
?>
												<option value='<?php echo $_smarty_tpl->tpl_vars['one']->value['key'];?>
' <?php if ($_smarty_tpl->tpl_vars['username']->value==$_smarty_tpl->tpl_vars['one']->value['key']) {?>selected<?php }?>><?php echo smarty_modifier_replace(smarty_modifier_replace($_smarty_tpl->tpl_vars['main_key']->value,"_dog_","@"),"_"," - ");?>
</option>
											<?php } ?>
									</select>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top" colspan='2'>
				<table width="100%">
					<?php  $_smarty_tpl->tpl_vars['field'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['field']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['fields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) {
$_smarty_tpl->tpl_vars['field']->_loop = true;
?>
					<tr>
						<td class="td_height">
							<div class="droppable2user">
								<div class="draggableuser" title="<?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
Drag and drop to the appropriate XML field<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
" id="<?php echo $_smarty_tpl->tpl_vars['field']->value['id'];?>
">
									<?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['field']->value['caption'], ENT_QUOTES, 'UTF-8', true);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>

								</div>
							</div>
						</td>
						<?php $_smarty_tpl->tpl_vars["idField"] = new Smarty_variable($_smarty_tpl->tpl_vars['field']->value['id'], null, 0);?>
						<td class="td_height td-wide">
							<div id='defaultValueUser_<?php echo $_smarty_tpl->tpl_vars['field']->value['id'];?>
'>
								<input placeholder="<?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['field']->value['caption'], ENT_QUOTES, 'UTF-8', true);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
" type="text" name='user_default_value[<?php echo $_smarty_tpl->tpl_vars['field']->value['id'];?>
]' id='iduser_<?php echo $_smarty_tpl->tpl_vars['field']->value['id'];?>
' value="<?php $_smarty_tpl->smarty->_tag_stack[] = array('tr', array()); $_block_repeat=true; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), null, $_smarty_tpl, $_block_repeat);while ($_block_repeat) { ob_start();?>
<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['user_default_value']->value[$_smarty_tpl->tpl_vars['idField']->value], ENT_QUOTES, 'UTF-8', true);?>
<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_plugins['block']['tr'][0][0]->translate(array(), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack);?>
"  />
							</div>
						</td>
					</tr>
					<?php } ?>
				</table>
			</td>
			<td valign="top">
				<table width="100%">
					<?php  $_smarty_tpl->tpl_vars['one'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['one']->_loop = false;
 $_smarty_tpl->tpl_vars['main_key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['tree']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['one']->key => $_smarty_tpl->tpl_vars['one']->value) {
$_smarty_tpl->tpl_vars['one']->_loop = true;
 $_smarty_tpl->tpl_vars['main_key']->value = $_smarty_tpl->tpl_vars['one']->key;
?>
						<tr>
							<td class="td_height" align="right" style="white-space: nowrap"><?php echo smarty_modifier_replace(smarty_modifier_replace($_smarty_tpl->tpl_vars['main_key']->value,"_dog_","@"),"_"," - ");?>
 </td>
							<td class="td_height"><div class="droppableuser" id="user_<?php echo $_smarty_tpl->tpl_vars['one']->value['key'];?>
"></td>
						</tr>
					<?php } ?>
				</table>
			</td>
		</tr>
	</tbody>
</table>

<?php }} ?>
