Example #1
0
    $e->setFrom($SYSTEM['email']['from']);
    $e->setFromName($SYSTEM['email']['fromName']);
    $e->setSubject($lang['eml_subj_invoice']);
    $e->set('SYSTEM', $SYSTEM);
    $e->set('invoice', $invoice);
    $e->set('client', $client);
    $e->set('admin', $admin);
    $ispayed = strtolower($invoice['curr_status']) == 'fully paid' ? true : false;
    $e->set('ispayed', $ispayed);
    $e->fetchMessage();
    $e->appendMessage('<img src="' . HTTP_ROOT . 'isop.php?sid=' . $emailSendID . '" width="1" height="1">');
    $e->setRecipient($client['email']);
    $e->setPriority('High');
    $result = $e->send();
    unset($e);
    $result = $result ? 'Successful' : 'Failed';
    if ($invoice['curr_status'] == 'unsent') {
        $ISL->UpdateInvoiceStatus($invoiceID, 'pending');
    }
    logItem($_SESSION['ses_client_id'], $invoiceID, 1, 5, $client['email'] . ": " . $result);
    if (!$passed) {
        echo "Mail to " . $client['email'] . ".<br>Status: " . $result;
    }
} else {
    if (!$passed) {
        echo "No invoice ID provided.";
    }
}
if (!$passed) {
    exit;
}
Example #2
0
$page = isset($_GET['page']) ? $_GET['page'] : 0;
$message = '';
$tpl =& new TemplateSystem();
$tpl->set('page_title', $lang['pt_invoices']);
$tpl->set('SYSTEM', $SYSTEM);
// Delete Selected Invoice
if (isset($_GET['del']) && isset($_GET['id'])) {
    $inv = $ISL->FetchInvoiceDetails($_GET['id']);
    if ($inv['curr_status'] == 'unsent') {
        $ISL->DeleteInvoice($_GET['id'], false);
        $message = $lang['invoice_deleted'];
    } else {
        $ISL->DeleteInvoice($_GET['id']);
        $message = $lang['invoice_set_void'];
    }
    logItem($_SESSION['ses_client_id'], $invoiceID, 1, 3);
}
if ($item & $value) {
    if ($search) {
        switch ($item) {
            case 'invoice_num':
                $sqlVals = 'i.invoice_num LIKE "%' . $_GET['value'] . '%"';
                break;
            case 'client':
                $sqlVals = 'i.clientID LIKE "%' . $_GET['value'] . '%"';
                break;
            case 'month':
                $sqlVals = "month(i.due_date)=month('" . date('Y-m-d', strtotime($_GET['value'])) . "') AND year(i.due_date)=year('" . date('Y-m-d', strtotime($_GET['value'])) . "')";
                break;
            case 'year':
                $sqlVals = "year(i.due_date)=year('" . date('Y-m-d', strtotime($_GET['value'])) . "')";
Example #3
0
/***************************************************************************
					clients.php
					------------
	product			: PHP Invoice
	version			: 1.0 build 1 (Beta)
	released		: Sunday September 7 2003
	copyright		: Copyright &copy; 2001-2009 Jeremy Hubert
	email			: support@illanti.com
	website			: http://www.illanti.com

    Lists the current clients in the database. DO NOT EDIT unless you know
    what you are doing.

***************************************************************************/
define('SITE_ROOT', '../');
require_once SITE_ROOT . 'includes/common.php';
securePage('admin');
$message = '';
if (isset($_GET['del']) && isset($_GET['id'])) {
    $ISL->DeleteClient($_GET['id']);
    logItem($_SESSION['ses_client_id'], $_GET['id'], 2, 8);
    $message = "<b>Sub User deleted</b><br><br>";
}
$tpl =& new TemplateSystem();
$tpl->set('page_title', 'Sub Users');
$tpl->set('clients', $ISL->FetchClients('staff'));
$tpl->set('message', $message);
$tpl->set('tbody', 'admin/subusers.tpl');
$tpl->display();
exit;
Example #4
0
                $e->setRecipient($client['email']);
                $e->setPriority('high');
                $e->send();
                unset($e);
                break;
            case 'mark':
                $status = "Fully Paid";
                $ISL->UpdateInvoiceStatus($invoiceID, $status);
                logItem($_SESSION['ses_client_id'], $invoiceID, 1, 2, 'Status changed to ' . $status);
                break;
            default:
                //do nothing
                break;
        }
        if (!$isnew) {
            logItem($_SESSION['ses_client_id'], $invoiceID, 1, 2, $edit_reason);
            $tpl->set('message', sprintf($lang['invoice_updated'], 'invoices.php'));
        } else {
            $tpl->set('message', sprintf($lang['invoice_added'], 'invoices.php'));
        }
        $tpl->set('tbody', 'action_complete.tpl');
        $submit = true;
    }
}
if (!$submit) {
    if ($invoiceID) {
        $invoice = $ISL->FetchInvoiceDetails($invoiceID);
        $invoice['issue_date'] = date('m/d/Y', $invoice['issue_date']);
        $invoice['due_date'] = date('m/d/Y', $invoice['due_date']);
    } elseif ($clientID) {
        $client = $ISL->FetchClientDetails($clientID);
Example #5
0
    what you are doing.

***************************************************************************/
define('SITE_ROOT', '../');
require_once SITE_ROOT . 'includes/common.php';
securePage('client');
$clientID = $_SESSION['ses_client_id'];
$access = isset($_REQUEST['access']) ? $_REQUEST['access'] : 'client';
$tpl =& new TemplateSystem();
$tpl->set('page_title', $lang['pt_edit_account']);
if (isset($_POST['submit'])) {
    $client = $ISL->fetchClientDetails($clientID);
    foreach ($_POST as $key => $val) {
        $client[$key] = $val;
    }
    $ISL->UpdateClient($clientID, $client);
    logItem($_SESSION['ses_client_id'], $clientID, 2, 7);
    $tpl->set('message', sprintf($lang['account_updated'], 'index.php'));
    $tpl->set('tbody', 'action_complete.tpl');
} else {
    if ($clientID) {
        $client = $ISL->FetchClientDetails($clientID);
    } else {
        $client = array('visible' => 1, 'access' => 'client', 'clientid' => 0, 'company' => '', 'firstname' => '', 'lastname' => '', 'contacttitle' => '', 'email' => '', 'address' => '', 'phonenumber' => '', 'faxnumber' => '', 'url' => '', 'logo' => '', 'account_num' => '', 'ref' => '', 'username' => '', 'passwd' => '', 'template' => $_SESSION['ses_template'], 'language' => $_SESSION['ses_lang'], 'def_tax' => '', 'def_tax2' => '', 'def_terms' => '', 'def_comments' => '', 'terms_days' => '30');
    }
    $tpl->set('templateDD', getTemplatesDD($client['template']));
    $tpl->set('languageDD', getLanguagesDD($client['language']));
    $tpl->set('client', $client);
    $tpl->set('tbody', 'client/edit_client.tpl');
}
$tpl->display();
Example #6
0
	version			: 1.0 build 1 (Beta)
	released		: Sunday September 7 2003
	copyright		: Copyright &copy; 2001-2009 Jeremy Hubert
	email			: support@illanti.com
	website			: http://www.illanti.com

    Processes the login from the index page. DO NOT EDIT unless you know
    what you are doing.

***************************************************************************/
define('SITE_ROOT', './');
require_once SITE_ROOT . 'includes/common.php';
$redir = SITE_ROOT . 'login.php';
if (isset($_POST['name'])) {
    $result = $ISL->doLogin($_POST['name'], $_POST['password']);
    if (is_array($result)) {
        $_SESSION['ses_client_id'] = $result['clientid'];
        $_SESSION['ses_parent_id'] = $result['parentclientid'];
        $_SESSION['ses_client_name'] = $result['firstname'];
        $_SESSION['ses_client_company'] = $result['company'];
        $_SESSION['ses_access'] = $result['access'];
        $_SESSION['ses_template'] = $result['template'] == 'default' ? $def_template : $result['template'];
        $_SESSION['ses_language'] = $result['language'] == 'default' ? $def_lang : $result['language'];
        logItem(0, $_SESSION['ses_client_id'], 2, 10, $_SERVER['REMOTE_ADDR']);
        $redir = SITE_ROOT . $result['access'] . '/index.php';
    } else {
        $redir = SITE_ROOT . 'login.php?r=3';
    }
}
header("Location: " . $redir);
exit;
Example #7
0
	product			: PHP Invoice
	version			: 1.0 build 1 (Beta)
	released		: Sunday September 7 2003
	copyright		: Copyright &copy; 2001-2009 Jeremy Hubert
	email			: support@illanti.com
	website			: http://www.illanti.com

    Allows for quick updating of an invoice's status. DO NOT EDIT unless 
    you know what you are doing.

***************************************************************************/
define('SITE_ROOT', '../');
require_once SITE_ROOT . 'includes/common.php';
securePage('admin');
$invoiceID = set($_REQUEST['id'], 0);
$status = isset($_REQUEST['st']) ? strtolower($_REQUEST['st']) : 0;
if (!$invoiceID) {
    trigger_error('No Invoice ID Provided', E_USER_ERROR);
}
$tpl =& new TemplateSystem();
$tpl->set('page_title', $lang['update_invoice']);
if ($invoiceID and $status) {
    $ISL->UpdateInvoiceStatus($invoiceID, $status);
    logItem($_SESSION['ses_client_id'], $invoiceID, 1, 2, 'Satus changed to ' . $status);
    $tpl->set('message', $lang['invoice_updated']);
    $tpl->set('tbody', 'action_complete.tpl');
} else {
    $tpl->set('message', $lang['no_status']);
    $tpl->set('tbody', 'action_complete.tpl');
}
$tpl->display('simple_framework.tpl');