Added ajax to check helper
[fa-stable.git] / inventory / manage / items.php
index 4a954d34ab77e068373b86068f08cc0fcfe4a016..967cb5e67ec56c400d1e09274d835818c7b05b9e 100644 (file)
@@ -44,7 +44,7 @@ if (isset($_FILES['pic']) && $_FILES['pic']['name'] != '')
        {
                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')
@@ -112,11 +112,13 @@ if (isset($_POST['addupdate']))
        {
                $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'], "\"") || 
@@ -124,6 +126,7 @@ if (isset($_POST['addupdate']))
        {
                $input_error = 1;
                display_error( _('The item code cannot contain any of the following characters -  & + OR a space OR quotes'));
+               set_focus('NewStockID');
 
        }