{
$result = $_FILES['pic']['error'];
$upload_file = 'Yes'; //Assume all is well to start off with
- $filename = $path_to_root . "/inventory/manage/image/$user_comp/";
+ $filename = $comp_path . "/$user_comp/images";
if (!file_exists($filename))
{
mkdir($filename);
}
- $filename .= "$stock_id.jpg";
+ $filename .= "/$stock_id.jpg";
//But check for the worst
if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG')
{
$input_error = 1;
display_error( _('The item name must be entered.'));
+ set_focus('description');
}
elseif (strlen($_POST['NewStockID']) == 0)
{
$input_error = 1;
display_error( _('The item code cannot be empty'));
+ set_focus('NewStockID');
}
elseif (strstr($_POST['NewStockID'], " ") || strstr($_POST['NewStockID'],"'") ||
strstr($_POST['NewStockID'], "+") || strstr($_POST['NewStockID'], "\"") ||
{
$input_error = 1;
display_error( _('The item code cannot contain any of the following characters - & + OR a space OR quotes'));
+ set_focus('NewStockID');
}
$stock_id = $_POST['NewStockID'];
delete_item($stock_id);
- $filename = $path_to_root . "/inventory/manage/image/$user_comp/$stock_id.jpg";
+ $filename = $comp_path . "/$user_comp/images/$stock_id.jpg";
if (file_exists($filename))
unlink($filename);
meta_forward($_SERVER['PHP_SELF']);
start_row();
label_cells(_("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
// Add Image upload for New Item - by Joe
-if (isset($_POST['NewStockID']) && file_exists("$path_to_root/inventory/manage/image/$user_comp/".$_POST['NewStockID'].".jpg"))
+if (isset($_POST['NewStockID']) && file_exists("$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg"))
{
- $stock_img_link = "<img src='$path_to_root/inventory/manage/image/$user_comp/".$_POST['NewStockID'].".jpg' width='$pic_width' height='$pic_height' border='0'>";
+ $stock_img_link = "<img src='$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg' width='$pic_width' height='$pic_height' border='0'>";
}
else
{
stock_item_types_list_row(_("Item Type:"), 'mb_flag', null,
(!isset($_POST['NewStockID']) || isset($_POST['New'])));
-/* The array stock_units is set up in config.php for user modification
-possible units of measure can added or modifying the array definition by editing that file */
-
stock_units_list_row(_('Units of Measure:'), 'units', null,
(!isset($_POST['NewStockID']) || isset($_POST['New'])));
end_table();