X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fcompany_preferences.php;h=4f1f548c3df2935a6fcd7797af3188c35ffa3382;hb=634019327c53a3e1082c90f4fcece9a97429a039;hp=d020398a8bd94937751d10ec5b36a8fe23c9d8f6;hpb=d567a10b7925c8bb97c734e213d6651a979af29d;p=fa-stable.git diff --git a/admin/company_preferences.php b/admin/company_preferences.php index d020398a..4f1f548c 100644 --- a/admin/company_preferences.php +++ b/admin/company_preferences.php @@ -44,9 +44,10 @@ if (isset($_POST['update']) && $_POST['update'] != "") $filename .= "/".$_FILES['pic']['name']; //But check for the worst - if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG') + if (!in_array((substr(trim($_FILES['pic']['name']),-3)), + array('jpg','JPG','png','PNG'))) { - display_error(_('Only jpg files are supported - a file extension of .jpg is expected')); + display_error(_('Only jpg and png files are supported - a file extension of .jpg or .png is expected')); $input_error = 1; } elseif ( $_FILES['pic']['size'] > ($max_image_size * 1024)) @@ -112,33 +113,34 @@ if (isset($_POST['update']) && $_POST['update'] != "") start_form(true); - -$myrow = get_company_prefs(); - -$_POST['coy_name'] = $myrow["coy_name"]; -$_POST['gst_no'] = $myrow["gst_no"]; -$_POST['tax_prd'] = $myrow["tax_prd"]; -$_POST['tax_last'] = $myrow["tax_last"]; -$_POST['coy_no'] = $myrow["coy_no"]; -$_POST['postal_address'] = $myrow["postal_address"]; -$_POST['phone'] = $myrow["phone"]; -$_POST['fax'] = $myrow["fax"]; -$_POST['email'] = $myrow["email"]; -$_POST['coy_logo'] = $myrow["coy_logo"]; -$_POST['domicile'] = $myrow["domicile"]; -$_POST['use_dimension'] = $myrow["use_dimension"]; -$_POST['base_sales'] = $myrow["base_sales"]; -$_POST['no_item_list'] = $myrow["no_item_list"]; -$_POST['no_customer_list'] = $myrow["no_customer_list"]; -$_POST['no_supplier_list'] = $myrow["no_supplier_list"]; -$_POST['custom1_name'] = $myrow["custom1_name"]; -$_POST['custom2_name'] = $myrow["custom2_name"]; -$_POST['custom3_name'] = $myrow["custom3_name"]; -$_POST['custom1_value'] = $myrow["custom1_value"]; -$_POST['custom2_value'] = $myrow["custom2_value"]; -$_POST['custom3_value'] = $myrow["custom3_value"]; -$_POST['curr_default'] = $myrow["curr_default"]; -$_POST['f_year'] = $myrow["f_year"]; +if (!isset($_POST['coy_name'])) { + $myrow = get_company_prefs(); + + $_POST['coy_name'] = $myrow["coy_name"]; + $_POST['gst_no'] = $myrow["gst_no"]; + $_POST['tax_prd'] = $myrow["tax_prd"]; + $_POST['tax_last'] = $myrow["tax_last"]; + $_POST['coy_no'] = $myrow["coy_no"]; + $_POST['postal_address'] = $myrow["postal_address"]; + $_POST['phone'] = $myrow["phone"]; + $_POST['fax'] = $myrow["fax"]; + $_POST['email'] = $myrow["email"]; + $_POST['coy_logo'] = $myrow["coy_logo"]; + $_POST['domicile'] = $myrow["domicile"]; + $_POST['use_dimension'] = $myrow["use_dimension"]; + $_POST['base_sales'] = $myrow["base_sales"]; + $_POST['no_item_list'] = $myrow["no_item_list"]; + $_POST['no_customer_list'] = $myrow["no_customer_list"]; + $_POST['no_supplier_list'] = $myrow["no_supplier_list"]; + $_POST['custom1_name'] = $myrow["custom1_name"]; + $_POST['custom2_name'] = $myrow["custom2_name"]; + $_POST['custom3_name'] = $myrow["custom3_name"]; + $_POST['custom1_value'] = $myrow["custom1_value"]; + $_POST['custom2_value'] = $myrow["custom2_value"]; + $_POST['custom3_value'] = $myrow["custom3_value"]; + $_POST['curr_default'] = $myrow["curr_default"]; + $_POST['f_year'] = $myrow["f_year"]; +} $_POST['del_coy_logo'] = 0; start_outer_table($table_style2);