adding zend project folders into old campcaster.
This commit is contained in:
parent
56abfaf28e
commit
7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions
36
application/models/Users.php
Normal file
36
application/models/Users.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class User {
|
||||
|
||||
public function getUsers($type=NULL) {
|
||||
global $CC_DBC;
|
||||
|
||||
$sql;
|
||||
|
||||
$sql_gen = "SELECT id, login, type FROM cc_subjs";
|
||||
$sql = $sql_gen;
|
||||
|
||||
|
||||
if(!is_null($type)){
|
||||
|
||||
if(is_array($type)) {
|
||||
for($i=0; $i<count($type); $i++) {
|
||||
$type[$i] = "type = '{$type[$i]}'";
|
||||
}
|
||||
$sql_type = join(" OR ", $type);
|
||||
}
|
||||
else {
|
||||
$sql_type = "type = {$type}";
|
||||
}
|
||||
|
||||
$sql = $sql_gen ." WHERE ". $sql_type;
|
||||
}
|
||||
|
||||
return $CC_DBC->GetAll($sql);
|
||||
}
|
||||
|
||||
public function getHosts() {
|
||||
return $this->getUsers(array('H', 'A'));
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue