Giter Club home page Giter Club logo

client_data's Introduction

Client_Data

Blesta Plugin That Allow Dev/Themers Get Client Data Info As Json Response , then they can use it in their Template or Plugin .

This Plugin didn't need install, just upload the folder client_data to plugins and you are ready to go .

Not all request should be Done Via Ajax , a direct call will return a blank page .

Example of Requests :

1 - For Tickets, the last element is the Tickets status

Get CLient's Open Tickets

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_tickets/open

Get CLient's Closed Tickets

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_tickets/closed

2 - For Services, the last element is the Service status

Get CLient's Active Services

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_services/active

Get CLient's Suspended Services

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_services/suspended

3 - For Invoices, the last element is the Invoices status

Get CLient's Open Invoices

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_invoices/open

Get CLient's Vioded Invoices

http://your_domain.com/blesta_dir/plugin/client_data/client_main/count_invoices/vioded

To get the info by Ajax request in template us this code

	<?php
	$this->Javascript->setInline('
		$(document).ready(function() {
			fetchInvoices();
		});
		
		function fetchInvoicesCount() {
			$(this).blestaRequest("GET", "' . $this->Html->safe($this->base_uri . "plugin/client_data/client_main/count_invoices/open") . '", null, function(data) {
				if (data)
					$("#my_div_id_to_replace").html(data);
			},
			null,
			{dataType:"json"});
		}
	');
	?>

To explain the code , you need to change the url and the div to put the requested data .

client_data's People

Contributors

naja7host avatar

Watchers

12345 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.