Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
chamilo-lms/main/inc/ajax/install.ajax.php

66 lines
2.5 KiB

<?php
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls for install
*/
//require_once '../global.inc.php';
$action = $_GET['a'];
switch ($action) {
case 'send_contact_information':
if (!empty($_POST)) {
// get params from contact form
$person_name = $_POST['person_name'];
$person_email = $_POST['person_email'];
$person_role = $_POST['person_role'];
$financial_decision = $_POST['financial_decision'];
$contact_language = $_POST['language'];
$company_name = $_POST['company_name'];
$company_activity = $_POST['company_activity'];
$company_country = $_POST['company_country'];
$company_city = $_POST['company_city'];
// validating required fields
$a_required_fields = array($person_name, $person_role, $company_name, $company_activity, $company_country);
$required_field_error = false;
foreach ($a_required_fields as $required_file) {
if (trim($required_file) === '') {
$required_field_error = true;
break;
}
}
if ($required_field_error) {
echo 'required_field_error';
} else {
// save contact information with web service
// create a client
$client = new SoapClient('https://version.chamilo.org/contact.php?wsdl');
// call method ws_add_contact_information
$contact_params = array(
'person_name' => $person_name,
'person_email' => $person_email,
'person_role' => $person_role,
'financial_decision' => $financial_decision,
'contact_language' => $contact_language,
'company_name' => $company_name,
'company_activity' => $company_activity,
'company_country' => $company_country,
'company_city' => $company_city
);
$result = $client->__soapCall(
'ws_add_contact_information',
array('contact_params' => $contact_params)
);
echo $result;
}
}
break;
default:
echo '';
}
exit;