<template>
    <form @submit.prevent="update">
        
<div class="form-group row">
    <div class="col-md-12">
        <label for="cust_client_fullname">Customer Contact Full Name</label>
        <input type="hidden" name="cust_client_id" id="cust_client_id" v-model="fields.cust_client_id">
        <input type="text" name="cust_client_fullname" v-model="fields.cust_client_fullname" class="form-control" placeholder="Enter full name...">
        <div v-if="errors && errors.cust_client_fullname" class="text-danger">{{ errors.cust_client_fullname[0] }}</div>
    </div>
    <div class="col-md-6">
        <label for="cust_client_idno">Customer Contact IDNO</label>
        <input type="text" name="cust_client_idno" v-model="fields.cust_client_idno" class="form-control" placeholder="">
        <div v-if="errors && errors.cust_client_idno" class="text-danger">{{ errors.cust_client_idno[0] }}</div>
    </div>
    
    <div class="col-md-6">
        <label for="cust_client_phone">Customer Contact Phone </label>
        <input type="text" name="cust_client_phone" v-model="fields.cust_client_phone" class="form-control" placeholder="e.g. 711223344">  
        <div v-if="errors && errors.cust_client_phone" class="text-danger">{{ errors.cust_client_phone[0] }}</div>                                                      
    </div>
    <div class="col-md-6">
        <label for="cust_client_status"> Active? </label>
        <input type="hidden" name="cust_client_status" v-model="fields.cust_client_status" class="form-control" placeholder="Enter contact Status...">
        <input type="checkbox" name="cust_client_status" class="form-control" v-model="fields.cust_client_status">
        <div v-if="errors && errors.cust_client_status" class="text-danger">{{ errors.cust_client_status[0] }}</div>
    </div>
    
	<div class="col-md-6">
        <label for="username"></label>
        <input type="hidden" name="username" v-model="fields.username" class="form-control" placeholder="Enter Username...">
        <div v-if="errors && errors.username" class="text-danger">{{ errors.username[0] }}</div>
    </div>
    </div>

        <div class="form-group">
            <button type="submit" class="btn btn-success btn-round">Save</button>
            <button type="reset" class="btn btn-danger btn-round">Clear</button>
        </div>       
        

        
    </form>
</template>

<script>
import FormMixin from '../shared/FormMixin';

export default {
  mixins: [ FormMixin ],
  props: ['clientdata'],
  data() {
    return {
      'action2': '/bmp/clients/update',
      'text': 'contact Updated succesfully',
      'redirect': '',
      fields: {
          cust_client_id:this.clientdata.cust_client_id,
          cust_client_fullname:this.clientdata.cust_client_fullname,
          cust_client_idno:this.clientdata.cust_client_idno,
          cust_client_phone:this.clientdata.cust_client_phone,
          cust_client_status:this.clientdata.cust_client_status
      }
    }
  },
  mounted(){
          this.fields.cust_client_id=this.clientdata.cust_client_id;
          this.fields.cust_client_fullname=this.clientdata.cust_client_fullname;
          this.fields.cust_client_idno=this.clientdata.cust_client_idno;
          this.fields.cust_client_phone=this.clientdata.cust_client_phone;
          this.fields.cust_client_status=this.clientdata.cust_client_status;
      
  }
}

</script>