Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##main\index.html.erb - line3
- <h1 style="letter-spacing: 5px; color: #dadada;">News Bulletin SY <%=h @this_school.sy_from %>-<%=h @this_school.sy_to %><%unless gs? || hs?%>, <%=h @this_school.semester %><b><%= @this_school.semester == 'Summer' ? '' : ' Semester'%></b><% end %></h1>
- ##students/show_record.html.erb
- <p style="text-align: center;"><i>GRADE</i></p>
- <%if @class_record_grade_h[index] != nil%>
- <table width=100% border=1>
- <tr bgcolor="black">
- <% @class_record_grade_h[index].each_with_index do |heading, hindex| %>
- <% unless hindex == 0 %><th><font color=white><%=h heading%></font></th><% end %>
- <%end%></tr>
- <tr>
- <%@class_record_grade[index].each_with_index do |body, bindex|%>
- <% unless bindex == 0 %><th><%=h body%></th><% end %>
- <%end%>
- </tr>
- </table>
- <%else%>
- <p style="text-align: center;">
- <%= render :partial => '/main/notavailable' %>
- </p>
- <%end%>
- ##school_infos_controller.rb
- def update
- if !params[:edit_button]
- pic_save
- else
- @school_info = SchoolInfo.find(1)
- @tempVar = @school_info.school_type
- @sy_to = params[:school_info][:sy_to]
- @sy_from = params[:school_info][:sy_from]
- diff = @sy_to - @sy_from
- if diff == 1
- respond_to do |format|
- if @school_info.update_attributes(params[:school_info])
- if (@school_info.school_type != @tempVar)
- Course.destroy_all
- Student.destroy_all
- Account.destroy_all "accounttype = 'Student' or accounttype = 'Parent'"
- SchoolClass.destroy_all
- ClassRecord.destroy_all
- if @school_info.school_type != "College"
- Account.destroy_all "accounttype = 'Adviser' or accounttype = 'College-Admin' or accounttype = 'Dept-Admin' or accounttype = 'GS-Admin' or accounttype = 'HS-Admin'"
- if @school_info.school_type == "High school" # high school
- Account.create(:username => "hadmin", :password => "hadmin", :accounttype => "HS-Admin")
- @school_info.semester = "First"
- @school_info.save
- else # grade school
- Account.create(:username => "gadmin", :password => "gadmin", :accounttype => "GS-Admin")
- @school_info.semester = "First"
- @school_info.save
- end
- @courses = Course.find(:all)
- Course.create(:courseid => "this", :title => "this")
- Student.create(:student_no => "111111", :name => "Mike", :last_name => "Bibby", :year_level => "1", :course => "this")
- Account.create(:username => "111111", :password => "Bibby", :accounttype => "Student")
- Account.create(:username => "111111p", :password => "mrmrsBibby", :accounttype => "Parent")
- SchoolClass.create(:cat_no => "SIBIKA", :sec_no => "A", :teacher => "Batibot")
- SchoolClass.create(:cat_no => "SIBIKA2", :sec_no => "A1", :teacher => "Batibot Sr.")
- SchoolClass.create(:cat_no => "MATH", :sec_no => "1", :teacher => "Sesame")
- SchoolClass.create(:cat_no => "MATH2", :sec_no => "1A", :teacher => "Sesame Jr.")
- @course = Course.find(:first, :conditions => [ "courseid = 'this'"])
- CourseCurriculum.create(:subject => "SIBIKA", :year => "1", :semester => "First", :course_id => @course.id)
- CourseCurriculum.create(:subject => "MATH", :year => "1", :semester => "First", :course_id => @course.id)
- CourseCurriculum.create(:subject => "SIBIKA2", :year => "2", :semester => "First", :course_id => @course.id)
- CourseCurriculum.create(:subject => "MATH2", :year => "2", :semester => "First", :course_id => @course.id)
- end
- end
- flash[:notice] = 'Update successful.'
- flash[:error] = nil
- format.html { redirect_to(edit_school_info_path(@school_info)) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @school_info.errors, :status => :unprocessable_entity }
- end
- end
- else
- flash[:error] = 'Invalid school year.'
- respond_to do |format|
- format.html { redirect_to(:controller=>'school_infos', :action=>'edit', :id=>1) }
- format.xml { head :ok }
- end
- end
- end
- end
- end
- ##payments_info.rb
- validates_numericality_of :prate, :irate, :iprate,
- :greater_than_or_equal_to => 0
- ##courses\show.html.erb -->> aesthetic lang..lolz
- <% if @students.empty? %>
- <i>No students under this course.</i>
- <% else %>
- <% @school = SchoolInfo.find(1) %>
- <% for a in (1..@school.levels.to_i) %>
- <center><div style="background-color: #FFEFAA;"><b><%= no_to_s(a) + ' Year' %></b></div></center>
- <ul>
- <% for student in @students %>
- <% if student.year_level.to_s == a.to_s%>
- <% if admin? %>
- <li> <%= link_to student.last_name + ", " + student.name, student %>
- <% else %>
- <li> <%= student.last_name + ", " + student.name %>
- <% end %>
- <% end %>
- <% end %>
- </ul>
- <% end %>
- <% end %>
- ##application_helper.rb -->> aesthetic lang..lolz
- def no_to_s(number) # ordinal number to word -- good for 1- 10 only
- unit = ['Zeroth', 'First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth', 'Seventh', 'Eigth', 'Ninth', 'Tenth', '']
- return unit[number]
- end
- ##student_payments_controller.rb
- def create
- @student_payment = StudentPayment.new(params[:student_payment])
- @id = params[:student_payment][:student_id]
- @amount = params[:student_payment][:amount]
- @payment_no = params[:student_payment][:payment_no]
- @payment_no == '0' ? str='Initial' : str=@payment_no.to_i.ordinalize
- respond_to do |format|
- if @student_payment.save
- logthestuff(" #" + @student_payment.id.to_s + " Student: " + @id + " Amount: " + @amount + " CREATE")
- flash[:notice] = 'Payment was successfully done.'
- format.html { redirect_to(:controller=> 'students', :action=> 'payment_tracking', :id=>@id) }
- format.xml { render :xml => @student_payment, :status => :created, :location => @student_payment }
- else
- flash[:error] = str + ' payment was already checked before.'
- format.html { redirect_to(:controller=> 'students', :action=> 'payment_tracking', :id=>@id) }
- format.xml { render :xml => @student_payment.errors, :status => :unprocessable_entity }
- end
- end
- end
- def create_in
- @student_payment = StudentPayment.new(params[:student_payment])
- @id = params[:student_payment][:student_id]
- @amount = params[:student_payment][:amount]
- @payment_no = params[:student_payment][:payment_no]
- @payment_no == '0' ? str='Initial' : str=@payment_no.to_i.ordinalize
- respond_to do |format|
- if @student_payment.save
- logthestuff(" #" + @student_payment.id.to_s + " Student: " + @id + " Amount: " + @amount + " CREATE")
- flash[:notice] = 'Payment was successfully done.'
- format.html { redirect_to(:controller=> 'students', :action=> 'payment_tracking_list') }
- format.xml { render :xml => @student_payment, :status => :created, :location => @student_payment }
- else
- flash[:error] = str + ' payment was already checked.'
- format.html { redirect_to(:controller=> 'students', :action=> 'payment_tracking_list') }
- format.xml { render :xml => @student_payment.errors, :status => :unprocessable_entity }
- end
- end
- end
- ## student_payment.rb
- validates_uniqueness_of :student_id, :scope => [:payment_no]
- ##school_classes_controller.rb - line 215, 1138, 1209 && records_controller.rb - line223
- @teachers = Teacher.find(:all, :conditions => ['last_name LIKE ?', "%#{teacher_last_name}%"])
- ## para sa date
- date = Time.parse("January 1, 2008") # date here
- @date_str = date.strftime("%B_") + date.day.to_s + date.strftime("_%Y")
- ##students/paid.html.erb - line 64 & students/unpaid.html.erb - line 78
- <h4><% unless gs? || hs? %><%= @school.semester %><%= @school.semester == 'Summer' ? ', ' : ' Semester, '%><% end %><%= @skul_yr%></h4>
- ##main\index.html.erb - line3
- <h1 style="letter-spacing: 5px; color: #dadada;">News Bulletin SY <%=h @this_school.sy_from %>-<%=h @this_school.sy_to %><%unless gs? || hs?%>, <%=h @this_school.semester %><b><% @this_school.semester == 'Summer' ? '' : ' Semester'%></b><% end %></h1>
- ##school_classes_controller.rb - line 650
- if post == nil
- flash[:error] = 'Your file is more than 50kb.'
- flash[:notice] = nil
- elsif post == 0
- flash[:error] = 'There is no file to upload.'
- flash[:notice] = nil
- elsif post == -1
- flash[:error] = 'Unknown file format.'
- flash[:notice] = nil
- elsif post == -3
- flash[:error] = 'Your file is infected.'
- flash[:notice] = nil
- elsif @fake_file
- flash[:error] = 'There is an error on the file you uploaded.'
- flash[:notice] = nil
- else
- flash[:notice] = 'File uploaded.'
- flash[:error] = nil
- end
Add Comment
Please, Sign In to add comment