Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function save(){
- $file = JRequest::getVar('jform', null, 'files', 'array');
- $path = JPATH_BASE;
- // Make the file name safe.
- jimport('joomla.filesystem.file');
- $file['name']['invoice'] = JFile::makeSafe($file['name']['invoice']);
- // Move the uploaded file into a permanent location.
- if (isset($file['name']['invoice'])) {
- // Make sure that the full file path is safe.
- $filepath = JPath::clean($path. DS ."components". DS ."com_invoicemanager". DS ."files". DS .strtolower($file['name']['invoice']));
- // Move the uploaded file.
- JFile::upload( $file['tmp_name']['invoice'], $filepath );
- $db =& JFactory::getDBO();
- $query = $db->getQuery(true);
- $query->update($db->nameQuote('#__invoicemanager'));
- $query->set($invoice.' = '.$db->quote($file['name']['invoice']));
- $query->where($db->nameQuote('id').'='.$db->quote($id));
- $db->setQuery($query);
- $db->query();
- var_dump($db);
- exit (0);
- }
- return parent::save();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement