コード例 #1
0
function registDomain($intRkwid = 0)
{
    if ($intRkwid == 0) {
        return;
    }
    require 'cin/SQLConnect_jas.php';
    $sqlRkw = " SELECT rkw_id, rkw_word, rkw_domid, rkw_url, rkw_rclid FROM rank_keyword ";
    $sqlRkw .= " WHERE TRUE ";
    $sqlRkw .= " AND rkw_domid = 0 ";
    $sqlRkw .= " AND rkw_id = {$intRkwid} ";
    $sqlRkw .= " AND rkw_url != '' ";
    print $sqlRkw . "<br />";
    $rsRkw = mysql_db_query($dbName, $sqlRkw);
    $rsRkwCount = mysql_num_rows($rsRkw);
    $rowRkw = mysql_fetch_array($rsRkw);
    if ($rowRkw[rkw_word] == true && (int) $rowRkw[rkw_domid] === 0) {
        #ドメインIDが保存されてないとき
        $strDomainName = getUrlDomain3($rowRkw[rkw_url]);
        $sqlDom = " SELECT * FROM domain_mgt ";
        $sqlDom .= " WHERE TRUE ";
        $sqlDom .= " AND dom_domain = '{$strDomainName}'";
        $rsDom = mysql_db_query($dbName, $sqlDom);
        $rsCountDom = mysql_num_rows($rsDom);
        print $sqlDom . "<br />";
        if ($rsCountDom === 0) {
            #ドメインが保存されていない場合
            $_POST[dom_rclid] = $rowRkw[rkw_rclid];
            $_POST[dom_registdate] = date('Y-m-d');
            $_POST[dom_domain] = $strDomainName;
            print DataJasInsertString(domain_mgt) . "<br />";
            $_POST[rkw_domid] = DataJasInsert(domain_mgt);
        } else {
            #既にドメインが保存されているとき
            $rowDom = mysql_fetch_array($rsDom);
            $_POST[rkw_domid] = $rowDom['dom_id'];
        }
        //End if
        $sqlUpDate = " UPDATE rank_keyword SET rkw_domid = {$_POST[rkw_domid]} ";
        $sqlUpDate .= " WHERE TRUE ";
        $sqlUpDate .= " AND rkw_id = {$intRkwid} ";
        print $sqlUpDate . "<br />";
        mysql_db_query($dbName, $sqlUpDate);
    }
    //End if
    require 'cin/SQLClose.php';
}
コード例 #2
0
function insertClientData($arrClientData)
{
    foreach ($arrClientData as $field_rank_client => $value_rank_client) {
        unset($_POST[$field_rank_client]);
        $_POST[$field_rank_client] = $value_rank_client;
    }
    //End foreach
    $_POST['rcl_status'] = 1;
    $_POST['rcl_resisted'] = 1;
    unset($_POST[rcl_id]);
    print DataJasInsertString('rank_client') . "<br /><br />";
    $intClientId = DataJasInsert('rank_client');
    //seo-rankingのユーザー名とパスワードの登録(update)
    //ユーザー名
    $prefix = "";
    if ($_POST[rcl_agencyflag] == "0") {
        $prefix = "A";
    }
    if ($_POST[rcl_agencyflag] == "1") {
        $prefix = "E";
    }
    if ($_POST[rcl_agencyflag] == "2") {
        $prefix = "A";
    }
    $username = $prefix . "-" . substr(DateNow(0), 2, 2) . substr(0, 5, 2) . "-" . substr("00000" . $intClientId, -5);
    //パスワード
    $pass = randPass(6);
    require 'cin/SQLConnect_jas.php';
    #	  	require('cin/SQLConnect.php');
    $sql = "UPDATE `rank_client` SET `rcl_username` = '" . $username . "', `rcl_password` = '" . $pass . "' WHERE (`rcl_id` = '" . $intClientId . "');";
    #15-02-13変更
    print $sql . "<BR><BR>";
    $c_hit = mysql_db_query($dbName, $sql) or die('UPDATE error: ' . mysql_errno() . ', ' . mysql_error());
    mysql_close($GLOBALS[dbHandle]);
    require 'cin/SQLClose.php';
    return $intClientId;
}
コード例 #3
0
function insertChargerMasData($arrChargerMasData)
{
    foreach ($arrChargerMasData as $field_rank_charger_mas => $value_rank_charger_mas) {
        unset($_POST[$field_rank_charger_mas]);
        $_POST[$field_rank_charger_mas] = $value_rank_charger_mas;
    }
    //End foreach
    $_POST['rcm_make_datetime'] = date('Y-m-d H:i:s');
    unset($_POST[rcm_id]);
    print DataJasInsertString('rank_charger_mas') . "<br /><br />";
    $intChargerMasId = DataJasInsert('rank_charger_mas');
    return $intChargerMasId;
}