usr_input.inc
4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?PHP
//*****************************************************************************
//*
//* プログラム名:e-イベント
//* プログラムID:usr_input.inc
//* 機能 :イベント登録画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=shift-jis");
include('../_include/smarty.conf');
//*** DB接続 ***//
include("../../include/dbcon.inc");
include("../../ini.php");
$o_smarty->assign('_SYS_ROOT_URL_', $_SYS_ROOT_URL_);
//*** 実行フォルダ取得 ***//
//echo $_SERVER["SCRIPT_FILENAME"];
$str_Url = split("/", $_SERVER["SCRIPT_FILENAME"]);
$DP_Foldar = $str_Url[count($str_Url)-2];
//*** カレンダー表示スタイル取得 ***//
$strSQL = "SELECT ";
$strSQL .= " style_name, ";
$strSQL .= " temp_name ";
$strSQL .= "FROM ";
$strSQL .= " mst_group, ";
$strSQL .= " group_style_tbl, ";
$strSQL .= " mst_style, ";
$strSQL .= " mst_template ";
$strSQL .= "WHERE";
$strSQL .= " mst_group.group_cd = group_style_tbl.group_cd AND ";
$strSQL .= " mst_group.group_foldar = '".$DP_Foldar."' AND ";
$strSQL .= " group_style_tbl.group_style = mst_style.style_id AND ";
$strSQL .= " group_style_tbl.group_template = mst_template.temp_id ";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("エラー(SELECT)");
exit;
}
if(pg_numrows($objRec) <= 0){
$color_css = "color1.css";
$template_name = "calendar01.tpl";
}else{
$objData = pg_fetch_object($objRec, 0);
$color_css = $objData->style_name;
$template_name = $objData->temp_name;
}
$o_smarty->assign('color_css', $color_css);
//*** ヘッダー情報取得 ***//
$strSQL = "SELECT ";
$strSQL .= " * ";
$strSQL .= "FROM ";
$strSQL .= " mst_group, ";
$strSQL .= " group_header_tbl ";
$strSQL .= "WHERE";
$strSQL .= " mst_group.group_cd = group_header_tbl.group_cd AND ";
$strSQL .= " group_foldar = '".$DP_Foldar."' ";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("エラー(SELECT)");
exit;
}
if(pg_numrows($objRec) <= 0){
$header_memo = '<img src="'.$_ROOT_URL_.'/image/base_header.jpg" />';
}else{
$objData = pg_fetch_object($objRec, 0);
$cboColor_Chk = $objData->header_memo;
switch($objData->type){
case "1":
$header_memo = '<img src="'.$_ROOT_URL_.'/image/base_header'.(int)substr($cboColor_Chk,1,2).'.jpg" />';
break;
case "2":
$strSQL = "SELECT ";
$strSQL .= " * ";
$strSQL .= "FROM ";
$strSQL .= " group_file_tbl ";
$strSQL .= "WHERE";
$strSQL .= " group_cd = '".$objData->group_cd."' AND ";
$strSQL .= " file_id = ".(int)$cboColor_Chk." ";
$objFileRec = pg_exec($strSQL);
if($objFileRec==false){
echo("エラー(SELECT)");
exit;
}
$objFileData = pg_fetch_object($objFileRec, 0);
$header_memo = '<img src="'.$_ROOT_URL_.'/image/header_'.$objData->group_cd."_".(int)$cboColor_Chk.'.'.$objFileData->file_type.'" />';
break;
case "3":
break;
default:
break;
}
}
$o_smarty->assign('header_memo',$header_memo);
//*** 日付コンボ ***//
$fmon_Data = "";
$fyear_Data = "";
$fday_Data = "";
$tyear_Data = "";
$tmon_Data = "";
$tday_Data = "";
list($eventy,$eventm,$eventd)=split(",",$hiduke);
//開始年月日
$fyear_Data = "<option value=".$eventy.">".$eventy."年</option>";
for ($intI = 1 ; $intI <= 12 ; $intI++) {
$fmon_Data .= "<option value=".sprintf('%02d', $intI);
if ($eventm == $intI){
$fmon_Data .= " selected";
}
$fmon_Data .= ">".$intI."月</option>";
}
for ($intI = 1 ; $intI <= 31 ; $intI++) {
$fday_Data .= "<option value=".sprintf('%02d', $intI);
if ($eventd == $intI){
$fday_Data .= " selected";
}
$fday_Data .= ">".$intI."日</option>";
}
//終了年月日
for ($intI = $eventy ; $intI <= $eventy+1 ; $intI++) {
$tyear_Data .= "<option value=".$intI;
if ($eventy==$intI){
$tyear_Data .= " selected";
}
$tyear_Data .= ">".$intI."年</option>";
}
for ($intI = 1 ; $intI <= 12 ; $intI++) {
$tmon_Data .= "<option value=".sprintf('%02d', $intI);
if ($eventm == $intI){
$tmon_Data .= " selected";
}
$tmon_Data .= ">".$intI."月</option>";
}
for ($intI = 1 ; $intI <= 31 ; $intI++) {
$tday_Data .= "<option value=".sprintf('%02d', $intI);
if ($eventd == $intI){
$tday_Data .= " selected";
}
$tday_Data .= ">".$intI."日</option>";
}
$o_smarty->assign('fyear_Data', $fyear_Data);
$o_smarty->assign('fmon_Data' , $fmon_Data );
$o_smarty->assign('fday_Data' , $fday_Data );
$o_smarty->assign('tyear_Data', $tyear_Data);
$o_smarty->assign('tmon_Data' , $tmon_Data );
$o_smarty->assign('tday_Data' , $tday_Data );
$o_smarty->display('cl_usr_input.tpl');
?>