Example #1
0
def searchCompany():
    rawSearchterm = (request.args.get('name', ''))
    html = HTMLHEAD
    unquotedTerm = urllib.unquote(rawSearchterm).upper()
    liketerm = Company.sqlrepr('%%%s%%' % unquotedTerm)
    sqlquery = "company.name LIKE %s" % liketerm
    html += '<h2>Company Search results</h2><h3>searching for %s</h3><ul>' % sqlquery
    people = Company.select(sqlquery)
    for thisone in people:
        if not thisone.hidden:
            html += "<li><a href='%s/company/id/%s'>%s</a></li>" %(BASEURL, thisone.recordid, thisone.name)
    html += '</ul>'
    html += HTMLTAIL
    return html
Example #2
0
 def get(self, rawSearchterm = u''):
     if rawSearchterm is u'':
         arguments = parse_qs(self.request.query)
         rawSearchterm = arguments.get('name')[0] 
     html = HTMLHEAD
     unquotedTerm = urllib.unquote(rawSearchterm).upper()
     liketerm = Company.sqlrepr('%%%s%%' % unquotedTerm)
     sqlquery = "company.name LIKE %s" % liketerm
     html += '<h2>Company Search results</h2><h3>searching for %s</h3><ul>' % sqlquery
     people = Company.select(sqlquery)
     for thisone in people:
         if not thisone.hidden:
             html += "<li><a href='%s/company/id/%s'>%s</a></li>" %(BASEURL, thisone.recordid, thisone.name)
     html += '</ul>'
     html += HTMLTAIL
     self.write(html)
Example #3
0
 def get(self, rawSearchterm=u''):
     if rawSearchterm is u'':
         arguments = parse_qs(self.request.query)
         rawSearchterm = arguments.get('name')[0]
     html = HTMLHEAD
     unquotedTerm = urllib.unquote(rawSearchterm).upper()
     liketerm = Company.sqlrepr('%%%s%%' % unquotedTerm)
     sqlquery = "company.name LIKE %s" % liketerm
     html += '<h2>Company Search results</h2><h3>searching for %s</h3><ul>' % sqlquery
     people = Company.select(sqlquery)
     for thisone in people:
         if not thisone.hidden:
             html += "<li><a href='%s/company/id/%s'>%s</a></li>" % (
                 BASEURL, thisone.recordid, thisone.name)
     html += '</ul>'
     html += HTMLTAIL
     self.write(html)
Example #4
0
    def get(self, companyid=u''):

        companyid = getarg(companyid, 'id')
        try:
            companyid = int(companyid)
            record = Company.byRecordid(companyid)
        except (ValueError, SQLObjectNotFound):
            self.quitWithMsg('No company with ID %s' % companyid)
            return
        if record.hidden:
            self.quitWithMsg('Company %s is not currently available' %
                             companyid)
            return
        subscribers = record.subscribers
        directors = record.directors
        html = '<h1>%s</h1>' % record.name
        companyurl = 'https://www.registro-publico.gob.pa/scripts/nwwisapi.dll/conweb/MESAMENU?TODO=SHOW&ID=%s' % record.recordid
        html += '<h3><a href="%s">Full Details</a></h3>' % companyurl
        html += '<h2>Directors</h2><ul>'
        for director in directors:
            if not director.hidden:
                html += '<li><a href="%s/person/%s">%s</a> %s </li>' % (
                    BASEURL, director.name, director.name, google(
                        director.name))
        html += '</ul>'
        html += '<h2>Subscribers</h2><ul>'
        for subscriber in subscribers:
            if not subscriber.hidden:
                html += '<li><a href="%s/person/%s">%s</a></li>' % (
                    BASEURL, subscriber.name, subscriber.name)
        html += '</ul>'
        agentlist = record.agent
        if len(agentlist):
            agent = agentlist[0]
            if not agent.hidden:
                html += '<h2>Agent</h2>'
                html += '<ul><li><a href="%s/person/%s">%s</a></li></ul>' % (
                    BASEURL, agent.name, agent.name)
        if record.registerdate:
            html += '<h3>Date Registered</h3>'
            html += record.registerdate.strftime('%F')
        html += '<h3><a href="https://www.registro-publico.gob.pa/RediWeb/default.asp">Look up complete file</a></h3> </br>'
        html += '(search for %s as "Numero de Ficha")' % record.recordid
        self.write(html)
Example #5
0
    def get(self, companyid=u''):

        companyid = getarg(companyid, 'id')
        try:
            companyid = int(companyid)
            record = Company.byRecordid(companyid)
        except (ValueError, SQLObjectNotFound):
            self.quitWithMsg('No company with ID %s' % companyid)
            return
        if record.hidden:
            self.quitWithMsg('Company %s is not currently available' % companyid)
            return
        subscribers = record.subscribers
        directors = record.directors
        html = '<h1>%s</h1>' % record.name
        companyurl = 'https://www.registro-publico.gob.pa/scripts/nwwisapi.dll/conweb/MESAMENU?TODO=SHOW&ID=%s' % record.recordid
        html += '<h3><a href="%s">Full Details</a></h3>' % companyurl
        html += '<h2>Directors</h2><ul>' 
        for director in directors:
            if not director.hidden:
                html += '<li><a href="%s/person/%s">%s</a> %s </li>' % (BASEURL, director.name, director.name, google(director.name))
        html += '</ul>'
        html += '<h2>Subscribers</h2><ul>' 
        for subscriber in subscribers:
            if not subscriber.hidden:
                html += '<li><a href="%s/person/%s">%s</a></li>' % (BASEURL, subscriber.name, subscriber.name)
        html += '</ul>'
        agentlist = record.agent
        if len(agentlist):
            agent = agentlist[0]
            if not agent.hidden:
                html += '<h2>Agent</h2>'
                html += '<ul><li><a href="%s/person/%s">%s</a></li></ul>' % (BASEURL, agent.name, agent.name)
        if record.registerdate:
            html += '<h3>Date Registered</h3>'
            html += record.registerdate.strftime('%F')
        html += '<h3><a href="https://www.registro-publico.gob.pa/RediWeb/default.asp">Look up complete file</a></h3> </br>'
        html += '(search for %s as "Numero de Ficha")' % record.recordid
        self.write(html)