Index: WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py	(revision 1761)
+++ WAeUP_SRP/trunk/skins/waeup_student/getNewStudentStatistics.py	(revision 1762)
@@ -20,6 +20,5 @@
     return 'Not allowed'
 
-
-total_new = context.students_catalog(session = '06')
+entry_sessions = ('06')
 
 new_states =      ('admitted',
@@ -42,14 +41,14 @@
 dict['id'] = 'All Faculties'
 dict['title'] = 'All Faculties'
-res = context.students_catalog(entry_session = '06')
+res = context.students_catalog(entry_session = entry_sessions)
 dict['total'] = len(res)
 for state in new_states:
-    res = context.students_catalog(entry_session = '06', review_state = state)
+    res = context.students_catalog(entry_session = entry_sessions, review_state = state)
     dict[state] = len(res)
-    statepercent = state+'_percent'    
+    statepercent = state+'_percent'
     if dict['total'] > 0:
         dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total'])
     else:
-        dict[statepercent] = 0   
+        dict[statepercent] = 0
 #fac_res['all'] = dict
 l.append(dict)
@@ -59,8 +58,8 @@
     dict['id'] = f.getId
     dict['title'] = f.Title
-    res = context.students_catalog(entry_session = '06', faculty = f.getId)
+    res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId)
     dict['total'] = len(res)
     for state in new_states:
-        res = context.students_catalog(entry_session = '06', faculty = f.getId, review_state = state)
+        res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state)
         dict[state] = len(res)
         statepercent = state+'_percent'
@@ -68,5 +67,5 @@
             dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total'])
         else:
-            dict[statepercent] = 0    
+            dict[statepercent] = 0
     #fac_res[f.getId] = dict
     l.append(dict)
Index: WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getRegStatistics.py	(revision 1761)
+++ 	(revision )
@@ -1,93 +1,0 @@
-## Script (Python) "getRegStatistics"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id: getStudentStatistics.py 1277 2007-01-11 21:11:37Z joachim $
-"""
-return Student Statistics
-"""
-import logging
-logger = logging.getLogger('Skins.getRegStatistics')
-
-try:
-    from Products.AdvancedQuery import Eq, Between, Le,In, Ge
-    aq_portal = context.portal_catalog.evalAdvancedQuery
-    students_catalog = context.students_catalog
-except:
-    evalAdvancedQuery = None
-logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
-l = []
-if not context.isStaff():
-    return l
-dep = {}
-
-dep['id'] = "All Faculties"
-
-total = float(len(students_catalog))
-
-dep['total'] = "%.0f" % total
-
-
-#from Products.zdb import set_trace;set_trace()
-
-sfp_res = context.portal_catalog(review_state ='school_fee_paid')
-sfp_ids = [r.getId for r in sfp_res]
-sfp = len(sfp_res)
-dep['school_fee_paid'] = sfp
-dep['school_fee_paid_percent'] =  "%.0f" % round(sfp*100/total)
-
-creg_res = context.portal_catalog(review_state ='courses_registered')
-creg_ids = [r.getId for r in creg_res]
-creg = len(creg_res)
-dep['courses_registered'] = creg
-dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
-
-cval_res = context.portal_catalog(review_state='courses_validated')
-cval_ids = [r.getId for r in cval_res]
-cval = len(cval_res)
-dep['courses_validated'] = cval
-dep['courses_validated_percent'] = "%.0f" % round(cval*100/total)
-
-
-l.append(dep)
-fs = context.portal_catalog(portal_type="Faculty")
-for fid in [f.getId for f in fs]:
-    dep = {}
-    dep['id'] = fid
-    #fquery = Eq('faculty',fid)
-    fac_res = students_catalog(faculty = fid)
-    fac_ids = [r.id for r in fac_res]
-    total = float(len(fac_res))
-
-    if total == 0:
-        continue
-
-    dep['total'] = "%.0f" % total
-
-    sfp = len([s for s in fac_ids if s in sfp_ids])
-    dep['school_fee_paid'] = sfp
-    dep['school_fee_paid_percent'] = 0
-    if total:
-        dep['school_fee_paid_percent'] = "%.0f" % round(sfp*100/total)
-
-    creg = len([s for s in fac_ids if s in creg_ids])
-    dep['courses_registered'] = creg
-    dep['courses_registered_percent'] = 0
-    if total:
-        dep['courses_registered_percent'] = "%.0f" % round(creg*100/total)
-
-    cval = len([s for s in fac_ids if s in cval_ids])
-    dep['courses_validated'] = cval
-    dep['courses_validated_percent'] = 0
-    if total:
-        dep['courses_validated_percent'] = "%.0f" % round(cval*100/total)
-
-    l.append(dep)
-
-return l
-
Index: WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1761)
+++ WAeUP_SRP/trunk/skins/waeup_student/getRetStudentStatistics.py	(revision 1762)
@@ -1,3 +1,3 @@
-## Script (Python) "getRetStudentStatistics"
+## Script (Python) "getNewStudentStatistics"
 ##bind container=container
 ##bind context=context
@@ -12,60 +12,60 @@
 return Student Statistics
 """
+
 import logging
 logger = logging.getLogger('Skins.getRetStudentStatistics')
 
-try:
-    from Products.AdvancedQuery import Eq, Between, Le,In, Ge
-    aq_portal = context.portal_catalog.evalAdvancedQuery
-    aq_students = context.students_catalog.evalAdvancedQuery
-except:
-    evalAdvancedQuery = None
 logger.info('%s invoked statistics' % context.portal_membership.getAuthenticatedMember())
+if not context.isStaff():
+    return 'Not allowed'
+
+entry_sessions = ('98','99','00','01','02','03','04','05')
+
+new_states =      ('returning',
+                   'school_fee_paid',
+                   'courses_registered',
+                   'courses_validated',
+                   )
+faculties = context.portal_catalog(portal_type="Faculty")
+
 l = []
-if not context.isStaff():
-    return l
-dep = {}
-dep['id'] = "All Faculties"
 
 
-ret_res1 = context.portal_catalog(review_state = 'returning')
-ret_ids1 = [r.getId for r in ret_res1]
-total_ret = len(ret_ids1)
+fac_res = {}
 
-ret_res2 = context.portal_catalog(review_state = ('school_fee_paid','courses_registered','courses_validated',))
-ret_ids2 = [r.getId for r in ret_res2]
+dict = {}
+dict['id'] = 'All Faculties'
+dict['title'] = 'All Faculties'
+res = context.students_catalog(entry_session = entry_sessions)
+dict['total'] = len(res)
+for state in new_states:
+    res = context.students_catalog(entry_session = entry_sessions, review_state = state)
+    dict[state] = len(res)
+    statepercent = state+'_percent'
+    if dict['total'] > 0:
+        dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total'])
+    else:
+        dict[statepercent] = 0
+#fac_res['all'] = dict
+l.append(dict)
 
-retquery = Ge('level','300') | (Eq('level','200') & Eq('entry_mode','UME'))
-ret_res3 = aq_students(retquery)
-ret_ids3 = [r.id for r in ret_res3]
-
-l.append(dep)
-sum_ret = 0
-sum_sfp = 0
-fs = context.portal_catalog(portal_type="Faculty")
-for fid in [f.getId for f in fs]:
-    dep = {}
-    dep['id'] = fid
-    fquery = Eq('faculty',fid)
-    stud_res = aq_students(fquery)
-    stud_ids = [r.id for r in stud_res]
-    total = float(len(stud_res))
-    if total == 0:
-        continue
-    sfp = len([s for s in stud_ids if s in ret_ids2 and s in ret_ids3])
-    dep['sfp'] = sfp
-    ret = len([s for s in stud_ids if s in ret_ids1])
-    dep['ret'] = ret
-    sum_ret += ret
-    sum_sfp += sfp
-
-    l.append(dep)
-
-l[0]['ret'] = sum_ret
-l[0]['sfp'] = sum_sfp
-l[0]['total_ret'] = total_ret + sum_sfp
-l[0]['total_li'] = sum_ret + sum_sfp
-
+for f in faculties:
+    dict = {}
+    dict['id'] = f.getId
+    dict['title'] = f.Title
+    res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId)
+    dict['total'] = len(res)
+    for state in new_states:
+        res = context.students_catalog(entry_session = entry_sessions, faculty = f.getId, review_state = state)
+        dict[state] = len(res)
+        statepercent = state+'_percent'
+        if dict['total'] > 0:
+            dict[statepercent] = "%.0f" % round(dict[state]*100.0/dict['total'])
+        else:
+            dict[statepercent] = 0
+    #fac_res[f.getId] = dict
+    l.append(dict)
 
 return l
 
+
Index: WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt	(revision 1761)
+++ WAeUP_SRP/trunk/skins/waeup_student/search_students_form.pt	(revision 1762)
@@ -18,6 +18,4 @@
       <nobr><a href="statistics_ret_view">Returning Student Statistics</a>
       &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_reg_view">Registration Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>        
       <nobr><a href="list_students">Cleared Student Export</a>
       &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt	(revision 1761)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_new_view.pt	(revision 1762)
@@ -11,11 +11,7 @@
   
       <strong>
-      <nobr><a href="statistics_new_view">New Student Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
+      <nobr><a href="search_students">Search Students</a>
+      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>      
       <nobr><a href="statistics_ret_view">Returning Student Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_reg_view">Registration Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>        
-      <nobr><a href="list_students">Cleared Student Export</a>
       &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
       </strong>     
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_reg_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_reg_view.pt	(revision 1761)
+++ 	(revision )
@@ -1,66 +1,0 @@
-<metal:body use-macro="here/main_template/macros/master">
-  <metal:main fill-slot="main">
-  <metal:block tal:define="departments context/getRegStatistics;
-                        mtool here/portal_membership;
-                        member mtool/getAuthenticatedMember;">       
-
-      <span tal:condition="not: departments">
-        <span tal:content="here/illegal_view" />
-      </span>
-      <span tal:condition="departments">
-  
-      <strong>
-      <nobr><a href="statistics_new_view">New Student Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_ret_view">Returning Student Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_reg_view">Registration Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>        
-      <nobr><a href="list_students">Cleared Student Export</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      </strong>
-
-      <h3>Registration Statistics</h3>
-      <br />
-      <span tal:condition="not:isAnon">
-        <table>
-          <tr class="odd ajaxtd">
-            <th >Faculty</th>
-            <th align="right">Total</th>
-            <th align="right">SFP</th>
-            <th align="right">CREG</th>
-            <th align="right">CVAL</th>
-          </tr>
-          <tr tal:repeat="d departments"
-              tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')">
-              <td width="80px"> <span tal:content="d/id" /> </td>
-              <td width="80px" align="right">
-                <span tal:content="d/total" />
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/school_fee_paid" />
-                (<span tal:content="d/school_fee_paid_percent" />%)
-              </td>              
-              <td width="80px" align="right"> 
-                <span tal:content="d/courses_registered" />
-                (<span tal:content="d/courses_registered_percent" />%)
-              </td>
-              <td width="80px" align="right"> 
-                <span tal:content="d/courses_validated" />
-                (<span tal:content="d/courses_validated_percent" />%)
-              </td>
-
-          </tr>
-        </table>
-        <br />
-        <table>
-        <tr><td>SFP:</td> <td>School fee paid</td></tr>
-        <tr><td>CREG:</td> <td>Courses registered</td></tr>
-        <tr><td>CVAL:</td> <td>Courses validated</td></tr>
-        </table>
-      </span>
-      </span>
-  </metal:block>      
-  </metal:main>
-</metal:body>
-      
Index: WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1761)
+++ WAeUP_SRP/trunk/skins/waeup_student/statistics_ret_view.pt	(revision 1762)
@@ -1,65 +1,65 @@
 <metal:body use-macro="here/main_template/macros/master">
   <metal:main fill-slot="main">
-  <metal:block tal:define="departments context/getRetStudentStatistics;
+  <metal:block tal:define="faculties context/getRetStudentStatistics;
                         mtool here/portal_membership;
                         member mtool/getAuthenticatedMember;">       
 
-      <span tal:condition="not: departments">
+      <span tal:condition="not: faculties">
         <span tal:content="here/illegal_view" />
       </span>
-      <span tal:condition="departments">
+      <span tal:condition="faculties">
   
       <strong>
+      <nobr><a href="search_students">Search Students</a>
+      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>        
       <nobr><a href="statistics_new_view">New Student Statistics</a>
       &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_ret_view">Returning Student Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      <nobr><a href="statistics_reg_view">Registration Statistics</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>        
-      <nobr><a href="list_students">Cleared Student Export</a>
-      &nbsp;&nbsp;&nbsp;&nbsp;</nobr>
-      </strong>
+      </strong>     
 
-   
-      <h3>Returning Student Statistics</h3>
+      <h3>New Student Statistics</h3>
       <br />      
-      <span tal:content="python:departments[0]['total_ret']" /> 
-      returning student records have been imported. 
-      <span tal:content="python:departments[0]['total_li']" /> returning students 
-      have logged in.
-      <br /><br />
       <span tal:condition="not:isAnon">
         <table>
           <tr class="odd ajaxtd">
             <th >Faculty</th>
+            <th align="right">Total</th>
             <th align="right">RET</th>
-            <th align="right">SFP+</th>
+            <th align="right">SFP</th>
+            <th align="right">CR</th>
+            <th align="right">CV</th>
+
           </tr>
-          <tr tal:define="d python:departments[0]"
-              class="even ajaxtd">
-              <td width="80px">All Faculties</td>
+          <tr tal:repeat="d faculties"
+              tal:attributes="class python:test(repeat['d'].even(), 'even ajaxtd', 'odd ajaxtd')">
+              <td width="80px"> <span tal:content="d/id" /> </td>
+              <td width="80px" align="right">
+                <span tal:content="d/total" />
+              </td>
               <td width="80px" align="right"> 
-                <span tal:content="d/ret" />
-              </td>   
+                <span tal:content="d/returning" />
+                (<span tal:content="d/returning_percent" />%)
+              </td>              
               <td width="80px" align="right"> 
-                <span tal:content="d/sfp" />
-              </td>              
-          </tr>
-          <tr tal:repeat="d python:departments[1:]"
-              tal:attributes="class python:test(repeat['d'].even(), 'odd ajaxtd', 'even ajaxtd')">
-              <td width="80px"> <span tal:content="d/id" /> </td>
+                <span tal:content="d/school_fee_paid" />
+                (<span tal:content="d/school_fee_paid_percent" />%)
+              </td>
               <td width="80px" align="right"> 
-                <span tal:content="d/ret" />
-              </td>       
+                <span tal:content="d/courses_registered" />
+                (<span tal:content="d/courses_registered_percent" />%)
+              </td>
               <td width="80px" align="right"> 
-                <span tal:content="d/sfp" />
-              </td>                              
+                <span tal:content="d/courses_validated" />
+                (<span tal:content="d/courses_validated_percent" />%)
+              </td>                                          
+
           </tr>
         </table>
         <br />
         <table>
-        <tr><td>RET:</td> <td>Returning students who have logged in</td></tr>
-        <tr><td>SFP:</td> <td>Returning students who paid their school fee</td></tr>
-        </table>        
+        <tr><td>RET: </td> <td>Returning</td></tr>
+        <tr><td>SFP: </td> <td>School fee paid</td></tr>
+        <tr><td>CR: </td> <td>Course list registered</td></tr>
+        <tr><td>CV: </td> <td>Course list validated</td></tr>                
+        </table>
       </span>
       </span>
