text: /*
   * script route generated by KOMA
   * @author : Yan Yan Purdiansah
   */    
  var express = require('express');
  var router = express.Router();
  var dateFormat = require('dateformat');    
  var database = require('./dao');
  var dao = new database.Dao();    
  var sessionChecker = require('./security');
  var appresource = {
      Title:'MsbOfflineSearch',
      Heading:'MsbOffline',
      Subscriber:{label :'Subscriber'},
      Messageid:{label :'Messageid'},
      Creationdate:{label :'Creationdate'},
      Messagesize:{label :'Messagesize'},
      Stanza:{label :'Stanza'},
      MsbOffline:{Heading:'MsbOffline',
          Subscriber:{header:'Subscriber'},
          Messageid:{header:'Messageid'},
          Creationdate:{header:'Creationdate'},
          Messagesize:{header:'Messagesize'},
          Stanza:{header:'Stanza'},
          },
      }
  
  router.get('/', sessionChecker, function(req, res, next) {
      var jsonObj = req.query;
      if(jsonObj.rowid===undefined) jsonObj.rowid = 0;
      req.session.previouspath = 'searchMsbOffline?'+req._parsedUrl.query;
      dao.searchMsbOffline(jsonObj,function(err,rows) {
          parameter = {
              session: req.session,
              cookies: req.cookies,
              resource: appresource,
              dateFormat: dateFormat,
              records: rows,
          }
          res.render('MsbOfflineSearchPage',parameter);
          console.log(parameter);        
      })
  });
  
  module.exports = router;
  