Mercurial > mercurial > hgweb_searcher2.cgi
comparison src/myframe.cpp @ 10:24e0775af32e
Add Name-View.
author | pyon@macmini |
---|---|
date | Wed, 22 Jun 2011 20:43:50 +0900 |
parents | db7bd315e52c |
children | 07adad93df84 |
comparison
equal
deleted
inserted
replaced
9:6f59ca2622af | 10:24e0775af32e |
---|---|
1 // Filename : mainframe.cpp | 1 // Filename : mainframe.cpp |
2 // Last Change: 21-Jun-2011. | 2 // Last Change: 22-Jun-2011. |
3 // | 3 // |
4 | 4 |
5 #include "symbol.h" | 5 #include "symbol.h" |
6 #include "common.h" | 6 #include "common.h" |
7 #include "myframe.h" | 7 #include "myframe.h" |
220 hr->LoadPage( wxT("html/notfound.html") ); | 220 hr->LoadPage( wxT("html/notfound.html") ); |
221 mf->m_statusBar->SetStatusText( wxT("データが存在しません."), 0 ); | 221 mf->m_statusBar->SetStatusText( wxT("データが存在しません."), 0 ); |
222 return; | 222 return; |
223 } | 223 } |
224 | 224 |
225 // HTML 生成 | |
225 path.Clear(); | 226 path.Clear(); |
226 htmlbody = wxT("<html><body>"); | 227 htmlbody = wxT("<html><body>"); |
227 htmlbody += wxT("該当者: "); | 228 htmlbody += wxT("該当者: "); |
228 htmlbody += wxT("<b>") + name + wxT("</b>"); | 229 htmlbody += wxT("<b>") + name + wxT("</b>"); |
229 htmlbody += wxT(" ( ") + hhs + wxT(" )"); | 230 htmlbody += wxT(" ( ") + hhs + wxT(" )"); |
234 wxRegEx reDate(wxT("(^.*20[0-9]{2}.)(20[0-9]{2})([0-2][0-9])([0-9]{2})(.*$)")); | 235 wxRegEx reDate(wxT("(^.*20[0-9]{2}.)(20[0-9]{2})([0-2][0-9])([0-9]{2})(.*$)")); |
235 | 236 |
236 int i=1; | 237 int i=1; |
237 int clrflg = 1; | 238 int clrflg = 1; |
238 while ( q.NextRow() ) { | 239 while ( q.NextRow() ) { |
239 path.Add(q.GetString(0)); | 240 wxString filepath; |
240 wxString date = q.GetString(0); | 241 filepath = q.GetString(0); |
242 // 氏名画像生成 | |
243 if ( 0 ) { | |
244 wxDir dir(filepath); | |
245 wxString file; | |
246 if ( !dir.IsOpened() ) return; | |
247 | |
248 bool cout = dir.GetFirst( &file, wxT("*.jpg"), wxDIR_FILES ); | |
249 if ( cout ) { | |
250 wxString s = filepath + wxFILE_SEP_PATH + file; | |
251 wxImage img_org( s, wxBITMAP_TYPE_JPEG ); | |
252 wxImage img_name; | |
253 img_name = img_org.GetSubImage( wxRect( wxPoint(328,556), wxSize(626,288) ) ); | |
254 img_name.Scale( 92, 200 ); | |
255 img_name.SaveFile( wxT("tmp/tmp.jpg") ); | |
256 } | |
257 } | |
258 | |
259 path.Add(filepath); | |
260 wxString date = filepath; | |
241 reDate.ReplaceAll( &date, wxT("\\2-\\3-\\4") ); | 261 reDate.ReplaceAll( &date, wxT("\\2-\\3-\\4") ); |
242 | 262 |
243 if ( clrflg ) { | 263 if ( clrflg ) { |
244 htmlbody += wxT("<tr bgcolor=\"#ffffcc\">"); | 264 htmlbody += wxT("<tr bgcolor=\"#ffffcc\">"); |
245 clrflg = 0; | 265 clrflg = 0; |
256 ccndb.Close(); | 276 ccndb.Close(); |
257 path.Shrink(); | 277 path.Shrink(); |
258 | 278 |
259 htmlbody += wxT("</table>"); | 279 htmlbody += wxT("</table>"); |
260 htmlbody += wxT("<br />"); | 280 htmlbody += wxT("<br />"); |
281 htmlbody += wxT("<div>"); | |
282 htmlbody += wxT("番号1の画像情報"); | |
283 htmlbody += wxT("<img src=\"tmp/name.jpg\" />"); | |
284 htmlbody += wxT("</div>"); | |
261 htmlbody += wxT("<div>"); | 285 htmlbody += wxT("<div>"); |
262 htmlbody += wxT("フォルダを開くには,番号を入力してください.<br />"); | 286 htmlbody += wxT("フォルダを開くには,番号を入力してください.<br />"); |
263 htmlbody += wxT("他の被保険者を検索するには,被保番を入力してください."); | 287 htmlbody += wxT("他の被保険者を検索するには,被保番を入力してください."); |
264 htmlbody += wxT("</div>"); | 288 htmlbody += wxT("</div>"); |
265 htmlbody += wxT("</body></html>"); | 289 htmlbody += wxT("</body></html>"); |
283 wxString execmd = wxT("explorer ") + path[val]; | 307 wxString execmd = wxT("explorer ") + path[val]; |
284 wxExecute( execmd ); | 308 wxExecute( execmd ); |
285 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); | 309 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); |
286 | 310 |
287 // 検索履歴をログに保存 | 311 // 検索履歴をログに保存 |
288 wxString logfn = wxGetCwd() + wxT("/db/log.txt"); | 312 wxString logfn = wxGetCwd() + wxT("/tmp/log.txt"); |
289 wxTextFile logFile; | 313 wxTextFile logFile; |
290 logFile.Open( logfn ); | 314 logFile.Open( logfn ); |
291 wxDateTime now = wxDateTime::Now(); | 315 wxDateTime now = wxDateTime::Now(); |
292 wxString log = now.Format() + wxT(" " ) + cmd + wxT(" ") + path[val]; | 316 wxString log = now.Format() + wxT(" " ) + cmd + wxT(" ") + path[val]; |
293 logFile.AddLine( log ); | 317 logFile.AddLine( log ); |
321 this->ChangeValue( wxEmptyString ); | 345 this->ChangeValue( wxEmptyString ); |
322 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); | 346 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); |
323 return; | 347 return; |
324 } | 348 } |
325 if ( cmd.Cmp(wxT("l")) == 0 ) { | 349 if ( cmd.Cmp(wxT("l")) == 0 ) { |
326 hr->LoadPage( wxT("db/log.txt") ); | 350 hr->LoadPage( wxT("tmp/log.txt") ); |
327 this->ChangeValue( wxEmptyString ); | 351 this->ChangeValue( wxEmptyString ); |
328 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); | 352 mf->m_statusBar->SetStatusText( wxEmptyString, 0 ); |
329 return; | 353 return; |
330 } | 354 } |
331 if ( cmd.Cmp(wxT("**")) == 0 ) { | 355 if ( cmd.Cmp(wxT("**")) == 0 ) { |
729 } | 753 } |
730 | 754 |
731 /* 被保険者整合性チェック */ | 755 /* 被保険者整合性チェック */ |
732 void MyFrame::OnCheckHhs(wxCommandEvent& WXUNUSED(event)) | 756 void MyFrame::OnCheckHhs(wxCommandEvent& WXUNUSED(event)) |
733 { | 757 { |
734 wxString logfn = wxGetCwd() + wxT("/db/checkhhs.log"); | 758 wxString logfn = wxGetCwd() + wxT("/tmp/checkhhs.log"); |
735 wxTextFile logFile; | 759 wxTextFile logFile; |
736 logFile.Open( logfn ); | 760 logFile.Open( logfn ); |
737 logFile.Clear(); | 761 logFile.Clear(); |
738 | 762 |
739 wxString gszFile = wxGetCwd() + wxT("/db/ccn.db"); | 763 wxString gszFile = wxGetCwd() + wxT("/db/ccn.db"); |