Example #1
0
/**
 * Check if Sesstings tables exists in Configuration Database
 * @return boolean
 */
function checkSettings()
{
    if (!checkTable('settings')) {
        createSettings();
    }
    return true;
}
    }
}
$selQ->where = "p.promo != '0'";
$cleanProps = array();
for ($i = 0; $i < count($propNames); $i++) {
    $selQ->select = array_merge($selQ->select, array($propNames[$i] . " as `" . $propLangName[$i] . "`"));
}
$selQ->tableNames = array("products as p");
$selQ->joins = array();
$selQ->joinTypes = array();
if (checkTable($conn, "products_" . $catid)) {
    $selQ->tableNames[] = "products_" . $catid . " as nld";
    $selQ->joins[] = "p.id = nld.infoid";
    $selQ->joinTypes[] = "LEFT JOIN";
}
if (checkTable($conn, "products_" . $catid . "_" . $language)) {
    $selQ->tableNames[] = "products_" . $catid . "_" . $language . " as ld";
    $selQ->joins[] = "p.id = ld.infoid";
    $selQ->joinTypes[] = "LEFT JOIN";
}
if (!$selQ->executeQuery()) {
    $statusMessage = $selQ->status;
    mysqli_close($conn);
    return;
}
if ($selQ->getNumberOfResults() == 0) {
    $statusMessage = makeStatusMessage(59, "error");
} else {
    $data = array();
    while ($row = $selQ->result->fetch_assoc()) {
        $data[] = $row;
Example #3
0
function checkTables()
{
    global $mydirname;
    xoops_cp_header();
    echo sprintf('<h4>%s&nbsp;&raquo;&raquo;&nbsp;%s&nbsp;&raquo;&raquo;&nbsp;%s</h4>', indexLink(), dbManagerLink(), _AM_WEBLOG_CHECKTABLE);
    // checking table 'weblog'
    $columns = array('blog_id', 'user_id', 'cat_id', 'created', 'title', 'contents', 'private', 'comments', 'reads', 'trackbacks', 'permission_group', 'dohtml', 'dobr');
    checkTable($mydirname, $columns);
    echo "<br />";
    // checking table 'weblog_category'
    $columns = array('cat_id', 'cat_pid', 'cat_title', 'cat_description', 'cat_created', 'cat_imgurl');
    checkTable($mydirname . '_category', $columns);
    echo "<br />";
    // checking table 'weblog_priv'
    $columns = array('priv_id', 'priv_gid');
    checkTable($mydirname . '_priv', $columns);
    echo "<br />";
    // checking table 'weblog_trackback'
    $columns = array('blog_id', 'tb_url', 'blog_name', 'title', 'description', 'link', 'direction', 'trackback_created');
    checkTable($mydirname . '_trackback', $columns);
    echo "<br />";
    // checking table 'weblogmyalbum_photos'
    $columns = array('lid', 'cid', 'title', 'ext', 'res_x', 'res_y', 'submitter', 'status', 'date');
    checkTable($mydirname . 'myalbum_photos', $columns);
    xoops_cp_footer();
}
Example #4
0
function checkPublishTable()
{
    if (!checkTable('db_tables')) {
        createPublishTable();
    }
    return true;
}
Example #5
0
    echo 'legacy22_check.php should set the same directory of mainfile.php.';
    die;
}
require_once 'mainfile.php';
$messages = array();
/*** check setting of XOOPS_TRUST_PATH ***/
switch (checkMainfile()) {
    case 0:
        $messages[] = 'You must add XOOPS_TRUST_PATH setting in ' . XOOPS_ROOT_PATH . '/mainfile.php';
        break;
    case 1:
        $messages[] = 'Directory XOOPS_TRUST_PATH(' . XOOPS_TRUST_PATH . ') is NOT found.';
        break;
}
/*** check table field expand by preload ***/
if (!checkTable()) {
    $messages[] = 'You must put extras/extra_preload/upgrade22.class.php in ' . XOOPS_ROOT_PATH . '/preload';
}
/*** check latest language file ***/
$lang = XCube_Root::getSingleton()->mLanguageManager->mLanguageName;
if (!checkLanguage($lang)) {
    $messages[] = 'You must move the latest language files from extras/extra_languages/' . $lang . '. DON\'T MOVE /install directory !';
}
/*** check file existing ***/
$files = checkFile();
foreach ($files as $file) {
    $messages[] = $file;
}
/*** check directory existing ***/
$directories = checkDirectory();
foreach ($directories as $dir) {
            $content .= '
					</tr>';
        }
        $content .= '
					</table>
					<button id="export" class="my_button right"><img src="../modules/mailjet/img/page_excel.png" />' . Tools::safeOutput($obj->trad[26]) . '</button>
					<div class="right" id="seg_pagination">
						<a href="javascript:next(1, ' . $nb . ')"><<</a>
						<a href="javascript:next(' . (Tools::getvalue('page') ? Tools::getvalue('page') - 1 : 1) . ', ' . $nb . ')"><</a>
						' . Tools::safeOutput($obj->trad[27]) . ' <b>' . (Tools::getvalue('page') ? Tools::getvalue('page') : 1) . '</b> / ' . $nb . '
						<a href="javascript:next(' . (Tools::getvalue('page') ? Tools::getvalue('page') + 1 : 2) . ', ' . $nb . ')">></a>
						<a href="javascript:next(' . $nb . ',' . $nb . ')">>></a>
						<font size="3">' . $nb1 . ' ' . Tools::safeOutput($obj->trad[25]) . '</font>
					</div>
					<div class="clear">&nbsp;</div>';
        if (checkTable(Tools::getValue('fieldSelect')) && ($fs = Tools::getValue('fieldSelect')) && $obj->fieldIsPrintable($fs[0])) {
            $stat = array();
            $nbcustomer = Db::getInstance()->getValue('SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'customer`');
            $req = Db::getInstance()->executeS($reqsql);
            if (Tools::getIsset($obj->getFieldLabel($fs[0])) && Tools::getIsset($req[0][$obj->getFieldLabel($fs[0])])) {
                $fieldSelect_nb = count(Tools::getValue('fieldSelect'));
                for ($i = 0; $i < $fieldSelect_nb; $i++) {
                    $val1 = $_POST['value1'][$i];
                    $val2 = $_POST['value2'][$i];
                    $range = true;
                    $op = false;
                    if ($obj->translateOp($val1) && !$obj->translateOp($val2)) {
                        $range = false;
                        $op = $val1;
                        $val1 = $val2;
                    } else {
Example #7
0
function presenceTable($dbConn, $prjm_id, $constraint = '')
{
    $sqln = "select afko,description,prjm_id ,year,prj_id,milestone \n" . " from project natural join prj_milestone where prjm_id={$prjm_id}";
    //$page_opening="Presence list for project $afko $description prjm_id $prjm_id prj_id $prj_id milestone $milestone";
    $resultSet = $dbConn->Execute($sqln);
    if (!$resultSet->EOF) {
        extract($resultSet->fields);
        $caption = "Presence list for project {$afko} ({$year}) {$description} prjm_id {$prjm_id} prj_id {$prj_id} milestone {$milestone}";
    } else {
        $caption = 'Presence list';
    }
    $sql = "select \n" . "p.afko||p.year as activity," . "agroup as grp, \n" . " datum||'#'||al.act_id||': '||short||' '||al.description as title, present,note \n" . " from act_presence_list2 al join student st using(snummer) \n" . "natural join activity join prj_milestone using(prjm_id) join project p using (prj_id)" . " left join absence_reason ar using (act_id,snummer)\n" . " where prjm_id={$prjm_id} ";
    if ($constraint != '') {
        $sql .= ' and ' . $constraint;
    }
    $sql .= " order by datum,start_time";
    //achternaam,roepnaam,al.act_id desc\n";
    return checkTable($dbConn, $sql, 0, 2, 3, 4, "<table summary='{$caption}' border='1' align='left' style='border-collapse:collapse'>\n" . "<caption style='font-weight:bold'>{$caption}</caption>\n");
}
function getProds($conn)
{
    require_once 'languageConfig.php';
    $catid = array();
    if (empty($_POST['catid'])) {
        $selQ = new selectSQL($conn);
        $selQ->select = array("id");
        $selQ->tableNames = array("categories");
        $selQ->where = "visible = 1";
        if (!$selQ->executeQuery()) {
            $GLOBALS['statusMessage'] = $selQ->status;
            return;
        }
        if ($selQ->getNumberOfResults() == 0) {
            $GLOBALS['statusMessage'] = makeStatusMessage(51, "error");
            return;
        }
        while ($r = $selQ->result->fetch_assoc()) {
            $catid[] = $r['id'];
        }
        $propNames = array("*");
    } else {
        $catid[] = $conn->real_escape_string($_POST['catid']);
        $arr = getPropsForCat($conn, $catid[0], $langArr);
        if (!$arr) {
            return;
        }
        $propNames = array_merge(array("p.id as id"), $arr['propNamesDef']);
        foreach ($arr['propNamesDefld'] as $pd) {
            $propNames[] = $pd;
        }
        foreach ($arr['propNamesld'] as $p) {
            $propNames[] = $p;
        }
        $propNames = array_merge($propNames, $arr['propNames']);
    }
    $selQ = new selectSQL($conn);
    $selQ->select = $propNames;
    if (isset($_POST['id'])) {
        $selQ->where = "id = " . $conn->real_escape_string($_POST['id']);
    } else {
        $w = "(";
        foreach ($catid as $i) {
            $w .= "p.catid = '" . $i . "' OR ";
        }
        $selQ->where = substr($w, 0, -3) . ")";
        if (isset($_POST['deleted'])) {
            $selQ->where .= " AND p.visible != 1";
        } else {
            $selQ->where .= " AND p.visible = 1";
        }
    }
    $selQ->tableNames = array("products as p");
    $selQ->joins = array();
    $selQ->joinTypes = array();
    foreach ($catid as $i) {
        if (checkTable($conn, "products_" . $i)) {
            $selQ->tableNames[] = "products_" . $i;
            $selQ->joins[] = "p.id = products_" . $i . ".infoid";
            $selQ->joinTypes[] = "LEFT JOIN";
        }
        foreach ($langArr as $l) {
            if (checkTable($conn, "products_" . $i . "_" . $l)) {
                $selQ->tableNames[] = "products_" . $i . "_" . $l;
                $selQ->joins[] = "p.id = products_" . $i . "_" . $l . ".infoid";
                $selQ->joinTypes[] = "LEFT JOIN";
            }
        }
    }
    if (!$selQ->executeQuery()) {
        $GLOBALS['statusMessage'] = $selQ->status;
        mysqli_close($conn);
        return;
    }
    $data = array();
    while ($r = $selQ->result->fetch_assoc()) {
        $data[] = $r;
    }
    $GLOBALS['data'] = $data;
    $GLOBALS['statusMessage'] = makeStatusMessage(22, "success");
}