Ejemplo n.º 1
0
function getTableMigration($table, $mysqli, $indent)
{
    $ind = getIndentation($indent);
    $output = array();
    $output[] = $ind . '// Migration for table ' . $table;
    $output[] = $ind . '$table = $this->table(\'' . $table . '\');';
    $output[] = $ind . '$table';
    foreach (getColumns($table, $mysqli) as $column) {
        if ($column['Field'] !== 'id') {
            $output[] = getColumnMigration($column['Field'], $column, $indent + 1);
        }
    }
    if ($foreign_keys = getForeignKeysMigrations(getForeignKeys($table, $mysqli), $indent + 1)) {
        $output[] = $foreign_keys;
    }
    $output[] = $ind . '    ->create();';
    $output[] = PHP_EOL;
    return implode(PHP_EOL, $output);
}
Ejemplo n.º 2
0
{
    if ($left && !$right) {
        $selectcolumns = "-left-col";
    }
    if ($right && !$left) {
        $selectcolumns = "-right-col";
    }
    if ($left && $right) {
        $selectcolumns = "-left-right";
    }
    if (!$left && !$right) {
        $selectcolumns = "-no-col";
    }
    return $selectcolumns;
}
$selectcolumns = getColumns($this->countModules('left'), $this->countModules('right'));
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$selectlogo = $this->params->get('selectlogo');
$sitename = $app->getCfg('sitename');
$doc->addStyleSheet(JUri::base() . 'templates/system/css/system.css', $type = 'text/css');
$doc->addStyleSheet(JUri::base() . 'templates/' . $this->template . '/css/template.css', $type = 'text/css');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo $this->language;
?>
" lang="<?php 
echo $this->language;
?>
" >
Ejemplo n.º 3
0
/** 쪽지 쓰기
 * @class memo
 * @param
		$data: 자료
		$from_no: 보내는사람번호
		$data_target: 받는회원자료
		$data_from: 보내는회원자료
		$ret: return 모드
  */
function sendMemo($data, $from_no = '', $data_target = '', $data_from = '', $ret = 0)
{
    global $mini;
    unset($data['from_member']);
    if (!is_array($data)) {
        $data = param($data);
    }
    if (empty($data['target_member'])) {
        __error('받는사람이 없습니다');
    }
    if (empty($data['ment'])) {
        __error('내용이 없습니다');
    }
    // 회원정보
    if (empty($data_target)) {
        check($data['target_member'], 'type:num, name:받는사람번호');
        $data_target = sql("SELECT * FROM {$mini['name']['member']} WHERE no={$data['target_member']}");
        if (!is_array($data_target)) {
            __error('존재하지 않는 회원 입니다');
        }
        $data_target = parseMember($data_target, 1);
    }
    if (empty($data_from)) {
        if (!empty($from_no)) {
            check($from_no, 'type:num, name:보내는사람번호');
            $data_from = sql("SELECT * FROM {$mini['name']['member']} WHERE no={$from_no}");
            if (!is_array($data_from)) {
                __error('존재하지 않는 회원 입니다');
            }
            $data_from = parseMember($data_from, 1);
        } else {
            if (!empty($mini['log'])) {
                $data_from = $mini['member'];
            } else {
                __error('보내는사람 정보가 없습니다');
            }
        }
    }
    $data['target_member'] = $data_target['no'];
    $data['from_member'] = $data_from['no'];
    $data['name_target'] = $data_target['name'];
    $data['name_from'] = $data_from['name'];
    // 친구메세지만 허용 확인
    if (!empty($data_target['ini']['memo']) && !empty($data_target['ini']['memo']['use_friend']) && empty($mini['member']['level_admin'])) {
        if (empty($data_target['ini']['friend']) || !empty($data_target['ini']['friend']) && !in_array($from_no, $data_target['ini']['friend'])) {
            __error('메세지를 보낼 수 없습니다. 상대방이 친구에게만 메세지를 받도록 설정했습니다.');
        }
    }
    // 차단 확인
    if (!empty($data_target['ini']['memo']['block']) && inStr($from_no, $data_target['ini']['memo']['block'])) {
        $data['is_block'] = 1;
    }
    // 내용 필터
    if (empty($data['skip_filter'])) {
        filter($data['ment'], 'encode');
    }
    // 기본정보 입력
    $data['date'] = $mini['date'];
    $data['ip'] = $mini['ip'];
    // 없는 것 빼기
    $col = getColumns($mini['name']['memo']);
    foreach ($data as $key => $val) {
        if (!inStr($key, $col)) {
            unset($data[$key]);
        }
    }
    // 쿼리
    sql("INSERT INTO {$mini['name']['memo']} " . query($data, 'insert'));
    // 리턴
    if ($ret) {
        return $data;
    }
}
Ejemplo n.º 4
0
/**
 * 입력 변수 체크 - 회원
 * @class admin.member 
 * @param
		$data: 자료
*/
function checkFieldMember(&$data)
{
    global $mini;
    if (!is_array($data)) {
        __error("입력된 데이터가 없습니다");
    }
    // DB 컬럼 로드
    iss($col);
    $col = getColumns($mini['name']['member']);
    foreach ($data as $key => $val) {
        switch ($key) {
            // 숫자 체크
            case 'site':
            case 'level':
            case 'confirm_jumin':
            case 'permit_mail':
            case 'confirm_mail':
            case 'permit_cp':
            case 'confirm_cp':
            case 'age':
            case 'icon':
            case 'icon_name':
            case 'photo':
            case 'point':
            case 'point_sum':
            case 'money':
            case 'lock_login':
            case 'admit':
                check($val, "type:num, name:{$key}, is_not:1");
                break;
                // 삭제 설정
            // 삭제 설정
            case 'date':
            case 'no':
                unset($data[$key]);
                break;
                // 그룹연결
            // 그룹연결
            case 'site_link':
                if (is_array($val)) {
                    $data[$key] = "[" . implode("][", $val) . "]";
                }
                break;
                // 비밀번호
            // 비밀번호
            case 'pass_encode':
            case 'pass':
                if (isset($data['pass_encode']) && $data['pass_encode']) {
                    switch ($mini['site']['secure_pass']) {
                        case 'md5':
                        case 'sha1':
                        case 'mixed':
                            check($data['pass_encode'], "type:id, name:암호화된 비밀번호, min:16, max:40");
                            break;
                        case 'mysql':
                            $data['pass_encode'] = mysql_escape_string($data['pass_encode']);
                            $tmp = array();
                            $tmp = sql("SELECT password('{$data['pass_encode']}') as pass");
                            $data['pass'] = $tmp['pass'];
                            break;
                        case 'mysql_old':
                            $data['pass_encode'] = mysql_escape_string($data['pass_encode']);
                            $tmp = array();
                            $tmp = sql("SELECT old_password('{$data['pass_encode']}') as pass");
                            $data['pass'] = $tmp['pass'];
                            break;
                    }
                    $data['pass'] = $data['pass_encode'];
                    unset($data['pass_encode']);
                } else {
                    unset($data[$key]);
                }
                break;
                // 홈페이지
            // 홈페이지
            case 'homepage':
                check($data[$key], "type:homepage, name:홈페이지, is_not:1");
                break;
                // 주민등록번호
            // 주민등록번호
            case 'jumin':
                check($val, "type:jumin, name:주민등록번호, is_not:1");
                break;
                // 사업자번호
            // 사업자번호
            case 'co_num':
                check($val, "type:co_num, name:사업자등록번호, is_not:1");
                // 메일
            // 메일
            case 'mail':
                check($val, "type:mail, name:메일, is_not:1");
                // 가입제한 메일 체크
                if (!empty($mini['site']['filter_mail'])) {
                    if (inStr(a(explode('@', $val), '1'), $mini['site']['filter_mail'])) {
                        __error("가입이 제한된 메일 도메인 입니다. 다른 도메인을 사용한 메일로 가입해주세요");
                    }
                }
                break;
                // 휴대전화
            // 휴대전화
            case 'cp':
                check($val, "type:cp, name:휴대전화, is_not:1");
                break;
                // 메신져
            // 메신져
            case 'chat':
                if (!empty($val)) {
                    $data[$key] = "[" . implode("][", array_unique(getStr($val))) . "]";
                }
                break;
                // 추가필드
            // 추가필드
            case 'field':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('추가필드 형식이 올바르지 않습니다');
                }
                break;
                // 내용 필터
            // 내용 필터
            case 'sign':
            case 'ment':
                if (!empty($val)) {
                    filter($data[$key], 'encode');
                }
                break;
                // str형식
            // str형식
            case 'open':
                $data[$key] = "[" . implode("][", $val) . "]";
                break;
                // 기본(단일필드)
            // 기본(단일필드)
            default:
                // tmp 값 제외
                if (preg_match("/^tmp_/i", $key)) {
                    unset($data[$key]);
                }
                // 존재하지 않는 필드일 때 빼기
                if (!inStr($key, $col)) {
                    unset($data[$key]);
                }
                // 배열 값 제외
                if (is_array($val)) {
                    __error("[{$key}] 값은 허용되지 않습니다");
                }
        }
    }
}
Ejemplo n.º 5
0
function getOrderBy()
{
    $ob = getPostString("orderby");
    if (is_numeric($ob)) {
        $columns = getColumns();
        $ob = $columns[intval($ob) - 1]->Field;
    }
    return $ob;
}
Ejemplo n.º 6
0
    foreach ($columns as $column) {
        $attributeList[] = $column->getName();
        $typeList[] = $column->getType();
    }
    $_SESSION['objectName'] = $objectName;
    $_SESSION['attributeList'] = serialize($attributeList);
    $_SESSION['typeList'] = serialize($typeList);
    $_SESSION['classList'] = serialize([]);
}
if (!isset($_POST['send']) || $_POST['send'] !== "1") {
    backWithMessage('Please send request from scanner.php');
}
$host = cleanInputData('host');
$username = cleanInputData('username');
$password = cleanInputData('password');
$dbName = cleanInputData('db_name');
$tableName = cleanInputData('table_name');
$objectName = cleanInputData('object_name');
if (empty($host) || empty($username) || empty($password) || empty($dbName) || empty($tableName) || empty($objectName)) {
    backWithMessage('Please fill all required fields');
}
$pdoConnection = new PDO(sprintf("mysql:dbname=%s;host=%s", $dbName, $host), $username, $password);
$columnFactory = new ColumnFactory();
$tables = getTables($pdoConnection);
if (!in_array($tableName, $tables)) {
    backWithMessage(sprintf('Table %s not exists in %s', $tableName, $dbName));
}
$columns = getColumns($pdoConnection, $columnFactory, $tableName);
serializeTableConfig($objectName, $columns);
session_write_close();
header("Location: ../index.php");
        case ReportType::TicketsCurrentlyOpen:
            $columns[] = array('name' => 'OpenedSince', 'header' => 'Opened Since (hours)', 'headerHtmlOptions' => array('width' => '120'));
            break;
        case ReportType::TicketsUnanswered:
            $columns[] = array('name' => 'OpenedSince', 'header' => 'Opened Since (hours)', 'headerHtmlOptions' => array('width' => '120'));
            break;
    }
    $columns[] = array('name' => 'ticketID', 'header' => 'Ticket #', 'headerHtmlOptions' => array('width' => '75'));
    $columns[] = array('name' => 'creatorName', 'header' => 'Creator Name', 'headerHtmlOptions' => array('width' => '200'));
    $columns[] = array('name' => 'creatorID', 'header' => 'Creator ID', 'headerHtmlOptions' => array('width' => '75'));
    $columns[] = array('name' => 'creatorDisabled', 'header' => 'Creator Disabled', 'value' => 'ReportUtils::getZeroOneToYesNo($data["creatorDisabled"])', 'headerHtmlOptions' => array('width' => '80'));
    $columns[] = array('name' => 'creatorEmail', 'header' => 'Creator Email', 'headerHtmlOptions' => array('width' => '150'));
    $columns[] = array('name' => 'ticketStatus', 'header' => 'Ticket Status', 'headerHtmlOptions' => array('width' => '105'));
    $columns[] = array('name' => 'ticketCreatedDate', 'header' => 'Created Date', 'value' => 'ReportUtils::dateformat($data["ticketCreatedDate"])', 'headerHtmlOptions' => array('width' => '160'));
    $columns[] = array('name' => 'assignedUserName', 'header' => 'Assigned To (Name)', 'headerHtmlOptions' => array('width' => '150'));
    $columns[] = array('name' => 'ticketAssignUserID', 'header' => 'Assigned To (Id)', 'headerHtmlOptions' => array('width' => '100'));
    $columns[] = array('name' => 'assignedUserDisabled', 'header' => 'Assigned To (Disabled)', 'value' => 'ReportUtils::getZeroOneToYesNo($data["assignedUserDisabled"])', 'headerHtmlOptions' => array('width' => '100'));
    $columns[] = array('name' => 'assignedUserEmail', 'header' => 'Assigned To (Email)', 'headerHtmlOptions' => array('width' => '150'));
    $columns[] = array('name' => 'ticketDomainName', 'header' => 'Ticket Domain', 'headerHtmlOptions' => array('width' => '200'));
    $columns[] = array('name' => 'ticketSubDomainName', 'header' => 'Ticket Sub Domain', 'headerHtmlOptions' => array('width' => '170'));
    $columns[] = array('name' => 'ticketPriorityDescription', 'header' => 'Ticket Priority', 'headerHtmlOptions' => array('width' => '110'));
    $columns[] = array('name' => 'ticketAssignedDate', 'header' => 'Ticket Assigned Date', 'value' => 'ReportUtils::dateformat($data["ticketAssignedDate"])', 'headerHtmlOptions' => array('width' => '160'));
    $columns[] = array('name' => 'ticketClosedDate', 'header' => 'Ticket Closed Date', 'value' => 'ReportUtils::dateformat($data["ticketClosedDate"])', 'headerHtmlOptions' => array('width' => '160'));
    $columns[] = array('name' => 'ticketIsEscalated', 'header' => 'Escalated', 'value' => 'ReportUtils::getZeroOneToYesNo($data["ticketIsEscalated"])', 'headerHtmlOptions' => array('width' => '80'));
    $columns[] = array('name' => 'ticketSubject', 'header' => 'Subject', 'headerHtmlOptions' => array('width' => '300'));
    $columns[] = array('name' => 'ticketDescription', 'header' => 'Description', 'headerHtmlOptions' => array('width' => '400'));
    /**/
    return $columns;
}
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'utilizationGrid', 'ajaxUpdate' => true, 'type' => 'striped condensed', 'template' => '{items}{summary}', 'dataProvider' => $dataprovider, 'enablePagination' => false, 'columns' => getColumns($ultilizationFilter)));
Ejemplo n.º 8
0
require_once '../../header.inc.php';
require_once '../class/report.class.php';
require_once inc_dataReader;
require_once inc_response;
$task = isset($_POST["task"]) ? $_POST["task"] : (isset($_GET["task"]) ? $_GET["task"] : "");
switch ($task) {
    case "save":
        saveReport();
    case "select":
        selectReports();
    case "delete":
        deleteReport();
    case "formSave":
        formSave();
    case "getColumns":
        getColumns();
        //....................................
    //....................................
    case "selectReportColumns":
        selectReportColumns();
    case "addReportColumn":
        addReportColumn();
    case "ChangeColumnOrder":
        ChangeColumnOrder();
    case "deleteColumn":
        deleteColumn();
}
function saveReport()
{
    $summaryNames = array("sum" => "مجموع", "count" => "تعداد", "avg" => "میانگین", "max" => "ماکزیمم", "min" => "مینیمم");
    //-------------------- Add or Edit report header ---------------------------
Ejemplo n.º 9
0
{
    if ($left && !$right) {
        $style = "-left-only";
    }
    if ($right && !$left) {
        $style = "-right-only";
    }
    if (!$left && !$right) {
        $style = "-wide";
    }
    if ($left && $right) {
        $style = "-both";
    }
    return $style;
}
$style = getColumns($this->countModules('left'), $this->countModules('right'));
//count modules in vertical positions u45
$user45count = $this->countModules('user4') + $this->countModules('user5');
if ($user45count == "1") {
    $user45width = "100%";
} elseif ($user45count == "2") {
    $user45width = "50%";
}
//count modules in vertical positions u67
$user67count = $this->countModules('user6') + $this->countModules('user7');
if ($user67count == "1") {
    $user67width = "100%";
} elseif ($user67count == "2") {
    $user67width = "50%";
}
?>
Ejemplo n.º 10
0
function getRequiredColumns($table)
{
    $result = getColumns($table);
    $columns = [];
    foreach ($result as $row) {
        if ($row['Field'] != 'id' && $row['Null'] == 'NO') {
            array_push($columns, $row['Field']);
        }
    }
    return $columns;
}
    }
    return $columns;
}
try {
    // Create (connect to) SQLite database (creates if not exists)
    $db = open_db();
    // Create table
    // -------------------------------------------------------------------------
    $createTableFields = array();
    foreach ($tableFields as $key => $elems) {
        $type = $elems[0];
        $createTableFields[] = "{$key} {$type}";
    }
    $createTableFields = implode(",", $createTableFields);
    $db->exec("CREATE TABLE IF NOT EXISTS {$tableName} (\n                    id INTEGER PRIMARY KEY,\n                    {$createTableFields}\n                )");
    $columns = getColumns($db, $tableName);
    print_r($columns);
    foreach ($tableFields as $key => $elems) {
        $type = $elems[0];
        if (!in_array($key, $columns)) {
            $default = "NULL";
            // print_r("alter table: " . $key . " type: " . $type . " default: " . $default);
            print_r("ALTER TABLE {$tableName} ADD {$key} {$type} DEFAULT {$default}");
            $db->exec("ALTER TABLE {$tableName} ADD {$key} {$type} DEFAULT {$default}");
        }
    }
    // Close file db connection
    // -------------------------------------------------------------------------
    $db = null;
    // write csv header
    $header = implode(", ", array_keys($tableFields));
Ejemplo n.º 12
0
/**
 * 입력 변수 체크 - 게시판
 * @class admin.board 
 * @param
		$data: 자료
*/
function checkFieldBoard(&$data)
{
    global $mini;
    if (!is_array($data)) {
        __error("입력된 데이터가 없습니다");
    }
    // DB 컬럼 로드
    iss($col);
    $col = getColumns($mini['name']['admin']);
    foreach ($data as $key => $val) {
        switch ($key) {
            // 삭제 설정
            case 'date':
            case 'no':
            case 'dir':
                unset($data[$key]);
                break;
                // 그룹연결
            // 그룹연결
            case 'site_link':
                if (is_array($val)) {
                    $data[$key] = "[" . implode("][", $val) . "]";
                }
                break;
                // 카테고리
            // 카테고리
            case 'category':
                if (is_array($val)) {
                    foreach ($val as $key2 => $val2) {
                        check($val2['no'], 'type:num, name: 카테고리번호');
                        check($val2['depth'], 'type:num, name: 카테고리단계, is_not:1');
                        check($val2['name'], 'name: 카테고리이름');
                        str($data[$key][$key2]['name'], 'encode');
                    }
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('카테고리 형식이 올바르지 않습니다');
                }
                break;
                // 추가필드
            // 추가필드
            case 'field':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('추가필드 형식이 올바르지 않습니다');
                }
                break;
                // 옵션
            // 옵션
            case 'options':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('스킨옵션 형식이 올바르지 않습니다');
                }
                break;
                // 단축키
            // 단축키
            case 'key_map':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('단축키 형식이 올바르지 않습니다');
                }
                break;
                // 기본(단일필드)
            // 기본(단일필드)
            default:
                // tmp 값 제외
                if (preg_match("/^tmp_/i", $key)) {
                    unset($data[$key]);
                }
                // 배열 값 제외
                if (is_array($val) && !preg_match("/^(config)\$/", $key)) {
                    __error("[{$key}] 값은 허용되지 않습니다");
                }
                // 존재하지 않는 필드일 때 빼기
                if (!inStr($key, $col)) {
                    unset($data[$key]);
                }
                // 권한
                if (preg_match("/permit_/i", $key) && $val && count(getStr($val)) > 1) {
                    $data[$key] = "[" . implode("][", array_unique(getStr($val))) . "]";
                    //__error($data[$key]);
                }
                break;
        }
    }
}
echo $form->labelEx($filter, 'numRulesToFind');
echo $form->textField($filter, 'numRulesToFind');
?>
            </div>
            <div><?php 
echo CHtml::submitButton('Refresh');
?>
</div>
       </div>
    </td>
    <td style="vertical-align:top;">
        <div id="chartSection" class="chartCont">
            <?php 
function getColumns()
{
    $columns = array();
    $columns[] = array('name' => 'Premise', 'header' => 'Premise');
    $columns[] = array('name' => 'Operator', 'header' => '');
    $columns[] = array('name' => 'Consequence', 'header' => 'Consequence');
    return $columns;
}
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'frecuentMenteeSubDomains', 'ajaxUpdate' => true, 'type' => 'striped condensed', 'template' => '{items}', 'dataProvider' => $dataprovider, 'enablePagination' => false, 'columns' => getColumns()));
?>
            
        </div>
    </td>
</table>


<?php 
$this->endWidget();
Ejemplo n.º 14
0
    }
    if ($right && !$left && !$center) {
        $columns = "-right-only";
    }
    if ($left && $right && !$center) {
        $columns = "-left-right";
    }
    if (!$left && !$right && !$center) {
        $columns = "-wide";
    }
    if ($right && !$left && $center) {
        $columns = "-right-center";
    }
    if (!$right && $left && $center) {
        $columns = "-left-center";
    }
    if ($right && $left && $center) {
        $columns = "-left-right-center";
    }
    if (!$right && !$left && $center) {
        $columns = "-center-only";
    }
    return $columns;
}
$columns = getColumns($this->countModules('left'), $this->countModules('right'), $this->countModules('center'));
unset($doc->_scripts[JURI::root(true) . '/media/jui/js/bootstrap.min.js']);
if ($responsive == "yes") {
    include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'responsive.php';
} elseif ($responsive == "no") {
    include dirname(__FILE__) . DIRECTORY_SEPARATOR . 'fixwidth.php';
}
Ejemplo n.º 15
0
require_once "authlib.php";
require_once "header.php";
if (!hasPerm('users.list', $user)) {
    header('Location: index.php');
    die;
}
?>
<main id="content-wrapper" class="container">
	<div class="page-header">
		<h1>SeaAuth <small>User Management</small></h1>
	</div>
	<a class="btn btn-warning" href="?di">Show Inactive</a>
	<table class="table table-striped table-hover">
		<?php 
//Get Columns
$cols = getColumns($conn, $userTable);
//Get fields
$col_ss = implode(", ", $cols);
$where = isset($_GET['di']) && hasPerm("users.inactive", $user) ? "" : "where active = '1'";
$cmd = $conn->prepare("select {$col_ss} from {$userTable} {$where} order by userID");
$cmd->execute();
$results = $cmd->fetchAll();
//Print out our table
echo "<thead><tr>";
foreach ($cols as $col) {
    echo "<th>{$col}</th>";
}
echo "<th>Edit</th><th>Deactivate</tr></thead><tbody>";
foreach ($results as $row) {
    echo "<tr>";
    foreach ($cols as $col) {
Ejemplo n.º 16
0
/**
 * 입력 변수 체크 - 그룹
 * @class admin.site 
 * @param
		$data: 자료
*/
function checkFieldSite(&$data)
{
    global $mini;
    if (!is_array($data)) {
        __error("입력된 데이터가 없습니다");
    }
    // DB 컬럼 로드
    iss($col);
    $col = getColumns($mini['name']['site']);
    foreach ($data as $key => $val) {
        switch ($key) {
            // 삭제 설정
            case 'date':
            case 'no':
                unset($data[$key]);
                break;
                // 그룹연결
            // 그룹연결
            case 'site_link':
                if (is_array($val)) {
                    $data[$key] = "[" . implode("][", $val) . "]";
                }
                break;
                // 추가필드
            // 추가필드
            case 'field':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('추가필드 형식이 올바르지 않습니다');
                }
                break;
                // 가입항목설정
            // 가입항목설정
            case 'join_setting':
                if (is_array($val)) {
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('가입항목설정 형식이 올바르지 않습니다');
                }
                break;
                // 템플릿
            // 템플릿
            case 'template':
                if (is_array($val)) {
                    str($data[$key], 'encode');
                    $data[$key] = serialize($data[$key]);
                } else {
                    __error('템플릿 형식이 올바르지 않습니다');
                }
                break;
                // 메일
            // 메일
            case 'mail':
                check($val, "type:mail, name:대표 메일");
                break;
                // 휴대전화
            // 휴대전화
            case 'cp':
                check($val, "type:cp, name:대표 휴대전화, is_not:1");
                break;
                // 회원상태목록
            // 회원상태목록
            case 'status':
                if (!empty($val)) {
                    $tmp = array_unique(getStr($val));
                    if (is_array($tmp)) {
                        $data[$key] = "[" . implode("][", $tmp) . "]";
                    }
                }
                break;
                // 그룹이름 태그처리
            // 그룹이름 태그처리
            case 'name':
                // str($data[$key], 'encode');
                break;
                // 기본(단일필드)
            // 기본(단일필드)
            default:
                // tmp 값 제외
                if (preg_match("/^tmp_/i", $key)) {
                    unset($data[$key]);
                }
                // 배열 값 제외
                if (is_array($val)) {
                    __error("[{$key}] 값은 허용되지 않습니다");
                }
                // 존재하지 않는 필드일 때 빼기
                if (!inStr($key, $col)) {
                    unset($data[$key]);
                }
                // 권한
                if (preg_match("/permit_/i", $key) && $val && count(getStr($val)) > 1) {
                    $data[$key] = "[" . implode("][", array_unique(getStr($val))) . "]";
                }
        }
    }
}
 * @category Behavioural
 * @package  Main
 * @author   Loris Team <*****@*****.**>
 * @license  Loris License
 * @link     https://github.com/aces/Loris
 */
set_include_path(get_include_path() . ":../project/libraries:../php/libraries:");
require_once __DIR__ . "/../vendor/autoload.php";
$configFile = "../project/config.xml";
$client = new NDB_Client();
$client->makeCommandLine();
$client->initialize($configFile);
$DB = Database::singleton();
// define which configuration file we're using for this installation
//Get the entries we already have in the DB
getColumns("Select Name, ParameterTypeID from parameter_type", $DB, $parameter_types);
//Delete in the parameter_type table relating to
//parameter_type_category.Type = 'Instrument', without affecting other entries.
//get parameter_type_category.Type ='Instrument' ParamenterTypeCategoryIDs
getColumn("SELECT ParameterTypeCategoryID\n        FROM parameter_type_category\n        WHERE Type = 'Instrument'", $DB, $instrumentParameterTypeCategoryIDs);
$instrumentParameterTypeCategoryIDString = implode(', ', $instrumentParameterTypeCategoryIDs);
//get all 'Instrument' ParameterTypeIDs
getColumn("SELECT ParameterTypeID\n        FROM parameter_type_category_rel\n        WHERE ParameterTypeCategoryID\n        IN ({$instrumentParameterTypeCategoryIDString})", $DB, $instrumentParameterTypeIDs);
$instrumentParameterTypeIDString = implode(', ', $instrumentParameterTypeIDs);
//delete all 'Instrument' entries from parameter_type_category_rel
$DB->run("DELETE FROM parameter_type_category_rel\n    WHERE ParameterTypeID in ({$instrumentParameterTypeIDString})");
//delete all 'Instrument' entries from parameter_type_category
$DB->run("DELETE FROM parameter_type_category\n    WHERE ParameterTypeCategoryID IN ({$instrumentParameterTypeCategoryIDString})");
//delete all 'Instrument' entries from parameter_type
$DB->run("DELETE FROM parameter_type\n    WHERE ParameterTypeID IN ({$instrumentParameterTypeIDString})");
print "Cleared data from BVL instruments\n";
Ejemplo n.º 18
0
Archivo: update.php Proyecto: uwol/vcms
if (in_array('vita_letzterautor', $columnsBasePerson)) {
    echo 'Aktualisiere Tabelle base_person<br />';
    $libDb->query('ALTER TABLE base_person DROP vita_letzterautor');
}
if (in_array('username', $columnsBasePerson)) {
    echo 'Aktualisiere Tabelle base_person<br />';
    $libDb->query('ALTER TABLE base_person DROP username');
}
if (!in_array('email', $indexesBasePerson)) {
    echo 'Aktualisiere Index auf Tabelle base_person<br />';
    $libDb->query('ALTER TABLE base_person ADD UNIQUE email (email)');
}
/**
* Tabelle base_semester aktualisieren
*/
$columnsBaseSemester = getColumns('base_semester');
if (!in_array('vop', $columnsBaseSemester)) {
    echo 'Aktualisiere Tabelle base_semester<br />';
    $libDb->query('ALTER TABLE base_semester ADD vop int(11) default NULL');
}
if (!in_array('vvop', $columnsBaseSemester)) {
    echo 'Aktualisiere Tabelle base_semester<br />';
    $libDb->query('ALTER TABLE base_semester ADD vvop int(11) default NULL');
}
if (!in_array('vopxx', $columnsBaseSemester)) {
    echo 'Aktualisiere Tabelle base_semester<br />';
    $libDb->query('ALTER TABLE base_semester ADD vopxx int(11) default NULL');
}
if (!in_array('vopxxx', $columnsBaseSemester)) {
    echo 'Aktualisiere Tabelle base_semester<br />';
    $libDb->query('ALTER TABLE base_semester ADD vopxxx int(11) default NULL');