{% extends 'exportplan/section.html' %} {% load static %} {% block head_other %} {% endblock %} {% block intro_title %}Travel plan{%endblock %} {% block intro_description %} Create a travel plan that will help you prepare everything you need for your upcoming business trips. {% endblock %} {% block main_content %}
View the latest guidance for British people travelling overseas during the coronavirus (COVID-19) pandemic
There are lots of things you'll have to think about to ensure you have a successful business trip. This section will help you to record everything you need to consider.
Every country will have different rules you have to comply with when you visit.
It's likely you'll need to visit your chosen markets to build business relationships and seal important deals.


To run your app with Electron, execute the following command under your Console (or Terminal):
The path-to-your-app
should be the path to your own Electron
app, you can read the quick start
guide in Electron's docs
on how to write one.


THE 2021 BMW 3 SERIES SEDAN
Starting at $41,250*
Lease Offer2021 BMW 3 Series 330i Sedan
FOR 36 MONTHS$3,999 DUE AT SIGNINGSUGGESTED DEALER CONTRIBUTION OF $975
Offer not valid in Puerto Rico. Lease financing available on new 2021 BMW 330i Sedan models from participating BMW Centers through BMW Financial Services through November 02, 2020, to eligible, qualified customers with excellent credit history who meet BMW Financial Services' credit requirements. Monthly lease payments of $429 per month for 36 months is based on an adjusted capitalized cost of $39,275 (MSRP of $44,395, including destination and handling fee of $995, less $2,645 customer down, $0 security deposit and suggested dealer contribution of $975 and $1,500 Lease Credit). Actual MSRP may vary. Dealer contribution may vary and could affect your actual lease payment. Cash due at signing includes $2,645 down payment, $429 first month's payment, $925 acquisition fee and $0 security deposit. Lessee responsible for insurance during the lease term, excess wear and tear as defined in the lease contract, $0.25/mile over 30,000 miles and a disposition fee of $350 at lease end. Not all customers will qualify for security deposit waiver. Tax, title, license, registration and dealer fees are additional fees due at signing. Advertised payment does not include applicable taxes. Purchase option at lease end, excluding tax, title and government fees, is $25,749. Offer valid through November 02, 2020 and may be combined with other offers unless otherwise stated. Models pictured may be shown with metallic paint and/or additional accessories. Visit your authorized BMW Center for important details.
Performance
DECADES OF DYNAMIC DRIVING
The original 3 Series Sedan brought power, agility, and spirit to the everyday driver. In its seventh generation, that performance has only grown more pronounced.
The power to push forward.
The 3 Series brings power and innovation together in a sedan made to move – from the M340i’s robust engine, delivering 382 horsepower, to the plug-in hybrid of the 330e.
Class-defining handling.
With a low center of gravity, lightweight components, and a suspension tuned to perfection on the grueling Nürburgring, this compact sedan delivers unrivaled sportiness and dynamics.
New dimensions of performance.
THE M340i SEDAN
With M-engineered components including brakes, suspension, and a 3.0-liter inline-6 engine augmented with new 48V mild hybrid technology for enhanced eBoost power, the M340i brings the power of M to the 3 Series Sedan.
DESIGN
STRIKING SEDAN STYLE
Sleek, wide, and low, the exterior of the BMW 3 Series Sedan was molded for aerodynamic excellence and aesthetic greatness.
The evolution of the defining sports sedan.
Balance institution and innovation like never before. The four-door 3 Series Sedan evolves BMW’s signature designs with modern takes on the iconic kidney grille and the Hofmeister kink.
A luxurious interior.
Experience a refined interior with exceptional fit and finish. Available Vernasca Leather upholstery and polished details set the atmosphere for spirited drives.
Distinguished accents.
Make an impression on every road with up to 19" M wheels and a range of vibrant exterior colors – including the newly available Phytonic Blue Metallic.
TECHNOLOGY
INNOVATIVE SYSTEMS
Surround yourself with BMW’s most advanced driving technology in the 3 Series Sedan, developed with even more convenient features to keep you connected at all times.
Personal Assistant
At your service.
The BMW Intelligent Personal Assistant gives you complete control over vehicle settings, navigation, and entertainment systems. Simply bring it to life with “Hey, BMW…” or your own personal activation word.
Standard Safety
Increase your peace of mind.
Standard Active Protection and Active Guard recognize and react to critical driving situations with protective measures. These standard safety features include Frontal Collision Warning, City Collision Mitigation, and more.
Connected Interfaces
Connect your way.
Welcome to the nexus of control, connection, and entertainment. The BMW Live Cockpit Professional, standard for the BMW M340i, seamlessly integrates every vehicle display and digital interaction.
Driving Assistance
Added safety innovations.
The available Driving Assistance Professional Package eases the stress of every drive with Active Cruise Control with Stop & Go, Active Lane Keeping Assistant with Side Collision Avoidance, and more.
Information Projection
Driving data in your line of sight.
The available full-color Head-up Display brings BMW’s most advanced technology to your every drive. Enjoy vital driving data projected directly onto the windshield, just a glance away.
Models
CORE MODELS
330i Sedan
STARTING MSRP*
$41,250
CORE MODELS
330i xDrive Sedan
STARTING MSRP*
$43,250
BMW M
M340i Sedan
STARTING MSRP*
$54,700
BMW M
M340i xDrive Sedan
STARTING MSRP*
$56,700
ELECTRIFIED
330e Sedan
STARTING MSRP*
$44,550
ELECTRIFIED
330e xDrive Sedan
STARTING MSRP*
$46,550
* Manufacturer’s suggested retail price excludes destination & handling fee of $995, tax, title, license, and registration.
2021 BMW 3 Series New Haven, CT
Rediscover Your Love of Driving in the 2021 BMW 3 Series New Haven, CT from BMW of North Haven
Always moving forward, BMW is known for its innovation and luxurious accents. The 2021 BMW 3 Series New Haven, CT, follows suit. This luxury sedan is built for performance and offers more intuitive technology than ever before. Test drive the 2021 BMW 3 Series New Haven, CT at BMW of North Haven today to test out the driver assist technologies, sink into comfort in the cabin and admire the TwinPower Turbo under the hood.
What BMW dealers have the 2021 BMW 3 Series New Haven, CT, for test drives?
We do! The team at BMW of North Haven is pleased to showcase the 2021 BMW 3 Series New Haven, CT. This premier sedan attracts attention at first glance with a stunning profile on all trims, including the 330i, 330i xDrive, M340i, M340i xDrive, 330e and 330e xDrive.
The 2021 BMW 3 Series New Haven, CT comes standard with premium SensaTec upholstery with premium trims featuring heated side mirrors and heated and ventilated front seats. The high-end tech includes advanced vehicle and key memory, as well as automatic three-zone climate control, rain-sensing windshield wipers and automatic headlight control. This model is also equipped with the MBUX infotainment system that utilizes voice commands to change settings and deliver information to the driver. This advanced system also learns the habits and routines of the driver to personalize each and every drive.
The 2021 BMW 3 Series New Haven, CT comes standard with a 2.0L TwinPower Turbo inline 4-cylinder engine that delivers 255 horsepower. Upgrade to the M340i and gain a 3.0L M TwinPower Turbo inline V6 that delivers 335 horsepower. As for safety, this vehicle stands out from the competition. Available safety features include automatic high beams, fatigue and focus alerts, post-crash braking, as well as frontal collision warnings with automatic city collision mitigation and braking. All trims of the 2021 BMW 3 Series New Haven, CT are equipped with a rear-view camera.
Where can I test drive a 2021 BMW 3 Series New Haven, CT?
Simply stop in at BMW of North Haven to test drive the 2021 BMW 3 Series New Haven, CT. This luxury sedan is one of the most popular sedans we have available and our team is happy to showcase all the premium features available. Our primary goal is your satisfaction, which is why we stock the 2021 BMW 3 Series New Haven, CT and luxury SUVs. Stop in today to test drive the 2021 BMW 3 Series New Haven, CT and select your next 3 Series to drive home.


Members stores Array.<object> the list of openings if manually changed then call redraw() to update canvas


{{ profilePosts?.length }} Posts
{{profileUser?.username}}
{{ profileFollowing?.length }} Following
{{ profileFollowers?.length }} Followers
{{ profilePosts?.length }} Posts
{{ profileFollowing?.length }} Following
{{ profileFollowers?.length }} Followers
{{ profileUser?.biography || 'No description'}}
No more posts


< Settings
Manual rotations
Animation control
Geometry control
Points customizer
Plot
Clear all
Edit current points
4Shadow.io
Stop animation
Reset
Help / About


| Class | EmployeeController |
| In: |
app/controllers/employee_controller.rb
|
| Parent: | ApplicationController |
# File app/controllers/employee_controller.rb, line 161 161: def add_additional_details 162: @additional_details = AdditionalField.find(:all) 163: @additional_field = AdditionalField.new(params[:additional_field]) 164: if request.post? and @additional_field.save 165: flash[:notice] = "Additional field created" 166: redirect_to :controller => "employee", :action => "add_additional_details" 167: end 168: end
# File app/controllers/employee_controller.rb, line 132 132: def add_bank_details 133: @bank_details = BankField.find(:all) 134: @bank_field = BankField.new(params[:bank_field]) 135: if request.post? and @bank_field.save 136: flash[:notice] = "Bank field created" 137: redirect_to :controller => "employee", :action => "add_bank_details" 138: end 139: end
# File app/controllers/employee_controller.rb, line 7 7: def add_category 8: @categories = EmployeeCategory.find(:all) 9: @category = EmployeeCategory.new(params[:category]) 10: if request.post? and @category.save 11: flash[:notice] = "Employee category created" 12: redirect_to :controller => "employee", :action => "add_category" 13: end 14: end
# File app/controllers/employee_controller.rb, line 72 72: def add_department 73: @departments = EmployeeDepartment.find(:all) 74: @department = EmployeeDepartment.new(params[:department]) 75: if request.post? and @department.save 76: flash[:notice] = "Employee department created" 77: redirect_to :controller => "employee", :action => "add_department" 78: end 79: end
# File app/controllers/employee_controller.rb, line 102 102: def add_grade 103: @grades = EmployeeGrade.find(:all) 104: @grade = EmployeeGrade.new(params[:grade]) 105: if request.post? and @grade.save 106: flash[:notice] = "Employee grade created" 107: redirect_to :controller => "employee", :action => "add_grade" 108: end 109: end
# File app/controllers/employee_controller.rb, line 588 588: def add_payslip_category 589: @employee = Employee.find(params[:emp_id]) 590: render :partial => "payslip_category_form" 591: end
# File app/controllers/employee_controller.rb, line 38 38: def add_position 39: @positions = EmployeePosition.find(:all) 40: @categories = EmployeeCategory.find(:all,:order => "name asc") 41: @position = EmployeePosition.new(params[:position]) 42: if request.post? and @position.save 43: flash[:notice] = "Employee position created" 44: redirect_to :controller => "employee", :action => "add_position" 45: end 46: end
# File app/controllers/employee_controller.rb, line 190 190: def admission1 191: @user = current_user 192: @user_name = @user.username 193: @employee1 = Employee.find_by_employee_number(@user_name) 194: @categories = EmployeeCategory.find(:all,:order => "name asc") 195: @positions = [] 196: @grades = EmployeeGrade.find(:all,:order => "name asc") 197: @departments = EmployeeDepartment.find(:all,:order => "name asc") 198: @nationalities = Country.all 199: @employee = Employee.new(params[:employee]) 200: @last_admitted_employee = Employee.find(:last,:conditions=>"employee_number != 'admin'") 201: @config = Configuration.find_by_config_key('EmployeeNumberAutoIncrement') 202: 203: if request.post? 204: 205: unless params[:employee][:employee_number].to_i ==0 206: @employee.employee_number= "E" + params[:employee][:employee_number].to_s 207: end 208: 209: if @employee.save 210: if params[:employee][:gender] == "true" 211<EMAIL_ADDRESS>:gender => true) 212: else 213<EMAIL_ADDRESS>:gender => false) 214: end 215: 216: if params[:employee][:status] == "true" 217<EMAIL_ADDRESS>:status => true) 218: else 219<EMAIL_ADDRESS>:status => false) 220: end 221: 222: @user = User.new 223: @user.first_name = @employee.first_name 224: @user.last_name = @employee.last_name 225: @user.username = @employee.employee_number.to_s 226: @user.password = @employee.employee_number.to_s + "123" 227: @user.role = 'Employee' 228: @user.email = "noreply" + @employee.employee_number.to_s +<EMAIL_ADDRESS>229: @user.save 230: 231: flash[:notice] = "Employee<EMAIL_ADDRESS>record saved" 232: redirect_to :controller =>"employee" ,:action => "admission2", :id => @employee.id 233: end 234: end 235: end
# File app/controllers/employee_controller.rb, line 278 278: def admission2 279: @countries = Country.find(:all) 280: @employee = Employee.find(params[:id]) 281: if request.post? and @employee.update_attributes(params[:employee]) 282: sms_setting = SmsSetting.new() 283: if sms_setting.application_sms_active and sms_setting.employee_sms_active 284: recipient =<EMAIL_ADDRESS>285: message = "Joining Info for<EMAIL_ADDRESS>Username<EMAIL_ADDRESS>Password<EMAIL_ADDRESS>Please change your password after logging in." 286: sms = SmsManager.new(message,recipient) 287: sms.send_sms 288: end 289: flash[:notice] = "address and contact details saved for #{ @employee.first_name}" 290: redirect_to :action => "admission3", :id => @employee.id 291: end 292: end
# File app/controllers/employee_controller.rb, line 312 312: def admission3 313: @employee = Employee.find(params[:id]) 314: @bank_fields = BankField.find(:all, :conditions=>"status = true") 315: if @bank_fields.empty? 316: redirect_to :action => "admission3_1", :id => @employee.id 317: end 318: if request.post? 319: params[:employee_bank_details].each_pair do |k, v| 320: EmployeeBankDetail.create(:employee_id => params[:id], 321: :bank_field_id => k,:bank_info => v['bank_info']) 322: end 323: flash[:notice] = "Bank details saved for<EMAIL_ADDRESS>324: redirect_to :action => "admission3_1", :id => @employee.id 325: end 326: end
# File app/controllers/employee_controller.rb, line 346 346: def admission3_1 347: @employee = Employee.find(params[:id]) 348: @additional_fields = AdditionalField.find(:all, :conditions=>"status = true") 349: if @additional_fields.empty? 350: redirect_to :action => "edit_privilege", :id => @employee.employee_number 351: end 352: if request.post? 353: params[:employee_additional_details].each_pair do |k, v| 354: EmployeeAdditionalDetail.create(:employee_id => params[:id], 355: :additional_field_id => k,:additional_info => v['additional_info']) 356: end 357: flash[:notice] = "Bank details saved for<EMAIL_ADDRESS>358: redirect_to :action => "edit_privilege", :id => @employee.employee_number 359: end 360: end
# File app/controllers/employee_controller.rb, line 392 392: def admission4 393: @departments = EmployeeDepartment.find(:all) 394: @categories = EmployeeCategory.find(:all) 395: @positions = EmployeePosition.find(:all) 396: @grades = EmployeeGrade.find(:all) 397: if request.post? 398: @employee = Employee.find(params[:id]) 399: Employee.update(@employee, :reporting_manager_id => params[:employee][:reporting_manager_id]) 400: flash[:notice]="employee reporting manager saved" 401: redirect_to :controller => "payroll", :action => "manage_payroll"<EMAIL_ADDRESS>402: end 403: 404: end
# File app/controllers/employee_controller.rb, line 1235 1235: def advanced_search 1236: @search = Employee.search(params[:search]) 1237: if params[:search] 1238: if params[:search][:status_equals]=="true" 1239: @search = Employee.search(params[:search]) 1240: @employees1 = @search.all 1241: @employees2 = [] 1242: elsif params[:search][:status_equals]=="false" 1243: @search = ArchivedEmployee.search(params[:search]) 1244: @employees1 = @search.all 1245: @employees2 = [] 1246: else 1247: @search1 = Employee.search(params[:search]).all 1248: @search2 = ArchivedEmployee.search(params[:search]).all 1249: @employees1 = @search1 1250: @employees2 = @search2 1251: end 1252: end 1253: end
# File app/controllers/employee_controller.rb, line 1364 1364: def advanced_search_pdf 1365: @employee_ids2 = params[:result2] 1366: @employee_ids = params[:result] 1367: @searched_for = params[:for] 1368: @status = params[:status] 1369: @employees1 = [] 1370: @employees2 = [] 1371: if params[:status] == 'true' 1372: @employee_ids.each do |s| 1373: employee = Employee.find(s) 1374: @employees1.push employee 1375: end 1376: elsif params[:status] == 'false' 1377: @employee_ids.each do |s| 1378: employee = ArchivedEmployee.find(s) 1379: @employees1.push employee 1380: end 1381: else 1382: @employee_ids.each do |s| 1383: employee = Employee.find(s) 1384: @employees1.push employee 1385: end 1386: unless @employee_ids2.nil? 1387: @employee_ids2.each do |s| 1388: employee = ArchivedEmployee.find(s) 1389: @employees2.push employee 1390: end 1391: end 1392: end 1393: 1394: end
# File app/controllers/employee_controller.rb, line 970 970: def all_employee_leave_applications 971: 972: @employee = Employee.find(params[:id]) 973: @departments = EmployeeDepartment.find(:all, :order=>"name ASC") 974: @employees = [] 975: render :partial=> "all_employee_leave_applications" 976: end
# File app/controllers/employee_controller.rb, line 795 795: def assign_employee 796: @departments = EmployeeDepartment.find(:all) 797: @subject = Subject.find(params[:id1]) 798: @employees = Employee.find_all_by_employee_department_id(Employee.find(params[:id]).employee_department_id) 799: EmployeesSubject.create(:employee_id => params[:id], :subject_id => params[:id1]) 800: @assigned_employee =<EMAIL_ADDRESS>801: render :partial =>"select_department" 802: end
# File app/controllers/employee_controller.rb, line 412 412: def change_reporting_manager 413: @departments = EmployeeDepartment.find(:all) 414: @categories = EmployeeCategory.find(:all) 415: @positions = EmployeePosition.find(:all) 416: @grades = EmployeeGrade.find(:all) 417: @emp = Employee.find(params[:id]) 418: @reporting_manager = Employee.find(@emp.reporting_manager_id).first_name unless @emp.reporting_manager_id.nil? 419: if request.post? 420: @employee = Employee.find(params[:id]) 421: Employee.update(@employee, :reporting_manager_id => params[:employee][:reporting_manager_id]) 422: flash[:notice]="Reporting manager successfully changed" 423: redirect_to :action => "profile"<EMAIL_ADDRESS>424: end 425: end
# File app/controllers/employee_controller.rb, line 1347 1347: def change_to_former 1348: @employee = Employee.find(params[:id]) 1349: if request.post? 1350: flash[:notice]="Successfully deleted employee!" 1351: @employee.archive_employee(params[:remove][:status_description]) 1352: redirect_to :action => "hr" 1353: end 1354: end
# File app/controllers/employee_controller.rb, line 622 622: def create_monthly_payslip 623: @new_payslip_category == [] 624: @employee = Employee.find(params[:id]) 625: @independent_categories = PayrollCategory.find_all_by_payroll_category_id_and_status(nil, true) 626: @dependent_categories = PayrollCategory.find_all_by_status(true, :conditions=>"payroll_category_id != \'\'") 627: @employee_additional_categories =<EMAIL_ADDRESS>:conditions=>"include_every_month = true") 628: @new_payslip_category = IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(@employee.id,nil) 629: @user = current_user 630: privilege = Privilege.find(14) 631: finance_manager = privilege.users 632: subject = " Payslip generated" 633: body = "Payslip has been generated for<EMAIL_ADDRESS><EMAIL_ADDRESS>Kindly approve this request" 634: finance_manager.each do |f| 635<EMAIL_ADDRESS>:recipient=>f.id, :subject=> subject, 636: :body => body, :is_read=>false, :is_deleted_by_sender=>false,:is_deleted_by_recipient=>false) 637: end 638: 639: if request.post? 640: salary_date = Date.parse(params[:salary_date]) 641: start_date = salary_date - ((salary_date.day - 1).days) 642: end_date = start_date + 1.month 643: payslip_exists =<EMAIL_ADDRESS>644: :conditions => ["salary_date >= ? and salary_date < ?", start_date, end_date]) 645: if payslip_exists == [] 646: params[:manage_payroll].each_pair do |k, v| 647: row_id = EmployeeSalaryStructure.find_by_employee_id_and_payroll_category_id(@employee, k) 648: category_name = PayrollCategory.find(k).name 649: unless row_id.nil? 650: MonthlyPayslip.create(:salary_date=>start_date,:employee_id => params[:id], 651: :payroll_category_id => k,:amount => v['amount']) 652: else 653: MonthlyPayslip.create(:salary_date=>start_date,:employee_id => params[:id], 654: :payroll_category_id => k,:amount => v['amount']) 655: end 656: end 657: individual_payslip_category = IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(@employee.id,nil) 658: individual_payslip_category.each do |c| 659: IndividualPayslipCategory.update(c.id, :salary_date=>start_date) 660: end 661: flash[:notice] =<EMAIL_ADDRESS>salary slip generated for #{params[:salary_date]}" 662: redirect_to :controller => "employee", :action => "profile", :id=> @employee.id 663: else #else for if payslip_exists == [] 664: individual_payslips_generated = IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(@employee.id,nil) 665: unless individual_payslips_generated.nil? 666: individual_payslips_generated.each do|i| 667: i.delete 668: end 669: end 670: flash[:notice] =<EMAIL_ADDRESS>salary slip already generated for #{params[:salary_date]}" 671: redirect_to :controller => "employee", :action => "profile", :id=> @employee.id 672: end 673: end 674: 675: end
# File app/controllers/employee_controller.rb, line 593 593: def create_payslip_category 594: @employee=Employee.find(params[:employee_id]) 595: IndividualPayslipCategory.create(:employee_id=>params[:employee_id],:name=>params[:name],:amount=>params[:amount]) 596: @created_category = IndividualPayslipCategory.find_by_employee_id_and_name_and_amount(params[:employee_id],params[:name],params[:amount]) 597: if params[:is_deduction] == nil 598<EMAIL_ADDRESS>:is_deduction=>false) 599: else 600<EMAIL_ADDRESS>:is_deduction=>params[:is_deduction]) 601: end 602: 603: if params[:include_every_month] == nil 604<EMAIL_ADDRESS>:include_every_month=>false) 605: else 606<EMAIL_ADDRESS>:include_every_month=>params[:include_every_month]) 607: end 608: 609: @new_payslip_category = IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(@employee.id,nil) 610: render :partial => "payslip_category_list",:locals => {:emp_id => @employee.id} 611: 612: end
# File app/controllers/employee_controller.rb, line 1356 1356: def delete 1357: employee = Employee.find(params[:id]) 1358: user = User.destroy_all(:username => employee.employee_number) unless user.nil? 1359: Employee.destroy(params[:id]) 1360: flash[:notice] = "All records have been deleted for employee with employee no. #{employee.employee_number}." 1361: redirect_to :controller => 'user', :action => 'dashboard' 1362: end
# File app/controllers/employee_controller.rb, line 177 177: def delete_additional_details 178: employees = EmployeeAdditionalDetail.find(:all ,:conditions=>"additional_field_id = #{params[:id]}") 179: if employees.empty? 180: AdditionalField.find(params[:id]).destroy 181: @additional_details = AdditionalField.find(:all) 182: flash[:notice]="Successfully deleted!" 183: redirect_to :action => "add_additional_details" 184: else 185: flash[:notice]="Unable to delete!" 186: redirect_to :action => "add_additional_details" 187: end 188: end
# File app/controllers/employee_controller.rb, line 148 148: def delete_bank_details 149: employees = EmployeeBankDetail.find(:all ,:conditions=>"bank_field_id = #{params[:id]}") 150: if employees.empty? 151: BankField.find(params[:id]).destroy 152: @bank_details = BankField.find(:all) 153: flash[:notice]="Successfully deleted!" 154: redirect_to :action => "add_bank_details" 155: else 156: flash[:notice]="Unable to delete!" 157: redirect_to :action => "add_bank_details" 158: end 159: end
# File app/controllers/employee_controller.rb, line 24 24: def delete_category 25: employees = Employee.find(:all ,:conditions=>"employee_category_id = #{params[:id]}") 26: category_position = EmployeePosition.find(:all, :conditions=>"employee_category_id = #{params[:id]}") 27: if employees.empty? and category_position.empty? 28: EmployeeCategory.find(params[:id]).destroy 29: @categories = EmployeeCategory.find :all 30: flash[:notice]="Successfully deleted!" 31: redirect_to :action => "add_category" 32: else 33: flash[:notice]="Unable to delete!" 34: redirect_to :action => "add_category" 35: end 36: end
# File app/controllers/employee_controller.rb, line 89 89: def delete_department 90: employees = Employee.find(:all ,:conditions=>"employee_department_id = #{params[:id]}") 91: if employees.empty? 92: EmployeeDepartment.find(params[:id]).destroy 93: @departments = EmployeeDepartment.find :all 94: flash[:notice]="Successfully deleted!" 95: redirect_to :action => "add_department" 96: else 97: flash[:notice]="Unable to delete!" 98: redirect_to :action => "add_department" 99: end 100: end
# File app/controllers/employee_controller.rb, line 119 119: def delete_grade 120: employees = Employee.find(:all ,:conditions=>"employee_grade_id = #{params[:id]}") 121: if employees.empty? 122: EmployeeGrade.find(params[:id]).destroy 123: @grades = EmployeeGrade.find :all 124: flash[:notice]="Successfully deleted!" 125: redirect_to :action => "add_grade" 126: else 127: flash[:notice]="Unable to delete!" 128: redirect_to :action => "add_grade" 129: end 130: end
# File app/controllers/employee_controller.rb, line 738 738: def delete_payslip 739: @individual_payslip_category=IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(params[:id],params[:id2]) 740: @individual_payslip_category.each do |pc| 741: pc.destroy 742: end 743: @monthly_payslip = MonthlyPayslip.find_all_by_employee_id_and_salary_date(params[:id], params[:id2]) 744: @monthly_payslip.each do |m| 745: m.destroy 746: end 747: flash[:notice]= "Payslip deleted for #{params[:id2]}" 748: redirect_to :controller=>"employee", :action=>"profile", :id=>params[:id] 749: end
# File app/controllers/employee_controller.rb, line 58 58: def delete_position 59: employees = Employee.find(:all ,:conditions=>"employee_position_id = #{params[:id]}") 60: 61: if employees.empty? 62: EmployeePosition.find(params[:id]).destroy 63: @positions = EmployeePosition.find :all 64: flash[:notice]="Successfully deleted!" 65: redirect_to :action => "add_position" 66: else 67: flash[:notice]="Unable to delete!" 68: redirect_to :action => "add_position" 69: end 70: end
# File app/controllers/employee_controller.rb, line 1004 1004: def department_payslip 1005: @departments = EmployeeDepartment.find(:all, :conditions=>"status = true", :order=> "name ASC") 1006: @salary_dates = MonthlyPayslip.find(:all, :conditions=>"is_approved = true",:select => "distinct salary_date") 1007: end
PDF methods
# File app/controllers/employee_controller.rb, line 1073 1073: def department_payslip_pdf 1074: @department = EmployeeDepartment.find(params[:department]) 1075: @employees =<EMAIL_ADDRESS>1076: 1077: 1078: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 1079: @salary_date = params[:salary_date] if params[:salary_date] 1080: 1081: # @monthly_payslips = MonthlyPayslip.find_all_by_salary_date(@salary_date, 1082: # :conditions=> "employee_id<EMAIL_ADDRESS>1083: # :order=> "payroll_category_id ASC") 1084: # 1085: # @individual_payslip_category = IndividualPayslipCategory.find_all_by_salary_date(@salary_date, 1086: # :conditions=>"employee_id<EMAIL_ADDRESS>1087: # :order=>"id ASC") 1088: # @individual_category_non_deductionable = 0 1089: # @individual_category_deductionable = 0 1090: # @individual_payslip_category.each do |pc| 1091: # unless pc.is_deduction == true 1092: # @individual_category_non_deductionable = @individual_category_non_deductionable + pc.amount.to_i 1093: # end 1094: # end 1095: # 1096: # @individual_payslip_category.each do |pc| 1097: # unless pc.is_deduction == false 1098: # @individual_category_deductionable = @individual_category_deductionable + pc.amount.to_i 1099: # end 1100: # end 1101: # 1102: # @non_deductionable_amount = 0 1103: # @deductionable_amount = 0 1104: # @monthly_payslips.each do |mp| 1105: # category1 = PayrollCategory.find(mp.payroll_category_id) 1106: # unless category1.is_deduction == true 1107: # @non_deductionable_amount = @non_deductionable_amount + mp.amount.to_i 1108: # end 1109: # end 1110: # 1111: # @monthly_payslips.each do |mp| 1112: # category2 = PayrollCategory.find(mp.payroll_category_id) 1113: # unless category2.is_deduction == false 1114: # @deductionable_amount = @deductionable_amount + mp.amount.to_i 1115: # end 1116: # end 1117: # 1118: # @net_non_deductionable_amount = @individual_category_non_deductionable + @non_deductionable_amount 1119: # @net_deductionable_amount = @individual_category_deductionable + @deductionable_amount 1120: # 1121: # @net_amount = @net_non_deductionable_amount - @net_deductionable_amount 1122: respond_to do |format| 1123: format.pdf { render :layout => false } 1124: end 1125: end
# File app/controllers/employee_controller.rb, line 1316 1316: def dob_equal_to_update 1317: year = params[:year] 1318: @start_date = "#{year}-01-01".to_date 1319: @end_date = "#{year}-12-31".to_date 1320: render :update do |page| 1321: page.replace_html 'dob_year_hidden', :partial=>"equal_to_dob_select" 1322: end 1323: end
# File app/controllers/employee_controller.rb, line 1334 1334: def dob_greater_than_update 1335: year = params[:year] 1336: @start_date = "2100-01-01".to_date 1337: @end_date = "#{year}-12-31".to_date 1338: render :update do |page| 1339: page.replace_html 'dob_year_hidden', :partial=>"greater_than_dob_select" 1340: end 1341: end
# File app/controllers/employee_controller.rb, line 1325 1325: def dob_less_than_update 1326: year = params[:year] 1327: @start_date = "1900-01-01".to_date 1328: @end_date = "#{year}-01-01".to_date 1329: render :update do |page| 1330: page.replace_html 'dob_year_hidden', :partial=>"less_than_dob_select" 1331: end 1332: end
# File app/controllers/employee_controller.rb, line 1272 1272: def doj_equal_to_update 1273: year = params[:year] 1274: @start_date = "#{year}-01-01".to_date 1275: @end_date = "#{year}-12-31".to_date 1276: render :update do |page| 1277: page.replace_html 'doj_year_hidden', :partial=>"equal_to_doj_select" 1278: end 1279: end
# File app/controllers/employee_controller.rb, line 1290 1290: def doj_greater_than_update 1291: year = params[:year] 1292: @start_date = "2100-01-01".to_date 1293: @end_date = "#{year}-12-31".to_date 1294: render :update do |page| 1295: page.replace_html 'doj_year_hidden', :partial=>"greater_than_doj_select" 1296: end 1297: end
# File app/controllers/employee_controller.rb, line 1281 1281: def doj_less_than_update 1282: year = params[:year] 1283: @start_date = "1900-01-01".to_date 1284: @end_date = "#{year}-01-01".to_date 1285: render :update do |page| 1286: page.replace_html 'doj_year_hidden', :partial=>"less_than_doj_select" 1287: end 1288: end
# File app/controllers/employee_controller.rb, line 245 245: def edit1 246: @categories = EmployeeCategory.find(:all,:order => "name asc") 247: @positions = EmployeePosition.find(:all) 248: @grades = EmployeeGrade.find(:all,:order => "name asc") 249: @departments = EmployeeDepartment.find(:all,:order => "name asc") 250: @employee = Employee.find(params[:id]) 251: if request.post? and @employee.update_attributes(params[:employee]) 252: if params[:employee][:gender] == "true" 253<EMAIL_ADDRESS>:gender => true) 254: else 255<EMAIL_ADDRESS>:gender => false) 256: end 257: 258: if params[:employee][:status] == "true" 259<EMAIL_ADDRESS>:status => true) 260: else 261<EMAIL_ADDRESS>:status => false) 262: end 263: 264: flash[:notice] = "Employee<EMAIL_ADDRESS>general information updated" 265: redirect_to :controller =>"employee" ,:action => "profile", :id => @employee.id 266: end 267: end
# File app/controllers/employee_controller.rb, line 294 294: def edit2 295: @employee = Employee.find(params[:id]) 296: @countries = Country.find(:all) 297: if request.post? and @employee.update_attributes(params[:employee]) 298: flash[:notice] = "Employee address details saved for #{ @employee.first_name}" 299: redirect_to :action => "profile", :id => @employee.id 300: end 301: end
# File app/controllers/employee_controller.rb, line 328 328: def edit3 329: @employee = Employee.find(params[:id]) 330: @bank_fields = BankField.find(:all, :conditions=>"status = true") 331: if request.post? 332: params[:employee_bank_details].each_pair do |k, v| 333: row_id= EmployeeBankDetail.find_by_employee_id_and_bank_field_id(@employee.id,k) 334: unless row_id.nil? 335: bank_detail = EmployeeBankDetail.find_by_employee_id_and_bank_field_id(@employee.id,k) 336: EmployeeBankDetail.update(bank_detail.id,:bank_info => v['bank_info']) 337: else 338: EmployeeBankDetail.create(:employee_id=>@employee.id,:bank_field_id=>k,:bank_info=>v['bank_info']) 339: end 340: end 341: flash[:notice] = "Employee<EMAIL_ADDRESS>bank details updated" 342: redirect_to :action => "profile", :id => @employee.id 343: end 344: end
# File app/controllers/employee_controller.rb, line 374 374: def edit3_1 375: @employee = Employee.find(params[:id]) 376: @additional_fields = AdditionalField.find(:all, :conditions=>"status = true") 377: if request.post? 378: params[:employee_additional_details].each_pair do |k, v| 379: row_id= EmployeeAdditionalDetail.find_by_employee_id_and_additional_field_id(@employee.id,k) 380: unless row_id.nil? 381: additional_detail = EmployeeAdditionalDetail.find_by_employee_id_and_additional_field_id(@employee.id,k) 382: EmployeeAdditionalDetail.update(additional_detail.id,:additional_info => v['additional_info']) 383: else 384: EmployeeAdditionalDetail.create(:employee_id=>@employee.id,:additional_field_id=>k,:additional_info=>v['additional_info']) 385: end 386: end 387: flash[:notice] = "Employee<EMAIL_ADDRESS>additional details updated" 388: redirect_to :action => "profile", :id => @employee.id 389: end 390: end
# File app/controllers/employee_controller.rb, line 170 170: def edit_additional_details 171: @additional_details = AdditionalField.find(params[:id]) 172: if request.post? and @additional_details.update_attributes(params[:additional_details]) 173: flash[:notice] = "Additional details updated" 174: redirect_to :action => "add_additional_details" 175: end 176: end
# File app/controllers/employee_controller.rb, line 141 141: def edit_bank_details 142: @bank_details = BankField.find(params[:id]) 143: if request.post? and @bank_details.update_attributes(params[:bank_details]) 144: flash[:notice] = "Bank details updated" 145: redirect_to :action => "add_bank_details" 146: end 147: end
# File app/controllers/employee_controller.rb, line 16 16: def edit_category 17: @category = EmployeeCategory.find(params[:id]) 18: if request.post? and @category.update_attributes(params[:category]) 19: flash[:notice] = "Employee category updated" 20: redirect_to :action => "add_category" 21: end 22: end
# File app/controllers/employee_controller.rb, line 303 303: def edit_contact 304: @employee = Employee.find(params[:id]) 305: if request.post? and @employee.update_attributes(params[:employee]) 306: flash[:notice] = "Employee contact details saved for #{ @employee.first_name}" 307: redirect_to :action => "profile", :id => @employee.id 308: end 309: end
# File app/controllers/employee_controller.rb, line 81 81: def edit_department 82: @department = EmployeeDepartment.find(params[:id]) 83: if request.post? and @department.update_attributes(params[:department]) 84: flash[:notice] = "Employee department updated" 85: redirect_to :action => "add_department" 86: end 87: end
# File app/controllers/employee_controller.rb, line 111 111: def edit_grade 112: @grade = EmployeeGrade.find(params[:id]) 113: if request.post? and @grade.update_attributes(params[:grade]) 114: flash[:notice] = "Employee grade updated" 115: redirect_to :action => "add_grade" 116: end 117: end
# File app/controllers/employee_controller.rb, line 269 269: def edit_personal 270: @nationalities = Country.all 271: @employee = Employee.find(params[:id]) 272: if request.post? and @employee.update_attributes(params[:employee]) 273: flash[:notice] = "Employee<EMAIL_ADDRESS>personal information updated" 274: redirect_to :controller =>"employee" ,:action => "profile", :id => @employee.id 275: end 276: end
# File app/controllers/employee_controller.rb, line 48 48: def edit_position 49: @categories = EmployeeCategory.find(:all) 50: @position = EmployeePosition.find(params[:id]) 51: if request.post? and @position.update_attributes(params[:position]) 52: flash[:notice] = "Employee position updated" 53: redirect_to :action => "add_position" 54: end 55: 56: end
# File app/controllers/employee_controller.rb, line 362 362: def edit_privilege 363: @privileges = Privilege.find(:all) 364: @user = User.find_by_username(params[:id]) 365: @employee =<EMAIL_ADDRESS>366: if request.post? 367: new_privileges = params[:user][:privilege_ids] if params[:user] 368: new_privileges ||= [] 369: @user.privileges = Privilege.find_all_by_id(new_privileges) 370: redirect_to :action => 'admission4',:id => @employee.id 371: end 372: end
# File app/controllers/employee_controller.rb, line 1181 1181: def employee_individual_payslip_pdf 1182: @employee = Employee.find(params[:id]) 1183: @department = EmployeeDepartment.find(@employee.employee_department_id).name 1184: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 1185: @category = EmployeeCategory.find(@employee.employee_category_id).name 1186: @grade = EmployeeGrade.find(@employee.employee_grade_id).name 1187: @position = EmployeePosition.find(@employee.employee_position_id).name 1188: @salary_date = Date.parse(params[:id2]) 1189: @monthly_payslips = MonthlyPayslip.find_all_by_salary_date(@salary_date, 1190: :conditions=> "employee_id<EMAIL_ADDRESS>1191: :order=> "payroll_category_id ASC") 1192: 1193: @individual_payslip_category = IndividualPayslipCategory.find_all_by_salary_date(@salary_date, 1194: :conditions=>"employee_id<EMAIL_ADDRESS>1195: :order=>"id ASC") 1196: @individual_category_non_deductionable = 0 1197: @individual_category_deductionable = 0 1198: @individual_payslip_category.each do |pc| 1199: unless pc.is_deduction == true 1200: @individual_category_non_deductionable = @individual_category_non_deductionable + pc.amount.to_i 1201: end 1202: end 1203: 1204: @individual_payslip_category.each do |pc| 1205: unless pc.is_deduction == false 1206: @individual_category_deductionable = @individual_category_deductionable + pc.amount.to_i 1207: end 1208: end 1209: 1210: @non_deductionable_amount = 0 1211: @deductionable_amount = 0 1212: @monthly_payslips.each do |mp| 1213: category1 = PayrollCategory.find(mp.payroll_category_id) 1214: unless category1.is_deduction == true 1215: @non_deductionable_amount = @non_deductionable_amount + mp.amount.to_i 1216: end 1217: end 1218: 1219: @monthly_payslips.each do |mp| 1220: category2 = PayrollCategory.find(mp.payroll_category_id) 1221: unless category2.is_deduction == false 1222: @deductionable_amount = @deductionable_amount + mp.amount.to_i 1223: end 1224: end 1225: 1226: @net_non_deductionable_amount = @individual_category_non_deductionable + @non_deductionable_amount 1227: @net_deductionable_amount = @individual_category_deductionable + @deductionable_amount 1228: 1229: @net_amount = @net_non_deductionable_amount - @net_deductionable_amount 1230: 1231: respond_to do |format| 1232: format.pdf { render :layout => false } 1233: end 1234: end
# File app/controllers/employee_controller.rb, line 574 574: def employees_list 575: department_id = params[:department_id] 576: @employees = Employee.find_all_by_employee_department_id(department_id) 577: 578: render :update do |page| 579: page.replace_html 'employee_list', :partial => 'employee_view_all_list', :object => @employees 580: end 581: end
HR Management special methods…
# File app/controllers/employee_controller.rb, line 835 835: def hr 836: user = current_user 837: @employee = Employee.find_by_employee_number(user.username) 838: end
# File app/controllers/employee_controller.rb, line 1127 1127: def individual_payslip_pdf 1128: @employee = Employee.find(params[:id]) 1129: @department = EmployeeDepartment.find(@employee.employee_department_id).name 1130: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 1131: @category = EmployeeCategory.find(@employee.employee_category_id).name 1132: @grade = EmployeeGrade.find(@employee.employee_grade_id).name 1133: @position = EmployeePosition.find(@employee.employee_position_id).name 1134: @salary_date = Date.parse(params[:id2]) 1135: @monthly_payslips = MonthlyPayslip.find_all_by_salary_date(@salary_date, 1136: :conditions=> "employee_id<EMAIL_ADDRESS>1137: :order=> "payroll_category_id ASC") 1138: 1139: @individual_payslip_category = IndividualPayslipCategory.find_all_by_salary_date(@salary_date, 1140: :conditions=>"employee_id<EMAIL_ADDRESS>1141: :order=>"id ASC") 1142: @individual_category_non_deductionable = 0 1143: @individual_category_deductionable = 0 1144: @individual_payslip_category.each do |pc| 1145: unless pc.is_deduction == true 1146: @individual_category_non_deductionable = @individual_category_non_deductionable + pc.amount.to_i 1147: end 1148: end 1149: 1150: @individual_payslip_category.each do |pc| 1151: unless pc.is_deduction == false 1152: @individual_category_deductionable = @individual_category_deductionable + pc.amount.to_i 1153: end 1154: end 1155: 1156: @non_deductionable_amount = 0 1157: @deductionable_amount = 0 1158: @monthly_payslips.each do |mp| 1159: category1 = PayrollCategory.find(mp.payroll_category_id) 1160: unless category1.is_deduction == true 1161: @non_deductionable_amount = @non_deductionable_amount + mp.amount.to_i 1162: end 1163: end 1164: 1165: @monthly_payslips.each do |mp| 1166: category2 = PayrollCategory.find(mp.payroll_category_id) 1167: unless category2.is_deduction == false 1168: @deductionable_amount = @deductionable_amount + mp.amount.to_i 1169: end 1170: end 1171: 1172: @net_non_deductionable_amount = @individual_category_non_deductionable + @non_deductionable_amount 1173: @net_deductionable_amount = @individual_category_deductionable + @deductionable_amount 1174: 1175: @net_amount = @net_non_deductionable_amount - @net_deductionable_amount 1176: 1177: respond_to do |format| 1178: format.pdf { render :layout => false } 1179: end 1180: end
# File app/controllers/employee_controller.rb, line 988 988: def leave_list 989: if params[:employee_id] == "" 990: render :update do |page| 991: page.replace_html "leave-list", :text => "none" 992: end 993: return 994: end 995: @employee = params[:emp_id] 996: @pending_applied_leaves = ApplyLeave.find_all_by_employee_id(params[:employee_id], :conditions=> "approved = false AND viewed_by_manager = false", :order=>"start_date DESC") 997: @applied_leaves = ApplyLeave.find_all_by_employee_id(params[:employee_id], :conditions=> "viewed_by_manager = true", :order=>"start_date DESC") 998: @all_leave_applications = ApplyLeave.find_all_by_employee_id(params[:employee_id]) 999: render :update do |page| 1000: page.replace_html "leave-list", :partial => "leave_list" 1001: end 1002: end
# File app/controllers/employee_controller.rb, line 940 940: def leave_management 941: user = current_user 942: @employee = Employee.find_by_employee_number(user.username) 943: @all_employee = Employee.find(:all) 944: @reporting_employees =<EMAIL_ADDRESS>945: @leave_types = EmployeeLeaveType.find(:all) 946: @total_leave_count = 0 947: @reporting_employees.each do |e| 948: @app_leaves = ApplyLeave.count(:conditions=>["employee_id =? AND viewed_by_manager =?", e.id, false]) 949: @total_leave_count = @total_leave_count + @app_leaves 950: end 951: @all_employee_total_leave_count = 0 952: @all_employee.each do |a| 953: @all_emp_app_leaves = ApplyLeave.count(:conditions=>["employee_id =? AND viewed_by_manager =?" , a.id, false]) 954: @all_employee_total_leave_count = @all_employee_total_leave_count + @all_emp_app_leaves 955: end 956: 957: @leave_apply = ApplyLeave.new(params[:leave_apply]) 958: if request.post? and @leave_apply.save 959: ApplyLeave.update(@leave_apply, :approved=> false, :viewed_by_manager=> false) 960: if params[:is_half_day] 961: ApplyLeave.update(@leave_apply, :is_half_day=> true) 962: else 963: ApplyLeave.update(@leave_apply, :is_half_day=> false) 964: end 965: flash[:notice]="Leave application created" 966: redirect_to :controller => "employee", :action=> "leave_management"<EMAIL_ADDRESS>967: end 968: end
# File app/controllers/employee_controller.rb, line 1299 1299: def list_dob_year 1300: dob_option = params[:dob_option] 1301: if dob_option == "equal to" 1302: render :update do |page| 1303: page.replace_html 'dob_year', :partial=>"equal_to_select_dob" 1304: end 1305: elsif dob_option == "less than" 1306: render :update do |page| 1307: page.replace_html 'dob_year', :partial=>"less_than_select_dob" 1308: end 1309: else 1310: render :update do |page| 1311: page.replace_html 'dob_year', :partial=>"greater_than_select_dob" 1312: end 1313: end 1314: end
# File app/controllers/employee_controller.rb, line 1255 1255: def list_doj_year 1256: doj_option = params[:doj_option] 1257: if doj_option == "equal to" 1258: render :update do |page| 1259: page.replace_html 'doj_year', :partial=>"equal_to_select" 1260: end 1261: elsif doj_option == "less than" 1262: render :update do |page| 1263: page.replace_html 'doj_year', :partial=>"less_than_select" 1264: end 1265: else 1266: render :update do |page| 1267: page.replace_html 'doj_year', :partial=>"greater_than_select" 1268: end 1269: end 1270: end
# File app/controllers/employee_controller.rb, line 1401 1401: def one_click_approve 1402: @dates = MonthlyPayslip.find_all_by_salary_date(params[:salary_date],:conditions => ["is_approved = false"]) 1403: @salary_date = params[:salary_date] 1404: render :update do |page| 1405: page.replace_html "approve",:partial=> "one_click_approve" 1406: end 1407: end
# File app/controllers/employee_controller.rb, line 1409 1409: def one_click_approve_submit 1410: dates = MonthlyPayslip.find_all_by_salary_date(Date.parse(params[:date])) 1411: 1412: dates.each do |d| 1413: d.approve(current_user.id) 1414: end 1415: flash[:notice] = 'Payslip has been approved' 1416: redirect_to :action => "hr" 1417: 1418: end
# File app/controllers/employee_controller.rb, line 858 858: def one_click_payslip_generation 859: 860: @user = current_user 861: finance_manager = find_finance_managers 862: finance = Configuration.find_by_config_value("Finance") 863: subject = " Payslip generated" 864: body = "Payslip has been generated for the particular month. Kindly approve this request" 865: salary_date = Date.parse(params[:salary_date]) 866: start_date = salary_date - ((salary_date.day - 1).days) 867: end_date = start_date + 1.month 868: employees = Employee.find(:all) 869: unless(finance_manager.nil? and finance.nil?) 870: finance_manager.each do |f| 871<EMAIL_ADDRESS>:recipient=>f.id, :subject=> subject, 872: :body => body, :is_read=>false, :is_deleted_by_sender=>false,:is_deleted_by_recipient=>false) 873: end 874: employees.each do|e| 875: payslip_exists = MonthlyPayslip.find_all_by_employee_id(e.id, 876: :conditions => ["salary_date >= ? and salary_date < ?", start_date, end_date]) 877: if payslip_exists == [] 878: salary_structure = EmployeeSalaryStructure.find_all_by_employee_id(e.id) 879: unless salary_structure == [] 880: salary_structure.each do |ss| 881: MonthlyPayslip.create(:salary_date=>start_date, 882: :employee_id=>e.id, 883: :payroll_category_id=>ss.payroll_category_id, 884: :amount=>ss.amount,:is_approved => false,:approver => nil) 885: end 886: end 887: end 888: end 889: else 890: employees.each do|e| 891: payslip_exists = MonthlyPayslip.find_all_by_employee_id(e.id, 892: :conditions => ["salary_date >= ? and salary_date < ?", start_date, end_date]) 893: if payslip_exists == [] 894: salary_structure = EmployeeSalaryStructure.find_all_by_employee_id(e.id) 895: unless salary_structure == [] 896: salary_structure.each do |ss| 897: MonthlyPayslip.create(:salary_date=>start_date, 898: :employee_id=>e.id, 899: :payroll_category_id=>ss.payroll_category_id, 900: :amount=>ss.amount,:is_approved => true,:approver => @user.id) 901: end 902: end 903: end 904: end 905: end 906: render :text => "<p>Salary slip generated for the month: #{salary_date.strftime("%B")}.<br/><b>NOTE:</b> Employees whose salary was generated manually, their salary slip was not generated by this process.</p>" 907: end
# File app/controllers/employee_controller.rb, line 914 914: def one_click_payslip_revert 915: unless params[:one_click_payslip][:salary_date] == "" 916: salary_date = Date.parse(params[:one_click_payslip][:salary_date]) 917: start_date = salary_date - ((salary_date.day - 1).days) 918: end_date = start_date + 1.month 919: employees = Employee.find(:all) 920: employees.each do|e| 921: payslip_record = MonthlyPayslip.find_all_by_employee_id(e.id, 922: :conditions => ["salary_date >= ? and salary_date < ?", start_date, end_date]) 923: payslip_record.each do |pr| 924: pr.destroy 925: end 926: individual_payslip_record = IndividualPayslipCategory.find_all_by_employee_id(e.id, 927: :conditions => ["salary_date >= ? and salary_date < ?", start_date, end_date]) 928: unless individual_payslip_record.nil? 929: individual_payslip_record.each do|ipr| 930: ipr.destroy 931: end 932: end 933: end 934: render :text=> "<p>Salary slip reverted for the month: #{salary_date.strftime("%B")}.</p>" 935: else 936: render :text=>"<p>Please select a month...</p>" 937: end 938: end
# File app/controllers/employee_controller.rb, line 1397 1397: def payslip_approve 1398: @salary_dates = MonthlyPayslip.find(:all, :select => "distinct salary_date") 1399: end
# File app/controllers/employee_controller.rb, line 854 854: def payslip_date_select 855: render :partial=>"one_click_payslip_date" 856: end
# File app/controllers/employee_controller.rb, line 909 909: def payslip_revert_date_select 910: @salary_dates = MonthlyPayslip.find(:all, :select => "distinct salary_date") 911: render :partial=>"one_click_payslip_revert_date" 912: end
# File app/controllers/employee_controller.rb, line 469 469: def profile 470: @current_user = current_user 471: @employee = Employee.find(params[:id]) 472: @new_reminder_count =<EMAIL_ADDRESS>:conditions=>"is_read = false") 473: @gender = "Male" 474: @gender = "Female" if @employee.gender == false 475: @status = "Active" 476: @status = "Inactive" if @employee.status == false 477: @reporting_manager = Employee.find(@employee.reporting_manager_id).first_name unless @employee.reporting_manager_id.nil? 478: exp_years = @employee.experience_year 479: exp_months = @employee.experience_month 480: date = Date.today 481: total_current_exp_days = (date-@employee.joining_date).to_i 482: current_years = total_current_exp_days/365 483: rem = total_current_exp_days%365 484: current_months = rem/30 485: @total_years = exp_years+current_years unless exp_years.nil? 486: @total_months = exp_months+current_months unless exp_months.nil? 487: end
# File app/controllers/employee_controller.rb, line 531 531: def profile_additional_details 532: @employee = Employee.find(params[:id]) 533: @additional_details =<EMAIL_ADDRESS>534: render :partial => "additional_details" 535: end
# File app/controllers/employee_controller.rb, line 513 513: def profile_address 514: @employee = Employee.find(params[:id]) 515: @home_country = Country.find(@employee.home_country_id).name unless @employee.home_country_id.nil? 516: @office_country = Country.find(@employee.office_country_id).name unless @employee.office_country_id.nil? 517: render :partial => "address" 518: end
# File app/controllers/employee_controller.rb, line 525 525: def profile_bank_details 526: @employee = Employee.find(params[:id]) 527: @bank_details =<EMAIL_ADDRESS>528: render :partial => "bank_details" 529: end
# File app/controllers/employee_controller.rb, line 520 520: def profile_contact 521: @employee = Employee.find(params[:id]) 522: render :partial => "contact" 523: end
# File app/controllers/employee_controller.rb, line 489 489: def profile_general 490: @employee = Employee.find(params[:id]) 491: @gender = "Male" 492: @gender = "Female" if @employee.gender == false 493: @status = "Active" 494: @status = "Inactive" if @employee.status == false 495: @reporting_manager = Employee.find(@employee.reporting_manager_id).first_name unless @employee.reporting_manager_id.nil? 496: exp_years = @employee.experience_year 497: exp_months = @employee.experience_month 498: date = Date.today 499: total_current_exp_days = (date-@employee.joining_date).to_i 500: current_years = total_current_exp_days/365 501: rem = total_current_exp_days%365 502: current_months = rem/30 503: @total_years = exp_years+current_years unless exp_years.nil? 504: @total_months = exp_months+current_months unless exp_months.nil? 505: render :partial => "general" 506: end
# File app/controllers/employee_controller.rb, line 538 538: def profile_payroll_details 539: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 540: @employee = Employee.find(params[:id]) 541: @payroll_details = EmployeeSalaryStructure.find_all_by_employee_id(@employee, :order=>"payroll_category_id ASC") 542: render :partial => "payroll_details" 543: end
# File app/controllers/employee_controller.rb, line 545 545: def profile_pdf 546: @employee = Employee.find(params[:id]) 547: @gender = "Male" 548: @gender = "Female" if @employee.gender == false 549: @status = "Active" 550: @status = "Inactive" if @employee.status == false 551: @reporting_manager = Employee.find(@employee.reporting_manager_id).first_name unless @employee.reporting_manager_id.nil? 552: exp_years = @employee.experience_year 553: exp_months = @employee.experience_month 554: date = Date.today 555: total_current_exp_days = (date-@employee.joining_date).to_i 556: current_years = total_current_exp_days/365 557: rem = total_current_exp_days%365 558: current_months = rem/30 559: @total_years = exp_years+current_years unless exp_years.nil? 560: @total_months = exp_months+current_months unless exp_months.nil? 561: @home_country = Country.find(@employee.home_country_id).name unless @employee.home_country_id.nil? 562: @office_country = Country.find(@employee.office_country_id).name unless @employee.office_country_id.nil? 563: @bank_details =<EMAIL_ADDRESS>564: @additional_details =<EMAIL_ADDRESS>565: respond_to do |format| 566: format.pdf { render :layout => false } 567: end 568: end
# File app/controllers/employee_controller.rb, line 508 508: def profile_personal 509: @employee = Employee.find(params[:id]) 510: render :partial => "personal" 511: end
# File app/controllers/employee_controller.rb, line 1343 1343: def remove 1344: @employee = Employee.find(params[:id]) 1345: end
# File app/controllers/employee_controller.rb, line 804 804: def remove_employee 805: @departments = EmployeeDepartment.find(:all) 806: @subject = Subject.find(params[:id1]) 807: @employees = Employee.find_all_by_employee_department_id(Employee.find(params[:id]).employee_department_id) 808: EmployeesSubject.find_by_employee_id_and_subject_id(params[:id], params[:id1]).destroy 809: @assigned_employee =<EMAIL_ADDRESS>810: render :partial =>"select_department" 811: end
# File app/controllers/employee_controller.rb, line 614 614: def remove_new_paylist_category 615: removal_category = IndividualPayslipCategory.find(params[:id]) 616: employee = removal_category.employee_id 617: removal_category.destroy 618: @new_payslip_category = IndividualPayslipCategory.find_all_by_employee_id_and_salary_date(employee,nil) 619: render :partial => "list_payslip_category" 620: end
# File app/controllers/employee_controller.rb, line 432 432: def search 433: @departments = EmployeeDepartment.find(:all) 434: @categories = EmployeeCategory.find(:all) 435: @positions = EmployeePosition.find(:all) 436: @grades = EmployeeGrade.find(:all) 437: end
# File app/controllers/employee_controller.rb, line 439 439: def search_ajax 440: other_conditions = "" 441: other_conditions += " AND employee_department_id = '#{params[:employee_department_id]}'" unless params[:employee_department_id] == "" 442: other_conditions += " AND employee_category_id = '#{params[:employee_category_id]}'" unless params[:employee_category_id] == "" 443: other_conditions += " AND employee_position_id = '#{params[:employee_position_id]}'" unless params[:employee_position_id] == "" 444: other_conditions += " AND employee_grade_id = '#{params[:employee_grade_id]}'" unless params[:employee_grade_id] == "" 445: @employee = Employee.find(:all, 446: :conditions => "(first_name LIKE \"#{params[:query]}%\" 447: OR middle_name LIKE \"#{params[:query]}%\" 448: OR last_name LIKE \"#{params[:query]}%\" 449: OR (concat(first_name, \" \", last_name) LIKE \"#{params[:query]}%\"))" + other_conditions, 450: :order => "first_name asc") unless params[:query] == '' 451: render :layout => false 452: end
# File app/controllers/employee_controller.rb, line 778 778: def select_department 779: @subject = Subject.find(params[:subject_id]) 780: @assigned_employee =<EMAIL_ADDRESS>781: @departments = EmployeeDepartment.find(:all) 782: render :update do |page| 783: page.replace_html 'department-select', :partial => 'select_department' 784: end 785: end
# File app/controllers/employee_controller.rb, line 840 840: def select_department_employee 841: @departments = EmployeeDepartment.find(:all, :order=>"name ASC") 842: @employees = [] 843: end
# File app/controllers/employee_controller.rb, line 454 454: def select_reporting_manager 455: other_conditions = "" 456: other_conditions += " AND employee_department_id = '#{params[:employee_department_id]}'" unless params[:employee_department_id] == "" 457: other_conditions += " AND employee_category_id = '#{params[:employee_category_id]}'" unless params[:employee_category_id] == "" 458: other_conditions += " AND employee_position_id = '#{params[:employee_position_id]}'" unless params[:employee_position_id] == "" 459: other_conditions += " AND employee_grade_id = '#{params[:employee_grade_id]}'" unless params[:employee_grade_id] == "" 460: @employee = Employee.find(:all, 461: :conditions => "(first_name LIKE \"#{params[:query]}%\" 462: OR middle_name LIKE \"#{params[:query]}%\" 463: OR last_name LIKE \"#{params[:query]}%\" 464: OR (concat(first_name, \" \", last_name) LIKE \"#{params[:query]}%\"))" + other_conditions, 465: :order => "first_name asc") unless params[:query] == '' 466: render :layout => false 467: end
# File app/controllers/employee_controller.rb, line 583 583: def show 584: @employee = Employee.find(params[:id]) 585<EMAIL_ADDRESS>:type => @employee.photo_content_type, :filename => @employee.photo_filename, :disposition => 'inline') 586: end
# File app/controllers/employee_controller.rb, line 764 764: def subject_assignment 765: @batches = Batch.active 766: @subjects = [] 767: end
# File app/controllers/employee_controller.rb, line 813 813: def timetable 814: @employee = Employee.find(params[:id]) 815: @tte = TimetableEntry.find_all_by_employee_id(params[:id]) 816: @timetable =<EMAIL_ADDRESS>817: @period_timing = ClassTiming.find(:all, :conditions => "is_break = false") 818: @day = Weekday.all(:select => "DISTINCT(weekday)") 819: @weekday = ["Sun", "Mon", "Tue","Wed", "Thu", "Fri", "Sat"] 820: end
# File app/controllers/employee_controller.rb, line 822 822: def timetable_pdf 823: @employee = Employee.find(params[:id]) 824: @tte = TimetableEntry.find_all_by_employee_id(params[:id]) 825: @timetable =<EMAIL_ADDRESS>826: @period_timing = ClassTiming.find(:all, :conditions => "is_break = false") 827: @day = Weekday.all(:select => "DISTINCT(weekday)") 828: @weekday = ["Mon", "Tue","Wed", "Thu", "Fri", "Sat", "Sun"] 829: respond_to do |format| 830: format.pdf { render :layout => false } 831: end 832: end
# File app/controllers/employee_controller.rb, line 1009 1009: def update_employee_payslip 1010: @department = EmployeeDepartment.find(params[:department_id]) if params[:department_id] 1011: @department ||= EmployeeDepartment.find(params[:payslip][:department_id]) 1012: @employee = Employee.find(params[:employee]) if params[:employee] 1013: @employee ||= @department.employees.first 1014: @prev_employee = @employee.previous_employee 1015: @next_employee = @employee.next_employee 1016: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 1017: @salary_date = params[:salary_date] if params[:salary_date] 1018: @salary_date ||= params[:payslip][:salary_date] 1019: if @salary_date == "" 1020: render :update do |page| 1021: page.replace_html "payslip_view", :text => "" 1022: end 1023: return 1024: end 1025: @monthly_payslips = MonthlyPayslip.find_all_by_salary_date(@salary_date, 1026: :conditions=> "employee_id<EMAIL_ADDRESS>1027: :order=> "payroll_category_id ASC") 1028: 1029: @individual_payslip_category = IndividualPayslipCategory.find_all_by_salary_date(@salary_date, 1030: :conditions=>"employee_id<EMAIL_ADDRESS>1031: :order=>"id ASC") 1032: @individual_category_non_deductionable = 0 1033: @individual_category_deductionable = 0 1034: @individual_payslip_category.each do |pc| 1035: unless pc.is_deduction == true 1036: @individual_category_non_deductionable = @individual_category_non_deductionable + pc.amount.to_i 1037: end 1038: end 1039: 1040: @individual_payslip_category.each do |pc| 1041: unless pc.is_deduction == false 1042: @individual_category_deductionable = @individual_category_deductionable + pc.amount.to_i 1043: end 1044: end 1045: 1046: @non_deductionable_amount = 0 1047: @deductionable_amount = 0 1048: @monthly_payslips.each do |mp| 1049: category1 = PayrollCategory.find(mp.payroll_category_id) 1050: unless category1.is_deduction == true 1051: @non_deductionable_amount = @non_deductionable_amount + mp.amount.to_i 1052: end 1053: end 1054: 1055: @monthly_payslips.each do |mp| 1056: category2 = PayrollCategory.find(mp.payroll_category_id) 1057: unless category2.is_deduction == false 1058: @deductionable_amount = @deductionable_amount + mp.amount.to_i 1059: end 1060: end 1061: 1062: @net_non_deductionable_amount = @individual_category_non_deductionable + @non_deductionable_amount 1063: @net_deductionable_amount = @individual_category_deductionable + @deductionable_amount 1064: 1065: @net_amount = @net_non_deductionable_amount - @net_deductionable_amount 1066: render :update do |page| 1067: page.replace_html "payslip", :partial => "update_employee_payslip" 1068: end 1069: end
# File app/controllers/employee_controller.rb, line 845 845: def update_employee_select_list 846: department_id = params[:department_id] 847: @employees = Employee.find_all_by_employee_department_id(department_id) 848: 849: render :update do |page| 850: page.replace_html 'employees_select_list', :partial => 'employee_select_list', :object => @employees 851: end 852: end
# File app/controllers/employee_controller.rb, line 787 787: def update_employees 788: @subject = Subject.find(params[:subject_id]) 789: @employees = Employee.find_all_by_employee_department_id(params[:department_id]) 790: render :update do |page| 791: page.replace_html 'employee-list', :partial => 'employee_list' 792: end 793: end
# File app/controllers/employee_controller.rb, line 978 978: def update_employees_select 979: @employee = params[:emp_id] 980: department_id = params[:department_id] 981: @employees = Employee.find_all_by_employee_department_id(department_id) 982: 983: render :update do |page| 984: page.replace_html 'employees_select', :partial => 'employee_select', :object => @employees 985: end 986: end
# File app/controllers/employee_controller.rb, line 683 683: def update_monthly_payslip 684: @currency_type = Configuration.find_by_config_key("CurrencyType").config_value 685: @salary_date = params[:salary_date] 686: if params[:salary_date] == "" 687: render :update do |page| 688: page.replace_html "payslip_view", :text => "" 689: end 690: return 691: end 692: @monthly_payslips = MonthlyPayslip.find_all_by_salary_date(params[:salary_date], 693: :conditions=> "employee_id =#{params[:emp_id]}", 694: :order=> "payroll_category_id ASC") 695: 696: @individual_payslip_category = IndividualPayslipCategory.find_all_by_salary_date(params[:salary_date], 697: :conditions=>"employee_id =#{params[:emp_id]}", 698: :order=>"id ASC") 699: @individual_category_non_deductionable = 0 700: @individual_category_deductionable = 0 701: @individual_payslip_category.each do |pc| 702: unless pc.is_deduction == true 703: @individual_category_non_deductionable = @individual_category_non_deductionable + pc.amount.to_i 704: end 705: end 706: 707: @individual_payslip_category.each do |pc| 708: unless pc.is_deduction == false 709: @individual_category_deductionable = @individual_category_deductionable + pc.amount.to_i 710: end 711: end 712: 713: @non_deductionable_amount = 0 714: @deductionable_amount = 0 715: @monthly_payslips.each do |mp| 716: category1 = PayrollCategory.find(mp.payroll_category_id) 717: unless category1.is_deduction == true 718: @non_deductionable_amount = @non_deductionable_amount + mp.amount.to_i 719: end 720: end 721: 722: @monthly_payslips.each do |mp| 723: category2 = PayrollCategory.find(mp.payroll_category_id) 724: unless category2.is_deduction == false 725: @deductionable_amount = @deductionable_amount + mp.amount.to_i 726: end 727: end 728: 729: @net_non_deductionable_amount = @individual_category_non_deductionable + @non_deductionable_amount 730: @net_deductionable_amount = @individual_category_deductionable + @deductionable_amount 731: 732: @net_amount = @net_non_deductionable_amount - @net_deductionable_amount 733: render :update do |page| 734: page.replace_html "payslip_view", :partial => "view_payslip" 735: end 736: end
# File app/controllers/employee_controller.rb, line 237 237: def update_positions 238: category = EmployeeCategory.find(params[:category_id]) 239: @positions = EmployeePosition.find_all_by_employee_category_id(category.id) 240: render :update do |page| 241: page.replace_html 'positions1', :partial => 'positions', :object => @positions 242: end 243: end
# File app/controllers/employee_controller.rb, line 427 427: def update_reporting_manager_name 428: employee = Employee.find(params[:employee_reporting_manager_id]) 429: render :text => employee.first_name + ' ' + employee.last_name 430: end
# File app/controllers/employee_controller.rb, line 769 769: def update_subjects 770: batch = Batch.find(params[:batch_id]) 771: @subjects = Subject.find_all_by_batch_id(batch.id,:conditions=>"is_deleted=false") 772: 773: render :update do |page| 774: page.replace_html 'subjects1', :partial => 'subjects', :object => @subjects 775: end 776: end
# File app/controllers/employee_controller.rb, line 570 570: def view_all 571: @departments = EmployeeDepartment.find(:all) 572: end
# File app/controllers/employee_controller.rb, line 751 751: def view_attendance 752: @employee = Employee.find(params[:id]) 753: @attendance_report =<EMAIL_ADDRESS>754: @leave_types = EmployeeLeaveType.find(:all, :conditions => "status = true") 755: 756: @total_leaves = 0 757: @leave_types.each do |lt| 758: leave_count = EmployeeAttendance.find_all_by_employee_id_and_employee_leave_type_id(@employee.id,lt.id).size 759: @total_leaves = @total_leaves + leave_count 760: end 761: render :partial => "attendance_report" 762: end
# File app/controllers/employee_controller.rb, line 677 677: def view_payslip 678: @employee = Employee.find(params[:id]) 679: @salary_dates = MonthlyPayslip.find_all_by_employee_id(params[:id], :conditions=>"is_approved = true",:select => "distinct salary_date") 680: render :partial => "select_dates" 681: end
# File app/controllers/employee_controller.rb, line 406 406: def view_rep_manager 407: @employee= Employee.find(params[:id]) 408: @reporting_manager = Employee.find(@employee.reporting_manager_id).first_name unless @employee.reporting_manager_id.nil? 409: render :partial => "view_rep_manager" 410: end


InitSprite()
Syntax
Result = InitSprite()Description
Initializes the sprite environment for later use. You must put this function at the top of your source code if you want to use the sprite functions.
Parameters
None.
Return value
Nonzero if the initialization of the sprite environment has successed, zero otherwise. You should always test this result to see if the sprite environment has been correctly initialized. If not you must quit the program or disable all the calls to the sprite related functions.
This function tries to initialize DirectX 9, so if it fails, it's probably because DirectX is not found or is a previous version.
Supported OS
All


Explanation
The Promise object is used for deferred and asynchronous computations. A Promise is in one of the three states:
- pending: initial state, not fulfilled or rejected.
- fulfilled: successful operation
- rejected: failed operation.
- settled: fulfilled or rejected
News
View source on github
// JS fun


Title of research study: TITLE
Key Information
This consent form asks you to take part in a research study. The study is being conducted by [PRINCIPAL INVESTIGATOR], [TITLE] in the Department of [DEPARTMENT] at [UNIVERSITY].
Purpose: [PURPOSE].
What you will be asked to do: In this HIT, you will be asked to [METHODS]. The study should take approximately [ESTIMATED TIME] to complete and you will be paid [COMPENSATION] for your participation.
At the end of the study, you’ll receive a validation code that you must enter into [PLATFORM] in order to receive payment.
This experiment involves sound. Please ensure you have access to audio before beginning.
How your confidentiality will be maintained: [DATA MANAGEMENT PLAN].
Benefits and Risks: [BENEFITS]. [RISKS]
Your participation is voluntary. You may withdraw at any time and you may choose not to answer any question but you must proceed to the final screen of the study in order to receive your completion code which you must submit in order to be paid.
If you have any questions about this research, please contact our lab manager, [LAB MANAGER NAME], at [LAB MANAGER EMAIL]. You may also contact [PRINCIPAL INVESTIGATOR] ([PI EMAIL]) if you have any questions about the study. Finally, you may contact the [IRB COMMITTEE] at [IRB PHONE] or [IRB EMAIL] about your rights as a research participant.
By clicking on the “I Agree to Participate” button below, you indicate that you are 18 years of age or older, that you voluntarily agree to participate in this study and that you understand the information in this consent form. You have not waived any legal rights you would otherwise have as a participant in a research study.
Protocol: [PROTOCOL NUMBER]
You have declined to participate at this time.
If you change your mind, simply reload this webpage.
Before we begin, we would like to test your equipment. First, we will test your sound system.
Please press the TEST SOUND button below to continue.
If you do not hear the metronome sound after pressing the button below, please check the sound settings on your computer and refresh this page to try again.
If you have difficulties checking your equipment or if the continue button doesn't appear after you've pressed the test sound button, feel free to contact our lab manager, [LAB MANAGER NAME], at [LAB MANAGER EMAIL].
| SPACEBAR |
We would also like to make sure your keyboard is working properly and your keystrokes are being counted by our program. Please press the SPACEBAR on your keyboard. If the press is registered, the word SPACEBAR above will be highlighted in blue. Once you've completed the test, a continue button will appear so that you can move on to the task. If you have difficulties checking your equipment or if the continue button doesn't appear after you've pressed your spacebar, feel free to contact our lab manager, [LAB MANAGER NAME], at [LAB MANAGER EMAIL]. |
The practice trials are now over.
Before you get started, there is one last thing you should know.
That is, from time to time throughout the task, we will ask you how motivated you are to do well on the task.
We understand you may not be completely motivated to do well on the task, and your response will not affect your ability to participate, so please be as HONEST and ACCURATE as possible.
To do this, we will present you with a motive-sampling screen that looks like this:
We would now like to know about your motivation level over the last couple minutes of the task.
Please be as HONEST and ACCURATE as possible.
We're now ready to start the task!
When you are ready to begin the experiment, please click the 'Begin Task' button below
Just prior to the onset of this screen, I was:
The thoughts I was experiencing were moving freely:
| Use the slider below to indicate the depth of your mind wandering. | ||
| Remember, mind wandering is when you are thinking about something unrelated to the task. | ||
| Not At All Mind Wandering | Fully Mind Wandering |
To confirm that you're a human being completing this study, please type the following numbers and letters exactly as you see them:
Please be advised: Refreshing your browser will cause the task to reset. Please do not refresh your browser.


{% extends "base.html" %} {% block title %}JeffPD{% endblock %} {% block page_content %}
Here's a preview of my current class site. Click the pic to checkout the full version!
There's two parts to this tutorial. Part 1 teaches you about why you should make a website, and part 1 teaches a little bit about how mine works. Part 2 teaches you how to make your website. If you just want to skip to part 2, that's OK, it won't hurt my feelings!
Why don't you check out some example class websites before you get started:
First, {% if current_user.is_authenticated() %}{{ current_user.first_name }}{% else %}Stranger{% endif %}, recognize that making your own website takes some work and some learning. But, once you get it rolling, it actually makes your teaching life much, much easier. Here's a picture I use to demonstrate this idea.
How does a website make your life much, much easier? By streamlining the process of getting information to/from students, communicating with parents, and documenting your teaching for admins. Here's another awesome picture to demonstrate that!
Next, checkout my website I used last school year. The "Weekly Topics of Study" section on the left hand side of the page is where I list every class and every assignment for the whole year.
Sometimes, students complete their work right on the website, such as in Week 17, Lesson 2. Other times, when students don't use computers in class, I'll still put that day's assignment on my website. An example of this is Week 8, Lesson 1, a lesson in which we mostly had lecture and discussions, but I still listed that day's PowerPoint on my website.
There's also a whole bunch of other benefits, which you can read about here.
OK, {% if current_user.is_authenticated() %}{{ current_user.first_name }}{% else %}Stranger{% endif %}, there's an easy way to make a website, and a slightly harder (but still pretty easy) way to make a website. If you make the easy website, your website will look like my website from a couple years ago. If you make the hard website, you'll make a website that looks just like my website from last year.
Making the easy website...To make the easy website, click here and follow the directions.
Making the hard website...This website will involve Google Sites, so head on over there now in a new tab. You'll have to login with a Google Account, so make one if you don't have one. You can use your personal account, or you could also use your mrmaxim.org Google Account, if you know how to do that.
There's no step-by-step, no-fail guide for making a class website like mine from last year, it's going to involve a decent amount of self-exploration and experimentation on your part to make this website. Don't be scared: trying and failing and trying again is how you get better at using all technology! However, here's some tips to help you along the way...
ps. If you've read this far, thanks, {% if current_user.is_authenticated() %}{{ current_user.first_name }}{% else %}Stranger{% endif %}! As a bonus surprise, check out this awesome picture of me and my neice...


## No need to take notes from the slides
* This talk is a web page
* You can go back and look at it all (or add to it!) later online
## The Internet and the World Wide Web
* Comes out of defence and science research
* The Internet started life as a US Defence research project at DARPA
* World Wide Web invented in 1989 at CERN
* The Internet had only 16 million users in 1995
The Internet and the World Wide Web
From the very early days, people thought about the political nature of the Internet …
… the Internet can be thought of as a utopian project (or set of projects) offering the possibility of radical, historically unprecedented human connection and sharing
## Fast forward to 2019
* 4 billion users, but …
* Over 50% of Internet traffic is non-human
* Streaming TV is now 58% of "downstream" (consumer) bandwidth usage
* The most popular websites by hit count are:
* Google
* Facebook
* Baidu (Chinese Facebook compettitor)
## To-do list for today
1. ~~Learn about WordPress~~
1. ~~Learn to code~~
1. Put some **stuff** _online_!
What is the World Wide Web?
(Okay, it's sort of a gorgeously stupid name)
World: it's meant to be global
Wide: anyone with a host can put content online
Web: Content indexes itself and allows navigation using hyperlinks
### Sidebar: Hypertext
* Includes stuff other than the World Wide Web
* It's kinda related to the cognitive _indexing_ processes vital to many new kinds of work ("knowing how to know things" versus "knowing things")
Sidebar: Hypertext
There is too much to know, so …
Google all the things, then …
Bookmark all the things that are actually good
Nabokov's PALE FIRE visualised as hypertext
## How do we put our stuff on the World Wide Web?
* Write angry comments on Facebook
## How do we put our stuff on the World Wide Web?
* ~~Write angry comments on Facebook~~
How do we put our stuff on the World Wide Web?
So to put our own stuff on the web, we need:
A domain name where people can find us
A host that can hold our content and deliver it to people
To put our stuff into special formats that let other people view it: HTML, CSS, JavaScript
## To-do list for today
1. ~~Put some **stuff** _online_~~
1. **Purchase a domain**
1. Set up a host
1. Learn how to create content
* Learn some languages!
1. Put the content on the host
1. Point the domain at the host
1. Look at more weird / fun content
Let's go domain shopping
## Sidebar: domain names
* Once people were desperate to own the **.com** or **.net** or **.org** version of their business / org name
* Last ten years: people care a lot less
* There are lots of new, cheap **Top Level Domains** (**.business**, **.fashion**, **.io**, **.map**, **.local**, **.university**)
* It costs just a few bucks to own a domain
## Sidebar: domain names
* Domain "squatting" is still a thing though
* It's against the rules to register domain names that are common typos for other domains
* eg **facebok.com**
snitch-jacket, transitive verb
To imply to your fellow conspirators and rebels that another member of your underground organisation is actually a police informant
## Our new domain
* We now "own" that domain (bought from [**namecheap.com**](https://namecheap.com)
* We can point that domain name at any _host address_ we want
* No one else can use it
* One year's time: we start getting emails telling us to renew it
* If we don't renew it, links to it will stop working
## Hypothetical: what if I want a completely secret domain?
* Always use a VPN to connect, administer and pay
* Use a domain registrar based in a jurisdiction that doesn't have intelligence treaties with your "enemies"
* Give false technical and owner contact info
* Use WHOIS protections anyway
* Pay with scrambled crypto currency
* Still probably not totally secret!
## To-do
1. ~~Put some **stuff** _online_~~
1. ~~Purchase a domain~~
1. **Set up a host**
1. Learn how to create content
* Learn some languages?!?!
1. Put the content on the host
1. Point the domain at the host
1. Look at more weird / fun content
Hosting
Hosting
A host can be thought of as like a "filing cabinet" for your content
that can give it to someone when they ask for it …
... maybe, like a filing cabinet + a butler?
## Hosting … what other stuff?
Different hosting providers offer lots of other things:
* Matching email addresses for your domain
*<EMAIL_ADDRESS>* Protection against DDoS attacks
* Help you set up _subdomains_
* blog.snitchjacket.fashion
* photos.snitchjacket.fashion
* Lots of other stuff … from e-commerce to site analytics
## Some options for hosting
* Option 1: a "server" (ie your computer connected to the internet)
* Option 2: "on the cloud" (ie someone else's computer on the net)
* Option 3: a _static website_ (ie you just need a "storage bucket")
GitHub Pages
A (mostly) free, open hosting option
If you're not paying, other people can see (and maybe use) your content
This Is Actually A Good Thing
Suitable for "static" sites (content only changes when you edit it)
## GitHub Pages
* [GitHub](https://github.com) supports **version control** for changes
* If you get serious about text or code, use version control!
* We will see some basic stuff about how it works as we go through today
* GitHub is a world-leading platform for _collaborating with others_
## Our new GitHub
* We created an account on [**GitHub**](https://github.com)
* We created a special _repository_ ("filing cabinet") with our account
* The information on GitHub is completely public
* We are going to start putting our **stuff** in there
## To-do
1. ~~Put some **stuff** _online_~~
1. ~~Purchase a domain~~
1. ~~Set up a host~~
1. **Learn how to create content**
* Learn some languages?!?!
1. Put the content on the host
1. Point the domain at the host
1.
Languages of the Web
The combination of HTML, JavaScript and CSS is powerful enough to replace nearly all your publishing and computing needs …
… with the huge benefit that it's easy to give things to lots of other people
HyperText Markup Language
HTML is for describing the structure of documents along with the text that goes into them …

<title>Hello, DFU!</title>

Hello, DFU!

HTML
HTML describes the structure of a web page
A tag like  usually has a closing tag
Tags can be nested inside each other
eg <title> goes inside
eg paragraph tag
 goes inside block tag

Lots of rules you don't need to know about
## How to learn HTML (or anything)
* Change the _markup_ and the _web page_ changes
* _Shorten the feedback loop_
* Use a tool that _auto-refreshes_ your page
Inventing on Principle
A cool 1h talk about how to learn things fast
## [CodePen](https://codepen.io/)
* Useful tool for experimenting with HTML, JavaScript and CSS
* Lets you see your changes heads up
* Helps you beg, borrow or steal ideas from others
* One of many: see also **jsFiddle**, **JS Bin** etc
## Cascading Stylesheets (CSS)
* A _language_ with its own syntax alongside HTML
* Stored in a style tag, or in a separate document
* CSS combines two aspects
* _Selecting_ elements from a web page
* _Applying_ "styles" to the selection
CSS selectors can be nested, combined and modified
… which gets complicated
## CSS capabilities
* Page layout (position, margins, padding, visibility, size)
* Animations
* Generic styles (colours, backgrounds, fonts)
* Insert "pseudo" elements
* Shrink and grow elements
* Change styles when user interacts
* hover, focus and others
* Very diverse, very intricate
## Stylesheet templates, themes and frameworks
* CSS is a rather difficult art
* Many interacting aesthetic decisions make up a coherent style
* Mobile styles are harder still
* Significant industry sector selling "templates" and "themes" with pre-built styles
* Frameworks such as [Bootstrap](https://getbootstrap.com) and [Foundation](https://foundation.zurb.com/) provide a starting point
## Style inspiration
* Frameworks like **Bootstrap** are useful, but everything looks the same
* Borrowing, theft?! Legitimate strategies
* Some sites are great for capturing a particular feel:
* eg [Cameron's World](https://www.cameronsworld.net/) which is full of retro garbage
* or [Brutalist Websites](https://brutalistwebsites.com/)
## 3. Create a "Contact Us" form with [FormSpree](https://formspree.io/)
* FormSpree allows us to set up a <form> element in our web page that will email us when someone submits a message
* We don't need a server or a mail host for this
* We'll also use the [Bootstrap](https://getbootstrap.com/) framework for slicker form styling
## 4. Generative art with [ProcessingJS](http://processingjs.org/)
* ProcessingJS is a port of the [Processing Visual Language](https://processing.org/overview/) to the browser
* It's designed to cross-pollinate the worlds of visual art and software engineering
// amoebaAbstract_01_formatik
// Copyright 2003 Marius Watz
// http://www.evolutionzone.com/
//
// Variation on abstract computational animation
// for the exhibition "Abstraction Now",
// Künstlerhaus Vienna, 29.08-28.09 2003.
## 5. Creating maps with [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js/examples/)
* Online maps can be hosted inside web pages you create
* With these maps you can render topical data, symbology, sensor data and more
* Mapbox GL JS is one of several popular JavaScript mapping libraries for the Web
* see also _OpenLayers_ and _LeafletJS_
## 5. Creating maps with [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js/examples/)
* To use Mapbox GL JS, we needed an "API Key" (a token identifying us) from our Mapbox account
* This is because a lot of the content we're using is _not ours_ - it's hyperlinked!
* Map tile data for satellite and street maps comes from Mapbox servers
* Mapbox controls usage and may charge you
## 6. Visualising data with [D3.js](https://bl.ocks.org)
* D3.js is a charting and dataviz library based on _pipelined_ transformation of source datasets using JavaScript
* Many, many examples online
* We've created a D3 Force Layout example [here](page6.html)
* This is a graph visualisation that relies on spacing graph nodes using a physics simulation
## Other possibilities
* Write your presentations using [RevealJS](https://github.com/hakimel/reveal.js/)
* Host blogs, business sites and others using [Jekyll](https://jekyllrb.com/)
* Host interactive chat-bots with [DialogFlow](https://dialogflow.com/)
* Sound synthesis with [HowlerJS](https://howlerjs.com/) or [Tone.js](https://tonejs.github.io/examples/)
* JavaScript-based game programming with [Elm](https://medium.com/@l.mugnaini/beginner-tutorials-how-to-build-a-game-in-elm-5491d6de8f25)


RDF as a backend for Modern JavaScript applications
rdf, javascript, and apiA major requirement for modern JavaScript applications is the presence of REST endpoints for the application to be able to get and post data into some back end. Relational databases have numerous systems for creating these automatically.
The Vimer a Vim Primer
So you accidentally opened vim can't figure out how to close it and now are here.
Comparing Triple Stores
rdf and triple storesIn looking into the world of triple stores there, exists very little in the way of traditional web communities discussing and comparing them. Most of the discussion appears to happen in academic journals, which would make sense as their widest us...
Formatting Test Post
This is a post to test various formatting.
— 1 of 1 —


Developing a model to detect defects in helmets used by pilots. Also creating a frontend environment for the model to run on and display the results.
Performed exploratory data analysis on data from a manganese production facility. Trained a Variational Autoencoder to reduce a 16,538 dimensional vector to 2 dimensions. Analyzed 2-d vector to determine clusters that maximized production output. Integrated data preprocessing and data report pipelines with the frontend using Django and React.
Created various models to diagnose Parkinsons patients from datasets, using xgboost and InceptionV3 transfer learning. Presented results at UMD's undergraduate day and the MLSE Conference at CMU.
A dynamic website that allows users after they signup to add campgrounds near their location, reviews of the campgrounds, and general comments. Using a non-relational database users are able to connect with their campgrounds and comments that are saved in MongoDB. In addition, the website uses RESTful routes to create, update, destroy, and show campgrounds and comments.
A fun static website that allows a user to play sounds from the keyboard on the website. Paper.js is a javascript library that provides the animation for the circles when a key is pressed, and Howler.js provides the functionality to play certain sounds. This idea came from https://patatap.com/ another website that allows a user to play default sounds on key presses.
A dynamic website that allows any visitor on the website to create, edit, or delete a blog. The blogs are stored in a non-relational database using MongoDB. This site uses Semantic UI which essentially is Bootstrap, but has more meaningful names for css classes. The idea behind this site was to practice RESTful routes, and attempt to try a new framework over Bootstrap.
A UC irvine dataset extracted features from the audio data recorded from various patients with parkinsons and without parkinsons. Using Scikit Learn I attempted to find the best accuracy given the dataset using various supervised learning techniques and got a 98% accuracy w/ KNN, and 96% accuracy with XGBoost. I also plotted the importance of the features in the dataset, and dropped features that had no impact on the tree model.
TwoSigma's Artificial Intelligence Challenge that tests a user's bot against other's players bot. Initially, began with a python implementation of strategies, and was placed at about 360. However, this began to exceed the amount of time I had for each turn, causing me to lose. Therefore, I switched to a ML strategy, using the ML starter bot I scraped data from the top players and trained the bot on the winners of those matches, reaching a rank of 401. Then I switched over to Java and back to algorithmic implementations where I was able to place 148. My github link on the right provides a more detailed description.
GPA: 3.63
GPA: 3.92
Computer Science
Mathematics/Statistics


Create a range of integers one through five
range 1 5
Yields 1 2 3 4 5
Create a range of integer negative two to six
range -- -2 6
Yields -2 -1 0 1 2 3 4 5 6
Create a range of even integers two to ten
range -increment=2 2 10
Yields 2 4 6 8 10
Create a descending range of integers ten down to one
range 10 1
Yields 10 9 8 7 6 5 4 3 2 1
Pick a random integer between zero and ten
range -r 0 10
Yields a random integer from 0 to 10


Sake - Swift Make
Sake is a Swift command line tool that helps you automate tasks in your projects. It’s heavily inspired by Makefile and Rake.
Motivation 💅
Why automating tasks using shell scripting or Ruby when you can do it in Swift, a language you are already familiar with? Sake aims to provide a command line tool and the foundation to automate your tasks in Swift.
Installation 🥑
You can easily install rake using Homebrew:
brew tap xcodeswift/sake git@github.com:xcodeswift/sake.git
brew install sake
Setup ⚒
- Git clone the project
git clone git@github.com:xcodeswift/sake.git
. - Build
swift build
.
Sakefile
Sakefile is the file that defines your project tasks:
// Sakefile
import SakefileDescription
import SakefileUtils
enum Task: String, CustomStringConvertible {
case build
var description: String {
switch self {
case .build:
return "Builds the project"
}
}
}
Sake<Task> {
$0.task(.build) { (utils) in
// Here is where you define your build task
}
}.run()
Usage 👩🏻💻
Creating a Sakefile.swift 📝
You can create an empty Sakefile.swift
running the following command:
sake init
Working on the Sakefile.swift 💼
You can edit the Sakefile.swift
using any text editor. Nonetheless, we recommend you to use Xcode since you’ll get syntax highlighting and code autocompletion for free. Sake provides a command to generate the Xcode project where you can edit the Sakefile.swift
. You can generate the command by running:
sake generate-xcodeproj
:warning: Note: Xcode can only run Swift code in a
main.swift
file. Since the name of the file isSakefile.swift
you’ll get some Xcode warnings. Ignore them!
Tasks ✅
Run a task
sake task name_of_the_task
List all the tasks
sake tasks
Sakefile Guidelines 🎨
The Swift code written in the Sakefile.swift
file should meet the following guidelines:
- It shouldn’t fail the execution either using
fatalError
or force unwrapping nil values. Failing the execution causes the tool to print the stack trace in the console. Instead throw errors that are handled bySake
and nicely printed into th console. - Code should be synchronous and tasks should be completed by the time the closre execution ends.
License
MIT License
Copyright (c) 2017 xcode.swift
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Home
Workshop Organizers
Program Committee
Call for Papers
Contact
Menu
Topics of Interest
Important Dates
Submission Guidelines
testing div 1
testing div 2 (not clickable)
testing span 1
testing div with same content as 1
testing span 2
testing span 3 (clickable with no resource)
Nonexistent
Site built with jQuery Ajax library.
Coverage report
Welcome to this Ajax test site.


From Loading sound files faster using Array Buffers and Web Audio API
Note: sounds can only be played one because the way I'm using AudioBufferSource.
Jaume Sanchez Elias @thespite (clicktorelease.com)
'Funk Game Loop', 'Honey Bee' and 'There It Is' Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0