PHP code example of rjdeliveryomaha / courierinvoice
1. Go to this page and download the library: Download rjdeliveryomaha/courierinvoice library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rjdeliveryomaha / courierinvoice example snippets
try {
SecureSessionHandler::start_session($config);
} catch (Exception $e) {
echo $e->getMessage();
exit;
}
echo SecureSessionHandler::outputKey();
SecureSessionHandler::destroySession();
try {
SecureSessionHandler::start_session($config);
} catch(Exception $e) {
echo "<span data-value=\"error\">{$e->getMessage()}</span>";
return FALSE;
}
echo SecureSessionHandler::outputKey();
return FALSE;
try {
$functions = new CommonFunctions($config, $data);
} catch(Exception $e) {
return $e->getMessage();
}
$functions->getProperty($property);
$functions->updateProperty($property, $value);
$functions->addToProperty($property, $value);
$functions->substractFromProperty($property, $value);
$functions->compareProperties($obj1, $obj2, $property, $strict=FALSE);
$functions->debug();
$functions->getError();
try {
$query = new Query($config, $data);
} catch(Exception $e) {
return $e->getMessage();
}
$data['queryParams']['
$data['queryParams']['exclude'] = [ 'pCountry' ];
$data['queryParams']['filter'] = [];
$data['queryParams']['filter'][] = ['Resource'=>'Charge', 'Filter'=>'eq', 'Value'=>5];
$data['queryParams']['filter'][] = ['Resource'=>'BillTo', 'Filter'=>'neq', 'Value'=>1];
$filter1 = [];
$filter1[] = ['Resource'=>'Charge', 'Filter'=>'bt', 'Value'=>'1,5'];
$filter1[] = ['Resource'=>'BillTo', 'Filter'=>'eq', 'Value'=>1];
$filter2 = [ ['Resource'=>'BillTo', 'Filter'=>'eq', 'Value'=>2] ];
$data['queryParams']['filter'] = [$filter1, $filter2];
$data['queryParams']['order'] = ['DispatchTimeStamp,desc'];
$data['queryParams']['order'] = ['BillTo', 'DispatchTimeStamp,desc'];
$data['queryParams']['page'] = '1';
$data['queryParams']['page'] = '1,50';
$data['endPoint'] = 'clients';
$data['method'] = 'get';
$data['queryParams']['filter'][] = ['Resource'=>'ClientID', 'Filter'=>'eq', 'Value'=>0];
$data['queryParams']['join'] = [ 'config' ];
$query->buildURI();
$query->call();
try {
$query->buildURI()->call();
} catch (Exception $e) {
return $e->getMessage();
}
try {
$handler = new LoginHandler($config, $data);
} catch(Exception $e) {
return $e->getMessage();
}
try {
$type = $handler->login();
} catch(Exception $e) {
echo $e->getMessage();
return false;
}
echo $type;
return false;
$_SESSION['config']
$_SESSION['mobile']
$_SESSION['ulevel']
try {
$ticket = new Ticket($config, $data);
} catch(Exception $e) {
return $e->getMessage();
}
$data['multiTicket'] = [
[
'ticket_index': 1,
'step': 'delivered',
'notes': 'This ticket was delivered'
],
[
'ticket_index': 2,
'step': 'returned'
]
]
echo $ticket->regenTicket();
echo $ticket->displaySingleTicket();
echo $ticket->displayMultiTicket();
echo $ticket->ticketsToDispatch();
echo $ticket->ticketForm();
echo $ticket->runPriceForm();
echo $ticket->calculateRunPrice();
echo $ticket->fetchTodaysTickets();
$ticket->processRouteTicket();
$ticket->processReturnTicket();
echo $ticket->updateTicketProperty();
$ticket->updateTicketDatabaseKeys = ['BillTo',
'Charge',
'EmailAddress',
'EmailConfirm',
'Telephone',
'RequestedBy',
'pClient',
'pAddress1',
'pAddress2',
'pCountry',
'pContact',
'pTelephone',
'dClient',
'dAddress1',
'dAddress2',
'dCountry',
'dContact',
'dTelephone',
'dryIce',
'diWeight',
'diPrice',
'DispatchedTo',
'Transfers',
'TicketBase',
'RunPrice',
'TicketPrice',
'Notes',
'pSigReq',
'dSigReq',
'd2SigReq',
'pLat',
'pLng',
'dLat',
'dLng',
'd2Lat',
'd2Lng'
];
echo $ticket->stepTicket();
echo $ticket->cancelTicket();
try {
$route = new Route($config, $data);
} catch(Exception $e) {
echo $e->getMessage();
return FALSE;
}
$route->routeTickets();
$route->onCallTickets();
$route->transferredTickets();
Scheduling::codeFromIndex($index);
Scheduling::literalFromIndex($index);
Scheduling::indexFromCode($code);
Scheduling::literalFromCode($code);
Scheduling::indexFromLiteral($literal);
Scheduling::codeFromLiteral($literal);
Scheduling::testIndex($index, $startDate, $testDate);
Scheduling::testCode($code, $startDate, $testDate);
Scheduling::testLiteral($literal, $startDate, $testDate);
try {
$invoice = new Invoice($config, $data);
} catch(Exception $e) {
echo $e->getMessage();
return FALSE;
}
$invoice->regenInvoice();
$invoice->invoiceQueryForm();
try {
$handler = new SearchHandler($config, $data);
} catch (Exception $e) {
echo $e->getMessage();
return false;
}
try {
$ticketChart = new TicketChart($config, $data);
} catch(Exception $e) {
echo $e->getMessage();
return FALSE;
}
$this->months[$monthLabel][$ticket['BillTo']] = [
'billTo'=>$ticket['BillTo'],
'monthTotal'=>1,
'contract'=>0,
'credit'=>0,
'canceled'=>0,
'onCall'=>0,
'routine'=>0,
'fourHour'=>0,
'threeHour'=>0,
'twoHour'=>0,
'oneHour'=>0,
'roundTrip'=>0,
'deadRun'=>0,
'dedicatedRun'=>0,
'withIce'=>0,
'withoutIce'=>0,
'startDate'=>$receivedDate->format('Y-m-d'),
'endDate'=>$receivedDate->format('Y-m-d')
];
$chart = $ticketChart->displayChart();
if ($chart === false) {
echo $ticketChart->getError();
} else {
echo $chart;
}
try {
$invoiceChart = new InvoiceChart($config, $data);
} catch(Exception $e) {
echo $e->getMessage();
return FALSE;
}
$this->months[$invoiceLabel] = [
'invoices'=>[0 => $invoice['InvoiceNumber']],
'billTo'=>$invoice['ClientID'],
'monthTotal'=>$invoice['InvoiceSubTotal'] - $invoice['BalanceForwarded'],
'contract'=>0,
'credit'=>0,
'canceled'=>0,
'onCall'=>0,
'routine'=>0,
'fourHour'=>0,
'threeHour'=>0,
'twoHour'=>0,
'oneHour'=>0,
'roundTrip'=>0,
'deadRun'=>0,
'dedicatedRun'=>0,
'dryIce'=>0,
'iceDelivery'=>0,
];
$chart = $invoiceChart->displayChart();
if ($chart === false) {
echo $invoiceChart->getError();
} else {
echo $chart;
}
try {
$client = new Client($config, $data);
} catch(Exception $e) {
echo $e->getMessage();
return FALSE;
}
$client->getAllClientInfo();
$client->changePassword();
$client->updateInfo();
$client->adminPasswordForm();
$client->dailyPasswordForm();
$client->orgPasswordForm();
$client->driverPasswordForm();
$client->dispatchPasswordForm();
$client->updateInfoForm();
use rjdeliveryomaha\courierinvoice\InvoiceCron;
try {
$cron = new InvoiceCron($config);
} catch(Exception $e) {
// log $e->getMessage();
exit;
}
try {
$cron->createInvoices();
} catch(Exception $e) {
// log $e->getMessage();
exit;
}
exit;
if (empty($_POST)) $_POST = json_decode(file_get_contents('php://input'),true);
javascript
rjdci.updateMap = ({ coords1, address1, coords2, address2, center, mapDivID }) => { return false; }