<?php //INCUDE THE CLASS include '../pancakeapp.php'; $pancake = new pancakeapp(); /* CLIENT LIST */ $result = $pancake->client_list(); //ITERATE THROUGH CLIENTS foreach ($result as $client) { echo "<BR> CLIENT_ID: " . $client['id'] . "<BR>"; } exit; /* CLIENT INFO */ $client_id = 1; $result = $pancake->client_info($client_id); var_dump($result); exit; /* CLIENT ADD */ $client_info = array('first_name' => 'fname', 'last_name' => 'lname', 'email' => '*****@*****.**', 'company' => 'Big Stacks', 'address' => '123 Maple Street', 'phone' => '555-5555', 'website' => 'http://www.pancakeapp.com'); $result = $pancake->client_add($client_info); var_dump($result); exit; /* CLIENT EDIT */ $data = array('id' => 1, 'first_name' => 'fname_edited', 'last_name' => 'lastname edited', 'email' => '*****@*****.**', 'company' => 'Bigger Stacks', 'address' => '1234 Maple Street', 'phone' => '888-555-5555', 'website' => 'www.website.ca'); $result = $pancake->client_edit($data); var_dump($result); exit; /* CLIENT DELETE */ $result = $pancake->client_delete(2); var_dump($result); exit;
<?php //INCUDE THE CLASS include '../pancakeapp.php'; $pancake = new pancakeapp(); /* INVOICE LIST */ $result = $pancake->invoice_list(); /* echo "<pre>"; print_r($result); echo "</pre>"; */ //ITERATE THROUGH INVOICES foreach ($result as $invoice) { echo "<BR> INVOICE_ID: " . $invoice['id'] . "<BR>"; } exit; /* INVOICE INFO */ $invoice_id = 1; $result = $pancake->invoice_info($invoice_id); var_dump($result); /* INVOICE ADD */ $items[0]['name'] = 'Big Stack'; $items[0]['description'] = 'Year subscription of pancakes'; $items[0]['rate'] = '16.47'; $items[0]['quantity'] = 12; $invoice_data = array('client_id' => 1, 'type' => 'DETAILED', 'description' => '', 'is_recurring' => 1, 'frequency' => 'y', 'auto_send' => 1, 'due_date' => '2013-11-25', 'items' => $items); $result = $pancake->invoice_add($invoice_data); var_dump($result); exit; /* INVOICE EDIT */