<?php
error_reporting(0);
$this->load->view('header_front');
$this->load->view('security_front');
$can_id = $this->session->userdata('user_id');
$sel_personal_information = mysql_query("select * from njobn_webusers where user_id='".$can_id."'");
$fetch_personal_data = mysql_fetch_array($sel_personal_information);
//count number rows for lookin 
?>

<div class="container main-content">
  <div class="row">
    <div class="col-xs-12 col-sm-12 col-md-8 profile">
      <div class="panel panel-default panel-profile-header">
        <div class="profile-header-bg"></div>
        <div class="profile-header-info">
          <div class="row">
            <div class="col-sm-12 text-center">
              <?php

                            //code for to get web logo
                            foreach ($footer_data1 as $val_profile) {
							$can_image=$val_profile->image;
                            }
                            ?>
              <?php
                                if ($can_image != '') {
                                    ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets/upload/<?php echo $can_image; ?>');" class="profile-photo" id="select_logo" ></div>
              <?php } else {
                        ?>
              <div style="background-image: url('<?php echo base_url(); ?>assets_front/images/JNJUKWebLogo.png');" class="profile-photo" id="select_logo" ></div>
              <?php }
                                ?>
              <?php

                                //code for to show first name and last name

                                foreach ($profile as $val_fname_lname) {

                                    $gre_job = $val_fname_lname->gre_job;

                                    ?>
              <p><?php echo $val_fname_lname->fname . ' ' . $val_fname_lname->lname; ?><br>
                <?php } ?>
                <?php

                            //code for to show email address and and phone

                            foreach ($profile as $val_adress_email_phone) {
                                $address=$val_adress_email_phone->address;
                                $phone=$val_adress_email_phone->phone;
                                $email=$val_adress_email_phone->email;
                                $linkedin=$val_adress_email_phone->linkedin;
                                $facebook=$val_adress_email_phone->facebook;
                                $twitter=$val_adress_email_phone->twitter;
                                $upwork=$val_adress_email_phone->upwork;
                            }
                            ?>
                <?php echo $phone;?>&nbsp; <br>
                <?php echo $email;?>&nbsp;<br>
              </p>
              <span id="newProfilePicLabel" class="new-pic-label"></span>
              <div id="newProfilePicFileHolder"><span class="file-input file-input-new">
                <form name="upload_image" id="upload_image" action="<?php echo base_url(); ?>front_end/upload_companlogo" method="post" enctype="multipart/form-data">
                  <div class="col-sm-8" style="width: 100%;">
                    <button type="submit" style="width: 44%;margin-left: auto;margin-right: auto;" class="btn btn-primary btn-block" name="update">Change Company logo</button>
                  </div>
                  <div class="btn btn-primary btn-file" style="display: none;"> </div>
                  <input type="hidden" name="oldimageprofile" value="<?php echo $can_image; ?>"/>
                  <input type="file" id="image" name="image"/>
                </form>
                </span>
                <!--[if lt IE 10]><br><div class="alert alert-warning"><strong>Note:</strong> Your browser does not support multiple file upload. Try an alternative or more recent browser to access these features.</div><script>jQuery("#profilePhotoFileInput").removeClass('file-loading');</script><![endif]-->
              </div>
            </div>
          </div>
        </div>
      </div>
  
      
      <form name="work" id="profile-form" class="form-horizontal"  method="post" action="<?php echo base_url();?>front_end/add_personal_inforation" onsubmit="return fromwork()">
        <div class="panel panel-default" id="profileBasicinfo">
          <h3>Basic Information</h3>
          <p style="color:#FF0000;"> <?php echo $this->session->flashdata('myprofile_data');?></p>
          <div class="row">
            <div class="col-sm-10 col-sm-push-1">
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-fullname">First Name</label>
                <div class="col-sm-8">
                  <input type="text" value="<?php echo $fetch_personal_data['fname'];?>" name="fname" class="form-control" id="fname" onkeypress="return alphaOnly(event)" placeholder="Subject">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-fullname">Last  Name</label>
                <div class="col-sm-8">
                  <input type="text" name="lname" class="form-control" id="lname" value="<?php echo $fetch_personal_data['lname'];?>"  onkeypress="return alphaOnly(event)" size="width: 380px;" placeholder="Subject">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-email">Email address</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="email" name="email" value="<?php echo $fetch_personal_data['email'];?>" placeholder="Email" onkeypress="return alphaOnly(event)" >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-mobile">Mobile Number</label>
                <div class="col-sm-8">
                  <input type="text" name="phone" class="form-control" value="<?php echo $fetch_personal_data['phone'];?>" id="phone"  placeholder="Phone Number">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-empstatus">Nationailty</label>
                <div class="col-sm-8">
                  <select name="nationailty" class="form-control"id="nationailty">
                    <option value="">Select Nationailty</option>
                    <?php
	$sel_nationalities=mysql_query("select * from nationalities");
	while($fethch_nationalities=mysql_fetch_array($sel_nationalities))
	{
	?>
                    <option value="<?php echo $fethch_nationalities['id'];?>" <?php if($fetch_personal_data['nationailty']==$fethch_nationalities['id']) {?> selected="selected" <?php }?> ><?php echo $fethch_nationalities['name'];?></option>
                    <?php }?>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Linkedin</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="linkedin" name="linkedin" value="<?php echo $fetch_personal_data['linkedin'];?>"  placeholder="https://www.linkedin.com/test">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Facebook</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="facebook" name="facebook" value="<?php echo $fetch_personal_data['facebook'];?>"  placeholder="https://www.facebook.com/Kulachisoft-554490381260844/">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Linkedin</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="linkedin" name="linkedin" value="<?php echo $fetch_personal_data['linkedin'];?>"  placeholder="https://www.linkedin.com/test">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Twitter</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="twitter" name="twitter" value="<?php echo $fetch_personal_data['twitter'];?>"  >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Upwork</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="upwork" name="upwork" value="<?php echo $fetch_personal_data['upwork'];?>"  >
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Address</label>
                <div class="col-sm-8">
                  <input type="text" name="address" class="form-control" id="address" value="<?php echo $fetch_personal_data['address'];?>"  placeholder="Address">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Town/City</label>
                <div class="col-sm-8">
                  <input type="text" name="city" id="city" onkeypress="return alphaOnly(event)" value="<?php echo $fetch_personal_data['city'];?>"  class="form-control" placeholder="Town/City">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Postal Code</label>
                <div class="col-sm-8">
                  <input type="text" name="postcode" id="postcode"  value="<?php echo $fetch_personal_data['postcode'];?>"  class="form-control" placeholder="444000">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-4 control-label" for="profile-birthday">Country</label>
                <div class="col-sm-8">
                  <?php
//get country name
	$sel_countries1=mysql_query("select * from countries where id='".$fetch_personal_data['country']."'");
	$fethch_counries1=mysql_fetch_array($sel_countries1);
?>
                  <select name="country" class="form-control"id="country">
                    <option value="">Select Country</option>
                    <?php
	$sel_countries=mysql_query("select * from countries");
	while($fethch_counries=mysql_fetch_array($sel_countries))
	{
	?>
                    <option value="<?php echo $fethch_counries['id'];?>" <?php if($fetch_personal_data['country']==$fethch_counries['id']) {?> selected="selected" <?php }?> ><?php echo $fethch_counries['name'];?></option>
                    <?php }?>
                  </select>
                </div>
              </div>
              
              <br>
              <div class="form-group">
                <label class="col-sm-4 control-label">&nbsp;</label>
                <div class="col-sm-8">
                  <button type="submit" class="btn btn-primary btn-block" name="update">Update Basic Information</button>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </form>
	  
    </div>
    <!-- sidebar -->
    <?php $this->load->view('frontleftbar'); ?>
    <!-- /.sidebar -->
  </div>
</div>
<!--CONTENT-AREA-->
<!--CONTENT-OUTER-->
</div>
<?php $this->load->view('footer_front'); ?>
