$opOrg->execute(); $opOrg->store_result(); if ($opOrg->num_rows == 0) { $opOrg->close(); jsonRet(false, 'INVALID_ORG'); } else { $sr = new Statement_Result($opOrg); $opOrg->fetch(); $opOrg->close(); if ($sr->Get('isActive') == 0) { jsonRet(false, 'INVALID_ORG'); } else { # LOAD ORG SETTINGS $opSC = new lethe(); $orgSets = array(); if (!$opSC->loadOrg($sr->Get('ID'))) { jsonRet(false, 'INVALID_ORG'); } # ACTIONS START ******************************************************************************************************* # Add if ($act == 'add') { /* Limit Controller */ $sourceLimit = calcSource($sr->Get('ID'), 'subscribers'); if (!limitBlock($sourceLimit, $orgSets['set_org_max_subscriber'])) { jsonRet(false, 'SUBSCRIBING_LIMIT_EXCEEDED'); } $chkAPI = $myconn->prepare("SELECT ID FROM " . db_table_pref . "subscribers WHERE OID=" . $sr->Get('ID') . " AND subscriber_mail=?") or die(mysqli_error($myconn)); $chkAPI->bind_param('s', $lmail); $chkAPI->execute(); $chkAPI->store_result(); if ($chkAPI->num_rows == 0) {
$errLogs = array(); $phase = rand(5000, 10000); # Load Organization Settings For First Time # It's required for different timezone setting $opCampSet = $myconn->query("SELECT \n\t\t\t\t\t\t\t\t\t*\n\t\t\t\t\t\t\t FROM \n\t\t\t\t\t\t\t\t\t\t" . db_table_pref . "campaigns\n\t\t\t\t\t\t\t WHERE \n\t\t\t\t\t\t\t\t\t\tID = " . $ID . "") or die(mysqli_error($myconn)); if (mysqli_num_rows($opCampSet) > 0) { $opCampSetRs = $opCampSet->fetch_assoc(); /* Load Organization */ $orgSets = array(); # Main Settings Stored in This Array (set_x) $opOrg = new lethe(); # If Organization Exists or allowed for daily limits # This function will call all organization settings for one phase # If Organization is exceeded daily limits, marked inactive or its not exists sending operation will abort on this section # Another limit controller in sending class for main submission accounts. if ($opOrg->loadOrg($opCampSetRs['OID'])) { # Settings Loaded $LETHE_ORG_SETS['set_org_name'] = $orgSets['set_org_name']; } else { $errLogs[] = "Error: Organization is Not Active or Daily Limit Exceeded!"; /* Show Log */ if (lethe_debug_mode) { $errLogStr = ''; foreach ($errLogs as $k => $v) { $errLogStr .= $v . '<br>'; } echo $errLogStr; } die; } /* Load Organization End */