Exemplo n.º 1
0
 /**
  * @internal param string $format
  * @return array
  */
 public function getAllRoles()
 {
     $roles = array();
     $this->conn->setSQL("SELECT * FROM acl_roles ORDER BY seq ASC");
     foreach ($this->conn->fetchRecords(PDO::FETCH_ASSOC) as $row) {
         array_push($roles, $row);
     }
     $total = $this->conn->rowCount();
     return array('totals' => $total, 'row' => $roles);
 }
Exemplo n.º 2
0
 public function verifyUserPass($pass)
 {
     $aes = new AES($_SESSION['site']['AESkey']);
     $pass = $aes->encrypt($pass);
     $uid = $_SESSION['user']['id'];
     $this->db->setSQL("SELECT username FROM users WHERE id = '{$uid}' AND password = '******' AND authorized = '1' LIMIT 1");
     $count = $this->db->rowCount();
     return $count != 0 ? 1 : 2;
 }
Exemplo n.º 3
0
 /**
  * @return bool
  */
 private function fieldHasBrother()
 {
     $this->db->setSQL("SELECT id FROM forms_field_options WHERE options LIKE '%\"name\":\"{$this->col}%\"'");
     $this->db->fetchRecords(PDO::FETCH_ASSOC);
     $count = $this->db->rowCount();
     if ($count >= 2) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 /**
  * @return array
  */
 public function checkOpenEncounters()
 {
     $pid = $_SESSION['patient']['pid'];
     $this->db->setSQL("SELECT pid FROM encounters WHERE pid = '{$pid}' AND close_date IS NULL");
     $total = $this->db->rowCount();
     if ($total >= 1) {
         return array('encounter' => true);
     } else {
         return array('encounter' => false);
     }
 }
//--------------------------------------------------------------------------------------------------------------------------
// listOrganization.json.php
//
// v0.0.1
// Under GPLv3 License
//
// Integrated by: Gi Technologies. in 2011
//
// Remember, this file is called via the Framework Store, this is the AJAX thing.
//--------------------------------------------------------------------------------------------------------------------------
session_name("MitosEHR");
session_start();
session_cache_limiter('private');
include_once $_SESSION['site']['root'] . "/classes/dbHelper.php";
// **************************************************************************************
// Reset session count 10 secs = 1 Flop
// **************************************************************************************
$_SESSION['site']['flops'] = 0;
// **************************************************************************************
// Database class instance
// **************************************************************************************
$mitos_db = new dbHelper();
$mitos_db->setSQL("SELECT \n\t\t\t\t\t\t*\n\t\t\t\t\tFROM\n  \t\t\t\t\t\tusers\n\t\t\t\t\tHAVING\n  \t\t\t\t\t\torganization <> ''");
$total = $mitos_db->rowCount();
$rows = array();
foreach ($mitos_db->execStatement(PDO::FETCH_ASSOC) as $row) {
    $row['cName'] = $row['fname'] . " " . $row['mname'] . " " . $row['lname'];
    array_push($rows, $row);
}
print json_encode(array('totals' => $total, 'row' => $rows));
//******************************************************************************
$_SESSION['site']['flops'] = 0;
//------------------------------------------
// Database class instance
//------------------------------------------
$mitos_db = new dbHelper();
// *************************************************************************************
// Deside what to do with the $_GET['task']
// *************************************************************************************
switch ($_GET['task']) {
    // *************************************************************************************
    // Data for Form List
    // *************************************************************************************
    case "form_list":
        $mitos_db->setSQL("SELECT DISTINCT form_id FROM layout_options");
        $totals = $mitos_db->rowCount();
        //---------------------------------------------------------------------------------------
        // start the array
        //---------------------------------------------------------------------------------------
        $rows = array();
        foreach ($mitos_db->execStatement(PDO::FETCH_ASSOC) as $row) {
            $row['id'] = $row['form_id'];
            array_push($rows, $row);
        }
        //---------------------------------------------------------------------------------------
        // here we are adding "totals" and the root "row" for sencha use
        //---------------------------------------------------------------------------------------
        print json_encode(array('totals' => $totals, 'row' => $rows));
        break;
        // *************************************************************************************
        // Available Data Types for the Form Editor