Example #1
0
            echo Language::string(443);
            ?>
</button>
                <button class="btnUpload" onclick="<?php 
            echo $class_name;
            ?>
.uiUpload(<?php 
            echo $oid;
            ?>
)"><?php 
            echo Language::string(383);
            ?>
</button>
                <?php 
        }
        $ws = UserWorkspace::from_property(array("db_name" => User::get_current_db()), false);
        $ws_id = 0;
        if ($ws != null) {
            $ws_id = $ws->id;
        }
        ?>
            <button class="btnRunTest" onclick="window.open('<?php 
        echo Ini::$path_external . "?wid=" . $ws_id . "&tid=" . $obj->id;
        ?>
', '_blank')"><?php 
        echo Language::string(362);
        ?>
</button>
        </div>
        <?php 
    }
 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 "<script>location.reload();</script>";
    die(Language::string(278));
}
//vars
$name = "concerto.table.query";
$db = User::get_current_db();
if (array_key_exists("db", $_POST)) {
    $workspace_id = $_POST['db'];
}
$table_name = "";
if (array_key_exists("table_name", $_POST)) {
    $table_name = $_POST['table_name'];
}
$type = "SELECT";
if (array_key_exists("type", $_POST)) {
    $type = $_POST['type'];
}
$ws = UserWorkspace::from_property(array("db_name" => $db), false);
TestSession::change_db($ws->id);
$table = Table::from_property(array("name" => $table_name), false);
$table_columns = array();
Example #3
0
 public function dump_data()
 {
     include Ini::$path_internal . "SETTINGS.php";
     $db_host = Ini::$db_host;
     $db_port = Ini::$db_port;
     $db_user = $db_master_user;
     $db_password = $db_master_password;
     $db_name = User::get_current_db();
     $db_table = $this->name;
     $count = 0;
     $sql = sprintf("SELECT COUNT(*) FROM `%s`", $db_table);
     $z = mysql_query($sql);
     if ($r = mysql_fetch_row($z)) {
         $count = $r[0];
     }
     if ($count == 0) {
         return "";
     } else {
         return `mysqldump --opt --host={$db_host} --port={$db_port} --user={$db_user} --password="******" --no-create-info --compact {$db_name} {$db_table} | grep -v '^\\/\\*![0-4][0-9]\\{4\\}.*\\/;\$'`;
     }
 }
Example #4
0
 public static function get_current_UserWorkspace()
 {
     $db = User::get_current_db();
     return UserWorkspace::from_property(array("db_name" => $db), false);
 }
Example #5
0
 private function initialize_db_connection()
 {
     include __DIR__ . "/SETTINGS.php";
     $h = mysql_connect($db_host . ($db_port != "" ? ":" . $db_port : ""), $db_master_user, $db_master_password);
     if (!$h) {
         return false;
     }
     mysql_set_charset('utf8', $h);
     mysql_query(sprintf("SET time_zone = '%s';", Ini::$mysql_timezone));
     $db = User::get_current_db();
     if ($db == null) {
         $db = Ini::$db_master_name;
     }
     if (mysql_select_db($db, $h)) {
         return true;
     } else {
         return false;
     }
 }