include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/admin/db/company_db.inc");
-
//-------------------------------------------------------------------------------------------------
-if (isset($_POST['submit']) && $_POST['submit'] != "")
+if (isset($_POST['update']) && $_POST['update'] != "")
{
$input_error = 0;
display_error(_("The company name must be entered."));
set_focus('coy_name');
}
- $user_comp = user_company();
if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
{
+ $user_comp = user_company();
$result = $_FILES['pic']['error'];
$filename = $comp_path . "/$user_comp/images";
if (!file_exists($filename))
}
elseif (file_exists($filename))
{
- display_notification(_('Attempting to overwrite an existing item image'));
$result = unlink($filename);
if (!$result)
{
{
$result = move_uploaded_file($_FILES['pic']['tmp_name'], $filename);
$_POST['coy_logo'] = $_FILES['pic']['name'];
- $message = ($result)?_('File url') ."<a href='$filename'>$filename</a>" : "Somthing is wrong with uploading a file.";
+ if(!$result)
+ display_error(_('Error uploading logo file'));
}
- /* EOF Add Image upload for New Item - by Ori */
}
-
if ($input_error != 1)
{
update_company_setup($_POST['coy_name'], $_POST['coy_no'], $_POST['gst_no'], $_POST['tax_prd'], $_POST['tax_last'],
display_notification_centered(_("Company setup has been updated."));
}
-
+ set_focus('coy_name');
+ $Ajax->activate('_page_body');
} /* end of if submit */
//---------------------------------------------------------------------------------------------
text_row_ex(_("Facsimile Number:"), 'fax', 25);
text_row_ex(_("Email Address:"), 'email', 25, 55);
label_row(_("Company Logo:"), $_POST['coy_logo']);
-label_row(_("New")." "._("Company Logo (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
+label_row(_("New Company Logo (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
text_row_ex(_("Domicile:"), 'domicile', 25, 55);
end_table(1);
hidden('coy_logo', $_POST['coy_logo']);
-submit_center('submit', _("Update"));
+submit_center('update', _("Update"), true, '', true);
end_form(2);
//-------------------------------------------------------------------------------------------------