$result = $_FILES['pic']['error'];
$upload_file = 'Yes'; //Assume all is well to start off with
$filename = $comp_path . "/$user_comp/images";
$result = $_FILES['pic']['error'];
$upload_file = 'Yes'; //Assume all is well to start off with
$filename = $comp_path . "/$user_comp/images";
//But check for the worst
if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG')
//But check for the worst
if (strtoupper(substr(trim($_FILES['pic']['name']), strlen($_FILES['pic']['name']) - 3)) != 'JPG')
label_row(_("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
// Add Image upload for New Item - by Joe
$stock_img_link = "";
label_row(_("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
// Add Image upload for New Item - by Joe
$stock_img_link = "";
{
// 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
$stock_img_link .= "<img id='item_img' alt = '[".$_POST['NewStockID'].".jpg".
{
// 31/08/08 - rand() call is necessary here to avoid caching problems. Thanks to Peter D.
$stock_img_link .= "<img id='item_img' alt = '[".$_POST['NewStockID'].".jpg".
- "]' src='$comp_path/$user_comp/images/".$_POST['NewStockID'].".jpg?nocache=".rand()."'".
- " width='$pic_width' height='$pic_height' border='0'>";
+ "]' src='$comp_path/$user_comp/images/".item_img_name($_POST['NewStockID']).".jpg?nocache=".rand()."'".
+ " height='$pic_height' border='0'>";