Created new tab for oncall sms and implemented
Showing
7 changed files
with
78 additions
and
50 deletions
| ... | @@ -87,7 +87,7 @@ class CreateCall extends Command { | ... | @@ -87,7 +87,7 @@ class CreateCall extends Command { |
| 87 | } catch (Exception $e) { | 87 | } catch (Exception $e) { |
| 88 | Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log"); | 88 | Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log"); |
| 89 | Log::error($e); | 89 | Log::error($e); |
| 90 | continue; | 90 | //continue; |
| 91 | } | 91 | } |
| 92 | } | 92 | } |
| 93 | 93 | ||
| ... | @@ -334,4 +334,4 @@ class CreateCall extends Command { | ... | @@ -334,4 +334,4 @@ class CreateCall extends Command { |
| 334 | 334 | ||
| 335 | return $cnt; | 335 | return $cnt; |
| 336 | } | 336 | } |
| 337 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 337 | } | ... | ... |
| ... | @@ -80,7 +80,7 @@ class PredictiveCallHangUp extends Command { | ... | @@ -80,7 +80,7 @@ class PredictiveCallHangUp extends Command { |
| 80 | } catch (Exception $e) { | 80 | } catch (Exception $e) { |
| 81 | Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log"); | 81 | Log::useFiles(storage_path()."/logs/predictive_".date("Y_m_d").".log"); |
| 82 | Log::error($e); | 82 | Log::error($e); |
| 83 | continue; | 83 | //continue; |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 86 | } | ... | ... |
| ... | @@ -161,7 +161,7 @@ class DialerController extends Controller { | ... | @@ -161,7 +161,7 @@ class DialerController extends Controller { |
| 161 | } | 161 | } |
| 162 | if(!empty($users)) | 162 | if(!empty($users)) |
| 163 | { | 163 | { |
| 164 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>"; | 164 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\",'1234');</script>"; |
| 165 | 165 | ||
| 166 | $searchresult.="<div id=internalid_matchlist></div><script> | 166 | $searchresult.="<div id=internalid_matchlist></div><script> |
| 167 | doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | 167 | 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 { | ... | @@ -367,7 +367,7 @@ class DialerController extends Controller { |
| 367 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); | 367 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); |
| 368 | 368 | ||
| 369 | 369 | ||
| 370 | $searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\");</script>"; | 370 | $searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\",\"".$callnumber."\");</script>"; |
| 371 | 371 | ||
| 372 | 372 | ||
| 373 | 373 | ... | ... |
| ... | @@ -150,38 +150,45 @@ class RecordController extends Controller { | ... | @@ -150,38 +150,45 @@ class RecordController extends Controller { |
| 150 | } | 150 | } |
| 151 | if($action=="sendsms") | 151 | if($action=="sendsms") |
| 152 | { | 152 | { |
| 153 | $wakka = new KHRMSLib(); | 153 | $number=Input::get('mobile'); |
| 154 | 154 | $smsid=Input::get('smsid'); | |
| 155 | $mobile=Input::get("mobile"); | 155 | $smstext=DB::table('oncall_sms_template')->where('id','=',$smsid)->first(); |
| 156 | $message=Input::get("message"); | 156 | |
| 157 | $url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; | 157 | $url = 'https://10.2.55.165:443/servlet/com.aclwireless.pushconnectivity.listeners.TextListener?'; |
| 158 | $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"]; | 158 | |
| 159 | $inputArray = [ | ||
| 160 | 'userId'=>'hdfcbalrt', | ||
| 161 | "pass"=>'hdfcbalrt25', | ||
| 162 | "appid"=>"hdfcbalrt", | ||
| 163 | "subappid"=>"hdfcbalrt", | ||
| 164 | "contenttype"=>"1", | ||
| 165 | "to"=>$number, | ||
| 166 | "from"=>"HDFCBK", | ||
| 167 | "text"=>$smstext->sms, | ||
| 168 | "selfid"=>"true", | ||
| 169 | "alert"=>"1", | ||
| 170 | "dlrreq"=>"true", | ||
| 171 | "intflag"=>"false" | ||
| 172 | ]; | ||
| 159 | $query = http_build_query($inputArray); | 173 | $query = http_build_query($inputArray); |
| 160 | $url .= $query; | 174 | $url .= $query; |
| 161 | 175 | try{ | |
| 162 | //echo $url; | 176 | $ch = curl_init(); |
| 163 | // exit; | 177 | curl_setopt($ch, CURLOPT_URL, $url); |
| 164 | 178 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
| 165 | try{ | 179 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
| 166 | $ch = curl_init(); | 180 | curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,3); |
| 167 | curl_setopt($ch, CURLOPT_URL, $url); | 181 | $response = curl_exec($ch); |
| 168 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | 182 | |
| 169 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | 183 | curl_close($ch); |
| 170 | // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 5); | 184 | if($response!=''){ |
| 171 | // curl_setopt($ch,CURLOPT_TIMEOUT, 15); | 185 | return "<script>simpleNotification('success','topRight','SMS Sent successfully!!');</script>"; |
| 172 | $response = curl_exec($ch); | 186 | }else{ |
| 173 | //echo "Kumar"; | 187 | return "<script>simpleNotification('error','topRight','SMS Failed to Send!!');</script>"; |
| 174 | // var_dump($response); | 188 | } |
| 175 | //return "<script>simpleNotification('success','topRight',$response);</script>"; | 189 | }catch(Exception $e) { |
| 176 | curl_close($ch); | 190 | Log::info($e->getMessage()); |
| 177 | return "<script>simpleNotification('success','topRight','Success');</script>"; | 191 | } |
| 178 | } catch(Exception $e) { | ||
| 179 | //echo "Manoj"; | ||
| 180 | $errormessage=$e->getMessage(); | ||
| 181 | return "<script>simpleNotification('error','topRight','Failed to Send Message');</script>"; | ||
| 182 | //var_dump($e->getMessage()); | ||
| 183 | } | ||
| 184 | //return "<script>simpleNotification('success','topRight','Message is $mobile');</script>"; | ||
| 185 | } | 192 | } |
| 186 | 193 | ||
| 187 | } | 194 | } | ... | ... |
| ... | @@ -26,6 +26,7 @@ class KFormLib | ... | @@ -26,6 +26,7 @@ class KFormLib |
| 26 | private $emprecordScripts=''; | 26 | private $emprecordScripts=''; |
| 27 | private $HRExclusiveClients=''; | 27 | private $HRExclusiveClients=''; |
| 28 | public $FormSelectVals=array(); | 28 | public $FormSelectVals=array(); |
| 29 | private $number=''; | ||
| 29 | 30 | ||
| 30 | private $objcache=array(); | 31 | private $objcache=array(); |
| 31 | 32 | ||
| ... | @@ -76,6 +77,7 @@ class KFormLib | ... | @@ -76,6 +77,7 @@ class KFormLib |
| 76 | $this->bkvarid=$this->getConfig('bkvarid',$config,''); | 77 | $this->bkvarid=$this->getConfig('bkvarid',$config,''); |
| 77 | $this->emprecordScripts=$this->getConfig('emprecordScripts',$config,''); | 78 | $this->emprecordScripts=$this->getConfig('emprecordScripts',$config,''); |
| 78 | $this->HRExclusiveClients=$this->getConfig('HRExclusiveClients',$config,''); | 79 | $this->HRExclusiveClients=$this->getConfig('HRExclusiveClients',$config,''); |
| 80 | $this->number=$this->getConfig('number',$config,''); | ||
| 79 | 81 | ||
| 80 | $updatetime=time(); | 82 | $updatetime=time(); |
| 81 | $this->recruitdata['modifylog'][$updatetime]=$this->gthis->GetUserName()."::"; | 83 | $this->recruitdata['modifylog'][$updatetime]=$this->gthis->GetUserName()."::"; |
| ... | @@ -3360,9 +3362,14 @@ function createRLP() | ... | @@ -3360,9 +3362,14 @@ function createRLP() |
| 3360 | } | 3362 | } |
| 3361 | function createSMSForm() | 3363 | function createSMSForm() |
| 3362 | { | 3364 | { |
| 3363 | //echo "Manoj"; | 3365 | //echo "Manoj"; |
| 3366 | |||
| 3364 | $dataarr=$this->recruitdata["peopledata"]; | 3367 | $dataarr=$this->recruitdata["peopledata"]; |
| 3365 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | 3368 | $number=$this->number; |
| 3369 | //echo "number=".$number; | ||
| 3370 | $smstemplates=DB::table('oncall_sms_template')->where('status','=','active')->select('sms','id')->get(); | ||
| 3371 | $data=""; | ||
| 3372 | $data.="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | ||
| 3366 | <h5>SMS</h5> | 3373 | <h5>SMS</h5> |
| 3367 | <hr/><br> | 3374 | <hr/><br> |
| 3368 | 3375 | ||
| ... | @@ -3376,15 +3383,17 @@ function createSMSForm() | ... | @@ -3376,15 +3383,17 @@ function createSMSForm() |
| 3376 | <div style='clear:both;width:100%;'> | 3383 | <div style='clear:both;width:100%;'> |
| 3377 | <div style='width:49%;float:left'> | 3384 | <div style='width:49%;float:left'> |
| 3378 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label> | 3385 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label> |
| 3379 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='mobilenumber'> | 3386 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='mobilenumber' value='".$number."' readonly> |
| 3380 | </div> | 3387 | </div> |
| 3381 | </div> | 3388 | </div> |
| 3382 | <br><br> | 3389 | <br><br> |
| 3383 | <div style='clear:both;width:100%;'> | 3390 | <div style='clear:both;width:100%;'> |
| 3384 | <div> | 3391 | <div>"; |
| 3385 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Message</label> | 3392 | foreach($smstemplates as $smstemplate){ |
| 3386 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='message' rows='4'></textarea> | 3393 | //print_r($smstemplate->sms); |
| 3387 | </div> | 3394 | $data.="<input type='radio' name='templateid' value=".$smstemplate->id."><label>".$smstemplate->sms."</label>"; |
| 3395 | } | ||
| 3396 | $data.="</div> | ||
| 3388 | </div> | 3397 | </div> |
| 3389 | <br><br> | 3398 | <br><br> |
| 3390 | <div style='clear:both;width:100%;'> | 3399 | <div style='clear:both;width:100%;'> |
| ... | @@ -3392,14 +3401,24 @@ function createSMSForm() | ... | @@ -3392,14 +3401,24 @@ function createSMSForm() |
| 3392 | </div> | 3401 | </div> |
| 3393 | </div> | 3402 | </div> |
| 3394 | <script> | 3403 | <script> |
| 3404 | |||
| 3395 | $('#sendmessage').click(()=>{ | 3405 | $('#sendmessage').click(()=>{ |
| 3396 | var postdata='mobile='+$('#mobilenumber').val(); | 3406 | var postdata='mobile='+$('#mobilenumber').val(); |
| 3397 | postdata+='&message='+$('#message').val(); | 3407 | postdata+='&smsid='+$('input[name=\"templateid\"]:checked').val(); |
| 3398 | doAjax('record?action=sendsms',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 3408 | var checkvalue=$('input[name=\"templateid\"]:checked').val(); |
| 3409 | //alert(checkvalue); | ||
| 3410 | if(checkvalue === undefined){ | ||
| 3411 | alert('Please select any option'); | ||
| 3412 | |||
| 3413 | }else{ | ||
| 3414 | //alert('entered'); | ||
| 3415 | doAjax('record?action=sendsms',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | ||
| 3399 | 3416 | ||
| 3400 | //alert('your mobile number is given '+$('#mobilenumber').val()); | 3417 | //alert('your template is given '+$('input[name=\"templateid\"]:checked').val()); |
| 3418 | } | ||
| 3401 | 3419 | ||
| 3402 | }) | 3420 | }) |
| 3421 | |||
| 3403 | </script>"; | 3422 | </script>"; |
| 3404 | 3423 | ||
| 3405 | 3424 | ||
| ... | @@ -3580,9 +3599,9 @@ function CreateForm(&$frm) | ... | @@ -3580,9 +3599,9 @@ function CreateForm(&$frm) |
| 3580 | { | 3599 | { |
| 3581 | $frm['One Assist']["{{id}} {{firstname}}"][]=array(); | 3600 | $frm['One Assist']["{{id}} {{firstname}}"][]=array(); |
| 3582 | } | 3601 | } |
| 3583 | if(Auth::user()->username == "admin"){ | 3602 | |
| 3584 | $frm['SMS']["{{id}} {{firstname}}"][]=array(); | 3603 | $frm['SMS']["{{id}} {{firstname}}"][]=array(); |
| 3585 | } | 3604 | |
| 3586 | } | 3605 | } |
| 3587 | } | 3606 | } |
| 3588 | 3607 | ... | ... |
| ... | @@ -1251,11 +1251,11 @@ function searchRecruit(searchstr) | ... | @@ -1251,11 +1251,11 @@ function searchRecruit(searchstr) |
| 1251 | doAjax("hr/ManageRecruit",postdata,"recruitresult","rsajaxMutex","rsvarajax"); | 1251 | doAjax("hr/ManageRecruit",postdata,"recruitresult","rsajaxMutex","rsvarajax"); |
| 1252 | return false; | 1252 | return false; |
| 1253 | } | 1253 | } |
| 1254 | function showRecruit(varid) | 1254 | function showRecruit(varid,number=0) |
| 1255 | { | 1255 | { |
| 1256 | $("#divworking").html(""); | 1256 | $("#divworking").html(""); |
| 1257 | if($("#client").length||$("#sel_client").length)window.open("home#h-"+varid); | 1257 | if($("#client").length||$("#sel_client").length)window.open("home#h-"+varid); |
| 1258 | else doAjax("record?action=show","blockname=NewRecruit&varid="+varid,"divworking"); | 1258 | else doAjax("record?action=show","blockname=NewRecruit&varid="+varid+"&number="+number,"divworking"); |
| 1259 | return false; | 1259 | return false; |
| 1260 | } | 1260 | } |
| 1261 | function showRecruitBK(varid) | 1261 | function showRecruitBK(varid) | ... | ... |
| ... | @@ -5,6 +5,7 @@ $wakka->setUserTimezone(); | ... | @@ -5,6 +5,7 @@ $wakka->setUserTimezone(); |
| 5 | $themehome=$wakka->GetThemePath('/'); | 5 | $themehome=$wakka->GetThemePath('/'); |
| 6 | $varid=Input::get('varid'); | 6 | $varid=Input::get('varid'); |
| 7 | $bkvarid=Input::get('bkvarid'); | 7 | $bkvarid=Input::get('bkvarid'); |
| 8 | $number=Input::get('number'); | ||
| 8 | 9 | ||
| 9 | $edituser=0;$noreaduser=0;$oldbkrec=0; | 10 | $edituser=0;$noreaduser=0;$oldbkrec=0; |
| 10 | $isuser=$wakka->GetUser()?1:0; | 11 | $isuser=$wakka->GetUser()?1:0; |
| ... | @@ -124,6 +125,7 @@ $config['oldbkrec']=$oldbkrec; | ... | @@ -124,6 +125,7 @@ $config['oldbkrec']=$oldbkrec; |
| 124 | $config['bkvarid']=$bkvarid; | 125 | $config['bkvarid']=$bkvarid; |
| 125 | $config['emprecordScripts']=$wakka->HRCoreVars['emprecordScripts']; | 126 | $config['emprecordScripts']=$wakka->HRCoreVars['emprecordScripts']; |
| 126 | $config['HRExclusiveClients']=$wakka->HRCoreVars['HRExclusiveClients']; | 127 | $config['HRExclusiveClients']=$wakka->HRCoreVars['HRExclusiveClients']; |
| 128 | $config['number']=$number; | ||
| 127 | 129 | ||
| 128 | $kformlib->data($config); | 130 | $kformlib->data($config); |
| 129 | 131 | ... | ... |
-
Please register or sign in to post a comment