c28829f5 by Yashwant

Merge branch 'master' of http://54.197.18.130/yashwant/hdfc

2 parents 96065cd6 e160c0bd
......@@ -115,7 +115,7 @@ class DialerController extends Controller {
altphone7 like '%".substr($callnumber,-10)."' OR
altphone8 like '%".substr($callnumber,-10)."' OR
altphone9 like '%".substr($callnumber,-10)."' OR
altphone10 like '%".substr($callnumber,-10)."') and id=$crmid ");
altphone10 like '%".substr($callnumber,-10)."') and id=$crmid $roclientstr ");
/*$tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR
altphone1 like '%$callnumber' OR
altphone2 like '%$callnumber' OR
......@@ -141,7 +141,7 @@ class DialerController extends Controller {
altphone7 like '%".substr($callnumber,-10)."' OR
altphone8 like '%".substr($callnumber,-10)."' OR
altphone9 like '%".substr($callnumber,-10)."' OR
altphone10 like '%".substr($callnumber,-10)."' ");
altphone10 like '%".substr($callnumber,-10)."' $roclientstr");
/*$tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' OR
altphone1 like '%$callnumber' OR
altphone2 like '%$callnumber' OR
......@@ -758,10 +758,10 @@ if($action=="recarchive")
}
public function show($id)
{
/*if(time()>strtotime('14:30:00') || time()<strtotime('03:30:00'))
if(time()>strtotime('14:30:00') || time()<strtotime('03:30:00'))
{
Session::flush();
}*/
}
if($id=="bucketdata")
{
......@@ -834,7 +834,7 @@ public function show($id)
$dbres=array();
if($bucket=="CurrentQueue")$dbres=$this->getCallSequencing(20);
else if($bucket=="Priority")$dbres=$wakka->getPersons("priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr limit $bs,$bl");
else if($bucket=="Priority")$dbres=$wakka->getPersons("priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr ORDER BY FIELD(priority,10,9,8,7,6,5,4,3,2,1) limit $bs,$bl");
else if($bucket=="TotalData")$dbres=$wakka->getPersons("1=1 and currentstatus='$currentstatus' and legalstatus='$legalstatus' and status!='Noqueue' $owclientstr limit $bs,$bl");
else if($bucket=="SearchData")$dbres=$wakka->getPersons("1=1 $roclientstrAll $skey limit $bs,$bl");
else if($bucket=="NotCalled")$dbres=$wakka->getPersons("status='New' and currentstatus='$currentstatus' and legalstatus='$legalstatus' $owclientstr limit $bs,$bl");
......@@ -1088,13 +1088,13 @@ public function show($id)
return view("layout.module.dialer.questairereport",array());
}
if($id=="callmanagement")
{
return view("layout.module.dialer.callmanagementreport",array());
}
{
return view("layout.module.dialer.callmanagementreport",array());
}
if($id=="supmessages")
{
return view("layout.module.dialer.supmessagesreport",array());
}
{
return view("layout.module.dialer.supmessagesreport",array());
}
if($id=='playrecfile')
{
......@@ -1145,14 +1145,14 @@ public function show($id)
if($type != "" && $id != ""){
if($type == "category"){
$output = "<option value=''>Select Category</option>";
$category = DB::table("relationship_category")->where("service_id",$id)->where("title","!=","")->where("status","=","Active")->get();
$category = DB::table("relationship_category")->where("service_id",$id)->where("title","!=","")->get();
foreach($category as $cat){
$output .= "<option value='".$cat->id."'>".$cat->title."</option>";
}
return $output;
}else if($type == "subCategory"){
$output = "<option value=''>Select Sub Category</option>";
$subCategory = DB::table("relationship_sub_category")->where("category_id",$id)->where("title","!=","")->where("status","=","Active")->get();
$subCategory = DB::table("relationship_sub_category")->where("category_id",$id)->where("title","!=","")->get();
foreach($subCategory as $cat){
$output .= "<option value='".$cat->title."'>".$cat->title."</option>";
}
......@@ -1172,6 +1172,7 @@ public function show($id)
$dbres=array();
$wakka = new KHRMSLib();
$rows="";
$owclientstr=array();
$oclientlst=$wakka->clientsOwnerRWAccess();
......@@ -1252,7 +1253,7 @@ public function show($id)
$reccrm_ids[] = "'".$recordValue[0]->id."'";
}
else{
$dbres[]=array('client'=>$lcall->client,'mobile'=>substr($lcall->number,-10),'callid'=>$lcall->id,'datetime'=>$lcall->updated_at);
$dbres[]=array('client'=>$lcall->client,'mobile'=>substr($lcall->number,-10),'callid'=>$lcall->id,'modified'=>$lcall->updated_at);
}
}
}
......@@ -1262,13 +1263,14 @@ public function show($id)
{
$recids_str = implode(",", $reccrm_ids);
$rec=$wakka->getPersons("id in ($recids_str)");
$dbres = array_merge($dbres,$rec);
$mobile="";
foreach ($dbres as $dbrow)
{
$mobile.= $dbrow['mobile']."-".$dbrow['client']."-".$dbrow['datetime'].",";
$mobile.= $dbrow['mobile']."-".$dbrow['client']."-".$dbrow['modified'].",";
}
return "<script>alert('Missed call is pending for :-----".$mobile." !')</script>";
//echo "<pre>".print_r($dbres)."</pre>";
......
......@@ -80,35 +80,43 @@ class QuestionareController extends Controller
{
//return "<script>simpleNotification('Alert','topRight','Get on call first!!')</script>";
}
if($call_status=='ANSWER' && $call_id !="")
{
foreach($questionArray as $key=> $quesArray)
{
$explodeQues = explode("-", $key);
foreach($questionArray as $key=> $quesArray)
{
$explodeQues = explode("-", $key);
$ques = $explodeQues[1];
$questionid='';
$questioncallid='';
$ques = $explodeQues[1];
$questionid='';
$questioncallid='';
$questiondetails=DB::table("questionaire_details")->where("cust_id","=",$cust_id)->where("call_id","=",$call_id)->where("question","=",$ques)->select('call_id','question')->first();
if($questiondetails)
{
$questioncallid=$questiondetails->call_id;
$questionid=$questiondetails->question;
$questiondetails=DB::table("questionaire_details")->where("cust_id","=",$cust_id)->where("call_id","=",$call_id)->where("question","=",$ques)->select('call_id','question')->first();
if($questiondetails)
{
$questioncallid=$questiondetails->call_id;
$questionid=$questiondetails->question;
//echo $questioncallid."---".$questionid;
}
//echo $questioncallid."---".$questionid;
}
if($questioncallid==$call_id && $questionid==$ques)
{
DB::statement("update questionaire_details set created_at='".date("Y-m-d H:i:s")."', updated_at='".date("Y-m-d H:i:s")."', user_id='".$user_id."',cust_id='".$cust_id."',call_id='".$call_id."',name='".$name."',number='".$mobile."',question_time='".$questionDateTime."',question='".$ques."',primary_question='".$quesArray->prim_ques."',primary_response='".trim($quesArray->prim_response)."',primary_text='".$quesArray->prim_txt."',followup1_question='".$quesArray->fol1_ques."',followup1_response='".trim($quesArray->fol1_response)."',followup1_text='".$quesArray->fol1_txt."',followup2_question='".$quesArray->fol2_ques."',followup2_response='".trim($quesArray->fol1_response)."',followup2_text='".$quesArray->fol2_txt."',followup3_question='".$quesArray->fol3_ques."',followup3_response='".trim($quesArray->fol1_response)."',followup3_text='".$quesArray->fol3_txt."',followup4_question='".$quesArray->fol4_ques."',followup4_response='".trim($quesArray->fol4_response)."',followup4_text='".$quesArray->fol4_txt."',followup5_question='".$quesArray->fol5_ques."',followup5_response='".trim($quesArray->fol5_response)."',followup5_text='".$quesArray->fol5_txt."',followup6_question='".$quesArray->fol6_ques."',followup6_response='".trim($quesArray->fol6_response)."',followup6_text='".$quesArray->fol6_txt."',followup7_question='".$quesArray->fol7_ques."',followup7_response='".trim($quesArray->fol7_response)."',followup7_text='".$quesArray->fol7_txt."' where call_id='".$call_id."' and question='".$ques."' and cust_id='".$cust_id."' ");
}
else
{
DB::statement("insert into questionaire_details set created_at='".date("Y-m-d H:i:s")."', updated_at='".date("Y-m-d H:i:s")."', user_id='".$user_id."',cust_id='".$cust_id."',call_id='".$call_id."',name='".$name."',number='".$mobile."',question_time='".$questionDateTime."',question='".$ques."',primary_question='".$quesArray->prim_ques."',primary_response='".trim($quesArray->prim_response)."',primary_text='".$quesArray->prim_txt."',followup1_question='".$quesArray->fol1_ques."',followup1_response='".trim($quesArray->fol1_response)."',followup1_text='".$quesArray->fol1_txt."',followup2_question='".$quesArray->fol2_ques."',followup2_response='".trim($quesArray->fol1_response)."',followup2_text='".$quesArray->fol2_txt."',followup3_question='".$quesArray->fol3_ques."',followup3_response='".trim($quesArray->fol1_response)."',followup3_text='".$quesArray->fol3_txt."',followup4_question='".$quesArray->fol4_ques."',followup4_response='".trim($quesArray->fol4_response)."',followup4_text='".$quesArray->fol4_txt."',followup5_question='".$quesArray->fol5_ques."',followup5_response='".trim($quesArray->fol5_response)."',followup5_text='".$quesArray->fol5_txt."',followup6_question='".$quesArray->fol6_ques."',followup6_response='".trim($quesArray->fol6_response)."',followup6_text='".$quesArray->fol6_txt."',followup7_question='".$quesArray->fol7_ques."',followup7_response='".trim($quesArray->fol7_response)."',followup7_text='".$quesArray->fol7_txt."'");
}
}
return "<div class='alert alert-success'><strong>All Questions Saved Successfully!</strong></div>";
if($questioncallid==$call_id && $questionid==$ques)
{
DB::statement("update questionaire_details set updated_at='".date("Y-m-d H:i:s")."', user_id='".$user_id."',cust_id='".$cust_id."',call_id='".$call_id."',name='".$name."',number='".$mobile."',question_time='".$questionDateTime."',question='".$ques."',primary_question='".$quesArray->prim_ques."',primary_response='".trim($quesArray->prim_response)."',primary_text='".$quesArray->prim_txt."',followup1_question='".$quesArray->fol1_ques."',followup1_response='".trim($quesArray->fol1_response)."',followup1_text='".$quesArray->fol1_txt."',followup2_question='".$quesArray->fol2_ques."',followup2_response='".trim($quesArray->fol1_response)."',followup2_text='".$quesArray->fol2_txt."',followup3_question='".$quesArray->fol3_ques."',followup3_response='".trim($quesArray->fol1_response)."',followup3_text='".$quesArray->fol3_txt."',followup4_question='".$quesArray->fol4_ques."',followup4_response='".trim($quesArray->fol4_response)."',followup4_text='".$quesArray->fol4_txt."',followup5_question='".$quesArray->fol5_ques."',followup5_response='".trim($quesArray->fol5_response)."',followup5_text='".$quesArray->fol5_txt."',followup6_question='".$quesArray->fol6_ques."',followup6_response='".trim($quesArray->fol6_response)."',followup6_text='".$quesArray->fol6_txt."',followup7_question='".$quesArray->fol7_ques."',followup7_response='".trim($quesArray->fol7_response)."',followup7_text='".$quesArray->fol7_txt."' where call_id='".$call_id."' and question='".$ques."' and cust_id='".$cust_id."' ");
}
else
{
DB::statement("insert into questionaire_details set created_at='".date("Y-m-d H:i:s")."', updated_at='".date("Y-m-d H:i:s")."', user_id='".$user_id."',cust_id='".$cust_id."',call_id='".$call_id."',name='".$name."',number='".$mobile."',question_time='".$questionDateTime."',question='".$ques."',primary_question='".$quesArray->prim_ques."',primary_response='".trim($quesArray->prim_response)."',primary_text='".$quesArray->prim_txt."',followup1_question='".$quesArray->fol1_ques."',followup1_response='".trim($quesArray->fol1_response)."',followup1_text='".$quesArray->fol1_txt."',followup2_question='".$quesArray->fol2_ques."',followup2_response='".trim($quesArray->fol1_response)."',followup2_text='".$quesArray->fol2_txt."',followup3_question='".$quesArray->fol3_ques."',followup3_response='".trim($quesArray->fol1_response)."',followup3_text='".$quesArray->fol3_txt."',followup4_question='".$quesArray->fol4_ques."',followup4_response='".trim($quesArray->fol4_response)."',followup4_text='".$quesArray->fol4_txt."',followup5_question='".$quesArray->fol5_ques."',followup5_response='".trim($quesArray->fol5_response)."',followup5_text='".$quesArray->fol5_txt."',followup6_question='".$quesArray->fol6_ques."',followup6_response='".trim($quesArray->fol6_response)."',followup6_text='".$quesArray->fol6_txt."',followup7_question='".$quesArray->fol7_ques."',followup7_response='".trim($quesArray->fol7_response)."',followup7_text='".$quesArray->fol7_txt."'");
}
}
return "<div class='alert alert-success'><strong>All Questions Saved Successfully!</strong></div>";
}
else
{
return "<script>simpleNotification('error','topRight','Please Get on call first');</script>";
}
}
}
......
......@@ -23,68 +23,88 @@ class RacingCustomerController extends Controller
public function saveRacingCustomer()
{
//$product_code = Input::get("product_code");
$pb_name = Input::get("pb_name");
$pb_code = Input::get("pb_code");
$pb_landline_contact_no = Input::get("pb_landline_contact_no");
$supervisor_mail_id = Input::get("supervisor_mail_id");
$group_id = Input::get("group_id");
$group_id_name = Input::get("group_id_name");
$cust_id = Input::get("cust_id");
$cust_name = Input::get("cust_name");
$relationship_with_group_id = Input::get("relationship_with_group_id");
$cust_id_next = Input::get("cust_id_next");
$cust_name_next = Input::get("cust_name_next");
$relationship_with_group_id_next = Input::get("relationship_with_group_id_next");
$new_group_addition_to_group = Input::get("new_group_addition_to_group");
$racing_from = Input::get("racing_from");
//$product_code = Input::get("product_code");
$pb_name = Input::get("pb_name");
$pb_code = Input::get("pb_code");
$pb_landline_contact_no = Input::get("pb_landline_contact_no");
$supervisor_mail_id = Input::get("supervisor_mail_id");
$group_id = Input::get("group_id");
$group_id_name = Input::get("group_id_name");
$cust_id = Input::get("cust_id");
$cust_name = Input::get("cust_name");
$relationship_with_group_id = Input::get("relationship_with_group_id");
$cust_id_next = Input::get("cust_id_next");
$cust_name_next = Input::get("cust_name_next");
$relationship_with_group_id_next = Input::get("relationship_with_group_id_next");
$new_group_addition_to_group = Input::get("new_group_addition_to_group");
$racing_from = Input::get("racing_from");
$user_id = Auth::user()->username;
$clientcode = Input::get('clientcode');
$mobile = Input::get('mobile');
$client = Input::get('client');
if($pb_name=="")return "<script>simpleNotification('error','topRight','please enter pb name');</script>";
if($pb_code=="")return "<script>simpleNotification('error','topRight','please enter pb code');</script>";
if($pb_landline_contact_no=="")return "<script>simpleNotification('error','topRight','please enter PB landline Contact No.');</script>";
if($supervisor_mail_id=="")return "<script>simpleNotification('error','topRight','please enter Supervisor Mail ID');</script>";
if($group_id=="")return "<script>simpleNotification('error','topRight','please enter Group ID');</script>";
if($group_id_name=="")return "<script>simpleNotification('error','topRight','please enter Group ID Name');</script>";
if($cust_id=="")return "<script>simpleNotification('error','topRight','please enter Cust ID');</script>";
if($cust_name=="")return "<script>simpleNotification('error','topRight','please enter Cust Name');</script>";
if($relationship_with_group_id=="")return "<script>simpleNotification('error','topRight','please enter Relationship With Group ID');</script>";
if($cust_id_next=="")return "<script>simpleNotification('error','topRight','please enter Cust ID');</script>";
if($cust_name_next=="")return "<script>simpleNotification('error','topRight','please enter Cust Name');</script>";
if($relationship_with_group_id_next=="")return "<script>simpleNotification('error','topRight','please enter Relationship With Group ID');</script>";
if($new_group_addition_to_group=="")return "<script>simpleNotification('error','topRight','please select Grouping');</script>";
if($racing_from=="")return "<script>simpleNotification('error','topRight','please enter Racing From');</script>";
if($pb_name=="")return "<script>simpleNotification('error','topRight','please enter pb name');</script>";
if($pb_code=="")return "<script>simpleNotification('error','topRight','please enter pb code');</script>";
if($pb_landline_contact_no=="")return "<script>simpleNotification('error','topRight','please enter PB landline Contact No.');</script>";
if($supervisor_mail_id=="")return "<script>simpleNotification('error','topRight','please enter Supervisor Mail ID');</script>";
if($group_id=="")return "<script>simpleNotification('error','topRight','please enter Group ID');</script>";
if($group_id_name=="")return "<script>simpleNotification('error','topRight','please enter Group ID Name');</script>";
if($cust_id=="")return "<script>simpleNotification('error','topRight','please enter Cust ID');</script>";
if($cust_name=="")return "<script>simpleNotification('error','topRight','please enter Cust Name');</script>";
if($relationship_with_group_id=="")return "<script>simpleNotification('error','topRight','please enter Relationship With Group ID');</script>";
if($cust_id_next=="")return "<script>simpleNotification('error','topRight','please enter Cust ID');</script>";
if($cust_name_next=="")return "<script>simpleNotification('error','topRight','please enter Cust Name');</script>";
if($relationship_with_group_id_next=="")return "<script>simpleNotification('error','topRight','please enter Relationship With Group ID');</script>";
if($new_group_addition_to_group=="")return "<script>simpleNotification('error','topRight','please select Grouping');</script>";
if($racing_from=="")return "<script>simpleNotification('error','topRight','please enter Racing From');</script>";
$crmcallDetails=CRMCall::where('number','like','%'.substr($mobile,-10).'%')->orderBy("created_at","DESC")->first();
$setracingCutomer = array();
if($crmcallDetails)
{
$call_id = $crmcallDetails->id;
$call_status = $crmcallDetails->status;
$crm_id = $crmcallDetails->crm_id;
}
$setracingCutomer[]="date='".date("Y-m-d H:i:s")."'";
//$setracingCutomer[]="product_code='$product_code'";
$setracingCutomer[]="pb_name='$pb_name'";
$setracingCutomer[]="pb_code='$pb_code'";
$setracingCutomer[]="pb_landline_contact_no='$pb_landline_contact_no'";
$setracingCutomer[]="supervisor_mail_id='$supervisor_mail_id'";
$setracingCutomer[]="group_id='$group_id'";
$setracingCutomer[]="group_id_name='$group_id_name'";
$setracingCutomer[]="cust_id='$cust_id'";
$setracingCutomer[]="cust_name='$cust_name'";
$setracingCutomer[]="relationship_with_group_id='$relationship_with_group_id'";
$setracingCutomer[]="cust_id_next='$cust_id_next'";
$setracingCutomer[]="cust_name_next='$cust_name_next'";
$setracingCutomer[]="relationship_with_group_id_next='$relationship_with_group_id_next'";
$setracingCutomer[]="new_group_addition_to_group='$new_group_addition_to_group'";
$setracingCutomer[]="racing_from='$racing_from'";
$setracingCutomer = array();
$setracingCut=implode(",",$setracingCutomer);
$setracingCutomer[]="date='".date("Y-m-d H:i:s")."'";
//$setracingCutomer[]="product_code='$product_code'";
$setracingCutomer[]="pb_name='$pb_name'";
$setracingCutomer[]="pb_code='$client'";
$setracingCutomer[]="pb_landline_contact_no='$pb_landline_contact_no'";
$setracingCutomer[]="supervisor_mail_id='$supervisor_mail_id'";
$setracingCutomer[]="group_id='$group_id'";
$setracingCutomer[]="group_id_name='$group_id_name'";
$setracingCutomer[]="cust_id='$cust_id'";
$setracingCutomer[]="cust_name='$cust_name'";
$setracingCutomer[]="relationship_with_group_id='$relationship_with_group_id'";
$setracingCutomer[]="cust_id_next='$cust_id_next'";
$setracingCutomer[]="cust_name_next='$cust_name_next'";
$setracingCutomer[]="relationship_with_group_id_next='$relationship_with_group_id_next'";
$setracingCutomer[]="new_group_addition_to_group='$new_group_addition_to_group'";
$setracingCutomer[]="racing_from='$racing_from'";
$setracingCutomer[]="call_id='$call_id'";
DB::statement("insert into potentialcustomer_details set $setracingCut");
$setracingCut=implode(",",$setracingCutomer);
return "<script>simpleNotification('success','topRight','Customer Details Saved Successfully');</script>";
if($call_status=='ANSWER' && $call_id!="")
{
DB::statement("insert into potentialcustomer_details set $setracingCut");
return "<script>simpleNotification('success','topRight','Customer Details Saved Successfully');</script>";
}
else
{
return "<script>simpleNotification('error','topRight','Please Get on call first');</script>";
}
}
public function updateracingcust()
{
$id=Input::get("id");
$status=Input::get("supervisorstatus");
DB::statement("update potentialcustomer_details set supervisor_status='$status' where id=$id");
DB::statement("update potentialcustomer_details set supervisor_status='$status',supervisor_update='".date("Y-m-d H:i:s")."' where id=$id");
return "<script>simpleNotification('success','topRight','Supervisor status Saved Successfully');</script>";
}
......
......@@ -7,23 +7,27 @@ use App\Models\Notification;
use App\Jobs\KHRMSLib;
use App\Models\User;
use DB;
use App\Models\CRMCall;
use App\Http\Controllers;
use App\Http\Requests;
use Illuminate\Http\Request;
class RecordController extends Controller {
public function __construct()
{
$this->middleware('auth');
$this->middleware('module_access');
$this->middleware('auth');
$this->middleware('module_access');
}
public function index()
{
return view('layout.module.record.index',array());
return view('layout.module.record.index',array());
}
public function create()
{
//
//
}
public function store()
{
......@@ -49,7 +53,7 @@ class RecordController extends Controller {
if($action=="addkey")
{
$wakka = new KHRMSLib();
$varid=Input::get("varid");
$keys=explode(",",Input::get("keys"));
$record=$wakka->getPerson($varid);
......@@ -58,18 +62,18 @@ class RecordController extends Controller {
$val=Input::get($key);
$record["peopledata"][$key]=$val;
}
$wakka->setPerson($varid,$record);
return Response::make("");
}
if($action=="delaltphone")
{
$wakka = new KHRMSLib();
$varid=Input::get("varid");
$i=Input::get("i");
$record=$wakka->getPerson($varid);
for($k=$i+1;$k<=10;$k++,$i++)
{
......@@ -78,7 +82,7 @@ class RecordController extends Controller {
}
$record["peopledata"]["altphone10"]="";
$record["peopledata"]["altphone_lbl_10"]="";
$wakka->setPerson($varid,$record);
}
if($action=="bulkupload")
......@@ -86,13 +90,13 @@ class RecordController extends Controller {
return view('layout.module.record.bulkupload',$data);
}
if($action=="callclient")
{
{
$clientSel = Input::get('client');
$clientcodeSel = DB::table('records')->where('client','=',$clientSel)->select('clientcode')->orderBy('clientcode','ASC')->get();
return $clientcodeSel;
}
return $clientcodeSel;
}
if($action=="questionlist")
{
$clientcode = Input::get('clientcode');
......@@ -121,21 +125,29 @@ class RecordController extends Controller {
}
if($action=="savecomment")
{
$agentArray = array();
$wakka = new KHRMSLib();
$clientcode = Input::get('clientcode');
$agent_comments = Input::get('agent_comment');
$agent_comments = preg_replace("/[^ \w]+/", "",$agent_comments);
$agentArray['clientcode'] = $clientcode;
$agentArray['agent_comments'] = $agent_comments;
$agentArray['agent'] = Auth::user()->username;
$wakka->setComment($clientcode,$agentArray);
}
{
$id = Input::get('id');
$agent_comments = Input::get('agent_comment');
$agent_comments = preg_replace("/[^ \w]+/", "",$agent_comments);
$user_id=Auth::user()->id;
$mobile = Input::get('mobile');
$crmcallDetails=CRMCall::where('number','like','%'.substr($mobile,-10).'%')->orderBy("created_at","DESC")->first();
if($crmcallDetails)
{
$call_id = $crmcallDetails->id;
$call_status = $crmcallDetails->status;
$crm_id = $crmcallDetails->crm_id;
}
if($call_status=='ANSWER' && $call_id!=""){
DB::statement("update DU_CRM_SUPERVISOR_COMMENTS set updated_at=now(),agent_comments='$agent_comments',user_id='$user_id',call_id=$call_id where id=$id");
return "<script>simpleNotification('success','topRight','Supervisor status Saved Successfully');</script>";
}
else
{
return "<script>simpleNotification('error','topRight','Please Get on call first');</script>";
}
}
}
public function show($id)
......@@ -153,11 +165,11 @@ class RecordController extends Controller {
}
public function edit($id)
{
//
//
}
public function update($id)
{
//
//
}
public function destroy($id)
{
......@@ -167,7 +179,7 @@ class RecordController extends Controller {
public function dashboard()
{
//echo "OK";
//echo "OK";
}
public function supervisorUpload()
......@@ -177,30 +189,30 @@ class RecordController extends Controller {
$data['wakka'] = new KHRMSLib();
$dashboarduser=Auth::user();
//$allusers=User::where('supervisor','=',$dashboarduser->username)->get();
//$allusers=User::where('supervisor','=',$dashboarduser->username)->get();
$allusers=User::where(function ($query) use($dashboarduser) {
$allusers=User::where(function ($query) use($dashboarduser) {
$query->where('supervisor','=',$dashboarduser->username)
->orWhere('lteam2','=',$dashboarduser->username)
->orWhere('lteam','=',$dashboarduser->username);
})->get();
//echo "<pre>".print_r($allusers)."</pre>";
})->get();
//echo "<pre>".print_r($allusers)."</pre>";
/*$allusers=User::where('supervisor','=',$dashboarduser->username)->orWhere('lteam2','=',$dashboarduser->username)->orWhere('lteam','=',$dashboarduser->username)->get();*/
//$allusers=User::where('supervisor','=','A20971')->get();
//$allusers=User::where('supervisor','=','A20971')->get();
foreach($allusers as $alluser){
$usrData = json_decode($alluser->data);
$usrData = json_decode($alluser->data);
$usrHRMSData = unserialize($usrData->hrmsdata);
$usrHRMSData = unserialize($usrData->hrmsdata);
if($usrHRMSData['clientsownerlist']&&$usrHRMSData['clientsownerlist']!='null')
$client[] = $usrHRMSData['clientsownerlist'];
if($usrHRMSData['clientsownerlist']&&$usrHRMSData['clientsownerlist']!='null')
$client[] = $usrHRMSData['clientsownerlist'];
$username[] = $alluser->username;
$username[] = $alluser->username;
}
$data['client'] = $client;
......@@ -208,15 +220,14 @@ class RecordController extends Controller {
return view('layout.module.record.commentsUpload',$data);
}
public function rlpPbwise()
{
$data = array();
$pbcode=Input::get('pbcode');
$data['pbcode']=$pbcode;
return view('layout.module.record.rlppbwise',$data);
}
}
public function rlpPbwise()
{
$data = array();
$pbcode=Input::get('pbcode');
$data['pbcode']=$pbcode;
return view('layout.module.record.rlppbwise',$data);
}
}
......
......@@ -1114,30 +1114,31 @@ function createQaireTab()
<div class='innerAll' style='background: #fff;'>";
//Supervisor Recommendation - By Manish on 20-02-17
//Supervisor Recommendation - By Prashant Jadhav on 07-11-17
if($dataarr['clientcode'])
{
$supComnt = SupervisonComments::select('supvisor_recommends','id','agent_comments')->where('clientcode','=',$dataarr['clientcode'])->first();
$supervisorcomments=preg_replace("/[^ \w]+/", "", $supComnt['supvisor_recommends']);
$agent_comments=preg_replace("/[^ \w]+/", "", $supComnt['agent_comments']);
$supComnt = DB::table('DU_CRM_SUPERVISOR_COMMENTS')->where('V_CUSTID','=',$dataarr['clientcode'])->orderBy('V_LAST_REVIEWED_ON','DESC')->limit(3)->get();
}
$data.="<p style='clear:both'><br>
<label class=label-small_new style='width:25%;' title=''>Supervisor Recommendation: </label>
<textarea id='dialer_userremarks' name='dialer_userremarks' style='width:40%' maxlength=250 placeholder='Only 250 Characters' readonly>".$supervisorcomments."</textarea>
</p>";
$data.="<p style='clear:both'>
<label class=label-small_new style='width:25%;' title=''>Agent Comment: </label>";
if($supComnt['agent_comments'])
$data.="<textarea id='agent_comment' name='agent_comment' style='width:40%' maxlength=250 placeholder='Only 250 Characters'>".$agent_comments."</textarea>";
else
$data.="<textarea id='agent_comment' name='agent_comment' style='width:40%' maxlength=250 placeholder='Only 250 Characters'></textarea>";
$data.="<input type='hidden' id='clientcode' value='".$dataarr['clientcode']."'>
</p>
<div class='container'>
<input type=button id='submitComments' class='btn btn-info' value='Submit' style=' margin: 5px 0 5px 660px;'>
</div>";
foreach($supComnt as $supervisorcomments)
{
$data.="<p style='clear:both'><br>
<label style='width:15%;' title=''>Supervisor Recommendation:</label>
<textarea id='dialer_userremarks' name='dialer_userremarks' style='width:30%;height:100px;' maxlength=250 placeholder='Only 250 Characters' readonly>".$supervisorcomments->T_BM_INSTRUCTION."</textarea>&nbsp;&nbsp;&nbsp;&nbsp;<label style='width:15%;' title=''>BM Product Recommendation:</label><textarea id='dialer_userremarks' name='dialer_userremarks' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters' readonly>".$supervisorcomments->T_BM_PRODUCT_RECO."</textarea><br><br>
<label style='width:15%;' title=''>Last Review On:</label>
<label style='width:30%;' title=''>".$supervisorcomments->V_LAST_REVIEWED_ON."</label>";
$data.="&nbsp;&nbsp;&nbsp;<label style='width:15%;' title=''>Agent Comment: </label>";
if($supervisorcomments->agent_comments)
$data.="<textarea id='".$supervisorcomments->id."_agent_comment' name='agent_comment' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters'>".$supervisorcomments->agent_comments."</textarea>";
else
$data.="<textarea id='".$supervisorcomments->id."_agent_comment' name='agent_comment' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters'></textarea>";
$data.="</p><div class='container'>
<input type=button id='".$supervisorcomments->id."_submitComments' class='btn btn-info' value='Submit' onclick='updateagentcomments(".$supervisorcomments->id.");'style=' margin: 5px 0 5px 660px;'>
</div>";
}
$data.="<legend class='task_legend'>Primary Questions</legend>
......@@ -1698,15 +1699,21 @@ function createQaireTab()
doAjax('questionare',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST');
});
$('#submitComments').click(function()
{
var agent_comment = $('#agent_comment').val();
var clientcode = $('#clientcode').val();
});
function updateagentcomments(id){
var agent_comment = $('#'+id+'_agent_comment').val();
if(agent_comment)
{
var postdata='clientcode='+clientcode;
postdata+='&agent_comment='+agent_comment;
var postdata='id='+id;
postdata+='&agent_comment='+agent_comment;
postdata+='&mobile='+'".$dataarr["mobile"]."';
doAjax('record?action=savecomment',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST');
}
......@@ -1714,11 +1721,8 @@ function createQaireTab()
{
alert('Please insert agent comment first');
}
});
});
}
</script>
......@@ -3069,6 +3073,9 @@ function createRacingCust()
postdata+='&relationship_with_group_id_next='+encodeURIComponent(relationshipgroupid);
postdata+='&new_group_addition_to_group='+encodeURIComponent(newGroupdditiongroup);
postdata+='&racing_from='+encodeURIComponent(racingfrom);
postdata+='&mobile='+'".$dataarr["mobile"]."';
postdata+='&client='+'".$dataarr["client"]."';
postdata+='&clientcode='+'".$dataarr["clientcode"]."';
doAjax('custrace',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST');
});
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!