
  
<center> 
  
   <?php
    require_once('superShopNavLink.php');
  ?>
 
  <!--NEW USER REGISTRATION FORM, DISPLAYED BY DEFAULTS IN PAGE LOAD-->


<fieldset id="alt_new_user_reg_form">
<label id="reg_form_tile_label"> Register super shop here </label></p/>
<i>Please fill information below-</i>
<form name="new_user_registration" id="new_user_registration" action="superShopRegFormPro.php"  method="post"  autocomplete="on" enctype="multipart/form-data">

<table border="0" id="reg_form_table">
 
        <input class="hi" type="hidden" name="admin"  value="<?php echo $admin;?>"> 
 
<tr>
	<td  rowspan="2"   valign="bottom">
   

                 <div id="deta" ><img id="image">  </div>
  </td> 
     <td valign="bottom" id="hf"> 

              <label id="mini_label">Choose profile image:<sup>*</sup></label>

              </td>

              
 <td id="reg_form_table_cell" valign="bottom">

<label id="mini_label"  >Owner id:</label>
 <br><sup id="io"></sup>
</td>
</tr>
<tr>
      <td valign="top">

              <input type="file" class="prof_info" name="file" id="file"  onchange="readURL(this);"/>
              <sup id="mg"></sup>
              </td>
 
     <td id="reg_form_table_cell" valign="top">
     
     <input type="text" name="owniD" id="owniD"  id="owniD" class="prof_info" value="<?php echo $ownID;?>"  /><br/>
     
     </td>

     
</tr>
 



<tr> <td colspan="3" id="reg_form_table_cell" valign="bottom">

<label id="main_label"  >Contact Address:</label>
 
</td>
</tr>


<tr>


<td height="40px" valign="top"> <label id="mini_label">Shop name:<sup>*</sup></label><br>

<sup id="hn"></sup></td> 


<td height="40px" valign="top"> <label>E-mail<sup>*</sup></label><br><sup id="em"></sup></td>


<td height="40px" valign="top"><label id="mini_label">Phone Number<sup>*</sup></label>
<br><sup id="p"></sup></td></tr>



<tr>
     
      <td>
     
     <input type="text" name="hname" id="hname" class="prof_info" value="<?php echo $hname;?>"  /><br/>
    

     </td>


     <td id="reg_form_table_cell">
    
    
     <input type="email" name="email" id="email" class="prof_info" value="<?php echo $email;?>" /><br/>
    
    
    </td>
     <td id="reg_form_table_cell">
     
     <input type="text" name="phoneno" id="phoneno" class="prof_info" value="<?php echo $phoneno;?>"  /><br/>
     
     </td>

     
</tr>
 
  <!---USERS PLACE OF BIRTH-->


<tr>
<td colspan="3" id="reg_form_table_cell" valign="bottom">

<label id="main_label">Place/location:</label> 
  
  </td>

</tr>
<tr>
   <td height="40px" valign="top"> <label id="mini_label">P.o.box<sup>optional</sup></label><br/></td>

   <td height="40px" valign="top">  <label id="mini_label">Street/Village<sup>*</sup></label><br><sup id="vs"></sup></td>

   <td height="40px" valign="top">   <label id="mini_label">Ward<sup>*</sup></label><br><sup id="w"></sup> </td>

</tr>




<tr><td id="reg_form_table_cell">

        <input type="text" name="pobox" id="pobox" class="prof_info" value="<?php echo $pobox;?>" /><br/>
       
    </td>
    <td id="reg_form_table_cell">

    
        <input type="text" name="street" id="street" class="prof_info" value="<?php echo $street;?>"  /><br/>
        
    </td>

    <td id="reg_form_table_cell">

    
        <input type="text" name="ward" id="ward" class="prof_info" value="<?php echo $ward;?>"  /><br/>
      
    </td>

    

<tr>
   <td height="40px" valign="top"> <label id="mini_label">Town/District<sup>*</sup></label> <br><sup id="ds"></sup></td>


   <td height="40px" valign="top">    <label id="mini_label">City/Region<sup>*</sup></label> <br><sup id="r"></sup></td>


   <td height="40px" valign="top"> <label id="mini_label">Country<sup>*</sup></label><br><sup id="c"></sup> </td>

</tr>



    <tr>


    <td id="reg_form_table_cell">
       
        <input type="text" name="district" id="district" class="prof_info" value="<?php echo $district;?>"  /><br/>
         
    </td>
    <td id="reg_form_table_cell">

   
        <input type="text" name="region" id="region" class="prof_info" value="<?php echo $region;?>"  /><br/>
      
    </td>

    <td id="reg_form_table_cell">

    
        <input type="text" name="country" id="country" class="prof_info" value="<?php echo $country;?>"  /><br/>
        
    </td>
</tr>


<tr>

         <td   height="150px"   align="left" valign="top"> 

           <label id="mini_label">Category:</label><br><sup id="ctc"></sup> <br>
        
        <select name="category" id="category" class="prof_info">
            
           
          <option value="">Select</option>
          
        
          
          <option value="Sound system">Sound system</option>
          <option value="Smart phone">Smart phone</option>
          <option value="Power generator">Power generator</option>
          <option value="Water pump generator">Water pump generator</option>
          <option value="Television">Television</option>
          <option value="Laptop computer">Laptop computer</option>
          <option value="Ipad">Ipad</option>
          <option value="Desktop computer">Desktop computer</option>
          <option value="Office and Stationary">Office and Stationary</option>
          <option value="Printers">Printers</option>
          <option value="Camera">Camera</option>
          <option value="Printer cartridge">Printer Cartridge</option> 
          <option value="Video Camera">Video Camera </option>
          <option value="Laminator Office">Laminator Office</option>
          <option value="Agrochemical Fertilizers">Agrochemical</option>
          <option value="Agro seeds">Agro seeds</option>
        </select>

        
 
          
        </td>
          <td colspan="2" height="150px" valign="bottom" align="right"> 

           <label id="mini_label">The nearset popular place name:</label><br><sup id="o"></sup> <br>
        
        <input type="text" name="popularDistination" id="popularDistination" class="prof_infp" value="<?php echo $popularDistination;?>"  />

        <p/>

        <input type="submit"  name="submit" value="Submit" id="subownreg"/>
          
        </td>

         
           
  </tr>
 

<!----PLACE OF BIRTH, AND PROFILE GENDER 

 -->
 

 </table>
 
</form>
</fieldset>

 

<script>
   document.getElementById("file").onchange = function () {
    var reader = new FileReader();

    reader.onload = function (e) {
        // get loaded data and render thumbnail.
        document.getElementById("image").src = e.target.result;
    };

    // read the image file as a data URL.
    reader.readAsDataURL(this.files[0]);
}
$(document).ready(function(){
  
$("#new_user_registration").on('submit',function(e){
  var floc= document.getElementById('file').value 
  var nV =/[a-z\s]/i;
    var j=0,k=0, g=0,i=0;
if (floc=="") 
    {
   e.preventDefault();
    document.getElementById('mg').innerHTML="Image file is required!..";
    }
    else
    {

    document.getElementById('mg').innerHTML="";
    }
 
//$.trim(lname);
var ownID =document.getElementById('owniD').value;
$.trim(ownID);
var street =document.getElementById('street').value;
$.trim(street);
var email =document.getElementById('email').value;
$.trim(email);
var ward =document.getElementById('ward').value;
$.trim(ward);
var district =document.getElementById('district').value;
$.trim(district);
var region =document.getElementById('region').value;
$.trim(region);

var category =document.getElementById('category').value;
$.trim(category);
 var country =document.getElementById('country').value;
$.trim(country);
var phoneno =document.getElementById('phoneno').value;
$.trim(phoneno);
var popularDistination =document.getElementById('popularDistination').value;
$.trim(popularDistination);
var hname =document.getElementById('hname').value;
$.trim(hname);
 


var vN =/[\(A-Za-z)]/g; 
var iN =/[\(A-Za-z0-9)]/g; 
var cN =/[\(A-Za-z0-9\s)]/g;
var nV =/[a-z\s]/i;
  var j=0,k=0, g=0,i=0;

                                                         //FIRST NAME VALIDATION
 


 
                                                                            ///STREET VALIDATION

if(category==""){
 e.preventDefault();

document.getElementById('ctc').innerHTML="Category required!..";
 

 }
 else{

      for(i=0;i<category.length;i++)
       {
         if(!category[i].match(cN))
          {
             j++;

           }
        }
      
       if(j>0){
       e.preventDefault();
   
        document.getElementById('ctc').innerHTML="Invalid category"; 
              }
         else{
 
        document.getElementById('ctc').innerHTML="";

              }
   }
 
    j=0, i=0;


 
if(ownID==""){
 e.preventDefault();

document.getElementById('io').innerHTML="Owner id required!..";
 

 }
 else{

      for(i=0;i<ownID.length;i++)
       {
         if(!ownID[i].match(iN))
          {
             j++;

           }
        }
      
       if(j>0){
       e.preventDefault();
   
        document.getElementById('oi').innerHTML="Invalid id"; 
              }
         else{
 
        document.getElementById('io').innerHTML="";

              }
   }
 
    j=0, i=0;
              
if(street==""){
 e.preventDefault();

document.getElementById('vs').innerHTML="Street is required!..";
 

 }
 else{

      for(i=0;i<street.length;i++)
       {
         if(!street[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
       e.preventDefault();
   
        document.getElementById('vs').innerHTML="Invalid name"; 
              }
         else{
 
        document.getElementById('vs').innerHTML="";

              }
   }
 
    j=0, i=0;
               
 


                                                    //EMAIL VALIDATION


 
var mail=/[\(A-Za-z)][\w.]\w+@\w+\.(net|com|edu)/;
if(email==""){
 e.preventDefault();
document.getElementById('em').innerHTML="E-mail address is required!..";
 

             }
 else{
  
         if(!email.match(mail))
          {
          
        e.preventDefault();
        document.getElementById('em').innerHTML="Invalid email"; 
              }
         else{ 
        document.getElementById('em').innerHTML="";

              }
   }
 
   
            
  


                                                                            ///WARD VALIDATION

if(ward==""){
e.preventDefault();
document.getElementById('w').innerHTML="Ward is required!..";
 

           }
  else{
 for(i=0;i<ward.length;i++)
       {
         if(!ward[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('w').innerHTML="Invalid ward name"; 
              }
         else{ 
        document.getElementById('w').innerHTML="";

              }
   }
 
    j=0, i=0;
                                                                            ///DISTRICT VALIDATION



if(district==""){
e.preventDefault();
document.getElementById('ds').innerHTML="District is required!..";
 
          }
 else{

     for(i=0;i<district.length;i++)
       {
         if(!district[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('ds').innerHTML="Invalid district name"; 
              }
         else{ 
        document.getElementById('ds').innerHTML="";

              }
   }
 
    j=0, i=0;                     


                                                                  ///REGION VALIDATION

if(region==""){
e.preventDefault();
document.getElementById('r').innerHTML="Region is required!..";
              }
 else{
 for(i=0;i<region.length;i++)
       {
         if(!region[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('r').innerHTML="Invalid region  name"; 
              }
         else{ 
        document.getElementById('r').innerHTML="";

              }
   }
 
    j=0, i=0;
                                                                ///COUNTRY VALIDATION

 
if(country==""){
e.preventDefault();
document.getElementById('c').innerHTML="Country is required!..";
 

               }
 else{

    for(i=0;i<country.length;i++)
       {
         if(!country[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('c').innerHTML="Invalid name"; 
              }
         else{ 
        document.getElementById('c').innerHTML="";

              }
   }
 
    j=0, i=0;                                                                        


     ///PHONE NUMBER VALIDATION

 var phn =/[\(0-9)]{12}/;
   
if(phoneno==""){
e.preventDefault();
document.getElementById('p').innerHTML="Phone is required valid one!..";
 

              }
 else{ 
       
         if(!phoneno.match(phn))
          {
             
        e.preventDefault();
        document.getElementById('p').innerHTML="Invalid phone"; 
              
          }
        
         else if(phoneno.length>12)
         {
        e.preventDefault();
        document.getElementById('p').innerHTML="Valid phone number must contain 12 digits.."; 
              

         }

         else
         {

        document.getElementById('p').innerHTML="";

        }
   }
 
    j=0, i=0; 





if(popularDistination =="")
{
e.preventDefault();
document.getElementById('o').innerHTML= "Popular destination required is required!..";
 
}
 else{

     for(i=0;i<popularDistination.length;i++)
       {
         if(!popularDistination[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('o').innerHTML="You typed popular destination with error"; 
              }
         else{

        document.getElementById('o').innerHTML="";

              }
   }
 
    j=0, i=0;

if(hname =="")
{
e.preventDefault();
document.getElementById('hn').innerHTML= "Hotel name is required!..";
 
}
 else{

     for(i=0;i<hname.length;i++)
       {
         if(!hname[i].match(nV))
          {
             j++;

           }
        }
      
       if(j>0){
        e.preventDefault();
        document.getElementById('hn').innerHTML="You typed hotel name with error"; 
              }
         else{

        document.getElementById('hn').innerHTML="";

              }
   }
 
    j=0, i=0; 
                                                               /// GENGER VALIDATION
 
  
}
);
}
);  
    
</script>

 