当前位置: 首页>>代码示例>>PHP>>正文


PHP mysql::CheckTableEmailingContacts方法代码示例

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


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

示例1: 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

示例2: parse_db

function parse_db($id)
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/" . basename(__FILE__) . ".{$id}.pid";
    $pid = trim(@file_get_contents($pidfile));
    if ($unix->process_exists($pid)) {
        $pid = getmypid();
        echo "[{$pid}]:: Process {$pid} already running...\n";
        die;
    }
    $pid = getmypid();
    file_put_contents($pidfile, $pid);
    $sql = "SELECT * FROM emailing_db_paths WHERE ID={$id}";
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $unzipbin = $unix->find_program("unzip");
    if ($unzipbin == null) {
        echo "[{$pid}]:: unzip tool no such file or directory...\n";
        update_status($id, "110", 1, "unzip tool no such file or directory");
        die;
    }
    $zip_path = $ligne["filepath"];
    if (!is_file($zip_path)) {
        echo "[{$pid}]:: {$zip_path} no such file or directory\n";
        update_status($id, "110", 1, "zip db no such file or directory");
        die;
    }
    $tmp_path = "/tmp/emailing-import/{$id}";
    writeevent("using {$tmp_path}", $id);
    @mkdir($tmp_path, 666, true);
    writeevent("Uncompress {$zip_path}", $id);
    echo "{$unzipbin} -o {$zip_path} -d {$tmp_path}\n";
    shell_exec("{$unzipbin} -o {$zip_path} -d {$tmp_path}");
    $files = $unix->DirFiles($tmp_path);
    if (!is_array($files)) {
        update_status($id, "110", 1, "{$zip_path} corrupted or no files stored");
        die;
    }
    while (list($filename, $file_name) = each($files)) {
        writeevent("parsing {$file_name}", $pid);
        $max = $unix->COUNT_LINES_OF_FILE("{$tmp_path}/{$file_name}");
        writeevent("parsing {$file_name} {$max} entries", $pid);
        $handle = @fopen("{$tmp_path}/{$file_name}", "r");
        $ligne["databasename"] = format_mysql_table($ligne["databasename"]);
        $q = new mysql();
        $q->CheckTableEmailingContacts("emailing_{$ligne["databasename"]}");
        $sql = "INSERT INTO emailing_{$ligne["databasename"]} (`gender`,`firstname`, `lastname`,`email`,`phone`,`city`,`cp`,`postaladdress`,`domain`) VALUES";
        if ($handle) {
            while (!feof($handle)) {
                $tw = $tw + 1;
                $count = $count + 1;
                unset($re);
                $buffer = fgets($handle, 4096);
                if (trim($buffer) == null) {
                    continue;
                }
                $buffer = str_replace('"', "", $buffer);
                $buffer = str_replace(';', ",", $buffer);
                $lines = explode(",", addslashes($buffer));
                if (!is_array($lines)) {
                    if (preg_match("#.+?@.+#", $buffer)) {
                        for ($i = 0; $i < 8; $i++) {
                            $lines[$i] = "";
                        }
                        $lines[3] = trim($buffer);
                    }
                }
                if (count($lines) < 2) {
                    if (preg_match("#.+?@.+#", $buffer)) {
                        for ($i = 0; $i < 8; $i++) {
                            $lines[$i] = "";
                        }
                        $lines[3] = trim($buffer);
                    }
                }
                $lines[3] = str_replace(";", ".", $lines[3]);
                $lines[3] = str_replace("?", ".", $lines[3]);
                $lines[3] = str_replace("@.", "@", $lines[3]);
                $lines[3] = str_replace('^', '@', $lines[3]);
                $lines[3] = str_replace(',', '.', $lines[3]);
                if (trim($lines[3]) == null) {
                    writeevent("failed 3:[{$buffer}] [" . __LINE__ . "]", $pid);
                    $GLOBALS["FAILED_CONTACTS"] = $GLOBALS["FAILED_CONTACTS"] + 1;
                    unset($lines);
                    continue;
                }
                if (!preg_match("#(.+?)@(.+?)\\.(.+)#", $lines[3], $re)) {
                    writeevent("failed 3:{$lines[3]} bad email address [" . __LINE__ . "]", $pid);
                    $GLOBALS["FAILED_CONTACTS"] = $GLOBALS["FAILED_CONTACTS"] + 1;
                    unset($lines);
                    continue;
                }
                $domain = $re[2];
                if (substr($domain, strlen($domain) - 1, 1) == '.') {
                    $domain = substr($domain, 0, strlen($domain) - 1);
                }
                if (preg_match("#^\\..+#", $domain)) {
                    writeevent("failed 3:{$lines[3]} bad domain {$domain} [" . __LINE__ . "]", $pid);
                    $GLOBALS["FAILED_CONTACTS"] = $GLOBALS["FAILED_CONTACTS"] + 1;
                    unset($lines);
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.emailing-import.php

示例3: popup_add_contact_save

function popup_add_contact_save()
{
    $db = $_GET["database"];
    $ID = $_GET["ID"];
    $_GET["ou"] = base64_decode($_GET["ou"]);
    if (trim($_GET["db_add"]) != null) {
        $db = $_GET["db_add"];
    }
    $db = format_mysql_table($db);
    $email = $_GET["email"];
    if (preg_match("#.+?@(.+)#", $email, $re)) {
        $domain = $re[1];
    }
    $sql_add = "INSERT INTO emailing_{$db} (gender,firstname,lastname,email,domain,phone,city,cp,postaladdress)\n\tVALUES('{$_GET["gender"]}','{$_GET["firstname"]}','{$_GET["lastname"]}','{$_GET["email"]}','{$domain}',\n\t'{$_GET["phone"]}','{$_GET["city"]}','{$_GET["cp"]}','{$_GET["postaladdress"]}');\n\t";
    $sql_edit = "UPDATE emailing_{$db} SET \n\tgender='{$_GET["gender"]}',\n\tlastname='{$_GET["lastname"]}',\n\temail='{$_GET["email"]}',\n\tdomain='{$domain}',\n\tphone='{$_GET["phone"]}',\n\tcity='{$_GET["city"]}',\n\tcp='{$_GET["cp"]}',\n\tpostaladdress='{$_GET["postaladdress"]}'\n\tWHERE ID={$ID}\n\t";
    if ($ID > 0) {
        $sql = $sql_edit;
    } else {
        $sql = $sql_add;
    }
    $q = new mysql();
    writelogs("Checking emailing_{$db}", __FUNCTION__, __FILE__, __LINE__);
    if (!$q->TABLE_EXISTS("emailing_{$db}", "artica_backup")) {
        writelogs("Create emailing_{$db}", __FUNCTION__, __FILE__, __LINE__);
        $q->CheckTableEmailingContacts("emailing_{$db}");
        $sql_table = "INSERT INTO emailing_db_paths(databasename,ou,zDate,finish,progress)\n\t\tVALUES ('{$db}','{$_GET["ou"]}',NOW(),1,100);\n\t\t";
        $z = new mysql();
        $z->QUERY_SQL($sql_table, "artica_backup");
        writelogs("{$z->mysql_error}", __FUNCTION__, __FILE__, __LINE__);
        if (!$z->ok) {
            echo "\n{$z->mysql_error}\n{$sql_table}\n\n";
        }
    }
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo "\n{$q->mysql_error}\n{$sql}\n\n";
    }
}
开发者ID:,项目名称:,代码行数:38,代码来源:

示例4: database_infos

function database_infos(){
	$ID=$_GET["database-infos"];
	$ou=$_GET["ou"];
	$tpl=new templates();
	$sql="SELECT * FROM emailing_db_paths WHERE ID=$ID";
	$q=new mysql();
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));	
	$databasename=$ligne["databasename"];
	$merged=$ligne["merged"];
	$make_unique_table_text=$tpl->javascript_parse_text("{make_unique_table_text}");
	$page=CurrentPageName();
	
	$tbl=@explode("\n",$ligne["reports_import"]);
	while (list ($index, $line) = each ($tbl)){
		$t[]="<div><code>$line</code></div>";
	}
	$q=new mysql();
	if(!$q->TABLE_EXISTS("emailing_{$databasename}","artica_backup")){$q->CheckTableEmailingContacts("emailing_{$databasename}");}
	
	$nb_contacts=$q->COUNT_ROWS("emailing_{$databasename}","artica_backup");
	
	$sql="SELECT domain FROM emailing_{$databasename} GROUP BY domain";
	$q=new mysql();
	$results=$q->QUERY_SQL($sql,"artica_backup");
	$nb_domains=mysql_num_rows($results);

	//table-synonyms-settings-96.png
	//table-synonyms-settings-32.png
	
	
	$are_you_sure_to_delete=$tpl->javascript_parse_text("{are_you_sure_to_delete}");
	$add_contact_js="Loadjs('domains.emailings.contacts.php?ou=$ou&dbname=$databasename')";
	
	$add_contact_icon="<td width=1% style='border-right:2px solid #CCCCCC;padding:4px'>". imgtootltip("contact-card-add-32.png","{add_contact_text}","$add_contact_js")."</td>";
	$synonym="<td width=1% style='border-right:2px solid #CCCCCC;padding:4px'>". imgtootltip("table-synonyms-settings-32.png","{make_unique_table_text}","MakeUniqueTable()")."</td>";
	$infos_plus=null;
	$explain_plus=null;
	
	
	
	if($merged==1){
		$add_contact_icon=null;
		$synonym=null;
		$infos_plus="&nbsp;{merged_database}";
		$explain_plus="<div class=explain>{merged_database_explain}</div>";
	}
	
	$html="
	<div id='db_$ID'>
	<table style='width:100%'>
	<tr>
	<td width=1% style='border-right:2px solid #CCCCCC;padding:4px'>". imgtootltip("delete-32.png","{delete}","DeleteDB();")."</td>
	<td width=1% style='border-right:2px solid #CCCCCC;padding:4px'>". imgtootltip("user-migrate-32.png","{migrate_user_tini_text}","MigrateUsersToLdap($ID,'$databasename');")."</td>
	$add_contact_icon
	$synonym
	
	
	
	<td nowrap><H4>$databasename (ref:$ID)</H4></td>
	</tr>
	</table>
	<table style='width:100%'>
	<tr>
	<td valign='top' width=1%><img src='img/table-show-90.png'></td>
	<td valign='top' width=99%>
		<table style='width:100%'>
		<tr>
			<td valign='top' style='font-size:13px' class=legend>{contacts}:</td>
			<td valign='top' style='font-size:13px'><strong style='font-size:13px'>$nb_contacts</strong></td>
		</tr>
		<tr>
			<td valign='top' style='font-size:13px' class=legend>{nb_domains}:</td>
			<td valign='top' style='font-size:13px'><strong style='font-size:13px'>$nb_domains</strong></td>
		</tr>		
		<tr>
			<td colspan=2>
			<H3>{infos}$infos_plus</H3>$explain_plus
			<br>
			<div style='height:220px;overflow:auto;border-top:1px solid #005447'>".@implode("\n",$t)."</div></td>
		</tr>
	</table>
	</div>
	</tr>
	</table>
	</div>
	<script>
	
	var x_DeleteDB= function (obj) {
			var tempvalue=obj.responseText;
			if(tempvalue.length>0){alert(tempvalue)};
			YahooWin4Hide();
			RefreshTab('emailing_campaigns');	
		}		
	
		function DeleteDB(ID){
			if(confirm('$are_you_sure_to_delete $databasename')){
			 	var XHR = new XHRConnection();
	      		XHR.appendData('delete-db','$ID');
	      		XHR.appendData('ou','{$_GET["ou"]}');
	      		if(document.getElementById('db_$ID')){
//.........这里部分代码省略.........
开发者ID:rsd,项目名称:artica-1.5,代码行数:101,代码来源:domains.emailings.php


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