<? global $vis_language;  ?>
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title"><? echo$vis_language['TXTREQUESTAPROVALS']; ?></h4>
        </div> 
        <div id="parent_list" class="modal-body">
            <div class="row">
                <div class="col-sm-12">
					<section id="test" class="scrollable wrapper">
						<div class="row m-b">
							<div class="col-md-12">
								<form method="post" role="form" class="form-horizontal" name="vis_attach_ci_<?= $operation['vis_ticket_id'];?>" id="vis_attach_ci_<?= $operation['vis_ticket_id'];?>">
								<? //THIS ONE FOR THE RADIO BUTTONS STARTS ?>    
								<div class="col-sm-9">
								<div class="radio i-checks m-r-lg pull-left "><label>
								<input type="radio" name="member" id="member" value="team" checked="checked" onclick="select_div('1')"><i></i>
								Team</label> </div>
								<div class="radio i-checks m-r-lg pull-left "><label>
								<input type="radio" name="member" id="member" value="staff" onclick="select_div('2')"><i></i>
								Staff                 </label> </div>
								</div>
								<? //THIS ONE FOR THE RADIO BUTTONS ENDS ?>
								
								
								
								    <div class="form-group">
									<!-- <div>
										<span class="col-sm-3">
										<span><input type="radio" name="member" value="team" checked onclick="select_div('1')"><? echo " ".$vis_language['TXTTEAM']?></span>
										<span class="col-sm-9">
										<input type="radio" name="member" value="staff" onclick="select_div('2')"><? echo " ".$vis_language['TXTSTAFF']?></span></span>
										
									</div> -->
									</div>
								
									<div class="form-group" id="staff" style="display:none;" >
									
									
									
										<label class="col-sm-3 control-label"><? echo $vis_language['TXTSELECTSTAFF']?></label>
										<div class="col-sm-9">
										<? $i=0;
											foreach ($staff_list as $staff) {?>
												<label class='checkbox-inline i-checks'>
													<input type='checkbox' name='vis_staff_id_<?=$i;?>' value="<?= $staff['staff_id'];?>"> <i></i>
													<span class='m-l-xs font-normal'><?= $staff['first_name'].' '.$staff['last_name'];?></span>
												</label><br />
											<? $i++; } ?>
								        </div>
									</div>
									
									<? //FOR TEAM SELECTION STARTS 
									if($staffgroup_list>0) { ?>
									<div class="form-group">
									<div id="team" class="form-group">
										<label class="col-sm-3 control-label"><? echo $vis_language['TXTSELECTTEAM']?></label>
										<? if(count($staffgroup_list)>4)  {?>
										<div class="col-sm-9" style="overflow-y:scroll;height:110px;width:420px;">
										<? } else {?>
										<div class="col-sm-9">
										<? } ?>
										
										<? $i=0;
											foreach ($staffgroup_list as $team) {?>
												<label class='checkbox-inline i-checks'>
													<input type='checkbox' class='chk' name='vis_group_id_<?=$i;?>' value="<?= $team['group_id'];?>" > <i></i>
													<span class='m-l-xs font-normal'><?= $team['group_name'];?></span>
												</label><br />
											<? $i++; } ?>
								        </div>
									</div>
									</div>
									
									<? } //FOR TEAM SELECTION ENDS ?>
									<input type="hidden" name="vis_ticket_id" id="vis_ticket_id" value="<?= $operation['vis_ticket_id'];?>">
									<input type="hidden" name="vis_dept_id" id="vis_dept_id" value="<?= $operation['vis_dept_id'];?>">
									<input type="hidden" name="total_staff" id="total_staff" value="<?= count($staff_list);?>">
									<? //FOR TOTAL GROUP ?>
									<input type="hidden" name="total_group" id="total_group" value="<?= count($staffgroup_list);?>">
									
									<? //FOR TOTAL GROUP ?>
								</form>
						    </div>
					  </div>
				  </section>
              
              </div>
            </div>
        </div>
        <div class="modal-footer">
			<a class="btn btn-default" data-dismiss="modal"><? echo $vis_language['TXTCANCEL']; ?></a>
            <a class="btn btn-primary" onclick="$(this).visExecution('submit_form',{'vis_module':'ticket', 'vis_operation':'send_approvals', 'vis_send_request':'success', 'vis_form':'vis_attach_ci_<?= $operation['vis_ticket_id'];?>'});"><? echo $vis_language['TXTSEND']; ?></a>
        </div>
    </div>
</div>
<script type="text/javascript">$('.selectpicker').selectpicker();</script>



<script>
function select_div(id)
{
	//alert(id);
	if(id==1)
	{
		$('#staff').hide();
		$('#team').show();
	}
	else
	{
		$('#team').hide();
		$('#staff').show();
	}
}
</script>