Beispiel #1
0
function IsoToDate($fecha)
{
    //                                                         Emek
    // Transforma una fecha del formato ISO aaa-mm-dd a dd-mm-aaaa
    // requiere funcion separafecha
    list($anio, $mes, $dia) = sscanf($fecha, "%04d-%02d-%02d");
    if ($anio > 0 && $mes > 0 && $dia > 0) {
        //$fecha2= date("d-m-Y",mktime(0,0,0,$mes,$dia,$anio));
        $fecha2 = "{$dia}-{$mes}-{$anio}";
        if (isdate($fecha2)) {
            return $fecha2;
        }
    }
}
Beispiel #2
0
                $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? '' : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']);
                $ugidsarr = array('0' => lang('release_usergroup')) + ugidsarr($grouptype['gtid'], $mchid);
                echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\"><select style=\"vertical-align: middle;\" name=\"minfosnew[grouptype" . $gtid . "]\">" . makeoption($ugidsarr, $actuser->info['grouptype' . $gtid]) . "</select></td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\"><input type=\"text\" size=\"20\" id=\"minfosnew[grouptype" . $gtid . "date]\" name=\"minfosnew[grouptype" . $gtid . "date]\" value=\"" . $actuser->info['grouptype' . $gtid . 'date'] . "\" onclick=\"ShowCalendar(this.id);\"></td>\n" . "</tr>";
            } else {
                $usergroups = read_cache('usergroups', $gtid);
                $actuser->info['grouptype' . $gtid . 'date'] = !$actuser->info['grouptype' . $gtid . 'date'] ? lang('noend') : date('Y-m-d', $actuser->info['grouptype' . $gtid . 'date']);
                echo "<tr class=\"txt\">\n" . "<td class=\"txtL w15B\">{$grouptype['cname']}</td>\n" . "<td class=\"txtL w35B\">" . (!$actuser->info['grouptype' . $gtid] ? lang('notbelong_usergroup') : $usergroups[$actuser->info['grouptype' . $gtid]]['cname']) . "</td>\n" . "<td class=\"txtL w15B\">" . lang('enddate') . "</td>\n" . "<td class=\"txtL w35B\">" . $actuser->info['grouptype' . $gtid . 'date'] . "</td>\n" . "</tr>";
            }
        }
        tabfooter('bmemberdetail');
        check_submit_func($submitstr);
        a_guide('memberdetail');
    } else {
        foreach ($grouptypes as $gtid => $grouptype) {
            if ($grouptype['mode'] < 2 && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($gtid != 2 || $backamember)) {
                $minfosnew['grouptype' . $gtid . 'date'] = !$minfosnew['grouptype' . $gtid] || !isdate($minfosnew['grouptype' . $gtid . 'date']) ? '0' : strtotime($minfosnew['grouptype' . $gtid . 'date']);
                $actuser->handgrouptype($gtid, $minfosnew['grouptype' . $gtid], $minfosnew['grouptype' . $gtid . 'date']);
            }
        }
        $actuser->updatedb();
        adminlog(lang('detail_edit_member'));
        amessage('membermodifyfinish', M_REFERER);
    }
} elseif ($action == 'allowance' && $mid) {
    if (!submitcheck('bmemberdetail')) {
        $a_field = new cls_field();
        $submitstr = '';
        tabheader(lang('issue_allowance_manager') . '&nbsp;:&nbsp;[' . $mchannel['cname'] . ']' . $actuser->info['mname'], 'memberdetail', "?entry=member&action=allowance&mid={$mid}", 2, 1, 1);
        trbasic(lang('aw_arc_issue_limit'), 'minfosnew[arcallowance]', $actuser->info['arcallowance']);
        trbasic(lang('aw_commu_issue_limit'), 'minfosnew[cuallowance]', $actuser->info['cuallowance']);
        tabfooter('bmemberdetail');
Beispiel #3
0
 function check_limit()
 {
     $mlimit = $this->field['mlimit'];
     if ($this->field['datatype'] == 'date') {
         $mlimit = 'date';
     } elseif ($this->field['datatype'] == 'int') {
         $mlimit = 'int';
     } elseif ($this->field['datatype'] == 'float') {
         $mlimit = 'number';
     }
     if (empty($this->newvalue) || empty($mlimit)) {
         return true;
     }
     $cname = $this->field['cname'];
     if ($mlimit == 'date' && !isdate($this->newvalue)) {
         $this->error = "{$cname} " . lang('liminpda');
     } elseif ($mlimit == 'int' && !is_numeric($this->newvalue)) {
         $this->error = "{$cname} " . lang('liminpint');
     } elseif ($mlimit == 'number' && !is_numeric($this->newvalue)) {
         $this->error = "{$cname} " . lang('liminpnum');
     } elseif ($mlimit == 'letter' && !preg_match("/^[a-z]+\$/i", $this->newvalue)) {
         $this->error = "{$cname} " . lang('limiinputlett');
     } elseif ($mlimit == 'numberletter' && !preg_match("/^[0-9a-z]+\$/i", $this->newvalue)) {
         $this->error = "{$cname} " . lang('limitinputnumberl');
     } elseif ($mlimit == 'tagtype' && !preg_match("/^[a-z]+\\w*\$/i", $this->newvalue)) {
         $this->error = "{$cname} " . lang('limitinputtagtype');
     } elseif ($mlimit == 'email' && !isemail($this->newvalue)) {
         $this->error = "{$cname} " . lang('limitinputemail');
     }
     return $this->error ? false : true;
 }
Beispiel #4
0
 $pre_cns = array();
 $pre_cns['caid'] = $archiveadd['caid'];
 //分析分类的定义及权限
 foreach ($cotypes as $k => $v) {
     if (!$v['self_reg'] && !in_array($k, $ccoids) && !in_array("ccid{$k}", $additems)) {
         $archiveadd["ccid{$k}"] = empty($archiveadd["ccid{$k}"]) ? '' : $archiveadd["ccid{$k}"];
         if ($v['notblank'] && !$archiveadd["ccid{$k}"]) {
             mcmessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
         }
         //必选类系
         $sqlmain .= ",ccid{$k} = '" . $archiveadd["ccid{$k}"] . "'";
         if ($archiveadd["ccid{$k}"]) {
             $pre_cns['ccid' . $k] = $archiveadd["ccid{$k}"];
         }
         if ($v['emode']) {
             $archiveadd["ccid{$k}date"] = !isdate($archiveadd["ccid{$k}date"]) ? 0 : strtotime($archiveadd["ccid{$k}date"]);
             !$archiveadd["ccid{$k}"] && ($archiveadd["ccid{$k}date"] = 0);
             if ($archiveadd["ccid{$k}"] && !$archiveadd["ccid{$k}date"] && $v['emode'] == 2) {
                 mcmessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
             }
             $sqlmain .= ",ccid{$k}date = '" . $archiveadd["ccid{$k}date"] . "'";
         }
     }
 }
 if (!$curuser->allow_arcadd($chid, $pre_cns)) {
     mcmessage('noissuepermission', axaction(2, M_REFERER), lang('cn_pointed'));
 }
 //分析类目组合的发表权限
 //有效值设置
 $archiveadd['validperiod'] = empty($archiveadd['validperiod']) ? 0 : max(0, intval($archiveadd['validperiod']));
 $channel['mindays'] && ($archiveadd['validperiod'] = max($archiveadd['validperiod'], $channel['mindays']));
Beispiel #5
0
     unset($a_field);
     tabfooter('newcommu');
     check_submit_func($submitstr);
 } else {
     $c_upload = new cls_upload();
     $bfields = fields_order($bfields);
     $sqlstr = '';
     $a_field = new cls_field();
     foreach ($ucotypes as $k => $v) {
         if (in_array('uccid' . $k, $citems) && $v['umode'] != 1) {
             if ($v['notblank'] && empty($communew['uccid' . $k])) {
                 amessage('notnull', axaction(2, M_REFERER), $v['cname']);
             }
             $sqlstr .= ",uccid{$k}='" . $communew['uccid' . $k] . "'";
             if ($v['emode']) {
                 $communew["uccid{$k}date"] = !isdate($communew["uccid{$k}date"]) ? 0 : strtotime($communew["uccid{$k}date"]);
                 if ($communew["uccid{$k}"] && !$communew["uccid{$k}date"] && $v['emode'] == 2) {
                     amessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
                 }
                 !$communew["uccid{$k}"] && ($communew["uccid{$k}date"] = 0);
                 $sqlstr .= ",uccid{$k}date='" . $communew["uccid{$k}date"] . "'";
             }
         }
     }
     foreach ($bfields as $k => $v) {
         if (!$v['isfunc'] && in_array($k, $citems)) {
             $a_field->init();
             $a_field->field = $v;
             $a_field->oldvalue = isset($report[$k]) ? $report[$k] : '';
             $a_field->deal('communew');
             if (!empty($a_field->error)) {
Beispiel #6
0
         }
     }
 }
 if (!empty($arcdeal['abover'])) {
     $aedit->updatefield('abover', 1, 'main');
 } elseif (!empty($arcdeal['unabover'])) {
     $aedit->updatefield('abover', 0, 'main');
 }
 if (!empty($arcdeal['caid'])) {
     $aedit->arc_caid($arccaid);
 }
 foreach ($cotypes as $k => $v) {
     if (!empty($arcdeal['ccid' . $k])) {
         $aedit->arc_ccid(${'arcccid' . $k}, $k);
         if ($v['emode']) {
             $aedit->updatefield("ccid{$k}date", !isdate(${"arcccid{$k}date"}) || !$aedit->archive["ccid{$k}"] ? 0 : strtotime(${"arcccid{$k}date"}), 'main');
         }
     }
 }
 if (!empty($arcdeal['rpmid'])) {
     $aedit->updatefield('rpmid', $arcrpmid, 'main');
 }
 if (!empty($arcdeal['dpmid'])) {
     $aedit->updatefield('dpmid', $arcdpmid, 'main');
 }
 if (!empty($arcdeal['fsalecp'])) {
     $aedit->updatefield('fsalecp', $arcfsalecp, 'main');
     $aedit->sale_define();
 }
 if (!empty($arcdeal['salecp'])) {
     $aedit->updatefield('salecp', $arcsalecp, 'main');
             mcmessage($a_field->error, axaction(2, M_REFERER));
         }
         $qvar = $v['issystem'] ? 'sqlcommon' : 'sqlcustom';
         ${$qvar} .= (${$qvar} ? ',' : '') . "{$k}='" . $a_field->newvalue . "'";
         if ($arr = multi_val_arr($a_field->newvalue, $v)) {
             foreach ($arr as $x => $y) {
                 ${$qvar} .= (${$qvar} ? ',' : '') . $k . '_' . $x . "='{$y}'";
             }
         }
     }
 }
 unset($a_field);
 if (empty($fcatalog['nodurat'])) {
     foreach (array('startdate', 'enddate') as $var) {
         $farchiveadd[$var] = trim($farchiveadd[$var]);
         $farchiveadd[$var] = !isdate($farchiveadd[$var]) ? 0 : strtotime($farchiveadd[$var]);
         $sqlcommon .= ",{$var}='" . max(0, intval($farchiveadd[$var])) . "'";
     }
 }
 $db->query("INSERT INTO {$tblprefix}farchives SET " . $sqlcommon);
 if (!($aid = $db->insert_id())) {
     $c_upload->closure(1);
     mcmessage('msgsaveerr', axaction(2, M_REFERER));
 } else {
     $c_upload->closure(1, $aid, 'farchives');
     $sqlcustom = "aid={$aid}" . ($sqlcustom ? ',' . $sqlcustom : '');
     $db->query("INSERT INTO {$tblprefix}farchives_{$chid} SET " . $sqlcustom);
     $aedit = new cls_farcedit();
     $aedit->set_aid($aid);
     $fcatalog['autocheck'] && $aedit->arc_check(1, 0);
     $aedit->updatedb();
Beispiel #8
0
     $uedit->updatefield('oprice', max(0, round($offernew['oprice'], 2)));
     $uedit->updatefield('refreshdate', $timestamp);
     $uedit->updatefield('enddate', empty($uedit->commu['setting']['vdays']) ? 0 : $timestamp + 86400 * $uedit->commu['setting']['vdays']);
 }
 if (isset($offernew['storage'])) {
     $uedit->updatefield('storage', max(-1, intval($offernew['storage'])));
 }
 $c_upload = new cls_upload();
 $fields = fields_order($fields);
 $a_field = new cls_field();
 foreach ($ucotypes as $k => $v) {
     if (isset($offernew['uccid' . $k])) {
         if (in_array('uccid' . $k, $citems) && !noedit('uccid' . $k, $v['umode'] == 2)) {
             $uedit->updatefield('uccid' . $k, $offernew['uccid' . $k]);
             if ($v['emode']) {
                 $offernew["uccid{$k}date"] = !isdate($offernew["uccid{$k}date"]) ? 0 : strtotime($offernew["uccid{$k}date"]);
                 if ($uedit->info["uccid{$k}"] && !$offernew["uccid{$k}date"] && $v['emode'] == 2) {
                     mcmessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
                 }
                 !$uedit->info["uccid{$k}"] && ($offernew["uccid{$k}date"] = 0);
                 $uedit->updatefield("uccid{$k}date", $offernew["uccid{$k}date"]);
             }
         }
     }
 }
 foreach ($fields as $k => $v) {
     if (isset($offernew[$k])) {
         if (!$v['isfunc'] && !$v['isadmin']) {
             $a_field->init();
             $a_field->field = $v;
             if (!noedit($k, !$curuser->pmbypmids('field', $v['pmid']))) {
Beispiel #9
0
    $fieldnew['cname'] = trim(strip_tags($fieldnew['cname']));
    if ($fnew) {
        $filterstr = empty($fconfigarr['filterstr']) ? "/[^a-zA-Z_0-9]+|^[0-9_]+/" : $fconfigarr['filterstr'];
        (empty($fieldnew['ename']) || empty($fieldnew['cname'])) && amessage('field_data_miss', $fconfigarr['errorurl']);
        preg_match($filterstr, $fieldnew['ename']) && amessage('field_ename_illegal', $fconfigarr['errorurl']);
        $fieldnew['ename'] = strtolower($fieldnew['ename']);
        in_array($fieldnew['ename'], $fconfigarr['enamearr']) && amessage('field_ename_repeat', $fconfigarr['errorurl']);
        in_array($fieldnew['ename'], $fieldwords) && amessage('field_ename_notuse', $fconfigarr['errorurl']);
        $db->query("ALTER TABLE {$fconfigarr['altertable']} ADD {$fieldnew['ename']} int(10) NOT NULL default '0'");
    } else {
        $fieldnew['cname'] = empty($fieldnew['cname']) ? $field['cname'] : $fieldnew['cname'];
    }
    if (!$isfunc) {
        $fieldnew['guide'] = empty($fieldnew['guide']) ? '' : trim($fieldnew['guide']);
        foreach (array('vdefault', 'min', 'max') as $key) {
            $fieldnew[$key] = trim($fieldnew[$key]);
            $fieldnew[$key] = !$fieldnew[$key] || !isdate($fieldnew[$key]) ? '' : strtotime($fieldnew[$key]);
        }
    } else {
        $fieldnew['func'] = empty($fieldnew['func']) ? '' : trim($fieldnew['func']);
    }
    foreach (array('datatype', 'ename', 'length', 'cname', 'notnull', 'nohtml', 'mode', 'guide', 'mlimit', 'rpid', 'issearch', 'innertext', 'min', 'max', 'regular', 'isfunc', 'func', 'vdefault', 'pmid', 'custom_1', 'custom_2') as $var) {
        isset($fieldnew[$var]) && ($sqlstr .= (!$sqlstr ? '' : ',') . "{$var}='" . $fieldnew[$var] . "'");
    }
    if ($fnew) {
        $db->query("INSERT INTO {$fconfigarr['fieldtable']} SET {$sqlstr}");
    } else {
        $wherestr = empty($fconfigarr['wherestr']) ? "WHERE ename='{$field['ename']}'" : $fconfigarr['wherestr'];
        $db->query("UPDATE {$fconfigarr['fieldtable']} SET {$sqlstr} {$wherestr}");
    }
}
Beispiel #10
0
             }
         }
     }
     unset($a_field);
     tabfooter('breplydetail');
     check_submit_func($submitstr);
 } else {
     $c_upload = new cls_upload();
     $fields = fields_order($fields);
     $a_field = new cls_field();
     $uedit->updatefield('refreshdate', $timestamp);
     foreach ($ucotypes as $k => $v) {
         if (in_array('uccid' . $k, $citems) && $v['umode'] != 1) {
             $uedit->updatefield('uccid' . $k, $replynew['uccid' . $k]);
             if ($v['emode']) {
                 $replynew["uccid{$k}date"] = !isdate($replynew["uccid{$k}date"]) ? 0 : strtotime($replynew["uccid{$k}date"]);
                 if ($uedit->info["uccid{$k}"] && !$replynew["uccid{$k}date"] && $v['emode'] == 2) {
                     amessage('setcoclass', axaction(2, M_REFERER), $v['cname']);
                 }
                 !$uedit->info["uccid{$k}"] && ($replynew["uccid{$k}date"] = 0);
                 $uedit->updatefield("uccid{$k}date", $replynew["uccid{$k}date"]);
             }
         }
     }
     foreach ($fields as $k => $v) {
         if (!$v['isfunc']) {
             $a_field->init();
             $a_field->field = $v;
             if ($curuser->pmbypmids('field', $v['pmid'])) {
                 $a_field->oldvalue = isset($oldrow[$k]) ? $oldrow[$k] : '';
                 $a_field->deal('replynew');
Beispiel #11
0
     amessage('memberpwdillegal', axaction(2, M_REFERER));
 }
 $md5_password = md5(md5($minfosadd['password']));
 #if(!$minfosadd['email'] || !isemail($minfosadd['email'])) amessage('memberemailillegal',axaction(2,M_REFERER));
 $autocheck = $mchannel['autocheck'];
 $mainarr = $subarr = $customarr = array();
 $mainarr['mname'] = $minfosadd['mname'];
 $mainarr['password'] = $md5_password;
 $mainarr['email'] = $minfosadd['email'];
 $mainarr['mtcid'] = empty($minfosadd['mtcid']) ? 1 : $minfosadd['mtcid'];
 foreach ($grouptypes as $gtid => $grouptype) {
     if (empty($grouptype['mode']) && !in_array($mchid, explode(',', $grouptype['mchids'])) && ($backamember || $gtid != 2)) {
         $usergroups = read_cache('usergroups', $gtid);
         if (!$minfosadd['grouptype' . $gtid] || in_array($mchid, explode(',', @$usergroups[$minfosadd['grouptype' . $gtid]]['mchids']))) {
             $mainarr["grouptype{$gtid}"] = $minfosadd['grouptype' . $gtid];
             $mainarr['grouptype' . $gtid . 'date'] = !$minfosadd['grouptype' . $gtid] || !isdate($minfosadd['grouptype' . $gtid . 'date']) ? '0' : strtotime($minfosadd['grouptype' . $gtid . 'date']);
         }
     }
 }
 foreach ($currencys as $crid => $currency) {
     if ($currency['available'] && $currency['initial']) {
         $mainarr["currency{$crid}"] = $currency['initial'];
     }
 }
 $mainarr['checked'] = 1;
 $mainarr['regip'] = $onlineip;
 $mainarr['regdate'] = $timestamp;
 $c_upload = new cls_upload();
 $mfields = fields_order($mfields);
 $a_field = new cls_field();
 $substr = $customstr = '';
Beispiel #12
0
     if (empty($fcatalog['nodurat'])) {
         foreach (array('startdate', 'enddate') as $var) {
             trbasic(lang($var), "farchivenew[{$var}]", $aedit->archive[$var] ? date('Y-m-d', $aedit->archive[$var]) : '', 'calendar');
             $submitstr .= makesubmitstr("farchivenew[{$var}]", 0, 0, 0, 0, 'date');
         }
     }
     tabfooter('bfarchivedetail');
     check_submit_func($submitstr);
 } else {
     if ($aedit->archive['checked'] && !$fcatalog['allowupdate']) {
         mcmessage('msgforbidupdate', axaction(2, M_REFERER));
     }
     if (empty($fcatalog['nodurat'])) {
         foreach (array('startdate', 'enddate') as $var) {
             $farchivenew[$var] = trim($farchivenew[$var]);
             $farchivenew[$var] = !isdate($farchivenew[$var]) ? 0 : strtotime($farchivenew[$var]);
             $aedit->updatefield($var, max(0, intval($farchivenew[$var])), 'main');
         }
     }
     $c_upload = new cls_upload();
     $fields = fields_order($fields);
     $a_field = new cls_field();
     foreach ($fields as $k => $v) {
         if (!$v['isadmin'] && !$v['isfunc']) {
             $a_field->init();
             $a_field->field = $v;
             $a_field->oldvalue = isset($aedit->archive[$k]) ? $aedit->archive[$k] : '';
             $a_field->deal('farchivenew');
             if (!empty($a_field->error)) {
                 $c_upload->rollback();
                 mcmessage($a_field->error, axaction(2, M_REFERER));
Beispiel #13
0
     $coclassnew['awardcp'] = $cotype['awardcp'] ? $coclassnew['awardcp'] : 0;
     $coclassnew['taxcp'] = $cotype['taxcp'] ? $coclassnew['taxcp'] : 0;
     $coclassnew['ftaxcp'] = $cotype['ftaxcp'] ? $coclassnew['ftaxcp'] : 0;
     $coclassnew['allowsale'] = $cotype['sale'] ? $coclassnew['allowsale'] : 0;
     $coclassnew['allowfsale'] = $cotype['fsale'] ? $coclassnew['allowfsale'] : 0;
     $sqlstr0 .= ",awardcp='{$coclassnew['awardcp']}',\n\t\t\t\t\t\ttaxcp='{$coclassnew['taxcp']}',\n\t\t\t\t\t\tftaxcp='{$coclassnew['ftaxcp']}',\n\t\t\t\t\t\tallowsale='{$coclassnew['allowsale']}',\n\t\t\t\t\t\tallowfsale='{$coclassnew['allowfsale']}',\n\t\t\t\t\t\tapmid='{$coclassnew['apmid']}',\n\t\t\t\t\t\trpmid='{$coclassnew['rpmid']}',\n\t\t\t\t\t\tcrpmid='{$coclassnew['crpmid']}',\n\t\t\t\t\t\tdpmid='{$coclassnew['dpmid']}',\n\t\t\t\t\t\tchids='{$coclassnew['chids']}'";
 } else {
     foreach (array('clicksfrom', 'commentsfrom', 'indays', 'favoritesfrom', 'praisesfrom', 'debasesfrom', 'ordersfrom', 'pricefrom', 'answersfrom', 'currencyfrom', 'clicksto', 'commentsto', 'outdays', 'favoritesto', 'praisesto', 'debasesto', 'ordersto', 'priceto', 'answersto', 'currencyto') as $v) {
         if ($coclassnew['conditions'][$v] == '') {
             unset($coclassnew['conditions'][$v]);
         } else {
             $coclassnew['conditions'][$v] = max(0, intval($coclassnew['conditions'][$v]));
         }
     }
     foreach (array('createdatefrom', 'createdateto') as $v) {
         if ($coclassnew['conditions'][$v] == '' || !isdate($coclassnew['conditions'][$v])) {
             unset($coclassnew['conditions'][$v]);
         } else {
             $coclassnew['conditions'][$v] = strtotime($coclassnew['conditions'][$v]);
         }
     }
     if ($coclassnew['conditions']['closed'] == '-1') {
         unset($coclassnew['conditions']['closed']);
     }
     $coclassnew['conditions']['sqlstr'] = trim($coclassnew['conditions']['sqlstr']);
     if ($coclassnew['conditions']['sqlstr'] == '') {
         unset($coclassnew['conditions']['sqlstr']);
     }
     if (empty($coclassnew['conditions'])) {
         amessage('setself_regcondition', axaction(2, M_REFERER));
     }