本文整理汇总了PHP中makecheckbox函数的典型用法代码示例。如果您正苦于以下问题:PHP makecheckbox函数的具体用法?PHP makecheckbox怎么用?PHP makecheckbox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makecheckbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPreConfig
/**
* Function getPreConfig
*
* outputs various content before the update process
* can be continued (askes for agreement whatever is being asked)
*
* @param string version
*
* @return string
*/
function getPreConfig($current_version)
{
$has_preconfig = false;
$return = '<div class="preconfig"><h3 style="color:#ff0000;">PLEASE NOTE - Important update notifications</h3>';
include_once makeCorrectFile(dirname(__FILE__) . '/preconfig/0.9/preconfig_0.9.inc.php');
parseAndOutputPreconfig($has_preconfig, $return, $current_version);
$return .= '<br /><br />' . makecheckbox('update_changesagreed', '<strong>I have read the update notifications above and I am aware of the changes made to my system.</strong>', '1', true, '0', true);
$return .= '</div>';
$return .= '<input type="hidden" name="update_preconfig" value="1" />';
if ($has_preconfig) {
return $return;
} else {
return '';
}
}
示例2: trfield
function trfield($varpre = '', $noeditstr = '', $ftype = '', $typeid = 0)
{
if (empty($this->field['ename']) || empty($this->field['available'])) {
return;
}
$trname = ($this->field['notnull'] ? '*' : '') . $this->field['cname'] . $noeditstr;
$varname = !$varpre ? $this->field['ename'] : $varpre . '[' . $this->field['ename'] . ']';
$oldstr = $this->isadd ? $this->field['vdefault'] : $this->oldvalue;
//多项选择
foreach (array('datatype', 'mode', 'guide', 'min', 'max') as $var) {
${$var} = $this->field[$var];
}
if ($datatype == 'cacc') {
$setting = empty($this->field['innertext']) ? array() : unserialize($this->field['innertext']);
trcacc($trname, $varname, $oldstr, $this->field['length'], @$setting['source'], @$setting['ids'], $mode, $max ? intval($max) : 0, $guide);
} else {
if (in_array($datatype, array('text', 'int', 'float'))) {
$oldstr = mhtmlspecialchars($oldstr);
$datatype = 'text';
} elseif ($datatype == 'select') {
$sourcearr = select_arr($this->field['innertext'], $this->field['fromcode']);
$oldstr = !$mode ? makeoption($sourcearr, $oldstr) : makeradio($varname, $sourcearr, $oldstr);
} elseif ($datatype == 'mselect') {
$sourcearr = select_arr($this->field['innertext'], $this->field['fromcode']);
$oldarr = explode("\t", $oldstr);
$oldstr = !$mode ? multiselect($varname . '[]', $sourcearr, $oldarr) : makecheckbox($varname . '[]', $sourcearr, $oldarr);
} elseif ($datatype == 'multitext') {
$oldstr = mhtmlspecialchars($oldstr);
} elseif ($datatype == 'date') {
$oldstr = $oldstr ? date('Y-m-d', $oldstr) : '';
} elseif ($datatype == 'map') {
!$oldstr && ($oldstr = $this->field['vdefault']);
$min = $this->field['length'];
} elseif ($datatype == 'vote') {
$mode = $ftype;
$max = $min;
$min = $typeid;
}
trspecial($trname, $varname, $oldstr, $datatype, $mode, $guide, $min, $max);
}
$this->make_submitstr($varname);
}
示例3: ask_yesno_withcheckbox
function ask_yesno_withcheckbox($text, $chk_text, $yesfile, $params = array(), $targetname = '', $show_checkbox = true)
{
global $userinfo, $db, $s, $header, $footer, $lng;
$hiddenparams = '';
if (is_array($params)) {
foreach ($params as $field => $value) {
$hiddenparams .= '<input type="hidden" name="' . htmlspecialchars($field) . '" value="' . htmlspecialchars($value) . '" />' . "\n";
}
}
if (isset($lng['question'][$text])) {
$text = $lng['question'][$text];
}
if (isset($lng['question'][$chk_text])) {
$chk_text = $lng['question'][$chk_text];
}
if ($show_checkbox) {
$checkbox = makecheckbox('delete_userfiles', $chk_text, '1', false, '0', true, true);
} else {
$checkbox = '<input type="hidden" name="delete_userfiles" value="0" />' . "\n";
}
$text = strtr($text, array('%s' => $targetname));
eval("echo \"" . getTemplate('misc/question_yesno_checkbox', '1') . "\";");
exit;
}
示例4: exit
<?php
(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (empty($submitmode)) {
$coidsarr = array();
foreach ($cotypes as $k => $v) {
if (!$v['self_reg']) {
$coidsarr[$k] = $v['cname'];
}
}
trbasic(lang('view_coids') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallcoids\" onclick=\"checkall(this.form,'coidsnew','chkallcoids')\">" . lang('selectall'), '', makecheckbox('coidsnew[]', $coidsarr, empty($aurl['setting']['coids']) ? array() : explode(',', $aurl['setting']['coids']), 5), '');
trbasic(lang('yes_arange') . lang('achannel') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallchids\" onclick=\"checkall(this.form,'chidsnew','chkallchids')\">" . lang('selectall'), '', makecheckbox('chidsnew[]', chidsarr(1), empty($aurl['setting']['chids']) ? array() : explode(',', $aurl['setting']['chids']), 5), '', lang('agnoselect'));
trbasic(lang('no_arange') . lang('achannel') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallnochids\" onclick=\"checkall(this.form,'nochidsnew','chkallnochids')\">" . lang('selectall'), '', makecheckbox('nochidsnew[]', chidsarr(1), empty($aurl['setting']['nochids']) ? array() : explode(',', $aurl['setting']['nochids']), 5), '', lang('agnoselect'));
} else {
foreach (array('coids', 'chids', 'nochids') as $var) {
$aurlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'});
}
$aurlnew['url'] = "?entry=addpre&nauid={$auid}";
}
示例5: exit
<?php
(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if (empty($submitmode)) {
load_cache('fcatalogs');
tabfooter();
tabheader(lang('arangeset'));
trbasic(lang('arange') . lang('coclass') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallcaids\" onclick=\"checkall(this.form,'caidsnew','chkallcaids')\">" . lang('selectall'), '', makecheckbox('caidsnew[]', fcaidsarr(), empty($murl['setting']['caids']) ? array() : explode(',', $murl['setting']['caids']), 5), '', lang('agnoselect'));
tabfooter();
tabheader(lang('pageresult'));
trbasic(lang('adm_title'), 'murlnew[mtitle]', $murl['mtitle'], 'text', lang('aga_title'));
trbasic(lang('adm_guide'), 'murlnew[guide]', $murl['guide'], 'textarea', lang('aga_title'));
$tnstr = "<input type=\"text\" size=\"25\" id=\"murlnew[tplname]\" name=\"murlnew[tplname]\" value=\"{$murl['tplname']}\"> \n\t\t\t<input class=\"checkbox\" type=\"checkbox\" name=\"murlnew[onlyview]\" id=\"murlnew[onlyview]\" value=\"1\"" . (empty($murl['onlyview']) ? '' : ' checked') . ">" . lang('onlyview');
trbasic(lang('customapage'), '', $tnstr, '', lang('agcustomapage'));
} else {
foreach (array('caids') as $var) {
$murlnew['setting'][$var] = empty(${$var . 'new'}) ? '' : implode(',', ${$var . 'new'});
}
$murlnew['url'] = "?action=farchiveadd&nmuid={$muid}";
}
示例6: tabfooter
tabfooter();
tabheader(lang('a_url'));
$iuidsarr = array();
foreach ($inurls as $k => $v) {
if (in_array($v['uclass'], array('adetail', 'inadd', 'content', 'load', 'setalbum', 'vol', 'comments', 'offers', 'replys', 'answers', 'purchases', 'reports', 'custom'))) {
$iuidsarr[$k] = '<b>' . $v['cname'] . '</b> ' . $v['remark'];
}
}
trbasic(lang('view_inurls'), '', makecheckbox('channelnew[iuids][]', $iuidsarr, empty($channel['iuids']) ? array() : explode(',', $channel['iuids']), 3), '', lang('agnoselect1'));
$imuidsarr = array();
foreach ($inmurls as $k => $v) {
if (in_array($v['uclass'], array('adetail', 'inadd', 'content', 'load', 'setalbum', 'vol', 'replys', 'answers', 'custom'))) {
$imuidsarr[$k] = '<b>' . $v['cname'] . '</b> ' . $v['remark'];
}
}
trbasic(lang('view_inmurls'), '', makecheckbox('channelnew[imuids][]', $imuidsarr, empty($channel['imuids']) ? array() : explode(',', $channel['imuids']), 3), '', lang('agnoselect1'));
tabfooter();
tabheader(lang('astaticset'));
$addnos = explode(',', $channel['addnos']);
$statics = explode(',', $channel['statics']);
$periods = explode(',', $channel['periods']);
$novus = explode(',', $channel['novus']);
for ($i = 0; $i <= $max_addno; $i++) {
$pvar = $i ? lang('addp') . $i : lang('arcconpage');
$str = "<input type=\"text\" size=\"6\" id=\"channelnew[addnos][{$i}]\" name=\"channelnew[addnos][{$i}]\" value=\"" . @$addnos[$i] . "\" title=\"" . lang('addnoset') . "\"> ";
$str .= "<select id=\"channelnew[statics][{$i}]\" name=\"channelnew[statics][{$i}]\">" . makeoption(array(0 => lang('staticsys'), 1 => lang('keepdnc'), 2 => lang('create_static')), @$statics[$i]) . "</select> ";
$str .= "<input type=\"text\" size=\"2\" id=\"channelnew[periods][{$i}]\" name=\"channelnew[periods][{$i}]\" value=\"" . @$periods[$i] . "\" title=\"" . lang('staticperiod') . "\"> ";
$str .= "<input class=\"checkbox\" type=\"checkbox\" id=\"channelnew[novus][{$i}]\" name=\"channelnew[novus][{$i}]\" value=\"1\" " . (empty($novus[$i]) ? '' : ' checked') . " title=\"" . lang('novu') . "\">";
trbasic($pvar . lang('setting'), '', $str, '', $i ? '' : lang('agaddnos'));
}
tabfooter('bchanneldetail');
示例7: trbasic
trbasic(lang('operate_permi_set'), 'communew[setting][apmid]', makeoption(pmidsarr('cuadd'), empty($commu['setting']['apmid']) ? 0 : $commu['setting']['apmid']), 'select');
trbasic(lang('allow_repeat'), 'communew[setting][repeat]', isset($commu['setting']['repeat']) ? $commu['setting']['repeat'] : 0, 'radio');
trbasic(lang('repeat_time_m'), 'communew[setting][repeattime]', isset($commu['setting']['repeattime']) ? $commu['setting']['repeattime'] : 0);
trbasic(lang('nouservote'), 'communew[setting][nouservote]', isset($commu['setting']['nouservote']) ? $commu['setting']['nouservote'] : 0, 'radio');
trbasic(lang('repeatvote'), 'communew[setting][repeatvote]', isset($commu['setting']['repeatvote']) ? $commu['setting']['repeatvote'] : 0, 'radio');
$itemsarr = array();
foreach ($ucotypes as $k => $v) {
if ($v['cclass'] == $commu['cclass']) {
$itemsarr['uccid' . $k] = $v['cname'];
}
}
foreach ($rfields as $k => $v) {
$itemsarr[$k] = $v['cname'];
}
trbasic(lang('cu_citems') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkall_1\" onclick=\"checkall(this.form,'citemsnew','chkall_1')\">" . lang('selectall'), '', makecheckbox('citemsnew[]', $itemsarr, empty($commu['setting']['citems']) ? array() : explode(',', $commu['setting']['citems']), 5), '');
trbasic(lang('cu_useredits') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkall_5\" onclick=\"checkall(this.form,'usereditsnew','chkall_5')\">" . lang('selectall'), '', makecheckbox('usereditsnew[]', $itemsarr, empty($commu['setting']['useredits']) ? array() : explode(',', $commu['setting']['useredits']), 5), '');
tabfooter();
tabheader(lang('udef_func') . " <input class=\"checkbox\" type=\"checkbox\" name=\"viewdetail\" value=\"1\" onclick=\"alterview('funcsetting')\">" . lang('view'));
echo "<tbody id=\"funcsetting\" style=\"display: none;\">";
trbasic(lang('php_func_code'), 'communew[func]', empty($commu['func']) ? '' : $commu['func'], 'btextarea');
echo "</tbody>";
tabfooter();
tabheader(lang('advsetting') . " <input class=\"checkbox\" type=\"checkbox\" name=\"viewdetail2\" value=\"1\" onclick=\"alterview('advsetting')\">" . lang('view'));
echo "<tbody id=\"advsetting\" style=\"display: none;\">";
trbasic(lang('custom_ucadd'), 'communew[ucadd]', empty($commu['ucadd']) ? '' : $commu['ucadd'], 'text', lang('agmucustom'));
trbasic(lang('custom_ucvote'), 'communew[ucvote]', empty($commu['ucvote']) ? '' : $commu['ucvote'], 'text', lang('agmucustom'));
trbasic(lang('custom_uadetail'), 'communew[uadetail]', empty($commu['uadetail']) ? '' : $commu['uadetail'], 'text', lang('agmucustom'));
trbasic(lang('custom_umdetail'), 'communew[umdetail]', empty($commu['umdetail']) ? '' : $commu['umdetail'], 'text', lang('agmucustom'));
trbasic(lang('customsetting'), 'communew[usetting]', empty($commu['usetting']) ? '' : $commu['usetting'], 'btextarea', lang('agcustomsetting'));
echo "</tbody>";
} else {
示例8: tabfooter
$aurlstr .= ($aurlstr ? ',' : '') . $k . '-' . @$aurls[$k]['cname'];
}
}
echo "<tr class=\"txt\">\n" . "<td class=\"txtC w30\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[{$mchid}]\" value=\"{$mchid}\"></td>\n" . "<td class=\"txtL\">{$title}</td>\n" . "<td class=\"txtC\">{$aurlstr}</td>\n" . "</tr>\n";
}
tabfooter();
tabheader(lang('operate_item'));
$enablearr = array('1' => lang('enable'), '0' => lang('cancel'));
trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[enable]\" value=\"1\"> " . lang('enable') . lang('mnode'), '', makeradio('arcenable', $enablearr, 1), '');
$aurlsarr = array();
foreach ($aurls as $k => $v) {
if (in_array($v['uclass'], array('members', 'memadd', 'mcomments', 'mreplys', 'mreports', 'marchives', 'mtrans', 'utrans', 'custom'))) {
$aurlsarr[$k] = $k . '-<b>' . $v['cname'] . '</b>-' . $v['remark'];
}
}
trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"arcdeal[auids]\" value=\"1\"> " . lang('set') . lang('aurl'), '', makecheckbox('arcauids[]', $aurlsarr, array(), 1), '');
tabfooter('bamconfigablock');
a_guide('amconfigablock');
} else {
if (!empty($selectid)) {
foreach ($selectid as $id) {
if (!empty($arcdeal['enable'])) {
if ($arcenable) {
if (!isset($mnodes[$id])) {
$mnodes[$id] = '';
}
} else {
unset($mnodes[$id]);
}
}
if (!empty($arcdeal['auids'])) {
示例9: substr
$ticket['lastreplier'] = $lng['ticket']['customer'];
}
if (strlen($ticket['subject']) > 20) {
$ticket['subject'] = substr($ticket['subject'], 0, 17) . '...';
}
eval("\$tickets.=\"" . getTemplate("tickets/archived_tickets") . "\";");
}
}
$priorities_options = makecheckbox('priority1', $lng['ticket']['high'], '1');
$priorities_options .= makecheckbox('priority2', $lng['ticket']['normal'], '2');
$priorities_options .= makecheckbox('priority3', $lng['ticket']['low'], '3');
$category_options = '';
$ccount = 0;
$result = $db->query('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` ORDER BY `name` ASC');
while ($row = $db->fetch_array($result)) {
$category_options .= makecheckbox('category' . $ccount, $row['name'], $row['id'], true);
$ccount++;
}
$customers = makeoption($lng['ticket']['nocustomer'], '-1', '-1');
$result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` " . ($userinfo['customers_see_all'] ? '' : " WHERE `adminid` = '" . (int) $userinfo['adminid'] . "' ") . " ORDER BY `name` ASC");
while ($row_customer = $db->fetch_array($result_customers)) {
$customers .= makeoption(getCorrectFullUserDetails($row_customer) . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid']);
}
eval("echo \"" . getTemplate("tickets/archive") . "\";");
}
} elseif ($action == 'view' && $id != 0) {
$log->logAction(ADM_ACTION, LOG_NOTICE, "viewed archived-ticket #" . $id);
$ticket_replies = '';
$mainticket = ticket::getInstanceOf($userinfo, $db, $settings, (int) $id);
$lastchange = date("d.m.Y H:i\\h", $mainticket->Get('lastchange'));
$dt = date("d.m.Y H:i\\h", $mainticket->Get('dt'));
示例10: array_intersect
$nclasses = array_intersect($nclasses, array_keys($tagclass));
if (in_array($utclass, $nclasses) || $utclass == 'no_class' && empty($nclasses)) {
$ttype = $tag['ttype'];
$title = $tag['title'];
$vieworder = $tag['vieworder'];
$tag = read_cache($ttype, $tag['tname'], '', $sid);
$tclassstr = fetch_class($ttype, $tag['tclass']);
$title || ($title = $tag['cname']);
echo "<tr class=\"txt\">" . "<td class=\"txtC w40\"><input class=\"checkbox\" type=\"checkbox\" name=\"selectid[]\" value=\"{$key}\"></td>\n" . "<td class=\"txtL\"><input type=\"text\" size=\"30\" maxlength=\"30\" name=\"usualtagsnew[{$key}][title]\" value=\"" . mhtmlspecialchars($title) . "\"></td>\n" . "<td class=\"txtL\">" . mhtmlspecialchars($tag['cname']) . "</td>\n" . "<td class=\"txtL\">{$tclassstr}</td>\n" . "<td class=\"txtL\">" . tag_style($tag['ename'], $ttype) . "</td>\n" . "<td class=\"txtC w50\"><input type=\"text\" size=\"4\" name=\"usualtagsnew[{$key}][vieworder]\" value=\"{$vieworder}\"></td>\n" . "<td class=\"txtC w30\"><a href=\"?entry=mtags&action=mtagsdetail&ttype={$ttype}{$param_suffix}&tname={$tag['ename']}\" onclick=\"return floatwin('open_mtagsedit',this)\">" . lang('detail') . "</a></td>\n" . "</tr>\n";
}
}
tabfooter();
//操作区
tabheader(lang('operate_item'));
trbasic(lang('choose_item'), '', "<input class=\"checkbox\" type=\"checkbox\" name=\"tagdeal[delete]\" value=\"1\"> " . lang('delete'), '');
trbasic("<input class=\"checkbox\" type=\"checkbox\" name=\"tagdeal[utclass]\" value=\"1\"> " . lang('set') . lang('usualtagclass'), '', makecheckbox('tagutclass[]', $tagclass), '');
tabfooter('busualtagsedit');
a_guide('usualtags_edit');
} else {
if (!empty($selectid)) {
foreach ($selectid as $key) {
if (!empty($tagdeal['delete'])) {
unset($usualtagsnew[$key], $usualtags[$key]);
continue;
}
if (!empty($tagdeal['utclass'])) {
$usualtags[$key]['class'] = empty($tagutclass) ? '' : implode(',', $tagutclass);
}
}
}
if (!empty($usualtagsnew)) {
示例11: makecheckbox
if ($result['email_autoresponder'] == '-1') {
$result['email_autoresponder'] = '';
}
$ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, $result['ftps'], true, true);
if ($result['ftps'] == '-1') {
$result['ftps'] = '';
}
$tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, $result['tickets'], true, true);
if ($result['tickets'] == '-1') {
$result['tickets'] = '';
}
$mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, $result['mysqls'], true, true);
if ($result['mysqls'] == '-1') {
$result['mysqls'] = '';
}
$number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, $result['aps_packages'], true, true);
if ($result['aps_packages'] == '-1') {
$result['aps_packages'] = '';
}
$language_options = '';
while (list($language_file, $language_name) = each($languages)) {
$language_options .= makeoption($language_name, $language_file, $result['def_language'], true);
}
$ipaddress = makeoption($lng['admin']['allips'], "-1", $result['ip']);
$ips = array();
$ipsandports = $db->query('SELECT `id`, `ip` FROM `' . TABLE_PANEL_IPSANDPORTS . '` ORDER BY `ip`, `port` ASC');
while ($row = $db->fetch_array($ipsandports)) {
if (filter_var($row['ip'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$row['ip'] = '[' . $row['ip'] . ']';
}
if (!in_array($row['ip'], $ips)) {
示例12: elseif
} elseif ($action == 'grouptypedetail' && $gtid) {
$grouptype = $grouptypes[$gtid];
if (!submitcheck('bgrouptypedetail')) {
tabheader(lang('edit_grouptype'), 'grouptypedetail', "?entry=grouptypes&action=grouptypedetail>id={$gtid}");
$modearr = array('0' => lang('user_handwork'), '1' => lang('admin_handwork'), '2' => lang('crbase'), '3' => lang('crex'));
$cridsarr = array(0 => $grouptype['mode'] == 3 ? lang('cash') : lang('noset')) + cridsarr();
trbasic(lang('grouptype_name'), 'grouptypenew[cname]', $grouptype['cname']);
if ($grouptype['issystem']) {
trbasic(lang('deal_mode'), '', $modearr[$grouptype['mode']], '');
trbasic(lang('related_cutype'), '', $cridsarr[$grouptype['crid']], '');
} else {
trbasic(lang('deal_mode'), 'grouptypenew[mode]', makeoption($modearr, $grouptype['mode']), 'select');
trbasic(lang('related_cutype'), 'grouptypenew[crid]', makeoption($cridsarr, $grouptype['crid']), 'select');
trbasic(lang('usergroup_alter_reset'), 'grouptypenew[allowance]', $grouptype['allowance'], 'radio');
}
trbasic(lang('inchids_forbid_use'), '', makecheckbox('grouptypenew[mchids][]', mchidsarr(), !empty($grouptype['mchids']) ? explode(',', $grouptype['mchids']) : array(), 5), '');
tabfooter('bgrouptypedetail', lang('modify'));
a_guide('grouptypedetail');
} else {
$grouptypenew['mode'] = empty($grouptypenew['mode']) ? 0 : $grouptypenew['mode'];
$grouptypenew['crid'] = empty($grouptypenew['crid']) ? 0 : $grouptypenew['crid'];
if (empty($grouptypenew['cname']) || $grouptypenew['mode'] == 2 && empty($grouptypenew['crid'])) {
amessage('groupdatamis', M_REFERER);
}
$grouptypenew['crid'] = $grouptypenew['mode'] < 2 ? 0 : $grouptypenew['crid'];
$grouptypenew['mchids'] = !empty($grouptypenew['mchids']) ? implode(',', $grouptypenew['mchids']) : '';
$grouptypenew['allowance'] = empty($grouptypenew['allowance']) ? 0 : $grouptypenew['allowance'];
$sqlstr = $grouptype['issystem'] ? '' : "mode='{$grouptypenew['mode']}',crid='{$grouptypenew['crid']}',allowance='{$grouptypenew['allowance']}',";
$db->query("UPDATE {$tblprefix}grouptypes SET \n\t\t\t\t\tcname='{$grouptypenew['cname']}',\n\t\t\t\t\t{$sqlstr}\n\t\t\t\t\tmchids='{$grouptypenew['mchids']}'\n\t\t\t\t\tWHERE gtid='{$gtid}'");
adminlog(lang('detail_modify_grouptype'));
updatecache('grouptypes', $gtid);
示例13: ManagePackages
//.........这里部分代码省略.........
while ($Row = $this->db->fetch_array($Result)) {
//query how often package has been installed
$Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` WHERE `PackageID` = ' . $Row['ID']);
if ($this->db->num_rows($Result2) == 0) {
//remove package if number of package instances is 0
self::UnlinkRecursive('./packages/' . $Row['Path']);
$this->db->query('DELETE FROM `' . TABLE_APS_PACKAGES . '` WHERE `ID` = ' . $Row['ID']);
}
}
} else {
//show yes/no question
$Message = $lng['question']['reallyremovepackages'];
$Ids = '<input type="hidden" name="all" value="remove"/>';
eval('echo "' . getTemplate('aps/askyesno') . '";');
$Question = true;
}
} else {
//no special button or "all" function has been clicked
//continue to parse "single" options
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`');
$Ids = '';
while ($Row = $this->db->fetch_array($Result)) {
//set new status of package (locked)
if ($Row['Status'] == PACKAGE_ENABLED && isset($_POST['lock' . $Row['ID']])) {
$this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_LOCKED . ' WHERE `ID` = ' . $this->db->escape($Row['ID']));
}
//set new status of package (enabled)
if ($Row['Status'] == PACKAGE_LOCKED && isset($_POST['unlock' . $Row['ID']])) {
$this->db->query('UPDATE `' . TABLE_APS_PACKAGES . '` SET `Status` = ' . PACKAGE_ENABLED . ' WHERE `ID` = ' . $this->db->escape($Row['ID']));
}
//save id of package to remove for yes/no question
if (isset($_POST['remove' . $Row['ID']])) {
$Ids .= '<input type="hidden" name="remove' . $Row['ID'] . '" value="1"/>';
//remove package if answer is yes
if (isset($_POST['answer']) && $_POST['answer'] == $lng['panel']['yes']) {
self::UnlinkRecursive('./packages/' . $Row['Path']);
$this->db->query('DELETE FROM `' . TABLE_APS_PACKAGES . '` WHERE `ID` = ' . $Row['ID']);
}
}
}
//if there are some ids to remove, show yes/no box
if ($Ids != '' && !isset($_POST['answer'])) {
//show yes/no question
$Message = $lng['question']['reallyremovepackages'];
eval('echo "' . getTemplate('aps/askyesno') . '";');
$Question = true;
}
}
}
//show package overview with options
if (!isset($_POST['save']) || $Question == false) {
//query all packages grouped by package name
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` GROUP BY `Name` ORDER BY `Name` ASC');
$Packages = '';
while ($Row = $this->db->fetch_array($Result)) {
eval('$Packages.="' . getTemplate('aps/manage_packages_row') . '";');
//get all package versions of current package
$Result2 = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Name` = "' . $this->db->escape($Row['Name']) . '" ORDER BY `Version` DESC, `Release` DESC');
while ($Row2 = $this->db->fetch_array($Result2)) {
//show package with options
$Lock = '';
$Unlock = '';
if ($Row2['Status'] == PACKAGE_ENABLED) {
$Lock = makecheckbox('lock' . $Row2['ID'], '', '1');
}
if ($Row2['Status'] == PACKAGE_LOCKED) {
$Unlock = makecheckbox('unlock' . $Row2['ID'], '', '1');
}
//query how often package has been installed
$Result3 = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` WHERE `PackageID` = ' . $Row2['ID']);
$Installations = $this->db->num_rows($Result3);
if ($Installations == 0) {
$Remove = makecheckbox('remove' . $Row2['ID'], '', '1');
}
eval('$Packages.="' . getTemplate('aps/manage_packages_detail') . '";');
}
}
if ($this->db->num_rows($Result) == 0) {
//no packages have been installed in system
self::InfoBox($lng['aps']['nopackagesinsystem']);
eval('echo "' . getTemplate('aps/manage_packages_download') . '";');
} else {
//generate some statistics
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '`');
$Temp = $this->db->num_rows($Result);
$Statistics = sprintf($lng['aps']['numerofpackagesinstalled'], $this->db->num_rows($Result));
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_PACKAGES . '` WHERE `Status` = ' . PACKAGE_ENABLED);
$Statistics .= sprintf($lng['aps']['numerofpackagesenabled'], $this->db->num_rows($Result));
$Statistics .= sprintf($lng['aps']['numerofpackageslocked'], $Temp - $this->db->num_rows($Result));
if ((int) $this->userinfo['customers_see_all'] == 1) {
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '`');
$Statistics .= sprintf($lng['aps']['numerofinstances'], $this->db->num_rows($Result));
} else {
$Result = $this->db->query('SELECT * FROM `' . TABLE_APS_INSTANCES . '` AS `i` INNER JOIN `' . TABLE_PANEL_CUSTOMERS . '` AS `c` ON `i`.`CustomerID` = `c`.`customerid` WHERE `c`.`adminid` = ' . (int) $this->userinfo['adminid']);
$Statistics .= sprintf($lng['aps']['numerofinstances'], $this->db->num_rows($Result));
}
eval('echo "' . getTemplate('aps/manage_packages') . '";');
}
}
}
示例14: elseif
$arr =& $matypes;
$tvar = 'cname';
} elseif (in_str('ccid', $mcnvar)) {
$arr = read_cache('coclasses', str_replace('ccid', '', $mcnvar));
$tvar = 'title';
} elseif (in_str('ugid', $mcnvar)) {
$arr = read_cache('usergroups', str_replace('ugid', '', $mcnvar));
$tvar = 'cname';
}
$narr = array();
foreach ($arr as $k => $v) {
if (empty($mcnodes[$mcnvar . '=' . $k])) {
$narr[$k] = $v[$tvar] . (isset($v['level']) ? '(' . $v['level'] . ')' : '');
}
}
trbasic(lang('choosenode') . "<br><input class=\"checkbox\" type=\"checkbox\" name=\"chkallmcnids\" onclick=\"checkall(this.form,'mcnidsnew','chkallmcnids')\">" . lang('selectall'), '', makecheckbox('mcnidsnew[]', $narr, array(), 5), '');
}
trbasic(lang('addnonum'), 'mcnodenew[addnum]');
trhidden('mcnodenew[mcnvar]', $mcnvar);
tabfooter('bmcnodeadd', lang('add'));
}
} else {
$mcnodenew['addnum'] = min(empty($mcn_max_addno) ? 0 : $mcn_max_addno, max(0, intval($mcnodenew['addnum'])));
if ($mcnvar == 'mcnid') {
if ($mcnodenew['alias'] = trim(strip_tags($mcnodenew['alias']))) {
$db->query("INSERT INTO {$tblprefix}mcnodes SET alias='{$mcnodenew['alias']}',addnum='{$mcnodenew['addnum']}',mcnvar='{$mcnvar}'");
if ($cnid = $db->insert_id()) {
$db->query("UPDATE {$tblprefix}mcnodes SET mcnid='{$cnid}',ename='{$mcnvar}={$cnid}' WHERE cnid={$cnid}");
}
updatecache('mcnodes');
}
示例15: date
if ($date_from == -1) {
$deactivated = '-1';
$date_from = '';
} else {
$deactivated = '0';
$date_from = date('d-m-Y', $date_from);
}
$date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
if ($date_until == -1) {
$deactivated = '-1';
$date_until = '';
} else {
$deactivated = '0';
$date_until = date('d-m-Y', $date_until);
}
$date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true);
#$isactive = makeyesno('active', '1', '0', $row['enabled']);
$autoresponder_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/customer/autoresponder/formfield.autoresponder_edit.php');
$autoresponder_edit_form = htmlform::genHTMLForm($autoresponder_edit_data);
$title = $autoresponder_edit_data['autoresponder_edit']['title'];
$image = $autoresponder_edit_data['autoresponder_edit']['image'];
eval("echo \"" . getTemplate("autoresponder/autoresponder_edit") . "\";");
} else {
if ($action == "delete") {
if (isset($_POST['send']) && $_POST['send'] == 'send') {
$account = trim($_POST['account']);
// Does autoresponder exist?
$result = $db->query("SELECT `email` FROM `" . TABLE_MAIL_AUTORESPONDER . "` WHERE `customerid` = '" . (int) $userinfo['customerid'] . "' AND `email` = '" . $db->escape($account) . "' LIMIT 0,1");
if ($db->num_rows($result) == 0) {
standard_error('invalidautoresponder');
}