Find Jobs
Hire Freelancers

Add some PHP code to check for max enrollment in Moodle

$30-250 USD

Completed
Posted over 10 years ago

$30-250 USD

Paid on delivery
I am looking to modify the enrol_paypal plugin to offer a way to limit the number of students per course that can enroll that way. I have figured out a short way to do it, but am not good enough in PHP to make it work. From [login to view URL] in the enrol_paypal folder: function enrol_page_hook(stdClass $instance) { global $CFG, $USER, $OUTPUT, $PAGE, $DB; ob_start(); if ($DB->record_exists('user_enrolments', array('userid'=>$USER->id, 'enrolid'=>$instance->id))) { return ob_get_clean(); } if ($instance->enrolstartdate != 0 && $instance->enrolstartdate > time()) { return ob_get_clean(); } if ($instance->enrolenddate != 0 && $instance->enrolenddate < time()) { return ob_get_clean(); } $course = $DB->get_record('course', array('id'=>$instance->courseid)); $context = context_course::instance($course->id); $shortname = format_string($course->shortname, true, array('context' => $context)); $strloginto = get_string("loginto", "", $shortname); $strcourses = get_string("courses"); // Pass $view=true to filter hidden caps if the user cannot see them if ($users = get_users_by_capability($context, 'moodle/course:update', 'u.*', '[login to view URL] ASC', '', '', '', '', false, true)) { $users = sort_by_roleassignment_authority($users, $context); $teacher = array_shift($users); } else { $teacher = false; } if ( (float) $instance->cost <= 0 ) { $cost = (float) $this->get_config('cost'); } else { $cost = (float) $instance->cost; } if (abs($cost) < 0.01) { // no cost, other enrolment methods (instances) should be used echo '<p>'.get_string('nocost', 'enrol_paypal').'</p>'; } else { /*REQUESTED FUNCTIONALITY: This is where we can put the check for maximum enrolled students: If ((count(userid) from mdl_enrol_paypal where payment_status = 'Completed' and courseid = $instance->courseid) > 75) {print "Course is full.";} else{*/ // Calculate localised and "." cost, make sure we send PayPal the same value, // please note PayPal expects amount with 2 decimal places and "." separator. $localisedcost = format_float($cost, 2, true); $cost = format_float($cost, 2, false); ... I do not need this to appear in any settings page right away, but may want to add that functionality later.
Project ID: 5274353

About the project

9 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi sir,I have read you requirement and interested to add the maximum limit code into the plugin so let me know with positive [login to view URL]
$111 USD in 3 days
5.0 (23 reviews)
4.4
4.4
9 freelancers are bidding on average $155 USD for this job
User Avatar
10+ years of experiance in programming PHP/MYSQl. I had done much programming into development and also bug fixing all these years. You can check my profile for my reputation and ranking . I can work on this project and finish it like you need. are you sure only on this file the code needs to be changed and it will work for number of students?
$147 USD in 3 days
4.9 (288 reviews)
7.4
7.4
User Avatar
Dear sir, I have gone through your outsourced requirement "Add some PHP code to check for max enrollment in Moodle" and have analyzed that I have right credentials (Moodle, PHP, Software Architecture) to execute your esteemed project. You will never go wrong choosing me :)
$184 USD in 3 days
5.0 (61 reviews)
5.4
5.4
User Avatar
Dear Sir, I'm expert PHP Open Source developer. I have done a lot of projects which are based on Open Source Technologies. I can complete your task very quickly. Let me know if you are interested. I'm sure you'll inspire with my work strategies. I'm expert in Open Source Technologies, Mobile Development, Website Designing, Graphic Designing etc . Looking forward to your quick response! Thanks Ssplancer
$88 USD in 3 days
5.0 (11 reviews)
4.3
4.3
User Avatar
www.freelancer.com/u/shrinkray.html . I am sure all of other bidders are project manager or sales person so they are not capable to give you reasonable estimate. I am an individual and professional developer who is holding always 100% completion rate . check my profile and portfolio. I want to discuss more about your project , so please give me your sky pe username or add me in sk ype : nowatch911
$150 USD in 3 days
5.0 (7 reviews)
2.9
2.9
User Avatar
respected sir i have an experience in html,html5,css,css3,php,javascript,jquery,ajax,kohana,prestashop,codeigniter,moodle,joomla,wordpress,drupal,sugarCRM,cpanel,server migration,webservice and mysql.i am ready to do your project. I have an experience in moodle customization. I have an experience in third party integration like paypal,eway,webpay payment gateway API,also know about twitter,tumblr,facebook API. I can customize enrollment plugin as per your requirement. you can contact me on skype:harshilshah1310
$100 USD in 2 days
5.0 (2 reviews)
1.7
1.7
User Avatar
A proposal has not yet been provided
$288 USD in 30 days
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$277 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Detroit, United States
5.0
1
Payment method verified
Member since Dec 31, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.