| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/app/View/Elements/People/ |
Upload File : |
<?php echo $this->Form->create('Person', array( 'type' => 'file', 'class' => 'form-horizontal admin' ) ); ?>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('ข้อมูลทั่วไป'); ?></div>
<div class="panel-body">
<!-- <div class="form-group">
<?php /*
echo $this->Form->label('Type',
sprintf('%s <b class="form-required">*</b>', __('ประเภทเครือข่ายบุคคล')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Type', array(
'multiple' => false,
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6',
'empty' => 'กรุณาเลือกประเภท'
));*/
?>
</div> -->
<div class="form-group">
<?php
echo $this->Form->label('organization_id', __('สังกัดเครือข่ายองค์กร'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('organization_id', array(
'multiple' => false,
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'empty' => 'ไม่สังกัดเครือข่ายองค์กรใด'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('name',
sprintf('%s <b class="form-required">*</b>', __('ชื่อเครือข่ายบคคล')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('name', array(
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6',
'maxlength' => 500
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('eng_name',
__('ชื่อเครือข่ายบุคคลภาษาอังกฤษ'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('eng_name', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 500
));
?>
</div>
<!-- <div class="form-group">
<?php /*
echo $this->Form->label('short_name',
__('ชื่อย่อเครือข่ายบุคคล'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('short_name', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 20
));
*/ ?>
</div> -->
<!-- <div class="form-group">
<?php /*
echo $this->Form->label('eng_short_name',
__('ชื่อย่อเครือข่ายภาษาอังกฤษ'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('eng_short_name', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 20
));
*/ ?>
</div> -->
<div class="form-group">
<?php
echo $this->Form->label('fax',
__('โทรสาร'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('fax', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 15
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('email',
__('อีเมล์'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('email', array(
'label' => false,
'type' => 'email',
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 100,
'required' => false,
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('telephone1',
sprintf('%s <b class="form-required">*</b>', __('หมายเลขโทรศัพท์ 1')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('telephone1', array(
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6',
'maxlength' => 15,
'required' => false
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('telephone2',
__('หมายเลขโทรศัพท์ 2'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('telephone2', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 15
));
?>
</div>
<!-- <div class="form-group">
<?php /*
echo $this->Form->label('founded',
sprintf('%s <b class="form-required">*</b>', __('วันที่เป็นสมาชิก')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('founded', array(
'label' => false,
'before' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
'type' => 'text',
'class' => 'form-control datepicker',
'div' => 'col-md-6 input-group'
));
*/ ?>
</div> -->
<div class="form-group">
<?php
echo $this->Form->label('joined', __('วันที่เริ่มเป็นสมาชิก <b class="form-required">*</b>'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('joined', array(
'label' => false,
'before' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
'type' => 'text',
'class' => 'form-control datepicker required',
'div' => 'col-md-6 input-group'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('address1', __('ที่อยู่'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('address1', array(
'label' => false,
'type' => 'textarea',
'class' => 'form-control',
'div' => 'col-md-6',
'maxlength' => 1000
));
?>
</div>
<div class="district-filter">
<div class="form-group">
<?php
echo $this->Form->label('province_id', __('จังหวัด <b class="form-required">*</b>'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('province_id', array(
'options' => $provinces,
'label' => false,
'class' => 'form-control selected-province required',
'data-name' => 'districts',
'div' => 'col-md-6',
'empty' => __('กรุณาเลือกจังหวัด'),
'value' => isset($province_exists['Province']['id']) ? $province_exists['Province']['id'] : null
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('district_id', __('อำเภอ / เขต <b class="form-required">*</b>'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('district_id', array(
'options' => $districts,
'value' => isset($province_exists) ? $province_exists['District']['id'] : '',
'label' => false,
'class' => 'form-control required district-select',
'div' => 'col-md-6',
'disabled' => isset( $province_exists['District']['name'] ) ? false : true,
));
?>
</div>
</div>
<div class="form-group">
<?php
echo $this->Form->label('postal_code',
sprintf('%s <b class="form-required">*</b>', __('รหัสไปรษณีย์')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('postal_code', array(
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6',
'maxlength' => 5
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('work_level',
__('หมายเหตุ'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('work_level', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('objective',
__('ผลงานที่ผ่านมา'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('objective', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('publish',
__('ประวัติโดยย่อ'),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('publish', array(
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6'
));
?>
</div>
<?php /*
<div class="form-group">
<?php
echo $this->Form->label('Offer',
sprintf('%s <b class="form-required">*</b>', __('ข้อเสนอ')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Offer', array(
'multiple' => true,
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('Action',
sprintf('%s <b class="form-required">*</b>', __('Actions')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Action', array(
'multiple' => true,
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6'
));
?>
</div>
*/ ?>
<div class="form-group">
<?php /*
echo $this->Form->label('Target',
sprintf('%s <b class="form-required">*</b>', __('เป้าหมาย')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Target', array(
'multiple' => true,
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6'
));*/
?>
</div>
<?php /*
<div class="form-group">
<?php
echo $this->Form->label('role_id',
sprintf('%s <b class="form-required">*</b>', __('บทบาทและหน้าที่')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('role_id', array(
'multiple' => false,
'label' => false,
'class' => 'form-control required',
'div' => 'col-md-6',
'empty' => __('เลือกบทบาทและหน้าที่')
));
?>
</div>
*/ ?>
</div>
</div><!-- First Panel -->
<div class="district-filter panel panel-default">
<div class="panel-heading"><?php echo __('กลุ่มเป้าหมาย') ?></div>
<div class="panel-body">
<div class="form-group">
<?php echo $this->Form->label('targetlist', __('กล่มเป้าหมาย'), array('class' => 'col-md-4 control-label text-right')); ?>
<div class="col-md-4">
<?php
echo $this->Form->select('targetlist', $targetList, array(
'label' => false,
'class' => 'form-control district-select',
'empty' => false
));
?>
</div>
<?php
echo $this->Html->link(__(' + '),
'#',
array(
'class' => 'btn btn-success addArea',
'data-name' => 'Target',
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('Target', __('กล่มเป้าหมายที่เลือก'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Target', array(
'label' => false,
'class' => 'form-control required',
'multiple' => 'checkbox',
'div' => 'col-md-6 area-list'
));
?>
</div>
</div>
</div><!-- Topic and subtopic -->
<div class="district-filter panel panel-default">
<div class="panel-heading"><?php echo __('เพิ่มประเภทสิทธิ') ?></div>
<div class="panel-body">
<div class="form-group">
<?php
echo $this->Form->label('Topic', __('ประเภทสิทธิหลัก'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Topic', array(
'label' => false,
'class' => 'form-control selected-province',
'div' => 'col-md-6',
'data-name' => 'subtopics',
'empty' => '- เลือกประเภทสิทธิหลัก -'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('subtopiclist', __('ประเภทสิทธิย่อย'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('subtopiclist', array(
'options' => array(),
'label' => false,
'class' => 'form-control district-select',
'div' => 'col-md-4',
'disabled' => true
));
echo $this->Html->link(__(' + '),
'#',
array(
'class' => 'btn btn-success addArea',
'data-name' => 'subtopics',
'disabled' => true
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('Subtopic', __('ประเภทสิทธิ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('Subtopic', array(
'label' => false,
'class' => 'form-control required',
'multiple' => 'checkbox',
'div' => 'col-md-6 area-list'
));
?>
</div>
</div>
</div><!-- Topic and subtopic -->
<?php
/*
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('สถานะที่เกี่ยวข้องกับ กสม.') ?></div>
<div class="panel-body">
<div class="form-group">
<?php
echo $this->Form->label('position_id',
sprintf('%s', __('สถานะเกี่ยวข้องกับ กสม.')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('position_id', array(
'multiple' => false,
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
'empty' => '- กรุณาเลือกสถานะ -',
'id' => 'add-person-position-id'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('position_start',
sprintf('%s', __('วันที่ได้รับตำแหน่ง')),
array(
'class' => 'col-md-4 control-label text-right',
'id' => 'position-start-label'
));
echo $this->Form->input('position_start', array(
'class' => 'form-control datepicker',
'div' => array('class' => 'col-md-3 input-group'),
'label' => false,
'type' => 'text',
'id' => 'add-person-position-start',
'after' => '<span class="glyphicon glyphicon-calendar input-group-addon"></span>'
))
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('position_end',
sprintf('%s', __('วันสิ้นสุดตำแหน่ง')),
array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('position_end', array(
'class' => 'form-control datepicker',
'div' => array('class' => 'col-md-3 input-group'),
'label' => false,
'type' => 'text',
'after' => '<span class="glyphicon glyphicon-calendar input-group-addon"></span>'
))
?>
</div>
</div>
</div>
*/
?>
<!-- ++ POSITIONS ++ -->
<div class="district-filter panel panel-default">
<div class="panel-heading"><?php echo __('สถานะที่เกี่ยวข้องกับ กสม.') ?></div>
<div class="panel-body">
<div class="form-group">
<?php echo $this->Form->label('Position', __('สถานะเกี่ยวข้องกับ กสม'), array('class' => 'col-md-4 control-label text-right')); ?>
<div class="col-md-4">
<?php
echo $this->Form->select('Position', $positions, array(
'label' => false,
'class' => 'form-control district-select',
'empty' => false
));
?>
</div>
<?php
echo $this->Html->link(__(' + '),
'#',
array(
'id' => 'add-position',
'class' => 'btn btn-success addPosition',
'data-name' => 'Position',
));
?>
</div>
<div class="form-group">
<?php echo $this->Form->label('PeoplePosition', __('สถานะที่ถูกเลือก'), array('class' => 'col-md-4 control-label text-right' ) ); ?>
<div class="col-md-6 positions-list">
<?php $cpt = 0; ?>
<?php if( !empty( $this->request->data['PeoplePosition'] ) ): ?>
<?php foreach( $this->request->data['PeoplePosition'] as $kPersonPosition => $vPersonPosition ): ?>
<div class="position-list-con PersonPosition">
<div class="form-group">
<div class="col-md-7">
<input type="checkbox" checked="checked" name="data[PersonPosition][PersonPosition][<?php echo $cpt;?>]" value="<?php echo $vPersonPosition['position_id']; ?>" id="PersonPosition<?php echo $kPersonPosition; ?>" />
<label for="PersonPosition<?php echo $kPersonPosition; ?>"><?php echo $positions[$vPersonPosition['position_id']]; ?></label>
</div>
</div>
<div class="form-group">
<?php
echo $this->Form->input('PersonPositionStart', array(
'name' => 'data[PersonPosition][PersonPositionStart][' . $cpt . ']',
'class' => 'datepicker form-control',
'div' => array('class' => 'col-md-7 input-group'),
'label' => false,
'type' => 'text',
'id' => 'PersonPositionStart' . $vPersonPosition['position_id'],
'after' => '<span class="glyphicon glyphicon-calendar input-group-addon"></span>',
'value' => $vPersonPosition['start'],
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->input('PersonPosition', array(
'name' => 'data[PersonPosition][PersonPositionEnd][' . $cpt . ']',
'class' => 'datepicker form-control',
'div' => array('class' => 'col-md-7 input-group'),
'label' => false,
'type' => 'text',
'after' => '<span class="glyphicon glyphicon-calendar input-group-addon"></span>',
'value' => $vPersonPosition['end'],
'id' => 'PersonPositionEnd' . $vPersonPosition['position_id']
));
?>
</div>
</div>
<?php $cpt++; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div><!-- Topic and subtopic -->
<!-- -- POSITIONS -- -->
<?php /* ?>
<!-- <div class="panel panel-default">
<div class="panel-heading"><?php echo __('โครงการพิเศษ') ?></div>
<div class="panel-body">
<?php if ( !empty($people_member) ) : ?>
<div class="form-group ">
<div class="col-md-4 text-right"><strong><?php echo __('ชื่อโครงการพิเศษ') ?></strong></div>
<div class="col-md-6"><?php echo $people_member['Member']['name']; ?></div>
</div>
<div class="form-group ">
<div class="col-md-4 text-right"><strong><?php echo __('วันที่เริ่มทำโครงการพิเศษ') ?></strong></div>
<div class="col-md-6"><?php echo CakeTime::format($people_member['PeopleMembership']['start'], '%d/%m/%Y'); ?></div>
</div>
<div class="form-group ">
<div class="col-md-4 text-right"><strong><?php echo __('วันสิ้นสุดโครงการพิเศษ') ?></strong></div>
<div class="col-md-6"><?php echo CakeTime::format($people_member['PeopleMembership']['end'], '%d/%m/%Y'); ?></div>
</div>
<div class="form-group">
<div class="col-md-offset-4 col-md-8">
<?php echo $this->Html->link( __('ลบโครงการพิเศษ'),
'#',
array(
'class' => 'btn btn-danger remove-mou',
'confirm' => __('ต้องการโครงการพิเศษ?')
)
);?>
</div>
</div>
<?php else : ?>
<div class="form-group">
<?php
echo $this->Form->label('ismou', __('เข้าร่วมโครงการพิเศษ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->radio('ismou',
array(1 => __('ใช่'), 0 => __('ไม่') ),
array(
'label' => array('class' => 'radio-inline'),
'div' => false,
'legend' => false,
'default' => 0,
'class' => 'ismou'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('mou_name', __('ชื่อโครงการ') , array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('member_id', array(
'label' => false,
// 'before' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
'options' => $members,
'class' => 'form-control mou-date required',
'div' => 'col-md-6 input-group',
'disabled' => true,
'empty' => 'กรุณาเลือกโครงการพิเศษ'
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('mou_start', __('วันที่เริ่มทำ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('mou_start', array(
'label' => false,
'after' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
'type' => 'text',
'class' => 'form-control datepicker mou-date required',
'div' => 'col-md-6 input-group',
'disabled' => true,
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('mou_end', __('วันที่สิ้นสุด'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('mou_end', array(
'label' => false,
'after' => '<span class="input-group-addon glyphicon glyphicon-calendar"></span>',
'type' => 'text',
'class' => 'form-control datepicker mou-date required',
'div' => 'col-md-6 input-group',
'disabled' => true
));
?>
</div>
<?php endif; ?>
</div>
</div> --><!-- MOU Panel -->
<php */?>
<div class="district-filter area-container panel panel-default">
<div class="panel-heading"><?php echo __('เพิ่มพื้นที่การทำงาน') ?></div>
<div class="panel-body">
<div class="form-group">
<?php
echo $this->Form->input('is_nationwide', array(
'id' => 'is_nationwide',
'div' => 'col-md-offset-4 col-md-6 area-list',
'label' => __('ทั่วประเทศ')
));
?>
</div>
<div id="wrapper-working-areas" class="<?php echo ( isset( $this->request->data['Person']['is_nationwide'] ) &&$this->request->data['Person']['is_nationwide'] ) ? 'hidden' : 'show'; ?>">
<div class="form-group">
<?php
echo $this->Form->label('area_province', __('เลือกจังหวัด'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('area_province', array(
'options' => $provinces,
'label' => false,
'class' => 'form-control selected-province required',
'div' => 'col-md-4',
'data-name' => 'districts',
'empty' => 'กรุณาเลือกจังหวัด'
));
echo $this->Html->link( __( '+' ),
'#',
array(
'id' => 'add_provincewide',
'div' => 'col-md-2 area-list',
'class' => 'btn btn-success',
) );
?>
</div>
<!-- ++ province wide ++ -->
<div class="form-group">
<?php
echo $this->Form->label('PersonProvinceWide', __('ทั่วทั้งจังหวัด'), array('class' => 'col-md-4 control-label text-right'));
/*
// I can't make the checkboxes to be all checked so I will add everything manually (clock is ticking, sorry...)
echo $this->Form->input('PersonProvinceWide', array(
'options' => isset($provinceswide) ? $provinceswide : array(),
'label' => false,
'class' => 'form-control required',
'multiple' => 'checkbox',
'div' => 'col-md-6 area-list provinces-wide-list',
'name' => 'data[PersonProvinceWide][PersonProvinceWide]',
));
*/
?>
<div class="col-md-6 provinces-wide-list">
<?php if( isset( $provinceswide ) ) : ?>
<?php foreach( $provinceswide as $kProvincewide => $vProvincewide ) : ?>
<div class="form-control required">
<input type="checkbox" checked="checked" name="data[PersonProvinceWide][PersonProvinceWide][]" value="<?php echo $kProvincewide; ?>" id="PersonProvinceWide<?php echo $kProvincewide; ?>" />
<label for="PersonProvinceWide<?php echo $kProvincewide; ?>"><?php echo $vProvincewide; ?></label>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<!-- -- Province Wide -- -->
<div class="form-group">
<?php
echo $this->Form->label('area_district', __('เลือกอำเภอ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('area_district', array(
'options' => array(),
'label' => false,
'class' => 'form-control district-select',
'div' => 'col-md-4',
'disabled' => true
));
echo $this->Html->link(__(' + '),
'#',
array(
'class' => 'btn btn-success addArea',
'data-name' => 'districts',
'disabled' => true
));
?>
</div>
<div class="form-group">
<?php
echo $this->Form->label('DistrictM2M', __('อำเภอ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('DistrictM2M', array(
'options' => isset($districtm2ms) ? $districtm2ms : array(),
'label' => false,
'class' => 'form-control required',
'multiple' => 'checkbox',
'div' => 'col-md-6 area-list',
'name' => 'data[DistrictM2M][DistrictM2M]'
));
?>
</div>
</div> <!-- #wrapper-working-areas -->
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><?php echo __('รูปภาพ') ?></div>
<div class="panel-body">
<div class="form-group">
<?php
echo $this->Form->label('photo', __('เลือกรูปภาพ'), array('class' => 'col-md-4 control-label text-right'));
echo $this->Form->input('photo', array(
'type' => 'file',
'label' => false,
'class' => 'form-control',
'div' => 'col-md-6',
));
?>
</div> <!-- .form-group -->
<div class="form-group">
<?php echo $this->Form->label('AttachedPhotos', __('รูปภาพที่มีอยู่แล้ว'), array('class' => 'col-md-4 control-label text-right')); ?>
<ul id="existing-photos" class="list-photos">
<?php $nPhotos = isset( $this->request->data['Photo'] ) ? count( $this->request->data['Photo'] ) : 0; ?>
<?php for( $i = 0; $i < $nPhotos; $i++) : ?>
<li>
<?php $photo = $this->request->data['Photo'][$i]; ?>
<?php echo $this->Html->image( $photos_url . '/' . $photo['name'], array( 'alt' => $photo['name']) ); ?>
<?php echo $this->Form->input( 'Person.delete_photo.' . $i, array(
'type' => 'checkbox',
'class' => '',
'value' => $photo['id'],
'hiddenField' => false,
'label' => array( 'text' => 'delete' ),
'div' => 'form-control',
'legend' => false,
));
?>
</li>
<?php endfor; ?>
</ul>
</div> <!-- .form-group -->
</div> <!-- .pannel-body -->
</div>
<hr>
<div class="form-group">
<?php
echo $this->Form->end(array(
'label' => $submit_label,
'class' => 'btn btn-success',
'div' => 'col-md-offset-4 col-md-4'
));
?>
</div>
<!-- Modal For add contact -->
<div class="modal fade" id="addContactModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"><?php echo __('เพิ่มผู้ประสานงาน') ?></h4>
</div>
<?php echo $this->element('contact-form'); ?>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- End Modal -->
<script>
$(function() {
var numberIncr = <?php echo $cpt;?>;
$('.remove-mou').on('click', function(e) {
e.preventDefault();
var memberUrl = '<?php echo $this->webroot;?>';
var personId = <?php echo isset($this->request->data['Person']['id']) ? $this->request->data['Person']['id'] : '0'; ?>;
var memberId = <?php echo empty($people_member) ? '0' : $people_member['PeopleMembership']['member_id']; ?>;
$.post(memberUrl + 'admin/people/memberDelete/' + personId + '/' + memberId, function( result ) {
if ( result ) {
location.reload();
}
});
});
// Click on `nation wide` button for working areas
$(' #is_nationwide' ).on( 'change', function( e ) {
$( '#wrapper-working-areas' ).toggleClass( 'hidden' );
} );
// add a province wide
$( '#add_provincewide' ).on( 'click', function( e ) {
e.preventDefault();
var provinceID = $( '#PersonAreaProvince' ).val();
var provinceName = $("#PersonAreaProvince option:selected").text();
var found = $( '#PersonProvinceWide' + provinceID ).length > 0;
if( !found && (provinceID != '' ) ) {
$( '.provinces-wide-list' ).append( '<div class="form-control required"><input type="checkbox" checked="checked" name="data[PersonProvinceWide][PersonProvinceWide][]" value="' + provinceID + '" id="PersonProvinceWide' + provinceID + '" /><label for="PersonProvinceWide' + provinceID + '" class="multiLabel">' + provinceName + '</label></div>' );
}
} );
$( '#add-position' ).on( 'click', function( e ) {
e.preventDefault();
var id = $( '#PersonPosition' ).val();
var name = $("#PersonPosition option:selected").text();
var found = ( $( ' #PersonPosition' + id ).length > 0 );
if( ( id != '' ) && !found ) {
var template = $("#person-position-item").html();
$( '.positions-list' ).append( _.template( template, { 'id': id, 'name': name, 'numberIncrs': numberIncr } ) );
$( '#PersonPositionStart' + id ).datepicker( {format: 'yyyy-mm-dd'} );
$( '#PersonPositionEnd' + id ).datepicker( {format: 'yyyy-mm-dd'} );
numberIncr++;
}
} );
});
</script>
<script type="text/html" id='person-position-item'>
<div class="position-list-con">
<div class="form-group">
<div class="col-md-7">
<input type="checkbox" checked="checked" name="data[PersonPosition][PersonPosition][<%=numberIncrs %>]" value="<%= id %>" id="PersonPosition<%= id %>" />
<label for="PersonPosition<%= id %>" class="multiLabel"><%= name %></label>
</div>
</div>
<div class="form-group">
<div class="col-md-7 input-group">
<input name="data[PersonPosition][PersonPositionStart][<%=numberIncrs %>]" autocomplete="off" class="datepicker PersonPosition form-control required" id="PersonPositionStart<%= id %>" type="text"/>
<span class="glyphicon glyphicon-calendar input-group-addon"></span>
</div>
</div>
<div class="form-group">
<div class="col-md-7 input-group">
<input name="data[PersonPosition][PersonPositionEnd][]" class="datepicker form-control" autocomplete="off" type="text" id="PersonPositionEnd<%= id %>"/>
<span class="glyphicon glyphicon-calendar input-group-addon"></span>
</div>
</div>
</div>
</script>