| Server IP : 138.197.176.125 / Your IP : 216.73.217.54 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/vtiger75/modules/CTWhatsAppExt/actions/ |
Upload File : |
<?php
/*+*******************************************************************************
* The content of this file is subject to the CRMTiger Pro license.
* ("License"); You may not use this file except in compliance with the License
* The Initial Developer of the Original Code is vTiger
* The Modified Code of the Original Code owned by https://crmtiger.com/
* Portions created by CRMTiger.com are Copyright(C) CRMTiger.com
* All Rights Reserved.
***************************************************************************** */
class CTWhatsAppExt_SaveEnableModule_Action extends Settings_Vtiger_Basic_Action {
public function process(Vtiger_Request $request) {
global $adb;
$getEnableModuleQuery=$adb->pquery("SELECT * FROM ctwhatsappext_enablemodules");
$numOfEnableModules = $adb->num_rows($getEnableModuleQuery);
$enableModules = json_encode($request->get('enableModules'));
if($numOfEnableModules){
$recordId=$adb->query_result($getEnableModuleQuery,0,'recordid');
$updateEnableModule = $adb->pquery("UPDATE ctwhatsappext_enablemodules SET enablemodules=? WHERE recordid=?",array($enableModules,$recordId));
if($updateEnableModule){
$result = array('code'=>2, 'msg'=>vtranslate('Enabled Module Updated Successfully','CTWhatsAppExt'));
}
}else{
$insertEnableModule = $adb->pquery("INSERT INTO ctwhatsappext_enablemodules (enablemodules) values(?)",array($enableModules));
if($insertEnableModule){
$result = array('code'=>1, 'msg'=>vtranslate('module Enabled Successfully','CTWhatsAppExt'));
}
}
$response = new Vtiger_Response();
$response->setEmitType(Vtiger_Response::$EMIT_JSON);
$response->setResult($result);
$response->emit();
}
}
?>