Example #1
0
 /**
  * returns all users
  *
  * @param boolean $include_docs if set to true, users documents will also be included
  * @return array users array : each row is a stdObject with "id", "rev" and optionally "doc" properties
  */
 public function getAllUsers($include_docs = false)
 {
     $client = new couchClient($this->client->dsn(), $this->userdb, $this->client->options());
     if ($include_docs) {
         $client->include_docs(true);
     }
     return $client->startkey("org.couchdb.user:"******"org.couchdb.user;")->getAllDocs()->rows;
 }
Example #2
0
                    }
                }
                echo "</tr>\n\t   '";
            }
        } catch (Exception $err) {
        }
    }
}
if (isset($_GET['lang'])) {
    //$language = $_GET['lang'];
    //$level = $_GET['level'];
    $language = "en";
    global $couchUrl;
    global $facilityId;
    $resources = new couchClient($couchUrl, "resources");
    $viewResults = $resources->include_docs(TRUE)->getView('api', 'allResources');
    for ($rcnt = 0; $rcnt < sizeof($viewResults->rows); $rcnt++) {
        $doc = $viewResults->rows[$rcnt]->doc;
        ///if($doc->language==$language && in_array($level,$doc->levels)){
        echo "<tr class='odd gradeB'>\n\t\t\t\t\t\t\t<td style='width: 30%;'>" . $doc->title . "</td>\n\t\t\t\t\t\t\t<td>" . $doc->description . "</td>\n\t\t\t\t\t\t\t<td>" . $doc->author . "</td>\n\t\t\t\t\t\t\t";
        //echo "<td>"
        // if(isset($doc->views)){
        //			  print($doc->views);
        //		  }else{
        //			  print('0');
        //		  }
        //		  echo "</td>";
        ///	echo "</td>";
        if ($doc->legacy->type == 'mp3') {
            print "<td><a href='viewResource.php?docId=" . $doc->_id . "&database=ttel_resources&resid=" . $doc->_id . "' target='_blank' class='btn btn-lg btn-success glyphicon glyphicon-music'></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\t\t\t\t\t\t\t\t <a href='delete.php?database=ttel_resources&resid=" . $doc->_id . "' target='_blank' class='btn btn-lg btn-primary glyphicon glyphicon-trash'>Delete</a></td>";
        } else {