
<!-- PAGE-INDEX-STARTS -->

<div class="breadcrumbs">
    <div class="breadcrumbs-inner">
        <div class="row m-0">
            <div class="col-sm-4">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><?= $pTitle ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li><a href="<?= base_url() ?>">Dashboard</a></li>
                            <li><a ><?= $menu ?></a></li>
                            <li class="active"><?= $smenu ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- PAGE-INDEX-ENDS -->
<?php
  $pos_code = getpos_code();
  $country = getCurrency();
  
?>
<!-- PAGE-CONTENT-STARTS -->

<div class="content">
  <div class="animated fadeIn">
      <div class="row">
        <div class="col-lg-12">
        <?php 
        $url = (!isset($Pos_id)||empty($Pos_id))?'Pos/createPos':'Pos/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="card">
              <div class="card-header">
                <strong><?= $pDescription ?></strong>
              </div>
              <div class="card-body card-block">
                <div class="form-group">
                  <div class="row">
                    <div class="col-md-6">

                      <label for="nf-email" class=" form-control-label">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>
                    <?php $req = (!isset($Pos_id)||empty($Pos_id))?'form-control required':'form-control';?>
                    <div class="col-md-6">
                      <label>Profile Picture</label><br>
                     
                        <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>
                
                <div class="form-group">
                  <div class="row">
                    <div class="col-md-2">
                    <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($country 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-4">
                      <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 class="col-md-6">
                      <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:'' ?>" >
                      <br>
                        <div id="email_req" style="color: red"></div>
                    </div>
                  </div>
                </div>

                
             
               
                <div class="form-group">
                  <div class="row">
                 
                    
                    <div class="col-md-6">
                      <label for="nf-email" class=" form-control-label">Location</label>
                      <input type="text" name="location" id="location" class="form-control" placeholder="Enter Location" onkeypress="ratelocation()" value="<?= (isset($PosData->location))?$PosData->location:'' ?>">
                      
                   
                   
                    </div>
                     <div class="col-md-3">
                      <label for="nf-email" class=" form-control-label">Latitude</label>
                      <input type="text" name="lat" value="<?= (isset($PosData->lat))?$PosData->lat:'' ?>" id="lat" class="form-control" readonly="">
                     
                   
                    </div>
                     <div class="col-md-3">
                      <label for="nf-email" class=" form-control-label">Longitude</label>
                     
                    <input type="text" name="lng" id="lng" value="<?= (isset($PosData->lng))?$PosData->lng:'' ?>" class="form-control" readonly="">
                   
                    </div>
                  </div>
                </div>
                 <div class="form-group">
                  <div class="row">

 <div class="col-md-6">
                      <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" value="<?= (isset($PosData->Pos_code))?$PosData->Pos_code:$pos_code ?>"  >
                    </div>



                    <div class="col-md-6">
                      <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" value="<?= (isset($PosData->altered_no))?$PosData->altered_no:'' ?>" >
                    </div>
                   
                  </div>
                </div>
                <div class="form-group">
                  <div class="row">
                  
                  </div>
                </div>
              
                  <div class="form-group">
                    <div class="row">         
                     <div class="col-md-6"> 
                       <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" ><?= (isset($PosData->address))?$PosData->address:'' ?></textarea> 
                       
                      </div>
                      <div class="col-md-3">
                  <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" value="<?= (isset($PosData->working_from))?$PosData->working_from:'' ?>" >
                </div>
               <div class="col-md-3">
                  <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" value="<?= (isset($PosData->working_to))?$PosData->working_to:'' ?>" >
                </div>
 
                    </div>
                  </div>
                  <div class="form-group">
                  <div class="row">
                
                  </div>
                </div>





              
                  <div class="form-group">
                    <div class="row">
                      <div class="col-md-12">
                          <button type="submit" class="btn btn-primary">
                                <i class="fa "></i>Submit
                          </button>
                      </div>
                    </div>
                  </div>   
                </div>
              </div>
            </form>
          </div>
         </div>
      </div>
   </div>
   <div class="clear-fix"></div>
  


              


