• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mysql类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中mysql的典型用法代码示例。如果您正苦于以下问题:PHP mysql类的具体用法?PHP mysql怎么用?PHP mysql使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了mysql类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: zoom_popup

function zoom_popup(){
	$q=new mysql();
	$page=CurrentPageName();
	$tpl=new templates();
	$MAIN=unserialize(base64_decode($_GET["zoom-popup"]));
	if(is_numeric($MAIN["ID"])){
		$ligne=mysql_fetch_array($q->QUERY_SQL("SELECT eth,rulename FROM iptables_main WHERE ID='{$MAIN["ID"]}'","artica_backup"));
		$title="{$ligne["eth"]}::".$tpl->javascript_parse_text($ligne["rulename"]);
	}
	
	$html="<div style='font-size:26px'>$title</div>
	<div style='width:98%' class=form>
	<table style='width:100%'>
	";
	
	unset($MAIN['MAC']);
	unset($MAIN['ID']);
	
	while (list ($num, $line) = each ($MAIN)){
		$tr[]="<tr>
			<td class=legend style='font-size:18px;width=1%' nowrap>$num</td>
			<td style='font-size:18px'>$line</td>
			</tr>";
	}
	$html=$html.@implode("", $tr)."</table></div>";
	echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:27,代码来源:system.firewall.events.php


示例2: create_user_from_mysql

function create_user_from_mysql()
{
    $q = new mysql();
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
    $GLOBALS["WAIT"] = true;
    build_progress("{start}", 10);
    $results = $q->QUERY_SQL("SELECT * FROM CreateUserQueue", "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        build_progress("MySQL error", 110);
        return;
    }
    @mkdir("/usr/share/artica-postfix/ressources/logs/web/create-users", 0755, true);
    echo mysql_num_rows($results) . " member(s) to create...\n";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $zMD5 = $ligne["zMD5"];
        $content = $ligne["content"];
        @file_put_contents("/usr/share/artica-postfix/ressources/logs/web/create-users/{$zMD5}", $content);
        if (create_user($zMD5)) {
            build_progress("{removing_order}", 95);
            $q->QUERY_SQL("DELETE FROM `CreateUserQueue` WHERE `zMD5`='{$zMD5}'", "artica_backup");
        } else {
            $q->QUERY_SQL("DELETE FROM `CreateUserQueue` WHERE `zMD5`='{$zMD5}'", "artica_backup");
            build_progress("{failed}", 110);
            return;
        }
    }
    build_progress("{done}", 100);
}
开发者ID:articatech,项目名称:artica,代码行数:32,代码来源:exec.create-user.php


示例3: postfix_status

function postfix_status()
{
    $user = new usersMenus();
    if (!$user->POSTFIX_INSTALLED) {
        return null;
    }
    $user->LoadModulesEnabled();
    $q = new mysql();
    $fetchmail_count = 0;
    if ($user->fetchmail_installed) {
        BuildingExecRightStatus("Building fetchmail statistics...", 25);
        $sql = "SELECT COUNT(ID) as tcount FROM `fetchmail_events` WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT( NOW( ) ,'%Y-%m-%d' )";
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events'));
        $fetchmail_count = $ligne["tcount"];
        $sql = "SELECT SUM(size) as tcount FROM `fetchmail_events` WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT( NOW( ) ,'%Y-%m-%d' )";
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events'));
        $fetchmail_size = FormatBytes($ligne["tcount"] / 1024);
        events("fetchmail_count={$fetchmail_count}, fetchmail_size={$fetchmail_size}");
    } else {
        events('Fetchmail is not installed');
    }
    BuildingExecRightStatus("Building storage statistics...", 30);
    $sql = "SELECT COUNT( MessageID ) as tcount FROM storage WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) ";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $backuped_mails = $ligne["tcount"];
    BuildingExecRightStatus("Building quarantine statistics...", 35);
    $sql = "SELECT COUNT( MessageID ) as tcount FROM quarantine WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) ";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $quarantine_mails = $ligne["tcount"];
    BuildingExecRightStatus("Building messages number statistics...", 40);
    $sql = "SELECT COUNT(ID) as tcount FROM `smtp_logs` WHERE DATE_FORMAT( time_sended, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' )";
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events'));
    $flow_mails = $ligne["tcount"];
    if ($user->cyrus_imapd_installed) {
        BuildingExecRightStatus("Building imap/pop3 number statistics...", 45);
        $sql = "SELECT COUNT(ID) as tcount FROM `mbx_con` WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' )";
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events'));
        $mbx_con = $ligne["tcount"];
        $mbx_con = "<tr>\n\t\t\t<td class=legend nowrap>{mbx_con}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$mbx_con} {connections}</td>\n\t\t</tr>";
    }
    if ($fetchmail_count > 0) {
        $fetchmail = "<tr>\n\t\t\t<td class=legend nowrap>{fetchmail_recup}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$fetchmail_count} {emails} ({$fetchmail_size})</td>\n\t\t</tr>";
    }
    $html = "\n\t<H5>Postfix:&nbsp;{today}</h5>\n\t<table class=table_form>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{received_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$flow_mails}</td>\n\t\t</tr>\n\t\t{$mbx_con}\t\n\t\t{$fetchmail}\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{backuped_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$backuped_mails}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{quarantine_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$quarantine_mails}</td>\n\t\t</tr>\n\t</table>\n\t\t\t\t\t\t\n\t\n\t";
    if ($user->AMAVIS_INSTALLED) {
        if ($user->EnableAmavisDaemon) {
            BuildingExecRightStatus("Building Amavis statistics...", 50);
            $ini = new Bs_IniHandler();
            $sock = new sockets();
            $ini->loadString($sock->getfile('amavisstatus'));
            $status_amavis = DAEMON_STATUS_ROUND("AMAVISD", $ini, null);
            $status_amavismilter = DAEMON_STATUS_ROUND("AMAVISD_MILTER", $ini, null);
            $status = "<br>{$status_amavis}<br>{$status_amavismilter}";
        }
    }
    $html = RoundedLightGrey($html) . $status . "<br>";
    file_put_contents('/usr/share/artica-postfix/ressources/logs/status.postfix.flow.html', $html);
    system('/bin/chmod 755 /usr/share/artica-postfix/ressources/logs/status.postfix.flow.html');
    BuildingExecRightStatus("Building done...", 100);
}
开发者ID:brucewu16899,项目名称:artica,代码行数:60,代码来源:exec.admin.smtp.flow.status.php


示例4: cnx_list

function cnx_list()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $html = "\n\t<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th>{$refresh}</th>\n\t\t<th>{date}</th>\n\t\t<th>{server}</th>\n\t\t<th>{member}</th>\n\t\t<th>{panel}</th>\n\t\t<th>{ipaddr}</th>\n\t</tr>\n</thead>\n<tbody class='tbody'>";
    $sql = "SELECT * FROM admin_cnx ORDER BY connected DESC LIMIT 0,100";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        if ($ligne["uid"] == -100) {
            $uid = "Manager";
        } else {
            $u = new user($ligne["uid"]);
            $uid = $u->DisplayName;
        }
        $date = date('H:i:s', strtotime($ligne["connected"]));
        $html = $html . "<tr class={$classtr}>\n\t\t<td width=1%><img src='img/user-32.png'></td>\n\t\t<td style='font-size:11px'>{$date}</td>\n\t\t<td style='font-size:11px'>{$ligne["webserver"]}</td>\n\t\t<td style='font-size:11px'>{$uid}</td>\n\t\t<td style='font-size:11px'>{$ligne["InterfaceType"]}</td>\n\t\t<td style='font-size:11px'>{$ligne["ipaddr"]} ({$ligne["hostname"]})</td>\n\t\t</tr>\n\t\t\n\t\t";
    }
    $html = $html . "</table>";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:admin.cnx.php


示例5: Save

function Save()
{
    $sock = new sockets();
    $disksize = $_POST["disksize"];
    $UpdateUtilityStorePath = $_POST["UpdateUtilityStorePath"];
    $HardDriveSizeMB = unserialize(base64_decode($sock->getFrameWork("system.php?HardDriveDiskSizeMB=" . base64_encode($UpdateUtilityStorePath))));
    if (!is_array($HardDriveSizeMB)) {
        echo "Fatal Error Cannot retreive information for `{$UpdateUtilityStorePath}`";
        return;
    }
    if ($disksize < 2500) {
        echo "Fatal 2500MB minimal size";
        return;
    }
    $AVAILABLEMB = $HardDriveSizeMB["AVAILABLE"];
    if ($AVAILABLEMB < $disksize) {
        $T = $disksize - $AVAILABLEMB;
        echo "Fatal Error : Available: {$AVAILABLEMB}MB, need at least {$T}MB";
        return;
    }
    $sql = "INSERT INTO loop_disks (`path`,`size`,`disk_name`,`maxfds`) VALUES ('{$UpdateUtilityStorePath}','{$disksize}','UpdateUtility','25000')";
    $q = new mysql();
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $sock = new sockets();
    $sock->SET_INFO("UpdateUtilityUseLoop", 1);
    $sock->getFrameWork("lvm.php?loopcheck=yes");
    $sock->getFrameWork("freeweb.php?reconfigure-updateutility=yes");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:32,代码来源:UpdateUtility.container-wizard.php


示例6: install_app

function install_app()
{
    $sock = new sockets();
    $tpl = new templates();
    $q = new mysql();
    $sql = "SELECT upgrade FROM setup_center WHERE CODE_NAME='{$_GET["product"]}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["upgrade"] == 1) {
        $echo = $tpl->javascript_parse_text("{installapp_already_scheduled}", 1);
        return;
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT CODE_NAME FROM setup_center WHERE CODE_NAME='{$_GET["product"]}'", "artica_backup"));
    if ($ligne["CODE_NAME"] == null) {
        $q->QUERY_SQL("INSERT IGNORE INTO setup_center (upgrade,progress,progress_text,CODE_NAME) VALUES(1,5,'{scheduled}','{$_GET["product"]}')", "artica_backup");
    } else {
        $q->QUERY_SQL("UPDATE setup_center SET upgrade=1,progress=5,progress_text='{scheduled}',events='' WHERE CODE_NAME='{$_GET["product"]}'", "artica_backup");
    }
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $echo = "{{$_GET["product"]}}\n{installation_lauched}";
    $echo = $tpl->javascript_parse_text($echo, 1);
    echo $echo;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:setup.index.progress.php


示例7: EnablePolicyd

function EnablePolicyd()
{
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    system("{$php} " . dirname(__FILE__) . "/exec.postfix.maincf.php--smtpd-client-restrictions");
    $q = new mysql();
    $sql = "SELECT * FROM postfix_whitelist_con";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo "{$q->mysql_error}\n";
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $finalwhitelist[] = $ligne["ipaddr"] . "\tOK";
        if (strpos($ligne["hostname"], "*") == 0) {
            $finalwhitelist[] = $ligne["hostname"] . "\tOK";
        }
    }
    if (is_array($finalwhitelist)) {
        $conf = implode("\n", $finalwhitelist);
    }
    events("saving " . strlen($conf) . " bytes length in /etc/postfix/wbl_connections");
    @file_put_contents("/etc/postfix/wbl_connections", $conf);
    system("postmap hash:/etc/postfix/wbl_connections");
    events("adding policyd-weight done...");
}
开发者ID:articatech,项目名称:artica,代码行数:25,代码来源:exec.policyd-weight.php


示例8: idclustered

function idclustered($md5)
{
    $sql = "SELECT ID FROM gluster_paths WHERE zmd='{$md5}'";
    $q = new mysql();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    return $ligne["ID"];
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:7,代码来源:gluster.path.php


示例9: chk_login

 public function chk_login()
 {
     global $db, $config, $enterprisemodel;
     $r['err'] = '';
     $db2 = new mysql($config["db2"]);
     $db2->connect();
     $query = "SELECT * FROM `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}enterprise` e\r\n\t\t           JOIN `{$config['db'][0]['dbname']}`.`{$config['default_prefix']}enterprise_profile` ep\r\n\t\t\t\t     ON e.enterpriseid=ep.enterpriseid and e.switch='Y'\r\n\t\t          WHERE e.prefixid = '{$config['default_prefix_id']}' \r\n\t\t\t        AND e.loginname = '{$_POST['loginname']}' \r\n\t\t\t        AND e.switch = 'Y' \r\n\t\t          LIMIT 1\r\n\t\t";
     error_log("[ajax/enterprise.chk_login]" . $query);
     $table = $db2->getQueryRecord($query);
     if (empty($table['table']['record'])) {
         //'账号不存在'
         $r['err'] = 3;
     } else {
         $_SESSION['sajamanagement']['enterprise'] = '';
         $enterprise = $table['table']['record'][0];
         $passwd = $this->str->strEncode($_POST['passwd'], $config['encode_key']);
         if ($enterprise['passwd'] === $passwd) {
             $_SESSION['sajamanagement']['enterprise'] = $enterprise;
             setcookie("enterpriseid", $enterprise['enterpriseid'], time() + 43200, "/", COOKIE_DOMAIN);
             $r['err'] = '';
         } else {
             //'密码不正确'
             $r['err'] = 5;
         }
     }
     return $r;
 }
开发者ID:,项目名称:,代码行数:27,代码来源:


示例10: schedules

function schedules(){
	$unix=new unix();
	$files=$unix->DirFiles("/etc/cron.d");
	$cron=new cron_macros();
	$php5=$unix->LOCATE_PHP5_BIN();
	
	
	while (list ($index, $line) = each ($files) ){
		if($index==null){continue;}
		if(preg_match("#^LdapImport-#",$index)){
			@unlink("/etc/cron.d/$index");
		}
	}
	

	$sql="SELECT * FROM ldap_ou_import WHERE enabled=1";
	
	
	$q=new mysql();
	$results=$q->QUERY_SQL($sql,"artica_backup");
 	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){	
 		if(trim($ligne["ScheduleMin"]==null)){continue;}
 		$schedule=$cron->cron_defined_macros[$ligne["ScheduleMin"]];
 		$f[]="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/share/artica-postfix/bin";
		$f[]="MAILTO=\"\"";
		$f[]="$schedule  root $php5 ".__FILE__." --import {$ligne["ID"]}";
		$f[]="";
		@file_put_contents("/etc/cron.d/LdapImport-{$ligne["ID"]}",implode("\n",$f));
		@chmod("/etc/cron.d/LdapImport-{$ligne["ID"]}",600);
		unset($f);
 	}
	
}
开发者ID:rsd,项目名称:artica-1.5,代码行数:33,代码来源:exec.domains.ldap.import.php


示例11: BuildDayTable

function BuildDayTable()
{
    $q = new mysql();
    $q->BuildTables();
    if (!$q->TABLE_EXISTS('smtp_logs_day', 'artica_events')) {
        send_email_events("Mysql error on smtp_logs_day table", "Artica was unable to create or detect smtp_logs_day table...", "system");
        return false;
    }
    $today = date('Y-m-d');
    $sql = "SELECT COUNT(id) as tcount,delivery_domain,DATE_FORMAT(time_stamp,'%Y-%m-%d') as tdate,bounce_error FROM \n\tsmtp_logs \n\tGROUP BY delivery_domain,tdate,bounce_error HAVING tdate<'{$today}' ORDER BY tdate DESC";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_events");
    if (!$q->ok) {
        echo "Wrong sql query {$q->mysql_error}\n";
        write_syslog("Wrong sql query {$q->mysql_error}", __FILE__);
        return false;
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $count = $count + 1;
        $emails = $ligne["tcount"];
        $delivery_domain = $ligne["delivery_domain"];
        $date = $ligne["tdate"];
        $bounce_error = $ligne["bounce_error"];
        $md5 = md5($delivery_domain . $date . $bounce_error . $emails);
        $sql = "INSERT IGNORE INTO smtp_logs_day (`key`,`day`,`delivery_domain`,`bounce_error`,`emails`)\n\t\tVALUES('{$md5}','{$date}','{$delivery_domain}','{$bounce_error}','{$emails}')";
        $q->QUERY_SQL($sql, "artica_events");
        if (!$q->ok) {
            echo "Wrong sql query {$q->mysql_error}\n";
            write_syslog("Wrong sql query \"{$sql}\" {$q->mysql_error}", __FILE__);
            return false;
        }
    }
    return true;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:34,代码来源:exec.smtp.events.clean.php


示例12: view_stats

function view_stats()
{
    if (!privs()) {
        die;
    }
    $ou = $_GET["ou"];
    $users = new usersMenus();
    sql_domain($ou);
    $sql = "SELECT COUNT( ID ) AS tcount, DATE_FORMAT( time_stamp, '%m-%d' ) AS tday\nFROM smtp_logs\nWHERE {$GLOBALS["SQL_DOMAINS"]}\nAND time_stamp > DATE_ADD( NOW( ) , INTERVAL -7\nDAY )\nGROUP BY DATE_FORMAT( time_stamp, '%m-%d' )";
    $q = new mysql();
    //echo $sql;
    $g = new artica_graphs($fileName, 60);
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $g->ydata[] = $ligne["tcount"];
        $g->xdata[] = $ligne["tday"];
    }
    //print_r($g->ydata);
    $fileName = "/usr/share/artica-postfix/ressources/logs/web/{$ou}-stats-7.png";
    $g->title = "Inbound messages";
    $g->x_title = "messages number";
    $g->y_title = "days-month";
    $g->width = 700;
    $g->filename = $fileName;
    $g->line_green();
    echo "<img src='ressources/logs/web/{$ou}-stats-7.png'>";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:27,代码来源:statistics.ou.php


示例13: main_rules_exceptionsitelist_list

function main_rules_exceptionsitelist_list($rule_main, $noecho = 0)
{
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $sql = "SELECT * FROM dansguardian_files WHERE filename='exceptionsitelist' AND RuleID={$rule_main} ORDER BY ID DESC";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $style = CellRollOver();
    $categ = "\n\t<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n\t<thead class='thead'>\n\t\t<tr>\n\t\t<th width=99% colspan=2>&nbsp;</th>\n\t\t</tr>\n\t</thead>\n\t<tbody class='tbody'>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $num = $ligne["ID"];
        $pattern = $ligne["pattern"];
        $categ = $categ . "<tr class={$classtr}>\n\t\t<td width=99%><strong style='font-size:16px'>{$pattern}</strong></td>\n\t\t<td width=1%>" . imgtootltip('delete-32.png', '{delete}', "exceptionsitelist_del('{$hostname}','{$rule_main}','{$num}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $categ = $categ . "</table>";
    $tpl = new templates();
    if ($noecho == 1) {
        return $tpl->_ENGINE_parse_body("{$categ}");
    }
    echo $tpl->_ENGINE_parse_body("{$categ}");
    $tpl = new templates();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:dansguardian.exception.sites.php


示例14: operations_build

function operations_build($p, $o)
{
    reqp('mysql');
    //$ret=$p.'-'.$o;
    //$r=plugin('mysql',$p,$o); p($r);
    $msq = new mysql('qda');
    //echo $msq->b;
    $msq->read('id,day', 'kv', 'frm="oaxiiboo 6" order by day ASC');
    $r = $msq->ret;
    setlocale(LC_ALL, "fr_FR");
    $dr = array('jan' => 'jan', 'fev' => 'feb', 'mars' => 'mar', 'avr.' => 'apr', 'mai' => 'may', 'juin' => 'jun', 'juil' => 'jul', 'août' => 'aug', 'sept' => 'sep', 'oct' => 'oct', 'nov' => 'nov', 'déc' => 'dec');
    foreach ($r as $k => $v) {
        $nb++;
        //14.12.28 00.50 (122)
        //$suj=date('y.m.d H.i',$v).' ('.$nb.')';
        //20:41 - 19 juin 2015
        $suj = date("H:i - d M Y", $v);
        //$suj=strftime("%R - %e %b %G",$v);
        //$suj=date('H:i - d m Y',$v).' ('.$nb.')';
        $suj = strtolower($suj);
        $suj = str_replace(array_values($dr), array_keys($dr), $suj);
        $suj .= ' (' . $nb . ')';
        echo $suj . br();
        //$msq->update('suj',$suj,'id',$k);
    }
    //p($r);
    return $ret;
}
开发者ID:philum,项目名称:cms,代码行数:28,代码来源:operations.php


示例15: main_extensions_bannedextensionslist_list

function main_extensions_bannedextensionslist_list($rule_main = null, $noecho = 0)
{
    $q = new mysql();
    if ($rule_main == null) {
        $rule_main = $_GET["rule_main"];
    }
    $dans = new dansguardian_rules(null, $rule_main);
    writelogs("Loading RuleID={$rule_main}", __FUNCTION__, __FILE__);
    $sql = "SELECT * FROM dansguardian_files WHERE filename='bannedextensionlist' AND RuleID={$rule_main}";
    writelogs("{$sql}", __FUNCTION__, __FILE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $style = CellRollOver();
    $categ = "\n\t<table style='width:99%' class=form>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $num = $ligne["ID"];
        $onoff = Field_checkbox("bannedextensionlist_id_{$num}", 1, $ligne["enabled"], "bannedextensionlist_switch('{$num}')");
        $ext = $ligne["pattern"];
        $ext = str_replace('.', '', $ext);
        $img = "img/ext/def_small.gif";
        if (file_exists("img/ext/{$ext}_small.gif")) {
            $img = "img/ext/{$ext}_small.gif";
        }
        $categ = $categ . "<tr {$style}>\n\t\t<td width=1%><IMG SRC='{$img}' id='image_{$num}'></td>\n\t\t<td width=1%>{$onoff}</td>\n\t\t<td width=1% style='font-size:12px'> <strong id='pattern_{$num}'>{$ligne["pattern"]}</strong></td>\n\t\t<td width=98% style='font-size:12px'><strong id='info_{$num}'>{$ligne["infos"]}</strong></td>\n\t\t<td width=1%>" . imgtootltip('ed_delete.gif', '{delete}', "bannedextensionlist_del('{$hostname}','{$rule_main}','{$num}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $categ = $categ . "</table>";
    $tpl = new templates();
    $categ = $tpl->_ENGINE_parse_body($categ);
    if ($noecho == 1) {
        return $categ;
    }
    echo $categ;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:32,代码来源:dansguardian.banned-extensions.php


示例16: save

function save()
{
    $databasename = $_GET["databasename"];
    $databasename = format_mysql_table($databasename);
    $ou = base64_decode($_GET["ou"]);
    $q = new mysql();
    $tpl = new templates();
    //CheckTableEmailingContacts
    while (list($key, $line) = each($_GET)) {
        if (preg_match("#DB_ADD_[0-9]+#", $key)) {
            $tables[] = "emailing_{$line}";
        }
    }
    if (count($tables) == 0) {
        echo $tpl->javascript_parse_text("{NODB_SELECTED}");
        return;
    }
    $q->CheckTableEmailingContacts("emailing_{$databasename}", $tables);
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $sql = "INSERT INTO emailing_db_paths (databasename,progress,finish,ou,zDate,merged)\n\tVALUES('{$databasename}','100','1','{$ou}',NOW(),'1');";
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:29,代码来源:domains.emailings.dblink.php


示例17: PostfixLogs

function PostfixLogs()
{
    include_once 'ressources/class.mysql.inc';
    $sql = "SELECT * FROM events WHERE event_id={$_GET["event"]} ORDER BY zDate DESC LIMIT 0,100";
    $my = new mysql();
    $html = "<table style='width:100%'>";
    $html = $html . "<tr style='background-color:#005447'>\n\t  <td width=1%>&nbsp;</td>\n\t  <td width=1% nowrap>&nbsp;</td>\n\t  <td>&nbsp;</td>\n\t  </tr>";
    $resultat = $my->QUERY_SQL($sql, 'artica_events');
    while ($ligne = @mysql_fetch_array($resultat, MYSQL_ASSOC)) {
        switch ($ligne["event_type"]) {
            case 0:
                $img = "icon_mini_warning.gif";
                break;
            case 1:
                $img = "icon-mini-ok.gif";
                break;
            case 2:
                $img = "icon-mini-info.gif";
                break;
            default:
                $img = "icon-mini-info.gif";
                break;
        }
        $html = $html . "<tr " . CellRollOver() . ">\n\t  <td width=1%><img src='img/{$img}' style='margin:2px'></td>\n\t  <td width=1% nowrap>{$ligne["zDate"]}</td>\n\t  <td>{$ligne["text"]}</td>\n\t  </tr>";
    }
    $html = $html . "</table>";
    $html = RoundedLightGrey($html);
    $page = $html;
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($page);
}
开发者ID:brucewu16899,项目名称:artica,代码行数:31,代码来源:mysql.events.php


示例18: popup

function popup()
{
    $ou = base64_decode($_GET["ou"]);
    $sql = "SELECT ID,enabled,report_datas FROM reports WHERE ou='{$ou}' AND report_type=1";
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $array = unserialize(base64_decode($ligne["report_datas"]));
    if ($array["day"] == null) {
        $array["day"] = 1;
    }
    if ($array["hour"] == null) {
        $array["hour"] = "5";
    }
    if ($array["min"] == null) {
        $array["min"] = "0";
    }
    if ($array["lastdays"] == null) {
        $array["lastdays"] = "7";
    }
    $cron = new cron_macros(1);
    $days = $cron->cron_days;
    for ($i = 1; $i < 60; $i++) {
        $lastdays[$i] = $i;
    }
    $html = "\n\t" . Field_hidden("ID", $ligne["ID"]) . "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><img src='img/postmaster-identity-128.png' id='report-image'></td>\n\t\t<td>\n\t\t<div style='font-size:14px' class=explain>{global_director_report_explain}</div>\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{enabled}:</td>\n\t\t\t<td>" . Field_checkbox("report_enabled", 1, $ligne["enabled"]) . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{generate_report_each}:</td>\n\t\t\t<td>" . Field_array_Hash($days, "day", $array["day"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{time}:</td>\n\t\t\t<td><table style='width:1%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t" . Field_array_Hash($cron->cron_hours, "hour", $array["hour"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t\t<td width=1% style='font-size:13px'>:</td>\n\t\t\t\t\t<td>" . Field_array_Hash($cron->cron_mins, "min", $array["min"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{recipient}:</td>\n\t\t\t<td>" . Field_text("recipient", $array["recipient"], "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{last_days}:</td>\n\t\t\t<td>" . Field_array_Hash($lastdays, "lastdays", $array["lastdays"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td colspan='2' align='right'><hr>" . button("{apply}", "DIRECTOR_SAVE()") . "</td>\n\t\t</tr>\n\t\t\n\t\t</table>\n\t\t\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:28,代码来源:domains.director.report.php


示例19: wizard_certificate_save

function wizard_certificate_save()
{
    $password = url_decode_special_tool($_POST["wizard-certificate-password"]);
    $password = mysql_escape_string2($password);
    $CommonName = url_decode_special_tool($_POST["wizard-certificate-commonname"]);
    $CommonName = strtolower(trim($CommonName));
    if ($CommonName == null) {
        echo "CommonName, no such data";
        return;
    }
    $q = new mysql();
    $sql = "SELECT CommonName  FROM sslcertificates WHERE CommonName='{$CommonName}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["CommonName"] != null) {
        echo "{$CommonName} Already exists...\n";
        return;
    }
    $sql = "INSERT IGNORE INTO sslcertificates (CommonName,keyPassword,password) VALUES ('{$CommonName}','{$password}','{$password}')";
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo "MySQL Error:\n" . $q->mysq_error . "\n{$sql}";
        return;
    }
    $sock = new sockets();
    $CommonName = urlencode($CommonName);
    echo base64_decode($sock->getFrameWork("system.php?BuildCSR={$CommonName}"));
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:27,代码来源:certificates.center.wizard.php


示例20: SaveInfos

function SaveInfos()
{
    $q = new mysql();
    $_POST["uid"] = addslashes($_POST["uid"]);
    $sql = "SELECT uid FROM quotaroot WHERE uid='{$_POST["uid"]}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if (!isset($_POST["GraceTime"])) {
        $_POST["GraceTime"] = 10080;
    }
    if (!is_numeric($_POST["GraceTime"])) {
        $_POST["GraceTime"] = 10080;
    }
    if ($ligne["uid"] == null) {
        $sql = "INSERT INTO quotaroot (`uid`,`block-hardlimit`,`block-softlimit`,`inode-softlimit`,`inode-hardlimit`,`enabled`,`GraceTime`) VALUES\n\t\t('{$_POST["uid"]}','{$_POST["block-hardlimit"]}','{$_POST["block-softlimit"]}','{$_POST["inode-softlimit"]}','{$_POST["inode-hardlimit"]}','{$_POST["enabled"]}','{$_POST["GraceTime"]}')";
    } else {
        $sql = "UPDATE quotaroot SET \n\t\t\t`block-hardlimit`='{$_POST["block-hardlimit"]}',\n\t\t\t`block-softlimit`='{$_POST["block-softlimit"]}',\n\t\t\t`inode-hardlimit`='{$_POST["inode-hardlimit"]}',\n\t\t\t`inode-softlimit`='{$_POST["inode-softlimit"]}',\n\t\t\t`GraceTime`='{$_POST["GraceTime"]}',\n\t\t\t`enabled`='{$_POST["enabled"]}'\n\t\t\tWHERE `uid`='{$_POST["uid"]}'\n\t\t\t";
    }
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error . "\nMySQL Command:\n{$sql}\n";
        return;
    }
    $sock = new sockets();
    $sock->getFrameWork("services.php?setquotas=yes");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:domains.edit.user.quota.php



注:本文中的mysql类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mysqlConnection类代码示例发布时间:2022-05-23
下一篇:
PHP mydb类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap