but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
if (!isset($ini)) {
    require_once '../../Ini.php';
    $ini = new Ini();
}
$logged_user = User::get_logged_user();
if ($logged_user == null) {
    echo json_encode(array());
    exit;
}
$obj = Test::from_mysql_id($_GET['oid']);
if ($obj == null || !$logged_user->is_object_readable($obj)) {
    echo json_encode(array());
    exit;
}
$sql = sprintf("SELECT * FROM `TestProtectedVariable` WHERE `Test_id`='%d'", $_GET['oid']);
$table = array();
$z = mysql_query($sql);
while ($r = mysql_fetch_array($z)) {
    $obj = TestProtectedVariable::from_mysql_id($r["id"]);
    $row = array("id" => $obj->id, "name" => $obj->name);
    array_push($table, $row);
}
echo json_encode($table);
Esempio n. 2
0
 public function get_TestProtectedVariables()
 {
     $tpv = TestProtectedVariable::from_property(array("Test_id" => $this->id));
     return $tpv;
 }