
PK 
<?php
ob_start();
//error_reporting(E_ALL ^ E_NOTICE);
@session_start();
ini_set('allow_url_include',1);
date_default_timezone_set("Asia/Kolkata");
set_time_limit(600);
ini_set('max_execution_time',600);
include '../includes/settings/constant.php';
//include '../includes/settings/db.php';
require_once '../includes/settings/PDODB.php';
include '../includes/modules/functions.php';
$function = new FUNCTIONS();
if (!empty($_SESSION['adminId']) && !empty($_SESSION['admin_role_id'])) {
if($_SESSION['admin_role_id']==1){
//header("Location: create-member.php");
}elseif($_SESSION['admin_role_id']==2){
header("Location: ../dashboard/index.php");
}
}else{
header("Location: ../index.php");
exit();
}
/*for ($i=0; $i <1000 ; $i++) {
echo time()."<br>";
}*/
//exit;
//print_r($_POST); exit;
//if(!empty($_POST["submit"]) && $_POST["submit"]=='ADD'){
if(isset($_POST['btnAddMember'])){
//print_r($_POST); exit;
$rwa_id = strtoupper(uniqid('RWA-',FALSE));
$owner_name = !empty($_POST['owner_name'])?trim($_POST['owner_name']):"";
$owner_age = !empty($_POST['owner_age'])?trim($_POST['owner_age']):"";
$mobile = !empty($_POST['mobile'])?trim($_POST['mobile']):"";
$tel_no = !empty($_POST['tel_no'])?trim($_POST['tel_no']):"";
$email = !empty($_POST['email'])?trim($_POST['email']):"";
$represent_name = !empty($_POST['represent_name'])?trim($_POST['represent_name']):"";
$represent_relation = !empty($_POST['represent_relation'])?trim($_POST['represent_relation']):"";
$represent_age = !empty($_POST['represent_age'])?trim($_POST['represent_age']):"";
$represent_mobile = !empty($_POST['represent_mobile'])?trim($_POST['represent_mobile']):"";
$represent_email = !empty($_POST['represent_email'])?trim($_POST['represent_email']):"";
$started_construction = !empty($_POST['started_construction'])?trim($_POST['started_construction']):"";
$date_completion_certificate = !empty($_POST['date_completion_certificate'])?trim($_POST['date_completion_certificate']):"";
$purchased_on = !empty($_POST['purchased_on'])?trim($_POST['purchased_on']):"";
$date_deed_registation = !empty($_POST['date_deed_registation'])?trim($_POST['date_deed_registation']):"";
$qualification_self = !empty($_POST['qualification_self'])?trim($_POST['qualification_self']):"";
$occupation_self = !empty($_POST['occupation_self'])?trim($_POST['occupation_self']):"";
$name_organisation = !empty($_POST['name_organisation'])?trim($_POST['name_organisation']):"";
$add_organisation = !empty($_POST['add_organisation'])?trim($_POST['add_organisation']):"";
$designation_self = !empty($_POST['designation_self'])?trim($_POST['designation_self']):"";
$qualification_spouse = !empty($_POST['qualification_spouse'])?trim($_POST['qualification_spouse']):"";
$occupation_spouse = !empty($_POST['occupation_spouse'])?trim($_POST['occupation_spouse']):"";
$name_organisation_spouse = !empty($_POST['name_organisation_spouse'])?trim($_POST['name_organisation_spouse']):"";
$add_organisation_spouse = !empty($_POST['add_organisation_spouse'])?trim($_POST['add_organisation_spouse']):"";
$designation_spouse = !empty($_POST['designation_spouse'])?trim($_POST['designation_spouse']):"";
$house_no = !empty($_POST['house_no'])?trim($_POST['house_no']):"";
$amount = !empty($_POST['amount'])?trim($_POST['amount']):"";
$share_phone_no = !empty($_POST['share_phone_no'])?trim($_POST['share_phone_no']):"";
$ipaddress = $function->getRealIpAddr();
$error_msg = "";
$pdodb = PDODB::getInstance();
$sql = "INSERT INTO users SET rwa_id='".$rwa_id."',owner_name='".$owner_name."',owner_age='".$owner_age."',mobile='".$mobile."',tel_no='".$tel_no."',email='".$email."',password= md5('".$mobile."'),ipaddress='".$ipaddress."'";
//print_r($sql); exit;
//echo "mdscmsdmc"; exit;
$result = $pdodb->query($sql);
//echo $result; exit;
if(!empty($result)){
//echo $result; exit;
$sql2 = "INSERT INTO user_details SET rwa_id='".$rwa_id."',house_no='".$house_no."',represent_name='".$represent_name."',represent_relation='".$represent_relation."',represent_age='".$represent_age."',represent_mobile='".$represent_mobile."',represent_email='".$represent_email."',started_construction='".$started_construction."',date_completion_certificate='".$date_completion_certificate."',purchased_on='".$purchased_on."',date_deed_registation='".$date_deed_registation."',qualification_self='".$qualification_self."',occupation_self='".$occupation_self."',name_organisation='".$name_organisation."',add_organisation='".$add_organisation."',designation_self='".$designation_self."',qualification_spouse='".$qualification_spouse."',occupation_spouse='".$occupation_spouse."',name_organisation_spouse='".$name_organisation_spouse."',add_organisation_spouse='".$add_organisation_spouse."',designation_spouse='".$designation_spouse."',amount='".$amount."',share_phone_no='".$share_phone_no."'";
//echo $sql2; exit;
$result2 = $pdodb->query($sql2);
//echo $result2; exit;
$insert_id = $pdodb->lastInsertId();
PDODB::closeInstance();
}
//print_r($insert_id); exit;
if (!empty($result) && !empty($result2)) {
echo "<script>alert('Member added successfully. Click OK to Add your Family Member Now.');</script>";
echo "<script>window.location.href='../familymember/create-family.php?id=$insert_id';</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>INSPINIA | Basic Form</title>
<?php include_once '../layout/style.php'; ?>
</head>
<body>
<div id="wrapper">
<?php $currentPage = 'member-create'; include_once '../layout/side-bar.php'; ?>
<div id="page-wrapper" class="gray-bg">
<?php include_once '../layout/header.php'; ?>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>Add Member Form</h2>
</div>
<div class="col-lg-2">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>All form elements</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#">Config option 1</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<form method="POST" class="form-horizontal" action="" id="addmember">
<div class="form-group">
<label class="col-sm-2 control-label">Owner’s Name*</label>
<div class="col-sm-4"><input name="owner_name" id="owner_name" type="text" class="form-control"></div>
<label class="col-sm-2 control-label">Owner’s Age</label>
<div class="input-group col-sm-4"><input name="owner_age" id="owner_age" type="text" class="form-control"> <span class="input-group-addon">Yrs.</span></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Mobile</label>
<div class="col-sm-4"><input type="text" name="mobile" id="mobile" class="form-control"></div>
<label class="col-sm-2 control-label">Email ID</label>
<div class="col-sm-4"><input type="text" name="email" id="email" class="form-control"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Telphone No.</label>
<div class="col-sm-4"><input type="text" name="tel_no" id="tel_no" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">Name of Person to represent in RWA</label>
<div class="col-sm-3"><input type="text" name="represent_name" id="represent_name" class="form-control">
<span class="help-block m-b-none">(Shall remain Alternate Member till revoked)</span></div>
<label class="col-sm-1 control-label">Relation</label>
<div class="col-sm-3"><input type="text" name="represent_relation" id="represent_relation" class="form-control">
<span class="help-block m-b-none">(Owner’s...)</span></div>
<label class="col-sm-1 control-label">Age</label>
<div class="input-group col-sm-2"><input name="represent_age" id="represent_age" type="text" class="form-control"> <span class="input-group-addon">Yrs.</span></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Mobile</label>
<div class="col-sm-4"><input name="represent_mobile" id="represent_mobile" type="text" class="form-control"></div>
<label class="col-sm-2 control-label">Email ID</label>
<div class="col-sm-4"><input type="text" name="represent_email" id="represent_email" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">Started Construction from</label>
<div class="col-sm-4"><input name="started_construction" id="started_construction" type="date" class="form-control"></div>
<label class="col-sm-2 control-label">Date of Completion Certificate</label>
<div class="col-sm-4"><input name="date_completion_certificate" id="date_completion_certificate" type="date" class="form-control"><span class="help-block m-b-none">(From Noida Authority)</span></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">Purchased On</label>
<div class="col-sm-4"><input type="date" name="purchased_on" id="purchased_on" class="form-control"></div>
<label class="col-sm-2 control-label">Date of Deed Registation</label>
<div class="col-sm-4"><input type="date" name="date_deed_registation" id="date_deed_registation" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">Qualification (Self)</label>
<div class="col-sm-4"><input type="text" name="qualification_self" id="qualification_self" class="form-control"></div>
<label class="col-sm-2 control-label">Occupation (Self)</label>
<div class="col-sm-4"><input type="text" name="occupation_self" id="occupation_self" class="form-control"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Name of Organisation</label>
<div class="col-sm-4"><input type="text" name="name_organisation" id="name_organisation" class="form-control"></div>
<label class="col-sm-2 control-label">Address of Organisation</label>
<div class="col-sm-4"><input type="text" name="add_organisation" id="add_organisation" class="form-control"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Designation (Self)</label>
<div class="col-sm-4"><input type="text" name="designation_self" id="designation_self" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">Qualification (Spouse)</label>
<div class="col-sm-4"><input type="text" name="qualification_spouse" id="qualification_spouse" class="form-control"></div>
<label class="col-sm-2 control-label">Occupation (Spouse)</label>
<div class="col-sm-4"><input type="text" name="occupation_spouse" id="occupation_spouse" class="form-control"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Name of Organisation</label>
<div class="col-sm-4"><input type="text" name="name_organisation_spouse" id="name_organisation_spouse" class="form-control"></div>
<label class="col-sm-2 control-label">Address of Organisation</label>
<div class="col-sm-4"><input type="text" name="add_organisation_spouse" id="add_organisation_spouse" class="form-control"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Designation (Spouse)</label>
<div class="col-sm-4"><input type="text" name="designation_spouse" id="designation_spouse" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">House Number</label>
<div class="col-sm-4"><input type="text" name="house_no" id="house_no" class="form-control"></div>
<label class="col-sm-2 control-label">Amount</label>
<div class="col-sm-4"><input type="text" name="amount" id="amount" class="form-control"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-12">
<label>Sharing of phone no. ( Please Tick )</label>
<div class="i-checks"><label><input name="share_phone_no" id="share_phone_no" type="checkbox" value="Yes, I am willing to share my no. with fellow members through Membership Register / Directory"><i></i> Yes, I am willing to share my no. with fellow members through Membership Register / Directory </label></div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-white" type="submit">Cancel</button>
<button class="btn btn-primary" name="btnAddMember" id="btnAddMember" type="submit">PROCEED TO ADD FAMILY MEMBER</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once '../layout/script.php'; ?>
<script>
$(document).ready(function () {
$('.i-checks').iCheck({
checkboxClass: 'icheckbox_square-green',
radioClass: 'iradio_square-green',
});
});
</script>
<script>
function tossterMsgAlert(msg='Welcome',title='') {
toastr.options = {
closeButton: true,
//debug: false,
newestOnTop: false,
//progressBar: false,
positionClass: 'toast-top-center',
preventDuplicates: true,
//onclick: null,
//showDuration: 300,
//hideDuration: 1000,
timeOut: 2000,
//extendedTimeOut: 1000,
//showEasing: 'swing',
//hideEasing: 'linear',
//showMethod: 'fadeIn',
hideMethod: 'fadeOut'
};
toastr.warning(title,msg);
}
</script>
<script type="text/javascript">
$("#addmember").validate({
rules: {
owner_name: {
required: true
},
mobile: {
required: true,
minlength: 10,
maxlength: 10,
//number: true
digits: true
}
},
messages: {
owner_name: {
required: "Please enter full name"
},
mobile: {
required: "Please enter mobile No",
minlength: "Mobile No Must Contain at least 10 digit",
maxlength: "Mobile No Must Not Exceed 10 digit",
}
},
submitHandler: function(form) {
form.submit();
}
});
</script>
</body>
</html>


PK 99