public static function get_week_array($year, $please_select = NULL, $date_flg = FALSE, $cell = FALSE)
 {
     $db = new Class_DB();
     $sql = " select a.week_cd,a.matrix_cd,a.week_seq,a.flier_date from M_MATRIX_TERM  a ";
     if ($cell) {
         $sql = $sql . " INNER JOIN T_MON_CELL_WEEK b on a.matrix_cd = b.matrix_cd ";
     }
     $sql = $sql . " where a.year4 = '{$year}' ";
     $sql = $sql . " order by a.week_cd";
     $db->query($sql);
     if ($please_select) {
         $data[""] = $please_select;
     }
     while ($row = $db->fetch()) {
         $v = "第" . $row["week_cd"] . "週";
         if ($row["week_seq"] != 0) {
             $v = $v . $row["week_seq"] . "回";
         }
         if ($date_flg) {
             $v = $v . " (" . Class_PWD::int8_to_date($row["flier_date"]) . ")";
         }
         $data[$row["matrix_cd"]] = $v;
     }
     return $data;
 }
 public static function get_insshop_form_upd_text($oldVal, $newVal, $username)
 {
     $new_line = self::$newLineChar;
     $retval = array();
     $retval["title"] = "【チラシ手配システム】折込販売店情報が更新されました";
     //	販売店名
     $ins_shop_name = $oldVal['ins_shop_name'] . "販売店";
     if ($oldVal['ins_shop_name'] == $newVal['ins_shop_name']) {
         $ins_shop_name = $ins_shop_name . "【" . $oldVal['ins_shop_cd'] . "】";
     } else {
         $ins_shop_name = $ins_shop_name . " → " . $newVal['ins_shop_name'] . "販売店【" . $oldVal['ins_shop_cd'] . "】";
     }
     //	都道府県
     $local_name = $oldVal['local_name'];
     if ($oldVal['local_cd'] != $newVal['local_cd']) {
         $local_name = $local_name . " → " . $newVal['local_name'];
     }
     //	媒体名
     $media_name = $oldVal['media_name'];
     //if ( $oldVal['media_name'] != $newVal['media_name']) {
     //	$media_name = $media_name." → ".$newVal['media_name'];
     //}
     //	納品先
     $delive_name = $oldVal['delive_name'];
     if ($oldVal['delive_name'] != $newVal['delive_name']) {
         $delive_name = $delive_name . " → " . $newVal['delive_name'];
     }
     //	折込会社部数
     $insert_conums = $oldVal['insert_conums'] . "部";
     if ($oldVal['insert_conums'] != $newVal['insert_conums']) {
         $insert_conums = $insert_conums . " → " . $newVal['insert_conums'] . "部";
     }
     //	廃止日
     $stop_date = Class_PWD::int8_to_date($newVal['stop_date']);
     //	備考
     $memo = $newVal['memo'];
     $retval["text"] = "{$new_line}" . "関係各位{$new_line}" . "{$new_line}" . "チラシ手配システムからの自動送信メールです。{$new_line}" . "{$new_line}" . "折込販売店情報が{$username}によって更新されました。{$new_line}" . "更新内容は下記のとおりです。{$new_line}" . "{$new_line}" . "{$ins_shop_name}{$new_line}" . "都道府県:{$local_name}{$new_line}" . "媒体名:{$media_name}{$new_line}" . "納品先:{$delive_name}{$new_line}" . "販売店部数:{$insert_conums}{$new_line}" . "廃止日:{$stop_date}{$new_line}" . "情報更新理由:{$memo}{$new_line}" . "{$new_line}" . "以上です。{$new_line}" . "部数等が変更になった折込パターン情報などの見直しをお願いいたします。{$new_line}";
     return $retval;
 }