Example #1
0
function audit_comments($lead_id, $list_id, $format, $user, $mel, $NOW_TIME, $link, $server_ip, $session_name, $one_mysql_log, $campaign)
{
    $audit_comments_active = audit_comments_active($list_id, $format, $user, $mel, $NOW_TIME, $link, $server_ip, $session_name, $one_mysql_log);
    if ($audit_comments_active) {
        //Get comment from list
        $stmt = "select comments from vicidial_list where lead_id='{$lead_id}' limit 1;";
        if ($format == 'debug') {
            echo "\n<!-- {$stmt} -->";
        }
        $rslt = mysql_query($stmt, $link);
        if ($mel > 0) {
            mysql_error_logging($NOW_TIME, $link, $mel, $stmt, '00142-AuditComments2', $user, $server_ip, $session_name, $one_mysql_log);
        }
        $row = mysql_fetch_row($rslt);
        if (strlen($row[0]) > 0) {
            $comment = $row[0];
            //Put comment in comment table
            $stmt = "INSERT INTO vicidial_comments (lead_id,user_id,list_id,campaign_id,comment) VALUES ('{$lead_id}','{$user}','{$list_id}','{$campaign}','{$comment}');";
            if ($format == 'debug') {
                echo "\n<!-- {$stmt} -->";
            }
            $rslt = mysql_query($stmt, $link);
            if ($mel > 0) {
                mysql_error_logging($NOW_TIME, $link, $mel, $stmt, '00142-AuditComments3', $user, $server_ip, $session_name, $one_mysql_log);
            }
            $affected = mysql_affected_rows();
            if ($affected > 0) {
                $stmt = "UPDATE vicidial_list set comments='' where lead_id='{$lead_id}';";
                if ($format == 'debug') {
                    echo "\n<!-- {$stmt} -->";
                }
                $rslt = mysql_query($stmt, $link);
                if ($mel > 0) {
                    mysql_error_logging($NOW_TIME, $link, $mel, $stmt, '00142-AuditComments4', $user, $server_ip, $session_name, $one_mysql_log);
                }
            } else {
                mysql_error_logging($NOW_TIME, $link, $mel, $stmt, '00142-AuditCommentsERROR-Comment not moved', $user, $server_ip, $session_name, $one_mysql_log);
                echo "\n<!-- 00142-AuditCommentsERROR-Comment not moved -->";
            }
        }
    }
}
Example #2
0
     $comments = stripslashes(trim("{$row['29']}"));
     $called_count = trim("{$row['30']}");
     $rank = trim("{$row['32']}");
     $owner = trim("{$row['33']}");
     $entry_list_id = trim("{$row['34']}");
     if ($entry_list_id < 100) {
         $entry_list_id = $list_id;
     }
 }
 if ($qc_features_active > 0) {
     //Added by Poundteam for Audited Comments
     ##### if list has audited comments, grab the audited comments
     require_once 'audit_comments.php';
     $ACcount = '';
     $ACcomments = '';
     $audit_comments_active = audit_comments_active($list_id, $format, $user, $mel, $NOW_TIME, $link, $server_ip, $session_name, $one_mysql_log);
     if ($audit_comments_active) {
         get_audited_comments($lead_id, $format, $user, $mel, $NOW_TIME, $link, $server_ip, $session_name, $one_mysql_log);
     }
     $ACcomments = strip_tags(htmlentities($ACcomments));
     $ACcomments = preg_replace("/\r/i", '', $ACcomments);
     $ACcomments = preg_replace("/\n/i", '!N', $ACcomments);
     //END Added by Poundteam for Audited Comments
 }
 ##### if lead is a callback, grab the callback comments
 $CBentry_time = '';
 $CBcallback_time = '';
 $CBuser = '';
 $CBcomments = '';
 $CBstatus = 0;
 $stmt = "SELECT count(*) FROM vicidial_statuses where status='{$dispo}' and scheduled_callback='Y';";