Monday 30 January 2017

empform


<!DOCTYPE html>
<html>
<head>
<title>Empform</title>
<style type="text/css">
      #myForm label.error
      {
        margin-left: 10px;
        width: auto;
        display: inline;
        color: red;
     }</style>
</head>
<body>
<form method="post" name="myForm" id="myForm" enctype="multipart/form-data">
<div align="right">
<table>
<tr>
    <td>
        <span style="text-transform:capitalize;">Welcome
        <?php echo $this->session->userdata('username');?>
        </span>
    </td>
    <td></td>  
    <td>
    <a href="<?php echo base_url();?>emp/fetch">View</a>
    </td>
</tr>
</table>
</div>
<fieldset>
  <div align="center">
    <table>
    <tr>
    <td>Username</td>
    <td>
       <input type="text" id="username" name="username" onkeyup="nospaces(this)" />
    </tr>
    <tr>
    <td>Password</td>
    <td><input type="text" id="password" name="password" class="text"></td>
    </tr>
    <tr>
    <td>CnfPassword</td>
    <td><input type="text" name="confirm_password" id="confirm_password" class="text"></td>
    </tr>
    <tr>
    <td>Address</td>
    <td><input type="text" id="address" name="address" class="text"></td>
    </tr>
    <tr>
    <td>Contact</td>
    <td><input type="text" id="contact" name="contact" class="text"></td>
    </tr>
    <tr>
    <td>Email</td>
    <td><input type="text" name="email"  id="email" class="text"></td>
    </tr>
    <tr>
    <td>Gender</td>
    <td ><input type="radio" id="gender" name="gender" checked="checked" value="male">Male
    <input type="radio" name="gender" id="gender" value="female">Female</td>
    </tr>
    <tr>
    <td>City:</td>
    <td>
    <select name="city" id="city" class="text">
        <option hidden="">Choose city</option>
        <option value="surat">Surat</option>
        <option value="nadiad">Nadiad</option>
        <option value="Baroda">Baroda</option>
    </select>
    </td>
    </tr>
    <tr><td>Hobby</td>
        <td>
       <input type="checkbox"  name="hobby[]"  value="teniss"/>teniss
            <input type="checkbox" name="hobby[]" value="football"/>football
            <input type="checkbox" name="hobby[]" value="cricket"/>cricket
          </td>
    </tr>
    <tr>
      <td colspan="2" align="center">
      <input type="button" value="submit" id="submit">
      </td></tr>
    </table>
  </div>
</fieldset>
<fieldset>

  <input type="button" value="listview" id="listview">

</fieldset>
</form>

<form method="post" name="upd_myForm" id="upd_myForm">

  <div id="dataall">
 </div>
 </form>

<script type="text/javascript" src="<?php echo base_url();?>public/assets/js/jquery-2.2.3.min.js">
</script>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/jquery.validate.js"></script>


<!--Start show update data with textbox-->
<script type="text/javascript">
  function update(id)
  {
       alert(id);
        $("#row_"+ id).hide();
        $("#input_row_"+id).show();
   }
</script>
<!--End show update data with textbox-->


<script type="text/javascript">
$("#listview").click(function()
{
 //  alert('btn clicked');
         var url1=  "<?php echo base_url().'emp/getvalues'?>";
         var form = $("#dataall").serialize();
        $.ajax({
        type:"POST",
        url: url1,
        data: form,
        success: function (data)
         {//alert(data);
             $('#dataall').html(data);
          }
     });
});
</script>


<!-- start for insert data with ajax -->
<script type="text/javascript">
$("#submit").click(function()
{
   //alert('btn clicked');
   var url1=  "<?php echo base_url().'emp/ajx_test'?>";
   var form = $("#myForm").serialize();
  //  alert(form);
    $.ajax({
     
    type:"POST",
    url: url1,
    data: form,
    success: function (data)
     {
      //  alert(success);
        //$('.sort').append(data);
        //window.location.reload();},
      }
    });
});
</script>
<!-- End for insert data with ajax -->

<!-- start Validation with Jquery -->
<script type="text/javascript">

    function nospaces(t)//username space not allowed
     {
       if(t.value.match(/\s/g)){
            t.value=t.value.replace(/\s/g,'');
        }
    }

$(document).ready(function()
 {   // alert('vickerer');

    $("#myForm").validate({
            rules:
            {  
                username: {
                    required: true,
                    minlength: 2,
                    remote:{
                         type: "POST",
                         url:"<?php echo base_url().'emp/check_username_availablity'?>",
                         data: { username : function(){
                            return $("#username").val();
                         }
                       }
                    }
                },
                password: {
                    required: true,
                    minlength: 5
                },
                confirm_password: {
                    required: true,
                    minlength: 5,
                    equalTo: "#password"
                },
                address: {
                    required: true,
                   },
                contact: {
                    required: true,
                    minlength:10,
                   },
               
                email: {
                    required: true,
                    email: true
                },  
   
            },
            messages: {
               
                username:  {
                    required: "Please provide a username",
                    minlength: "Your username must be at least 2 characters long",
                    remote:"already exists"
                },
                password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 5 characters long"
                },
                confirm_password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 5 characters long",
                    equalTo: "Please enter the same password as above"
                },
                email: "Please enter a valid email address",
                address:"Please enter address",

                contact:
                {
                    required:"Please enter contact Number",
                     minlength: "Your Contact must be at least 10 Number long"
                }
               
            }
        });
})

</script>
<!-- End Validation with Jquery -->

<!-- start Validation with Jquery -->
<script type="text/javascript">

var baseeee='<?php echo base_url().'emp/check_username_for_update'?>';

$("#upd_myForm").validate({
            rules:
            {  
                upd_username: {
                required: true,
                remote: {
                  url: baseeee,
                  type: "post",
                  data: { uname: function() {
                    return $( "#upd_username" ).val();
                  } }
                }

              },
                password: {
                    required: true,
                    minlength: 5
                },
                confirm_password: {
                    required: true,
                    minlength: 5,
                    equalTo: "#password"
                },
                address: {
                    required: true,
                   },
                contact: {
                    required: true,
                    minlength:10,
                   },
               
                email: {
                    required: true,
                    email: true
                },  
   
            },
            messages: {
               
                upd_username:  {
                    minlength: "Your username must be at least 2 characters long",
                    remote: "already existbbbbbbbbbbbbbbs"
                },
                password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 5 characters long"
                },
                confirm_password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 5 characters long",
                    equalTo: "Please enter the same password as above"
                },
                email: "Please enter a valid email address",
                address:"Please enter address",

                contact:
                {
                    required:"Please enter contact Number",
                     minlength: "Your Contact must be at least 10 Number long"
                }
               
            }
        });



$(document ).ready(function()
 {  // alert('vickerer');

   
});

</script>
<!-- End Validation with Jquery -->

<!--
<script>
function loadDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("dataall").innerHTML =
      this.responseText;
    }
  };
  xhttp.open("GET", "ajax_info.txt", true);
  xhttp.send();
}
</script>
 -->

</body>
</html>

display

<!DOCTYPE html>
<html>
<head>
  <title>View</title>

<script type="text/javascript">
checked=false;
function checkedAll(frm1)
{
var aa=document.getElementById('frm1');
if(checked==false)
{
checked =true
}
else
{
checked =false
}
for(var i=0;i < aa.elements.length;i++)
{
aa.elements[i].checked=checked;
}
}
</script>

</head>
<body>

<form method="post" action="<?php echo base_url();?>emp/search">
<div align="right" class="search">
<input type="text" name="search" placeholder="Username" />
<input type="submit" value="search" />
</div>
</form>

<form method="post" enctype="multipart/form-data" action="<?php echo base_url();?>emp/delete_all
 " id="frm1">

<table>
<tr><a href="<?php echo base_url();?>emp">Insert Data</a></tr>
</table>

<table  border="1" style="background-color:#">
<tr>
 <th><input type="checkbox" name="id[]" onclick="checkedAll(frm1);"/></th>
<td>Id</td>
<td>Username</td>
<td>Password</td>
<td>Address</td>
<td>Contact</td>
<td>Email</td>
<td>gender</td>
<td>Image</td>
<td>city</td>
<td>Hobby</td>
<td colspan="2" align="center">Action</td>
</tr>

<?php
if($result)
{
$no=1;
foreach($result as $row)
{
?>  <tr>
<td><input type="checkbox" name="id[]" value="<?php echo $row->id;?>"></td>
     <td><?php echo $no; $row->id;?></td>
   <td><?php echo $row->username;?></td>
   <td><?php echo $row->password;?></td>
   <td><?php echo $row->address?></td>
   <td><?php echo $row->contact;?></td>
   <td><?php echo $row->email;?></td>
   <td><?php echo $row->gender;?></td>
   <td>
   <?php
     $path=explode(",",$row->images);
 $i=count($path);
 $file_path ='upload/';
 for($j=0;$j<$i;$j++)
 {
    $src=$file_path.$path[$j];
   ?>

 <img src="<?php echo base_url();?>/<?php echo $src;?>" width="50" height="50" title="<?php echo $row->images;?>"/>

<!-- <a href='<?php echo base_url();?>emp/delete_single/<?php echo $src."/".$row->id;?>'>Delete</a>
-->

        <!--     <a href="<?php echo base_url();?>emp/delete_single/<?php echo $row->id;?>/<?php echo $row->images;?>">Delete</a>
         -->

 <a href='<?php echo base_url();?>emp/delete_single/<?php echo $row->id."/".$path[$j];  ?>'>Delete</a>
 
 <?php
 }
    ?>
</td>

   <td><?php echo $row->city;?></td>

 <td><?php echo $row->hobby;?></td>
 
<td>
<a href="<?php echo base_url();?>emp/delete/<?php echo $row->id;?>">Delete</a></td>
 
    <td><a href="<?php echo base_url();?>emp/edit/<?php echo $row->id;?>">Update</a></td>

   </tr>
   <?php
   $no++;
}
}
?>
 <tr><td align="left" colspan="13">
   <input type="submit" value="Delete All" /></td></tr>

</table>

<div class="pgin">
<?php echo $link;?>
</div>
</body>
</html>

dbemp

<?php
class dbemp extends CI_model
{
function insert($y)
{
$this->db->insert('registration', $y);
}
    public function check_username_availablity()
    {
        $username = trim($this->input->post('username'));
        $username = strtolower($username);

        $query = $this->db->query("SELECT * FROM registration WHERE username='$username'");
        if($query->num_rows() > 0)
            return false;
        else
            return true;
    }
 

    function getcount()
    {
        return $this->db->count_all('registration');
    }

    function get_all_classes($eid)
    {

        $this->db->where('id',$eid);

        $query = $this->db->get('registration');

        if($query->result())
        {
            $result = $query->result();

            foreach($result as $row)
            {
                $options[$row->id] = $row->username;
            }  
            return $options;
        }
    }
   
function getalldata($offset,$start)
{
$sql="select * from registration where id LIMIT ".$start.",".$offset." ";
$res=$this->db->query($sql);
return $res->result();
}
   
    function getsearch()
    {
        $match=$this->input->post('search');
       
        $res=$this->db->query("select * from registration where(username like'%".$match."%')");
        return $res->result();
    }
    /*
    function getdelete($id)
    {
        $sql="Select *from registration where id='".$id."'";
        $res=$this->db->query($sql);
        return $res->row();
    }*/

      function getAll()
      {
        $query=$this->db->query("SELECT * FROM registration");

         return $query->result();
        //returns from this string in the db, converts it into an array
      }



    function deleteimg($id)
    {
        $sql=$this->db->query("select * from registration where id='".$id."'");
        return $sql->row();
    }
    function delete($id)
    {
        $this->db->where('id',$id);
        $this->db->delete('registration');
    }

    function delete_all($id)
    {
        $this->db->where('id',$id);
        $this->db->delete('registration');
    }

}
?>

emp

<?php

class emp extends CI_controller
{
function __construct()
{
parent::__construct();
$this->load->model('dbemp');
$this->load->library('upload');
$this->load->library('pagination');

}

function index()
{
$this->load->view('empform');
}

public function check_username_availablity()
{
//print_r('rakes');
// $get_result = $this->dbemp->check_username_availablity();
     $username = $_POST['username'];
     // echo "false";
 $query = $this->db->query("SELECT username FROM registration WHERE username='$username'")->num_rows();
     if($query>0 )
            echo "false";

        else
            echo "true";
    }

public function check_username_for_update()
{
//echo "false";
// print_r($_POST);
    //  die();
   
    //$username = $_POST['upd_username'];
    $username = 'vinod';
     // echo "false";
 $username_db = $this->db->query("SELECT username FROM registration")->result_array();
 
 $statuts = 1;

  foreach ($username_db as $value)
  {
//echo "<pre>";
// print_r($value['username']);

echo "<pre>";
// print_r($username);

echo "Data base ".$value['username']."<br>";
echo "user ".$username."<br>";

if($username == $value['username'])
     {
       //echo " true";
       $statuts=0;
     }
else
 {
   //echo "false";
      }
  }
        echo "status ".$statuts;

}

function set_upload()
{
$config = array();
         $config['upload_path'] = 'upload/';
         $config['allowed_types'] = 'png|jpg|jpeg|gif';
         $config['max_size'] = '0';
         $config['overwrite'] = FALSE;
 
  return $config;
}

function insertdata()
{
//echo "array value";
// print_r($_POST);

$insert=array('username'=>$_POST['username'],
'password'=>$_POST['password'],
'address'=>$_POST['address'],
'contact'=>$_POST['contact'],
'email'=>$_POST['email'],
'gender'=>$_POST['gender'],
//'images'=>$img_file,
'city'=>$_POST['city'],
  'hobby'=>implode(",",$_POST['hobby']));

 $this->dbemp->insert($insert);

}


function getvalues()
{

echo "<h1>hello</h1><br>";
$this->load->model('dbemp');
    $data['result'] = $this->dbemp->getAll();
//    $this->load->view('empform',$data);

echo "<table border=1>";
echo "<th>id</th>";
echo "<th>Username</th>";
echo "<th>Password</th>";
echo "<th>Address</th>";
echo "<th>Contact</th>";
echo "<th>Email</th>";
echo "<th>Gender</th>";
echo "<th>City</th>";
echo "<th>Hobby</th>";
echo "<th colspan=2 >Action</th>";

$no=1;
$username_db = $this->db->query("SELECT username FROM registration")->result_array();
//echo $username_db[0]['username'];
//print_r($username_db);
    foreach($data['result'] as $row)
     {
   ?>
    <tr id="row_<?php echo $row->id;?>">
        <td><?php echo $no; $row->id;?></td>
        <td><?php echo $row->username;?></td>
        <td><?php echo $row->password;?></td>
        <td><?php echo $row->address?></td>
        <td><?php echo $row->contact;?></td>
        <td><?php echo $row->email;?></td>
        <td><?php echo $row->gender;?></td>
        <td><?php echo $row->city;?></td>
        <td><?php echo $row->hobby;?></td>
         <td>
<a href="<?php echo base_url();?>emp/delete/<?php echo $row->id;?>">Delete</a></td>
 
<td><a href="javascript:void()"onclick="update('<?php echo $row->id;?>');">Update</a></td>

        </tr>
         <tr style="display:none;" id="input_row_<?php echo $row->id;?>">

     
        <td><?php echo $no; $row->id;?></td>
     <td><input type="text" name="upd_username" id="upd_username" value="<?php echo $row->username;?>">
    <input type="hidden" name="upd_username1" id="upd_username1" value="<?php echo $row->username;?>">
     </td>
        <td><input type="text" name="password" id="password" value="<?php echo $row->password;?>"></td>
        <td><input type="text" name="address" id="address" value="<?php echo $row->address;?>"></td>
        <td><input type="text" name="contact" id="contact" value="<?php echo $row->contact;?>"></td>
        <td><input type="text" name="email" id="email" value="<?php echo $row->email;?>"></td>
        <td><input type="text" name="gender" id="gender" value="<?php echo $row->gender;?>"></td>
        <td><input type="text" name="city" id="city" value="<?php echo $row->city;?>"></td>
        <td><input type="text" name="hobby" id="hobby" value="<?php echo $row->hobby;?>"></td>
         <td>
<a href="<?php echo base_url();?>emp/delete/<?php echo $row->id;?>">Delete</a></td>
 
<td><a href="<?php echo base_url();?>emp/<?php echo $row->id;?>" onclick="update('<?php echo $row->id;?>');" >Update</a>
</td>
<td><input type="submit" name="submit" id="submit" value="update"></td>
     

        </tr>
       
        <?php
        $no++;
         }
     echo "</table>";


    return $data;
}

    function fetch()
{
$config['base_url']= base_url()."emp/fetch";
$config['total_rows']=$this->dbemp->getcount();
$config['per_page']=3;
$config['uri_segment']=3;

$this->pagination->initialize($config);
$page=($this->uri->segment(3))? $this->uri->segment(3):0;
$data['result']=$this->dbemp->getalldata($config["per_page"],$page);
$data['link']=$this->pagination->create_links();
$this->load->view('display',$data);

}

function search()
{
$config['base_url']= base_url()."emp/fetch";
$config['total_rows']=$this->dbemp->getcount();
$config['per_page']=3;

$config['uri_segment']=3;

$this->pagination->initialize($config);

$page=($this->uri->segment(3))? $this->uri->segment(3):0;

$data['result']=$this->dbemp->getsearch($config["per_page"],$page);
$data['link']=$this->pagination->create_links();
//$data['result']=$this->dbemp->getsearch();
$this->load->view('display',$data);
}

function delete($id)
{

$qur="select * from registration where id=".$id;
$res=$this->db->query($qur)->result_array();


echo "<pre>";
print_r($res);
echo "</pre>";


$img_array=explode(',', $res[0]['images']);


echo "<pre>";
print_r($img_array);
echo "</pre>";

foreach ($img_array as $img) {
unlink("upload/".$img);
}


$this->db->query("delete from registration where id=".$id);

//$abc=$this->dbemp->deleteimg($id);
//unlink("upload/".$abc->images);

//$this->dbemp->delete($id);
redirect('emp/fetch');
}

function delete_single($id,$image)
{ //for one image delete from one user's multiple delete folder..
unlink("upload/" .$image);

$qur=$this->db->query("select * from registration where id=".$id)->row_array();

$arysss=explode(',', $qur['images']);
$namee=$image;
$arysss = array_diff($arysss, array($namee));
$string = implode(',', $arysss);

$data = array('images'=>$string);

  $this->db->where('id',$id);
$this->db->update('registration',$data);
redirect('emp/fetch');
}

function delete_all()
{
foreach($_POST['id'] as $id)
{
$this->dbemp->delete($id);

}
redirect('emp/fetch');


}


}

?>

Sunday 29 January 2017

dbabc

<?php
class dbabc extends CI_Model
{
function insertwww($abcd)
{
$this->db->insert('register',$abcd);
}

function getalldata()
{
$sql=$this->db->get('register');
return $sql->result();
}
function getsearch()
{
$match=$this->input->post('search');
$sql="select *from register where(username like'%".$match."%')";
$res=$this->db->query($sql);
return $res->result();

}
function getedit($i)
{
$sql=$this->db->query("select *from register where signup_id=$i");
return $sql->row();
}
   
function deleteimg($i)
{
$sql=$this->db->query("select *from register where signup_id=$i");
return $sql->row();
}


function update($abc,$id)
{
$this->db->where('signup_id',$id);
$this->db->update('register',$abc);
}
function delete($id)
{
$this->db->where('signup_id',$id);
$this->db->delete('register');
}
}
?>

abc

<?php
class abc extends CI_controller
{
function __construct()
{
parent::__construct();
$this->load->model('dbabc');

$login=$this->session->userdata('username');

if($login=='')
{
redirect('login');
}

}
function index()
{
$this->form_validation->set_rules('username','Name','required|alpha');
$this->form_validation->set_rules('password','Name','required');
$this->form_validation->set_rules('address','Name','required');
$this->form_validation->set_rules('contact','Name','required|is_numeric|min_length[10]|max_length[10]');
$this->form_validation->set_rules('email','Name','required|valid_email');
$this->form_validation->set_rules('gender','Name','required');
$this->form_validation->set_rules('city','Name','required');
$this->form_validation->set_rules('hobby','Name','required');

if($this->form_validation->run()==false)
{
 $this->load->view('form');
}
else
{
$abc['upload_path']='upload';
$abc['allowed_types']='png|jpg|jpeg|gif';
$this->load->library('upload',$abc);
if(!$this->upload->do_upload('image'))
{
$file="";
}
else
{
$file=$this->upload->file_name;
}

$abc=array('username'=>$_POST['username'],
'password'=>$_POST['password'],
'address'=>$_POST['address'],
'contact'=>$_POST['contact'],
'email'=>$_POST['email'],
'gender'=>$_POST['gender'],
'city'=>implode(',',$_POST['city']),
'hobby'=>implode(",",$_POST['hobby']),
'image'=>$file);
$this->dbabc->insertwww($abc);
redirect('abc/view');
}
}
function view()
{
$data['result']=$this->dbabc->getalldata();
$this->load->view('view',$data);
}
function search()
{
$data['result']=$this->dbabc->getsearch();
 $this->load->view('view',$data);
}
function delete($id)
{
$abc=$this->dbabc->deleteimg($id);
unlink("upload/".$abc->image);

$this->dbabc->delete($id);
redirect('abc/view');
}
function edit($a)
{
if($a=='')
{
redirect('abc/view');
}
$this->form_validation->set_rules('username','Name','required');
$this->form_validation->set_rules('password','Name','required');
$this->form_validation->set_rules('address','Name','required');
$this->form_validation->set_rules('contact','Name','required|is_numeric|min_length[10]|max_length[10]');
$this->form_validation->set_rules('email','Name','required|valid_email');
$this->form_validation->set_rules('gender','Name','required');
$this->form_validation->set_rules('city','Name','required');
$this->form_validation->set_rules('hobby','Name','required');

if($this->form_validation->run()==false)
{
$data['aaa']=$a;
   $this->load->view('edit',$data);
}
else
{
$abc['upload_path']='upload';
$abc['allowed_types']='png|jpg|jpeg|gif';

       $this->load->library('upload',$abc);
if(!$this->upload->do_upload('image'))
{
$file=$_POST['old_image'];
}
else
{
$file=$this->upload->file_name;
}
$abc=array('username'=>$_POST['username'],'password'=>$_POST['password'],'address'=>$_POST['address'],'contact'=>$_POST['contact'],'email'=>$_POST['email'],'gender'=>$_POST['gender'],'city'=>implode(',',$_POST['city']),'hobby'=>implode(",",$_POST['hobby']),'image'=>$file);
$this->dbabc->update($abc,$a);
redirect('abc/view');
}
}

}

?>

form

<style>
.success
{
color:#0F0;
}
</style>

<?php $this->load->view('header');?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body bgcolor="#999999">


<div align="" class="top">

<fieldset>

<div class="head">
<div class="heading"><span style="text-align:left;">Signp Now</span></div>
<div class="link" ><a href="<?php echo base_url();?>index.php/abc/view">View</a>

</div>
</div>

<div align="center">

<form method="post" enctype="multipart/form-data">

<table>
<tr>
<td>Username</td>
<td><input type="text" name="username" class="text"></td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('username');?></td>
</tr>

<tr>
<td>Password</td>
<td><input type="text" name="password" class="text"></td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('password');?></td>
</tr>


<tr>
<td>Address</td>
<td><input type="text" name="address" class="text"></td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('address');?></td>
</tr>


<tr>
<td>Contact</td>
<td><input type="text" name="contact" class="text"></td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('contact');?></td>
</tr>


<tr>
<td>Email</td>
<td><input type="text" name="email" class="text"></td>
</tr>


<tr>
<td></td>
<td><?php echo form_error('email');?></td>
</tr>
<tr>
<td>Image</td>
<td><input type="file" name="image"></td>
</tr>

<tr>
<td>Gender</td>
<td ><input type="radio" name="gender" value="male">Male
<input type="radio" name="gender" value="female">Female</td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('gender');?></td>
</tr>


<tr>
<td>City:</td>
<td>
<select name="city[]" multiple="multiple" class="text">
<option hidden="">Choose city</option>
<option value="surat">Surat</option>
<option value="nadiad">Nadiad</option>
<option value="Baroda">Baroda</option>

</select>
</td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('city');?></td>
</tr>

<tr>
<td>Hobby</td>
<td><input type="checkbox" name="hobby[]" value="cricket">cricket
<input type="checkbox" name="hobby[]" value="tennis">tennis
<input type="checkbox" name="hobby[]" value="football">footbol</td>
</tr>

<tr>
<td></td>
<td><?php echo form_error('hobby');?></td>
</tr>



<tr>
<td colspan="2" align="center"><input type="submit" class="but">
<input type="reset" class="but"></td>
</tr>

</table>
</form>
</div>

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


<?php $this->load->view('footer');?>