ok
Direktori : /proc/thread-self/root/home2/selectio/public_html/subamangala/ |
Current File : //proc/thread-self/root/home2/selectio/public_html/subamangala/search.php |
<?php include"config/config.php"; // $dbHost = 'localhost'; // $dbUsername = 'fmsbilli_mangalam_matrimony'; // $dbPassword = 'mangalam_matrimony'; // $dbName = 'fmsbilli_mangalam_matrimony'; // Connect with the database // $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName); // Get search term' @$searchTerm = $_GET['term']; if(isset($_GET['field']) && $_GET['field']=="bname") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE bname LIKE '%".$searchTerm."%' GROUP BY bname"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['bname']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="dname") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE dname LIKE '%".$searchTerm."%' GROUP BY dname"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['dname']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="caste") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM caste WHERE name LIKE '%".$searchTerm."%' GROUP BY name"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="rname") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE registeredby LIKE '%".$searchTerm."%' GROUP BY registeredby"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="default") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM caste GROUP BY name"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="subcaste") { $cid = $_GET['cid']; mysqli_set_charset($db,"utf8"); // Get matched data from skills table $query = $db->query("SELECT * FROM subcaste WHERE casteid='$cid' AND name LIKE '%".$searchTerm."%' GROUP BY name"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } /*if(isset($_GET['field']) && $_GET['field']=="brokername") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE brokername LIKE '%".$searchTerm."%' GROUP BY brokername"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['brokername']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } */ if(isset($_GET['field']) && $_GET['field']=="brokername") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); //$query = $db->query("SELECT * FROM brokers WHERE brokername LIKE '%".$searchTerm."%' GROUP BY brokername"); $query = $db->query("SELECT * FROM brokers WHERE brokername LIKE '%".$searchTerm."%' GROUP BY brokername"); //$query = $db->query("SELECT DISTINCT id,brokername FROM brokers WHERE brokername LIKE '%".$searchTerm."%'"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['brokername']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="father_name") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE father_name LIKE '%".$searchTerm."%' GROUP BY father_name"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['father_name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="father_dname") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE father_dname LIKE '%".$searchTerm."%' GROUP BY father_dname"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['father_dname']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="mother_name") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE mother_name LIKE '%".$searchTerm."%' GROUP BY mother_name"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['mother_name']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="mother_dname") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE mother_dname LIKE '%".$searchTerm."%' GROUP BY mother_dname"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['mother_dname']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="ancestry") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE ancestry LIKE '%".$searchTerm."%' GROUP BY ancestry"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['ancestry']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="edu") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE edu LIKE '%".$searchTerm."%' GROUP BY edu"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['edu']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="job") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE job LIKE '%".$searchTerm."%' GROUP BY job"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['job']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="tyear") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE tyear LIKE '%".$searchTerm."%' GROUP BY tyear"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['tyear']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } if(isset($_GET['field']) && $_GET['field']=="family_god") { // Get matched data from skills table mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE family_god LIKE '%".$searchTerm."%' GROUP BY family_god"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['family_god']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } /*if(isset($_GET['field']) && $_GET['field']=="native_place") { // Get matched data from skills table $query = $db->query("SELECT * FROM profiles WHERE native_place LIKE '%".$searchTerm."%'"); // Generate skills data array $skillData = array(); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data['id'] = $row['id']; $data['value'] = $row['native_place']; array_push($skillData, $data); } } // Return results as json encoded array echo json_encode($skillData); } */ if(isset($_POST['cellno']) && $_POST['cellno']!="") { $statement = $pdo->prepare("SELECT * FROM profiles WHERE cellno='$_POST[cellno]' and dob='$_POST[dob]'"); $statement->execute(); $query = $statement->fetchAll(PDO::FETCH_ASSOC); if($query->num_rows > 0){ echo "1"; } else { echo "0"; } } if(isset($_POST['dob']) && $_POST['dob']!="") { $statement = $pdo->prepare("SELECT * FROM profiles WHERE dob ='$_POST[dob]'"); $statement->execute(); $query = $statement->fetchAll(PDO::FETCH_ASSOC); // Generate skills data array $data = ""; $data .= "<table class=\"table\"> <tr>"; //$data .= '<th id="psid"><input type="checkbox" name="select_all" value="1" size="15" id="example-select-all"></th>'; $data .= "<th>பதிவு எண்</th>"; $data .= "<th>பதிவு முறை</th>"; $data .= "<th>பெயர்</th>"; $data .= "<th>பாலினம்</th>"; $data .= "<th>ஜாதி</th>"; $data .= "<th>பிறந்த தேதி</th>"; $data .= "<th>நட்சத்திரம்</th>"; $data .= "<th>அப்பா பெயர்</th>"; $data .= "<th>இருப்பிடம்</th>"; $data .= "<th>புரோக்கர் பெயர்</th></tr>"; $brokername =''; if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ // $data .= "<tr><td align='center'>".$row["regnop"]." ".$row['id']."</td>"; $data .= "<td align='center'>".$row['regtype']."</td>"; $data .= "<td align='center'>".$row['bname']."</td>"; $data .= "<td align='center'>".$row['gender']."</td>"; $cq = $db->query("select * from caste where id='$row[caste]'"); $cres = $cq->fetch_assoc(); $caste = $cres["name"]; $data .= "<td align='center'>".$caste."</td>"; $data .= "<td align='center'>".$row['dob']."</td>"; if( $row["natchatram"]=="1"){ $natchatram = "அஸ்வினி";} else if( $row["natchatram"]=="2"){ $natchatram = "பரணி";} else if( $row["natchatram"]=="3"){ $natchatram = "கார்த்திகை";} else if( $row["natchatram"]=="4"){ $natchatram = "ரோகிணி";} else if( $row["natchatram"]=="5"){ $natchatram = "மிருகசீரிடம்";} else if( $row["natchatram"]=="6"){ $natchatram = "திருவாதிரை";} else if( $row["natchatram"]=="7"){ $natchatram = "புனர்பூசம்";} else if( $row["natchatram"]=="8"){ $natchatram = "பூசம்";} else if( $row["natchatram"]=="9"){ $natchatram = "ஆயில்யம்";} else if( $row["natchatram"]=="10"){ $natchatram = "மகம்";} else if( $row["natchatram"]=="11"){ $natchatram = "பூரம்";} else if( $row["natchatram"]=="12"){ $natchatram = "உத்தரம்";} else if( $row["natchatram"]=="13"){ $natchatram = "அஸ்தம்";} else if( $row["natchatram"]=="14"){ $natchatram = "சித்திரை";} else if( $row["natchatram"]=="15"){ $natchatram = "சுவாதி";} else if( $row["natchatram"]=="16"){ $natchatram = "விசாகம்";} else if( $row["natchatram"]=="17"){ $natchatram = "அனுஷம்";} else if( $row["natchatram"]=="18"){ $natchatram = "கேட்டை";} else if( $row["natchatram"]=="19"){ $natchatram = "மூலம்";} else if( $row["natchatram"]=="20"){ $natchatram = "பூராடம்";} else if( $row["natchatram"]=="21"){ $natchatram = "உத்திராடம்";} else if( $row["natchatram"]=="22"){ $natchatram = "திருவோணம்";} else if( $row["natchatram"]=="23"){ $natchatram = "அவிட்டம்";} else if( $row["natchatram"]=="24"){ $natchatram = "சதயம்";} else if( $row["natchatram"]=="25"){ $natchatram = "பூரட்டாதி";} else if( $row["natchatram"]=="26"){ $natchatram = "உத்திரட்டாதி";} else if( $row["natchatram"]=="27"){ $natchatram = "ரேவதி";} $data .= "<td align='center'>".$natchatram."</td>"; $data .= "<td align='center'>".$row['father_name']."</td>"; $data .= "<td align='center'>".$row['native_place']."</td>"; if($row['brokercount']>0) { if(@strpos(",", $row['broker_ids']) !== false ) { $bro_ids[0] =$row['broker_ids']; } else { $bro_ids = explode(",",$row['broker_ids']); } for($i=0;$i< $row['brokercount'];$i++) { /*$bncl = "brokername".$i; //echo $bncl; $btcl = "brokertype".$i; $ipcl = "is_phone".$i; $picl = "profid".$i;*/ mysqli_set_charset($db,"utf8"); @$bro_query = "select * from brokers where id='$bro_ids[$i]'"; //echo $bro_query; $bro_res = mysqli_query($db,$bro_query); $bro_row = mysqli_fetch_assoc($bro_res); if($bro_row['brokername']!="") { $brokername = $bro_row['brokername']; // if($bro_row['type']=="I") $brokername .= "<span style=\"color:red;font-size:20px;\"><sup>*</sup></span>"; // //if($bro_row['is_phone']=="1") $brokername .= "<sup><i class='fa fa-phone' aria-hidden='true' style='color:green;font-size:20px;'></i></sup>"; // if( $row['brokercount']>1 && ($i+1)!= $row['brokercount']) // { // $brokername .= ","; // } } } } $data .= "<td align='center'>".$brokername."</td></tr>"; //array_push($skillData, $data); } } else { $data .= "<tr><td align='center' colspan='7'>பொருத்தமான பதிவுகள் இல்லை. </td></tr>"; } $data .= "</table>"; // Return results as json encoded array echo $data; } if(isset($_POST['ids']) && $_POST['ids']!="") { // Get matched data from skills table $idsa = explode(",",$_POST['ids']); for($i=0;$i<count($idsa);$i++) { mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM profiles WHERE id ='$idsa[$i]'"); // Generate skills data array $data = ""; $data .= "<table class=\"table\" id=\"sharetab\"> <tr>"; $data .= '<th id="psid"></th>'; $data .= "<th>பதிவு எண்</th>"; $data .= "<th>பதிவு முறை</th>"; $data .= "<th>பெயர்</th>"; $data .= "<th>பாலினம்</th>"; $data .= "<th>ஜாதி</th>"; $data .= "<th>பிறந்த தேதி</th>"; $data .= "<th>செல்போன் எண்</th></tr>"; /* $data .= "<th>புரோக்கர் பெயர்</th></tr>";*/ if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $data .= "<tr><td style='font-weight:bold;'><input type='checkbox' name='sharep[]' class='profchk' value='".$row['id']."'size='15' id='ex-select-all'></td>"; $data .= "<td align='center'>".$row["regnop"]." ".$row['id']."</td>"; $data .= "<td align='center'>".$row['regtype']."</td>"; $data .= "<td align='center'>".$row['bname']."</td>"; $data .= "<td align='center'>".$row['gender']."</td>"; $cq = $db->query("select * from caste where id='$row[caste]'"); $cres = $cq->fetch_assoc(); $caste = $cres["name"]; $data .= "<td align='center'>".$caste."</td>"; $data .= "<td align='center'>".$row['dob']."</td>"; $data .= "<td align='center'>"."*****".substr($row["cellno"],-5)."</td></tr>"; } } else { $data .= "<tr><td align='center' colspan='7'>பொருத்தமான பதிவுகள் இல்லை. </td></tr>"; } $data .= "</table>"; // Return results as json encoded array echo $data; } } if(isset($_POST['shareids']) && $_POST['shareids']!="") { // Get matched data from skills table $type = $_POST['type']; if($type=="P") { $proid = $_POST['profiles']; $idsa = explode(",",$_POST['shareids']); $date = date('Y-m-d H:i:s'); $data =""; for($i=0;$i<count($idsa);$i++) { mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM share_profiles WHERE rec_type ='$type' AND rec_id='$proid' AND prof_given='$idsa[$i]'"); //if(in_array($idsa[$i], $row['prof_given'])) if($query->num_rows > 0) { $data .= "<div style='color:red;font-weight:bold;'>*பதிவு " . $idsa[$i] . " ஏற்கனவே ஜாதகருக்கு வழங்கப்பட்டுள்ளது.</div><br>"; } else { mysqli_set_charset($db,"utf8"); $queryn = $db->query("SELECT * FROM profiles WHERE id ='$idsa[$i]'"); // Generate skills data array //$data = ""; $data .= "<table class=\"table\" id=\"sharetab\" style=\"color:green;\"> <tr>"; //$data .= '<th id="psid"></th>'; $data .= "<th>பதிவு எண்</th>"; $data .= "<th>பதிவு முறை</th>"; $data .= "<th>பெயர்</th>"; $data .= "<th>பாலினம்</th>"; $data .= "<th>ஜாதி</th>"; $data .= "<th>பிறந்த தேதி</th>"; $data .= "<th>செல்போன் எண்</th></tr>"; /* $data .= "<th>புரோக்கர் பெயர்</th></tr>";*/ if($queryn->num_rows > 0){ while($row = $queryn->fetch_assoc()){ //$data .= "<tr><td style='font-weight:bold;'><input type='checkbox' name='sharep[]' class='profchk' value='".$row['id']."'size='15' id='ex-select-all'></td>"; $data .= "<td align='center'>".$row["regnop"]." ".$row['id']."</td>"; $data .= "<td align='center'>".$row['regtype']."</td>"; $data .= "<td align='center'>".$row['bname']."</td>"; $data .= "<td align='center'>".$row['gender']."</td>"; $cq = $db->query("select * from caste where id='$row[caste]'"); $cres = $cq->fetch_assoc(); $caste = $cres["name"]; $data .= "<td align='center'>".$caste."</td>"; $data .= "<td align='center'>".$row['dob']."</td>"; $data .= "<td align='center'>"."*****".substr($row["cellno"],-5)."</td></tr>"; } } $data .= "</table>"; $proidins = $idsa[$i]; $sql = "INSERT INTO share_profiles (prof_given, rec_type, rec_id,given_on) VALUES ('$proidins', '$type','$proid','$date')"; if ($db->query($sql) === TRUE) { $data .= "<div style='color:green;font-weight:bold;'>*பதிவு " .$idsa[$i] . " வெற்றிகரமாக ஜாதகருக்கு வழங்கப்பட்டுள்ளது.</div><br>"; } } } echo $data; } else if($type=="B") { $broid = $_POST['brokers']; $idsa = explode(",",$_POST['shareids']); $date = date('Y-m-d H:i:s'); $data =""; for($i=0;$i<count($idsa);$i++) { mysqli_set_charset($db,"utf8"); $query = $db->query("SELECT * FROM share_profiles WHERE rec_type ='$type' AND rec_id='$broid' AND prof_given='$idsa[$i]'"); //$row = $query->fetch_assoc(); if($query->num_rows > 0) { $data .= "<div style='color:red;font-weight:bold;'>*பதிவு " . $idsa[$i] . " ஏற்கனவே புரோக்கருக்கு வழங்கப்பட்டுள்ளது.</div><br>"; } else { mysqli_set_charset($db,"utf8"); $queryn = $db->query("SELECT * FROM profiles WHERE id ='$idsa[$i]'"); // Generate skills data array //$data = ""; $data .= "<table class=\"table\" id=\"sharetab\" style=\"color:green;\"> <tr>"; //$data .= '<th id="psid"></th>'; $data .= "<th>பதிவு எண்</th>"; $data .= "<th>பதிவு முறை</th>"; $data .= "<th>பெயர்</th>"; $data .= "<th>பாலினம்</th>"; $data .= "<th>ஜாதி</th>"; $data .= "<th>பிறந்த தேதி</th>"; $data .= "<th>செல்போன் எண்</th></tr>"; /* $data .= "<th>புரோக்கர் பெயர்</th></tr>";*/ if($queryn->num_rows > 0){ while($row = $queryn->fetch_assoc()){ //$data .= "<tr><td style='font-weight:bold;'><input type='checkbox' name='sharep[]' class='profchk' value='".$row['id']."'size='15' id='ex-select-all'></td>"; $data .= "<td align='center'>".$row["regnop"]." ".$row['id']."</td>"; $data .= "<td align='center'>".$row['regtype']."</td>"; $data .= "<td align='center'>".$row['bname']."</td>"; $data .= "<td align='center'>".$row['gender']."</td>"; $cq = $db->query("select * from caste where id='$row[caste]'"); $cres = $cq->fetch_assoc(); $caste = $cres["name"]; $data .= "<td align='center'>".$caste."</td>"; $data .= "<td align='center'>".$row['dob']."</td>"; $data .= "<td align='center'>"."*****".substr($row["cellno"],-5)."</td></tr>"; } } $data .= "</table>"; $broidins = $idsa[$i]; $sql = "INSERT INTO share_profiles (prof_given, rec_type, rec_id,given_on) VALUES ('$broidins', '$type','$broid','$date')"; if ($db->query($sql) === TRUE) { $data .= "<div style='color:green;font-weight:bold;'>*பதிவு " .$idsa[$i] ." வெற்றிகரமாக புரோக்கருக்கு வழங்கப்பட்டுள்ளது.</div><br>"; } } } echo $data; } } ?>