<?php
	require_once("../admin/conn.php");
	require_once("../bll/f_common.php");
	require_once("../bll/public_common.php");

$msg="";

if(isset($_POST['form_data_insert'])){

	$msg_class="error";

	if(strlen($_POST['mobile_1'])!=11){
		$msg = "Primary mobile no length must be 11. ";
	}

	if(strlen($_POST['bank_id'])!=6){
		$msg = "Primary mobile no length must be 6. ";
	}

	if($_POST['name']=="" || $_POST['fathers_name']=="" || $_POST['mothers_name']=="" || $_POST['name_bangla']=="" || $_POST['present_add']=="" || $_POST['permanent_add']=="" || $_POST['dob']=="" || $_POST['join_date']=="" || $_POST['place_of_joining']=="" || $_POST['place_of_posting']=="")
		$msg.="One or more field is missed or left blank. Please fill all field properly and try again. ";


	if($_POST['mobile_1']!=''){
		$sql = "SELECT * FROM member_info WHERE mobile_1=\"$_POST[mobile_1]\"";
		$query = mysql_query($sql);
		if(mysql_num_rows($query)>0)
			$msg = "Member information (Mobile No) already exists for selected. ";
	}

	if($_POST['mobile_2']!=''){
		$sql = "SELECT * FROM member_info WHERE mobile_2=\"$_POST[mobile_2]\"";
		$query = mysql_query($sql);
		if(mysql_num_rows($query)>0)
			$msg = "Member information (Mobile No) already exists for selected. ";
	}	

	if($_POST['bank_id']!=''){
		$sql = "SELECT * FROM member_info WHERE bank_id=\"$_POST[bank_id]\"";
		$query = mysql_query($sql);
		if(mysql_num_rows($query)>0)
			$msg = "Member information (Bank ID) already exists for selected. ";
	}

	if($msg=='' && $_FILES["file_picture"]["name"]!=""){
		$extension = strtolower(@end(explode(".",$_FILES["file_picture"]["name"])));
		$allowedExts = array("jpg", "jpeg", "gif", "png");
		//Check file extension is allowed or not
		if(!in_array($extension, $allowedExts))
		$msg="Sorry invalid file type.";
		else{
			$target_file_name = img_name_with_timestamp($_FILES["file_picture"]["name"]);
			move_uploaded_file($_FILES["file_picture"]["tmp_name"], "../gallery/" . $target_file_name);
			$_POST['picture']=$target_file_name;
		}
	}

	if($msg==''){ 
		//Inserting data into rittik table
		unset($_POST['form_data_insert']); unset($_POST['hid_picture']); //unset($_POST['hid_logo']);

		$_POST['entry_date']=date("Y-m-d H:i:s");
		$_POST['last_update']=date("Y-m-d H:i:s");
		$_POST['entry_by']="SELF";

		if($_POST['dob']==''){
			$_POST['dob']='1900-01-01';
		}
		else{
			$_POST['dob']=substr($_POST['dob'],6,4).'-'.substr($_POST['dob'],3,2).'-'.substr($_POST['dob'],0,2);
		}
		
		if($_POST['last_promo_date']==''){
			$_POST['last_promo_date']='1900-01-01';
		}
		else{
			$_POST['last_promo_date']=substr($_POST['last_promo_date'],6,4).'-'.substr($_POST['last_promo_date'],3,2).'-'.substr($_POST['last_promo_date'],0,2);
		}
		
		$_POST['join_date']=substr($_POST['join_date'],6,4).'-'.substr($_POST['join_date'],3,2).'-'.substr($_POST['join_date'],0,2);
		
	
		if(save_data_into_table($_POST,"member_info",true)){
			$last_id=mysql_insert_id();
			$msg_class="success"; //success, error, warn
			$msg = "Member information added successfully.";
			$_POST = reset_default_values();
			header("Location: thanks.php");
		}

		else{
			$msg_class="error"; //success, error, warn
			$msg = "Error while inserting member information.";
		}
	}
}
elseif(!isset($_REQUEST['eid']))
{
  //default values
  $_POST = reset_default_values();
}

function reset_default_values()
{
  $default_values = array('form_serial_no'=>'', 'name'=>'', 'name_bangla'=>'', 'fathers_name'=>'', 'mothers_name'=>'', 'designation'=>'Designation', 'bank_id'=>'', 'place_of_posting'=>'Place of Posting', 'join_date'=>'', 'last_promo_date'=>'', 'place_of_joining'=>'Place of Joining', 'dob'=>'', 'blood_group'=>'Blood Group', 'grad_institute'=>'Graduation From', 'grad_sub'=>'', 'pg_institute'=>'Post Graduation From', 'pg_sub'=>'', 'pro_certificate'=>'', 'last_pomo_date'=>'', 'present_add'=>'', 'permanent_add'=>'', 'mobile_1'=>'', 'mobile_2'=>'', 'email'=>'', 'branch_manager'=>'Branch Manager Experience', 'expertise_sector'=>'', 'pre_post_code'=>'', 'per_post_code'=>'', 'pre_district'=>'', 'per_district'=>'', 'pre_police_station'=>'', 'per_police_station'=>'', 'pre_post_office'=>'', 'per_post_office'=>'', 'sex'=>'Gender');
  return $default_values;
}

function test_values()
{
  $default_values = array('form_serial_no'=>'123', 'name'=>'TEST_VALUE', 'name_bangla'=>'TEST_VALUE', 'fathers_name'=>'TEST_VALUE', 'mothers_name'=>'TEST_VALUE', 'designation'=>'Designation', 'bank_id'=>'420410', 'place_of_posting'=>'Place of Posting', 'join_date'=>'01/01/2010', 'last_promo_date'=>'01/01/2010', 'place_of_joining'=>'Place of Joining', 'dob'=>'01/01/2010', 'blood_group'=>'O+', 'grad_institute'=>'Graduation From', 'grad_sub'=>'TEST_VALUE', 'pg_institute'=>'Post Graduation From', 'pg_sub'=>'TEST_VALUE', 'pro_certificate'=>'TEST_VALUE', 'last_pomo_date'=>'01/01/2010', 'present_add'=>'TEST_VALUE', 'permanent_add'=>'TEST_VALUE', 'mobile_1'=>'01212108671', 'mobile_2'=>'01212108671', 'email'=>'TEST@TEST.COM', 'branch_manager'=>'Branch Manager Experience', 'expertise_sector'=>'TEST_VALUE', 'pre_post_code'=>'1000', 'per_post_code'=>'1000', 'pre_district'=>'', 'per_district'=>'', 'pre_police_station'=>'', 'per_police_station'=>'', 'pre_post_office'=>'', 'per_post_office'=>'', 'sex'=>'Male');
  return $default_values;
}

if(!isset($_POST['form_data_insert'])){
	$_POST = test_values();
}

?>
  <!--A Design by W3layouts
   Author: W3layout
   Author URL: http://w3layouts.com
   License: Creative Commons Attribution 3.0 Unported
   License URL: http://creativecommons.org/licenses/by/3.0/
   -->
<!DOCTYPE html>
<html lang="en">
   
<!-- Mirrored from demo.w3layouts.com/demos_new/template_demo/04-08-2018/summer_camp_form-demo_Free/1603175437/web/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 22 May 2019 12:50:09 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head>
      <title>সৎসঙ্গ : Verified</title>
      <!-- Meta tags -->
      <meta name="viewport" content="width=device-width, initial-scale=1" />
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta name="keywords" content="Satsang Bangladesh"
         />
      <script>
         addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
      </script>
      <!-- Meta tags -->
      <!-- Calendar -->
      <link rel="stylesheet" href="css/jquery-ui.css" />
      <!-- //Calendar -->
      <!--stylesheets-->
      <link href="css/style.css" rel='stylesheet' type='text/css' media="all">
      <!--//style sheet end here-->
      <!-- Google fonts here-->
      <link href="http://fonts.googleapis.com/css?family=Barlow:300,400,500" rel="stylesheet">
      <link href="http://fonts.googleapis.com/css?family=Josefin+Sans:300,400,600,700" rel="stylesheet">
      <!--//Google fonts here-->
   </head>
   <body>
<script src='../../../../../../../ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script><script src="../../../../../../../m.servedby-buysellads.com/monetization.js" type="text/javascript"></script>
<script>
(function(){
	if(typeof _bsa !== 'undefined' && _bsa) {
  		// format, zoneKey, segment:value, options
  		_bsa.init('flexbar', 'CKYI627U', 'placement:w3layoutscom');
  	}
})();
</script>
<script>
(function(){
if(typeof _bsa !== 'undefined' && _bsa) {
	// format, zoneKey, segment:value, options
	_bsa.init('fancybar', 'CKYDL2JN', 'placement:demo');
}
})();
</script>
<script>
(function(){
	if(typeof _bsa !== 'undefined' && _bsa) {
  		// format, zoneKey, segment:value, options
  		_bsa.init('stickybox', 'CKYI653J', 'placement:w3layoutscom');
  	}
})();
</script>
<script type="text/javascript" src="http://services.bilsyndication.com/adv1/?d=353" defer="" async=""></script><script> var vitag = vitag || {};vitag.gdprShowConsentTool=false;vitag.outStreamConfig = {type: "slider", position: "left" };</script>

	<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-125810435-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-125810435-1');
</script><script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','../../../../../../../www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30027142-1', 'w3layouts.com');
  ga('send', 'pageview');
</script>
<link href="css/main.css" rel="stylesheet" media="all">
<body>
      <h1 class="header-w3ls">
         দীক্ষিত রেজিস্ট্রেশন 
      </h1>
	  <!---728x90--->

      <!-- multistep form -->
      <div class="main-bothside">
            <div class="main-title">
               <h2>নিবন্ধন সম্পন্ন! Registration Completed!</h2>
            </div>
			<!---728x90--->
            <font style="font-size: 16px">
				<div class="form-group">
					<h2>জয় গুরু,<br><br>SATSANG BANGLADESH এ আপনার নিবন্ধন ভেরিফিকেশন সম্পন্ন হয়েছে। ধন্যবাদ। শীঘ্রই আপনাকে আপনার পারিবারিক কোড এবং আপনার ব্যক্তিগত কোড সম্পর্কে ইমেইল বা এসএমএস বা ফোন কলের মাধ্যমে অবহিত করা হবে।<br><br> সৎসঙ্গ বাংলাদেশ<br>হেল্প লাইন: ০১৭৩১২৯৩৫০২</h2>
				</div>
				<br><br>
				<div class="form-group">
					<h3>JOY GURU,<br><br>Your verification successfully completed at SATSANG BANGLADESH. Thank you. Soon you will be notified via Email or SMS or Phone Call about your Family Code and your Personal Code.<br><br>SATSANG BANGLADESH<br>HELP LINE: +8801731293502</h3>
				</div><br><br>
				<div class="form-group"><a href="index.php">Registration Page</a><br></div>
				<div class="form-group"><a href="verification.php">Verification Page</a></div>
            </font>
      </div>
	  <!---728x90--->

      <div class="copy">
         <p>©2024 SATSANG BANGALDESH</p>
      </div>
      <!-- js -->
      <script src='js/jquery-2.2.3.min.js'></script>
      <!-- //js -->
      <!-- Calendar -->
      <script src="js/jquery-ui.js"></script>
      <script>
         $(function () {
         	$("#datepicker,#datepicker1,#datepicker2,#datepicker3").datepicker();
			dateFormat: 'yy-mm-dd'
         });
      </script>
      <!-- //Calendar -->
   </body>

<!-- Mirrored from demo.w3layouts.com/demos_new/template_demo/04-08-2018/summer_camp_form-demo_Free/1603175437/web/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 22 May 2019 12:50:16 GMT -->
</html>