parent
633b276403
commit
073df113a1
@ -0,0 +1,89 @@ |
||||
<?php |
||||
/** |
||||
* List of services |
||||
* @package chamilo.plugin.buycourses |
||||
*/ |
||||
/** |
||||
* Initialization |
||||
*/ |
||||
|
||||
$cidReset = true; |
||||
|
||||
require_once '../../../main/inc/global.inc.php'; |
||||
|
||||
$plugin = BuyCoursesPlugin::create(); |
||||
$includeSessions = $plugin->get('include_sessions') === 'true'; |
||||
$includeServices = $plugin->get('include_services') === 'true'; |
||||
|
||||
$nameFilter = null; |
||||
$minFilter = 0; |
||||
$maxFilter = 0; |
||||
$appliesToFilter = ''; |
||||
|
||||
$form = new FormValidator('search_filter_form', 'get', null, null, [], FormValidator::LAYOUT_INLINE); |
||||
|
||||
if ($form->validate()) { |
||||
$formValues = $form->getSubmitValues(); |
||||
$nameFilter = isset($formValues['name']) ? $formValues['name'] : null; |
||||
$minFilter = isset($formValues['min']) ? $formValues['min'] : 0; |
||||
$maxFilter = isset($formValues['max']) ? $formValues['max'] : 0; |
||||
$appliesToFilter = isset($formValues['applies_to']) ? $formValues['applies_to'] : ''; |
||||
} |
||||
|
||||
$form->addHeader($plugin->get_lang('SearchFilter')); |
||||
$form->addText('name', $plugin->get_lang('ServiceName'), false); |
||||
$form->addElement( |
||||
'number', |
||||
'min', |
||||
$plugin->get_lang('MinimumPrice'), |
||||
['step' => '0.01', 'min' => '0'] |
||||
); |
||||
$form->addElement( |
||||
'number', |
||||
'max', |
||||
$plugin->get_lang('MaximumPrice'), |
||||
['step' => '0.01', 'min' => '0'] |
||||
); |
||||
$appliesToOptions = [ |
||||
'' => get_lang('Any'), |
||||
0 => get_lang('None'), |
||||
1 => get_lang('User'), |
||||
2 => get_lang('Course'), |
||||
3 => get_lang('Session') |
||||
]; |
||||
$form->addSelect('applies_to', $plugin->get_lang('AppliesTo'), $appliesToOptions); |
||||
$form->addHtml('<hr>'); |
||||
$form->addButtonFilter(get_lang('Search')); |
||||
|
||||
$serviceList = $plugin->getCatalogServiceList($nameFilter, $minFilter, $maxFilter, $appliesToFilter); |
||||
|
||||
//View |
||||
if (api_is_platform_admin()) { |
||||
$interbreadcrumb[] = [ |
||||
'url' => 'configuration.php', |
||||
'name' => $plugin->get_lang('AvailableCoursesConfiguration') |
||||
]; |
||||
$interbreadcrumb[] = [ |
||||
'url' => 'paymentsetup.php', |
||||
'name' => $plugin->get_lang('PaymentsConfiguration') |
||||
]; |
||||
} else { |
||||
$interbreadcrumb[] = [ |
||||
'url' => '../index.php', |
||||
'name' => $plugin->get_lang('UserPanel') |
||||
]; |
||||
} |
||||
|
||||
$templateName = $plugin->get_lang('ListOfServicesOnSale'); |
||||
$tpl = new Template($templateName); |
||||
$tpl->assign('search_filter_form', $form->returnForm()); |
||||
$tpl->assign('showing_services', true); |
||||
$tpl->assign('services', $serviceList); |
||||
$tpl->assign('sessions_are_included', $includeSessions); |
||||
$tpl->assign('services_are_included', $includeServices); |
||||
|
||||
$content = $tpl->fetch('buycourses/view/catalog.tpl'); |
||||
|
||||
$tpl->assign('header', $templateName); |
||||
$tpl->assign('content', $content); |
||||
$tpl->display_one_col_template(); |
@ -0,0 +1,39 @@ |
||||
<?php |
||||
|
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* Service information page |
||||
* Show information about a service (for custom purposes) |
||||
* @author José Loguercio Silva <jose.loguercio@beeznest.com> |
||||
* @package chamilo.buycourses_plugin |
||||
*/ |
||||
|
||||
$cidReset = true; |
||||
|
||||
require_once '../../../main/inc/global.inc.php'; |
||||
|
||||
$serviceId = isset($_GET['service_id']) ? intval($_GET['service_id']) : false; |
||||
|
||||
$plugin = BuyCoursesPlugin::create(); |
||||
|
||||
$includeServices = $plugin->get('include_services') === 'true'; |
||||
|
||||
if (!$includeServices) { |
||||
api_not_allowed(true); |
||||
} |
||||
|
||||
$service = $plugin->getServices($serviceId); |
||||
|
||||
if (!$service['id']) { |
||||
api_not_allowed(true); |
||||
} |
||||
|
||||
$template = new Template(false); |
||||
$template->assign('pageUrl', api_get_path(WEB_PATH) . "service/{$serviceId}/information/"); |
||||
$template->assign('service', $service); |
||||
$template->assign('essence', Essence\Essence::instance()); |
||||
|
||||
$content = $template->fetch('buycourses/view/service_information.tpl'); |
||||
|
||||
$template->assign('content', $content); |
||||
$template->display_one_col_template(); |
@ -0,0 +1,3 @@ |
||||
* |
||||
|
||||
!.gitignore |
@ -0,0 +1,80 @@ |
||||
<link rel="stylesheet" type="text/css" href="{{ _p.web_plugin ~ 'buycourses/resources/css/style.css' }}"/> |
||||
|
||||
<div id="service-information"> |
||||
|
||||
<div class="row"> |
||||
<div class="col-xs-12"> |
||||
<h3 class="text-uppercase buy-courses-title-color">{{ service.name }}</h3> |
||||
</div> |
||||
|
||||
{% if service.video_url %} |
||||
<div class="col-sm-6 col-md-7 col-xs-12"> |
||||
<div class="embed-responsive embed-responsive-16by9"> |
||||
{{ essence.replace(service.video_url) }} |
||||
</div> |
||||
</div> |
||||
{% endif %} |
||||
|
||||
<div class="{{ service.video_url ? 'col-sm-6 col-md-5 col-xs-12' : 'col-sm-12 col-xs-12' }}"> |
||||
<div class="block"> |
||||
<div class="panel panel-default"> |
||||
<div class="panel-heading"> |
||||
<h4>{{ "Description"|get_lang }}</h4> |
||||
</div> |
||||
<div class="panel-body"> |
||||
<p><em class="fa fa-flag-o"></em> <b>{{ 'AppliesTo'|get_plugin_lang('BuyCoursesPlugin') }}</b> : |
||||
{% if service.applies_to == 1 %} |
||||
{{ 'User' | get_lang }} |
||||
{% elseif service.applies_to == 2 %} |
||||
{{ 'Course' | get_lang }} |
||||
{% elseif service.applies_to == 3 %} |
||||
{{ 'Session' | get_lang }} |
||||
{% endif %} |
||||
</p> |
||||
<p><em class="fa fa-money"></em> <b>{{ 'Price'|get_plugin_lang('BuyCoursesPlugin') }}</b> : {{ service.currency == 'BRL' ? 'R$' : service.currency }} {{ service.price }}</p> |
||||
<p><em class="fa fa-align-justify"></em> <b>{{ 'Details' | get_lang }}</b> : {{ service.description }}</p> |
||||
<div class="text-right" style="padding-bottom: 20px;"> |
||||
<a href="{{ _p.web_plugin ~ 'buycourses/src/service_process.php?t=4&i=' ~ service.id }}" class="btn btn-success btn-lg"> |
||||
<em class="fa fa-shopping-cart"></em> {{ 'Buy'|get_plugin_lang('BuyCoursesPlugin') }} |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</br> |
||||
</br> |
||||
<div class="row info-course"> |
||||
<div class="col-xs-12 col-md-7"> |
||||
<div class="panel panel-default"> |
||||
<div class="panel-heading"> |
||||
<h4>{{ 'ServiceInformation'|get_plugin_lang('BuyCoursesPlugin') }}</h4> |
||||
</div> |
||||
<div class="panel-body"> |
||||
{{ service.service_information }} |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-xs-12 col-md-5"> |
||||
<div class="panel panel-default social-share"> |
||||
<div class="panel-heading"> |
||||
<h4>{{ "ShareWithYourFriends"|get_lang }}</h4> |
||||
</div> |
||||
<div class="panel-body"> |
||||
<div class="icons-social text-center"> |
||||
<a href="https://www.facebook.com/sharer/sharer.php?{{ {'u': pageUrl}|url_encode }}" target="_blank" class="btn bnt-link btn-lg"> |
||||
<em class="fa fa-facebook fa-2x"></em> |
||||
</a> |
||||
<a href="https://twitter.com/home?{{ {'status': session.getName() ~ ' ' ~ pageUrl}|url_encode }}" target="_blank" class="btn bnt-link btn-lg"> |
||||
<em class="fa fa-twitter fa-2x"></em> |
||||
</a> |
||||
<a href="https://www.linkedin.com/shareArticle?{{ {'mini': 'true', 'url': pageUrl, 'title': session.getName() }|url_encode }}" target="_blank" class="btn bnt-link btn-lg"> |
||||
<em class="fa fa-linkedin fa-2x"></em> |
||||
</a> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
Loading…
Reference in new issue