SHARE
TWEET

Untitled

a guest Jun 17th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function getDepartmentIDByName($departmentName, $companyID, $db)
  2.     {
  3.         /* (none) always has an ID of 0. */
  4.         if ($departmentName === '(none)')
  5.         {
  6.             return 0;
  7.         }
  8.  
  9.         $sql = sprintf(
  10.             "SELECT
  11.                 company_department_id AS departmentID
  12.              FROM
  13.                 company_department
  14.              WHERE
  15.                 name = %s
  16.              AND
  17.                 company_id = %s
  18.              AND
  19.                 site_id = %s",
  20.              $this->_db->makeQueryString($departmentName),
  21.              $companyID,
  22.              $this->_siteID
  23.         );
  24.         $rs = $db->getAssoc($sql);
  25.  
  26.         if (empty($rs))
  27.         {
  28.             return 0;
  29.         }
  30.  
  31.         return $rs['departmentID'];
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top