Thursday, 2 April 2015

<html>
<head>
</head>
<body>
<div style="background-color:grey;float:left; height:455px;width:303px">
<span style="font-weight:1500;font-family:Lucida Handwriting;font-size:50px"><b>MANAGE</b></span><br/>
<ul style="font-weight:1500;font-family:Lucida Handwriting;font-size:30px">
<li><a href="dashowner2.php">ADD PROPERTY</a></li>
<li><a href="dashowner3.php">VIEW PROPERTY</a></li>
<li><a href="dashowner3.php">UPDATE OWNER</a></li>
<li><a href="dashowner4.php">CHANGE PASSWORD</a></li>
<li><a href="logout.php">LOGOUT</a></li>
</ul>
</div>
</body>
</html>

dashboard.php

<html>
<head>
</head>
<body>
<div style="background-color:grey;float:left; height:455px;width:303px">
<span style="font-weight:1500;font-family:Lucida Handwriting;font-size:50px"><b>MANAGE</b></span><br/>
<ul style="font-weight:1500;font-family:Lucida Handwriting;font-size:30px">
<li><a href="dashowner2.php">ADD PROPERTY</a></li>
<li><a href="dashowner3.php">VIEW PROPERTY</a></li>
<li><a href="dashowner3.php">UPDATE OWNER</a></li>
<li><a href="dashowner4.php">CHANGE PASSWORD</a></li>
<li><a href="logout.php">LOGOUT</a></li>
</ul>
</div>
</body>
</html>

Tuesday, 31 March 2015

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
</head>
<body>
<div>
<table border="0">
          <thead>
              <tr>
                  <th>property type</th>
              </tr>
          </thead>
 <tbody>
<?php
$query="SELECT * from property_type where p_id=";
$data=mysql_query($query);
while ($row=mysql_fetch_array ($data))
{

         
          echo"<tr>";
           echo"<td><img src='properties\'".$row['photo']." width='200px' height='200px' alt='Sorry image cannot be displayed'/>
                  </td>";
                  echo"<td><span>OWNER NAME:".$row['oname']."</span><br/>

 <span>PROPERTY ADDRESS:".$row['p_address']."</span><br/>
 <span>STATE:".$row['statename']."</span><br/>
 <span>CITY:".$row['cityname']."</span><br/>
 <span>PROPERTY FOR:".$row['p_type']."</span><br/>
 <span>CONTACT NO:".$row['contact']."</span><br/></td>";
            echo"</tr>";
}
?>
          </tbody>
      </table>

</div>
</body>
</html>

viewtype.php

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
</head>
<body>
<div>
<table border="0">
          <thead>
              <tr>
                  <th>property type</th>
              </tr>
          </thead>
 <tbody>
<?php
$query="SELECT * from property_type where p_id=";
$data=mysql_query($query);
while ($row=mysql_fetch_array ($data))
{

         
          echo"<tr>";
           echo"<td><img src='properties\'".$row['photo']." width='200px' height='200px' alt='Sorry image cannot be displayed'/>
                  </td>";
                  echo"<td><span>OWNER NAME:".$row['oname']."</span><br/>

 <span>PROPERTY ADDRESS:".$row['p_address']."</span><br/>
 <span>STATE:".$row['statename']."</span><br/>
 <span>CITY:".$row['cityname']."</span><br/>
 <span>PROPERTY FOR:".$row['p_type']."</span><br/>
 <span>CONTACT NO:".$row['contact']."</span><br/></td>";
            echo"</tr>";
}
?>
          </tbody>
      </table>

</div>
</body>
</html>

Friday, 27 March 2015

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
</head>
<body>
<div>
<table border="0">
          <thead>
              <tr>
                  <th>PHOTO OF PROPERTY</th>
                  <th>ABOUT PROPERTY</th>
              </tr>
          </thead>
 <tbody>
<?php
$query="SELECT *,states.statename,city.cityname,property_owner.name as oname,property_type.p_type from property_registration join states on states.stateid=property_registration.state_id join city on city.cityid=property_registration.city_id join property_type on property_type.p_id=property_registration.p_type join property_owner on property_registration.p_owner=property_owner.owner_id";
$data=mysql_query($query);
while ($row=mysql_fetch_array ($data))
{

         
          echo"<tr>";
           echo"<td><img src='properties\'".$row['photo']." width='200px' height='200px' alt='Sorry image cannot be displayed'/>
                  </td>";
                  echo"<td><span>OWNER NAME:".$row['oname']."</span><br/>

 <span>PROPERTY ADDRESS:".$row['p_address']."</span><br/>
 <span>STATE:".$row['statename']."</span><br/>
 <span>CITY:".$row['cityname']."</span><br/>
 <span>PROPERTY FOR:".$row['p_type']."</span><br/>
 <span>CONTACT NO:".$row['contact']."</span><br/></td>";
            echo"</tr>";
}
?>
          </tbody>
      </table>

</div>
</body>
</html>

view.php

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
</head>
<body>
<div>
<table border="0">
          <thead>
              <tr>
                  <th>PHOTO OF PROPERTY</th>
                  <th>ABOUT PROPERTY</th>
              </tr>
          </thead>
 <tbody>
<?php
$query="SELECT *,states.statename,city.cityname,property_owner.name as oname,property_type.p_type from property_registration join states on states.stateid=property_registration.state_id join city on city.cityid=property_registration.city_id join property_type on property_type.p_id=property_registration.p_type join property_owner on property_registration.p_owner=property_owner.owner_id";
$data=mysql_query($query);
while ($row=mysql_fetch_array ($data))
{

         
          echo"<tr>";
           echo"<td><img src='properties\'".$row['photo']." width='200px' height='200px' alt='Sorry image cannot be displayed'/>
                  </td>";
                  echo"<td><span>OWNER NAME:".$row['oname']."</span><br/>

 <span>PROPERTY ADDRESS:".$row['p_address']."</span><br/>
 <span>STATE:".$row['statename']."</span><br/>
 <span>CITY:".$row['cityname']."</span><br/>
 <span>PROPERTY FOR:".$row['p_type']."</span><br/>
 <span>CONTACT NO:".$row['contact']."</span><br/></td>";
            echo"</tr>";
}
?>
          </tbody>
      </table>

</div>
</body>
</html>

Tuesday, 24 March 2015

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$id;
$row=mysql_query("select p_type from property_type where p_id=".$_GET['id']);
$result=mysql_fetch_array($row);
if(isset($_POST['update']))
{
mysql_query("update property_type set p_type='".$_POST['txt1']."'where p_id=".$_GET['id']);
header('location:delete.php');
}
?>
<html>
<form method="POST">
<body>
<center>
<h2>Enter Proprty Type</h2>
</body>
<table border="2" width="60%"align="center" style="background-color:#E0FFFF">
<tr><td>Enter Proprty Type</td><td><input type="text"name="txt1"value="<?php echo$result['p_type']?>"/>
</tr></td>


</table>
<br/>
<input type="submit"name="update"value="update"/>
</center>
</form>
</html>

typeproperty.php

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$id;
$row=mysql_query("select p_type from property_type where p_id=".$_GET['id']);
$result=mysql_fetch_array($row);
if(isset($_POST['update']))
{
mysql_query("update property_type set p_type='".$_POST['txt1']."'where p_id=".$_GET['id']);
header('location:delete.php');
}
?>
<html>
<form method="POST">
<body>
<center>
<h2>Enter Proprty Type</h2>
</body>
<table border="2" width="60%"align="center" style="background-color:#E0FFFF">
<tr><td>Enter Proprty Type</td><td><input type="text"name="txt1"value="<?php echo$result['p_type']?>"/>
</tr></td>


</table>
<br/>
<input type="submit"name="update"value="update"/>
</center>
</form>
</html>

Friday, 20 March 2015

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>

<html>
<head>
<script type="text/javascript">
function chk()
{

if(chk1() && chk2())
{
 if(chk3())
 {
if(chk4() && chk5() && chk6())
{
if(chk7())
{
if(chk8())
{
return true;
}
}
}
}
}
return false;
 }



 function chk1()
{
var elem=document.getElementById("txt1");
  if(elem.value=="")
  {
  document.getElementById("a").innerHTML="please enter name!";
   return false;
  }
  else
 {
document.getElementById("a").innerHTML="";
return true;
 }
 }
function chk2()
{
var elem=document.getElementById("txt1");
var alphaExp=/^[a-zA-Z]+$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("a").innerHTML="";
return true;
  }
else
  {
document.getElementById("a").innerHTML="please enter only alphabets!";
elem.focus();
 return false;
  }
  }
  function chk3()
{
var elem=document.getElementById("txt2");
var alphaExp = /^([A-Za-z0-9\-\.\_])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("b").innerHTML="";
return true;
  }
else
  {
document.getElementById("b").innerHTML="please enter valid email!";
elem.focus();
 return false;
 }
 }
 function chk4()
{
var elem=document.getElementById("txt3");
  if(elem.value=="")
  {
  document.getElementById("c").innerHTML="please enter password!";
   return false;
  }
  else
 {
document.getElementById("c").innerHTML="";
return true;
 }
 }
 function chk5()
{
var elem=document.getElementById("txt4");
  if(elem.value=="")
  {
  document.getElementById("d").innerHTML="please confirm your password!";
   return false;
  }
  else
 {
document.getElementById("d").innerHTML="";
return true;
 }
 }
 function chk6()
 {
 var elem=document.getElementById("txt3");
 var elem2=document.getElementById("txt4");
 if(elem.value==elem2.value)
 {
 document.getElementById("d").innerHTML="";
 return true;
 }
 else
 {
 document.getElementById("d").innerHTML="password you entered not match !";
 elem.focus();
 return false;
 }
 }
 
 function chk7()
  {
  var elem=document.getElementById("txt5");
  var alphaExp=/^\d{10}$/;
  if(elem.value.match(alphaExp))
  {
  document.getElementById("e").innerHTML="";
return true;
}
else
{
document.getElementById("e").innerHTML="enter mobile no of 10 digits !";
elem.focus();
 return false;
  }
 }
 


 function chk8()
{
var elem=document.getElementById("sec");
 if(elem.value=="please choose")
 {
 document.getElementById("f").innerHTML="please select a question!";
elem.focus();
return false;
}
else
{
document.getElementById("f").innerHTML="";
return true;
 }
}

</script>
</head>
</head>
<body>
<div style="background-color:white;
background-image:url('property.jpg');width:1000px;height:450px;
color:red"/>
<form method="post" onsubmit="return chk();">
<h1 style="font-weight:1500"><i>SEEKER-REGISTRATION</i></hi>
      <table border="0" style="font-size:20px;font-family:Segoe Print;font-style:italic;font-weight:bold">
         
          <tbody>
              <tr>
                  <td>NAME</td>
                  <td><input type="text" name="name" value="" id="txt1" /><span id="a"></span></td>
              </tr>
               <tr>
                  <td>E-MAIL</td>
                  <td><input type="text" name="email" value="" id="txt2"/><span id="b"></span></td>
              </tr>
               <tr>
                  <td>PASSWORD</td>
                  <td><input type="password" name="password" value="" id="txt3" /><span id="c"></span></td>
              </tr>
               <tr>
                  <td>CONFIRM-PASSWORD</td>
                  <td><input type="password" name="conpassword" value="" id="txt4" /><span id="d"></span></td>
              </tr>
             
              <tr>
                  <td>ADDRESS</td>
                  <td><input type="text" name="address" value="" /></td>
              </tr>
              <tr>
                  <td>CONTACT NO</td>
                  <td><input type="text" name="contactno" value="" id="txt5"/><span id="e"></span></td>
              </tr>
           
              <tr>
                  <td>SECURITY QUESTION</td>
                  <td><select name="securityquestion" id="sec">
                          <option>--SELECT--</option>
                         <?php
 $query="select * from security_question";
 $data=mysql_query($query);
 while ($row=mysql_fetch_array ($data))
 {
 echo"<option value=".$row ['security_id'].">".$row ['question']."</option>";
 }
 ?>
                      </select><span id="f"></span></td>
              </tr>
              <tr>
                  <td>SECURITY ANSWER</td>
                  <td><input type="text" name="answer" value="" /></td>
              </tr>
          </tbody>
      </table>
 <br/>
 <input type="submit" value="ADD" name="btn"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="CANCEL" name="btn1"/>
 <form/>
</div>
<?php
if (isset($_POST['btn'])){
$query1="insert into propertyseeker (Name,Emailid,Address,Password,Sec_ques,Answer,Contact) values ('".$_POST['name']."','".$_POST['email']."','".$_POST['address']."','".$_POST['password']."','".$_POST['securityquestion']."','".$_POST['answer']."','".$_POST['contactno']."')";
$data=mysql_query($query1);
if ($data)
{
echo"Data inserted";
}
else
{
echo mysql_error();
}}
?>
  </body>
</html>

mpropertyseeker.php

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>

<html>
<head>
<script type="text/javascript">
function chk()
{

if(chk1() && chk2())
{
 if(chk3())
 {
if(chk4() && chk5() && chk6())
{
if(chk7())
{
if(chk8())
{
return true;
}
}
}
}
}
return false;
 }



 function chk1()
{
var elem=document.getElementById("txt1");
  if(elem.value=="")
  {
  document.getElementById("a").innerHTML="please enter name!";
   return false;
  }
  else
 {
document.getElementById("a").innerHTML="";
return true;
 }
 }
function chk2()
{
var elem=document.getElementById("txt1");
var alphaExp=/^[a-zA-Z]+$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("a").innerHTML="";
return true;
  }
else
  {
document.getElementById("a").innerHTML="please enter only alphabets!";
elem.focus();
 return false;
  }
  }
  function chk3()
{
var elem=document.getElementById("txt2");
var alphaExp = /^([A-Za-z0-9\-\.\_])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("b").innerHTML="";
return true;
  }
else
  {
document.getElementById("b").innerHTML="please enter valid email!";
elem.focus();
 return false;
 }
 }
 function chk4()
{
var elem=document.getElementById("txt3");
  if(elem.value=="")
  {
  document.getElementById("c").innerHTML="please enter password!";
   return false;
  }
  else
 {
document.getElementById("c").innerHTML="";
return true;
 }
 }
 function chk5()
{
var elem=document.getElementById("txt4");
  if(elem.value=="")
  {
  document.getElementById("d").innerHTML="please confirm your password!";
   return false;
  }
  else
 {
document.getElementById("d").innerHTML="";
return true;
 }
 }
 function chk6()
 {
 var elem=document.getElementById("txt3");
 var elem2=document.getElementById("txt4");
 if(elem.value==elem2.value)
 {
 document.getElementById("d").innerHTML="";
 return true;
 }
 else
 {
 document.getElementById("d").innerHTML="password you entered not match !";
 elem.focus();
 return false;
 }
 }
 
 function chk7()
  {
  var elem=document.getElementById("txt5");
  var alphaExp=/^\d{10}$/;
  if(elem.value.match(alphaExp))
  {
  document.getElementById("e").innerHTML="";
return true;
}
else
{
document.getElementById("e").innerHTML="enter mobile no of 10 digits !";
elem.focus();
 return false;
  }
 }
 


 function chk8()
{
var elem=document.getElementById("sec");
 if(elem.value=="please choose")
 {
 document.getElementById("f").innerHTML="please select a question!";
elem.focus();
return false;
}
else
{
document.getElementById("f").innerHTML="";
return true;
 }
}

</script>
</head>
</head>
<body>
<div style="background-color:white;
background-image:url('property.jpg');width:1000px;height:450px;
color:red"/>
<form method="post" onsubmit="return chk();">
<h1 style="font-weight:1500"><i>SEEKER-REGISTRATION</i></hi>
      <table border="0" style="font-size:20px;font-family:Segoe Print;font-style:italic;font-weight:bold">
         
          <tbody>
              <tr>
                  <td>NAME</td>
                  <td><input type="text" name="name" value="" id="txt1" /><span id="a"></span></td>
              </tr>
               <tr>
                  <td>E-MAIL</td>
                  <td><input type="text" name="email" value="" id="txt2"/><span id="b"></span></td>
              </tr>
               <tr>
                  <td>PASSWORD</td>
                  <td><input type="password" name="password" value="" id="txt3" /><span id="c"></span></td>
              </tr>
               <tr>
                  <td>CONFIRM-PASSWORD</td>
                  <td><input type="password" name="conpassword" value="" id="txt4" /><span id="d"></span></td>
              </tr>
             
              <tr>
                  <td>ADDRESS</td>
                  <td><input type="text" name="address" value="" /></td>
              </tr>
              <tr>
                  <td>CONTACT NO</td>
                  <td><input type="text" name="contactno" value="" id="txt5"/><span id="e"></span></td>
              </tr>
           
              <tr>
                  <td>SECURITY QUESTION</td>
                  <td><select name="securityquestion" id="sec">
                          <option>--SELECT--</option>
                         <?php
 $query="select * from security_question";
 $data=mysql_query($query);
 while ($row=mysql_fetch_array ($data))
 {
 echo"<option value=".$row ['security_id'].">".$row ['question']."</option>";
 }
 ?>
                      </select><span id="f"></span></td>
              </tr>
              <tr>
                  <td>SECURITY ANSWER</td>
                  <td><input type="text" name="answer" value="" /></td>
              </tr>
          </tbody>
      </table>
 <br/>
 <input type="submit" value="ADD" name="btn"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="CANCEL" name="btn1"/>
 <form/>
</div>
<?php
if (isset($_POST['btn'])){
$query1="insert into propertyseeker (Name,Emailid,Address,Password,Sec_ques,Answer,Contact) values ('".$_POST['name']."','".$_POST['email']."','".$_POST['address']."','".$_POST['password']."','".$_POST['securityquestion']."','".$_POST['answer']."','".$_POST['contactno']."')";
$data=mysql_query($query1);
if ($data)
{
echo"Data inserted";
}
else
{
echo mysql_error();
}}
?>
  </body>
</html>

Sunday, 15 March 2015

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
<script type="text/javascript">
function chk()
{

if(chk1() && chk2())
{
 if(chk3())
 {
if(chk4() && chk5() && chk6())
{
if(chk7())
{
if(chk8())
{
return true;
}
}
}
}
}
return false;
 }



 function chk1()
{
var elem=document.getElementById("txt1");
  if(elem.value=="")
  {
  document.getElementById("a").innerHTML="please enter name!";
   return false;
  }
  else
 {
document.getElementById("a").innerHTML="";
return true;
 }
 }
function chk2()
{
var elem=document.getElementById("txt1");
var alphaExp=/^[a-zA-Z]+$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("a").innerHTML="";
return true;
  }
else
  {
document.getElementById("a").innerHTML="please enter only alphabets!";
elem.focus();
 return false;
  }
  }
  function chk3()
{
var elem=document.getElementById("txt2");
var alphaExp = /^([A-Za-z0-9\-\.\_])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("b").innerHTML="";
return true;
  }
else
  {
document.getElementById("b").innerHTML="please enter valid email!";
elem.focus();
 return false;
 }
 }
 function chk4()
{
var elem=document.getElementById("txt3");
  if(elem.value=="")
  {
  document.getElementById("c").innerHTML="please enter password!";
   return false;
  }
  else
 {
document.getElementById("c").innerHTML="";
return true;
 }
 }
 function chk5()
{
var elem=document.getElementById("txt4");
  if(elem.value=="")
  {
  document.getElementById("d").innerHTML="please confirm your password!";
   return false;
  }
  else
 {
document.getElementById("d").innerHTML="";
return true;
 }
 }
 function chk6()
 {
 var elem=document.getElementById("txt3");
 var elem2=document.getElementById("txt4");
 if(elem.value==elem2.value)
 {
 document.getElementById("d").innerHTML="";
 return true;
 }
 else
 {
 document.getElementById("d").innerHTML="password you entered not match !";
 elem.focus();
 return false;
 }
 }
 
 function chk7()
  {
  var elem=document.getElementById("txt5");
  var alphaExp=/^\d{10}$/;
  if(elem.value.match(alphaExp))
  {
  document.getElementById("e").innerHTML="";
return true;
}
else
{
document.getElementById("e").innerHTML="enter mobile no of 10 digits !";
elem.focus();
 return false;
  }
 }
 


 function chk8()
{
var elem=document.getElementById("sec");
 if(elem.value=="please choose")
 {
 document.getElementById("f").innerHTML="please select a question!";
elem.focus();
return false;
}
else
{
document.getElementById("f").innerHTML="";
return true;
 }
}

</script>
</head>
<body>
<div align="center" style="background-color:#BC8F8F">
<form method="post" onsubmit="return chk();">
<h1 style="font-weight:1500"><i>OWNER-REGISTRATION</i></hi>
      <table border="0" style="font-size:20px;font-family:Segoe Print;font-style:italic;font-weight:bold">
         
          <tbody>
              <tr>
                  <td>NAME</td>
                  <td><input type="text" name="name" value="" id="txt1" /><span id="a"></span></td>
              </tr>
               <tr>
                  <td>E-MAIL</td>
                  <td><input type="text" name="email" value="" id="txt2"/><span id="b"></span></td>
              </tr>
               <tr>
                  <td>PASSWORD</td>
                  <td><input type="password" name="password" value="" id="txt3" /><span id="c"></span></td>
              </tr>
               <tr>
                  <td>CONFIRM-PASSWORD</td>
                  <td><input type="password" name="conpassword" value="" id="txt4" /><span id="d"></span></td>
              </tr>
             
              <tr>
                  <td>ADDRESS</td>
                  <td><input type="text" name="address" value="" /></td>
              </tr>
              <tr>
                  <td>CONTACT NO</td>
                  <td><input type="text" name="contactno" value="" id="txt5"/><span id="e"></span></td>
              </tr>
           
              <tr>
                  <td>SECURITY QUESTION</td>
                  <td><select name="securityquestion" id="sec">
                          <option>--SELECT--</option>
                         <?php
 $query="select * from security_question";
 $data=mysql_query($query);
 while ($row=mysql_fetch_array ($data))
 {
 echo"<option value=".$row ['security_id'].">".$row ['question']."</option>";
 }
 ?>
                      </select><span id="f"></span></td>
              </tr>
              <tr>
                  <td>SECURITY ANSWER</td>
                  <td><input type="text" name="answer" value="" /></td>
              </tr>
          </tbody>
      </table>
 <br/>
 <input type="submit" value="ADD" name="btn"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="CANCEL" name="btn1"/>
 <form/>
</div>
 
<?php
if (isset($_POST['btn'])){
$query1="insert into property_owner (name,password,address,contact,email,security_id,security_answer) values ('".$_POST['name']."','".$_POST['password']."','".$_POST['address']."','".$_POST['contactno']."','".$_POST['email']."','".$_POST['securityquestion']."','".$_POST['answer']."')";
$data=mysql_query($query1);
if ($data)
{
echo"Data inserted";
}
else
{
echo"Data not inserted";
}}
?>
</body>
</html>

ownerform.php

<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
?>
<html>
<head>
<script type="text/javascript">
function chk()
{

if(chk1() && chk2())
{
 if(chk3())
 {
if(chk4() && chk5() && chk6())
{
if(chk7())
{
if(chk8())
{
return true;
}
}
}
}
}
return false;
 }



 function chk1()
{
var elem=document.getElementById("txt1");
  if(elem.value=="")
  {
  document.getElementById("a").innerHTML="please enter name!";
   return false;
  }
  else
 {
document.getElementById("a").innerHTML="";
return true;
 }
 }
function chk2()
{
var elem=document.getElementById("txt1");
var alphaExp=/^[a-zA-Z]+$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("a").innerHTML="";
return true;
  }
else
  {
document.getElementById("a").innerHTML="please enter only alphabets!";
elem.focus();
 return false;
  }
  }
  function chk3()
{
var elem=document.getElementById("txt2");
var alphaExp = /^([A-Za-z0-9\-\.\_])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(elem.value.match(alphaExp))
{
 document.getElementById("b").innerHTML="";
return true;
  }
else
  {
document.getElementById("b").innerHTML="please enter valid email!";
elem.focus();
 return false;
 }
 }
 function chk4()
{
var elem=document.getElementById("txt3");
  if(elem.value=="")
  {
  document.getElementById("c").innerHTML="please enter password!";
   return false;
  }
  else
 {
document.getElementById("c").innerHTML="";
return true;
 }
 }
 function chk5()
{
var elem=document.getElementById("txt4");
  if(elem.value=="")
  {
  document.getElementById("d").innerHTML="please confirm your password!";
   return false;
  }
  else
 {
document.getElementById("d").innerHTML="";
return true;
 }
 }
 function chk6()
 {
 var elem=document.getElementById("txt3");
 var elem2=document.getElementById("txt4");
 if(elem.value==elem2.value)
 {
 document.getElementById("d").innerHTML="";
 return true;
 }
 else
 {
 document.getElementById("d").innerHTML="password you entered not match !";
 elem.focus();
 return false;
 }
 }
 
 function chk7()
  {
  var elem=document.getElementById("txt5");
  var alphaExp=/^\d{10}$/;
  if(elem.value.match(alphaExp))
  {
  document.getElementById("e").innerHTML="";
return true;
}
else
{
document.getElementById("e").innerHTML="enter mobile no of 10 digits !";
elem.focus();
 return false;
  }
 }
 


 function chk8()
{
var elem=document.getElementById("sec");
 if(elem.value=="please choose")
 {
 document.getElementById("f").innerHTML="please select a question!";
elem.focus();
return false;
}
else
{
document.getElementById("f").innerHTML="";
return true;
 }
}

</script>
</head>
<body>
<div align="center" style="background-color:#BC8F8F">
<form method="post" onsubmit="return chk();">
<h1 style="font-weight:1500"><i>OWNER-REGISTRATION</i></hi>
      <table border="0" style="font-size:20px;font-family:Segoe Print;font-style:italic;font-weight:bold">
         
          <tbody>
              <tr>
                  <td>NAME</td>
                  <td><input type="text" name="name" value="" id="txt1" /><span id="a"></span></td>
              </tr>
               <tr>
                  <td>E-MAIL</td>
                  <td><input type="text" name="email" value="" id="txt2"/><span id="b"></span></td>
              </tr>
               <tr>
                  <td>PASSWORD</td>
                  <td><input type="password" name="password" value="" id="txt3" /><span id="c"></span></td>
              </tr>
               <tr>
                  <td>CONFIRM-PASSWORD</td>
                  <td><input type="password" name="conpassword" value="" id="txt4" /><span id="d"></span></td>
              </tr>
             
              <tr>
                  <td>ADDRESS</td>
                  <td><input type="text" name="address" value="" /></td>
              </tr>
              <tr>
                  <td>CONTACT NO</td>
                  <td><input type="text" name="contactno" value="" id="txt5"/><span id="e"></span></td>
              </tr>
           
              <tr>
                  <td>SECURITY QUESTION</td>
                  <td><select name="securityquestion" id="sec">
                          <option>--SELECT--</option>
                         <?php
 $query="select * from security_question";
 $data=mysql_query($query);
 while ($row=mysql_fetch_array ($data))
 {
 echo"<option value=".$row ['security_id'].">".$row ['question']."</option>";
 }
 ?>
                      </select><span id="f"></span></td>
              </tr>
              <tr>
                  <td>SECURITY ANSWER</td>
                  <td><input type="text" name="answer" value="" /></td>
              </tr>
          </tbody>
      </table>
 <br/>
 <input type="submit" value="ADD" name="btn"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="CANCEL" name="btn1"/>
 <form/>
</div>
 
<?php
if (isset($_POST['btn'])){
$query1="insert into property_owner (name,password,address,contact,email,security_id,security_answer) values ('".$_POST['name']."','".$_POST['password']."','".$_POST['address']."','".$_POST['contactno']."','".$_POST['email']."','".$_POST['securityquestion']."','".$_POST['answer']."')";
$data=mysql_query($query1);
if ($data)
{
echo"Data inserted";
}
else
{
echo"Data not inserted";
}}
?>
</body>
</html>

Tuesday, 10 March 2015

<?php
include('topmenu.php');
include('leftmenu.php');
?>
<html>
<body>
<div style="background-color:white;
background-image:url('homeee.jpg');width:1000px;height:500px;
color:orange"/>
<form method="post" enctype="multipart/form-data">
<br/>
Add property
<br/>

Name<input type="text" name="name"/>
</br>
Address<input type="text" name="paddress"/>
<br/>



state <select  name="state">
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from states";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['stateid'].">".$row['statename']."</option>";
}

?>
</select>


</br>
city <select name="city" >
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from city";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['cityid'].">".$row['cityname']."</option>";
}
?>

</select>
<br/>
Property type<select name="ptype" />
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from property_type";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['p_id'].">".$row['p_type']."</option>";
}

?>
</select>
</br>

Price<input type="text" name="price"/>
</br>

choose file<input type="file" name="photo"/><br/>
<input type="submit" value="add" name="btn"/>
<br/>
<?php
if(isset($_POST['btn']))
{
move_uploaded_file($_FILES['photo']['tmp_name'],"upload/".$_FILES['photo']['name']);
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="insert into property_registration(name,p_address,state_id,city_id,p_type,p_owner,price,photo)values('".$_POST['name']."','".$_POST['paddress']."',".$_POST['state'].",".$_POST['city'].",".$_POST['ptype'].",01,'".$_POST['price']."','".$_FILES['photo']['name']."')";
$data=mysql_query($query);
if($data)
{
echo "property submit";
}
else
{
echo mysql_error();
}
}
?>


<br/>



</form>
</div>
</body>
</html>

mproperty.php

<?php
include('topmenu.php');
include('leftmenu.php');
?>
<html>
<body>
<div style="background-color:white;
background-image:url('homeee.jpg');width:1000px;height:500px;
color:orange"/>
<form method="post" enctype="multipart/form-data">
<br/>
Add property
<br/>

Name<input type="text" name="name"/>
</br>
Address<input type="text" name="paddress"/>
<br/>



state <select  name="state">
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from states";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['stateid'].">".$row['statename']."</option>";
}

?>
</select>


</br>
city <select name="city" >
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from city";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['cityid'].">".$row['cityname']."</option>";
}
?>

</select>
<br/>
Property type<select name="ptype" />
<option>...select...</option>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="select * from property_type";
$data=mysql_query($query);
while($row=mysql_fetch_array($data))
{
echo "<option value=".$row['p_id'].">".$row['p_type']."</option>";
}

?>
</select>
</br>

Price<input type="text" name="price"/>
</br>

choose file<input type="file" name="photo"/><br/>
<input type="submit" value="add" name="btn"/>
<br/>
<?php
if(isset($_POST['btn']))
{
move_uploaded_file($_FILES['photo']['tmp_name'],"upload/".$_FILES['photo']['name']);
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$query="insert into property_registration(name,p_address,state_id,city_id,p_type,p_owner,price,photo)values('".$_POST['name']."','".$_POST['paddress']."',".$_POST['state'].",".$_POST['city'].",".$_POST['ptype'].",01,'".$_POST['price']."','".$_FILES['photo']['name']."')";
$data=mysql_query($query);
if($data)
{
echo "property submit";
}
else
{
echo mysql_error();
}
}
?>


<br/>



</form>
</div>
</body>
</html>

Friday, 6 March 2015

<?php
include('topmenu.php');
include('leftmenu.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="ibuyhome.css">
</head>
<body>

<!---<a href="insertsecurityque.php" class="link">For inserting a new user click here</a>--->
</body>
</html>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$row=mysql_query("select * from security_question");
echo "<form method='post'>";
echo "<table border='3px' style='color:white;background:black;width:800px;border-radius:8px;margin-left:200px'>";
echo "<tr style='color:#b22222'>";
echo "<th>Question</th>";
echo "<th>Delete</th>";
echo "<th>Edit</th>";
echo "</tr>";
while($result=mysql_fetch_array($row))
{
echo "<tr>";

echo "<td>".$result['question']."</td>";
echo "<td><a href='delsec.php?id=".$result['security_id']."'onclick=\"return confirm('Are You Sure You Want To Delete')\">Delete</a></td>";
echo "<td><a href='editsec.php?id=".$result['security_id']."'onclick=\"return confirm('Are You Sure You Want To edit')\">Edit</a></td>";

echo "</tr>";
}
echo "<tr>";
echo"<td><input type='text' size='70' name='texttt'/></td>";
echo"<td colspan='2'><input type='submit' value='Add Question' id='butt' name='buttt'/></td>";
echo "</tr>";

echo "</table>";
?>
<?php
if(isset($_POST['buttt']))
{
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');//selecting database
$query="insert into security_question(question)values('".$_POST['texttt']."')";
$data=mysql_query($query);
echo "data inserted";
header('location:managesecurity.php');
}
?>

managesecurity.php

<?php
include('topmenu.php');
include('leftmenu.php');
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="ibuyhome.css">
</head>
<body>

<!---<a href="insertsecurityque.php" class="link">For inserting a new user click here</a>--->
</body>
</html>
<?php
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');
$row=mysql_query("select * from security_question");
echo "<form method='post'>";
echo "<table border='3px' style='color:white;background:black;width:800px;border-radius:8px;margin-left:200px'>";
echo "<tr style='color:#b22222'>";
echo "<th>Question</th>";
echo "<th>Delete</th>";
echo "<th>Edit</th>";
echo "</tr>";
while($result=mysql_fetch_array($row))
{
echo "<tr>";

echo "<td>".$result['question']."</td>";
echo "<td><a href='delsec.php?id=".$result['security_id']."'onclick=\"return confirm('Are You Sure You Want To Delete')\">Delete</a></td>";
echo "<td><a href='editsec.php?id=".$result['security_id']."'onclick=\"return confirm('Are You Sure You Want To edit')\">Edit</a></td>";

echo "</tr>";
}
echo "<tr>";
echo"<td><input type='text' size='70' name='texttt'/></td>";
echo"<td colspan='2'><input type='submit' value='Add Question' id='butt' name='buttt'/></td>";
echo "</tr>";

echo "</table>";
?>
<?php
if(isset($_POST['buttt']))
{
mysql_connect('localhost','root');
mysql_select_db('ibuyhome');//selecting database
$query="insert into security_question(question)values('".$_POST['texttt']."')";
$data=mysql_query($query);
echo "data inserted";
header('location:managesecurity.php');
}
?>