$full_total = 0; $bill_total = 0; $full_quantity = 0; $bill_quantity = 0; $x_kind = null; $x_status = null; echo '<table>'; //echo '<caption>Work order items captoin</caption>'; echo '<tr><th colspan="3">Quantity</th><th>Kind</th><th>Name</th><th>Rate</th><th>Tax</th><th>Subtotal</th></tr>'; // @todo Need to track Invoice Totals foreach ($this->WorkOrderItemList as $woi) { // Header Row if ($x_kind != $woi['kind'] || $x_status != $woi['status']) { //drawSummaryRow($bill_quantity, $bill_total); if ($woi['invoice_id']) { $text = Radix::link("/invoice/view/{$woi['invoice_id']}", "Invoice #{$woi['invoice_id']}"); } else { $text = $woi['status'] . ' ' . $woi['kind'] . ' Items'; } // echo "<tr><th colspan='6'>". $text . '</th></tr>'; $bill_total = 0; $bill_quantity = 0; } $name = html((isset($woi['date']) ? date('m/d/y ', strtotime($woi['date'])) . ' ' : null) . $woi['name']); echo '<tr class="rero">'; echo '<td>' . Form::checkbox('woi_id[]', $woi['id'], array('checked' => 'checked')) . '</td>'; echo '<td>' . Form::text('woi_q_' . $woi['id'], $woi['a_quantity'], array('style' => 'width:3em')) . '</td>'; echo '<td>' . Form::text('woi_status_' . $woi['id'], $woi['status']) . '</td>'; echo '<td class="c">' . $woi['kind'] . '</td>'; //echo '<td><strong>' . $this->link('/workorder.item/view/' . $woi->id,$name) . '</strong></td>'; echo '<td>' . $name . '</td>';
echo '<tr class="rero ' . strtolower($item['status']) . ' ' . strtolower($item['kind']) . '">'; // Star echo '<td>' . star($item['star']) . '</td>'; // ID echo '<td><a href="' . Radix::link('/workorder/view?w=' . $item['id']) . '">#' . $item['id'] . '</td>'; // Printable Link if (in_array('print', $cols)) { echo '<td><a href="' . Radix::link('/workorder/pdf?w=' . $item['id']) . '">' . img('/tango/22x22/devices/printer.png', 'Get PDF') . '</a></td>'; } if (in_array('date', $cols) && isset($item['date'])) { echo '<td class="c">' . ImperiumView::niceDate($item['date']) . '</td>'; } echo '<td>' . $item['kind'] . '/' . $item['status'] . '</td>'; if (isset($item['contact_name'])) { if (in_array('contact', $cols)) { echo '<td><a href="' . Radix::link('/contact/view?c=' . $item['contact_id']) . '">' . $item['contact_name'] . '</td>'; } } if (in_array('note', $cols)) { echo '<td>'; $x = min(max(strpos($item['note'], "\n"), 32), 64); echo trim(substr($item['note'], 0, $x)); echo '</td>'; } if (in_array('open_amount', $cols)) { echo '<td class="bill" title="Open Amount">' . number_format($item['open_amount'], 2) . '</td>'; } if (in_array('bill_amount', $cols)) { echo '<td class="bill" title="Bill Amount">(' . number_format($item['bill_amount'], 2) . ')</td>'; } echo '</tr>';
echo Radix::block('file-list', $this->ContactFileList); // Work Orders echo '<h2><a href="' . Radix::link('/workorder/new?c=' . $this->Contact['id']) . '"><i class="fa fa-clock-o"></i> Work Orders</a></h2>'; if ($this->WorkOrderList) { echo Radix::block('workorder-list', array('list' => $this->WorkOrderList)); } // Invoices echo '<h2><a href="' . Radix::link('/invoice/new?c=' . $this->Contact['id']) . '"><i class="fa fa-list"></i> Invoices</a></h2>'; if ($this->InvoiceList) { echo Radix::block('invoice-list', array('list' => $this->InvoiceList)); } // History $x = array('ajax' => true, 'list' => $this->Contact->getHistory()); echo Radix::block('diff-list', $x); ?> <script type='text/javascript'> $('#account').autocomplete({ source: "<?php echo Radix::link('/account/ajax?a=account'); ?> ", change: function(event, ui) { if (ui.item) { $('#account').val(ui.item.label); $('#account_id').val(ui.item.id); } } }); </script> <?php
// View Results $runbal = $this->openBalance; $cr_sum = 0; $dr_sum = 0; echo '<table style="width:100%;">'; echo '<tr><th>Date</th><th>Account/Note</th><th>Entry #</th><th>Link</th><th>Debit</th><th>Credit</th><th>Balance</th></tr>'; echo '<tr class="rero">'; echo '<td class="c">-Open-</td><td colspan="5">Opening Balance</td>'; echo '<td class="b r">' . number_format($this->openBalance, 2) . '</td>'; echo '</tr>'; foreach ($this->LedgerEntryList as $le) { //$date = AppHelper::dateNice($le['date']); //$link = '/accounts/journal/entry/'.$le['account_journal_id']; $link = '/account/transaction?' . http_build_query(array('id' => $le['account_journal_id'], 'r' => '/account/ledger?' . http_build_query(array('id' => $this->Account['id'])))); echo '<tr class="rero">'; echo '<td class="c"><a href="' . Radix::link($link) . '">' . $le['date'] . '</td>'; echo '<td>' . $le['account_name'] . '/' . $le['note'] . '</td>'; echo sprintf('<td class="c">#%s%s</td>', $le['kind'], $le['account_journal_id']); // Object Link if (!empty($le['link_to'])) { echo sprintf('<td class="c">%s:%d</td>', $le['link_to'], $le['link_id']); } else { echo '<td></td>'; } // Debit or Credit if ($le['amount'] > 0) { echo '<td></td><td class="r">' . number_format($le['amount'], 2) . '</td>'; } else { echo "<td class='r'>" . number_format(abs($le['amount']), 2) . '</td><td></td>'; } // Amount
if ($x_kind != $woi['kind'] || $x_status != $woi['status']) { drawSummaryRow($e_size, $e_cost, $a_size, $a_cost); // The method of tying WOI => IVI is incorrect // We should tie IVI => WOI, so that here we'd look for IVI where workorder_item_id = ? //if ($woi->invoice_id) { // $text = $this->link("/invoice/view?i={$woi->invoice_id}","Invoice #{$woi->invoice_id}"); //} else { $text = $woi['status'] . ' ' . $woi['kind'] . ' Items'; //} echo '<tr><th colspan="6">' . $text . '</th></tr>'; // Reset Counters $a_cost = $e_cost = 0; $a_size = $e_size = 0; } // $name = (isset($woi->date) ? date('m/d/y ',strtotime($woi->date)) : null) . $woi->name; $link = '<a class="ajax-edit" data-name="woi-edit" href="' . Radix::link('/workorder/item?id=' . $woi['id']) . '">%s</a>'; echo '<tr class="rero">'; // Date echo '<td>'; if (!empty($woi['date'])) { $html = null; $time = strtotime($woi['date']); $span = $_SERVER['REQUEST_TIME'] - $time; $html .= '<span title="' . strftime('%a %Y-%m-%d', $time) . ' (' . floor($span / 86400) . ' days ago)">'; if ($span >= 31104000) { // 360 days $html .= strftime('%a %m/%d/%y', $time); } else { $html .= strftime('%a %m/%d', $time); } $html .= '</span>';
// $this->_s->EmailComposeMessage->body.= "\n\nSincerely,\n"; // $this->_s->EmailComposeMessage->body.= ' ' . $this->_c->Company->name . "\n\n"; // $this->_s->EmailComposeMessage->body.= 'PS: The linked files are in Adobe PDF format. You must have Acrobat Reader (or other compatible software) installed to view these documents.'; // $this->_s->ReturnTo = sprintf('/workorder/view/id/%d?sent=true',$wo->id); $this->_s->ReturnGood = sprintf('/workorder/view?w=%d?sent=good', $wo->id); $this->_s->ReturnFail = sprintf('/workorder/view?w=%d?sent=fail', $wo->id); Radix::redirect('/email/compose'); break; case 'save': $list = array('contact_id', 'date', 'kind', 'base_rate', 'base_unit', 'requester', 'note'); foreach ($list as $x) { $wo[$x] = trim($_POST[$x]); } $wo->save(); if ($id) { Session::flash('info', "Work Order #{$id} saved"); } else { $id = $wo['id']; Session::flash('info', "Work Order #{$id} created"); } Radix::redirect('/workorder/view?w=' . $id); break; case 'void': $sql = 'UPDATE workorder_item SET status = ? WHERE workorder_id = ? AND status = ?'; SQL::query($sql, array('Void', $wo->id, 'Pending')); $wo['status'] = 'Void'; $wo->save(); Session::flash('info', "Work Order #{$wo->id} voided"); Radix::redirect('/'); break; }
<?php /** Work Order Create Action Create a new Work Order */ namespace Edoceo\Imperium; use Edoceo\Radix; $_ENV['title'] = array('Invoice', 'Create'); $this->Invoice = new Invoice(null); if (!empty($_GET['c'])) { $c = new Contact(intval($_GET['c'])); if (!empty($c['id'])) { $this->Invoice['contact_id'] = $c['id']; $this->Contact = $c; $this->ContactList = $this->Contact->getContactList(); } } Radix::$path = '/invoice/view';
//echo "$('#ch$id').fancybox({'height':'20%'});\n"; // ,'titleShow':false,'width':'60%'});\n"; //echo "});</script>\n"; //echo '<div id="' . sprintf('phone-%x',$id) . '" style="display:none;font-size:28pt;">'; //echo $buf . '<br>' . $f; //echo '</div>'; // $buf.= $this->link('/contact.channel/view?id='.$this->data->id,$phone_img); break; case ContactChannel::EMAIL: //$email_img = img('/silk/1.3/email_edit.png','Edit Email'); //$image = img('/silk/1.3/email_go.png','Email'); echo '<span class="grow-huge">'; echo '<a href="' . Radix::link('/email/compose?to=' . $data['data']) . '">'; echo html($data['data']); echo '</a>'; echo '</span>'; // if (!empty($data['id'])) { // $i = img('/silk/1.3/email_edit.png','Edit Email'); // $html.= '<a href="' . $edit_link . '">'; // $html.= $i; // $html.= '</a>'; // } break; default: // $i = img('/silk/1.3/email_edit.png','Edit Email'); echo '<a href="' . Radix::link('/contact/channel?id=' . $data['id']) . '">'; echo html($data['data']); echo '</a>'; } // echo trim("$icon $name $link"); // // echo $html;
<?php /** @todo Link this Account to A Customer */ namespace Edoceo\Imperium; use Edoceo\Radix; use Edoceo\Radix\DB\SQL; use Edoceo\Radix\HTML\Form; $this->Account = new Account($_GET['id']); // $this->form('Account',array('action'=>$this->appurl.'/account/save','method'=>'post')); echo '<form action="' . Radix::link('/account/save') . '" method="post">'; echo '<table>'; echo "<tr><td class='l'>Kind:</td><td colspan='2'>" . Form::select('kind', $this->Account['kind'], $this->AccountKindList) . "</td></tr>"; echo "<tr><td class='l'>Code & Name:</td><td>" . Form::text('code', $this->Account['code'], array('size' => 6)) . '</td>'; echo '<td>' . Form::text('name', $this->Account['name']) . '</td>'; echo '</tr>'; // Note // echo "<tr><td class='b r'>Note:</td><td colspan='2'>" . $this->formText('note',$this->Account->note,array('size'=>40)) . "</td></tr>"; // Parent Account $list = array(0 => '- None -'); $list[0] = '- None -'; foreach ($this->AccountList as $item) { if (!empty($item['parent_id'])) { continue; } $list[$item['id']] = $item['full_name']; } echo "<tr><td class='b r'>Parent:</td><td colspan='2'>" . Form::select('parent_id', $this->Account['parent_id'], $list) . '</td></tr>'; /*
<?php /** Create a new Contact */ namespace Edoceo\Imperium; use Edoceo\Radix; $_ENV['title'] = array('Contact', 'Create'); $this->Contact = new Contact(null); if (!empty($_GET['parent'])) { $c = new Contact(intval($_GET['parent'])); if (!empty($c['id'])) { $this->Contact['parent_id'] = $c['id']; } } Radix::$path = '/contact/view';
<?php /** */ namespace Edoceo\Imperium; use Edoceo\Radix; use Edoceo\Radix\Session; Session::kill(); Radix::redirect('/auth/sign-in');
<?php /** Work Order Create Action Create a new Work Order */ namespace Edoceo\Imperium; use Edoceo\Radix; $_ENV['title'] = array('WorkOrder', 'Create'); $this->WorkOrder = new WorkOrder(null); if (!empty($_GET['c'])) { $c = new Contact(intval($_GET['c'])); if (!empty($c['id'])) { $this->WorkOrder['contact_id'] = $c['id']; $this->Contact = $c; if (!empty($c->contact)) { $this->WorkOrder['requester'] = $c['contact']; } // @todo Should be getSubContacts() $this->ContactList = $this->Contact->getContactList(); // $this->view->ContactAddressList = $db->fetchPairs("select id,address from contact_address where contact_id={$id}"); } } Radix::$path = '/workorder/view';
// Output // $page_link = $this->paginationControl($this->Page,'All','../elements/page-control.phtml'); // echo $page_link; // First Character Index // @todo Would be cool to highlight //$a = empty($_GET['a']) ? null : $_GET['a']; $opts = array('page' => 1, 'sort' => $this->Sort); $list = array(); if (!empty($this->Char)) { $opts['char'] = null; $list[] = '<a href="?' . http_build_query($opts) . '">ALL</a>'; } if ($this->Char == '#') { $list[] = '<span class="hi"> # </span>'; } else { $opts['char'] = '#'; $list[] = '<a href="?' . http_build_query($opts) . '"> # </a>'; } // Alphabet Link for ($i = 65; $i <= 90; $i++) { $opts['char'] = chr($i); if ($opts['char'] == $this->Char) { $list[] = '<span class="hi"> ' . $opts['char'] . ' </span>'; } else { $list[] = '<a href="?' . http_build_query($opts) . '"> ' . chr($i) . ' </a>'; } //$this->link('/contact?' . http_build_query($opts),' ' . chr($i) . ' ') . ' '; } echo '<div class="jump_list">' . implode(' ', $list) . '</div>'; echo Radix::block('contact-list', array('list' => $this->ContactList)); echo $page_link;
return 0; } if (count($data['list']) == 0) { return 0; } echo '<div id="note-list">'; $i = 0; foreach ($data['list'] as $item) { //$i++; //Zend_Debug::dump($i); // $item = new Base_Note($x); if (empty($item['name'])) { $item['name'] = '- Untitled -'; } $date = date('m/d/y', strtotime($item['cts'])); $link = Radix::link('/note/view?id=' . $item['id']); echo '<p>'; switch ($item['kind']) { case 'Conversation': echo '<i class="fa fa-file-text"></i> '; break; case 'Note': echo '<i class="fa fa-file-text-o"></i> '; break; } echo star($item['star']); // echo '<td class="b"><a onclick="$(\'#note-edit\').load(\'' . $link . '\'); return false;" href="' . $link . '">' .$item->name . '</a></td>'; echo '<a class="fancybox fancybox.ajax" href="' . $link . '">' . $item['name'] . '</a>'; // echo '<td style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 80%;">' . substr($item->data,0,32). '</td>'; // echo "<td class='c'>" . AppHelper::dateNice($date) . "</td>"; echo '</p>';
A Form for creating or editing a Contact Channel */ namespace Edoceo\Imperium; use Edoceo\Radix; use Edoceo\Radix\HTML\Form; echo '<form method="post">'; echo '<div>'; // echo Form::hidden('id', $this->ContactChannel['id']); echo Form::hidden('contact_id', $this->ContactChannel['contact_id']); echo '</div>'; echo '<table>'; echo "<tr><td class='b r'>Kind:</td><td>" . Form::select('kind', $this->ContactChannel['kind'], ContactChannel::$kind_list) . '</td></tr>'; echo "<tr><td class='b r'>Name:</td><td>" . Form::text('name', $this->ContactChannel['name']) . '</td></tr>'; echo "<tr><td class='b r'>Data:</td><td>" . Form::text('data', $this->ContactChannel['data']) . '</td></tr>'; // echo "<tr><td class='b r'>Primary:</td><td>". Form::formCheckbox('primary')."</td></tr>"; echo '</table>'; echo '<div class="bf">'; // echo '<button class="exec" name="a" value="apply">Apply</button>'; echo '<button class="exec" name="a" value="save">Save</button>'; if (empty($this->ContactChannel['id'])) { echo '<button class="warn" name="a" value="cancel">Cancel</button>'; } else { echo '<button class="fail" name="a" value="delete">Delete</button>'; } echo '</div>'; echo '</form>'; // History $args = array('list' => $this->ContactChannel->getHistory()); echo Radix::block('diff-list', $args);
// $this->_redirect('/account/transaction?id=' . $aje->id); // } if ('save-copy' == $_POST['a']) { // $_SESSION['account-transaction'] = $aje; // $_SESSION['account-transaction-list' = array(); // ] = $ale; // // $_SESSION['new-transaction'] = $aje; Radix::redirect('/account/transaction'); } // Redirect Back $ret = '/account/ledger'; if (!empty($_SESSION['return-path'])) { $ret = $_SESSION['return-path']; unset($_SESSION['return-path']); } Radix::redirect($ret); break; } if ($id) { $this->AccountJournalEntry = new AccountJournalEntry($id); // //$this->_d->fetchRow("select * from account_journal where id = $id"); //$sql = $this->_d->select(); //$sql->from('general_ledger'); //$sql->where('account_journal_id = ?', $id); //$sql->order(array('account_full_code','amount')); // $sql = $this->_d->select(); // $sql->from(array('al'=>'account_ledger')); // $sql->join(array('a'=>'account'),'al.account_id = a.id',array('a.full_name as account_name')); // $sql->where('al.account_journal_id = ?', $id); // //$sql->order(array('al.amount asc','a.full_code'));
use Edoceo\Radix; echo '<table>'; echo '<tr>'; echo '<th>Name</th>'; echo '<th>Phone</th>'; echo '<th>Email</th>'; echo '</tr>'; foreach ($data['list'] as $item) { echo '<tr class="rero ' . $item['kind'] . '">'; // Show Contact, if none show Name echo '<td>'; echo '<a href="' . Radix::link('/contact/view?c=' . $item['id']) . '">'; switch (strtolower($item['kind'])) { case 'company': echo '<i class="fa fa-building"></i> '; break; case 'vendor': echo '<i class="fa fa-truck"></i> '; break; case 'person': default: echo '<i class="fa fa-user"></i> '; } echo html($item['name']); echo '</a>'; echo '</td>'; echo '<td>' . Radix::block('stub-channel', array('kind' => ContactChannel::PHONE, 'data' => $item['phone'])) . '</td>'; echo '<td>' . Radix::block('stub-channel', array('kind' => ContactChannel::EMAIL, 'data' => $item['email'])) . '</td>'; echo '</tr>'; } echo '</table>';
use Edoceo\Radix; use Edoceo\Radix\Session; use Edoceo\Radix\DB\SQL; $sql = 'SELECT id, name, cts FROM base_note'; // $this->_d->select(); $sql .= ' WHERE link IS NULL OR link = \'\''; $sql .= ' ORDER BY name'; // $sql->from('base_note',array('id','name','cts')); // $sql->where('link is null'); // $sql->order(array('name')); $res = SQL::fetch_all($sql); // $page = Zend_Paginator::factory($sql); // $page->setCurrentPageNumber($this->_request->getParam('page')); // $page->setItemCountPerPage(30); // $page->setPageRange(10); // if ($cpage->getTotalItemCount()) { if (0 != count($res)) { $a_id = $res[0]['id']; $z_id = $res[count($res)]['id']; $title = array(); $title[] = sprintf('Notes %d through %d', $a_id, $z_id); $title[] = sprintf('Page %d of %d', 1, 99); $_ENV['title'] = $title; } else { $_ENV['title'] = 'Notes'; Session::flash('info', 'There are no notes created'); } // $this->view->Page = $page; // echo $this->paginationControl($this->Page,'All','../elements/page-control.phtml'); echo Radix::block('note-list', array('list' => $res, 'page' => 1)); // echo $this->paginationControl($this->Page,'All','../elements/page-control.phtml');
if ('data:image/jpeg;base64,' == substr($image, 0, 23)) { $b64 = substr($image, 22); // Radix::dump($b64); $jpg_data = base64_decode($b64); $dir = sprintf('%s/webroot/img/content/contact/%u', APP_ROOT, $this->Contact['id']); if (!is_dir($dir)) { mkdir($dir, 0755, true); } $jpg_file = sprintf('%s/0.jpg', $dir); $res = file_put_contents($jpg_file, $jpg_data); if (0 == $res) { Session::flash('fail', 'Unable to write the snapshot'); } } if ('data:image/png;base64,' == substr($image, 0, 22)) { $b64 = substr($image, 22); Radix::dump($b64); $png_data = base64_decode($b64); $dir = sprintf('%s/webroot/img/content/contact/%u', APP_ROOT, $this->Contact['id']); if (!is_dir($dir)) { mkdir($dir, 0755, true); } $png_file = sprintf('%s/0.png', $dir); $res = file_put_contents($png_file, $png_data); if (0 == $res) { Session::flash('fail', 'Unable to write the snapshot'); } } Session::flash('info', 'Capture Saved'); Radix::redirect('/contact/view?c=' . $this->Contact['id']); }
<?php /** @file @brief Views a Note using the note/edit element */ namespace Edoceo\Imperium; use Edoceo\Radix; use Edoceo\Radix\HTML\Form; $this->Note = new Base_Note($_GET['id']); $_ENV['title'] = array('Note', 'Edit', $this->Note['name']); $note = $this->Note['note']; if (class_exists('\\Parsedown')) { $P = new \Parsedown(); $note = $P->text($note); } echo '<div class="markdown" style="background:#e0e0e0;border:2px inset #666;padding:8px;">'; echo $note; echo '</div>'; echo '<form action="' . Radix::link('/note/save') . '" id="note-edit-form" method="post">'; echo '<div class="cmd">'; echo Form::hidden('id', $this->Note['id']); echo Form::hidden('link', $this->Note['link']); echo '<input class="exec" name="a" type="submit" value="Edit">'; echo '</div>'; echo '</form>';
echo '</ul>'; echo '</li>'; // Plugins // @todo Google Link-Up - Plugin Menu/Config? $list = array(); if (!empty($_ENV['google']['apps_domain'])) { // @note Think These should Link Out to Google Services $x = $_ENV['google']['apps_domain']; $list[] = '<li><a href="https://mail.google.com/a/' . $x . '" target="_blank">Google Mail</a></li>'; $list[] = '<li><a href="https://www.google.com/calendar/hosted/' . $x . '" target="_blank">Google Calendar</a></li>'; $list[] = '<li><a href="https://docs.google.com/a/' . $x . '" target="_blank">Google Documents</a></li>'; // $list[] = sprintf('<a href="https://mail.google.com/tasks/a/' . $x . '/m" target="_blank"> Tasks</a>',$x); $list[] = '<li><a href="https://mail.google.com/tasks/a/' . $x . '/ig" target="_blank">Google Tasks</a></li>'; } if (!empty($_ENV['plugin'])) { foreach ($_ENV['plugin'] as $k => $v) { $list[] = '<li><a href="' . Radix::link('/plugin?p=' . $k) . '">' . $k . '</a></li>'; // echo '<li><a href="/plugin?p=' . $_ENV[$v]['link'] . '">' . $k . '</a></li>'; } } if (count($list)) { echo '<li><a href="#"><span>' . img('/tango/24x24/categories/preferences-system.png') . ' Plugins</span></a>'; echo '<ul>' . implode('', $list) . '</ul>'; echo '</li>'; } // Search Form echo '<li style="float:right;">'; echo '<form action="' . Radix::link('/search') . '" method="get">'; echo '<input id="q" name="q" placeholder="Search" value="" />'; echo '</form></li>'; echo '</ul>';
continue; } $info = $_ENV['data'][$name]; if (count($info['list']) > 0) { // echo "<div style='display: table-cell;'>"; echo '<div>'; // style='display: table-cell;'>"; echo sprintf('<h2>%d %s</h2>', count($info['list']), $name); echo Radix::block($info['view'], array('list' => $info['list'], 'opts' => array('head' => true))); echo '</div>'; // Radix::dump($info); } } // Show the Events $sql = 'SELECT contact_event.*, contact.name AS contact_name FROM contact_event'; $sql .= ' JOIN contact ON contact_event.contact_id = contact.id'; // $sql.= ' WHERE flag = 0'; $sql .= ' ORDER BY contact_event.xts DESC'; $sql .= ' LIMIT 20'; $res = SQL::fetch_all($sql); foreach ($res as $rec) { echo '<p>'; echo '<a href="' . Radix::link('/contact/view?c=' . $rec['contact_id']) . '">' . html($rec['contact_name']) . '</a>'; echo ' - '; echo html($rec['name']); echo ' - '; echo html($rec['note']); echo '</p>'; echo '<p>Due: ' . strftime('%Y-%m-%d %H:%M', $rec['xts']) . '</p>'; // Radix::dump($rec); }
// Search // echo '<form action="' . Radix::link('/account/search') . '">'; // echo '<div>'; // echo '<input type="text" name="q" value="">'; // echo '<button value="search">Search</button>'; // echo '</div>'; echo '<p><strong>Cash</strong> basis, reports for money collected when B&O</p>'; echo '<p>Accounts for Period: ' . $this->date_alpha . ' - ' . $this->date_omega . '</p>'; echo '<table>'; foreach ($this->AccountList as $item) { if ($x_kind != $item['kind']) { echo "<tr><th>Code</th><th>{$item['kind']}</th><th>Balance</th><th colspan='3'>Actions</th></tr>"; } echo '<tr class="rero">'; $indent = str_repeat(' ', substr_count($item['full_code'], '/')); echo '<td>' . $indent . '<a href="' . Radix::link('/account/ledger?id=' . $item['id']) . '">' . html($item['full_code']) . '</td>'; echo "<td>{$item['name']}"; if (strlen($item['account_tax_line_name'])) { echo " <span class='s'>({$item['account_tax_line_name']})</span>"; } echo '</td>'; echo '<td class="r">' . number_format(abs($item['balance']), 2) . '</td>'; // echo '<td class="r"><a href="' . Radix::link('/account/ledger?id=' . $item['id']) . '">' . $img_al . '</td>'; echo '<td class="r"><a href="' . Radix::link('/account/journal?id=' . $item['id']) . '"><i class="fa fa-align-left"></i></td>'; echo '<td class="r"><a href="' . Radix::link('/account/edit?id=' . $item['id']) . '"><i class="fa fa-check-square-o"></i></td>'; echo '</tr>'; $x_kind = $item['kind']; } echo '</table>'; Radix::dump($_GET);
<?php /** @file @brief Invoice Index View Shows Paginated Results of the Index View */ namespace Edoceo\Imperium; use Edoceo\Radix; echo Radix::block('page-link', array('cur' => $this->page_cur, 'max' => $this->page_max, 'size' => $_GET['size'])); echo Radix::block('invoice-list', array('list' => $this->list)); echo Radix::block('page-link', array('cur' => $this->page_cur, 'max' => $this->page_max, 'size' => $_GET['size']));
<?php /** Render the Invoice as a PDF */ namespace Edoceo\Imperium; use Edoceo\Radix; Radix::$theme_name = 'pdf'; // $l = Zend_Layout::getMvcInstance(); // $l->setLayout('pdf'); $iv = null; if (!empty($_GET['i'])) { $iv = new Invoice($_GET['i']); } else { $ss = Zend_Registry::get('session'); if (isset($ss->Invoice)) { $iv = $ss->Invoice; } else { $iv = new Invoice($_GET['i']); } } if (empty($iv['id'])) { throw new Exception('Invalid Invoice Id', __LINE__); } $pdf = new PDF\Invoice(); $pdf->loadInvoice($iv); // $this->view->file = new stdClass(); // $this->view->file->name = 'Invoice-' . $iv->id . '.pdf'; // $this->view->file->data = $pdf->render(); // $this->view->file->size = strlen($this->view->file->data);
$sql .= ' ORDER BY contact.name'; if (preg_match('/[_%]/', $q)) { $sql = str_replace('#op#', 'LIKE', $sql); } elseif (preg_match('/[\\.\\*\\+\\?]/', $q)) { $sql = str_replace('#op#', '~*', $sql); } else { $sql = str_replace('#op#', '=', $sql); } // Radix::dump($sql); // Radix::dump($arg); $res = SQL::fetch_all($sql, $arg); // Radix::dump(SQL::lastError()); // Radix::dump($res); foreach ($res as $rec) { $idx++; echo '<dt><a href="' . Radix::link('/contact/view?c=' . $rec['id']) . '">Contact: ' . $rec['name'] . '</a></dt>'; } echo '</dl>'; if ($idx == 0) { _draw_rebuild_prompt(); return 0; } $_ENV['title'] = array('Search', $q, $idx == 1 ? '1 result' : $idx . ' results'); /** Draw the Rebuild Button */ function _draw_rebuild_prompt() { echo '<div style="padding:32px;">'; echo '<form method="post">'; echo '<button name="a" value="rebuild">Rebuild Index</button>';
$body = str_replace('$wi_name', $woi['name'], $body); $body = str_replace('$wi_note', $woi['note'], $body); $body = str_replace('$wi_quantity_est', $woi['e_quantity'], $body); $body = str_replace('$wi_rate_est', $woi['e_rate'], $body); $body = str_replace('$wi_unit_est', $woi['e_unit'], $body); $body = str_replace('$wi_quantity', $woi['a_quantity'], $body); $body = str_replace('$wi_rate', $woi['a_rate'], $body); $body = str_replace('$wi_unit', $woi['a_unit'], $body); $body = str_replace('$wi_cost', sprintf('%0.4f', $woi['a_quantity'] * $woi['a_rate']), $body); $body = str_replace('$wi_status', $woi['status'], $body); $mail['body'] = $body; $_SESSION['mail-compose'] = $mail; // Want to Add This History $_SESSION['return-path'] = '/workorder/view?w=' . $wo['id']; Radix::redirect('/email/compose'); } Radix::redirect('/workorder/view?w=' . $wo['id']); break; case 'view': $id = intval($_GET['id']); $woi = new WorkOrderItem($id); if (empty($woi['id'])) { Session::flash('fail', sprintf('Cannot find Work Order Item #%d', $id)); return; } $this->WorkOrder = new WorkOrder($woi['workorder_id']); $this->WorkOrderItem = $woi; break; default: Radix::dump($_POST); }
// echo '<link href="//gcdn.org/normalize/3.0.2/normalize.css" rel="stylesheet">'; echo '<link href="//gcdn.org/pure/0.6.0/pure.css" rel="stylesheet">'; echo '<link href="//gcdn.org/font-awesome/4.2.0/font-awesome.css" rel="stylesheet">'; // echo '<link href="//gcdn.org/jquery-ui/1.10.2/smoothness.css" rel="stylesheet">'; echo '<link href="//gcdn.org/radix/radix.css" rel="stylesheet">'; echo '<link href="' . Radix::link('/css/base.css') . '" rel="stylesheet">'; echo '<link href="' . Radix::link('/img/imperium-icon.ico') . '" rel="shortcut icon">'; echo '<link href="' . Radix::link('/img/imperium-icon.png') . '" rel="apple-touch-icon">'; echo '<script src="//gcdn.org/jquery/1.10.2/jquery.js"></script>'; echo '<script src="//gcdn.org/jquery-ui/1.10.2/jquery-ui.js"></script>'; echo '<script src="' . Radix::link('/js/imperium.js') . '"></script>'; echo '<script>Imperium.base = "' . Radix::base(true) . '";</script>'; echo "</head>\n<body>\n"; // Content Header echo '<header>'; $menu = Radix::block('menu.php'); if (!empty($menu)) { echo '<div id="menu">'; echo $menu; echo '</div>'; // echo ImperiumView::mruDraw(); } // if (!empty($this->title_one)) { // echo '<h2>' . $this->title_one . '</h2>'; // } // if (!empty($this->title_two)) { // echo $this->title_two; // } echo '</header>'; // Menu for Authenticated Users Only // $auth = Zend_Auth::getInstance();
var txt = $('#note-' + jei).val(); var off = $('#account_id-' + jei).val(); var dr = $('#je' + jei + 'dr').val(); var cr = $('#je' + jei + 'cr').val(); var arg = { a: 'save-one', date: dts, note: txt, offset_account_id: off, cr: cr, dr: dr }; $.post('<?php echo Radix::link('/account/reconcile'); ?> ', arg, function(res, ret) { switch (ret) { case 'success': // Advance to Next Visible $('#journal-entry-index-' + jei).nextAll('.reconcile-show:first').find('.account-name').focus(); // $('#account_name-' + (jei + 1)).focus(); // Remove Row $('#journal-entry-index-' + jei).remove(); // Decrement Counter var size = parseInt( $('#reconcile-item-size').html() ) || 0; if (size > 1) { size--;
echo '</td>'; // Status echo "<td class='b r'>Status:</td><td><select name='status'>"; foreach (array('', 'New', 'Not Started', 'In Progress', 'Completed', 'Waiting', 'Deferred') as $x) { echo "<option " . ($x == $this->Note['status'] ? 'selected ' : null) . " value='{$x}'>{$x}</option>"; } echo '</select></td>'; echo '</tr>'; if (!empty($this->Note['link'])) { echo '<tr>'; echo '<td class="l">Link To:</td>'; echo '<td>'; // @todo this is not elegant /djb 20111013 if (preg_match('/(contact|invoice|workorder):(\\d+)/', $this->Note['link'], $m)) { $page = '/' . $m[1] . '/view?' . substr($m[1], 0, 1) . '=' . $m[2]; echo '<a href="' . Radix::link($page) . '">' . ucfirst($m[1]) . ' #' . $m[2] . '</a>'; } else { echo $this->Note['link']; } echo '</td>'; echo '</tr>'; } // Tags //$opts = array('class'=>'tb','div'=>false,'label'=>false,'size'=>64); //echo "<tr><td class='b r'>Tags:</td><td colspan='3'>" . $this->formText('tags',$this->Note->tags,$opts) . "</td></tr>"; // Previous text of Conversation if ($this->Note['kind'] == 'Conversation') { echo '<tr><td colspan="6"><pre>' . $this->Note['note'] . '</pre></td></tr>'; $this->Note['note'] = null; } echo '</td></tr>';