<?php
$user = auth()->user();
?>
	<head>
		<title><?php echo e(__('mylanguage.project_title')); ?></title>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="description" content="Mosque Desk">
		<meta name="author" content="Technopulse">
		<script src="assets/js/jquery/jquery-2.1.0.min.js"></script>
		<!-- CSS -->
		<link href="assets/css/bootstrap.min.css" rel="stylesheet" type="text/css">
		<link href="assets/css/main.css" rel="stylesheet" type="text/css">
		<link href="assets/css/my-custom-styles.css" rel="stylesheet" type="text/css">
		<link href="css/jquery.toast.min.css" rel="stylesheet" type="text/css">
		<link rel="stylesheet" href="css/jquery-confirm.min.css">
		<!--[if lte IE 9]>
			<link href="assets/css/main-ie.css" rel="stylesheet" type="text/css"/>
			<link href="assets/css/main-ie-part2.css" rel="stylesheet" type="text/css"/>
		<![endif]-->
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
		<!-- Fav and touch icons -->
		<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/android-icon-144x144.png">
		<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/apple-icon-114x114.png">
		<link rel="apple-touch-icon-precomposed" sizes="72x72" href="img/android-icon-72x72.png">
		<link rel="apple-touch-icon-precomposed" sizes="57x57" href="img/android-icon-48x48.png">
		<link rel="shortcut icon" href="img/android-icon-36x36.png">
<!--### Coding to open Loading Box Starts here -->

<style>
/* Center the loader */
#loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #3498db;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes  spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Add animation to "page content" */
.animate-bottom {
  position: relative;
  -webkit-animation-name: animatebottom;
  -webkit-animation-duration: 1s;
  animation-name: animatebottom;
  animation-duration: 1s
}

@-webkit-keyframes animatebottom {
  from { bottom:-100px; opacity:0 } 
  to { bottom:0px; opacity:1 }
}

@keyframes  animatebottom { 
  from{ bottom:-100px; opacity:0 } 
  to{ bottom:0; opacity:1 }
}

#wrapper {
  display: none;
}
</style>
<script>
var myVar;
function myLoadingFunction() {
  myVar = setTimeout(showPage, 3000);
}
function showPage() {
  document.getElementById("loader").style.display = "none";
  document.getElementById("wrapper").style.display = "block";
}
</script>
<!--### Coding to open Loading Box ends here -->
<script src="assets/js/king-table.js"></script>
	</head>
<body onafterprint="afterprint()">
<style>
.container-non-responsive {
  /* Margin/padding copied from Bootstrap */
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;

  /* Set width to your desired site width */
  width: 1170px;
}
</style>

<div class="container-non-responsive">


<div class="content">
	<div class="widget">
		<div class="widget-header">
			<h3><?php echo e(__('mylanguage.jamath_member_new')); ?></h3>
		</div>
		<div class="widget-content">

<form id="frmmain" name="frmmain" data-parsley-validate novalidate enctype="multipart/form-data">
<input type="hidden" name="_token" id="_token" value="<?php echo e(csrf_token()); ?>">
<input type="hidden" name="Username" id="Username" value="<?php echo e($user->usr_id); ?>">
<input type="hidden" name="cst_id" id="cst_id" value="<?php echo e(isset($data) ? $data['cst_id'] : '0'); ?>">
<input type="hidden" name="totamt" id="totamt" value="0">
				<div class="tab-content">
					<div id="colored21" class="tab-pane fade in active">
						<!-- HORIZONTAL FORM -->
						<div class="widget">
							<div class="widget-header">
							<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.main')); ?> <?php echo e(__('mylanguage.member_profile')); ?></h3></div>
							<div class="widget-content">
<div class="row">
	<div class="col-xs-8 form-horizontal">
		<table class="table table-striped table-bordered">
			<tr>
				<td><?php echo e(__('mylanguage.date_of_join')); ?></td>
				<td><input type="date" readonly class="form-control" id="cst_doj" name="cst_doj" placeholder="<?php echo e(__('mylanguage.date_of_join')); ?>" value="<?php echo date("Y-m-d"); ?>" onkeyup="loadgradeslno(cst_doj.value,grd_id.value)" onchange="loadgradeslno(cst_doj.value,grd_id.value)"></td>
			</tr>
			<tr>
				<td><?php echo e(__('mylanguage.name')); ?></td>
				<td><input type="text" class="form-control" id="cst_name" name="cst_name" placeholder="<?php echo e(__('mylanguage.full')); ?> <?php echo e(__('mylanguage.name')); ?>" readonly ></td>
			</tr>
			<tr>
				<td><?php echo e(__('mylanguage.select_grade')); ?></td>
				<td><select id="grd_id" name="grd_id" class="form-control" onchange="loadgradeslno(cst_doj.value,grd_id.value)" disabled readonly>
					<option value=""><?php echo e(__('mylanguage.select_grade')); ?></option>
				</select></td>
			</tr>
			<tr>
				<td><?php echo e(__('mylanguage.member_id')); ?></td>
				<td><input type="hidden" class="form-control" id="cst_grd_code" name="cst_grd_code" value="0">
				<input type="text" class="form-control" id="cst_code" name="cst_code" placeholder="<?php echo e(__('mylanguage.jamath_member_id')); ?>" readonly ></td>
			</tr>
			<tr>
				<td><?php echo e(__('mylanguage.Mobno')); ?></td>
				<td><input type="text" class="form-control" id="lacc_resaddr_mob" name="lacc_resaddr_mob" placeholder="<?php echo e(__('mylanguage.Mobno')); ?>" onkeyup="loadcontactnumber1()" readonly ></td>
			</tr>
		</table>
	</div>
	<div class="col-xs-4 form-horizontal">
		<div class="form-group">
			<div class="col-sm-12">
				<table class="table table-striped table-bordered">
					<tr>
						<td>
							<center><image src="img/dpimg.jpg" style="width: 170px;height: 225px;" id="blah"></center>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
</div>
							</div>
						</div>
						<div class="widget">
							<div class="widget-header">
							<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.personal_det')); ?></h3></div>
							<div class="widget-content">
								<div class="row">
									<div class="col-xs-6 form-horizontal">
	<div class="form-group">
		<label for="cst_dob" class="col-sm-4 control-label"><?php echo e(__('mylanguage.dob')); ?></label>
		<div class="col-sm-8">
			<input type="date" class="form-control" id="cst_dob" name="cst_dob" placeholder="DOB." onkeyup="ageCount(this.value,'lacc_age')" onchange="ageCount(this.value,'lacc_age')" max="<?php echo date("Y-m-d"); ?>"  readonly >
			<span id="ageerror"></span>
		</div>
	</div>
		
	<div class="form-group">
		<label for="cst_maritalstatus" class="col-sm-4 control-label"><?php echo e(__('mylanguage.marital_status')); ?></label>
		<div class="col-sm-8">
			<select id="cst_maritalstatus" name="cst_maritalstatus" class="form-control" readonly disabled>
				<option value="">- <?php echo e(__('mylanguage.marital_status')); ?> - </option>
				<option value="Single"><?php echo e(__('mylanguage.single')); ?></option>
				<option value="Married"><?php echo e(__('mylanguage.married')); ?></option>
				<option value="Divorced"><?php echo e(__('mylanguage.divorced')); ?></option>
				<option value="Widowed"><?php echo e(__('mylanguage.widowed')); ?></option>
			</select>
		</div>
	</div>
	
	<div class="form-group">
		<label for="cst_qualification" class="col-sm-4 control-label"><?php echo e(__('mylanguage.qualification')); ?></label>
		<div class="col-sm-8">
			<input type="text" class="form-control" id="cst_qualification" name="cst_qualification" placeholder="<?php echo e(__('mylanguage.qualification')); ?>"  readonly >
		</div>
	</div>
	
	<div class="form-group">
		<label for="cst_bloodgroup" class="col-sm-4 control-label"><?php echo e(__('mylanguage.blood_group')); ?></label>
		<div class="col-sm-8">
			<input type="text" class="form-control" id="cst_bloodgroup" name="cst_bloodgroup" placeholder="<?php echo e(__('mylanguage.blood_group')); ?>"  readonly >
		</div>
	</div>
									</div>
									<div class="col-xs-6 form-horizontal">							
		<div class="form-group">
			<label for="lacc_age" class="col-sm-4 control-label"><?php echo e(__('mylanguage.age')); ?>.</label>
			<div class="col-sm-8">
				<input type="text" class="form-control" id="lacc_age" name="lacc_age" placeholder="<?php echo e(__('mylanguage.age')); ?>" readonly >
			</div>
		</div>
		
		<div class="form-group">
			<label for="cst_gender" class="col-sm-4 control-label"><?php echo e(__('mylanguage.gender')); ?></label>
			<div class="col-sm-8">
				<select id="cst_gender" name="cst_gender" class="form-control" readonly disabled>
					<option value="">- <?php echo e(__('mylanguage.gender')); ?> -</option>
					<option value="Male"><?php echo e(__('mylanguage.male')); ?></option>
					<option value="Female"><?php echo e(__('mylanguage.female')); ?></option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label for="cst_occupation" class="col-sm-4 control-label"><?php echo e(__('mylanguage.occupation')); ?></label>
			<div class="col-sm-8">
				<input type="text" class="form-control" id="cst_occupation" name="cst_occupation" placeholder="<?php echo e(__('mylanguage.occupation')); ?>" readonly  >
			</div>
		</div>
		<div class="form-group">
			<label for="cst_income" class="col-sm-4 control-label"><?php echo e(__('mylanguage.income')); ?></label>
			<div class="col-sm-8">
				<input type="text" class="form-control" id="cst_income" name="cst_income" placeholder="<?php echo e(__('mylanguage.income')); ?>"  readonly >
			</div>
		</div>										
									</div>
								</div>
							</div>
						</div>
						<div class="widget">
							<div class="widget-header">
							<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.note')); ?></h3></div>
							<div class="widget-content">
								<div class="row">
									<div class="col-xs-12 form-horizontal">
										<div class="form-group">
											<div class="col-sm-12">
<textarea class="form-control" id="cst_note" name="cst_note" placeholder="<?php echo e(__('mylanguage.note')); ?>" readonly ></textarea>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<!-- END HORIZONTAL FORM -->

						<!-- HORIZONTAL FORM -->
						<div class="row">
							<div class="col-xs-6">
								<div class="widget">
									<div class="widget-header">
									<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.Residence_Address')); ?>:</h3></div>
									<div class="widget-content">
										<div class="row">
											<div class="col-xs-12 form-horizontal">
												<div class="form-group">
													<label for="lacc_resaddr_addr" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Address')); ?></label>
													<div class="col-sm-8">
														<textarea class="form-control" id="lacc_resaddr_addr" name="lacc_resaddr_addr" placeholder="<?php echo e(__('mylanguage.Address')); ?>" readonly ></textarea>
													</div>
												</div>
												<div class="form-group">
													<label for="lacc_resaddr_city" class="col-sm-4 control-label"><?php echo e(__('mylanguage.City')); ?></label>
													<div class="col-sm-8">
														<input type="text" class="form-control" id="lacc_resaddr_city" name="lacc_resaddr_city" placeholder="<?php echo e(__('mylanguage.City')); ?>" readonly >
													</div>
												</div>
												<div class="form-group">
													<label for="lacc_resaddr_pin" class="col-sm-4 control-label"><?php echo e(__('mylanguage.PIN_Code')); ?></label>
													<div class="col-sm-8">
														<input type="text" class="form-control" id="lacc_resaddr_pin" name="lacc_resaddr_pin" placeholder="<?php echo e(__('mylanguage.PIN_Code')); ?>" readonly >
													</div>
												</div>
												<div class="form-group">
													<label for="lacc_resaddr_landmark" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Landmark')); ?></label>
													<div class="col-sm-8">
														<input type="text" class="form-control" id="lacc_resaddr_landmark" name="lacc_resaddr_landmark" placeholder="<?php echo e(__('mylanguage.Landmark')); ?>" readonly >
													</div>
												</div>
<div class="form-group">
	<label for="lacc_resaddr_mob1" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Mobno')); ?></label>
	<div class="col-sm-8">
		<input type="text" class="form-control" id="lacc_resaddr_mob1" name="lacc_resaddr_mob1" placeholder="<?php echo e(__('mylanguage.Mobno')); ?>" onkeyup="loadcontactnumber2()" readonly >
	</div>
</div>
												<div class="form-group">
													<label for="lacc_resaddr_tel" class="col-sm-4 control-label"><?php echo e(__('mylanguage.TelNo')); ?></label>
													<div class="col-sm-8">
														<input type="text" class="form-control" id="lacc_resaddr_tel" name="lacc_resaddr_tel" placeholder="<?php echo e(__('mylanguage.TelNo')); ?>" readonly >
													</div>
												</div>
												<div class="form-group">
													<label for="lacc_resaddr_email" class="col-sm-4 control-label"><?php echo e(__('mylanguage.EmailID')); ?></label>
													<div class="col-sm-8">
														<input type="text" class="form-control" id="lacc_resaddr_email" name="lacc_resaddr_email" placeholder="<?php echo e(__('mylanguage.EmailID')); ?>" readonly >
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							
							<div class="col-xs-6">
								<!-- REGISTRATION FORM WITH ICONS -->								
								<div class="widget">
									<div class="widget-header">
									<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.PermanentAddress')); ?></h3></div>
									<div class="widget-content">
										<div class="row">
		<div class="col-xs-12 form-horizontal">
			<div class="form-group">
				<label for="lacc_permaddr_addr" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Address')); ?></label>
				<div class="col-sm-8">
					<textarea class="form-control" id="lacc_permaddr_addr" name="lacc_permaddr_addr" placeholder="<?php echo e(__('mylanguage.Address')); ?>" readonly ></textarea>
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_city" class="col-sm-4 control-label"><?php echo e(__('mylanguage.City')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_city" name="lacc_permaddr_city" placeholder="<?php echo e(__('mylanguage.City')); ?>" readonly >
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_pin" class="col-sm-4 control-label"><?php echo e(__('mylanguage.PIN_Code')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_pin" name="lacc_permaddr_pin" placeholder="<?php echo e(__('mylanguage.PIN_Code')); ?>" readonly >
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_landmark" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Landmark')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_landmark" name="lacc_permaddr_landmark" placeholder="<?php echo e(__('mylanguage.Landmark')); ?>" readonly >
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_mob" class="col-sm-4 control-label"><?php echo e(__('mylanguage.Mobno')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_mob" name="lacc_permaddr_mob" placeholder="<?php echo e(__('mylanguage.Mobno')); ?>" readonly >
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_tel" class="col-sm-4 control-label"><?php echo e(__('mylanguage.TelNo')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_tel" name="lacc_permaddr_tel" placeholder="<?php echo e(__('mylanguage.TelNo')); ?>" readonly >
				</div>
			</div>
			<div class="form-group">
				<label for="lacc_permaddr_email" class="col-sm-4 control-label"><?php echo e(__('mylanguage.EmailID')); ?></label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="lacc_permaddr_email" name="lacc_permaddr_email" placeholder="<?php echo e(__('mylanguage.EmailID')); ?>" readonly >
				</div>
			</div>
		</div>
										</div>
									</div>
								</div>
								<!-- END REGISTRATION FORM WITH ICONS -->
							</div>							
						</div>
						<!-- END HORIZONTAL FORM -->

						<!-- HORIZONTAL FORM -->
						<div class="row">
							<div class="col-xs-12">
								<!-- REGISTRATION FORM WITH ICONS -->
								
								<div class="widget">
									<div class="widget-header">
									<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.family_members_list')); ?>:</h3></div>
									<div class="widget-content">
										<div class="row">
											<div class="col-xs-12 form-horizontal" id="idfamilylist"></div>
										</div>
									</div>
								</div>
								<!-- END REGISTRATION FORM WITH ICONS -->
							</div>
							

						</div>
						<!-- END HORIZONTAL FORM -->

						<!-- HORIZONTAL FORM -->
						
						<div class="row">

							<div class="col-xs-12">
								<!-- REGISTRATION FORM WITH ICONS -->
								
								<div class="widget">
									<div class="widget-header">
									<h3><i class="fa fa-edit"></i> View Uploaded Documents:</h3></div>
									<div class="widget-content">
										<div class="row">
						<div class="col-xs-12 form-horizontal" id="iddocumentlist"></div>
										</div>
									</div>
								</div>
								<!-- END REGISTRATION FORM WITH ICONS -->
							</div>
							
						</div>
						<!-- END HORIZONTAL FORM -->

						<!-- HORIZONTAL FORM -->
	<div class="row">
		<div class="col-xs-12">
				<div class="widget-header">
				<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.subscription')); ?>:</h3></div>
				<div class="row">							
					<div class="col-xs-12">
						<!-- Invoice amount - Paid Amount - Balance Amount STARTS HERE-->
						<div class="widget" id="tabipblist"></div>
						<!-- Invoice amount - Paid Amount - Balance Amount ENDS HERE-->
					</div>
				</div>
			<!-- END REGISTRATION FORM WITH ICONS -->
		</div>
	</div>
						<!-- END HORIZONTAL FORM -->

	<div class="row">
		<div class="col-xs-12">
				<div class="widget-header">
				<h3><i class="fa fa-edit"></i> <?php echo e(__('mylanguage.trans_rpt')); ?>:</h3></div>
				<div class="row">							
					<div class="col-xs-12">
						<!-- Invoice amount - Paid Amount - Balance Amount STARTS HERE-->
						<div class="widget" id="tabrptlist"></div>
						<!-- Invoice amount - Paid Amount - Balance Amount ENDS HERE-->
					</div>
				</div>
			<!-- END REGISTRATION FORM WITH ICONS -->
		</div>
	</div>	
				
				</div>
					
				<!-- HORIZONTAL FORM -->
			</form>
			<!-- END HORIZONTAL FORM -->
		</div>
	</div>
</div>
</div>
</div>
<script src="js/jquery.validate.min.js"></script>
<style>
	.error
	{
	color:red;
	}
</style>
<script>
//Moday Make Payment Starts here
	$('#viewtransdetail').on('show.bs.modal', function(e) 
	{
			var $modal = $(this),
            trn_id = e.relatedTarget.id;
			$('#trn_id').val(trn_id);
			$.ajax({
				url: 'viewbillrecs',
				type: 'GET',
				data:'&trn_id='+trn_id,
				success: function(data)
				{
					$('#idpaymentrecord').html("test");
				}
			});
    })
//Modal Make Payment Ends here
</script>
<script>
	i = 0;	
	function ageCount(dt,agectrl)
	{
		lacc_dob=dt;
		ageCounts(lacc_dob,agectrl);
	}
	function ageCounts(lacc_dob,agectrl)
	{
		$('#ageerror').html("");
		dob = new Date(lacc_dob);
		var today = new Date();
		var age = Math.floor((today-dob) / (365.25 * 24 * 60 * 60 * 1000));
		if(age<0)
		{
			$('#ageerror').html("<span style='color:red'>Sorry! Age Below Then 0</span>");
		}
		else
		{
			$('#ageerror').html("");
			$('#'+agectrl).val(age);
		}		
	}

	//###Coding to Load Grade Serial Number starts here
	function loadgradeslno(doj,gradeid)
	{
		//loadgradeslno(cst_doj.value,grd_id.value)
		if(gradeid=="")
		{
		}
		else
		{
			var Username = $('#Username').val();
			$('#cst_code').val('');
			$.ajax({
					url:'Loadgradeserialnumber',
					type:'GET',
					data:'&doj='+doj+'&gradeid='+gradeid+'&Username='+Username,
					success:function(data)
					{
						if($('#cst_id').val() == 0)
						{
							$('#cst_code').val(data['reclist'][0].gradeprefix+data['reclist'][0].custcode);
							$('#cst_grd_code').val(data['reclist'][0].custcode);				
							$('#tabipb').html(data['transrecord']);
							$('#tabrpt').html(data['rpt_transrecord']);
						}
						else
						{
							$('#cst_code').val(data['reclist'][0].gradeprefix+$('#cst_grd_code').val());
							$('#tabipb').html(data['transrecord']);
							$('#tabrpt').html(data['rpt_transrecord']);
						}
					}
				});
		}
	}
	//###Coding to Load Grade Serial Number ends here
	//Edit Family Members Record starts here
	function funeditfamilymembers(customerid)
	{
		$.ajax({
			type: "GET",
			url:"/editfamilymember",
			dataType: "json",
			data: {			
				'customerid': customerid
			},
			success: function (data) {
					$('#cst_family_relationship').val(data.sqlstatement[0].cst_relationship);
					$('#cst_family_name').val(data.sqlstatement[0].cst_name);
					$('#cst_family_gender').val(data.sqlstatement[0].cst_gender);
					$('#cst_family_maritalstatus').val(data.sqlstatement[0].cst_maritalstatus);
					$('#cst_family_qualification').val(data.sqlstatement[0].cst_qualification);
					$('#cst_family_dob').val(data.sqlstatement[0].cst_dob);
					ageCount(data.sqlstatement[0].cst_dob,'cst_family_age');
					$('#cst_family_bloodgroup').val(data.sqlstatement[0].cst_bloodgroup);
					$('#cst_family_mobileno').val(data.contactno);
					$('#cst_family_note').val(data.sqlstatement[0].cst_note);
					$('#family_cst_id').val(data.sqlstatement[0].cst_id);
			}
		});
	}
	//Edit Family Members Record ends here

	//load Full fund types 	edit_grd_id edit_grd_id
	$(document).ready(function(){
		var edit_grd_id = $('#edit_grd_id').val();
		$.ajax({
		type: "GET",
		url:"/loadgradelist",
		dataType: "json",
		success: function (data) {
		$.each(data,function(i,obj)
		{
			if(edit_grd_id ==0)
			{
				var div_data="<option value="+obj.grd_id+">"+obj.grd_grade+" (" + obj.grd_prefix + ")</option>";	
			}
			else 
			{
				if(edit_grd_id == obj.grd_id)
				{
					var div_data="<option value="+obj.grd_id+" selected>"+obj.grd_grade+" (" + obj.grd_prefix + ")</option>";	
				}
				else{
					var div_data="<option value="+obj.grd_id+">"+obj.grd_grade+" (" + obj.grd_prefix + ")</option>";		
				}
			}
			$(div_data).appendTo('#grd_id');
		});  
		}
		});
	});

	//Delete Family Members starts here
	function DeleteFamilyMembers(customerid)
	{
		var cst_id = $('#cst_id').val();
		if(confirm("Are you sure want to delete this record?") == true)
		{
			k = 0;
			if(k == 0)
			{
				k++;
				$.ajax({
					type: "GET",
					url:"/delfamilymember",
					dataType: "json",
					data: {
						'_token': $('input[name=_token]').val(),
						'customerid': customerid,
						'cst_id':cst_id
					},
					success: function (data) {	
						$('#idfamilylist').html(data['transrecord']);
					}
				});
			}
		}		
	}
	//Delete Family Members ends here
	//Delete Members document starts here
	function DeleteMemberDocuments(doc_id)
	{
		var cst_id = $('#cst_id').val();
		if(confirm("Are you sure want to delete this record?") == true)
		{
			k = 0;
			if(k == 0)
			{
				k++;
				$.ajax({
					type: "GET",
					url:"/delmemberdocs",
					dataType: "json",
					data: {
						'_token': $('input[name=_token]').val(),
						'doc_id': doc_id,
						'cst_id':cst_id
					},
					success: function (data) {	
						$('#iddocumentlist').html(data['transrecord']);
					}
				});
			}
		}	
	}
	//Delete Members document ends here
</script>
<script>
	$(document).ready(function(){
		var edit_cst_id = parseInt($('#cst_id').val());
		if(edit_cst_id != 0)
		{
			loadeditcstrec();
		}
	});
	
	function loadeditcstrec()
	{
			var edit_cst_id = $('#cst_id').val();
			$.ajax({
			type: "GET",
			url:"/loadprintingprofile",
			dataType: "json",
			data: {
				'_token': $('input[name=_token]').val(),
				'edit_cst_id': edit_cst_id
			},
			success: function (data) {
					$('#cst_grd_code').val(data['cst_customer'].cst_code);
					$('#cst_code').val(data['cst_grade'].grd_prefix + data['cst_customer'].cst_code);
					$('#cst_name').val(data['cst_customer'].cst_name);
					$('#cst_maritalstatus').val(data['cst_customer'].cst_maritalstatus);
					$('#cst_occupation').val(data['cst_customer'].cst_occupation);
					$('#cst_income').val(data['cst_customer'].cst_income);
					$('#cst_qualification').val(data['cst_customer'].cst_qualification);
					$('#cst_gender').val(data['cst_customer'].cst_gender);
					$('#cst_doj').val(data['cst_customer'].cst_doj);
					$('#cst_bloodgroup').val(data['cst_customer'].cst_bloodgroup);
					$('#cst_relationship').val(data['cst_customer'].cst_relationship);
					$('#cst_note').val(data['cst_customer'].cst_note);
					$('#cst_dob').val(data['cst_customer'].cst_dob);
					$('#grd_id').val(data['cst_customer'].grd_id);
					ageCount(data['cst_customer'].cst_dob,'lacc_age');
					//Residence_Address
					$('#lacc_resaddr_addr').val(data['resaddress'][0]);
					$('#lacc_resaddr_city').val(data['resaddress'][1]);
					$('#lacc_resaddr_pin').val(data['resaddress'][2]);
					$('#lacc_resaddr_landmark').val(data['resaddress'][3]);
					$('#lacc_resaddr_mob').val(data['resaddress'][4]);
					$('#lacc_resaddr_mob1').val(data['resaddress'][4]);
					$('#lacc_resaddr_tel').val(data['resaddress'][5]);
					$('#lacc_resaddr_email').val(data['resaddress'][6]);
					//PermanentAddress
					$('#lacc_permaddr_addr').val(data['permaddress'][0]);
					$('#lacc_permaddr_city').val(data['permaddress'][1]);
					$('#lacc_permaddr_pin').val(data['permaddress'][2]);
					$('#lacc_permaddr_landmark').val(data['permaddress'][3]);
					$('#lacc_permaddr_mob').val(data['permaddress'][4]);
					$('#lacc_permaddr_tel').val(data['permaddress'][5]);
					$('#lacc_permaddr_email').val(data['permaddress'][6]);
					$('#totamt').val(data['totamt']);
					$('#idfamilylist').html(data['transrecord']);
					$('#iddocumentlist').html(data['docrecord']);
					$('#tabipblist').html(data['crdrrecord']);
					$('#tabrptlist').html(data['cstrpt']);
					$("#blah").attr("src",data['dpname']);
			}
		});
	}
	$(document).ready(function(){
		if(document.getElementById('grd_id').value == "")
		{
			loadeditcstrec();
		}
	});
</script>																				
<script>
	function BillPrint(transaction_id)
	{
		$("#modprintpaymentreceipt").modal();
		$.ajax({
			url: 'printpaymentbill',
			type: 'get',
			data:'&transaction_id='+transaction_id,
			success: function(data)
			{
				//Update balance in table starts here
				$('#tot_'+data.trn_transaction.cst_id).html(""+data.bil_billrec[0].totalamt);
				paidamt= parseFloat(parseFloat(data.bil_billrec[0].paidamt) + parseFloat(data.bil_billrec[0].advamt) + parseFloat(data.bil_billrec[0].prepayamt));
				$('#paid_'+data.trn_transaction.cst_id).html(""+ paidamt);
				amt= parseFloat(data.bil_billrec[0].totalamt) - (parseFloat(data.bil_billrec[0].paidamt) + parseFloat(data.bil_billrec[0].advamt) + parseFloat(data.bil_billrec[0].prepayamt));
				$('#bal_'+data.trn_transaction.cst_id).html(""+amt);
				//Update balance in table ends here							
				document.getElementById("receiptbillno").innerHTML=data.trn_billno;
				document.getElementById("receiptmember_id").innerHTML= data.cst_grade_prefix + "-" + data.cst_code;
				document.getElementById("receiptdate").innerHTML=data.trn_date;
				document.getElementById("receiptname").innerHTML=data.cst_name;
				document.getElementById("receiptamt1").innerHTML=data.bilr_gtotal;
				document.getElementById("transaction_id").value=transaction_id;
				$('#receipttable').html(data.transrecord);
			}
		});
	}
	function ViewInvoice(bill_id)
	{
		$("#modchargesreceipt").modal();
		$.ajax({
			url: 'viewsingleinvoice',
			type: 'get',
			data:'&bill_id='+bill_id,
			success: function(data)
			{
				//Update balance in table starts here
				$('#tot_'+data.trn_transaction.cst_id).html(""+data.bil_billrec[0].totalamt);
				paidamt= parseFloat(parseFloat(data.bil_billrec[0].paidamt) + parseFloat(data.bil_billrec[0].advamt) + parseFloat(data.bil_billrec[0].prepayamt));
				$('#paid_'+data.trn_transaction.cst_id).html(""+ paidamt);
				amt= parseFloat(data.bil_billrec[0].totalamt) - (parseFloat(data.bil_billrec[0].paidamt) + parseFloat(data.bil_billrec[0].advamt) + parseFloat(data.bil_billrec[0].prepayamt));
				$('#bal_'+data.trn_transaction.cst_id).html(""+amt);
				//Update balance in table ends here							
				document.getElementById("receiptbillnoa").innerHTML=data.trn_billno;
				document.getElementById("receiptmember_ida").innerHTML= data.cst_grade_prefix + "-" + data.cst_code;
				document.getElementById("receiptdatea").innerHTML=data.trn_date;
				document.getElementById("receiptnamea").innerHTML=data.cst_name;
				document.getElementById("receiptamt1a").innerHTML=data.bilr_paidamt;
				document.getElementById("transaction_ida").value=transaction_id;
				$('#receipttablea').html(data.transrecord);
			}
		});
	}
	function ConfirmToDelete()
	{
		var transaction_ids = $('input[name=transaction_ids]').val();
		if(confirm("Are you sure want to delete this Payment record?") == true)
		{
			k = 0;
			if(k == 0)
			{
				k++;
				$.ajax({
					type: "GET",
					url:"/delpaymentrecord",
					dataType: "json",
					data: {
						'_token': $('input[name=_token]').val(),
						'transaction_ids': transaction_ids
					},
					success: function (data) {
						$('#modprintpaymentreceipt').modal('toggle');
							//$('#tabipblist').html(data['crdrrecord']);
							//$('#tabrptlist').html(data['cstrpt']);
							loadeditcstrec();
						alert("Payment Record deleted successfully...");
						//$('#iddocumentlist').html(data['transrecord']);
					}
				});
			}
		}	
	}
	function ConfirmToBillDelete()
	{
		var transaction_ids = $('input[name=transaction_idsa]').val();
		var trn_ida = $('input[name=trn_ida]').val();
		if(confirm("Are you sure want to delete this Invoice record?") == true)
		{
			k = 0;
			if(k == 0)
			{
				k++;
				$.ajax({
					type: "GET",
					url:"/delbillingrecord",
					dataType: "json",
					data: {
						'_token': $('input[name=_token]').val(),
						'transaction_ids': transaction_ids,
						'trn_ida': trn_ida
					},
					success: function (data) {
						$('#modchargesreceipt').modal('toggle');
							//$('#tabipblist').html(data['crdrrecord']);
							//$('#tabrptlist').html(data['cstrpt']);
							loadeditcstrec();
						alert("Payment Record deleted successfully...");
						//$('#iddocumentlist').html(data['transrecord']);
					}
				});
			}
		}	
	}
</script>
<script>
function funloadmatrimonialdata(cst_id)
{
		$.ajax({
			url: 'MatriCertificate',
			type: 'GET',
			data:'&cst_id='+cst_id,
			success: function(data)
			{
				$('#sideMenu').html(data);
			}
		});
}
</script>
<script>

function readURL(input) {
  if (input.files && input.files[0]) {
    var reader = new FileReader();
    
    reader.onload = function(e) {
      $('#blah').attr('src', e.target.result);
    }    
    reader.readAsDataURL(input.files[0]);
  }  
}

$('#dp').change(function () {
	if ($(this).val() != '') {
		readURL(this);
		upload(this);
	}
});
function upload(img) 
{
	var form_data = new FormData();
	form_data.append('dp', img.files[0]);
	form_data.append('_token', '<?php echo e(csrf_token()); ?>');
	var cst_id = $('#cst_id').val();
	form_data.append('cst_id',cst_id);
	$.ajax({
		url: "uploaddp",
		data: form_data,
		type: 'POST',
		contentType: false,
		processData: false,
		success: function (data) {
			//$('#loading').css('display', 'none');
		},
		error: function (xhr, status, error) {
			alert(xhr.responseText);
			//$('#preview_image').attr('src', '<?php echo e(asset('images/noimage.jpg')); ?>');
		}
	});
}
function loadcontactnumber1()
{
	document.getElementById("lacc_resaddr_mob1").value =document.getElementById("lacc_resaddr_mob").value;
}
function loadcontactnumber2()
{
	document.getElementById("lacc_resaddr_mob").value =document.getElementById("lacc_resaddr_mob1").value;
}
</script>
	<script src="assets/js/bootstrap/bootstrap.js"></script>
	<script src="assets/js/plugins/modernizr/modernizr.js"></script>    
	<script src="assets/js/plugins/bootstrap-tour/bootstrap-tour.custom.js"></script>
	<script src="assets/js/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
	<script src="assets/js/king-common.js"></script>
	<script src="assets/js/plugins/stat/jquery.easypiechart.min.js"></script>
	<script src="assets/js/plugins/raphael/raphael-2.1.0.min.js"></script>
	<script src="assets/js/plugins/stat/flot/jquery.flot.min.js"></script>
	<script src="assets/js/plugins/stat/flot/jquery.flot.resize.min.js"></script>
	<script src="assets/js/plugins/stat/flot/jquery.flot.time.min.js"></script>
	<script src="assets/js/plugins/stat/flot/jquery.flot.pie.min.js"></script>
	<script src="assets/js/plugins/stat/flot/jquery.flot.tooltip.min.js"></script>
	<script src="assets/js/plugins/jquery-sparkline/jquery.sparkline.min.js"></script>
	<script src="assets/js/plugins/datatable/jquery.dataTables.min.js"></script>
	<script src="assets/js/plugins/datatable/dataTables.bootstrap.js"></script>
	<script src="assets/js/plugins/jquery-mapael/jquery.mapael.js"></script>
	<script src="assets/js/plugins/raphael/maps/usa_states.js"></script>
	<script src="assets/js/king-chart-stat.js"></script>
	<script src="assets/js/king-table.js"></script>
	<script src="assets/js/king-components.js"></script>
	<script src="js/jquery.toast.min.js"></script>
    <script src="js/jquery-confirm.min.js"></script>
	<script src="assets/js/plugins/bootstrap-multiselect/bootstrap-multiselect.js"></script>
	<script src="assets/js/plugins/parsley-validation/parsley.min.js"></script>
<script>
$(document).ready(function()
{
	window.print();
});
function afterprint()
{
	window.close();
}
</script>