示例#1
0
文件: users.php 项目: xvilo/Cpanel
                    <div class="twelve columns">
	                    <div class="element nopadding">
	                        <h5>Overzicht facturen</h5>
                            <table class="table table-cp" id="invoices-table">
		                        <thead>
		                            <tr>
		                                <th><i class="fa fa-check payed"></i></th>
		                                <th>Nummer</th>
		                                <th>Klant</th>
		                                <th>Betaling</th>
		                                <th>Totaal</th>
		                            </tr>
		                        </thead>
		                        <tbody>
			                        <?php 
    foreach (getInvoices('', $_GET['id']) as $invoices) {
        $totalAmount = number_format($invoices['invoice_total'], 2, ',', '.');
        $invoiceStatus = getInvoiceStatus($invoices['invoice_status']);
        echo "<tr>";
        echo "<th><a class='invoice status' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoiceStatus}</a></th>";
        echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>";
        echo "<th><a class='invoice customer' target='_blank' href='/admin/users/{$invoices['invoice_recipient']}'>{$invoices['invoice_recipient']}</a></th>";
        echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>";
        echo "<th><a class='invoice total' href='/admin/invoices/{$invoices['invoice_number']}'>&euro; {$totalAmount}</a></th>";
        echo '<tr>';
    }
    ?>
		                        </tbody>
		                    </table>
                        </div>
                    </div>
//if this page has error with auth remove the above line and figure out how to do it right

$SI_INVOICE_TYPE = new SimpleInvoices_Db_Table_InvoiceType();

$domain_id = domain_id::get();

#$sql = "SELECT * FROM ".TB_PREFIX."invoices where domain_id = ".$domain_id;

#global $dbh;
#$sth = dbQuery($sql) or die(htmlsafe(end($dbh->errorInfo())));

//$sql = "SELECT * FROM ".TB_PREFIX."invoices LIMIT $start, $limit";
$invoice = new invoice();
$sth = $invoice->select_all();

$q = strtolower($_GET["q"]);
if (!$q) return;

while ($invoice = getInvoices($sth)) {

	$invoiceType = $SI_INVOICE_TYPE->getInvoiceType($invoice['type_id']);

	if (strpos(strtolower($invoice['index_id']), $q) !== false) {
		$invoice['id'] = htmlsafe($invoice['id']);
		$invoice['total'] = htmlsafe(number_format($invoice['total'],2));
		$invoice['paid'] = htmlsafe(number_format($invoice['paid'],2));
		$invoice['owing'] = htmlsafe(number_format($invoice['owing'],2));
		echo "$invoice[id]|<table><tr><td class='details_screen'>$invoice[preference]:</td><td>$invoice[index_id]</td><td  class='details_screen'>Total: </td><td>$invoice[total] </td></tr><tr><td class='details_screen'>Biller: </td><td>$invoice[biller] </td><td class='details_screen'>Paid: </td><td>$invoice[paid] </td></tr><tr><td class='details_screen'>Customer: </td><td>$invoice[customer] </td><td class='details_screen'>Owing: </td><td><u>$invoice[owing]</u></td></tr></table>\n";
	}
}
示例#3
0
文件: invoice.php 项目: xvilo/Cpanel
	                    <Br>
                        <div class="element nopadding">
	                        <h5>Betaalde facturen</h5>
                            <table class="table table-cp" id="invoices-table">
		                        <thead>
		                            <tr>
		                                <th><i class="fa fa-check payed"></i></th>
		                                <th>Nummer</th>
		                                <th>Klant</th>
		                                <th>Betaling</th>
		                                <th>Totaal</th>
		                            </tr>
		                        </thead>
		                        <tbody>
			                        <?php 
    foreach (getInvoices() as $invoices) {
        $totalAmount = number_format($invoices['invoice_total'], 2, ',', '.');
        $invoiceStatus = getInvoiceStatus($invoices['invoice_status']);
        echo "<tr>";
        echo "<th><a class='invoice status' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoiceStatus}</a></th>";
        echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>";
        echo "<th><a class='invoice customer' target='_blank' href='/admin/users/{$invoices['invoice_recipient']}'>{$invoices['invoice_recipient']}</a></th>";
        echo "<th><a class='invoice number' href='/admin/invoices/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>";
        echo "<th><a class='invoice total' href='/admin/invoices/{$invoices['invoice_number']}'>&euro; {$totalAmount}</a></th>";
        echo '<tr>';
    }
    ?>
		                        </tbody>
		                    </table>
                        </div>
                    </div>
示例#4
0
?>
    <div id="main-content">
        <div id="guts">
            <div class="leftwrapper">
                <div class="element nopadding">
                    <table class="table table-cp" id="invoices-table">
                        <thead>
                            <tr>
                                <th><i class="fa fa-check"></i></th>
                                <th>Nummer</th>
                                <th>Totaal</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php 
foreach (getInvoices($_SESSION['user_num']) as $invoices) {
    $totalAmount = number_format($invoices['invoice_total'], 2, ',', '.');
    $invoiceStatus = getInvoiceStatus($invoices['invoice_status']);
    echo "<tr>";
    echo "<th><a class='invoice status' href='/invoice/{$invoices['invoice_number']}'>{$invoiceStatus}</a></th>";
    echo "<th><a class='invoice number' href='/invoice/{$invoices['invoice_number']}'>{$invoices['invoice_number']}</a></th>";
    echo "<th><a class='invoice total' href='/invoice/{$invoices['invoice_number']}'>&euro; {$totalAmount}</a></th>";
    echo '<tr>';
}
?>
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="container">
#API access username goes here
define('WHMCS_API_PASSWORD', 'test123');
#API access password goes here
define('AUTO_AUTH_KEY', 'abcXYZ123');
define('FRESHDESK_DOMAIN', 'http://mycompany.freshdesk.com');
define('WHMCS_API_ACCESS_KEY', 'abc123');
#Specify the apiaccesskey or whitelist the access machines ips for api calls in WHMCS app.
header('Access-Control-Allow-Origin: ' . FRESHDESK_DOMAIN);
header('Access-Control-Allow-Headers: ' . 'x-csrf-token');
header('Content-Type: application/json; charset=utf-8');
check_proper_request();
define('AGENT_EMAIL', trim($_REQUEST['agent']));
define('REQ_EMAIL', trim($_REQUEST['email']));
$client = getClientDetails();
if (isset($client->result) && $client->result == 'success') {
    $result = array('client' => $client, 'products' => getProducts($client)->products, 'domains' => getDomain($client)->domains, 'invoices' => getInvoices($client)->invoices, 'sso_url' => sso_url());
    header('HTTP 1.0 200 OK');
    echo json_encode($result);
} else {
    header('HTTP 1.0 502 Bad Gateway');
    echo json_encode($client);
}
function check_proper_request()
{
    if (!array_key_exists('app_key', $_REQUEST) || $_REQUEST['app_key'] != APP_KEY) {
        header('HTTP/1.0 401 Unauthorized');
        echo '{ "error": "Invalid App key" }';
        exit(0);
    }
    if (!array_key_exists('email', $_REQUEST) || !array_key_exists('agent', $_REQUEST)) {
        header('HTTP/1.0 400 Bad Request');
示例#6
0
<!--<input type="submit" name="update" value="Update" /><input type="submit" name="delete" value="Delete" />-->
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr class="table-header"><th width="10"><input type="checkbox" name"all">  </th>
<th>Invoice Number</th>
<th>Status</th>
<th>Date Issued</th>
<th>Amount Paid</th>
<th>Balance</th>
<th>Total Amount</th>
<th>Actions</th></tr>
</thead>
<tbody>
<?php 
    $numrows = count(getInvoices());
    // number of rows to show per page
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
        // cast var as int
        $currentpage = (int) $_GET['currentpage'];
    } else {
        // default page num
        $currentpage = 1;
    }
    // end if
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
        // set current page to last page
示例#7
0
    $customer = getCustomers();
    foreach ($customer as $value) {
        ?>
<option value="<?php 
        echo $value['cust_id'];
        ?>
"><?php 
        echo $value['cust_name'];
        ?>
</option>
 <?php 
    }
    ?>
</select>
<label>Invoice Number </label><input type="text" name="name" value="<?php 
    echo count(getInvoices()) + 1;
    ?>
"  disabled>
<label>Date issued </label> <select name="room_type" class="select" ><?php 
    $type = getRoomType();
    foreach ($type as $value) {
        ?>
<option value="<?php 
        echo $value['cat_id'];
        ?>
"><?php 
        echo $value['category'];
        ?>
</option>
 <?php 
    }