<?php
$department = '<select data-placeholder="--' .  __('lblChoose', true) . '--" name="department_id[]" id="department_id" multiple="multiple" class="pj-form-field w300 required">';
foreach ($tpl['department_arr'] as $v)
{
	if(in_array($v['id'], $tpl['department_id_arr']))
	{
	    $department .= sprintf('<option value="%u" selected="selected">%s</option>', $v['id'], pjSanitize::html($v['name']));
	}else{
	    $department .= sprintf('<option value="%u">%s</option>', $v['id'], pjSanitize::html($v['name']));
	}
}
$department .= '</select>';

pjAppController::jsonResponse(compact('department'));
?>