Initial Change
Showing
21 changed files
with
1721 additions
and
126 deletions
| ... | @@ -8,6 +8,8 @@ use App\Services\FormBuilder; | ... | @@ -8,6 +8,8 @@ use App\Services\FormBuilder; |
| 8 | use Illuminate\Http\Request; | 8 | use Illuminate\Http\Request; |
| 9 | use Response; | 9 | use Response; |
| 10 | use App\Models\User; | 10 | use App\Models\User; |
| 11 | use SimpleXLSX; | ||
| 12 | use App\Jobs\KHRMSLib; | ||
| 11 | 13 | ||
| 12 | class CampaignController extends Controller { | 14 | class CampaignController extends Controller { |
| 13 | 15 | ||
| ... | @@ -50,7 +52,153 @@ class CampaignController extends Controller { | ... | @@ -50,7 +52,153 @@ class CampaignController extends Controller { |
| 50 | public function store(Request $request) | 52 | public function store(Request $request) |
| 51 | { | 53 | { |
| 52 | $action = Input::get("action"); | 54 | $action = Input::get("action"); |
| 55 | if($action == 'upload'){ | ||
| 56 | if($request->hasFile('file')){ | ||
| 57 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 58 | include(app_path().'/lib/simplexlsx-master/simplexlsx.class.php'); | ||
| 53 | 59 | ||
| 60 | $path = $request->file->getRealPath(); | ||
| 61 | $objSimpleXLSX = SimpleXLSX::parse($path); | ||
| 62 | |||
| 63 | $objWorksheet = $objSimpleXLSX->rows(); | ||
| 64 | $highestColumn = count($objWorksheet[0]); | ||
| 65 | $highestrow=count($objWorksheet); | ||
| 66 | |||
| 67 | //echo "<pre>";print_r($objWorksheet); | ||
| 68 | //echo "\n"; | ||
| 69 | //print_r($highestColumn); | ||
| 70 | //echo "\n"; | ||
| 71 | |||
| 72 | //echo $highestrow; | ||
| 73 | |||
| 74 | for($i=0;$i<$highestrow;$i++) | ||
| 75 | {//echo $i; | ||
| 76 | $excelarray[$i]=array(); | ||
| 77 | for ($head = 0; $head < $highestColumn; $head++) | ||
| 78 | { | ||
| 79 | if($i==0) | ||
| 80 | { | ||
| 81 | $keys[$head]=trim($objWorksheet[$i][$head]); | ||
| 82 | |||
| 83 | } | ||
| 84 | else | ||
| 85 | { | ||
| 86 | $excelarray[$i][$keys[$head]]=trim($objWorksheet[$i][$head]); | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
| 90 | |||
| 91 | //echo "<pre>";print_r($excelarray); | ||
| 92 | |||
| 93 | for($i=1;$i<$highestrow;$i++) | ||
| 94 | { | ||
| 95 | if($excelarray[$i]["name"]!="" || $excelarray[$i]["name"]!="0" || $excelarray[$i]["name"]!=0 ) | ||
| 96 | { | ||
| 97 | //echo $excelarray[$i]["name"]; | ||
| 98 | if(!empty($excelarray[$i]["name"])){ | ||
| 99 | $campaign = Input::get("selectCampaignField"); | ||
| 100 | |||
| 101 | if($campaign=="all"){ | ||
| 102 | $campaign=""; | ||
| 103 | $allcampaign=Campaign::where('mtype',"=","company")->orderBy('mkey')->get(); | ||
| 104 | foreach ($allcampaign as $mkeycampaign) | ||
| 105 | { | ||
| 106 | $campaign .= $mkeycampaign->mkey.","; | ||
| 107 | } | ||
| 108 | $campaign=substr($campaign, 0, -1); | ||
| 109 | } | ||
| 110 | |||
| 111 | $usercampaign=User::where('username','=',trim($excelarray[$i]["name"])); | ||
| 112 | |||
| 113 | if($usercampaign->count() > 0){ | ||
| 114 | $usercampaign = $usercampaign->first(); | ||
| 115 | $campaignList =$usercampaign->clients.",".$campaign; | ||
| 116 | $data=json_decode($usercampaign->data,true); | ||
| 117 | if(isset($data['hrmsdata'])) | ||
| 118 | { | ||
| 119 | $hrmsdata=unserialize($data['hrmsdata']); | ||
| 120 | $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 121 | $data['hrmsdata']=serialize($hrmsdata); | ||
| 122 | }else | ||
| 123 | { | ||
| 124 | $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 125 | $data['hrmsdata']=serialize($hrmsdata); | ||
| 126 | } | ||
| 127 | $data=json_encode($data); | ||
| 128 | $usercampaign->updated_at=date("Y-m-d H:i:s"); | ||
| 129 | $usercampaign->clients=$campaignList; | ||
| 130 | $usercampaign->data=$data; | ||
| 131 | $usercampaign->save(); | ||
| 132 | } | ||
| 133 | |||
| 134 | |||
| 135 | } | ||
| 136 | } | ||
| 137 | } | ||
| 138 | |||
| 139 | } | ||
| 140 | } | ||
| 141 | |||
| 142 | if($action == 'bulkupload'){ | ||
| 143 | if($request->hasFile('file')){ | ||
| 144 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 145 | include(app_path().'/lib/simplexlsx-master/simplexlsx.class.php'); | ||
| 146 | |||
| 147 | $path = $request->file->getRealPath(); | ||
| 148 | $objSimpleXLSX = SimpleXLSX::parse($path); | ||
| 149 | |||
| 150 | |||
| 151 | $objWorksheet = $objSimpleXLSX->rows(); | ||
| 152 | $highestColumn = count($objWorksheet[0]); | ||
| 153 | $highestrow=count($objWorksheet); | ||
| 154 | |||
| 155 | |||
| 156 | $dbUsers=DB::table('users')->select('username', 'data')->where('status','=','Active')->get(); | ||
| 157 | $dbCampaigns=DB::table('hrms_masters')->select('mkey')->where('status','=','Active')->get(); | ||
| 158 | |||
| 159 | $activeUser = array(); | ||
| 160 | $activeCampaign = array(); | ||
| 161 | $activeUserData = array(); | ||
| 162 | foreach ($dbUsers as $key => $dbUser){ | ||
| 163 | $activeUser[] = $dbUser->username; | ||
| 164 | $activeUserData[$dbUser->username] = $dbUser->data; | ||
| 165 | } | ||
| 166 | foreach ($dbCampaigns as $key => $dbCampaign)$activeCampaign[] = $dbCampaign->mkey; | ||
| 167 | |||
| 168 | $campaigns = array(); | ||
| 169 | $users = array(); | ||
| 170 | for($row=0;$row<$highestrow;$row++) | ||
| 171 | { | ||
| 172 | if($row!=0 && !empty(trim($objWorksheet[$row][0]))){ | ||
| 173 | |||
| 174 | if(in_array(trim($objWorksheet[$row][0]), $activeCampaign) && in_array(trim($objWorksheet[$row][1]), $activeUser)){ | ||
| 175 | |||
| 176 | $users[trim($objWorksheet[$row][1])][] = $objWorksheet[$row][0]; | ||
| 177 | } | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 181 | foreach ($users as $userName => $campaigns) { | ||
| 182 | $campaignList = implode(',', $campaigns); | ||
| 183 | |||
| 184 | $data=json_decode($activeUserData[$userName],true); | ||
| 185 | |||
| 186 | if(isset($data['hrmsdata'])) | ||
| 187 | { | ||
| 188 | $hrmsdata=unserialize($data['hrmsdata']); | ||
| 189 | $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 190 | $data['hrmsdata']=serialize($hrmsdata); | ||
| 191 | }else | ||
| 192 | { | ||
| 193 | $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 194 | $data['hrmsdata']=serialize($hrmsdata); | ||
| 195 | } | ||
| 196 | $data=json_encode($data); | ||
| 197 | |||
| 198 | DB::table('users')->where('username', $userName)->update(['clients'=>$campaignList, 'data' => $data]); | ||
| 199 | } | ||
| 200 | } | ||
| 201 | } | ||
| 54 | // if($action=="createCampaign") | 202 | // if($action=="createCampaign") |
| 55 | // { | 203 | // { |
| 56 | // $this->validate($request,[ | 204 | // $this->validate($request,[ |
| ... | @@ -86,7 +234,45 @@ class CampaignController extends Controller { | ... | @@ -86,7 +234,45 @@ class CampaignController extends Controller { |
| 86 | { | 234 | { |
| 87 | if($id=="show") | 235 | if($id=="show") |
| 88 | { | 236 | { |
| 237 | $gthis = new KHRMSLib(); | ||
| 89 | $campaign = Input::get("campaign"); | 238 | $campaign = Input::get("campaign"); |
| 239 | |||
| 240 | $mastersdata=$gthis->getCompanyMaster($campaign); | ||
| 241 | $disposition = array(); | ||
| 242 | if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$gthis->HRCoreVars['dialerDispoList']; | ||
| 243 | $dispoarr=explode("~",$mastersdata['dialerDispoList']); | ||
| 244 | foreach($dispoarr as $dispo) | ||
| 245 | { | ||
| 246 | if(!empty($dispo)) | ||
| 247 | { | ||
| 248 | $dispoprts=explode("|",$dispo); | ||
| 249 | if(sizeof($dispoprts)>=3) | ||
| 250 | { | ||
| 251 | $disposition[$dispoprts[1]] = $dispoprts[2]; | ||
| 252 | $dispositionCode[$dispoprts[1]] = $dispoprts[0]; | ||
| 253 | /*$data.="dialerdispoarray['$dispoprts[1]']='$dispoprts[2]'; | ||
| 254 | dispoClassArray['$dispoprts[0]']='$dispoprts[1]';";*/ | ||
| 255 | } | ||
| 256 | } | ||
| 257 | } | ||
| 258 | $data['disposition'] = $disposition; | ||
| 259 | $data['dispositionCode'] = $dispositionCode; | ||
| 260 | |||
| 261 | |||
| 262 | $dispositionList=DB::table('hrms_masters')->select('*')->where('status','=','Active')->where("mkey","=",$campaign)->where("mtype","=",'coreconfig')->first(); | ||
| 263 | |||
| 264 | $dispolist=explode("~",$dispositionList->mvalue); | ||
| 265 | $dispositionList = array(); | ||
| 266 | foreach ($dispolist as $key => $dispo) { | ||
| 267 | if(!empty($dispo)) | ||
| 268 | { | ||
| 269 | $dispoprts=explode("|",$dispo); | ||
| 270 | $dispositionList[$dispoprts[1]]= $dispoprts[2]; | ||
| 271 | } | ||
| 272 | } | ||
| 273 | |||
| 274 | $data['dispositionList'] = $dispositionList; | ||
| 275 | //$campaign = Input::get("campaign"); | ||
| 90 | if($campaign != ""){ | 276 | if($campaign != ""){ |
| 91 | //this condition for getting all campaign data | 277 | //this condition for getting all campaign data |
| 92 | if($campaign == "all") | 278 | if($campaign == "all") |
| ... | @@ -107,6 +293,7 @@ class CampaignController extends Controller { | ... | @@ -107,6 +293,7 @@ class CampaignController extends Controller { |
| 107 | $data['queryLogs'] = DB::table("campaign_query")->where('campaign', '=', $campaign)->get(); | 293 | $data['queryLogs'] = DB::table("campaign_query")->where('campaign', '=', $campaign)->get(); |
| 108 | // $data['dataList'] = DB::table("records")->select(DB::Raw('list_id, count(*) as recordCount'))->where("client","=",$campaign)->groupBy('list_id')->get(); | 294 | // $data['dataList'] = DB::table("records")->select(DB::Raw('list_id, count(*) as recordCount'))->where("client","=",$campaign)->groupBy('list_id')->get(); |
| 109 | $userassignedcampign=DB::table('users')->select('username','clients')->whereRaw(' FIND_IN_SET(?,clients)', [$campaign])->get(); | 295 | $userassignedcampign=DB::table('users')->select('username','clients')->whereRaw(' FIND_IN_SET(?,clients)', [$campaign])->get(); |
| 296 | //$scheduledCampaign = Campaign::where("mtype","=","company")->where("mkey","=",$campaign)->first(); | ||
| 110 | return view("layout.module.campaign.campaign",$data,compact('userassignedcampign')); | 297 | return view("layout.module.campaign.campaign",$data,compact('userassignedcampign')); |
| 111 | } | 298 | } |
| 112 | 299 | ||
| ... | @@ -118,7 +305,7 @@ class CampaignController extends Controller { | ... | @@ -118,7 +305,7 @@ class CampaignController extends Controller { |
| 118 | if($id=="query") | 305 | if($id=="query") |
| 119 | { | 306 | { |
| 120 | $campaign = Input::get("campaign"); | 307 | $campaign = Input::get("campaign"); |
| 121 | $querySelect = Input::get("querySelect"); | 308 | $querySelect = Input::get("allvalues"); |
| 122 | $queryConditions = Input::get("queryConditions"); | 309 | $queryConditions = Input::get("queryConditions"); |
| 123 | if($queryConditions){ | 310 | if($queryConditions){ |
| 124 | $queryConditions = str_replace('"', "'", $queryConditions); | 311 | $queryConditions = str_replace('"', "'", $queryConditions); |
| ... | @@ -126,9 +313,19 @@ class CampaignController extends Controller { | ... | @@ -126,9 +313,19 @@ class CampaignController extends Controller { |
| 126 | }else{ | 313 | }else{ |
| 127 | $queryConditions = '1'; | 314 | $queryConditions = '1'; |
| 128 | } | 315 | } |
| 129 | $queryLimit = Input::get("queryLimit"); | 316 | // $queryInCondition = Input::get("queryInCondition"); |
| 130 | $queryOffset = Input::get("queryOffset"); | 317 | // if($queryInCondition != 'null'){ |
| 131 | $checkedValue = Input::get("checkedValue"); | 318 | // $queryInCondition = str_replace('"', "'", $queryInCondition); |
| 319 | // $queryInCondition = str_replace(''', "'", $queryInCondition); | ||
| 320 | // $queryInCondition = "or elegible IN ($queryInCondition)"; | ||
| 321 | // $querySelect .= ',elegible'; | ||
| 322 | // }else{ | ||
| 323 | // $queryInCondition = ''; | ||
| 324 | // } | ||
| 325 | //$queryLimit = Input::get("queryLimit"); | ||
| 326 | //$queryOffset = Input::get("queryOffset"); | ||
| 327 | //$checkedValue = Input::get("checkedValue"); | ||
| 328 | // print_r($checkedValue); | ||
| 132 | $fields = explode(",", $querySelect); | 329 | $fields = explode(",", $querySelect); |
| 133 | 330 | ||
| 134 | $i = 1; $output = ''; | 331 | $i = 1; $output = ''; |
| ... | @@ -137,23 +334,29 @@ class CampaignController extends Controller { | ... | @@ -137,23 +334,29 @@ class CampaignController extends Controller { |
| 137 | 334 | ||
| 138 | if($campaign=="All") | 335 | if($campaign=="All") |
| 139 | { | 336 | { |
| 140 | $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; | 337 | // $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; |
| 338 | $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions"; | ||
| 141 | $sqlQuery = DB::select($selQuery); | 339 | $sqlQuery = DB::select($selQuery); |
| 142 | }else | 340 | }else |
| 143 | { | 341 | { |
| 144 | $selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; | 342 | //$selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; |
| 343 | $selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions"; | ||
| 145 | $sqlQuery = DB::select($selQuery); | 344 | $sqlQuery = DB::select($selQuery); |
| 146 | } | 345 | } |
| 147 | 346 | ||
| 148 | if($checkedValue=="on") | 347 | if($sqlQuery){ |
| 149 | { | 348 | |
| 150 | $queryExist = DB::table('campaign_query')->where('query','=',$selQuery)->where('campaign', '=', $campaign)->select('id')->first(); | 349 | $queryExist = DB::table('campaign_query')->where('query','=',$selQuery)->where('campaign', '=', $campaign)->select('id')->first(); |
| 151 | 350 | ||
| 152 | if(empty($queryExist)) | 351 | if(empty($queryExist)) |
| 153 | { | 352 | { |
| 154 | DB::table('campaign_query')->insert(['campaign'=>$campaign, 'query'=>$selQuery, 'select_col'=>$querySelect,'where_cond'=>"client = '$campaign' AND $queryConditions"]); | 353 | DB::table('campaign_query')->insert(['campaign'=>$campaign, 'query'=>$selQuery, 'select_col'=>$querySelect,'where_cond'=>"client = '$campaign' AND $queryConditions"]); |
| 354 | }else{ | ||
| 355 | $output .="<p class='text-danger'>".'QueryAlreadyExist'."</p></br>"; | ||
| 155 | } | 356 | } |
| 156 | } | 357 | |
| 358 | } | ||
| 359 | |||
| 157 | 360 | ||
| 158 | } catch(\Illuminate\Database\QueryException $ex){ | 361 | } catch(\Illuminate\Database\QueryException $ex){ |
| 159 | $output .= "<p class='text-danger'>".$ex->getMessage()."</p>"; | 362 | $output .= "<p class='text-danger'>".$ex->getMessage()."</p>"; |
| ... | @@ -161,7 +364,9 @@ class CampaignController extends Controller { | ... | @@ -161,7 +364,9 @@ class CampaignController extends Controller { |
| 161 | } | 364 | } |
| 162 | 365 | ||
| 163 | if(count($sqlQuery)){ | 366 | if(count($sqlQuery)){ |
| 164 | $output .= '<div style="overflow-x:auto;"><table class="table table-bordered"><thead><tr><th class="text-center">#</th>'; | 367 | $output .='<div><label>'.count($sqlQuery).'</label></div>'; |
| 368 | } | ||
| 369 | /*$output .= '<div style="overflow-x:auto;"><table class="table table-bordered"><thead><tr><th class="text-center">#</th>'; | ||
| 165 | foreach ($fields as $key) { | 370 | foreach ($fields as $key) { |
| 166 | $output .= '<th class="text-center">'.trim($key).'</th>'; | 371 | $output .= '<th class="text-center">'.trim($key).'</th>'; |
| 167 | } | 372 | } |
| ... | @@ -177,7 +382,7 @@ class CampaignController extends Controller { | ... | @@ -177,7 +382,7 @@ class CampaignController extends Controller { |
| 177 | }else{ | 382 | }else{ |
| 178 | $output .= '<h5 class="text-danger"><i class="fa fa-exclamation-circle"></i> No Result!</h5>'; | 383 | $output .= '<h5 class="text-danger"><i class="fa fa-exclamation-circle"></i> No Result!</h5>'; |
| 179 | } | 384 | } |
| 180 | $output .= '</tbody></table></div>'; | 385 | $output .= '</tbody></table></div>';*/ |
| 181 | return $output; | 386 | return $output; |
| 182 | } | 387 | } |
| 183 | 388 | ||
| ... | @@ -195,8 +400,8 @@ class CampaignController extends Controller { | ... | @@ -195,8 +400,8 @@ class CampaignController extends Controller { |
| 195 | $sqlQuery = DB::select($queryTxt->query); | 400 | $sqlQuery = DB::select($queryTxt->query); |
| 196 | 401 | ||
| 197 | if(count($sqlQuery)){ | 402 | if(count($sqlQuery)){ |
| 198 | $output .= '<div style="overflow-x:auto;"><table class="table table-bordered"><thead><tr><th class="text-center">#</th>'; | 403 | $output .= '<div style="overflow-x:auto;"><h5>'.count($sqlQuery).'</h5>'; |
| 199 | foreach ($fields as $key) { | 404 | /*foreach ($fields as $key) { |
| 200 | $output .= '<th class="text-center">'.trim($key).'</th>'; | 405 | $output .= '<th class="text-center">'.trim($key).'</th>'; |
| 201 | } | 406 | } |
| 202 | $output .= "</tr></thed><tbody>"; | 407 | $output .= "</tr></thed><tbody>"; |
| ... | @@ -207,7 +412,7 @@ class CampaignController extends Controller { | ... | @@ -207,7 +412,7 @@ class CampaignController extends Controller { |
| 207 | } | 412 | } |
| 208 | $output .= "</tr>"; | 413 | $output .= "</tr>"; |
| 209 | $i++; | 414 | $i++; |
| 210 | } | 415 | }*/ |
| 211 | }else{ | 416 | }else{ |
| 212 | $output .= '<h5 class="text-danger"><i class="fa fa-exclamation-circle"></i> No Result!</h5>'; | 417 | $output .= '<h5 class="text-danger"><i class="fa fa-exclamation-circle"></i> No Result!</h5>'; |
| 213 | } | 418 | } |
| ... | @@ -235,15 +440,26 @@ class CampaignController extends Controller { | ... | @@ -235,15 +440,26 @@ class CampaignController extends Controller { |
| 235 | }else{ | 440 | }else{ |
| 236 | $queryConditions = '1'; | 441 | $queryConditions = '1'; |
| 237 | } | 442 | } |
| 443 | $queryInCondition = Input::get("queryInCondition"); | ||
| 444 | if($queryInCondition != 'null'){ | ||
| 445 | $queryInCondition = str_replace('"', "'", $queryInCondition); | ||
| 446 | $queryInCondition = str_replace(''', "'", $queryInCondition); | ||
| 447 | $queryInCondition = "or elegible IN ($queryInCondition)"; | ||
| 448 | $querySelect .= ',elegible'; | ||
| 449 | }else{ | ||
| 450 | $queryInCondition = ''; | ||
| 451 | } | ||
| 238 | $queryLimit = Input::get("queryLimit"); | 452 | $queryLimit = Input::get("queryLimit"); |
| 239 | $queryOffset = Input::get("queryOffset"); | 453 | $queryOffset = Input::get("queryOffset"); |
| 240 | 454 | ||
| 241 | try { | 455 | try { |
| 242 | if($campaign=="All"){ | 456 | if($campaign=="All"){ |
| 243 | $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; | 457 | //$selQuery = "SELECT $querySelect FROM records WHERE $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; |
| 244 | $sqlQuery = DB::select($selQuery); | 458 | $selQuery = "SELECT $querySelect FROM records WHERE $queryConditions $queryInCondition LIMIT $queryLimit OFFSET $queryOffset"; |
| 459 | $sqlQuery = DB::select($selQuery); | ||
| 245 | }else{ | 460 | }else{ |
| 246 | $selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; | 461 | $selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions $queryInCondition LIMIT $queryLimit OFFSET $queryOffset"; |
| 462 | //$selQuery = "SELECT $querySelect FROM records WHERE client = '$campaign' AND $queryConditions LIMIT $queryLimit OFFSET $queryOffset"; | ||
| 247 | $sqlQuery = DB::select($selQuery); | 463 | $sqlQuery = DB::select($selQuery); |
| 248 | } | 464 | } |
| 249 | } catch(\Illuminate\Database\QueryException $ex){ | 465 | } catch(\Illuminate\Database\QueryException $ex){ |
| ... | @@ -269,7 +485,7 @@ class CampaignController extends Controller { | ... | @@ -269,7 +485,7 @@ class CampaignController extends Controller { |
| 269 | DB::table('campaign_query')->where('id','!=', $campQryId)->update(['current_queue'=>'']); | 485 | DB::table('campaign_query')->where('id','!=', $campQryId)->update(['current_queue'=>'']); |
| 270 | DB::table('campaign_query')->where('id','=', $campQryId)->update(['current_queue'=>'selected']); | 486 | DB::table('campaign_query')->where('id','=', $campQryId)->update(['current_queue'=>'selected']); |
| 271 | 487 | ||
| 272 | return Response::make("<script>simpleNotification('success','topRight','Query Logic added successfully!');</script>"); | 488 | //return "<script>simpleNotification('success','topRight','Query Logic Successfully Updated');</script>"; |
| 273 | } | 489 | } |
| 274 | if($id=="assigncampaign") | 490 | if($id=="assigncampaign") |
| 275 | { | 491 | { |
| ... | @@ -314,21 +530,36 @@ class CampaignController extends Controller { | ... | @@ -314,21 +530,36 @@ class CampaignController extends Controller { |
| 314 | foreach ($agentsArr as $key => $agent) | 530 | foreach ($agentsArr as $key => $agent) |
| 315 | { | 531 | { |
| 316 | $usercampaign=User::where('username','=',$agent)->first(); | 532 | $usercampaign=User::where('username','=',$agent)->first(); |
| 317 | 533 | //$campaignList =$usercampaign->clients.",".$campaign; | |
| 318 | $campaignList =$usercampaign->clients.",".$campaign; | 534 | |
| 319 | $data=json_decode($usercampaign->data,true); | 535 | $data=json_decode($usercampaign->data,true); |
| 320 | if(isset($data['hrmsdata'])) | 536 | if(isset($data['hrmsdata'])) |
| 321 | { | 537 | { |
| 322 | $hrmsdata=unserialize($data['hrmsdata']); | 538 | $hrmsdata=unserialize($data['hrmsdata']); |
| 323 | $hrmsdata['clientsownerlist'] = $campaignList; | 539 | if($usercampaign->clients==$hrmsdata['clientsownerlist']){ |
| 540 | $campaignList =$usercampaign->clients.",".$campaign; | ||
| 541 | // print_r($hrmsdata['clientsownerlist']); | ||
| 542 | // $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 543 | }else{ | ||
| 544 | //print_r($hrmsdata['clientsownerlist']); | ||
| 545 | $campaignList = $hrmsdata['clientsownerlist'].",".$campaign; | ||
| 546 | //$hrmsdata['clientsownerlist'] = $hrmsdata['clientsownerlist'].",".$campaign; | ||
| 547 | } | ||
| 548 | $hrmsdata['clientsownerlist'] = $campaignList; | ||
| 549 | //print_r($hrmsdata['clientsownerlist']); | ||
| 324 | $data['hrmsdata']=serialize($hrmsdata); | 550 | $data['hrmsdata']=serialize($hrmsdata); |
| 551 | //print_r($data['hrmsdata']); | ||
| 552 | //exit(); | ||
| 325 | }else | 553 | }else |
| 326 | { | 554 | { |
| 555 | //exit(); | ||
| 556 | $campaignList =$usercampaign->clients.",".$campaign; | ||
| 327 | $hrmsdata['clientsownerlist'] = $campaignList; | 557 | $hrmsdata['clientsownerlist'] = $campaignList; |
| 328 | $data['hrmsdata']=serialize($hrmsdata); | 558 | $data['hrmsdata']=serialize($hrmsdata); |
| 559 | //print_r($data['hrmsdata']); | ||
| 329 | } | 560 | } |
| 330 | $data=json_encode($data); | 561 | $data=json_encode($data); |
| 331 | 562 | //print_r($data); | |
| 332 | $usercampaign->updated_at=date("Y-m-d H:i:s"); | 563 | $usercampaign->updated_at=date("Y-m-d H:i:s"); |
| 333 | $usercampaign->clients=$campaignList; | 564 | $usercampaign->clients=$campaignList; |
| 334 | $usercampaign->data=$data; | 565 | $usercampaign->data=$data; |
| ... | @@ -375,25 +606,140 @@ class CampaignController extends Controller { | ... | @@ -375,25 +606,140 @@ class CampaignController extends Controller { |
| 375 | if(isset($data['hrmsdata'])) | 606 | if(isset($data['hrmsdata'])) |
| 376 | { | 607 | { |
| 377 | $hrmsdata=unserialize($data['hrmsdata']); | 608 | $hrmsdata=unserialize($data['hrmsdata']); |
| 609 | //print_r($hrmsdata); | ||
| 378 | $hrms_arr=explode(",", $hrmsdata['clientsownerlist']); | 610 | $hrms_arr=explode(",", $hrmsdata['clientsownerlist']); |
| 379 | $update_campaign[]=$campaign; | 611 | $update_campaign[]=$campaign; |
| 380 | $update_hrms=array_diff($hrms_arr, $update_campaign); | 612 | $update_hrms=array_diff($hrms_arr, $update_campaign); |
| 381 | $hrmsdata['clientsownerlist']= implode(",",$update_hrms); | 613 | $hrmsdata['clientsownerlist']= implode(",",$update_hrms); |
| 614 | $final = implode(",",$update_hrms); | ||
| 615 | // print_r($hrmsdata['clientsownerlist']); | ||
| 382 | $data['hrmsdata']=serialize($hrmsdata); | 616 | $data['hrmsdata']=serialize($hrmsdata); |
| 383 | $data=json_encode($data); | 617 | $data=json_encode($data); |
| 384 | 618 | ||
| 385 | } | 619 | } |
| 386 | $usercampaign1=User::where('username','=',$agent)->first(); | 620 | $usercampaign1=User::where('username','=',$agent)->first(); |
| 387 | $usercampaign1->updated_at=date("Y-m-d H:i:s"); | 621 | $usercampaign1->updated_at=date("Y-m-d H:i:s"); |
| 388 | $usercampaign1->clients=$finalcampaign; | 622 | $usercampaign1->clients=$finalcampaign; |
| 389 | $usercampaign1->data=$data; | 623 | $usercampaign1->data=$data; |
| 390 | $usercampaign1->save(); | 624 | $usercampaign1->save(); |
| 391 | // DB::statement("update users set updated_at='".date("Y-m-d H:i:s")."',clients='$finalcampaign',data='$data' where username='$agent'"); | 625 | //DB::statement("update users set updated_at='".date("Y-m-d H:i:s")."',clients='$finalcampaign',data='$data' where username='$agent'"); |
| 392 | } | 626 | } |
| 393 | } | 627 | } |
| 394 | 628 | ||
| 395 | return; | 629 | return; |
| 396 | } | 630 | } |
| 631 | if($id=="schedulecampaign"){ | ||
| 632 | $campaign = Input::get("selectCampaignField"); | ||
| 633 | $starttime = Input::get("starttime"); | ||
| 634 | $endtime = Input::get("endtime"); | ||
| 635 | //return view("layout.module.outputreport.supervisorreport", $data); | ||
| 636 | /*$updateschedule = Campaign::where("mtype","=","company")->where("mkey","=",$campaign)->first(); | ||
| 637 | $updateschedule->campaignstartdate=$starttime; | ||
| 638 | $updateschedule->campaignenddate=$endtime; | ||
| 639 | $updateschedule->save();*/ | ||
| 640 | /* $scheduledCampaign = Campaign::where("mtype","=","company")->where("mkey","=",$campaign)->get(); | ||
| 641 | $data['scheduledCampaign']=$scheduledCampaign; | ||
| 642 | return view("layout/module/campaign/campaignScheduler",$data);*/ | ||
| 643 | DB::statement("update hrms_masters set campaignstartdate='$starttime:00',campaignenddate='$endtime:00' where mkey='$campaign' and mtype='company'"); | ||
| 644 | } | ||
| 645 | |||
| 646 | if($id=="bulkupload"){ | ||
| 647 | return view("layout.module.campaign.bulkupload"); | ||
| 648 | } | ||
| 649 | |||
| 650 | if($id=='deleteAssignDisposition'){ | ||
| 651 | $wakka = new KHRMSLib(); | ||
| 652 | $campaign = Input::get("selectCampaignField"); | ||
| 653 | $disposition = Input::get("disposition"); | ||
| 654 | |||
| 655 | $hrmsdata = DB::table('hrms_masters')->where('mkey','=', $campaign)->where('mtype','=', 'coreconfig')->select('*'); | ||
| 656 | if($hrmsdata->count() > 0){ | ||
| 657 | $hrmsdata = $hrmsdata->first(); | ||
| 658 | $dispolist=explode("~",$hrmsdata->mvalue); | ||
| 659 | $dispositionList = array(); | ||
| 660 | $mvalue = ''; | ||
| 661 | foreach ($dispolist as $key => $dispo) { | ||
| 662 | if(!empty($dispo)) | ||
| 663 | { | ||
| 664 | $dispoprts=explode("|",$dispo); | ||
| 665 | if($dispoprts[1] != $disposition){ | ||
| 666 | if(empty($mvalue)){ | ||
| 667 | $mvalue .= "$dispo"; | ||
| 668 | }else{ | ||
| 669 | $mvalue .= "~$dispo"; | ||
| 670 | } | ||
| 671 | } | ||
| 672 | } | ||
| 673 | } | ||
| 674 | $wakka->Query("update hrms_masters set mvalue='$mvalue' where mkey='$campaign' and mtype='coreconfig';"); | ||
| 675 | } | ||
| 676 | } | ||
| 677 | |||
| 678 | if($id=="assigndisposition"){ | ||
| 679 | $wakka = new KHRMSLib(); | ||
| 680 | $code = Input::get('code'); | ||
| 681 | $disposition = Input::get('disposition'); | ||
| 682 | $subDisposition = Input::get('subDisposition'); | ||
| 683 | $campaign = Input::get("selectCampaignField"); | ||
| 684 | |||
| 685 | $hrmsdata = DB::table('hrms_masters')->where('mkey','=', $campaign)->where('mtype','=', 'coreconfig')->select('*'); | ||
| 686 | if($hrmsdata->count() == 0){ | ||
| 687 | $mvalue = "$code|$disposition|$subDisposition"; | ||
| 688 | DB::table('hrms_masters')->insert(['mkey'=>$campaign, 'mtype'=>'coreconfig', 'mvalue'=>$mvalue,'status'=>'active']); | ||
| 689 | }else{ | ||
| 690 | $hrmsdata = $hrmsdata->first(); | ||
| 691 | if(!empty($hrmsdata->mvalue)){ | ||
| 692 | $dispolist=explode("~",$hrmsdata->mvalue); | ||
| 693 | $dispositionList = array(); | ||
| 694 | $mvalue = ''; | ||
| 695 | foreach ($dispolist as $key => $dispo) { | ||
| 696 | if(!empty($dispo)) | ||
| 697 | { | ||
| 698 | $dispoprts=explode("|",$dispo); | ||
| 699 | if($dispoprts[1] == $disposition){ | ||
| 700 | $mvalue = $hrmsdata->mvalue; | ||
| 701 | $mvalue = str_replace($dispoprts[2], $subDisposition, $mvalue); | ||
| 702 | |||
| 703 | } | ||
| 704 | } | ||
| 705 | } | ||
| 706 | if(empty($mvalue)){ | ||
| 707 | $mvalue .= $hrmsdata->mvalue."~$code|$disposition|$subDisposition"; | ||
| 708 | } | ||
| 709 | }else{ | ||
| 710 | |||
| 711 | $mvalue = "$code|$disposition|$subDisposition"; | ||
| 712 | } | ||
| 713 | $wakka->Query("update hrms_masters set mvalue='$mvalue' where mkey='$campaign' and mtype='coreconfig';"); | ||
| 714 | } | ||
| 715 | |||
| 716 | } | ||
| 717 | |||
| 718 | if($id == "sampleDataExcel"){ | ||
| 719 | /*$objPHPExcel = new \PHPExcel(); | ||
| 720 | $objPHPExcel->getProperties() | ||
| 721 | ->setCreator("Temporaris") | ||
| 722 | ->setLastModifiedBy("Temporaris") | ||
| 723 | ->setTitle("Template Relevé des heures intérimaires") | ||
| 724 | ->setSubject("Template excel") | ||
| 725 | ->setDescription("Template excel permettant la création d'un ou plusieurs relevés d'heures") | ||
| 726 | ->setKeywords("Template excel"); | ||
| 727 | $objPHPExcel->setActiveSheetIndex(0); | ||
| 728 | $objPHPExcel->getActiveSheet()->SetCellValue('A1', "12"); | ||
| 729 | |||
| 730 | $writer = \PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); | ||
| 731 | header('Content-Type: application/vnd.ms-excel'); | ||
| 732 | header('Content-Disposition: attachment;filename="excel.xls"'); | ||
| 733 | header('Cache-Control: max-age=0'); | ||
| 734 | |||
| 735 | $writer->save('php://output'); | ||
| 736 | |||
| 737 | return ;*/ | ||
| 738 | |||
| 739 | return view("layout.module.campaign.sampleDataExcel"); | ||
| 740 | } | ||
| 741 | |||
| 742 | return; | ||
| 397 | } | 743 | } |
| 398 | 744 | ||
| 399 | public function edit($id) | 745 | public function edit($id) |
| ... | @@ -408,4 +754,4 @@ class CampaignController extends Controller { | ... | @@ -408,4 +754,4 @@ class CampaignController extends Controller { |
| 408 | { | 754 | { |
| 409 | } | 755 | } |
| 410 | 756 | ||
| 411 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 757 | } | ... | ... |
| ... | @@ -95,4 +95,5 @@ Route::group(['middleware' => ['web']], function () { | ... | @@ -95,4 +95,5 @@ Route::group(['middleware' => ['web']], function () { |
| 95 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); | 95 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); |
| 96 | ///for the rlp pbwise | 96 | ///for the rlp pbwise |
| 97 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); | 97 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); |
| 98 | |||
| 98 | }); | 99 | }); | ... | ... |
| ... | @@ -818,11 +818,20 @@ $data.="</fieldset></div> | ... | @@ -818,11 +818,20 @@ $data.="</fieldset></div> |
| 818 | var dialerdispoarray={};var dispoClassArray={}; | 818 | var dialerdispoarray={};var dispoClassArray={}; |
| 819 | dialerdispoarray['']='';\n"; | 819 | dialerdispoarray['']='';\n"; |
| 820 | 820 | ||
| 821 | $mastersdata=$gthis->getDispocampaignData($dataarr[client]); | ||
| 822 | //$dispoarr=explode("~",$mastersdata['mvalue']); | ||
| 823 | |||
| 824 | if(empty($mastersdata)) | ||
| 825 | { | ||
| 826 | $mastersdata=$gthis->getCompanyMaster($client); | ||
| 827 | if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$gthis->HRCoreVars['dialerDispoList']; | ||
| 821 | 828 | ||
| 822 | $mastersdata=$gthis->getCompanyMaster($client); | 829 | $dispoarr=explode("~",$mastersdata['dialerDispoList']); |
| 823 | if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$gthis->HRCoreVars['dialerDispoList']; | 830 | }else{ |
| 824 | 831 | $dispoarr=explode("~",$mastersdata['mvalue']); | |
| 825 | $dispoarr=explode("~",$mastersdata['dialerDispoList']); | 832 | } |
| 833 | |||
| 834 | |||
| 826 | foreach($dispoarr as $dispo) | 835 | foreach($dispoarr as $dispo) |
| 827 | { | 836 | { |
| 828 | if(!empty($dispo)) | 837 | if(!empty($dispo)) |
| ... | @@ -1163,7 +1172,7 @@ function createQaireTab() | ... | @@ -1163,7 +1172,7 @@ function createQaireTab() |
| 1163 | } | 1172 | } |
| 1164 | 1173 | ||
| 1165 | } | 1174 | } |
| 1166 | 1175 | if(isset($supComnt)){ | |
| 1167 | foreach($supComnt as $supervisorcomments) | 1176 | foreach($supComnt as $supervisorcomments) |
| 1168 | { | 1177 | { |
| 1169 | 1178 | ||
| ... | @@ -1182,6 +1191,7 @@ function createQaireTab() | ... | @@ -1182,6 +1191,7 @@ function createQaireTab() |
| 1182 | <input type=button id='".$supervisorcomments->id."_submitComments' class='btn btn-info' value='Submit' onclick='updateagentcomments(".$supervisorcomments->id.");'style=' margin: 5px 0 5px 660px;'> | 1191 | <input type=button id='".$supervisorcomments->id."_submitComments' class='btn btn-info' value='Submit' onclick='updateagentcomments(".$supervisorcomments->id.");'style=' margin: 5px 0 5px 660px;'> |
| 1183 | </div>"; | 1192 | </div>"; |
| 1184 | } | 1193 | } |
| 1194 | } | ||
| 1185 | 1195 | ||
| 1186 | $data.="<legend class='task_legend'>Primary Questions</legend> | 1196 | $data.="<legend class='task_legend'>Primary Questions</legend> |
| 1187 | 1197 | ||
| ... | @@ -3358,53 +3368,7 @@ function createRLP() | ... | @@ -3358,53 +3368,7 @@ function createRLP() |
| 3358 | return $data; | 3368 | return $data; |
| 3359 | 3369 | ||
| 3360 | } | 3370 | } |
| 3361 | function createSMSForm() | ||
| 3362 | { | ||
| 3363 | //echo "Manoj"; | ||
| 3364 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 3365 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | ||
| 3366 | <h5>SMS</h5> | ||
| 3367 | <hr/><br> | ||
| 3368 | 3371 | ||
| 3369 | <div style='clear:both;width:100%;'> | ||
| 3370 | <div style='width:49%;float:left'> | ||
| 3371 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Name</label> | ||
| 3372 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['firstname']."' id='customer_name' readonly> | ||
| 3373 | </div> | ||
| 3374 | </div> | ||
| 3375 | <br><br> | ||
| 3376 | <div style='clear:both;width:100%;'> | ||
| 3377 | <div style='width:49%;float:left'> | ||
| 3378 | <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'> | ||
| 3380 | </div> | ||
| 3381 | </div> | ||
| 3382 | <br><br> | ||
| 3383 | <div style='clear:both;width:100%;'> | ||
| 3384 | <div> | ||
| 3385 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Message</label> | ||
| 3386 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='message' rows='4'></textarea> | ||
| 3387 | </div> | ||
| 3388 | </div> | ||
| 3389 | <br><br> | ||
| 3390 | <div style='clear:both;width:100%;'> | ||
| 3391 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%;font-weight:bold;' value='Send' id='sendmessage'> | ||
| 3392 | </div> | ||
| 3393 | </div> | ||
| 3394 | <script> | ||
| 3395 | $('#sendmessage').click(()=>{ | ||
| 3396 | var postdata='mobile='+$('#mobilenumber').val(); | ||
| 3397 | postdata+='&message='+$('#message').val(); | ||
| 3398 | doAjax('record?action=sendsms',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | ||
| 3399 | |||
| 3400 | //alert('your mobile number is given '+$('#mobilenumber').val()); | ||
| 3401 | |||
| 3402 | }) | ||
| 3403 | </script>"; | ||
| 3404 | |||
| 3405 | |||
| 3406 | return $data; | ||
| 3407 | } | ||
| 3408 | function createOneAssistForm() | 3372 | function createOneAssistForm() |
| 3409 | { | 3373 | { |
| 3410 | $dataarr=$this->recruitdata["peopledata"]; | 3374 | $dataarr=$this->recruitdata["peopledata"]; |
| ... | @@ -3580,9 +3544,6 @@ function CreateForm(&$frm) | ... | @@ -3580,9 +3544,6 @@ function CreateForm(&$frm) |
| 3580 | { | 3544 | { |
| 3581 | $frm['One Assist']["{{id}} {{firstname}}"][]=array(); | 3545 | $frm['One Assist']["{{id}} {{firstname}}"][]=array(); |
| 3582 | } | 3546 | } |
| 3583 | if(Auth::user()->username == "admin"){ | ||
| 3584 | $frm['SMS']["{{id}} {{firstname}}"][]=array(); | ||
| 3585 | } | ||
| 3586 | } | 3547 | } |
| 3587 | } | 3548 | } |
| 3588 | 3549 | ||
| ... | @@ -3652,7 +3613,6 @@ function CreateForm(&$frm) | ... | @@ -3652,7 +3613,6 @@ function CreateForm(&$frm) |
| 3652 | if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm(); | 3613 | if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm(); |
| 3653 | if($tbname=='RLP')$tabsdata.=$this->createRLP(); | 3614 | if($tbname=='RLP')$tabsdata.=$this->createRLP(); |
| 3654 | if($tbname=='One Assist')$tabsdata.=$this->createOneAssistForm(); | 3615 | if($tbname=='One Assist')$tabsdata.=$this->createOneAssistForm(); |
| 3655 | if($tbname=='SMS')$tabsdata.=$this->createSMSForm(); | ||
| 3656 | $tabsdata.="</div>"; | 3616 | $tabsdata.="</div>"; |
| 3657 | $i++; | 3617 | $i++; |
| 3658 | } | 3618 | } | ... | ... |
| ... | @@ -870,13 +870,13 @@ function popMail($userid) | ... | @@ -870,13 +870,13 @@ function popMail($userid) |
| 870 | } | 870 | } |
| 871 | function getPersonServer($empid) | 871 | function getPersonServer($empid) |
| 872 | { | 872 | { |
| 873 | if($this->getCount("records","clientcode='$empid'")==1) | 873 | if($this->getCount("records_demo","id='$empid'")==1) |
| 874 | { | 874 | { |
| 875 | $empdata=$this->LoadSingle("select * from records where clientcode='$empid';"); | 875 | $empdata=$this->LoadSingle("select * from records_demo where id='$empid';"); |
| 876 | $personarr['peopledata']=unserialize($empdata['peopledata']); | 876 | $personarr['peopledata']=unserialize($empdata['peopledata']); |
| 877 | $personarr['modifylog']=unserialize($empdata['modifylog']); | 877 | $personarr['modifylog']=unserialize($empdata['modifylog']); |
| 878 | $personarr['dirty']=unserialize($empdata['dirty']); | 878 | $personarr['dirty']=unserialize($empdata['dirty']); |
| 879 | $personarr['peopledata']['clientcode']=$empid; | 879 | $personarr['peopledata']['id']=$empid; |
| 880 | return $personarr; | 880 | return $personarr; |
| 881 | } | 881 | } |
| 882 | else return FALSE; | 882 | else return FALSE; |
| ... | @@ -1033,7 +1033,7 @@ function popMail($userid) | ... | @@ -1033,7 +1033,7 @@ function popMail($userid) |
| 1033 | 1033 | ||
| 1034 | function setPersonServer($empid,&$personarr) | 1034 | function setPersonServer($empid,&$personarr) |
| 1035 | { | 1035 | { |
| 1036 | if($this->getCount("records","clientcode='$empid'")==1&&is_array($personarr['peopledata'])) | 1036 | if($this->getCount("records_demo","id='$empid'")==1&&is_array($personarr['peopledata'])) |
| 1037 | { | 1037 | { |
| 1038 | $spostvars=serialize($personarr['peopledata']); | 1038 | $spostvars=serialize($personarr['peopledata']); |
| 1039 | $screatedlog=serialize($personarr['modifylog']); | 1039 | $screatedlog=serialize($personarr['modifylog']); |
| ... | @@ -1046,10 +1046,10 @@ function popMail($userid) | ... | @@ -1046,10 +1046,10 @@ function popMail($userid) |
| 1046 | { | 1046 | { |
| 1047 | $cachestr=''; | 1047 | $cachestr=''; |
| 1048 | 1048 | ||
| 1049 | /*if($personarr['peopledata']['dialer_flag']=="VIP" || $personarr['peopledata']['dialer_flag']=="") | 1049 | if($personarr['peopledata']['dialer_flag']=="VIP" || $personarr['peopledata']['dialer_flag']=="") |
| 1050 | { | 1050 | { |
| 1051 | $personarr['peopledata']['priority'] = ""; | 1051 | $personarr['peopledata']['priority'] = ""; |
| 1052 | }*/ | 1052 | } |
| 1053 | 1053 | ||
| 1054 | foreach($this->cachearray as $cachekey) | 1054 | foreach($this->cachearray as $cachekey) |
| 1055 | { | 1055 | { |
| ... | @@ -1072,13 +1072,13 @@ function popMail($userid) | ... | @@ -1072,13 +1072,13 @@ function popMail($userid) |
| 1072 | } | 1072 | } |
| 1073 | } | 1073 | } |
| 1074 | } | 1074 | } |
| 1075 | $personarr['peopledata']['clientcode']=$empid; | 1075 | $personarr['peopledata']['id']=$empid; |
| 1076 | 1076 | ||
| 1077 | $quoteP=serialize($personarr['peopledata']); | 1077 | $quoteP=serialize($personarr['peopledata']); |
| 1078 | $quoteM=serialize($personarr['modifylog']); | 1078 | $quoteM=serialize($personarr['modifylog']); |
| 1079 | $quoteD=serialize($personarr['dirty']); | 1079 | $quoteD=serialize($personarr['dirty']); |
| 1080 | /*$status=$personarr['peopledata']['status'];*/ | 1080 | /*$status=$personarr['peopledata']['status'];*/ |
| 1081 | return $this->Query("update records set modified=now(),peopledata='$quoteP',modifylog='$quoteM',dirty='$quoteD' $cachestr where clientcode='$empid' limit 1"); | 1081 | return $this->Query("update records_demo set modified=now(),peopledata='$quoteP',modifylog='$quoteM',dirty='$quoteD' $cachestr where id='$empid' limit 1"); |
| 1082 | } | 1082 | } |
| 1083 | } | 1083 | } |
| 1084 | else return -1; | 1084 | else return -1; |
| ... | @@ -1159,7 +1159,7 @@ function popMail($userid) | ... | @@ -1159,7 +1159,7 @@ function popMail($userid) |
| 1159 | } | 1159 | } |
| 1160 | } | 1160 | } |
| 1161 | 1161 | ||
| 1162 | return $this->LoadAll("select id,peopledata".$sqlarr." from records where $wheresql;"); | 1162 | return $this->LoadAll("select id".$sqlarr." from records where $wheresql;"); |
| 1163 | } | 1163 | } |
| 1164 | function getPersons($wheresql) | 1164 | function getPersons($wheresql) |
| 1165 | { | 1165 | { |
| ... | @@ -1174,33 +1174,6 @@ function popMail($userid) | ... | @@ -1174,33 +1174,6 @@ function popMail($userid) |
| 1174 | 1174 | ||
| 1175 | return $this->LoadAll("select id,created,modified,peopledata,modifylog,dirty".$sqlarr." from records where $wheresql;"); | 1175 | return $this->LoadAll("select id,created,modified,peopledata,modifylog,dirty".$sqlarr." from records where $wheresql;"); |
| 1176 | } | 1176 | } |
| 1177 | function getPersonsMissedcall($wheresql) | ||
| 1178 | { | ||
| 1179 | $sqlarr=""; | ||
| 1180 | foreach($this->cachearray as $cachekey) | ||
| 1181 | { | ||
| 1182 | if($cachekey!='') | ||
| 1183 | { | ||
| 1184 | $sqlarr.=" ,`$cachekey`"; | ||
| 1185 | } | ||
| 1186 | } | ||
| 1187 | |||
| 1188 | return $this->LoadAll("select id,created,modified,peopledata,modifylog,dirty".$sqlarr." from records where $wheresql ORDER BY modified desc;"); | ||
| 1189 | } | ||
| 1190 | |||
| 1191 | function getPersonsdownloadreport($wheresql) | ||
| 1192 | { | ||
| 1193 | $sqlarr=""; | ||
| 1194 | foreach($this->cachearray as $cachekey) | ||
| 1195 | { | ||
| 1196 | if($cachekey!='') | ||
| 1197 | { | ||
| 1198 | $sqlarr.=" ,`$cachekey`"; | ||
| 1199 | } | ||
| 1200 | } | ||
| 1201 | |||
| 1202 | return $this->LoadAll("select id,created,modified,peopledata,modifylog,dirty,client".$sqlarr." from records where $wheresql ORDER BY id asc ;"); | ||
| 1203 | } | ||
| 1204 | 1177 | ||
| 1205 | function isWorkingEmployee(&$ppldata,$year,$month,$date=0) | 1178 | function isWorkingEmployee(&$ppldata,$year,$month,$date=0) |
| 1206 | { | 1179 | { |
| ... | @@ -1388,7 +1361,12 @@ function popMail($userid) | ... | @@ -1388,7 +1361,12 @@ function popMail($userid) |
| 1388 | function getCompanyMaster($company) | 1361 | function getCompanyMaster($company) |
| 1389 | { | 1362 | { |
| 1390 | $companyarr=$this->loadAllDBMasters($company,'company');//$this->LoadSingle("select * from hrms_masters where mkey='$company' and mtype='company';"); | 1363 | $companyarr=$this->loadAllDBMasters($company,'company');//$this->LoadSingle("select * from hrms_masters where mkey='$company' and mtype='company';"); |
| 1364 | |||
| 1391 | $mastersdata=array(); | 1365 | $mastersdata=array(); |
| 1366 | |||
| 1367 | $mastersdata['status'] = $companyarr["status"]; | ||
| 1368 | /* $mastersdata['campaignstartdate'] = $companyarr["campaignstartdate"]; | ||
| 1369 | $mastersdata['campaignenddate'] = $companyarr["campaignenddate"];*/ | ||
| 1392 | if(!isset($companyarr["mvalue"]))$companyarr["mvalue"]=""; | 1370 | if(!isset($companyarr["mvalue"]))$companyarr["mvalue"]=""; |
| 1393 | 1371 | ||
| 1394 | $companymasters=explode("|",$companyarr["mvalue"]); | 1372 | $companymasters=explode("|",$companyarr["mvalue"]); |
| ... | @@ -1412,9 +1390,14 @@ function popMail($userid) | ... | @@ -1412,9 +1390,14 @@ function popMail($userid) |
| 1412 | } | 1390 | } |
| 1413 | } | 1391 | } |
| 1414 | } | 1392 | } |
| 1415 | 1393 | ||
| 1416 | return $mastersdata; | 1394 | return $mastersdata; |
| 1417 | } | 1395 | } |
| 1396 | function getDispocampaignData($company){ | ||
| 1397 | $companyar=$this->LoadSingle("select mvalue from hrms_masters where mkey='$company' and mtype='coreconfig';"); | ||
| 1398 | //print_r($company); | ||
| 1399 | return $companyar; | ||
| 1400 | } | ||
| 1418 | function getEmailListforClient($tclient) | 1401 | function getEmailListforClient($tclient) |
| 1419 | { | 1402 | { |
| 1420 | $unameslist=array(); | 1403 | $unameslist=array(); |
| ... | @@ -1610,6 +1593,26 @@ function popMail($userid) | ... | @@ -1610,6 +1593,26 @@ function popMail($userid) |
| 1610 | } | 1593 | } |
| 1611 | function clientsReadAccess() | 1594 | function clientsReadAccess() |
| 1612 | { | 1595 | { |
| 1596 | /* $companyarr=$this->LoadAll("select * from hrms_masters where mtype='company' and status='active'"); | ||
| 1597 | $campaigns=array(); | ||
| 1598 | $now = new \DateTime(); | ||
| 1599 | foreach($companyarr as $tcompany){ | ||
| 1600 | $campaigns[]=$tcompany['mkey']; | ||
| 1601 | } | ||
| 1602 | foreach($companyarr as $tcompany){ | ||
| 1603 | $campaignstartdate = new \DateTime($tcompany['campaignstartdate']); | ||
| 1604 | $campaignenddate = new \DateTime($tcompany['campaignenddate']); | ||
| 1605 | |||
| 1606 | if(empty($tcompany['campaignstartdate']) || empty($tcompany['campaignenddate'])){ | ||
| 1607 | print_r($tcompany['mkey']); | ||
| 1608 | $campaigns[]=$tcompany['mkey']; | ||
| 1609 | }else{ | ||
| 1610 | if($campaignstartdate < $now and $campaignenddate > $now){ | ||
| 1611 | print_r($tcompany['mkey']); | ||
| 1612 | $campaigns[]=$tcompany['mkey']; | ||
| 1613 | } | ||
| 1614 | } | ||
| 1615 | }*/ | ||
| 1613 | $clientlst=array(); | 1616 | $clientlst=array(); |
| 1614 | if($this->GetBBBUserData("readotherdata")=="No") | 1617 | if($this->GetBBBUserData("readotherdata")=="No") |
| 1615 | { | 1618 | { |
| ... | @@ -1630,7 +1633,8 @@ function popMail($userid) | ... | @@ -1630,7 +1633,8 @@ function popMail($userid) |
| 1630 | } | 1633 | } |
| 1631 | else | 1634 | else |
| 1632 | { | 1635 | { |
| 1633 | $companyarr=$this->LoadAll("select * from hrms_masters where mtype='company'"); | 1636 | $companyarr=$this->LoadAll("select * from hrms_masters where mtype='company' and status='active'"); |
| 1637 | //$companyarr=$this->LoadAll("select * from hrms_masters where mtype='company'"); | ||
| 1634 | foreach($companyarr as $tcompany)$clientlst[]=$tcompany['mkey']; | 1638 | foreach($companyarr as $tcompany)$clientlst[]=$tcompany['mkey']; |
| 1635 | 1639 | ||
| 1636 | $selectarr=$this->loadAllDBMasters("client",'select'); | 1640 | $selectarr=$this->loadAllDBMasters("client",'select'); |
| ... | @@ -1639,7 +1643,31 @@ function popMail($userid) | ... | @@ -1639,7 +1643,31 @@ function popMail($userid) |
| 1639 | if(is_array($clientlst))$clientlst=array_unique(array_merge($clientlst,$newvalues)); | 1643 | if(is_array($clientlst))$clientlst=array_unique(array_merge($clientlst,$newvalues)); |
| 1640 | } | 1644 | } |
| 1641 | } | 1645 | } |
| 1642 | return $clientlst; | 1646 | $activeClientCampaign = array(); |
| 1647 | $companyarr=$this->LoadAll("select * from hrms_masters where mtype='company' and status='active'"); | ||
| 1648 | $campaigns=array(); | ||
| 1649 | $dashboarduser=Auth::user(); | ||
| 1650 | $timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone; | ||
| 1651 | $timeoffset = $timeoffset*60; | ||
| 1652 | $now = strtotime(date("Y-m-d H:i:s"))-$timeoffset; | ||
| 1653 | |||
| 1654 | foreach($companyarr as $tcompany){ | ||
| 1655 | $campaignstartdate = strtotime($tcompany['campaignstartdate']); | ||
| 1656 | $campaignenddate = strtotime($tcompany['campaignenddate']); | ||
| 1657 | if($tcompany['campaignstartdate'] == '0000-00-00 00:00:00' || $tcompany['campaignenddate'] == '0000-00-00 00:00:00'){ | ||
| 1658 | $campaigns[]=$tcompany['mkey']; | ||
| 1659 | }else{ | ||
| 1660 | if($campaignstartdate < $now and $campaignenddate > $now){ | ||
| 1661 | $campaigns[]=$tcompany['mkey']; | ||
| 1662 | } | ||
| 1663 | } | ||
| 1664 | } | ||
| 1665 | foreach ($clientlst as $key => $value) { | ||
| 1666 | if(in_array($value, $campaigns)){ | ||
| 1667 | $activeClientCampaign[]=$value; | ||
| 1668 | } | ||
| 1669 | } | ||
| 1670 | return $activeClientCampaign; | ||
| 1643 | } | 1671 | } |
| 1644 | function clientsOwnerRWAccess() | 1672 | function clientsOwnerRWAccess() |
| 1645 | { | 1673 | { |
| ... | @@ -1811,9 +1839,7 @@ function popMail($userid) | ... | @@ -1811,9 +1839,7 @@ function popMail($userid) |
| 1811 | function searchPhone($key,$number) | 1839 | function searchPhone($key,$number) |
| 1812 | { | 1840 | { |
| 1813 | $users=array(); | 1841 | $users=array(); |
| 1814 | |||
| 1815 | $mobile10=substr($number,-10); | 1842 | $mobile10=substr($number,-10); |
| 1816 | //Log::info($mobile10." ^ "); | ||
| 1817 | $tusers=$this->getPersons("RIGHT($key,10) = $mobile10"); | 1843 | $tusers=$this->getPersons("RIGHT($key,10) = $mobile10"); |
| 1818 | if($tusers) | 1844 | if($tusers) |
| 1819 | { | 1845 | { | ... | ... |
| ... | @@ -109,10 +109,10 @@ return [ | ... | @@ -109,10 +109,10 @@ return [ |
| 109 | "RecordingQC"=>["menuAction('dialer/recqc');","A"], | 109 | "RecordingQC"=>["menuAction('dialer/recqc');","A"], |
| 110 | "RecordingArchive"=>["menuAction('dialer/recarchive');","A"], | 110 | "RecordingArchive"=>["menuAction('dialer/recarchive');","A"], |
| 111 | ]], | 111 | ]], |
| 112 | 112 | "Campaign" => ["disp"=>"FCM","icon"=>"file","dash"=>"", | |
| 113 | "Campaign" => ["disp"=>"Campaign","icon"=>"file","dash"=>"","onclick"=>"menuAction('campaign');"], | 113 | "submenu"=>["FCM"=>["menuAction('campaign');"], |
| 114 | 114 | "Bulk Upload"=>["menuAction('campaign/bulkupload');"], | |
| 115 | 115 | ]], | |
| 116 | "Admin" => ["disp"=>"Admin","icon"=>"gear","dash"=>"", | 116 | "Admin" => ["disp"=>"Admin","icon"=>"gear","dash"=>"", |
| 117 | "submenu"=>["Masters"=>["showBlock('Masters');"], | 117 | "submenu"=>["Masters"=>["showBlock('Masters');"], |
| 118 | "Delete Record"=>["showBlock('DeletePerson');"], | 118 | "Delete Record"=>["showBlock('DeletePerson');"], | ... | ... |
| 1 | <div class="container-fluid"> | ||
| 2 | <div class="layout-app"> | ||
| 3 | <div class="row"> | ||
| 4 | <div class="col-md-12"> | ||
| 5 | <div class="col-separator col-separator-first col-unscrollable box"> | ||
| 6 | <div class="innerAll"> | ||
| 7 | <h4>Bulk Upload</h4> | ||
| 8 | <hr style="margin-bottom: 10px;" /> | ||
| 9 | |||
| 10 | <div class="row"> | ||
| 11 | <div class="col-lg-6"> | ||
| 12 | <div class="form-inline"> | ||
| 13 | <form method="post" id="bulkUpload" enctype="multipart/form-data"> | ||
| 14 | <input type=hidden name=uploadSet value='1'> | ||
| 15 | {{ csrf_field() }} | ||
| 16 | <div class="col-md-2"> | ||
| 17 | <label>Upload Users:</label> | ||
| 18 | </div> | ||
| 19 | <div class="col-md-4"> | ||
| 20 | <input type="file" name="file" id="file" required /> | ||
| 21 | </div> | ||
| 22 | <div class="col-md-2"> | ||
| 23 | <input type="submit" name="upload" id="upload" class="btn btn-primary" value="Upload"> | ||
| 24 | |||
| 25 | </div> | ||
| 26 | <div class="col-md-2"> | ||
| 27 | <!--- <span><a href="javascript:void(0)" id="downloadExcel">Sample excel format</a></span>---> | ||
| 28 | </div> | ||
| 29 | </form> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | <div class="col-lg-6"> | ||
| 33 | |||
| 34 | </div> | ||
| 35 | </div> | ||
| 36 | |||
| 37 | </div> | ||
| 38 | </div> | ||
| 39 | </div> | ||
| 40 | </div> | ||
| 41 | |||
| 42 | </div> | ||
| 43 | </div> | ||
| 44 | |||
| 45 | <script> | ||
| 46 | $(document).ready(function(){ | ||
| 47 | $('#bulkUpload').on('submit', function(event){ | ||
| 48 | event.preventDefault(); | ||
| 49 | var formData = new FormData(this); | ||
| 50 | $.ajax({ | ||
| 51 | url:"campaign?action=bulkupload", | ||
| 52 | method:"POST", | ||
| 53 | data:formData, | ||
| 54 | dataType:'JSON', | ||
| 55 | contentType: false, | ||
| 56 | cache: false, | ||
| 57 | processData: false, | ||
| 58 | success:function(data) | ||
| 59 | { | ||
| 60 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 61 | $('#bulkUpload').trigger("reset"); | ||
| 62 | $("#file").val(null); | ||
| 63 | }, | ||
| 64 | error: function(error) | ||
| 65 | { | ||
| 66 | simpleNotification('Success','topRight',"Something went wrong!"); | ||
| 67 | }, | ||
| 68 | }); | ||
| 69 | }); | ||
| 70 | |||
| 71 | $('#downloadExcel').click(function(){ | ||
| 72 | event.preventDefault(); | ||
| 73 | doAjax("campaign/sampleDataExcel","","","","","GET"); | ||
| 74 | return false; | ||
| 75 | }); | ||
| 76 | }); | ||
| 77 | </script> |
| 1 | @include("layout/module/campaign/formBuilder") | ||
| 2 | |||
| 3 | @if($campaignDetails) | ||
| 4 | <hr style="margin-top: 10px;margin-bottom: 10px;" /> | ||
| 5 | <div class="row"> | ||
| 6 | <div class="col-sm-2"> | ||
| 7 | <h4 class="text-center"><span class="text-info"> {{ is_array($campaignDetails)?$campaignDetails['mkey']:$campaignDetails->mkey}}</span> <small>campaign</small></h4> | ||
| 8 | <ul class="list-group"> | ||
| 9 | <li class="list-group-item active">By Call Status</li> | ||
| 10 | <?php $totalRecordsByStatus = 0; ?> | ||
| 11 | @foreach($dataCountByStatus as $data) | ||
| 12 | <li class="list-group-item"> | ||
| 13 | {{ $data->status ? $data->status : '- Blank -' }} <span class="badge">{{$data->recordCount}}</span> | ||
| 14 | </li> | ||
| 15 | <?php $totalRecordsByStatus += $data->recordCount; ?> | ||
| 16 | @endforeach | ||
| 17 | <li class="list-group-item" style="background-color:#f6f7fb;"> | ||
| 18 | <strong>Total</strong> <span class="badge"><strong>{{ isset($totalRecordsByStatus) ? $totalRecordsByStatus : '0' }}</strong></span> | ||
| 19 | </li> | ||
| 20 | </ul> | ||
| 21 | |||
| 22 | <ul class="list-group"> | ||
| 23 | <li class="list-group-item active">By Disposition</li> | ||
| 24 | <?php $totalRecordsByDisposition = 0; ?> | ||
| 25 | @foreach($dataCountByDisposition as $data) | ||
| 26 | <li class="list-group-item"> | ||
| 27 | {{ $data->dialer_status ? $data->dialer_status : '- Blank -' }} <span class="badge">{{$data->recordCount}}</span> | ||
| 28 | </li> | ||
| 29 | <?php $totalRecordsByDisposition += $data->recordCount; ?> | ||
| 30 | @endforeach | ||
| 31 | <li class="list-group-item" style="background-color:#f6f7fb;"> | ||
| 32 | <strong>Total</strong> <span class="badge"><strong>{{ isset($totalRecordsByDisposition) ? $totalRecordsByDisposition : '0' }}</strong></span> | ||
| 33 | </li> | ||
| 34 | </ul> | ||
| 35 | </div> | ||
| 36 | <div class="col-sm-10"> | ||
| 37 | <div id="tabs"> | ||
| 38 | <ul class="nav nav-tabs" role="tablist"> | ||
| 39 | <!-- <li role="presentation"> | ||
| 40 | <a href="#ctCrm" aria-controls="home" role="tab" data-toggle="tab">CRM</a> | ||
| 41 | </li> | ||
| 42 | <li role="presentation"> | ||
| 43 | <a href="#ctScript" aria-controls="profile" role="tab" data-toggle="tab">Script</a> | ||
| 44 | </li> | ||
| 45 | <li role="presentation"> | ||
| 46 | <a href="#ctFeedback" aria-controls="messages" role="tab" data-toggle="tab">Feedback</a> | ||
| 47 | </li> | ||
| 48 | <li role="presentation"> | ||
| 49 | <a href="#ctSettings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a> | ||
| 50 | </li> | ||
| 51 | <li role="presentation"> | ||
| 52 | <a href="#ctData" aria-controls="data" role="tab" data-toggle="tab">Data</a> | ||
| 53 | </li> --> | ||
| 54 | <li role="presentation" class="active"> | ||
| 55 | <a href="#ctSql" aria-controls="sql" role="tab" data-toggle="tab">Filter Condition</a> | ||
| 56 | </li> | ||
| 57 | <li role="presentation"> | ||
| 58 | <a href="#ctSql1" aria-controls="sql" role="tab" data-toggle="tab">Filter Apply</a> | ||
| 59 | </li> | ||
| 60 | <li role="presentation"> | ||
| 61 | <a href="#assign" aria-controls="sql" role="tab" data-toggle="tab">User Assign</a> | ||
| 62 | </li> | ||
| 63 | <li role="presentation"> | ||
| 64 | <a href="#schedule" aria-controls="sql" role="tab" data-toggle="tab">Scheduler</a> | ||
| 65 | </li> | ||
| 66 | <li role="presentation"> | ||
| 67 | <a href="#disposition" aria-controls="sql" role="tab" data-toggle="tab">Disposition</a> | ||
| 68 | </li> | ||
| 69 | </ul> | ||
| 70 | <div class="tab-content"> | ||
| 71 | <!-- <div role="tabpanel" class="tab-pane" id="ctCrm"> | ||
| 72 | </div> | ||
| 73 | <div role="tabpanel" class="tab-pane" id="ctScript"> | ||
| 74 | </div> | ||
| 75 | <div role="tabpanel" class="tab-pane" id="ctFeedback"> | ||
| 76 | </div> | ||
| 77 | <div role="tabpanel" class="tab-pane" id="ctSettings"> | ||
| 78 | </div> | ||
| 79 | <div role="tabpanel" class="tab-pane" id="ctData"> | ||
| 80 | </div> --> | ||
| 81 | <div role="tabpanel" class="tab-pane active" id="ctSql"> | ||
| 82 | @include("layout/module/campaign/campaignTabSql") | ||
| 83 | </div> | ||
| 84 | <div role="tabpanel" class="tab-pane" id="ctSql1"> | ||
| 85 | @include("layout/module/campaign/campaignTabSqlCond") | ||
| 86 | </div> | ||
| 87 | <div role="tabpanel" class="tab-pane" id="assign"> | ||
| 88 | @include("layout/module/campaign/campaignAssignToAgents") | ||
| 89 | </div> | ||
| 90 | <div role="tabpanel" class="tab-pane" id="schedule"> | ||
| 91 | @include("layout/module/campaign/campaignScheduler") | ||
| 92 | </div> | ||
| 93 | <div role="tabpanel" class="tab-pane" id="disposition"> | ||
| 94 | @include("layout/module/campaign/campaignAssignToDisposition") | ||
| 95 | </div> | ||
| 96 | </div> | ||
| 97 | </div> | ||
| 98 | </div> | ||
| 99 | </div> | ||
| 100 | @else | ||
| 101 | <br/> | ||
| 102 | <p class="text-danger text-center">Campaign not found.</p> | ||
| 103 | @endif | ||
| 104 | |||
| 105 | <style> | ||
| 106 | .tab-pane{padding: 10px;border: 1px solid #ed5564;border-top: none;} | ||
| 107 | .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus{border: 1px solid #ed5564;border-bottom-color: transparent;} | ||
| 108 | </style> |
application/resources/views/layout/module/campaign/campaign/campaignAssignToAgents.blade.php
0 → 100755
| 1 | <?php | ||
| 2 | $dashboarduser=Auth::user(); | ||
| 3 | if($dashboarduser->usertype != 'Admin'){ | ||
| 4 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 5 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 6 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 7 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 8 | })->get(); | ||
| 9 | } | ||
| 10 | else | ||
| 11 | { | ||
| 12 | $allusers=DB::table('users')->select('*')->where('status','=','Active')->get(); | ||
| 13 | } | ||
| 14 | |||
| 15 | foreach($userassignedcampign as $userassigned) | ||
| 16 | { | ||
| 17 | $userassignedcamp[] = $userassigned->username; | ||
| 18 | } | ||
| 19 | |||
| 20 | foreach($allusers as $alluser) | ||
| 21 | { | ||
| 22 | if (isset($userassignedcamp)) { | ||
| 23 | if (!in_array($alluser->username, $userassignedcamp)) | ||
| 24 | { | ||
| 25 | $username[] = $alluser->username; | ||
| 26 | } | ||
| 27 | } | ||
| 28 | else{ | ||
| 29 | $username[] = $alluser->username; | ||
| 30 | } | ||
| 31 | |||
| 32 | } | ||
| 33 | foreach($allusers as $user) | ||
| 34 | { | ||
| 35 | $campaigns=$user->clients; | ||
| 36 | if(isset($data->hrmsdata)) | ||
| 37 | {print_r('man');echo "<br><br>"; | ||
| 38 | $hrmsdata=unserialize($data['hrmsdata']); | ||
| 39 | // $campaignList = $hrmsdata['clientsownerlist'];print_r($campaignList); | ||
| 40 | } | ||
| 41 | //$username[] = $alluser->username; | ||
| 42 | } | ||
| 43 | |||
| 44 | //$data['client'] = $client; | ||
| 45 | // if(isset($username))$data->username = $username; | ||
| 46 | ?> | ||
| 47 | <div class="row"> | ||
| 48 | <div class="col-md-12"> | ||
| 49 | <div class="panel panel-info"> | ||
| 50 | <div class="panel-body"> | ||
| 51 | <div class="col-md-2"> | ||
| 52 | <label>Select User:</label> | ||
| 53 | </div> | ||
| 54 | <div class="col-md-6"> | ||
| 55 | <select id="username" class="select2multi" style='width:100%' multiple=""> | ||
| 56 | <option value></option> | ||
| 57 | <?php if(isset($username))foreach($username as $user){;echo "<option value='$user'>$user</option>";} ?> | ||
| 58 | </select> | ||
| 59 | </div> | ||
| 60 | <div class="col-md-2"> | ||
| 61 | <button id="assigncampaign" class="btn btn-xs btn-info">Assign Campaign | ||
| 62 | </button> | ||
| 63 | </div> | ||
| 64 | </div> | ||
| 65 | </div> | ||
| 66 | <div class="panel panel-info"> | ||
| 67 | <div class="panel-body"> | ||
| 68 | <form method="post" id="upload_form" enctype="multipart/form-data"> | ||
| 69 | <input type=hidden name=uploadSet value='1'> | ||
| 70 | {{ csrf_field() }} | ||
| 71 | <div class="col-md-2"> | ||
| 72 | <label>Upload Users:</label> | ||
| 73 | </div> | ||
| 74 | <div class="col-md-6"> | ||
| 75 | <input type="file" name="file" id="file" required /> | ||
| 76 | </div> | ||
| 77 | <div class="col-md-2"> | ||
| 78 | <input type="submit" name="upload" id="upload" class="btn btn-primary" value="Upload"> | ||
| 79 | </div> | ||
| 80 | </form> | ||
| 81 | </div> | ||
| 82 | </div> | ||
| 83 | <!--<div class="panel panel-info"> | ||
| 84 | <div class="panel-body"> | ||
| 85 | <div class="col-md-2"> | ||
| 86 | <label>Upload Users:</label> | ||
| 87 | </div> | ||
| 88 | <div class="col-md-6"> | ||
| 89 | <input type="file" name="user"> | ||
| 90 | <input type="file" name="file" id="file" required /> | ||
| 91 | </div> | ||
| 92 | <div class="col-md-2"> | ||
| 93 | <button id="upload" class="btn btn-xs btn-info">Upload | ||
| 94 | </button> | ||
| 95 | </div> | ||
| 96 | </div> | ||
| 97 | </div> --> | ||
| 98 | |||
| 99 | <div class="panel panel-info"> | ||
| 100 | <div class="panel-heading "><strong>Assigned Users List</strong><div style="float:right;"> | ||
| 101 | <button id="removeuser" class="btn btn-xs btn-info">Edit User | ||
| 102 | </button> | ||
| 103 | </div></div> | ||
| 104 | <div class="panel-body"> | ||
| 105 | |||
| 106 | <div class="col-md-12" id="dbs"> | ||
| 107 | @foreach ($userassignedcampign as $row) | ||
| 108 | |||
| 109 | <div class="col-md-1">{{$row->username}}</div> | ||
| 110 | |||
| 111 | @endforeach | ||
| 112 | </div> | ||
| 113 | <div class="col-md-12" id="abs" style="display:none"> | ||
| 114 | <div class="col-md-6"> | ||
| 115 | <select id="username1" class="select2multi" style='width:100%' multiple=""> | ||
| 116 | <option value></option> | ||
| 117 | <?php if(isset($userassignedcamp))foreach($userassignedcamp as $userassigned){;echo "<option value='$userassigned' selected>$userassigned</option>";} ?> | ||
| 118 | </select> | ||
| 119 | </div> | ||
| 120 | <div class="col-md-2"> | ||
| 121 | <button id="removecampaign" class="btn btn-xs btn-info">Save | ||
| 122 | </button> | ||
| 123 | </div> | ||
| 124 | </div> | ||
| 125 | |||
| 126 | |||
| 127 | </div> | ||
| 128 | </div> | ||
| 129 | </div> | ||
| 130 | </div> | ||
| 131 | <script> | ||
| 132 | $(document).ready(function(){ | ||
| 133 | $('#upload_form').on('submit', function(event){ | ||
| 134 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 135 | var formData = new FormData(this); | ||
| 136 | formData.append('selectCampaignField', selectCampaignField); | ||
| 137 | event.preventDefault(); | ||
| 138 | $.ajax({ | ||
| 139 | url:"campaign?action=upload", | ||
| 140 | method:"POST", | ||
| 141 | data:formData, | ||
| 142 | dataType:'JSON', | ||
| 143 | contentType: false, | ||
| 144 | cache: false, | ||
| 145 | processData: false, | ||
| 146 | success:function(data) | ||
| 147 | { | ||
| 148 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 149 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 150 | $('.nav-tabs a[href="#assign"]').tab('show'); | ||
| 151 | }); | ||
| 152 | |||
| 153 | } | ||
| 154 | }); | ||
| 155 | }); | ||
| 156 | }); | ||
| 157 | </script> | ||
| 158 | <script> | ||
| 159 | function addInQueue(){ | ||
| 160 | var data = 'radioValue='+$("input[name='query']:checked").val(); | ||
| 161 | |||
| 162 | doAjax("campaign/addCurrQueue",data,"","","","GET"); | ||
| 163 | } | ||
| 164 | |||
| 165 | $('#assigncampaign').click(function() | ||
| 166 | { | ||
| 167 | var agents = $('#username').val(); | ||
| 168 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 169 | |||
| 170 | |||
| 171 | if(agents&&selectCampaignField) | ||
| 172 | { | ||
| 173 | var postdata='agents='+agents; | ||
| 174 | postdata+='&selectCampaignField='+selectCampaignField; | ||
| 175 | doAjax("campaign/assigncampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 176 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 177 | |||
| 178 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 179 | $("#usrname").select2("val", "Select User..."); | ||
| 180 | $("#selectCampaignField").select("val", "Select Dial Mode..."); | ||
| 181 | $('.nav-tabs a[href="#assign"]').tab('show'); | ||
| 182 | }); | ||
| 183 | |||
| 184 | }); | ||
| 185 | } | ||
| 186 | else | ||
| 187 | { | ||
| 188 | $("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign and user.</p>'); | ||
| 189 | } | ||
| 190 | |||
| 191 | }); | ||
| 192 | |||
| 193 | $("#removeuser").click(function(){ | ||
| 194 | $("#dbs").hide(); | ||
| 195 | $("#abs").toggle(); | ||
| 196 | }); | ||
| 197 | $('#removecampaign').click(function() | ||
| 198 | { | ||
| 199 | var agents = $('#username1').val(); | ||
| 200 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 201 | |||
| 202 | |||
| 203 | if(selectCampaignField) | ||
| 204 | { | ||
| 205 | var postdata='agents='+agents; | ||
| 206 | postdata+='&selectCampaignField='+selectCampaignField; | ||
| 207 | doAjax("campaign/removecampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 208 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 209 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 210 | $("#usrname").select2("val", "Select User..."); | ||
| 211 | $("#selectCampaignField").select("val", "Select Dial Mode..."); | ||
| 212 | $('.nav-tabs a[href="#assign"]').tab('show'); | ||
| 213 | }); | ||
| 214 | |||
| 215 | }); | ||
| 216 | } | ||
| 217 | else | ||
| 218 | { | ||
| 219 | $("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign and user.</p>'); | ||
| 220 | } | ||
| 221 | |||
| 222 | }); | ||
| 223 | </script> |
application/resources/views/layout/module/campaign/campaign/campaignAssignToDisposition.blade.php
0 → 100755
| 1 | <style> | ||
| 2 | .list-group{ | ||
| 3 | padding: 5px; | ||
| 4 | margin: 0px; | ||
| 5 | overflow:auto; | ||
| 6 | width:100% | ||
| 7 | } | ||
| 8 | </style> | ||
| 9 | <div class="row"> | ||
| 10 | <div class="col-md-12"> | ||
| 11 | <div class="panel panel-info"> | ||
| 12 | <div class="panel-body"> | ||
| 13 | <div class="row" style="margin: 5px"> | ||
| 14 | <div class="col-md-2"> | ||
| 15 | <label>Select Disposition:</label> | ||
| 16 | </div> | ||
| 17 | <div class="col-md-6"> | ||
| 18 | <select id="disposition" class="form-control" onchange='subDisposition($(this).val());'> | ||
| 19 | <option value></option> | ||
| 20 | <?php if(isset($disposition)) | ||
| 21 | foreach($disposition as $kay => $val) | ||
| 22 | { | ||
| 23 | $code = $dispositionCode[$kay]; | ||
| 24 | echo "<option data-id='$code' data-text='$kay' value='$val'>$kay</option>"; | ||
| 25 | } ?> | ||
| 26 | </select> | ||
| 27 | |||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | <div class="row" style="margin: 5px"> | ||
| 31 | <div class="col-md-2"> | ||
| 32 | <label>Select Sub Disposition:</label> | ||
| 33 | </div> | ||
| 34 | <div class="col-md-6"> | ||
| 35 | <select id="subDisposition" class="select2multi" style='width:100%' multiple=""> | ||
| 36 | </select> | ||
| 37 | </select> | ||
| 38 | </div> | ||
| 39 | </div> | ||
| 40 | <div class="row"> | ||
| 41 | <div class="col-md-2"> | ||
| 42 | <button id="assigndesposition" class="btn btn-xs btn-info">Assign Disposition | ||
| 43 | </button> | ||
| 44 | </div> | ||
| 45 | <div class="col-md-8" id="error"> | ||
| 46 | </div> | ||
| 47 | </div> | ||
| 48 | |||
| 49 | </div> | ||
| 50 | </div> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | <div class="col-sm-12"> | ||
| 54 | <div class="panel panel-info"> | ||
| 55 | <div class="panel-heading"><strong>Disposition List</strong></div> | ||
| 56 | <div class="panel-body" id=""> | ||
| 57 | <ul class="list-group"> | ||
| 58 | <?php foreach($dispositionList as $key => $val) { if(!empty($val)){ ?> | ||
| 59 | <li class="list-group-item list-group"> | ||
| 60 | <div class="col-sm-12"> | ||
| 61 | <div class="col-sm-3"><?php echo $key; ?></div> | ||
| 62 | <div class="col-sm-6"><?php echo $val; ?></div> | ||
| 63 | <div class="col-sm-2"><a class="innerAll" href="#" onclick="deleteDesposition('<?php echo $key; ?>');"> | ||
| 64 | <span class="btn btn-primary btn-xs"><i class="fa fa-trash-o"></i></span> | ||
| 65 | </a></div> | ||
| 66 | </div> | ||
| 67 | |||
| 68 | </li> | ||
| 69 | <?php }} ?> | ||
| 70 | </ul> | ||
| 71 | </div> | ||
| 72 | </div> | ||
| 73 | </div> | ||
| 74 | |||
| 75 | </div> | ||
| 76 | |||
| 77 | <script> | ||
| 78 | function subDisposition(dispo) | ||
| 79 | { | ||
| 80 | var dispolist = dispo.split(','); | ||
| 81 | /*var dispolist = []; | ||
| 82 | |||
| 83 | $.each( dispo, function( index, value ){ | ||
| 84 | dispolist = $.merge( dispolist, value.split(',') ); | ||
| 85 | });*/ | ||
| 86 | |||
| 87 | $("#subDisposition").select2("val", "Select"); | ||
| 88 | updateJSSelect('subDisposition',dispolist); | ||
| 89 | } | ||
| 90 | |||
| 91 | function deleteDesposition(key) | ||
| 92 | { | ||
| 93 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 94 | var postdata='disposition='+key; | ||
| 95 | postdata+='&selectCampaignField='+selectCampaignField; | ||
| 96 | |||
| 97 | doAjax("campaign/deleteAssignDisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 98 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 99 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 100 | $("#subDisposition").select2("val", "Select"); | ||
| 101 | $('.nav-tabs a[href="#disposition"]').tab('show'); | ||
| 102 | }); | ||
| 103 | |||
| 104 | }); | ||
| 105 | } | ||
| 106 | |||
| 107 | $('#assigndesposition').click(function() | ||
| 108 | { | ||
| 109 | $("#error").html(''); | ||
| 110 | var code = $('#disposition').find(':selected').attr('data-id') | ||
| 111 | //var disposition = $("#disposition option:selected").text(); | ||
| 112 | var disposition = $('#disposition').find(':selected').attr('data-text') | ||
| 113 | var subDisposition = $('#subDisposition').val(); | ||
| 114 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 115 | //alert(selectCampaignField); | ||
| 116 | |||
| 117 | if(disposition&&selectCampaignField) | ||
| 118 | { | ||
| 119 | var postdata='disposition='+disposition; | ||
| 120 | postdata+='&code='+code; | ||
| 121 | postdata+='&disposition='+disposition; | ||
| 122 | postdata+='&subDisposition='+subDisposition; | ||
| 123 | postdata+='&selectCampaignField='+selectCampaignField; | ||
| 124 | doAjax("campaign/assigndisposition",postdata,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 125 | simpleNotification('Success','topRight',"Campaign assign suceesfully!"); | ||
| 126 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 127 | $("#subDisposition").select2("val", "Select"); | ||
| 128 | $('.nav-tabs a[href="#disposition"]').tab('show'); | ||
| 129 | }); | ||
| 130 | |||
| 131 | }); | ||
| 132 | } | ||
| 133 | else | ||
| 134 | { | ||
| 135 | $("#error").html('<p class="text-danger text-center">Please select the campaign and disposition.</p>'); | ||
| 136 | return false; | ||
| 137 | } | ||
| 138 | |||
| 139 | |||
| 140 | |||
| 141 | }); | ||
| 142 | |||
| 143 | </script> |
| 1 | <?php | ||
| 2 | $queryFields = explode(",", 'status,dialer_status,dialer_substatus,usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback,elegible'); | ||
| 3 | |||
| 4 | ?> | ||
| 5 | <div class="row"> | ||
| 6 | <div class="col-md-12"> | ||
| 7 | <div class="panel panel-info"> | ||
| 8 | <div class="panel-body"> | ||
| 9 | <!--<p><button id='addquery' class="btn btn-xs btn-info">ADD</button></p>---> | ||
| 10 | <label> Filter Name</label> | ||
| 11 | <input id='filtername' type='text' /> | ||
| 12 | <select id="columnSelect" multiple="" style='width:100%' class=select2multi> | ||
| 13 | @foreach($queryFields as $fields) | ||
| 14 | <option value="{{$fields}}">{{$fields}}</option> | ||
| 15 | @endforeach | ||
| 16 | </select> | ||
| 17 | <button type="submit" class="btn btn-success pull-right" value='Prepare' id='prepare'>Prepare</button> | ||
| 18 | </div> | ||
| 19 | <div> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | </div> | ||
| 23 | </div> | ||
| 24 | <script> | ||
| 25 | $("#prepare").click(function(){ | ||
| 26 | console.log($("#columnSelect").val().length); | ||
| 27 | }); | ||
| 28 | </script> |
| 1 | <?php | ||
| 2 | |||
| 3 | |||
| 4 | |||
| 5 | ?> | ||
| 6 | |||
| 7 | <div class="row"> | ||
| 8 | <div class="col-md-12"> | ||
| 9 | <div class="panel panel-info"> | ||
| 10 | <div class="panel-body"> | ||
| 11 | <p><label class='label-small_new' style='width:15%'>Campaign Start Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignstartdate id=campaignstartdate value="{{ isset($campaignDetails->campaignstartdate)?$campaignDetails->campaignstartdate:'0000-00-00 00:00:00' }}"></p> | ||
| 12 | <p><label class='label-small_new' style='width:15%'>Campaign End Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignenddate id=campaignenddate value="{{ isset($campaignDetails->campaignenddate)?$campaignDetails->campaignenddate:'0000-00-00 00:00:00' }}" ></p> | ||
| 13 | <div class="col-md-2"> | ||
| 14 | <button id="scheduleCampaign" class="btn btn-xs btn-info">Schedule | ||
| 15 | </button> | ||
| 16 | </div> | ||
| 17 | </div> | ||
| 18 | </div> | ||
| 19 | </div> | ||
| 20 | </div> | ||
| 21 | <script> | ||
| 22 | $('#scheduleCampaign').click(function(){ | ||
| 23 | var selectCampaignField = $('#selectCampaignField').val(); | ||
| 24 | var starttime = $('#campaignstartdate').val(); | ||
| 25 | var endtime = $('#campaignenddate').val(); | ||
| 26 | console.log(endtime); | ||
| 27 | if(endtime != "0"){ | ||
| 28 | var postdata='selectCampaignField='+selectCampaignField+'&starttime='+starttime+'&endtime='+endtime; | ||
| 29 | doAjax("campaign/schedulecampaign",postdata,"campaignDetailsArea","","","GET",function(retrstr){ | ||
| 30 | doAjax("campaign/show","campaign="+selectCampaignField,"campaignDetailsArea","","","GET"); | ||
| 31 | simpleNotification('Success','topRight',"Campaign scheduled suceesfully!"); | ||
| 32 | $("#usrname").select2("val", "Select User..."); | ||
| 33 | $("#selectCampaignField").select("val", "Select Dial Mode..."); | ||
| 34 | |||
| 35 | }); | ||
| 36 | }else{ | ||
| 37 | $("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the Start and End time.</p>'); | ||
| 38 | } | ||
| 39 | |||
| 40 | }); | ||
| 41 | $('body').on('focus',".datetimepicker", function(){ | ||
| 42 | $(this).datetimepicker({format: 'YYYY-MM-DD HH:mm'}); | ||
| 43 | }); | ||
| 44 | </script> |
| 1 | <div class="row"> | ||
| 2 | <div class="btn-group pull-right"> | ||
| 3 | <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-fw fa-plus-square"></i> Add Field <span class="caret"></span> | ||
| 4 | </button> | ||
| 5 | <ul class="dropdown-menu"> | ||
| 6 | <li><a href="#" onclick="fbAddField('layout','addCrmArea');return false;"><i class="fa fa-fw fa-th-large"></i> Layout</a></li> | ||
| 7 | <li><a href="#" onclick="fbAddField('text','addCrmArea');return false;"><i class="fa fa-fw fa-font"></i> Text</a></li> | ||
| 8 | <li><a href="#" onclick="fbAddField('select','addCrmArea');return false;"><i class="fa fa-fw fa-indent"></i> Select Box</a></li> | ||
| 9 | <li><a href="#" onclick="fbAddField('date','addCrmArea');return false;"><i class="fa fa-fw fa-calendar"></i> Date</a></li> | ||
| 10 | <li><a href="#" onclick="fbAddField('textArea','addCrmArea');return false;"><i class="fa fa-fw fa-list-alt"></i> Text Area</a></li> | ||
| 11 | </ul> | ||
| 12 | </div> | ||
| 13 | </div> | ||
| 14 | |||
| 15 | <div class="modal fade" id="fbAddFieldForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
| 16 | <div class="modal-dialog" role="document"> | ||
| 17 | <div class="modal-content"> | ||
| 18 | <div class="modal-body" id="fbAddFieldFormContent"></div> | ||
| 19 | </div> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <hr style="margin:5px 0;border: 1px solid #ed5564;" /> | ||
| 24 | <div id="addCrmArea"></div> | ||
| 25 | |||
| 26 | <script> | ||
| 27 | var feedbackForm = '{"formData":{"row1":{"column1":{"columnName":"Personal Information","columnCount":"6","fields":{"customerName":{"type":"text","name":"customerName","title":"Customer Name","required":true,"default":"","editable":true},"customerType":{"type":"select","name":"customerType","title":"Customer Type","required":true,"options":"Existing,New,MNP,Corporate","default":"Existing","editable":true},"customerAddress":{"type":"textArea","name":"customerAddress","title":"Customer Address","required":true,"default":"","editable":true},"birthDate":{"type":"date","name":"birthDate","title":"Birth Date","required":true,"default":"","editable":true}}},"column2":{"columnName":"Plan Details","columnCount":"6","fields":{"planName":{"type":"text","name":"planName","title":"Plan Name","required":true,"default":"","editable":true},"planType":{"type":"select","name":"planType","title":"Plan Type","required":true,"options":"Prepaid,Postpaid","default":"Postpaid","editable":true},"planIncludes":{"type":"textArea","name":"planIncludes","title":"Plan Includes","required":true,"default":"","editable":true}}}}},"formFields":"customerName,customerType,customerAddress,birthDate,planName,planType,planIncludes"}'; | ||
| 28 | |||
| 29 | doAjax("campaign","action=buildForm&rawData="+feedbackForm,"addCrmArea","","","POST"); | ||
| 30 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | |||
| 3 | use App\Models\Campaign; | ||
| 4 | |||
| 5 | ini_set("precision", 15); | ||
| 6 | |||
| 7 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 8 | |||
| 9 | if ($_SERVER["REQUEST_METHOD"] == "POST") | ||
| 10 | { | ||
| 11 | $errorMsg = ""; $successMsg = "";$successCount = 0; | ||
| 12 | |||
| 13 | if($_FILES['file']['tmp_name']) | ||
| 14 | { | ||
| 15 | if($_FILES['file']['type'] == "application/vnd.ms-excel") | ||
| 16 | { | ||
| 17 | $fileUploadLimit = 52428800; // files size is in bytes | ||
| 18 | if($_FILES['file']['size'] < $fileUploadLimit) | ||
| 19 | { | ||
| 20 | if ($_POST["uploadFileType"] == "customerInfo" && $_POST["campaignName"] != "") | ||
| 21 | { | ||
| 22 | $inputFileType = "Excel5"; | ||
| 23 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 24 | $objPHPExcel = $objReader->load($_FILES['file']['tmp_name']); | ||
| 25 | $objWorksheet = $objPHPExcel->getActiveSheet(); | ||
| 26 | $highestColumn = PHPExcel_Cell::columnIndexFromString($objPHPExcel->getActiveSheet()->getHighestColumn()); | ||
| 27 | $highestrow=$objPHPExcel->getActiveSheet()->getHighestRow(); | ||
| 28 | $excelarray=array();$keys=array(); | ||
| 29 | $listId = time(); | ||
| 30 | |||
| 31 | $dataColumns = ['id'=>'Id','unique_id'=>'Customer Unique Id','firstname'=>'First Name','lastname'=>'Last Name','mobile'=>'Mobile','phones'=>'Other Phones']; | ||
| 32 | |||
| 33 | $campaign=Campaign::where('mkey','=',$_POST["campaignName"])->where('mtype','=','company')->first(); | ||
| 34 | if($campaign->crm != ""){ | ||
| 35 | $crmColumns = json_decode($campaign->crm); | ||
| 36 | $crmColumns = (array)$crmColumns->formFields; | ||
| 37 | } | ||
| 38 | |||
| 39 | for($i=1;$i<=$highestrow;$i++){ | ||
| 40 | $excelarray[$i]=array(); | ||
| 41 | for($head = 0; $head < $highestColumn; $head++){ | ||
| 42 | if($i==1){ | ||
| 43 | $keys[$head]=trim($objWorksheet->getCellByColumnAndRow($head,$i)->getValue()); | ||
| 44 | }else{ | ||
| 45 | $excelarray[$i][$keys[$head]]=trim($objWorksheet->getCellByColumnAndRow($head, $i)->getValue()); | ||
| 46 | } | ||
| 47 | } | ||
| 48 | } | ||
| 49 | // print_r($crmColumns);exit; | ||
| 50 | for($i=3;$i<=$highestrow;$i++) | ||
| 51 | { | ||
| 52 | if($excelarray[$i]["id"]==""){ | ||
| 53 | $crmData = []; | ||
| 54 | if(isset($crmColumns)){ | ||
| 55 | foreach ($crmColumns as $key => $value) { | ||
| 56 | array_push($crmData, [$key => $excelarray[$i][$key]]); | ||
| 57 | } | ||
| 58 | } | ||
| 59 | $data = ["list_id"=>$listId, | ||
| 60 | "unique_id"=>$excelarray[$i]["unique_id"], | ||
| 61 | "firstname"=>$excelarray[$i]["firstname"], | ||
| 62 | "lastname"=>$excelarray[$i]["lastname"], | ||
| 63 | "mobile"=>$excelarray[$i]["mobile"], | ||
| 64 | "phones"=>$excelarray[$i]["phones"], | ||
| 65 | "crm"=>serialize($crmData), | ||
| 66 | "client"=>$_POST["campaignName"], | ||
| 67 | "status"=>"New", | ||
| 68 | 'created'=>date('Y-m-d H:i:s'), | ||
| 69 | 'modified'=>date('Y-m-d H:i:s')]; | ||
| 70 | $addToDB = DB::table('records')->insert($data); | ||
| 71 | $successCount++; | ||
| 72 | }else{ | ||
| 73 | $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | ||
| 74 | } | ||
| 75 | continue; | ||
| 76 | // $lanq = DB::table('records')->select('id')->where('lan', '=', $excelarray[$i]["lan"])->first(); | ||
| 77 | // if($lanq){ | ||
| 78 | // $excelarray[$i]["id"]=intval($lanq->id); | ||
| 79 | // }else{ | ||
| 80 | // $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | ||
| 81 | // } | ||
| 82 | |||
| 83 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | ||
| 84 | { | ||
| 85 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | ||
| 86 | // $ppldata=$empdata["peopledata"]; | ||
| 87 | // $createdlog=$empdata['modifylog']; | ||
| 88 | // $fdirty=$empdata['dirty']; | ||
| 89 | |||
| 90 | // $createdlog[$updatetime]=$username."::"; | ||
| 91 | // $createdlog["updated"]=$updatetime; | ||
| 92 | |||
| 93 | $newdata=$ppldata; | ||
| 94 | if($isadmin||strstr($clientlst,$ppldata['client'])) | ||
| 95 | { | ||
| 96 | $editflag=0; | ||
| 97 | foreach($excelarray[$i] as $key => $value) | ||
| 98 | { | ||
| 99 | $value = preg_replace('/[^A-Za-z0-9\., -]/', '', $value); | ||
| 100 | |||
| 101 | if(isset($kformlib->HRFieldNames[$key])) | ||
| 102 | { | ||
| 103 | if($value!="") | ||
| 104 | { | ||
| 105 | if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC | ||
| 106 | { | ||
| 107 | $value=str_replace("'"," ",$value); | ||
| 108 | if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).","; | ||
| 109 | |||
| 110 | $fdirty[$key]=1;$editflag=1; | ||
| 111 | |||
| 112 | if($triggers=='Yes') | ||
| 113 | { | ||
| 114 | $kformlib->empAnalytics($excelarray[$i]["id"],$ppldata,$key,$value,$ppldata[$key]); | ||
| 115 | $kformlib->empWorkflowTrigger($excelarray[$i]["id"],$ppldata['client'],$key,$value,$ppldata[$key],$ppldata,$newdata); | ||
| 116 | } | ||
| 117 | $newdata[$key]=$value; | ||
| 118 | } | ||
| 119 | //else $message.="same $excelarray[$i][id]:$key:$value, "; | ||
| 120 | } | ||
| 121 | //else $message.="empty $excelarray[$i][id]:$key, "; | ||
| 122 | }else{ | ||
| 123 | // $message.="Invalid key :$key, "; | ||
| 124 | } | ||
| 125 | } | ||
| 126 | if($editflag) | ||
| 127 | { | ||
| 128 | $empdata["peopledata"]=$newdata; | ||
| 129 | $empdata['modifylog']=$createdlog; | ||
| 130 | $empdata['dirty']=$fdirty; | ||
| 131 | |||
| 132 | $wakka->setPerson($excelarray[$i]["id"],$empdata); | ||
| 133 | $success.=$excelarray[$i]["id"].","; | ||
| 134 | $successCount++; | ||
| 135 | } | ||
| 136 | }else{ | ||
| 137 | $errorMsg.="No access to $excelarray[$i][id], "; | ||
| 138 | } | ||
| 139 | } | ||
| 140 | } | ||
| 141 | $successMsg .= "Data Uploaded ($successCount)."; // : $success."; | ||
| 142 | } | ||
| 143 | }else{ | ||
| 144 | $errorMsg .= "File size too large, Please check file size should be less then ".($fileUploadLimit / (1024*1024))."mb."; | ||
| 145 | } | ||
| 146 | }else{ | ||
| 147 | $errorMsg .= "File format not valid, Please attach Excel file (.xls) and try upload again."; | ||
| 148 | } | ||
| 149 | @unlink($_FILES['file']); | ||
| 150 | }else{ | ||
| 151 | $errorMsg .= "File not found, Please attach file and try upload again."; | ||
| 152 | } | ||
| 153 | if(isset($successMsg) && $successMsg!="")echo "Success! <br/>".$successMsg; | ||
| 154 | if(isset($errorMsg) && $errorMsg!="")echo "Error! <br/>".$errorMsg; | ||
| 155 | } | ||
| 156 | else | ||
| 157 | { | ||
| 158 | if(isset($_GET['format']) && $_GET['format'] == 'dataUpload'){ | ||
| 159 | if(isset($_GET['campaign']) && $_GET['campaign'] != ''){ | ||
| 160 | $dataColumns = ['id'=>'Id','unique_id'=>'Customer Unique Id','firstname'=>'First Name','lastname'=>'Last Name','mobile'=>'Mobile','phones'=>'Other Phones']; | ||
| 161 | |||
| 162 | $campaign=Campaign::where('mkey','=',$_GET['campaign'])->where('mtype','=','company')->first(); | ||
| 163 | if($campaign->crm != ''){ | ||
| 164 | $crmColumns = json_decode($campaign->crm); | ||
| 165 | if($crmColumns->formFields)$dataColumns = array_merge($dataColumns,(array) $crmColumns->formFields); | ||
| 166 | } | ||
| 167 | $PHPExcelObj = new PHPExcel(); $head=0; | ||
| 168 | foreach($dataColumns as $key => $value){ | ||
| 169 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 170 | $PHPExcelObj->getActiveSheet()->setCellValue($colstr."1", $key); | ||
| 171 | $PHPExcelObj->getActiveSheet()->setCellValue($colstr."2", $value); | ||
| 172 | $head++; | ||
| 173 | } | ||
| 174 | $objWriter = PHPExcel_IOFactory::createWriter($PHPExcelObj, 'Excel5'); | ||
| 175 | $objWriter->save('php://output'); | ||
| 176 | |||
| 177 | header('Content-Type: application/vnd.ms-excel'); | ||
| 178 | header('Content-Disposition: attachment;filename="DataUploadFormat.xls"'); | ||
| 179 | header('Cache-Control: max-age=0'); | ||
| 180 | return; | ||
| 181 | }else{ | ||
| 182 | echo "Campaign not found"; | ||
| 183 | return; | ||
| 184 | } | ||
| 185 | } | ||
| 186 | ?> | ||
| 187 | <div class="row"> | ||
| 188 | <div class="col-sm-12"> | ||
| 189 | <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> | ||
| 190 | <div class="panel panel-info"> | ||
| 191 | <div class="panel-heading" role="tab" id="headingOne" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> | ||
| 192 | <strong><i class="fa fa-upload"></i> Data Upload</strong> | ||
| 193 | <span class="badge pull-right"><i class="fa fa-sort"></i></span> | ||
| 194 | </div> | ||
| 195 | <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne"> | ||
| 196 | <div class="panel-body"> | ||
| 197 | <div class="tab_generic"> | ||
| 198 | <p><span style="color:#f00;"><strong>Instruction</strong></span> (Works only if you have 'Write access" to the records) Please create an Excel-2003 format file with header as field-keys and rows containing record data. Extream Care is should be taken during bulk upload as previous values will be overwritten and lost.</p> | ||
| 199 | <hr style="margin-bottom: 10px;" /> | ||
| 200 | <div class="row"> | ||
| 201 | <div class="col-sm-3"> | ||
| 202 | <p><strong>Get Format</strong></p> | ||
| 203 | <button type="submit" class="btn btn-success" onclick="getDataFormat();return false;"><i class="fa fa-download"></i> Get Format</button> | ||
| 204 | </div> | ||
| 205 | <div class="col-sm-9"> | ||
| 206 | <p><strong>Upload File</strong></p> | ||
| 207 | <form method="POST" enctype="multipart/form-data" target="resultArea" action="campaign?action=dataUpload" class="form-inline"> | ||
| 208 | <input type="hidden" name="_token" value="{{ csrf_token() }}" /> | ||
| 209 | <input type="hidden" name="uploadFileType" value="customerInfo"/> | ||
| 210 | <input type="hidden" name="campaignName" value="{{ $campaignDetails->mkey }}"/> | ||
| 211 | <div class="form-group"> | ||
| 212 | <input type="file" class="form-control" name="file" required="required" /> | ||
| 213 | </div> | ||
| 214 | <div class="form-group"> | ||
| 215 | <button type="submit" class="btn btn-success"><i class="fa fa-upload"></i> Upload</button> | ||
| 216 | </div> | ||
| 217 | </form> | ||
| 218 | </div> | ||
| 219 | </div> | ||
| 220 | <hr style="margin-top: 10px;margin-bottom: 10px;" /> | ||
| 221 | <span>Result</span> | ||
| 222 | <iframe name=resultArea id="resultArea" style="width: 100%;border:1px solid #ccc;"></iframe> | ||
| 223 | </div> | ||
| 224 | </div> | ||
| 225 | </div> | ||
| 226 | </div> | ||
| 227 | |||
| 228 | <div class="panel panel-info"> | ||
| 229 | <div class="panel-heading" role="tab" id="headingTwo" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> | ||
| 230 | <strong><i class="fa fa-table"></i> Data List</strong> | ||
| 231 | <span class="badge pull-right"><i class="fa fa-sort"></i></span> | ||
| 232 | </div> | ||
| 233 | <div id="collapseTwo" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingTwo"> | ||
| 234 | <div class="panel-body"> | ||
| 235 | @if(isset($dataList) && count($dataList)) | ||
| 236 | <table class="table table-bordered" style="margin-bottom: 0;"> | ||
| 237 | <head><tr class="active"> | ||
| 238 | <th>List Id</th> | ||
| 239 | <th>Record Count</th> | ||
| 240 | </tr></head> | ||
| 241 | <body> | ||
| 242 | @foreach($dataList as $data) | ||
| 243 | <tr> | ||
| 244 | <td>{{ $data->list_id }}</td> | ||
| 245 | <td>{{ $data->recordCount }}</td> | ||
| 246 | </tr> | ||
| 247 | @endforeach | ||
| 248 | </body> | ||
| 249 | </table> | ||
| 250 | @else | ||
| 251 | <p>No data found</p> | ||
| 252 | @endif | ||
| 253 | </div> | ||
| 254 | </div> | ||
| 255 | </div> | ||
| 256 | </div> | ||
| 257 | </div> | ||
| 258 | </div> | ||
| 259 | |||
| 260 | <script type="text/javascript"> | ||
| 261 | function getDataFormat(){ | ||
| 262 | var campaign = $("#selectCampaignField").val(); | ||
| 263 | window.open('campaign/getDataFormat?format=dataUpload&campaign='+campaign);return false; | ||
| 264 | } | ||
| 265 | </script> | ||
| 266 | |||
| 267 | <?php | ||
| 268 | } | ||
| 269 | ?> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
application/resources/views/layout/module/campaign/campaign/campaignTabFeedback.blade.php
0 → 100755
| 1 | <div class="row"> | ||
| 2 | <div class="btn-group pull-right"> | ||
| 3 | <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-fw fa-plus-square"></i> Add Field <span class="caret"></span> | ||
| 4 | </button> | ||
| 5 | <ul class="dropdown-menu"> | ||
| 6 | <li><a href="#" onclick="fbAddField('layout','addFieldArea');return false;"><i class="fa fa-fw fa-th-large"></i> Layout</a></li> | ||
| 7 | <li><a href="#" onclick="fbAddField('text','addFieldArea');return false;"><i class="fa fa-fw fa-font"></i> Text</a></li> | ||
| 8 | <li><a href="#" onclick="fbAddField('select','addFieldArea');return false;"><i class="fa fa-fw fa-indent"></i> Select Box</a></li> | ||
| 9 | <li><a href="#" onclick="fbAddField('date','addFieldArea');return false;"><i class="fa fa-fw fa-calendar"></i> Date</a></li> | ||
| 10 | <li><a href="#" onclick="fbAddField('textArea','addFieldArea');return false;"><i class="fa fa-fw fa-list-alt"></i> Text Area</a></li> | ||
| 11 | </ul> | ||
| 12 | </div> | ||
| 13 | </div> | ||
| 14 | |||
| 15 | <div class="modal fade" id="fbAddFieldForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
| 16 | <div class="modal-dialog" role="document"> | ||
| 17 | <div class="modal-content"> | ||
| 18 | <div class="modal-body" id="fbAddFieldFormContent"></div> | ||
| 19 | </div> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <hr style="margin:5px 0;border: 1px solid #ed5564;" /> | ||
| 24 | <div id="addFieldArea"></div> | ||
| 25 | |||
| 26 | <script> | ||
| 27 | var feedbackForm = '{"formData":{"row1":{"column1":{"columnName":"Personal Information","columnCount":"6","fields":{"customerName":{"type":"text","name":"customerName","title":"Customer Name","required":true,"default":"","editable":true},"customerType":{"type":"select","name":"customerType","title":"Customer Type","required":true,"options":"Existing,New,MNP,Corporate","default":"Existing","editable":true},"customerAddress":{"type":"textArea","name":"customerAddress","title":"Customer Address","required":true,"default":"","editable":true},"birthDate":{"type":"date","name":"birthDate","title":"Birth Date","required":true,"default":"","editable":true}}},"column2":{"columnName":"Plan Details","columnCount":"6","fields":{"planName":{"type":"text","name":"planName","title":"Plan Name","required":true,"default":"","editable":true},"planType":{"type":"select","name":"planType","title":"Plan Type","required":true,"options":"Prepaid,Postpaid","default":"Postpaid","editable":true},"planIncludes":{"type":"textArea","name":"planIncludes","title":"Plan Includes","required":true,"default":"","editable":true}}}}},"formFields":"customerName,customerType,customerAddress,birthDate,planName,planType,planIncludes"}'; | ||
| 28 | |||
| 29 | doAjax("campaign","action=buildForm&rawData="+feedbackForm,"addFieldArea","","","POST"); | ||
| 30 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <div class="row"> | ||
| 2 | <div class="col-sm-12"> | ||
| 3 | <div class="panel panel-info"> | ||
| 4 | <div class="panel-heading"><strong>Agent Script</strong></div> | ||
| 5 | <div class="panel-body"> | ||
| 6 | <div> | ||
| 7 | <div class="form-group" style="margin-bottom: 5px;"> | ||
| 8 | <textarea class="form-control" rows="10" id="agentScript" placeholder="Enter your script here">{{ $campaignDetails->script }}</textarea> | ||
| 9 | </div> | ||
| 10 | <div class="form-group" style="margin-bottom: 0;"> | ||
| 11 | <span>Add agent script here</span> | ||
| 12 | <button type="submit" class="btn btn-success pull-right"><i class="glyphicon glyphicon-floppy-disk"></i> Save</button> | ||
| 13 | </div> | ||
| 14 | </div> | ||
| 15 | </div> | ||
| 16 | </div> | ||
| 17 | </div> | ||
| 18 | </div> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | //$queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback'); | ||
| 3 | $queryFields = explode(",", 'usr_id,branchCode,organizationName,designation,dob,location,state,residenceAddress,residenceAddressZipCode,officeAddress,officeAddressZipCode,alternateMobile,officeNumber,referenceName,referenceMobile,referenceName2,referenceMobile2,loanStatus,product,bucket,dpd,tenureStartDate,tenureEndDate,tenureRemaining,disbursalDate,rateOfInterest,installmentNo,chequeBounceNo,reasonForLastBounce,reasonForSecondLastBounce,cycleDate,ebnb,bank,lastMonthPaymentMode,lastMonthPaymentAmount,lastMonthPaymentDate,delinquencyString,specialCode,centralECS,emi,pos,bounceCharge,penalMTD,penalLTD,overdueAmount,installmentAmountOverdue,altphone1,altphone2,altphone3,altphone4,altphone5,altphone6,altphone7,altphone8,altphone9,altphone10,priority,dialer_substatus,dialer_callback'); | ||
| 4 | ?> | ||
| 5 | <div class="row"> | ||
| 6 | <div class="col-sm-12"> | ||
| 7 | <div class="panel panel-info"> | ||
| 8 | <div class="panel-heading"><strong>Query</strong></div> | ||
| 9 | <div class="panel-body"> | ||
| 10 | <div class="form-group" style="margin-bottom: 8px;"> | ||
| 11 | <label>SELECT</label> | ||
| 12 | <input type='text' value='*' id='allvalues'disabled/> | ||
| 13 | <!--<select id="querySelect" multiple="" data-rel="chosen" style='width:100%' class=select2multi> | ||
| 14 | <option value="currentstatus" selected="selected">currentstatus</option> | ||
| 15 | <option value="legalstatus" selected="selected">legalstatus</option> | ||
| 16 | <option value="mobile" selected="selected">mobile</option> | ||
| 17 | <option value="status" selected="selected">status</option> | ||
| 18 | <option value="dialer_status" selected="selected">dialer_status</option> | ||
| 19 | <option value="dialer_substatus" selected="selected">dialer_substatus</option> | ||
| 20 | @foreach($queryFields as $fields) | ||
| 21 | <option value="{{$fields}}">{{$fields}}</option> | ||
| 22 | @endforeach | ||
| 23 | </select>--> | ||
| 24 | <label style="margin-top: 5px;">FROM 'records' WHERE</label> | ||
| 25 | <input type="text" class="form-control" id="queryConditions" placeholder="1" value="1"/> | ||
| 26 | </div> | ||
| 27 | <div class="form-inline"> | ||
| 28 | <div> | ||
| 29 | <button type="submit" class="btn btn-success pull-right" id='savequery' onclick="runSqlQuery();return false;">Save</button> | ||
| 30 | <!--- <button type="submit" class="btn btn-success pull-right" onclick="runSqlQuery();return false;"><i class="glyphicon glyphicon-ok"></i> Run Query</button>---> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | </div> | ||
| 34 | </div> | ||
| 35 | |||
| 36 | <div class="panel-group"> | ||
| 37 | <div class="panel panel-default"> | ||
| 38 | <div class="panel-heading"> | ||
| 39 | <h4 class="panel-title"> | ||
| 40 | Show Filters | ||
| 41 | </h4> | ||
| 42 | </div> | ||
| 43 | <div id="collapse1" > | ||
| 44 | <ul class="list-group"> | ||
| 45 | @foreach($queryLogs as $queryLog) | ||
| 46 | <li class="list-group-item"><a onclick="runFSqlQuery({{$queryLog->id}});return false;" style="cursor:pointer">{{$queryLog->query}} </a></li> | ||
| 47 | @endforeach | ||
| 48 | </ul> | ||
| 49 | <div class="panel-footer">*Please Refresh Current Campaign To See Updated Saved Queries</div> | ||
| 50 | </div> | ||
| 51 | </div> | ||
| 52 | </div> | ||
| 53 | <br><br> | ||
| 54 | |||
| 55 | <div class="panel panel-info"> | ||
| 56 | <div class="panel-heading" id="appendButton"><strong>Output</strong><button type="submit" class="btn btn-default btn-sm" onclick="downloadOutput();return false;" style="margin: 0 0 0.1% 84%;display: none" id="downloadButton"><i class="glyphicon glyphicon-download"></i> Download</button></div> | ||
| 57 | <div class="panel-body" id="sqlQueryOutput"> | ||
| 58 | <p><i class="fa fa-exclamation-circle"></i> Press Run Query button to see output!</p> | ||
| 59 | </div> | ||
| 60 | </div> | ||
| 61 | </div> | ||
| 62 | </div> | ||
| 63 | |||
| 64 | <script> | ||
| 65 | function runSqlQuery(){ | ||
| 66 | //var checkedValue = $('#savequery').val(); | ||
| 67 | //var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue; | ||
| 68 | var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&allvalues='+$("#allvalues").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val(); | ||
| 69 | doAjax("campaign/query",data,"sqlQueryOutput","","","GET"); | ||
| 70 | |||
| 71 | document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block"; | ||
| 72 | } | ||
| 73 | |||
| 74 | function runFSqlQuery(id){ | ||
| 75 | var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&id='+id+'&querySelect='+$("#querySelect").val(); | ||
| 76 | doAjax("campaign/fquery",data,"sqlQueryOutput","","","GET"); | ||
| 77 | |||
| 78 | document.getElementById("downloadButton").style = "margin: 0% 0% 0.1% 84%;display: block"; | ||
| 79 | } | ||
| 80 | |||
| 81 | function delSqlQuery(id){ | ||
| 82 | var data = 'id='+id; | ||
| 83 | var value = '{{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}'; | ||
| 84 | doAjax("campaign/delete",data,"sqlQueryOutput","","","GET"); | ||
| 85 | |||
| 86 | doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){ | ||
| 87 | $("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>'); | ||
| 88 | }); | ||
| 89 | } | ||
| 90 | function enablelogic(id){ | ||
| 91 | console.log(id); | ||
| 92 | var data='id='+id; | ||
| 93 | var value = '{{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}'; | ||
| 94 | //doAjax("campaign/enable",data,"sqlQueryOutput","","","GET"); | ||
| 95 | |||
| 96 | doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){ | ||
| 97 | $("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>'); | ||
| 98 | }); | ||
| 99 | } | ||
| 100 | |||
| 101 | function downloadOutput() | ||
| 102 | { | ||
| 103 | //window.open('campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val());return false; | ||
| 104 | window.open('campaign/download?campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryInCondition='+$("#queryInCondition").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val());return false; | ||
| 105 | } | ||
| 106 | </script> |
| 1 | <div class="row"> | ||
| 2 | <div class="col-sm-12"> | ||
| 3 | <div class="panel panel-info"> | ||
| 4 | <div class="panel-heading"><strong>Query List</strong></div> | ||
| 5 | <div class="panel-body" id=""> | ||
| 6 | <ul class="list-group"> | ||
| 7 | <li class="list-group-item"><input type="radio" name="query" id="currQuery" value="" checked>Default</li> | ||
| 8 | @foreach($queryLogs as $queryLog) | ||
| 9 | <li class="list-group-item"><input type="radio" name="query" id="currQuery" value="{{$queryLog->id}}" {{$queryLog->current_queue?"checked":""}}>{{$queryLog->query}}</li> | ||
| 10 | @endforeach | ||
| 11 | </ul> | ||
| 12 | |||
| 13 | <div class="form-inline"> | ||
| 14 | <div class="form-group" style="display: block;"> | ||
| 15 | <button type="submit" class="btn btn-success pull-right" onclick="addInQueue();return false;"><i class="glyphicon glyphicon-plus"></i> Filter Apply</button> | ||
| 16 | </div> | ||
| 17 | </div> | ||
| 18 | </div> | ||
| 19 | </div> | ||
| 20 | </div> | ||
| 21 | </div> | ||
| 22 | |||
| 23 | <script> | ||
| 24 | function addInQueue(){ | ||
| 25 | var data = 'radioValue='+$("input[name='query']:checked").val(); | ||
| 26 | // var checkedValue = $('.saveQryChck:checked').val(); | ||
| 27 | // var data = 'campaign={{ is_array($campaignDetails)?$campaignDetails["mkey"]:$campaignDetails->mkey }}&querySelect='+$("#querySelect").val()+'&queryConditions='+$("#queryConditions").val()+'&queryLimit='+$("#queryLimit").val()+'&queryOffset='+$("#queryOffset").val()+'&checkedValue='+checkedValue; | ||
| 28 | doAjax("campaign/addCurrQueue",data,"","","","GET"); | ||
| 29 | } | ||
| 30 | </script> |
| 1 | <?php | ||
| 2 | |||
| 3 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 4 | |||
| 5 | $inputFileType = "Excel5"; | ||
| 6 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 7 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 8 | $baseRow = 2; | ||
| 9 | |||
| 10 | $tcol=0;$extrahdrarr=array(); | ||
| 11 | |||
| 12 | $highestColumn = sizeof($fieldsarr); | ||
| 13 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 14 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 15 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]); | ||
| 16 | } | ||
| 17 | |||
| 18 | $ii=1; | ||
| 19 | foreach($alist as $aline) | ||
| 20 | { | ||
| 21 | $row = $baseRow++; $col = 0; | ||
| 22 | |||
| 23 | foreach ($fieldsarr as $key) { | ||
| 24 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit(trim($aline->$key)); | ||
| 25 | } | ||
| 26 | |||
| 27 | } | ||
| 28 | |||
| 29 | header('Content-Type: application/vnd.ms-excel'); | ||
| 30 | header('Content-Disposition: attachment;filename="Output.xls"'); | ||
| 31 | header('Cache-Control: max-age=0'); | ||
| 32 | |||
| 33 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 34 | $objWriter->save('php://output'); | ||
| 35 | |||
| 36 | return ; | ||
| 37 | |||
| 38 | ?> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <script> | ||
| 2 | function addDatePicker(selector){ | ||
| 3 | $('#'+selector).datepicker({dateFormat:'yy-mm-dd',inline:true,changeYear:true,changeMonth:true,selectOtherMonths:true,yearRange:'1947:2022'}); | ||
| 4 | $('#'+selector).datepicker("show"); | ||
| 5 | } | ||
| 6 | |||
| 7 | function fbAddField(type,area){ | ||
| 8 | var output = ''; | ||
| 9 | if(type == 'layout'){ | ||
| 10 | |||
| 11 | } | ||
| 12 | $('#fbAddFieldFormContent').append(type); | ||
| 13 | $('#fbAddFieldForm').modal('show'); | ||
| 14 | |||
| 15 | $('#'+area).append(type); | ||
| 16 | } | ||
| 17 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <div class="container-fluid"> | ||
| 2 | <div class="layout-app"> | ||
| 3 | <div class="row"> | ||
| 4 | <div class="col-md-12"> | ||
| 5 | <div class="col-separator col-separator-first col-unscrollable box"> | ||
| 6 | <div class="innerAll"> | ||
| 7 | <h4>Campaign</h4> | ||
| 8 | <hr style="margin-bottom: 10px;" /> | ||
| 9 | |||
| 10 | <div class="row"> | ||
| 11 | <div class="col-lg-4"> | ||
| 12 | <div class="form-inline"> | ||
| 13 | <div class="form-group"> | ||
| 14 | <label>Select Campaign</label> | ||
| 15 | </div> | ||
| 16 | <div class="form-group"> | ||
| 17 | <select class="form-control" id="selectCampaignField" onchange="campaignDetailsShow(this.value);return false;"> | ||
| 18 | <option value="">Select Campaign</option> | ||
| 19 | <option value="all">All</option> | ||
| 20 | @foreach($campaignList as $campaign) | ||
| 21 | <option value="{{ $campaign->mkey }}">{{ $campaign->mkey }}</option> | ||
| 22 | @endforeach | ||
| 23 | </select> | ||
| 24 | |||
| 25 | </div> | ||
| 26 | |||
| 27 | <span id="campaignRefresh"></span> | ||
| 28 | </div> | ||
| 29 | </div> | ||
| 30 | |||
| 31 | <!-- <div class="col-lg-6"> | ||
| 32 | <form class="form-inline text-right"> | ||
| 33 | <div class="form-group"> | ||
| 34 | <label>Create Campaign</label> | ||
| 35 | </div> | ||
| 36 | <div class="form-group"> | ||
| 37 | <input type="text" class="form-control" id="campaignName" placeholder="Campaign Name"> | ||
| 38 | </div> | ||
| 39 | <button type="button" class="btn btn-success" onclick="createCampaign();"><i class="glyphicon glyphicon-plus"></i> ADD</button> | ||
| 40 | </form> | ||
| 41 | </div> --> | ||
| 42 | </div> | ||
| 43 | |||
| 44 | <div id="campaignDetailsArea"></div> | ||
| 45 | </div> | ||
| 46 | </div> | ||
| 47 | </div> | ||
| 48 | </div> | ||
| 49 | |||
| 50 | </div> | ||
| 51 | </div> | ||
| 52 | |||
| 53 | <script> | ||
| 54 | function campaignDetailsShow(value){ | ||
| 55 | if(value){ | ||
| 56 | doAjax("campaign/show","campaign="+value,"campaignDetailsArea","","","GET",function(response){ | ||
| 57 | $("#campaignRefresh").html('<div class="form-group"><button onclick="campaignDetailsShow($(\'#selectCampaignField option:selected\').val());return false;" class="btn btn-xs btn-info">Refresh Campaign</button></div>'); | ||
| 58 | }); | ||
| 59 | }else{ | ||
| 60 | $("#campaignDetailsArea").html('<br/><p class="text-danger text-center">Please select the campaign.</p>'); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | // function createCampaign(){ | ||
| 65 | // var campaignName = $('#campaignName').val(); | ||
| 66 | // if(campaignName){ | ||
| 67 | // if( /[^a-zA-Z0-9]/.test(campaignName)){ | ||
| 68 | // simpleNotification('error','topRight','Campaign name is not alphanumeric.'); | ||
| 69 | // }else{ | ||
| 70 | // var dataStr = "action=createCampaign&campaignName="+campaignName; | ||
| 71 | // doAjax("campaign",dataStr,"campaignDetailsArea","","","POST",function(response){ | ||
| 72 | // // console.log(response.responseText); | ||
| 73 | // }); | ||
| 74 | // } | ||
| 75 | // }else{ | ||
| 76 | // simpleNotification('error','topRight','Campaign name should not be blank.'); | ||
| 77 | // } | ||
| 78 | // } | ||
| 79 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | |||
| 3 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 4 | |||
| 5 | $inputFileType = "Excel5"; | ||
| 6 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 7 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 8 | $baseRow = 2; | ||
| 9 | |||
| 10 | $objPHPExcel->getActiveSheet()->setCellValue('A1', "12"); | ||
| 11 | |||
| 12 | |||
| 13 | header('Content-Type: application/vnd.ms-excel'); | ||
| 14 | header('Content-Disposition: attachment;filename="Output.xls"'); | ||
| 15 | header('Cache-Control: max-age=0'); | ||
| 16 | |||
| 17 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 18 | $objWriter->save('php://output'); | ||
| 19 | |||
| 20 | return ; | ||
| 21 | |||
| 22 | ?> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment