93b4094f by G Manojkumar

Created new tab for oncall sms and implemented

1 parent 8252849c
......@@ -87,7 +87,7 @@ class CreateCall extends Command {
} catch (Exception $e) {
Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
Log::error($e);
continue;
//continue;
}
}
......@@ -334,4 +334,4 @@ class CreateCall extends Command {
return $cnt;
}
}
\ No newline at end of file
}
......
......@@ -80,7 +80,7 @@ class PredictiveCallHangUp extends Command {
} catch (Exception $e) {
Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log");
Log::error($e);
continue;
//continue;
}
}
}
\ No newline at end of file
}
......
......@@ -161,7 +161,7 @@ class DialerController extends Controller {
}
if(!empty($users))
{
$searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>";
$searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\",'1234');</script>";
$searchresult.="<div id=internalid_matchlist></div><script>
doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){
......@@ -367,7 +367,7 @@ class DialerController extends Controller {
$newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline);
$searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\");</script>";
$searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\",\"".$callnumber."\");</script>";
......
......@@ -150,38 +150,45 @@ class RecordController extends Controller {
}
if($action=="sendsms")
{
$wakka = new KHRMSLib();
$mobile=Input::get("mobile");
$message=Input::get("message");
$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
$inputArray = ['userId'=>'hdfcbalrt',"pass"=>'hdfcbalrt25',"appid"=>"hdfcbalrt","subappid"=>"hdfcbalrt","contenttype"=>"1","to"=>$mobile,"from"=>"HDFCBK","text"=>$message,"selfid"=>"true","alert"=>"1","dlrreq"=>"true","intflag"=>"false"];
$number=Input::get('mobile');
$smsid=Input::get('smsid');
$smstext=DB::table('oncall_sms_template')->where('id','=',$smsid)->first();
$url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?';
$inputArray = [
'userId'=>'hdfcbalrt',
"pass"=>'hdfcbalrt25',
"appid"=>"hdfcbalrt",
"subappid"=>"hdfcbalrt",
"contenttype"=>"1",
"to"=>$number,
"from"=>"HDFCBK",
"text"=>$smstext->sms,
"selfid"=>"true",
"alert"=>"1",
"dlrreq"=>"true",
"intflag"=>"false"
];
$query = http_build_query($inputArray);
$url .= $query;
//echo $url;
// exit;
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 5);
// curl_setopt($ch,CURLOPT_TIMEOUT, 15);
$response = curl_exec($ch);
//echo "Kumar";
// var_dump($response);
//return "<script>simpleNotification('success','topRight',$response);</script>";
curl_close($ch);
return "<script>simpleNotification('success','topRight','Success');</script>";
} catch(Exception $e) {
//echo "Manoj";
$errormessage=$e->getMessage();
return "<script>simpleNotification('error','topRight','Failed to Send Message');</script>";
//var_dump($e->getMessage());
}
//return "<script>simpleNotification('success','topRight','Message is $mobile');</script>";
try{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3);
$response = curl_exec($ch);
curl_close($ch);
if($response!=''){
return "<script>simpleNotification('success','topRight','SMS Sent successfully!!');</script>";
}else{
return "<script>simpleNotification('error','topRight','SMS Failed to Send!!');</script>";
}
}catch(Exception $e) {
Log::info($e->getMessage());
}
}
}
......
......@@ -26,6 +26,7 @@ class KFormLib
private $emprecordScripts='';
private $HRExclusiveClients='';
public $FormSelectVals=array();
private $number='';
private $objcache=array();
......@@ -76,6 +77,7 @@ class KFormLib
$this->bkvarid=$this->getConfig('bkvarid',$config,'');
$this->emprecordScripts=$this->getConfig('emprecordScripts',$config,'');
$this->HRExclusiveClients=$this->getConfig('HRExclusiveClients',$config,'');
$this->number=$this->getConfig('number',$config,'');
$updatetime=time();
$this->recruitdata['modifylog'][$updatetime]=$this->gthis->GetUserName()."::";
......@@ -3360,9 +3362,14 @@ function createRLP()
}
function createSMSForm()
{
//echo "Manoj";
//echo "Manoj";
$dataarr=$this->recruitdata["peopledata"];
$data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'>
$number=$this->number;
//echo "number=".$number;
$smstemplates=DB::table('oncall_sms_template')->where('status','=','active')->select('sms','id')->get();
$data="";
$data.="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'>
<h5>SMS</h5>
<hr/><br>
......@@ -3376,15 +3383,17 @@ function createSMSForm()
<div style='clear:both;width:100%;'>
<div style='width:49%;float:left'>
<label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label>
<input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='mobilenumber'>
<input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='mobilenumber' value='".$number."' readonly>
</div>
</div>
<br><br>
<div style='clear:both;width:100%;'>
<div>
<label class='label-small_new' style='width:14%;font-weight:bold;'>Message</label>
<textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='message' rows='4'></textarea>
</div>
<div>";
foreach($smstemplates as $smstemplate){
//print_r($smstemplate->sms);
$data.="<input type='radio' name='templateid' value=".$smstemplate->id."><label>".$smstemplate->sms."</label>";
}
$data.="</div>
</div>
<br><br>
<div style='clear:both;width:100%;'>
......@@ -3392,14 +3401,24 @@ function createSMSForm()
</div>
</div>
<script>
$('#sendmessage').click(()=>{
var postdata='mobile='+$('#mobilenumber').val();
postdata+='&message='+$('#message').val();
doAjax('record?action=sendsms',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST');
postdata+='&smsid='+$('input[name=\"templateid\"]:checked').val();
var checkvalue=$('input[name=\"templateid\"]:checked').val();
//alert(checkvalue);
if(checkvalue === undefined){
alert('Please select any option');
}else{
//alert('entered');
doAjax('record?action=sendsms',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST');
//alert('your mobile number is given '+$('#mobilenumber').val());
//alert('your template is given '+$('input[name=\"templateid\"]:checked').val());
}
})
</script>";
......@@ -3580,9 +3599,9 @@ function CreateForm(&$frm)
{
$frm['One Assist']["{{id}} {{firstname}}"][]=array();
}
if(Auth::user()->username == "admin"){
$frm['SMS']["{{id}} {{firstname}}"][]=array();
}
}
}
......
......@@ -1251,11 +1251,11 @@ function searchRecruit(searchstr)
doAjax("hr/ManageRecruit",postdata,"recruitresult","rsajaxMutex","rsvarajax");
return false;
}
function showRecruit(varid)
function showRecruit(varid,number=0)
{
$("#divworking").html("");
if($("#client").length||$("#sel_client").length)window.open("home#h-"+varid);
else doAjax("record?action=show","blockname=NewRecruit&varid="+varid,"divworking");
else doAjax("record?action=show","blockname=NewRecruit&varid="+varid+"&number="+number,"divworking");
return false;
}
function showRecruitBK(varid)
......
......@@ -5,6 +5,7 @@ $wakka->setUserTimezone();
$themehome=$wakka->GetThemePath('/');
$varid=Input::get('varid');
$bkvarid=Input::get('bkvarid');
$number=Input::get('number');
$edituser=0;$noreaduser=0;$oldbkrec=0;
$isuser=$wakka->GetUser()?1:0;
......@@ -124,6 +125,7 @@ $config['oldbkrec']=$oldbkrec;
$config['bkvarid']=$bkvarid;
$config['emprecordScripts']=$wakka->HRCoreVars['emprecordScripts'];
$config['HRExclusiveClients']=$wakka->HRCoreVars['HRExclusiveClients'];
$config['number']=$number;
$kformlib->data($config);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!