コード例 #1
0
ファイル: trigger_modify.php プロジェクト: noikiy/vsuninpay
any later version.

This program is distributed in the hope that it will be useful, 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.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include 'inc/header.php';
if ($_POST['query'] != '') {
    $data_query = @mssql_query($_POST['query']) or die(throwSQLError('unable to save procedure'));
    if ($data_query) {
        throwSuccess('procedure saved');
    }
} else {
    mssql_select_db($_SESSION['database']);
    $lines = array();
    $doit = false;
    $data_query = @mssql_query('sp_helptext \'' . urldecode($_GET['trigger']) . '\'') or die(throwSQLError('unable to retrieve trigger'));
    if ($data_query) {
        while ($row = mssql_fetch_array($data_query)) {
            $lines[] = $row['Text'];
        }
        $lines[1] = str_replace('CREATE', 'ALTER', $lines[1]);
    } else {
        $lines[] = 'I am unable to read this trigger.';
    }
}
コード例 #2
0
ファイル: view_modify.php プロジェクト: noikiy/vsuninpay
any later version.

This program is distributed in the hope that it will be useful, 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.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include 'inc/header.php';
if ($_POST['query'] != '') {
    $data_query = @mssql_query($_POST['query']) or die(throwSQLError('unable to save view'));
    if ($data_query) {
        throwSuccess('view saved');
    }
} else {
    mssql_select_db($_SESSION['database']);
    $lines = array();
    $doit = false;
    $data_query = @mssql_query('sp_helptext \'' . urldecode($_GET['view']) . '\'') or die(throwSQLError('unable to retrieve procedure'));
    if (!@mssql_num_rows($data_query)) {
        $schema_query = @mssql_query('SELECT TABLE_SCHEMA FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME = \'' . urldecode($_GET['view']) . '\';');
        if ($schema_query) {
            $schema_array = mssql_fetch_array($schema_query);
            $_GET['view'] = $schema_array['TABLE_SCHEMA'] . '.' . urldecode($_GET['view']);
            unset($data_query);
            $data_query = @mssql_query('sp_helptext \'' . $_GET['view'] . '\'') or die(throwSQLError('unable to retrieve view'));
            if (@mssql_num_rows($data_query)) {
                $doit = true;
コード例 #3
0
ファイル: function_modify.php プロジェクト: noikiy/vsuninpay
any later version.

This program is distributed in the hope that it will be useful, 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.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include 'inc/header.php';
if (!empty($_POST['query'])) {
    $data_query = @mssql_query($_POST['query']) or throwSQLError('unable to save function');
    if ($data_query) {
        throwSuccess('function saved');
    }
    $lines = explode("\n", $_POST['query']);
} else {
    mssql_select_db($_SESSION['database']);
    $lines = array();
    $data_query = @mssql_query('sp_helptext \'' . urldecode($_GET['function']) . '\'') or die(throwSQLError('unable to retrieve function'));
    if ($data_query) {
        while ($row = mssql_fetch_array($data_query)) {
            $lines[] = str_replace('CREATE', 'ALTER', $row['Text']);
        }
    } else {
        $lines[] = 'I am unable to read this function.';
    }
}
?>
コード例 #4
0
ファイル: database_import.php プロジェクト: noikiy/vsuninpay
                $value = str_replace('\'', '', $value);
                if (!is_numeric($value)) {
                    $query = str_replace($value, base64_decode($value), $query);
                }
            }
        }
        //$querys[] = $query;
        //$result = true;
        $result = @mssql_query($query) or throwSQLError('unable to execute query', $query);
        if (!$result) {
            $errorcount++;
        } else {
            $successcount++;
        }
    }
    throwSuccess('Queries executed successfully: ' . $successcount);
    throwFailure('Queries executed with failure: ' . $errorcount);
    //print_r($querys);
    include 'inc/footer.php';
}
?>

<form name="form1" method="post" enctype="multipart/form-data" action="database_import.php">
<table width="400" cellpadding="3" cellspacing="3" style="border: 1px solid">
	<tr>
		<td align="center" colspan="2" style="background: #D0DCE0">
			<b>Export Options</b>
		</td>
	</tr>
	<tr>
		<td align="right" style="background: #CCCCCC" valign="top" nowrap>