Moved all SQL statements from PHP files into relevant *_db.inc files.
[fa-stable.git] / reporting / includes / header2.inc
index c3fd180b9baab9f7b6f98efadee875b038390b56..1a03c8b823cdb0c1ef2a0559451465ad388b14cf 100644 (file)
                if ($branch != null)
                {
                        $id = $branch['salesman'];
-                       $sql = "SELECT salesman_name  FROM ".TB_PREF."salesman WHERE salesman_code='$id'";
-                       $result = db_query($sql,"could not get sales person");
-                       $row = db_fetch($result);
-                       $this->TextWrap($col, $this->row, $width, $row['salesman_name'], 'C');
+                       //$sql = "SELECT salesman_name  FROM ".TB_PREF."salesman WHERE salesman_code='$id'";
+                       //$result = db_query($sql,"could not get sales person");
+                       //$row = db_fetch($result);
+                       //$this->TextWrap($col, $this->row, $width, $row['salesman_name'], 'C');
+                       $this->TextWrap($col, $this->row, $width, get_salesman_name($id), 'C');
                }               
                elseif ($doctype == 26)
                        $this->TextWrap($col, $this->row, $width, $wo_types_array[$myrow["type"]], 'C');