if ($id) { Session::flash('info', 'Invoice #' . $Invoice['id'] . ' saved'); } else { Session::flash('info', 'Invoice #' . $Invoice['id'] . ' created'); } Radix::redirect('/invoice/view?i=' . $Invoice['id']); break; // Email the Invoice // Email the Invoice case 'send': $co = new Contact($Invoice['contact_id']); // Sent Good if ($_GET['sent'] == 'true') { $msg = 'Invoice #' . $Invoice['id'] . ' sent to ' . $this->_s->EmailSentMessage->to; unset($this->_s->EmailSentMessage->to); Base_Diff::note($iv, $msg); $this->_s->msg = $msg; $this->redirect('/invoice/view?i=' . $Invoice['id']); } $ah = Auth_Hash::make($Invoice); $this->_s->EmailComposeMessage = new \stdClass(); $this->_s->EmailComposeMessage->to = $co['email']; //$ss->EmailComposeMessage->to = $co->email; //if ($co->kind != 'Person') { // if ($list = $co->getContactList(Contact::FLAG_BILL)) { // $to = array(); // foreach ($list as $x) { // $to[] = $x->email; // } // $this->_s->EmailComposeMessage->to = implode(',',$to); // $this->_s->EmailComposeMessage->body = 'Hello, ' . $list[0]->first_name . ",\n";
<?php namespace Edoceo\Imperium; use Edoceo\Radix\DB\SQL; $id = intval($_GET['w']); $this->WorkOrder = new WorkOrder($id); // Record Being Sent if (!empty($this->_s->ReturnFrom) && $this->_s->ReturnFrom == 'mail') { unset($this->_s->ReturnFrom); if ($this->_s->ReturnCode == 200) { $msg = 'Work Order #' . $this->WorkOrder->id . ' sent to ' . $this->_s->EmailSentMessage->to; unset($this->_s->EmailSentMessage->to); Base_Diff::note($this->WorkOrder, $msg); $this->_s->info[] = $msg; } unset($this->_s->ReturnCode); } // Adding a Contact? //if ( ($_POST['c'] == 'Add') && (!empty($_POST['add_contact_id'])) ) { // $sql = 'INSERT INTO workorder_contact (workorder_id,contact_id) VALUES (%d,%d)'; // $this->_d->query(sprintf($sql,$this->WorkOrder->id,$_POST['add_contact_id'])); // $this->_s->info[] = 'The Contact has been Added'; // $this->_redirect('/workorder/view?w=' . $this->WorkOrder->id); // break; //} if ($this->WorkOrder['id'] > 0) { $_ENV['title'] = array('WorkOrder', 'View', "#{$id}"); $this->Contact = new Contact($this->WorkOrder['contact_id']); // Show Notes $this->WorkOrderNoteList = $this->WorkOrder->getNotes();