by Khanyasi » Thu Oct 12, 2017 3:02 pm
Hi William here i have the custom code which was added to it i thought let me show you this code it might help before i look for a coder
if ($function == 'carrier_dump')
{
$stmt="SELECT dialplan_entry from vicidial_server_carriers WHERE carrier_id='Modulis1';";
$rslt=mysql_query($stmt, $link) or die("could not execute: $stmt " . mysql_error());
$row=mysql_fetch_row($rslt);
echo nl2br($row[0]);
exit;
}
if ($function == 'camponoff')
{
if (strlen($campaign_id) > 0 && strlen($active) > 0 && ($active =='Y' || $active == 'N'))
{
if ($active == 'Y')
{
$isactive = "Activated";
}
else
{
$isactive = "DeActivated";
}
$stmt="UPDATE vicidial_campaigns SET active = '$active' WHERE campaign_id = '$campaign_id';";
$rslt=mysql_query($stmt, $link) or die("could not execute: $stmt " . mysql_error());
printf ("Success Campaign $campaign_id has been $isactive <BR>");
}
if (strlen($campaign_id) == 0)
{
printf ("ERROR No Campaign ID<BR>");
}
if (strlen($active) == 0)
{
printf ("ERROR No Active flag<BR>");
}
if ($active !='Y')
{
if($active != 'N')
{
printf ("ERROR Incorrect Active Flag: $active <BR>");
}
}
exit;
}
if ($function == 'calllogdump')
{
#$stmt="SELECT * from vicidial_log where processed = 'N' AND limit 1000;";
$stmt ="select vicidial_log.uniqueid,left(vicidial_list.vendor_lead_code,7), left(vicidial_log.call_date,10),right(vicidial_log.call_date,8), vicidial_log.user, CONCAT('IVR TEL -- ',vicidial_log.phone_number,' -- ',vicidial_log.status),vicidial_list.source_id
from vicidial_log, vicidial_list
where vicidial_log.lead_id = vicidial_list.lead_id
and (vicidial_log.processed = 'N')
and vicidial_log.user = 'VDAD'
order by call_date limit 10000;";
$rslt=mysql_query($stmt, $link) or die("could not execute: $stmt " . mysql_error());
$num_rows = mysql_num_rows($rslt);
$count= 0;
while ($count < $num_rows)
{
$row=mysql_fetch_row($rslt);
$date = date('Y-m-d H:i:s', time());
printf("$row[0]|$row[1]|$row[2]|$row[3]|$row[4]|$row[5]|$row[6]|$row[7]<BR>")
;
$count++;
}
exit;
}
if ($function == 'calllogmark')
{
$vendor_lead_code = ereg_replace('"','',$vendor_lead_code);
$nosuccess = 0;
if ($vendor_lead_code == '')
{
printf ("ERROR<BR>");
$nosuccess = 1;
}
printf("Unique ID: $vendor_lead_code <BR>");
$stmt ="UPDATE vicidial_log set processed = 'Y',comments = NOW() where uniqueid = '$vendor_lead_code';";
$rslt=mysql_query($stmt, $link) or die("could not execute: $stmt " . mysql_error());
if ($nosuccess == 0)
{
printf("SUCCESS<BR>");
}
exit;
}