	<section class="content-header">
        <h1>
            Daftar Individu
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">individu</li>
        </ol>
    </section>
	<section class="content">
		<div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class='box-header with-border'>
					<button class="btn btn-success" onclick="add_siswa()"><i class="glyphicon glyphicon-plus"></i> Tambah Individu</button>
					<button class="btn btn-default" onclick="reload_table()"><i class="glyphicon glyphicon-refresh"></i> Reload</button>
					<a class="btn btn-primary" href="individu/import"><i class="glyphicon glyphicon-upload"></i> Upload Individu</a>
					<a class="btn btn-danger" href="individu/lihatpresensi"><i class="glyphicon glyphicon-file"></i> Lihat Presensi</a>
					<a class="btn btn-danger" href="individu/lihatjurnal"><i class="glyphicon glyphicon-file"></i> Lihat Jurnal</a>
					<button class="btn btn-success" onclick="setting_jam()"><i class="glyphicon glyphicon-pencil"></i> Setting Jam</button>
				</div>
					<!-- /.box-header -->
					<div class="box-body table-responsive">
					<table id="table" class="table table-bordered table-striped">
						<thead>
							<tr>
								<th>No</th>
								<th>Action</th>
								<th>Kode Absen</th>
								<th>Nama Individu</th>
								<th>UserName</th>
								<th>Kelompok</th>
								<th>Hardware</th>
								<th>Reset Pass</th>
								<th>Spesial</th>
							</tr>
						</thead>
						<tbody>
						</tbody>

						<tfoot>
						<tr>
							<th>No</th>
							<th>Action</th>
							<th>Kode Absen</th>
							<th>Nama Individu</th>
							<th>UserName</th>
							<th>Kelompok</th>
							<th>Hardware</th>
							<th>Reset Pass</th>
							<th>Spesial</th>
						</tr>
						</tfoot>
					</table>
				</div><!-- /.box-body -->
            </div><!-- /.box -->
        </div>
    </div>
<div class="modal fade" id="modal_form" role="dialog">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h3 class="modal-title">Tambah Individu</h3>
			</div>
			<div class="modal-body form">
				<form action="#" id="form" class="form-horizontal">
					<input type="hidden" value="" name="id"/>
					<div class="form-body">
						<div class="form-group">
							<label class="control-label col-md-3">Kode Absen</label>
							<div class="col-md-9">
								<input name="absen" placeholder="Masukan Kode Absen" class="form-control" type="text">
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">Nama Individu</label>
							<div class="col-md-9">
								<input name="nama" placeholder="Masukan Nama Individu" class="form-control" type="text">
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">Alamat Individu</label>
							<div class="col-md-9">
								<input name="alamat" placeholder="Alamat Individu" class="form-control" type="text">
								<span class="help-block"></span>
							</div>
						</div>
						<div class="form-group">
							<label class="control-label col-md-3">NO HP</label>
							<div class="col-md-9">
								<input name="nohp" placeholder="Nomor HP" class="form-control" type="text">
								<span class="help-block"></span>
							</div>
						</div>

						<div class="form-group">
							<label class="control-label col-md-3">Kelompok</label>
							<div class="col-md-9">
								<select name="kd_jenis" class="form-control" style="width: 100%;">
									<option value="">--Select Kelompok--</option>
									<?php
									$jurusan=$this->db->query("SELECT * FROM web_kelas");
									foreach ($jurusan->result() as $row) {
										$kode=$row->kode;
										$jurusan=$row->nama;
										echo "<option value=".$kode.">".$jurusan."</option>";
									}
									?>

								</select>
								<span class="help-block"></span>
							</div>
						</div>

						<div class="form-group">
							<label class="control-label col-md-3">Senin</label>
							<div class="col-md-9">
								<select name="senin" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Selasa</label>
							<div class="col-md-9">
								<select name="selasa" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Rabu</label>
							<div class="col-md-9">
								<select name="rabu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Kamis</label>
							<div class="col-md-9">
								<select name="kamis" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Jumat</label>
							<div class="col-md-9">
								<select name="jumat" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Sabtu</label>
							<div class="col-md-9">
								<select name="sabtu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
							<div class="form-group">
							<label class="control-label col-md-3">Minggu</label>
							<div class="col-md-9">
								<select name="minggu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
							<div class="form-group">
							<label class="control-label col-md-3">Jenis Pegawai</label>
							<div class="col-md-9">
								<select name="jenispegawai" class="form-control">
										<option value="0">Biasa</option>
										<option value="1">Penjaga</option>
										<option value="2">Guru</option>
										<option value="3">Pegawai</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						</div>
					</form>
			</div>
			<div class="modal-footer">
				<button type="button" id="btnSave" onclick="save()" class="btn btn-primary">Simpan</button>
				<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- setting jam -->
<div class="modal fade" id="modal_jam" role="dialog">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h3 class="modal-title">Setting Jam</h3>
			</div>
			<div class="modal-body form">
				<form action="#" id="form_jam" class="form-horizontal">
						<div class="form-body">
						<div class="form-group">
							<label class="control-label col-md-3">Senin</label>
							<div class="col-md-9">
								<select name="senin" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Selasa</label>
							<div class="col-md-9">
								<select name="selasa" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Rabu</label>
							<div class="col-md-9">
								<select name="rabu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Kamis</label>
							<div class="col-md-9">
								<select name="kamis" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Jumat</label>
							<div class="col-md-9">
								<select name="jumat" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Sabtu</label>
							<div class="col-md-9">
								<select name="sabtu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						<div class="form-group">
							<label class="control-label col-md-3">Minggu</label>
							<div class="col-md-9">
								<select name="minggu" class="form-control">
									<?php
										$cekjam=$this->db->query("SELECT * FROM web_jam");
										foreach ($cekjam->result() as $rsjam) {
											$kode= $rsjam->kode;
											$nama = $rsjam->nama;
											echo '<option value="'.$rsjam->kode.'">'.$rsjam->nama.'</option>';
										}
									 ?>
										<option value="6">Libur</option>
									</select>
									<span class="help-block"></span>
								</div>
							</div>
						</div>
					</form>
			</div>
			<div class="modal-footer">
				<button type="button" id="btnSaveJam" onclick="save_jam()" class="btn btn-primary">Simpan</button>
				<button type="button" class="btn btn-danger" data-dismiss="modal">Batal</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script src="<?php echo base_url('assets/datatables/js/jquery.dataTables.min.js')?>"></script>
			<script type="text/javascript">

			var save_method; //for save method string
			var table;
			var base_url = '<?php echo base_url();?>';

			$(document).ready(function() {

				//datepicker
				$('.datepicker').datepicker({
					autoclose: true,
					format: "yyyy-mm-dd",
					todayHighlight: true,
					orientation: "top auto",
					todayBtn: true,
					todayHighlight: true,
				});

				//set input/textarea/select event when change value, remove class error and remove text help block
				$("input").change(function(){
					$(this).parent().parent().removeClass('has-error');
					$(this).next().empty();
				});
				$("textarea").change(function(){
					$(this).parent().parent().removeClass('has-error');
					$(this).next().empty();
				});
				$("select").change(function(){
					$(this).parent().parent().removeClass('has-error');
					$(this).next().empty();
				});
				 //check all
				$("#check-all").click(function () {
					$(".data-check").prop('checked', $(this).prop('checked'));
				});
			});

			$(function () {
				table = $('#table').DataTable({

					"processing": true, //Feature control the processing indicator.
					"serverSide": true, //Feature control DataTables' server-side processing mode.
					"order": [], //Initial no order.
					"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Semua"]],
					// Load data for the table's content from an Ajax source
					"ajax": {
						"url": "<?php echo site_url('individu/ajax_list')?>",
						"type": "POST"
					},

					//Set column definition initialisation properties.
					"columnDefs": [
						{
							"targets": [ 0 ], //first column
							"orderable": false, //set not orderable
						},
						{
							"targets": [ -1 ], //last column
							"orderable": false, //set not orderable
						},

					],

				});
			});

			function add_siswa()
			{
				save_method = 'add';
				$('#form')[0].reset(); // reset form on modals
				$('.form-group').removeClass('has-error'); // clear error class
				$('.help-block').empty(); // clear error string
				$('#modal_form').modal('show'); // show bootstrap modal
				$('.modal-title').text('Tambah Individu'); // Set Title to Bootstrap modal title
			}
			function setting_jam()
			{
				save_method = 'setting';
				$('#form_jam')[0].reset(); // reset form on modals
				$('.form-group').removeClass('has-error'); // clear error class
				$('.help-block').empty(); // clear error string
				$('#modal_jam').modal('show'); // show bootstrap modal
				$('.modal-title').text('Setting Jam'); // Set Title to Bootstrap modal title
			}

			function edit_siswa(id)
			{
				save_method = 'update';
				$('#form')[0].reset(); // reset form on modals
				$('.form-group').removeClass('has-error'); // clear error class
				$('.help-block').empty(); // clear error string


				//Ajax Load data from ajax
				$.ajax({
					url : "<?php echo site_url('individu/ajax_edit')?>/" + id,
					type: "GET",
					dataType: "JSON",
					success: function(data)
					{

						$('[name="id"]').val(data.NIP);
						$('[name="absen"]').val(data.absen);
						$('[name="nama"]').val(data.NM_PEGAWAI);
						$('[name="alamat"]').val(data.ALAMAT);
						$('[name="nohp"]').val(data.NO_HP);
						$('[name="kd_jenis"]').val(data.KD_JENIS_KETENAGAAN);
						$('[name="senin"]').val(data.SEN);
						$('[name="selasa"]').val(data.SEL);
						$('[name="rabu"]').val(data.RAB);
						$('[name="kamis"]').val(data.KAM);
						$('[name="jumat"]').val(data.JUM);
						$('[name="sabtu"]').val(data.SAB);
						$('[name="minggu"]').val(data.MIN);
						$('[name="jenispegawai"]').val(data.jenispegawai);
						$('#modal_form').modal('show'); // show bootstrap modal when complete loaded
						$('.modal-title').text('Edit Individu'); // Set title to Bootstrap modal title

					},
					error: function (jqXHR, textStatus, errorThrown)
					{
						alert('Error get data from ajax');
					}
				});
			}

			function reload_table()
			{
				table.ajax.reload(null,false); //reload datatable ajax
			}
			function save_jam()
			{
				$('#btnSaveJam').text('saving...'); //change button text
				$('#btnSaveJam').attr('disabled',true); //set button disable
				var url;
					url = "<?php echo site_url('individu/settingjam')?>";
				// ajax adding data to database

				var formData = new FormData($('#form_jam')[0]);
				$.ajax({
					url : url,
					type: "POST",
					data: formData,
					contentType: false,
					processData: false,
					dataType: "JSON",
					success: function(data)
					{

						if(data.status) //if success close modal and reload ajax table
						{
							alert('Berhasil Ubah jam semua individu');
							$('#modal_jam').modal('hide');
							reload_table();
						}
						else
						{
							for (var i = 0; i < data.inputerror.length; i++)
							{
								$('[name="'+data.inputerror[i]+'"]').parent().parent().addClass('has-error'); //select parent twice to select div form-group class and add has-error class
								$('[name="'+data.inputerror[i]+'"]').next().text(data.error_string[i]); //select span help-block class set text error string
							}
						}
						$('#btnSave').text('save'); //change button text
						$('#btnSave').attr('disabled',false); //set button enable


					},
					error: function (jqXHR, textStatus, errorThrown)
					{
						alert('Error adding / update data');
						$('#btnSaveJam').text('save'); //change button text
						$('#btnSaveJam').attr('disabled',false); //set button enable

					}
				});
			}
			function save()
			{
				$('#btnSave').text('saving...'); //change button text
				$('#btnSave').attr('disabled',true); //set button disable
				var url;

				if(save_method == 'add') {
					url = "<?php echo site_url('individu/ajax_add')?>";
				} else {
					url = "<?php echo site_url('individu/ajax_update')?>";
				}

				// ajax adding data to database

				var formData = new FormData($('#form')[0]);
				$.ajax({
					url : url,
					type: "POST",
					data: formData,
					contentType: false,
					processData: false,
					dataType: "JSON",
					success: function(data)
					{

						if(data.status) //if success close modal and reload ajax table
						{
							$('#modal_form').modal('hide');
							reload_table();
						}
						else
						{
							for (var i = 0; i < data.inputerror.length; i++)
							{
								$('[name="'+data.inputerror[i]+'"]').parent().parent().addClass('has-error'); //select parent twice to select div form-group class and add has-error class
								$('[name="'+data.inputerror[i]+'"]').next().text(data.error_string[i]); //select span help-block class set text error string
							}
						}
						$('#btnSave').text('save'); //change button text
						$('#btnSave').attr('disabled',false); //set button enable


					},
					error: function (jqXHR, textStatus, errorThrown)
					{
						alert('Error adding / update data');
						$('#btnSave').text('save'); //change button text
						$('#btnSave').attr('disabled',false); //set button enable

					}
				});
			}
			function savedu()
			{
				$('#btnSaveDU').text('saving...'); //change button text
				$('#btnSaveDU').attr('disabled',true); //set button disable
				var url;
					url = "<?php echo site_url('individu/du_update')?>";
				var formData = new FormData($('#formdu')[0]);
				$.ajax({
					url : url,
					type: "POST",
					data: formData,
					contentType: false,
					processData: false,
					dataType: "JSON",
					success: function(data)
					{

						if(data.status) //if success close modal and reload ajax table
						{
							$('#du_form').modal('hide');
							reload_table();
						}
						else
						{
							for (var i = 0; i < data.inputerror.length; i++)
							{
								$('[name="'+data.inputerror[i]+'"]').parent().parent().addClass('has-error'); //select parent twice to select div form-group class and add has-error class
								$('[name="'+data.inputerror[i]+'"]').next().text(data.error_string[i]); //select span help-block class set text error string
							}
						}
						$('#btnSaveDU').text('Simpan'); //change button text
						$('#btnSaveDU').attr('disabled',false); //set button enable


					},
					error: function (jqXHR, textStatus, errorThrown)
					{
						alert('Error adding / update data');
						$('#btnSaveDU').text('Simpan'); //change button text
						$('#btnSaveDU').attr('disabled',false); //set button enable

					}
				});
			}
			function delete_siswa(id)
			{
				if(confirm('Are you sure delete this data?'))
				{
					// ajax delete data to database
					$.ajax({
						url : "<?php echo site_url('individu/ajax_delete')?>/"+id,
						type: "POST",
						dataType: "JSON",
						success: function(data)
						{
							//if success reload ajax table
							$('#modal_form').modal('hide');
							reload_table();
						},
						error: function (jqXHR, textStatus, errorThrown)
						{
							alert('Error deleting data');
						}
					});

				}
			}
			function export_siswa()
			{

					// ajax delete data to database
					$.ajax({
						url : "<?php echo site_url('individu/export')?>",
						type: "POST",
						dataType: "JSON",
						success: function(data)
						{
							reload_table();
						},
						error: function (jqXHR, textStatus, errorThrown)
						{
							alert('Error data export siswa ');
						}
					});
			}
			 function kirim_nama()
			{
				if(confirm('Apakan akan kirim nama ke fingerprint?'))
				{
					// ajax delete data to database
					$.ajax({
						url : "<?php echo site_url('individu/kirim_nama')?>",
						type: "POST",
						dataType: "JSON",
						success: function(data)
						{
							alert('Berhasil hapus data');
							reload_table();
						},
						error: function (jqXHR, textStatus, errorThrown)
						{
							alert('Error deleting data');
						}
					});

				}
			}
			function bulk_delete()
			{
				var list_id = [];
				$(".data-check:checked").each(function() {
						list_id.push(this.value);
				});
				if(list_id.length > 0)
				{
					if(confirm('Are you sure delete this '+list_id.length+' data?'))
					{
						$.ajax({
							type: "POST",
							data: {id:list_id},
							url: "<?php echo site_url('individu/ajax_bulk_delete')?>",
							dataType: "JSON",
							success: function(data)
							{
								if(data.status)
								{
									reload_table();
								}
								else
								{
									alert('Failed.');
								}

							},
							error: function (jqXHR, textStatus, errorThrown)
							{
								alert('Error deleting data');
							}
						});
					}
				}
				else
				{
					alert('no data selected');
				}
			}
			function edit_status(id,status)
			{
				if(confirm('Apakah yakin mereset hardware?'))
				{
					// ajax delete data to database
					$.ajax({

						type: 'POST',
						data: {idnya:id,statusnya:status},
						url : "<?php echo site_url('individu/ubah_status')?>",
						dataType: "JSON",
						success: function(data)
							{
								if(data.status)
								{
									$.toast({
										heading: 'Success',
										text: "Hardware sudah di reset.",
										showHideTransition: 'slide',
										icon: 'success',

										position: 'bottom-right',
										bgColor: '#7EC857'
									});
									reload_table();
								}
								else
								{
									alert('Failed.');
								}

							},
							error: function (jqXHR, textStatus, errorThrown)
							{
								alert('Error reset data');
							}
					});

				}
			}
			function reset_password(id,status)
			{
				if(confirm('Apakah yakin mereset password?'))
				{
					// ajax delete data to database
					$.ajax({

						type: 'POST',
						data: {idnya:id,statusnya:status},
						url : "<?php echo site_url('individu/reset_password')?>",
						dataType: "JSON",
						success: function(data)
							{
								if(data.status)
								{
									$.toast({
										heading: 'Success',
										text: "Password sudah di reset.",
										showHideTransition: 'slide',
										icon: 'success',
										position: 'bottom-right',
										bgColor: '#7EC857'
									});
									reload_table();
								}
								else
								{
									alert('Failed.');
								}

							},
							error: function (jqXHR, textStatus, errorThrown)
							{
								alert('Error reset password');
							}
					});

				}
			}
			function edit_spesial(id,status)
			{
				if(confirm('Apakah yakin menspesialkan user?'))
				{
					// ajax delete data to database
					$.ajax({

						type: 'POST',
						data: {idnya:id,statusnya:status},
						url : "<?php echo site_url('individu/ubah_spesial')?>",
						dataType: "JSON",
						success: function(data)
							{
								if(data.status)
								{
									$.toast({
										heading: 'Success',
										text: "User sudah spesial.",
										showHideTransition: 'slide',
										icon: 'success',

										position: 'bottom-right',
										bgColor: '#7EC857'
									});
									reload_table();
								}
								else
								{
									alert('Failed.');
								}

							},
							error: function (jqXHR, textStatus, errorThrown)
							{
								alert('Error spesial data');
							}
					});

				}
			}
			</script>
  </section>
