function getLanguagesAdminContent() { global $action; $content = ''; switch ($action) { case 'edit': $ID = (int) $_REQUEST['ID']; $content .= getEdit($ID); break; case 'add': $content .= getAdd(); break; default: $content .= getList(); break; } return $content; }
function getArticlesAdminContent() { global $site; global $sActionText; global $action, $itemviewid; $ret = ''; switch ($action) { case 'edit': $ret .= getEdit(); break; case 'add': $ret .= getAdd(); break; default: $ret .= getList(); break; } return $ret; }
function getArticlesAdminContent() { global $site; global $sActionText; global $action, $itemviewid; $content = ''; switch ($action) { case 'edit': $ID = (int) $_REQUEST['ID']; $content .= getEdit($ID); break; case 'add': $content .= getAdd(); break; default: $content .= getList(); break; } return $content; }
} $html .= ' </table> <input type="submit" value="ok" /> </form> </fieldset>'; return $html; } if (Tools::getValue('type') == 'baseadd') { Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'basecondition(label, tablename) values ("' . pSQL(Tools::getValue('label')) . '", "' . pSQL(Tools::getValue('tablename')) . '")'); Tools::redirect('modules/segmentmodule/config.php'); } elseif (Tools::getValue('type') == 'sourceadd') { Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'sourcecondition(id_basecondition,label, jointable) values ("' . pSQL(Tools::getValue('idbase')) . '","' . pSQL(Tools::getValue('label')) . '", "' . pSQL(Tools::getValue('jointable')) . '")'); Tools::redirect('modules/segmentmodule/config.php?type=addtobase&idbase=' . (int) Tools::getValue('idbase')); } elseif (Tools::getValue('type') == 'fieldadd') { Db::getInstance()->Execute('INSERT INTO ' . _DB_PREFIX_ . 'fieldcondition(id_sourcecondition,label, field) values ("' . pSQL(Tools::getValue('idsource')) . '","' . pSQL(Tools::getValue('label')) . '", "' . pSQL(Tools::getValue('field')) . '")'); Tools::redirect('modules/segmentmodule/config.php?type=addtosource&idsource=' . (int) Tools::getValue('idsource')); } elseif (Tools::getValue('type') == 'addtosource') { echo 'add to :' . Tools::getValue('idsource') . ' <br />'; echo getAdd(array('label', 'field'), 'fieldadd', array('idsource' => (int) Tools::getValue('idsource'))); echo getTable(array('id', 'idsource', 'label', 'field'), Db::getInstance()->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'fieldcondition'), 'field'); } elseif (Tools::getValue('type') == 'addtobase') { echo 'add to :' . Tools::getValue('idbase') . ' <br />'; echo getAdd(array('label', 'jointable'), 'sourceadd', array('idbase' => (int) Tools::getValue('idbase'))); echo getTable(array('id', 'idbase', 'label', 'jointable'), Db::getInstance()->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'sourcecondition'), 'source'); } else { echo getAdd(array('label', 'tablename'), 'baseadd'); echo getTable(array('id', 'label', 'tablename'), Db::getInstance()->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'basecondition'), 'base'); }