Exemplo n.º 1
0
(select post_id from post_mst where post_code = {$post_code_nm}) as post_id,
(select job_id from job_mst where job_code = {$job_code_nm}) as job_id,
'{$joukin_kbn}' as joukin_kbn,
'1' as user_type_id,
to_char(now(),'yyyy/MM/dd hh24:mm:ss') as start_date
FROM
idodata
{$where}
SQL;
                    $request = $oMgr->oDb->getRow($sql);
                    list($y, $m, $d) = explode("/", $request['birthday']);
                    $request['birth_year'] = $y;
                    $request['birth_mon'] = $m;
                    $request['birth_day'] = $d;
                    // 新規
                    $ret = $oMgr->insertUserData(&$request);
                    if (!$ret) {
                        echo $err_msg . "利用者情報新規登録に失敗しました。";
                        continue;
                    }
                    // 中間テーブルのユーザIDを更新
                    $sql = "update idodata set user_id = " . $request['user_id'] . $where;
                    $ret = $oMgr->oDb->query($sql);
                    if (!$ret) {
                        echo "中継テーブルの更新に失敗しました。\n";
                        continue;
                    }
                    //職員番号でも氏名でも一致しなかった場合は、新規登録
                    $message = "新規登録:" . "[職員番号:" . $vals['cshainno'] . "、氏名:" . $vals['cnameknj'] . "、生年月日:" . $vals['dbirth_dte'] . "、性別:" . $vals['seibetu_nme'] . "]";
                    echo $message . PHP_EOL;
                    file_put_contents("/var/www/phplib/import/" . "sinki_toroku.csv", $body, FILE_APPEND);