<!DOCTYPE html>
<html>
  <?php
  $this->load->view('template/header_script');

   $Currency = getCurrency();
  

  ?>

  <style>
    .profile_div{
        width:100%;
        text-align: center;
        padding-top:0px;
        padding-bottom: 30px;

    }

    .profile_circle{
        width:120px;
        height:120px;
        border-radius: 50%;
        background-color: #a8a8a8;
        margin: 0 auto;
        position: relative;
    }
    .profile_circle img{
        width:100%;
        height:100%;
        border-radius: 50%;
        object-position: center;
        object-fit: cover;
    }
    .profile_circle input{
        position: absolute;
        top:0px;
        left:0px;
        right:0px;
        bottom: 0px;
        opacity: 0;
    }
</style>
<body class="bg-dark">
<div class="sufee-login d-flex align-content-center flex-wrap">
        <div class="container">
            <div class="login-content">
                <div class="login-logo">

                    <a href="index.html">

                      <label><h1>POS Registration</h1></label>
                    </a>
                </div>
                <div class="login-form">
                  <?php 
        $url = (isset($Pos_id)||!empty($Pos_id))
        ?'Registration_request/updatePos/'.$Pos_id:'';
        if($this->session->flashdata('message')) { 
        $flashdata = $this->session->flashdata('message'); ?>
          <div class="alert alert-<?= $flashdata['class'] ?>">
            <button class="close" data-dismiss="alert" type="button">×</button>
            <?= $flashdata['message'] ?>
          </div>
          <?php } ?>
          <form role="form" action="<?= base_url($url) ?>" method="post" class="validate" data-parsley-validate="" enctype="multipart/form-data">
            <div class="profile_div">
                <div class="profile_circle">
                      <?php $req = (!isset($Pos_id)||empty($Pos_id))
                  ?'form-control required':'form-control';?>
                      <img id="image_id_1" src="<?= (isset($PosData->profile_photo))?base_url($PosData->profile_photo):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" />
                        <input name="profile_image" type="file" accept="image/*" onchange="setImg(this,'image_id_1');" class="<?= base_url($req) ?>"/>

                </div>
            </div>
                        <div class="form-group">
                            <label>User Name</label>
                           <input type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="name" placeholder="Enter Name" class="form-control required" value="<?= (isset($PosData->name))?$PosData->name:'' ?>" >
                        </div>
                    <div class="form-group">
                    <div class="row">
                    <div class="col-md-3">
                    <label for="nf-email" class=" form-control-label">Code</label>
  <select name="phone_code" id="selectSm" class="form-control required">
                        <option value="">Code</option>    
                        <?php foreach($Currency as $crny) { ?> 
                        <?php  if  (isset($Pos_id)||!empty($Pos_id)) { ?>
                        <option <?= $PosData->code == $crny['code'] ? "selected" : "" ; ?> value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
                        <?php }else { ?> 
                        <option  value="<?= $crny['code'] ?>"><?= $crny['code'] ?></option>
                        <?php }} ?> 
                      </select>
                    </div>
                    <div class="col-md-9">
                      <label for="nf-email" class=" form-control-label">Phone Number</label>
                      <input type="text" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"  data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="phone" placeholder="Enter Phone Number" class="form-control required" value="<?= (isset($PosData->phone_no))?$PosData->phone_no:'' ?>" >
                    </div>
                </div>
                        <div class="form-group">
                            <label>Email address</label>
                             <label for="nf-email" class=" form-control-label">Email</label>
                       <input type="email" id="pd_email" name="email" placeholder="Enter Email" class="form-control required" onfocusout="myFunction()" value="<?= (isset($PosData->email_id))?$PosData->email_id:'' ?>" >
                        </div>
                        <div class="form-group">
                            <label>Password</label>
                           <input type="password" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"  data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="password" placeholder="Enter Password" class="form-control required" value="" >
                        </div>
                         <div class="form-group">
                         <label for="nf-email" class=" form-control-label">Location</label>
                      <input type="text" name="location" id="location"  required class="form-control required" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($PosData->location))?$PosData->location:'' ?>">
                     <input type="hidden" name="lat" value="<?= (isset($PosData->lat))?$PosData->lat:'' ?>" id="lat" required class="form-control required" readonly="">
                     <input type="hidden" name="lng" id="lng" value="<?= (isset($PosData->lng))?$PosData->lng:'' ?>" required class="form-control required" readonly="">
                  </div>
                   <div class="form-group">
                      <label for="nf-email" class=" form-control-label">Pos Code</label>
                       <input type="text" readonly="" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"  data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="Pos_code" placeholder="Pos Code" class="form-control required" value="<?= (isset($PosData->pos_code))?$PosData->pos_code:'' ?>"  >
                    </div>
                    <div class="form-group">
                      <label for="nf-email" class=" form-control-label">Altered Number</label>
                       <input type="text" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"  data-parsley-pattern="^[0-9\ , - + \/]+$" id="nf-brand" name="altered_no" placeholder="Enter Altered Number" class="form-control required" value="<?= (isset($PosData->altered_no))?$PosData->altered_no:'' ?>" >
                    </div>
                     <div class="form-group"> 
                       <label for="nf-email"  class=" form-control-label">Address</label>
                              <textarea type="text" data-parsley-trigger="change" data-parsley-minlength="2" data-parsley-pattern="^[a-zA-Z0-9\ . _ - ' \/]+$" id="nf-brand" name="address" placeholder="Enter Address" class="form-control required" ><?= (isset($PosData->address))?$PosData->address:'' ?></textarea> 
                       
                      </div>
                      
                      <div class="form-group">
                      <label for="nf-email" class=" form-control-label">Working From</label>
                     <input type="text" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"   id="nf-brand" name="working_from" placeholder="Working From" class="form-control required" value="<?= (isset($PosData->working_from))?$PosData->working_from:'' ?>" >
                    </div>
                     <div class="form-group">
                      <label for="nf-email" class=" form-control-label">Working To</label>
                    <input type="text" data-parsley-trigger="change" data-parsley-trigger="change"  data-parsley-minlength="2"   id="nf-brand" name="working_to" placeholder="Working To" class="form-control required" value="<?= (isset($PosData->working_to))?$PosData->working_to:'' ?>" >
                    </div>

                        <button type="submit" class="btn btn-primary btn-flat m-b-30 m-t-30">Register</button>
                        <div class="social-login-content">
                        
                        </div>
                     
                    </form>
                </div>
            </div>
        </div>
    </div>

<?php
        $this->load->view('template/footer_script');
    ?>
  </body>
</html>