-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.utils_fp.php
73 lines (69 loc) · 1.99 KB
/
class.utils_fp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
class utils_fp{
private $_name;
private $_nickname;
private $_status;
private $_id;
function __construct() {
}
// retrive neuron names and id starting with $letter
public function retriveNeuronsWithFP(){
$types_array=array();
$index=0;
// set letter as blank so that all name associated with type and synonym will be fetched in case of all.
// fetch the neuron name from name-type,nickname-type and name-synonym(column-table) starting with letter.
$query_to_get_neurons_name=" SELECT DISTINCT fp.fp_name ,'' as type_id
FROM FiringPattern fp, FiringPatternRel fpr
WHERE fp.definition_parameter LIKE 'parameter'
AND fp.id=fpr.FiringPattern_id and fp.fp_name > '' ORDER BY fp.fp_name";
//print("Query:".$query_to_get_neurons_name);
$type_records = mysqli_query($GLOBALS['conn'],$query_to_get_neurons_name);
if (!$type_records) {
die("<p>Error in Listing Searched Neuron Records.</p>");
}
while($rows=mysqli_fetch_array($type_records, MYSQLI_ASSOC))
{
$name=$rows['fp_name'];
$id = $rows['type_id'];
$types_array[$index]=new utils_fp();
$types_array[$index]->setName($name);
$types_array[$index]->setId($id);
//echo "$name,$id";
$index++;
}
return $types_array;
}
public function setName($var)
{
$this->_name = $var;
}
public function setNickname($var)
{
$this->_nickname = $var;
}
public function setStatus($var)
{
$this->_status = $var;
}
public function setId($var)
{
$this->_id = $var;
}
public function getName()
{
return $this->_name;
}
public function getNickname()
{
return $this->_nickname;
}
public function getStatus()
{
return $this->_status;
}
public function getId()
{
return $this->_id;
}
}
?>