<?php /** */ namespace Edoceo\Imperium; use Edoceo\Radix\DB\SQL; $sql = 'SELECT name AS id,name FROM base_enum WHERE link = ? ORDER BY sort'; $this->KindList = SQL::fetch_mix($sql, array('contact-kind')); $this->StatusList = SQL::fetch_mix($sql, array('contact-status')); // function createAction() // { // $_ENV['title'] = array('Contact','Create'); // $P = new Contact(intval($_GET['parent'])); // if ($P->id) { // $this->view->Contact['parent_id'] = $P['id']; // $this->view->Contact['company'] = $P['company']; // $this->view->Contact['phone'] = $P['phone']; // $this->view->Contact['url'] = $P['url']; // } // $this->render('view'); // } //
namespace Edoceo\Imperium; use Edoceo\Radix\Session; use Edoceo\Radix\DB\SQL; $id = intval($_GET['i']); $this->Invoice = new Invoice($id); if (!empty($_GET['sent']) && $_GET['sent'] == 'good') { Radix\Session::flash('info', 'Invoice Status updated'); $this->Invoice['status'] = 'Sent'; $this->Invoice->setFlag(Invoice::FLAG_SENT); $this->Invoice->save(); // Base_Diff::note($this->Invoice, $this->_s->info); } $_ENV['invoice']['id'] = $this->Invoice['id']; $this->Contact = new Contact($this->Invoice['contact_id']); $this->ContactAddressList = SQL::fetch_mix('select id,address from contact_address where contact_id = ?', array($this->Invoice['contact_id'])); $this->InvoiceItemList = $this->Invoice->getInvoiceItems(); $this->InvoiceNoteList = $this->Invoice->getNotes(); $this->InvoiceFileList = $this->Invoice->getFiles(); $this->InvoiceHistoryList = $this->Invoice->getHistory(); $this->InvoiceTransactionList = $this->Invoice->getTransactions(); // Add Prev / Next Links $this->jump_list = array(); if (!empty($this->Invoice['id'])) { // Previous Ones $s = sprintf('SELECT id FROM invoice where id < %d order by id desc limit 5', $this->Invoice['id']); $r = SQL::fetch_all($s); $r = array_reverse($r); foreach ($r as $x) { $this->jump_list[] = array('controller' => 'invoice', 'action' => 'view', 'id' => $x['id']); }
<?php /** WorkorderController init Sets the ACL for this Controller */ namespace Edoceo\Imperium; use Edoceo\Radix\DB\SQL; //$acl = Zend_Registry::get('acl'); //if ($acl->has('workorder') == false) { // $acl->add( new Zend_Acl_Resource('workorder') ); //} //$acl->allow('user','workorder'); // parent::init(); $sql = 'SELECT name AS id,name FROM base_enum WHERE link = ? ORDER BY sort'; $this->StatusList = SQL::fetch_mix($sql, array('invoice-status')); $this->ItemStatusList = SQL::fetch_mix($sql, array('invoice-item-status')); $this->UnitList = Base_Unit::getList();
static function getList() { $sql = 'select id,name from base_unit order by name'; return SQL::fetch_mix($sql); }
$_ENV['mode'] = 'view'; if ($_FILES['file']['error'] == 0) { $this->Account = new Account($_POST['account_id']); $_ENV['title'] = array('Account', 'Reconcile', $this->Account['full_name'], 'Preview'); // Read File $arg = array('kind' => $_POST['format'], 'file' => $_FILES['file']['tmp_name'], 'account_id' => $_POST['upload_id']); $this->JournalEntryList = Account_Reconcile::parse($arg); } else { Session::flash('fail', 'Failed to Upload'); } // @todo If the Target Account is Asset then Other Side Only (and vice-versa) $sql = 'SELECT id,full_name '; $sql .= 'FROM account '; // $sql.= "WHERE kind like 'Expense%' "; $sql .= 'ORDER BY full_code ASC, code ASC'; $this->AccountPairList = SQL::fetch_mix($sql); $_SESSION['reconcile_upload_id'] = $_POST['upload_id']; $_SESSION['reconcile_offset_id'] = $_POST['offset_id']; $_ENV['upload_account_id'] = $_SESSION['reconcile_upload_id']; $_ENV['offset_account_id'] = $_POST['offset_id']; break; case 'save': // Save the Uploaded Transactions $_ENV['upload_account_id'] = $_SESSION['reconcile_upload_id']; Radix::dump($_POST); return 0; $c = ceil(count($_POST) / 4); for ($i = 1; $i <= $c; $i++) { // Skip Entries Missing Date (or the last of the count) if (empty($_POST[sprintf('je%ddate', $i)])) { continue;
<?php /** WorkorderController init Sets the ACL for this Controller */ namespace Edoceo\Imperium; use Edoceo\Radix\DB\SQL; //$acl = Zend_Registry::get('acl'); //if ($acl->has('workorder') == false) { // $acl->add( new Zend_Acl_Resource('workorder') ); //} //$acl->allow('user','workorder'); // parent::init(); $sql = 'SELECT name AS id,name FROM base_enum WHERE link = ? ORDER BY sort'; $this->KindList = SQL::fetch_mix($sql, array('workorder-kind')); $this->StatusList = SQL::fetch_mix($sql, array('workorder-status')); $this->ItemStatusList = SQL::fetch_mix($sql, array('workorder-item-status'));