diff --git a/controllers/email_attachments_controller.php b/controllers/email_attachments_controller.php index 1ccd22ef..3189850e 100755 --- a/controllers/email_attachments_controller.php +++ b/controllers/email_attachments_controller.php @@ -6,8 +6,14 @@ class EmailAttachmentsController extends AppController { function download($id) { - Configure::write('debug', 0); + $file = $this->EmailAttachment->findById($id); + if(file_exists($file['EmailAttachment']['filename'])) { + + + + Configure::write('debug', 0); + header('Content-type: ' . $file['EmailAttachment']['type']); header('Content-length: ' . $file['EmailAttachment']['size']); header('Content-Disposition: attachment; filename='.$file['EmailAttachment']['name']); @@ -17,6 +23,11 @@ class EmailAttachmentsController extends AppController { readfile($file['EmailAttachment']['filename']); // echo $file['EmailAttachment']['filename'] exit(); + } + else { + echo "ERROR!! : File Not Found"; + echo $file['EmailAttachment']['filename']; + } } } diff --git a/controllers/enquiries_controller.php b/controllers/enquiries_controller.php index 6d453745..84b37933 100755 --- a/controllers/enquiries_controller.php +++ b/controllers/enquiries_controller.php @@ -7,9 +7,9 @@ class EnquiriesController extends AppController { var $paginate = array( - 'contain' => false, - 'limit' => 150, - 'order'=>array('Enquiry.id' => 'desc') + 'contain' => false, + 'limit' => 150, + 'order'=>array('Enquiry.id' => 'desc') ); @@ -29,8 +29,8 @@ class EnquiriesController extends AppController { } $this->set('status_list', $status_list); - //debug($this->paginate()); - // $this->set('status_list', $this->Enquiry->Status->find('list')); + //debug($this->paginate()); + // $this->set('status_list', $this->Enquiry->Status->find('list')); } function view($id = null) { @@ -50,11 +50,11 @@ class EnquiriesController extends AppController { //$this->set('files', $this->Enquiry->EnquiryFile->find('all', array('conditions' => array('EnquiryFile.enquiry_id'=>$id), 'order' => 'EnquiryFile.created ASC'))); - /* Trying to optimise the queries for this part of the view - it's currently getting bogged down checking Email Attachments. + /* Trying to optimise the queries for this part of the view - it's currently getting bogged down checking Email Attachments. * Going to create an array describing whether a particular email ID has an attachment. Trying to avoid checking binary data in a find('all') call - */ + */ -/* + /* $emails = $this->Enquiry->Email->find('all', array( 'recursive' => 0, 'contain' => 'EmailAttachment.id', 'EmailAttachment.email_id', @@ -67,7 +67,7 @@ class EnquiriesController extends AppController { TO DO: * Fix up Email Attachment icon on email box. Currently broken -KC 6/8/09 $this->set('number_of_emails', $this->Enquiry->Email->find('count', array('conditions'=>array('Email.enquiry_id'=>$id)))); - */ + */ $this->set('emails', $this->Enquiry->Email->find('all', array('conditions'=>array('Email.enquiry_id' => $id)))); $this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id)))); @@ -100,7 +100,7 @@ class EnquiriesController extends AppController { } if(isset($customer)) { - /* Check if the customer exists in the database - otherwise send the user back to step 1*/ + /* Check if the customer exists in the database - otherwise send the user back to step 1*/ if(!$customer) { $this->Session->setFlash(__('The customer must already exist in the database. Please try again', true)); $this->redirect(array('action'=>'add')); @@ -155,12 +155,12 @@ class EnquiriesController extends AppController { } } - /* Internal function to display page 2 of the Add Enquiry Form Wizard + /* Internal function to display page 2 of the Add Enquiry Form Wizard * to help make the flow-control logic of the add function clearer. * */ function __showPage2($customer) { - /* Combine the first_name and last_name for the Contact Drop Down Box */ + /* Combine the first_name and last_name for the Contact Drop Down Box */ $contacts = $this->Enquiry->Contact->find('all', array('conditions' => array('Contact.customer_id' => $customer['Customer']['id']))); $contacts = Set::Combine($contacts, '{n}.Contact.id', array('{0} {1}', '{n}.Contact.first_name', '{n}.Contact.last_name')); $states = $this->Enquiry->State->find('list'); @@ -173,7 +173,7 @@ class EnquiriesController extends AppController { $this->set('billing_addresses', $customerAddresses); $this->set('shipping_addresses', $customerAddresses); $this->set('errors', $this->Enquiry->invalidFields()); - /* Feels like an ugly hack. But it gets the desired effect and it will do for now */ + /* Feels like an ugly hack. But it gets the desired effect and it will do for now */ if(isset($customerAddresses[0]['BillingAddress'])) { $billing_address_list[0] = "No Address Selected"; @@ -192,7 +192,7 @@ class EnquiriesController extends AppController { - /* Add enquiry_id to the Email Queue */ + /* Add enquiry_id to the Email Queue */ function __addToQueue($id) { $enquiry = $this->Enquiry->read(null, $id); @@ -209,13 +209,13 @@ class EnquiriesController extends AppController { } } - /* Generate Enquiry number and return it as a string */ + /* Generate Enquiry number and return it as a string */ function __generateEnquiryNumber($data) { $state = $this->Enquiry->State->findById($data['Enquiry']['state_id']); $principle = $this->Enquiry->Principle->findById($data['Enquiry']['principle_id']); - /* Generate the enquiry number for this enquiry */ - /* CMC Enquiry number format is: + /* Generate the enquiry number for this enquiry */ + /* CMC Enquiry number format is: * CMCE- * eg. CMC1245NE351234-456 */ @@ -223,104 +223,104 @@ class EnquiriesController extends AppController { $enquiryoffset = 7882; //What Number Enquiry we were at before using this package. $enquiryid += $enquiryoffset; $enquiryid++; - /* Find how many enquiries have been for this principle code */ + /* Find how many enquiries have been for this principle code */ $principleenquiries = $this->Enquiry->findCount('principle_code ='. $principle['Principle']['code']); - /* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */ + /* Principle Code Offsets - Existing Number of Enquiries for each Principle Code */ $principlecode_offset = array( 15 => 207, //ELMAC, AMAL - 20 => 51, //T and B Electronic - 25 => 2062, //ATEX,Brilex,Marston - 35 => 2067, //Mid-West Instrument, DP - 36 => 47, //Reading Technologies - 37 => 2040, //Eldridge, Smart Measurement, Alia - 65 => 2212, //Papenmeier, Herberts Industrieglas - 85 => 586, //Analytical Systems, Misc - 95 => 181); //Comet, T and D. + 20 => 51, //T and B Electronic + 25 => 2062, //ATEX,Brilex,Marston + 35 => 2067, //Mid-West Instrument, DP + 36 => 47, //Reading Technologies + 37 => 2040, //Eldridge, Smart Measurement, Alia + 65 => 2212, //Papenmeier, Herberts Industrieglas + 85 => 586, //Analytical Systems, Misc + 95 => 181); //Comet, T and D. $principleenquiries += $principlecode_offset[$principle['Principle']['code']]; //Add the offset. $principleenquiries++; - /* Find how many enquiries have been for this principle code in this state */ - /* This aspect of the enquiry number is not useful anymore. Made redundant thanks to mySQL queries. + /* Find how many enquiries have been for this principle code in this state */ + /* This aspect of the enquiry number is not useful anymore. Made redundant thanks to mySQL queries. * But this has been done for backwards-compatablity with existing enquiry numbers */ $principleconditions = array - ( - "Enquiry.principle_code" => $principle['Principle']['code'], - "Enquiry.state_id" => $data['Enquiry']['state_id'] + ( + "Enquiry.principle_code" => $principle['Principle']['code'], + "Enquiry.state_id" => $data['Enquiry']['state_id'] ); $stateprincipleenquiries = $this->Enquiry->findCount($principleconditions); - /*Add the offsets for the State Principle Enquiries for each Code */ + /*Add the offsets for the State Principle Enquiries for each Code */ $stateprinciple_offset = array( - //Elmac, Amal - 15 => array("NSW" => 39, "VIC" => 38, "TAS" => 58, - "ACT" => 0, "QLD" => 30, "NT" => 0, - "WA" => 19, "SA" => 8, "Overseas" => 1), - //T and B Electronic - 20 => array("NSW" => 14, "VIC" => 6, "TAS" => 0, - "ACT" => 0, "QLD" => 8, "NT" => 0, - "WA" => 12, "SA" => 1, "Overseas" => 5), - //ATEX,Brilex,Marston - 25 => array("NSW" => 580, "VIC" => 599, "TAS" => 186, - "ACT" => 0, "QLD" => 254, "NT" => 3, - "WA" => 541, "SA" => 72, "Overseas" => 625), - //Mid-West Instrument, DP - 35 => array("NSW" => 549, "VIC" => 851, "TAS" => 9, - "ACT" => 0, "QLD" => 245, "NT" => 15, - "WA" => 470, "SA" => 508, "Overseas" => 154), - //Reading Technologies - 36 => array("NSW" => 1, "VIC" => 3, "TAS" => 0, - "ACT" => 0, "QLD" => 7, "NT" => 0, - "WA" => 0, "SA" => 4, "Overseas" => 2), - //Eldridge, Smart Measurement, Alia - 37 => array("NSW" => 204, "VIC" => 60, "TAS" => 1, - "ACT" => 0, "QLD" => 130, "NT" => 1, - "WA" => 44, "SA" => 25, "Overseas" => 18), - //Papenmeier, Herberts Industrieglas - 65 => array("NSW" => 498, "VIC" => 537, "TAS" => 44, - "ACT" => 0, "QLD" => 158, "NT" => 12, - "WA" => 138, "SA" => 25, "Overseas" => 174), - //Analytical Systems, Misc - 85 => array("NSW" => 3, "VIC" => 6, "TAS" => 0, - "ACT" => 0, "QLD" => 1, "NT" => 0, - "WA" => 2, "SA" => 2, "Overseas" => 0), - //Comet, T and D. - 95 => array("NSW" => 34, "VIC" => 28, "TAS" => 6, - "ACT" => 0, "QLD" => 29, "NT" => 0, - "WA" => 9, "SA" => 8, "Overseas" => 31), + //Elmac, Amal + 15 => array("NSW" => 39, "VIC" => 38, "TAS" => 58, + "ACT" => 0, "QLD" => 30, "NT" => 0, + "WA" => 19, "SA" => 8, "Overseas" => 1), + //T and B Electronic + 20 => array("NSW" => 14, "VIC" => 6, "TAS" => 0, + "ACT" => 0, "QLD" => 8, "NT" => 0, + "WA" => 12, "SA" => 1, "Overseas" => 5), + //ATEX,Brilex,Marston + 25 => array("NSW" => 580, "VIC" => 599, "TAS" => 186, + "ACT" => 0, "QLD" => 254, "NT" => 3, + "WA" => 541, "SA" => 72, "Overseas" => 625), + //Mid-West Instrument, DP + 35 => array("NSW" => 549, "VIC" => 851, "TAS" => 9, + "ACT" => 0, "QLD" => 245, "NT" => 15, + "WA" => 470, "SA" => 508, "Overseas" => 154), + //Reading Technologies + 36 => array("NSW" => 1, "VIC" => 3, "TAS" => 0, + "ACT" => 0, "QLD" => 7, "NT" => 0, + "WA" => 0, "SA" => 4, "Overseas" => 2), + //Eldridge, Smart Measurement, Alia + 37 => array("NSW" => 204, "VIC" => 60, "TAS" => 1, + "ACT" => 0, "QLD" => 130, "NT" => 1, + "WA" => 44, "SA" => 25, "Overseas" => 18), + //Papenmeier, Herberts Industrieglas + 65 => array("NSW" => 498, "VIC" => 537, "TAS" => 44, + "ACT" => 0, "QLD" => 158, "NT" => 12, + "WA" => 138, "SA" => 25, "Overseas" => 174), + //Analytical Systems, Misc + 85 => array("NSW" => 3, "VIC" => 6, "TAS" => 0, + "ACT" => 0, "QLD" => 1, "NT" => 0, + "WA" => 2, "SA" => 2, "Overseas" => 0), + //Comet, T and D. + 95 => array("NSW" => 34, "VIC" => 28, "TAS" => 6, + "ACT" => 0, "QLD" => 29, "NT" => 0, + "WA" => 9, "SA" => 8, "Overseas" => 31), ); $stateprincipleenquiries += $stateprinciple_offset[$principle['Principle']['code']][$state['State']['shortform']]; $stateprincipleenquiries++; - /* Generate/set the enquiry number */ + /* Generate/set the enquiry number */ $enquiryno = 'CMC'.$enquiryid.$state['State']['enqform'].'E'.$principle['Principle']['code'].$principleenquiries. - '-'.$stateprincipleenquiries; + '-'.$stateprincipleenquiries; return $enquiryno; } - /* Autocomplete the customer name - Used in: add.ctp */ + /* Autocomplete the customer name - Used in: add.ctp */ function completeCustomer() { $this->set('customers', $this->Enquiry->Customer->find('all', array( - 'conditions' => array( - 'Customer.name LIKE' => '%'.$this->data['Customer']['name'].'%' - ),'fields' => array('Customer.name') + 'conditions' => array( + 'Customer.name LIKE' => '%'.$this->data['Customer']['name'].'%' + ),'fields' => array('Customer.name') ))); $this->layout = 'ajax'; } - /* Moving this to the new Enquiry email sender. */ + /* Moving this to the new Enquiry email sender. */ function __sendNewEnquiryEmail($id) { - //Setup the SMTP Options + //Setup the SMTP Options $this->Email->smtpOptions = array( - 'port' => '25', - 'timeout' => '30', - 'host' => '192.168.0.8', - 'username' => 'sales', - 'password' => '2seng33+02'); + 'port' => '25', + 'timeout' => '30', + 'host' => '192.168.0.8', + 'username' => 'sales', + 'password' => '2seng33+02'); $this->Email->delivery = 'smtp'; $enquiry = $this->Enquiry->read(null, $id); @@ -382,7 +382,7 @@ class EnquiriesController extends AppController { $this->set('billing_addresses', $customerAddresses); $this->set('shipping_addresses', $customerAddresses); - /* Feels like an ugly hack. But it gets the desired effect and it will do for now */ + /* Feels like an ugly hack. But it gets the desired effect and it will do for now */ if(isset($customerAddresses[0]['BillingAddress'])) { $billing_address_list[0] = "No Address Selected"; @@ -402,7 +402,7 @@ class EnquiriesController extends AppController { $this->set(compact('enquiry', 'users','contacts','principles','statuses', 'addresses')); } - /* function update_status($enquiryid) { + /* function update_status($enquiryid) { $newid = $this->params['form']['value']; @@ -420,21 +420,66 @@ class EnquiriesController extends AppController { function update_status() { if($this->data) { App::import('Core', 'Sanitize'); - $new_status = Sanitize::clean($this->data['Enquiry']['status_id']); - $this->Enquiry->id = $this->data['Enquiry']['id']; - $this->Enquiry->saveField('status_id', $new_status); - $this->set('enquiry', $this->Enquiry->findById($this->data['Enquiry']['id'])); + $new_status = Sanitize::clean($this->data['Enquiry']['status_id']); + $this->Enquiry->id = $this->data['Enquiry']['id']; + $this->Enquiry->saveField('status_id', $new_status); + $this->set('enquiry', $this->Enquiry->findById($this->data['Enquiry']['id'])); } } + + /** + * For the search query form + */ function search() { - if(empty($this->data)) { - $this->Session->setFlash('Enter part of the Enquiry number you want to find'); + + } + + /** + * Actually performs the searches + */ + function doSearch() { + if(!empty($this->data)) { + $searchQuery = $this->data['Enquiry']['search_string']; + + $custConditions = array('Customer.name LIKE' => "%$searchQuery%"); + $enqConditions = array('Enquiry.title LIKE' => "%$searchQuery%"); + + $words = explode(" ", $searchQuery); + + if(count($words) == 2) { + $contactConditions = array('AND'=>array('Contact.first_name LIKE' => "%$words[0]%", + 'Contact.last_name LIKE' => "%$words[1]")); + } + else { + $contactConditions = array('OR'=>array('Contact.first_name LIKE' => "%$searchQuery%", + 'Contact.last_name LIKE' => "%$searchQuery")); + } + + $customerResults = $this->Enquiry->Customer->find('all', array('conditions' => $custConditions, 'recursive'=>0)); + $enquiryResults = $this->Enquiry->find('all', array('conditions'=>$enqConditions, 'recursive'=>0)); + $contactResults = $this->Enquiry->find('all', array('conditions'=>$contactConditions, 'recursive'=>0)); + + $searchDone = true; + + $statuses = $this->Enquiry->Status->find('all', array('recursive'=>0)); + $status_list = array(); + foreach ($statuses as $status) { + $statusid = $status['Status']['id']; + $status_list[$statusid] = $status['Status']['name']; + } + $this->set('status_list', $status_list); + + + $this->set(compact('customerResults', 'enquiryResults', 'contactResults', 'searchDone', 'status_list')); + $this->layout = 'ajax'; + } + } function mark_submitted($id = null) { diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index 69c1f2f2..175f9bd5 100755 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -14,7 +14,7 @@ class VaultShell extends Shell { /****************************************************** * Config Variables * *****************************************************/ - $testing = 0; //Whether to actually move the emails. 1=test, 0=production + $testing = 1; //Whether to actually move the emails. 1=test, 0=production /* Setup Connection to the IMAP server */ $username = 'vault'; $password = 'xjdYOsmJWc37'; /* The password for the account to be checked */ @@ -42,7 +42,7 @@ class VaultShell extends Shell { $number_of_messages = $MC->Nmsgs; echo "Number of messages to Process ".$number_of_messages."\n"; - + if($number_of_messages == 0) { exit(0); } @@ -61,9 +61,12 @@ class VaultShell extends Shell { $discardArray = array(); + //exit(0); + /* Loop through the messages and sort them into ones to be processed or discarded */ - for ($i=1; $i <= $number_of_messages; $i++) { + + for($i=1; $i <= $number_of_messages; $i++) { $this_header = imap_headerinfo($mbox, $i); $message = $this->getMessage($mbox, $i, $this_header); @@ -185,19 +188,41 @@ class VaultShell extends Shell { /* Finished working with the IMAP server. Make the changes and close the connection */ - if($testing == 0) { + //if($testing == 0) { + + + + echo "Tidying up now. Moving messages to Stored or Discarded\n"; + reset($discardArray); reset($storedArray); - $storeSet = implode(",", $storedArray); - $discardSet = implode(",",$discardArray); + $numberToStore = count($storedArray); + $numberToDiscard= count($discardArray); - echo "Tidying up now. Moving messages to Stored or Discarded\n"; - imap_mail_move($mbox, $storeSet, 'INBOX/Stored'); - imap_mail_move($mbox, $discardSet, 'INBOX/Discarded'); - } + if($numberToStore > 0) { + echo "Got $numberToStore messages to store\n"; + $storeSet = implode(",", $storedArray); + imap_mail_move($mbox, $storeSet, 'INBOX/Stored'); + } + + if($numberToDiscard > 0) { + echo "Going to discard $numberToDiscard messages\n"; + $discardSet = implode(",",$discardArray); + + imap_mail_move($mbox, $discardSet, 'INBOX/Discarded'); + } + + + + + + + + + //} imap_expunge($mbox); imap_close($mbox); @@ -346,19 +371,5 @@ class VaultShell extends Shell { } - - /** - * Generate a uniq id. - * - * - */ - - function getUniqId($email_dir) { - $uniqid = uniqid(null,TRUE); - - return $uniqid; - - } - } ?> diff --git a/views/contacts/index.ctp b/views/contacts/index.ctp index 14782ce2..d10195aa 100755 --- a/views/contacts/index.ctp +++ b/views/contacts/index.ctp @@ -9,7 +9,6 @@ echo $paginator->counter(array( - @@ -30,9 +29,7 @@ foreach ($contacts as $contact): - +
sort('customer_id');?>sort('id');?> sort('first_name');?> sort('last_name');?> sort('email');?> link($contact['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $contact['Customer']['id'])); ?> - - diff --git a/views/enquiries/do_search.ctp b/views/enquiries/do_search.ctp new file mode 100644 index 00000000..1c6ea713 --- /dev/null +++ b/views/enquiries/do_search.ctp @@ -0,0 +1,124 @@ + + + + + 0): + ?> + +

Matching Enquiries

+ + + + + + + + + + + + + + + + > + + + + + + + + + +
DatePrincipleEnquiry NumberCustomerContactActions
toUnix($enquiryRes['Enquiry']['created'])); ?> link($enquiryRes['Principle']['short_name'], array('controller'=> 'principles', 'action'=>'view', $enquiryRes['Principle']['id'])); + } + else { + echo $html->link($enquiryRes['Principle']['name'], array('controller'=> 'principles', 'action'=>'view', $enquiryRes['Principle']['id'])); + } + ?> + link($enquiryRes['Enquiry']['title'], array('controller'=>'enquiries', 'action'=>'view', $enquiryRes['Enquiry']['id'])); ?> link($enquiryRes['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $enquiryRes['Customer']['id'])); ?> link($enquiryRes['Contact']['first_name'].' '.$enquiryRes['Contact']['last_name'], array('controller'=> 'contacts', 'action'=>'view', $enquiryRes['Contact']['id'])); ?>link('View', array('controller'=>'enquiries', 'action'=>'view', $enquiryRes['Enquiry']['id'])); ?>
+ + + + + + 0): +?> +

Matching Customers

+ + + + + + + + + + + +
Name
link(__('View', true), array('action'=>'view', $custRes['Customer']['id'])); ?>
+ + + + + + + + 0): ?> +

Matching Contacts

+ + + + + + + + + + + + + + + +
First NameLast NameCustomer
link($contact['Customer']['name'], array('controller'=> 'customers', 'action'=>'view', $contact['Customer']['id'])); ?>link(__('View', true), array('action'=>'view', $contact['Contact']['id'])); ?>
+ diff --git a/views/enquiries/search.ctp b/views/enquiries/search.ctp new file mode 100644 index 00000000..8b86f738 --- /dev/null +++ b/views/enquiries/search.ctp @@ -0,0 +1,26 @@ +link('search'); ?> + +
+ + create('Enquiry', array('default'=>false)); + echo '

Quick Search'; + echo $html->image('system-search.png'); + echo '

'; + + echo $form->input('Enquiry.search_string', array('Label'=>'Search for:', 'id'=>'searchString')); + + //echo $form->input('Customer.id', array('type'=>'hidden')); + + //echo $form->end('Search'); + + ?> + +
+ +
+ + +
+ + +
\ No newline at end of file diff --git a/views/layouts/default.ctp b/views/layouts/default.ctp index 4fda9b37..7d7d1115 100755 --- a/views/layouts/default.ctp +++ b/views/layouts/default.ctp @@ -14,9 +14,9 @@ echo $html->css('quotenik'); echo $html->css('jquery-ui.custom.css'); - + echo $javascript->link('ckeditor/ckeditor'); - + echo $javascript->link('jquery'); echo $javascript->link('jquery-ui'); @@ -25,7 +25,7 @@ echo $javascript->link('ckeditor/adapters/jquery'); echo $scripts_for_layout; - + ?> @@ -98,11 +98,15 @@ -
  • link('Users', '/users/index'); ?> + echo $html->link('Users', '/users/index'); ?>
      -
    • link('Users Index', '/users/index'); ?>
    • -
    • link('Add User', '/users/add'); ?>
    • +
    • echo $html->link('Users Index', '/users/index');
    • +
    • link('Add User', '/users/add');
    +
  • */ + ?> + +
  • link('Search', '/enquiries/search'); ?>
  • link('Help', '/pages/help'); ?>
      diff --git a/views/principles/index.ctp b/views/principles/index.ctp index c36d88ba..03e1f1d1 100755 --- a/views/principles/index.ctp +++ b/views/principles/index.ctp @@ -8,7 +8,7 @@ echo $paginator->counter(array( ?>

      - + @@ -24,9 +24,7 @@ foreach ($principles as $principle): } ?> > - + diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 680b7b38..41853466 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -376,7 +376,7 @@ table { clear: both; color: #333; margin-bottom: 10px; - width: 100%; + width: auto; } th { background: #f2f2f2; @@ -603,6 +603,7 @@ table.productTable { } + /* Paging */ div.paging { background:#fff; diff --git a/webroot/js/globalsearch.js b/webroot/js/globalsearch.js new file mode 100644 index 00000000..7db104a1 --- /dev/null +++ b/webroot/js/globalsearch.js @@ -0,0 +1,10 @@ +/* + * file: globalsearch.js + * + * Use the jquery plugin to allow keyboard shortcut search from anywhere + * + * @TODO this. + * + */ + + diff --git a/webroot/js/search.js b/webroot/js/search.js new file mode 100644 index 00000000..4e12797b --- /dev/null +++ b/webroot/js/search.js @@ -0,0 +1,35 @@ +/* + * file: search.js + + * Powers AJAX search of records in the CMC Sales System. + * + * + */ + +$(function() { + + $("#searchButton").button().click(function() { + + doSearch(); + return false; + + + }); + + + +}); + + + + +function doSearch() { + $.post("/enquiries/doSearch", $("#searchString").serialize(), function(data) { + $("#results").html(data); + }); + +} + + + +
      sort('id');?>sort('name');?> sort('code');?> sort('country_id');?> - -