Example #1
0
 function saveBlance()
 {
     global $toC_Json, $osC_Language, $osC_Database;
     $osC_Currencies = new osC_Currencies_Admin();
     $data = array('amount' => $_REQUEST['amount'], 'comments' => $_REQUEST['comments'], 'customers_id' => $_REQUEST['customers_id'], 'notify' => isset($_REQUEST['notify']) && $_REQUEST['notify'] == 'on' ? '1' : '0');
     if (osC_Customers_Admin::saveBlance($data)) {
         $data = osC_Customers_Admin::getData($_REQUEST['customers_id']);
         $response = array('success' => true, 'customers_credits' => $osC_Currencies->format($data['customers_credits']), 'feedback' => $osC_Language->get('ms_success_action_performed'));
     } else {
         $response = array('success' => false, 'feedback' => $osC_Language->get('ms_error_action_not_performed'));
     }
     echo $toC_Json->encode($response);
 }