Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_pin_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_pin_edit_form.pt	(revision 1415)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_pin_edit_form.pt	(revision 1415)
@@ -0,0 +1,48 @@
+<tal:block define="rendered_main options/rendered;
+                   portal_status_message options/psm;
+                   data_storage options/ds;
+                   mode options/mode;
+                   edition python:1;"
+                   >
+<metal:block define-macro="edit_form">
+  <metal:block use-macro="here/content_lib_master/macros/master">
+  <metal:block fill-slot="header"
+    tal:define="creation creation|nothing;
+                edition edition|nothing;
+                metadata metadata|nothing"
+                >
+    </metal:block>
+      <metal:block fill-slot="main">
+      
+        <div style="text-align: right" tal:condition="python: mode == 'edit'">
+        <a href="" target="slip" tal:attributes="href string:accommodation_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Accommodation Slip
+        </a>
+        </div>      
+      
+        <h3 tal:condition="python: mode == 'create'">Book Your Accommodation! </h3>
+        <h3 tal:condition="python: mode == 'edit'">Pay Your Accommodation Maintenance Fee! </h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+          <p>Instructions :</p>
+          <ul tal:condition="python: mode == 'create'">
+            <li>Buy a Hostel Application Scratch Card.</li> 
+            <li>Enter the PIN above and press 'Book'.</li>
+            <li>Print your Hostel Allocation Slip.</li>
+          </ul>
+          <ul tal:condition="python: mode == 'edit'" 
+              tal:define="info python: context.getAccommodationInfo()">
+            <li>Buy a Hostel Maintainance Scratch Card 
+            (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for 
+            <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li> 
+            <li>Enter the PIN above and press 'Save'.</li>
+            <li>Print your Hostel Maintenance Receipt.</li>
+          </ul>
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/accommodation_pin_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/accommodation_pin_edit_form.pt	(revision 1413)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<tal:block define="rendered_main options/rendered;
-                   portal_status_message options/psm;
-                   data_storage options/ds;
-                   mode options/mode;
-                   edition python:1;"
-                   >
-<metal:block define-macro="edit_form">
-  <metal:block use-macro="here/content_lib_master/macros/master">
-  <metal:block fill-slot="header"
-    tal:define="creation creation|nothing;
-                edition edition|nothing;
-                metadata metadata|nothing"
-                >
-    </metal:block>
-      <metal:block fill-slot="main">
-      
-        <div style="text-align: right" tal:condition="python: mode == 'edit'">
-        <a href="" target="slip" tal:attributes="href string:accommodation_slip"
-            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
-            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
-            Accommodation Slip
-        </a>
-        </div>      
-      
-        <h3 tal:condition="python: mode == 'create'">Book Your Accommodation! </h3>
-        <h3 tal:condition="python: mode == 'edit'">Pay Your Accommodation Maintenance Fee! </h3>
-        <br />
-        <div tal:replace="structure rendered_main" />
-          <p>Instructions :</p>
-          <ul tal:condition="python: mode == 'create'">
-            <li>Buy a Hostel Application Scratch Card.</li> 
-            <li>Enter the PIN above and press 'Book'.</li>
-            <li>Print your Hostel Allocation Slip.</li>
-          </ul>
-          <ul tal:condition="python: mode == 'edit'" 
-              tal:define="info python: context.getAccommodationInfo()">
-            <li>Buy a Hostel Maintainance Scratch Card 
-            (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for 
-            <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li> 
-            <li>Enter the PIN above and press 'Save'.</li>
-            <li>Print your Hostel Maintenance Receipt.</li>
-          </ul>
-      </metal:block>
-      <metal:block fill-slot="sub">
-      </metal:block>
-    </metal:block>
-  </metal:block>
-</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/add_student.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/add_student.py	(revision 1415)
+++ WAeUP_SRP/trunk/skins/waeup_student/add_student.py	(revision 1415)
@@ -0,0 +1,72 @@
+##parameters=REQUEST
+# $Id$
+"""
+process the the accommodation reservation
+"""
+import DateTime
+current = DateTime.DateTime()
+pr = context.portal_registration
+wftool = context.portal_workflow
+lt = context.portal_layouts
+mtool = context.portal_membership
+member = mtool.getAuthenticatedMember()
+acco_cat = context.portal_accommodation
+import logging
+logger = logging.getLogger('Student')
+
+validate = REQUEST.has_key("cpsdocument_edit_button") and\
+           REQUEST.get("cpsdocument_edit_button").startswith('add')
+d = {}
+mode = 'edit'
+rendered,psm,ds = lt.renderLayout(layout_id= 'student_create',
+                      schema_id= 'student_create',
+                      context=context,
+                      mapping=validate and REQUEST,
+                      ob=d,
+                      layout_mode=mode,
+                      commit = False
+                      )
+if psm == 'invalid':
+    psm = "Please correct your input."
+    return context.add_student_form(rendered = rendered,
+                                 psm = psm,
+                                 #psm = "%s, %s" % (psm,ds),
+                                 mode = mode,
+                                 formaction = "add_student",
+                                 button = "add",
+                                 ds = ds,
+                                 )
+elif psm == '':
+    return context.add_student_form(rendered = rendered,
+                                 psm = psm,
+                                 mode = mode,
+                                 formaction = "add_student",
+                                 button = "add",
+                                 ds = ds,
+                                 )
+elif psm == 'valid':
+    pass
+##firstname = ds.get('firstname')
+##middlename = ds.get('middlename')
+##lastname = ds.get('lastname')
+##email = ds.get('email')
+##matric_no = ds.get('matric_no')
+##study_course = ds.get('study_course')
+##level = ds.get('level')
+dict = {}
+dict.update(ds)
+sid,password = context.waeup_tool.createStudent(dict)
+dict['sid'] = sid
+dict['password'] = password
+student_rec = context.getFormattedStudentEntry(context.students_catalog(id = sid)[0])
+psm = "Student created with Id: %s and password: %s" % (sid,password)
+logger.info('"%s","created student","%s"' % (member,sid))
+return context.add_student_form(rendered = rendered,
+                                 #psm = "%s, %s" % (psm,ds),
+                                 mode = 'view',
+                                 psm = psm,
+                                 ds = dict,
+                                 student = student_rec,
+                                 )
+
+
Index: WAeUP_SRP/trunk/skins/waeup_student/add_student_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/add_student_form.pt	(revision 1415)
+++ WAeUP_SRP/trunk/skins/waeup_student/add_student_form.pt	(revision 1415)
@@ -0,0 +1,78 @@
+<tal:block define="rendered_main options/rendered;
+           portal_status_message options/psm;
+           info options/ds;
+           mode options/mode;
+           student options/student|nothing;
+           formaction options/formaction|nothing;
+           matric_no options/matric_no|nothing;
+           name options/name|nothing;
+           creation creation|nothing;"
+           >
+  <metal:block define-macro="edit_form">
+    <metal:block use-macro="here/content_lib_master/macros/master">
+      <metal:block fill-slot="header">
+      </metal:block>
+      <metal:block fill-slot="main">
+        <span tal:condition="python: mode == 'view'" tal:omit-tag="">
+          <table>
+            <tr>
+              <td>Student Id:</td>
+              <td tal:content="info/sid" />
+            </tr>                
+            <tr>
+              <td>Password:</td>
+              <td tal:content="info/password" />
+            </tr>                
+            <tr>
+              <td>Name</td>
+              <td tal:content="student/name" />
+            </tr>                
+            <tr>
+              <td>Sex:</td>
+              <td tal:content="student/sex" />
+            </tr>                
+            <tr>
+              <td>Email:</td>
+              <td tal:content="student/email" />
+            </tr>                
+            <tr>
+              <td>Entry Mode:</td>
+              <td tal:content="student/entry_mode" />
+            </tr>        
+            <tr>
+              <td>Matric No</td>
+              <td tal:content="student/matric_no" />
+            </tr>                
+            <tr>
+              <td>Study Course</td>
+              <td tal:content="student/course" />
+            </tr>                
+          </table>
+        </span>
+        <span tal:condition="python: mode != 'view'" tal:omit-tag="">
+          <form action="" id="editForm" method="post" 
+              enctype="multipart/form-data" class="workflow"
+              tal:attributes="action options/formaction"
+              >
+          <div tal:replace="structure rendered_main" />
+          <br />
+          <input type="submit" class="standalone" name="cpsdocument_edit_button"
+                 value="Save" 
+                 id="cpsdocument_edit_button"
+                 tal:attributes="value options/button"
+                 tal:condition="not:creation" />
+          <input type="submit" 
+                 class="standalone" 
+                 name="cpsdocument_create_button"
+                 value="apply"
+                 tal:attributes="value options/button"
+                 tal:condition="creation" />
+          
+        </form>
+        </span>
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py	(revision 1413)
+++ WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py	(revision 1415)
@@ -16,5 +16,5 @@
 d = {}
 for f in fields:
-    d[f] = getattr(brain,f,'--')
+    d[f] = getattr(brain,f,'')
     if f == "sex":
         if d[f]:
Index: WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1413)
+++ WAeUP_SRP/trunk/skins/waeup_student/getStudentReviewState.py	(revision 1415)
@@ -5,5 +5,5 @@
 ##bind script=script
 ##bind subpath=traverse_subpath
-##parameters=student=None, with_items=None
+##parameters=
 ##title=
 ##
@@ -12,6 +12,13 @@
 return Info about the current Student
 """
+try:
+    from Products.AdvancedQuery import Eq, Between, Le,In
+    evalAQ = context.portal_catalog.evalAdvancedQuery
+except:
+    evalAdvancedQuery = None
 student_id = context.getStudentId()
-res = context.portal_catalog(id = student_id,portal_type='Student')
+#res = context.portal_catalog(id = student_id,portal_type='Student')
+query = Eq('id',student_id)
+res = evalAQ(query)
 if not res:# or len(res) > 1:
     return None
