| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276 |
- <?php
-
- namespace App\Http\Controllers\DS;
-
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use Illuminate\Support\Facades\Auth;
- use Carbon\Carbon;
- use File;
- use Validator;
- use PDF;
- use Config;
- Use Mail;
-
- Use App\StaffOld;
- Use App\Staff;
- Use App\Model\StaffDetail;
- Use App\Model\Company;
-
- Use App\Model\OldBusiness;
- Use App\Model\OldResidential;
- Use App\Model\OldDocket;
- Use App\Model\OrderHistory;
- use App\Model\OldWorkOrder;
-
- Use App\Model\Subscriber;
- Use App\Model\Coverage;
- Use App\Model\Form;
- Use App\Model\PackageDetail;
- Use App\Model\WorkOrder;
- Use App\Model\Docket;
- Use App\Model\FormStatus;
-
- class TestController extends Controller {
-
- public function sortBy()
- {
- $i = 0;
- $arr = array();
- $docket=DocketLaravel::orderBy('created_at', 'desc')->get();
- $nested_data = array();
-
- foreach($docket as $a)
- {
- $customer = Subscriber::where('_id', $a->customer_id)->first();
- $business = Business::where('_id', $a->customer_id)->first();
-
- if(!empty($customer))
- {
- $arr[]=$a;
- }
-
- if(!empty($business))
- {
- $arr[]=$a;
- };
- }
-
- foreach($arr as $b)
- {
- $i++; $n1 = '';
-
- $tempContractor = CompanyLaravel::where('_id', $b->contractor_id)->first();
- $contractor = $tempContractor->name;
-
- $tempInstaller = StaffDetailLaravel::where('_id', $b->installer_id)->first();
-
- $tempCustomer = Subscriber::where('_id', $b->customer_id)->first();
- $tempBusiness = Business::where('_id', $b->customer_id)->first();
-
- if(!empty($tempCustomer))
- {
- $building = $tempCustomer->building;
- }
- else
- {
- $building = $tempBusiness->company_name;
- }
-
- if(!empty($tempInstaller))
- {
- array_push($nested_data, array(
- 'index' => $n1.$i,
- 'docket_id' => $b->docket_id,
- 'work_order_id' => $b->work_order_id,
- 'nature_work' => $b->nature_work,
- 'contractor_id' => $contractor,
- 'installer_name' => $tempInstaller->name,
- 'customer_id' => $building,
- 'installer_id' => $tempInstaller->phone,
- 'end_job' => $b->end_job,
- 'rating' => $b->Rating1
- ));
- }
- else
- {
- array_push($nested_data, array(
- 'index' => $n1.$i,
- 'docket_id' => $a->docket_id,
- 'work_order_id' => $a->work_order_id,
- 'nature_work' => $a->nature_work,
- 'contractor_id' => $contractor,
- 'installer_name' => '',
- 'customer_id' => $building,
- 'installer_id' => '',
- 'end_job' => $a->end_job,
- 'rating' => $a->Rating1
- ));
- }
- }
-
- foreach($nested_data as $c)
- {
- echo $c["end_job"]."<br>";
- }
- }
-
- function random_code($limit) {
- return substr(base_convert(sha1(uniqid(mt_rand())), 16, 36), 0, $limit);
- }
-
-
- //*********************************************************************** Check Work Order & Form *******************************************************/
- public function checkAvailableWorkOrder(){
-
- $oldWork = WorkDetail::where('formT','R')->get()->toArray();
- $subs = Subscriber::where('dealer','=','')->get();
-
- $a = array();
-
- foreach($subs as $s){
- if(array_search($s->wo, array_column($oldWork, 'wo')) !== False) {
- $a[] = $s;
- }
- }
-
- dd($a);
- }
- //*********************************************************************** Convert Form, Subscribers, Package Form, Work Order *******************************************************/
- public function convertFormAndRelation(){
- $newCoverage = Form::get()->toArray();
- $oldCoverage = OldResidential::all();
- $count = count($oldCoverage);
- $id = 0; $i = 0;
- foreach($oldCoverage as $c){
-
- if(array_search($c->_id, array_column($newCoverage, '_id')) !== False) {
- } else {
-
- if($c->dealer == ''){
-
- $sl = Form::create([
- '_id' => new \MongoDB\BSON\ObjectId($c->_id),
- 'type_service' => $c->type_application,
- 'type_application' => 'R',
- 'status_payment' => $c->status,
- 'status_email' => $c->status1,
- 'remark_form' => $c->remarks,
- 'dealer_id' => $c->dealer,
- 'company_id' => $c->dealer_company,
- 'created_at' => new \MongoDB\BSON\UTCDateTime($c->reg_time*1000)
- ]);
-
- $su_id = '';
- do {
- $su_id = strtoupper('CBB-'.$this->random_code(6).'R');
- } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- $sdl = new Subscriber();
- $sdl->subscriber_id = $su_id;
- $sdl->name = $c->name;
- $sdl->ic = $c->ic;
- $sdl->citizen = $c->citizen;
- $sdl->gender = $c->gender;
- $sdl->race = $c->race;
- $sdl->email = $c->email;
- $sdl->phone1 = $c->phone1;
- $sdl->phone2 = $c->phone2;
- $sdl->unit_no = $c->unit_no;
- $sdl->building_name = $c->building;
- $sdl->street = $c->street;
- $sdl->postcode = $c->postcode;
- $sdl->city = $c->city;
- $sdl->state = $c->state;
- $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- $sdl->back_ic = str_replace("data","/document",$c->imageback);
- $sdl->signature = str_replace("data","/document",$c->signature);
- $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- $packageD = new PackageDetail();
- $packageD->contract = $c->contract;
- $packageD->name = $c->package;
- $packageD->montly_fee = '';
- $packageD->voice_fee = $c->voice;
- $packageD->deposit = '';
- $packageD->upfront_payment = '';
- $packageD->rfs = $c->rfs;
-
- if($c->wo != ''){
- $getWo = OldWorkOrder::all();
-
- foreach($getWo as $w){
- if($w->wo == $c->wo){
- $woD = new WorkOrder();
- $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- $woD->wo = $w->wo;
- $woD->nature_work = $w->nature_work;
- $woD->sub_category = $w->sub_category;
- $woD->dateTimeStart = $w->dateTimeStart;
- $woD->dateTimeEnd = $w->dateTimeEnd;
- $woD->contractor_id = $w->contractor_id;
- $woD->installer_id = $w->installer_id;
- $woD->onu = $w->onu;
- $woD->router = $w->router;
- $woD->need_phone = $w->n_phone;
- $woD->no_phone = $w->no_phone;
- $woD->pppoe_username = $w->pppoe_username;
- $woD->pppoe_password = '';
- $woD->docket_id = $w->docket;
- $woD->remarks_custservice = $w->remarks;
- $woD->remarks_installer = $w->remarks_inst;
- $woD->status = $w->status;
- $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- $sl->workorder()->save($woD);
- }
- }
- }
-
- $sl->subscriber()->save($sdl);
- $sl->packagedetail()->save($packageD);
-
- $i++;
-
- }else {
-
- $sl = new Form();
- $sl->_id = new \MongoDB\BSON\ObjectId($c->_id);
- $sl->type_service = $c->type_application;
- $sl->type_application = 'R';
- $sl->status_payment = $c->status;
- $sl->status_email = $c->status1;
- $sl->remark_form = $c->remarks;
- $sl->dealer_id = $c->dealer;
- $sl->company_id = $c->dealer_company;
- $sl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // staff
- $staff = Staff::where('_id',$c->dealer)->first();
- // dd($c->dealer);
- $staff->form()->save($sl);
-
- $su_id = '';
- do {
- $su_id = strtoupper('CBB-'.$this->random_code(6).'R');
- } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- $sdl = new Subscriber();
- $sdl->subscriber_id = $su_id;
- $sdl->name = $c->name;
- $sdl->ic = $c->ic;
- $sdl->citizen = $c->citizen;
- $sdl->gender = $c->gender;
- $sdl->race = $c->race;
- $sdl->email = $c->email;
- $sdl->phone1 = $c->phone1;
- $sdl->phone2 = $c->phone2;
- $sdl->unit_no = $c->unit_no;
- $sdl->building_name = $c->building;
- $sdl->street = $c->street;
- $sdl->postcode = $c->postcode;
- $sdl->city = $c->city;
- $sdl->state = $c->state;
- $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- $sdl->back_ic = str_replace("data","/document",$c->imageback);
- $sdl->signature = str_replace("data","/document",$c->signature);
- $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- $packageD = new PackageDetail();
- $packageD->contract = $c->contract;
- $packageD->name = $c->package;
- $packageD->montly_fee = '';
- $packageD->voice_fee = $c->voice;
- $packageD->deposit = '';
- $packageD->upfront_payment = '';
- $packageD->rfs = $c->rfs;
-
- if($c->wo != ''){
- $getWo = OldWorkOrder::all();
-
- foreach($getWo as $w){
- if($w->wo == $c->wo){
- $woD = new WorkOrder();
- $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- $woD->wo = $w->wo;
- $woD->nature_work = $w->nature_work;
- $woD->sub_category = $w->sub_category;
- $woD->dateTimeStart = $w->dateTimeStart;
- $woD->dateTimeEnd = $w->dateTimeEnd;
- $woD->contractor_id = $w->contractor_id;
- $woD->installer_id = $w->installer_id;
- $woD->onu = $w->onu;
- $woD->router = $w->router;
- $woD->need_phone = $w->n_phone;
- $woD->no_phone = $w->no_phone;
- $woD->pppoe_username = $w->pppoe_username;
- $woD->pppoe_password = '';
- $woD->docket_id = $w->docket;
- $woD->remarks_custservice = $w->remarks;
- $woD->remarks_installer = $w->remarks_inst;
- $woD->status = $w->status;
- $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- $sl->workorder()->save($woD);
- }
- }
- }
-
- $sl->subscriber()->save($sdl);
- $sl->packagedetail()->save($packageD);
-
- $id++;
- }
- }
- }
-
- dd('Semua- '.$count. ' -D ' .$id .' -ND '.$i);
- }
-
- public function convertFormAndRelationBusiness(){
- $newCoverage = Form::get()->toArray();
- $oldCoverage = OldBusiness::all();
- $count = count($oldCoverage);
- $id = 0; $i = 0;
- foreach($oldCoverage as $c){
-
- if(array_search($c->_id, array_column($newCoverage, '_id')) !== False) {
- } else {
-
- if($c->dealer == ''){
-
- $sl = Form::create([
- '_id' => new \MongoDB\BSON\ObjectId($c->_id),
- 'type_service' => $c->type_application,
- 'type_application' => 'B',
- 'status_payment' => $c->status,
- 'status_email' => $c->status1,
- 'remark_form' => $c->remarks,
- 'dealer_id' => $c->dealer,
- 'company_id' => $c->dealer_company,
- 'created_at' => new \MongoDB\BSON\UTCDateTime($c->reg_time*1000)
- ]);
-
- $su_id = '';
- do {
- $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
- } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- $sdl = new Subscriber();
- $sdl->subscriber_id = $su_id;
- $sdl->company_name = $c->company_name;
- $sdl->company_reg = $c->company_reg;
- $sdl->company_num = $c->company_num;
- $sdl->company_fax = $c->company_fax;
- $sdl->name = $c->name;
- $sdl->ic = $c->ic;
- $sdl->designation = $c->designation;
- $sdl->gender = $c->gender;
- $sdl->race = $c->race;
- $sdl->email = $c->email;
- $sdl->phone1 = $c->phone1;
- $sdl->phone2 = $c->phone2;
- $sdl->unit_no = '';
- $sdl->street = $c->address;
- $sdl->postcode = $c->postcode;
- $sdl->city = $c->city;
- $sdl->state = $c->state;
- $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- $sdl->back_ic = str_replace("data","/document",$c->imageback);
- $sdl->form24_49 = str_replace("data","/document",$c->formA_B);
- $sdl->form9_44 = str_replace("data","/document",$c->formD);
- $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- $packageD = new PackageDetail();
- $packageD->contract = $c->contract;
- $packageD->name = $c->package;
- $packageD->montly_fee = '';
- $packageD->voice_fee = $c->voice;
- $packageD->deposit = '';
- $packageD->upfront_payment = '';
- $packageD->rfs = $c->rfs;
-
- if($c->wo != ''){
- $getWo = OldWorkOrder::all();
-
- foreach($getWo as $w){
- if($w->wo == $c->wo){
- $woD = new WorkOrder();
- $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- $woD->wo = $w->wo;
- $woD->nature_work = $w->nature_work;
- $woD->sub_category = $w->sub_category;
- $woD->dateTimeStart = $w->dateTimeStart;
- $woD->dateTimeEnd = $w->dateTimeEnd;
- $woD->contractor_id = $w->contractor_id;
- $woD->installer_id = $w->installer_id;
- $woD->onu = $w->onu;
- $woD->router = $w->router;
- $woD->need_phone = $w->n_phone;
- $woD->no_phone = $w->no_phone;
- $woD->pppoe_username = $w->pppoe_username;
- $woD->pppoe_password = '';
- $woD->docket_id = $w->docket;
- $woD->remarks_custservice = $w->remarks;
- $woD->remarks_installer = $w->remarks_inst;
- $woD->status = $w->status;
- $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- $sl->workorder()->save($woD);
- }
- }
- }
-
- $sl->subscriber()->save($sdl);
- $sl->packagedetail()->save($packageD);
-
- $i++;
-
- }else {
-
- $sl = new Form();
- $sl->_id = new \MongoDB\BSON\ObjectId($c->_id);
- $sl->type_service = $c->type_application;
- $sl->type_application = 'B';
- $sl->status_payment = $c->status;
- $sl->status_email = $c->status1;
- $sl->remark_form = $c->remarks;
- $sl->dealer_id = $c->dealer;
- $sl->company_id = $c->dealer_company;
- $sl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // staff
- $staff = Staff::where('_id',$c->dealer)->first();
- // dd($c->dealer);
- $staff->form()->save($sl);
-
- $su_id = '';
- do {
- $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
- } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- $sdl = new Subscriber();
- $sdl->subscriber_id = $su_id;
- $sdl->company_name = $c->company_name;
- $sdl->company_reg = $c->company_reg;
- $sdl->company_num = $c->company_num;
- $sdl->company_fax = $c->company_fax;
- $sdl->name = $c->name;
- $sdl->ic = $c->ic;
- $sdl->designation = $c->designation;
- $sdl->gender = $c->gender;
- $sdl->race = $c->race;
- $sdl->email = $c->email;
- $sdl->phone1 = $c->phone1;
- $sdl->phone2 = $c->phone2;
- $sdl->unit_no = '';
- $sdl->street = $c->address;
- $sdl->postcode = $c->postcode;
- $sdl->city = $c->city;
- $sdl->state = $c->state;
- $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- $sdl->back_ic = str_replace("data","/document",$c->imageback);
- $sdl->form24_49 = str_replace("data","/document",$c->formA_B);
- $sdl->form9_44 = str_replace("data","/document",$c->formD);
- $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- $packageD = new PackageDetail();
- $packageD->contract = $c->contract;
- $packageD->name = $c->package;
- $packageD->montly_fee = '';
- $packageD->voice_fee = $c->voice;
- $packageD->deposit = '';
- $packageD->upfront_payment = '';
- $packageD->rfs = $c->rfs;
-
- if($c->wo != ''){
- $getWo = OldWorkOrder::all();
-
- foreach($getWo as $w){
- if($w->wo == $c->wo){
- $woD = new WorkOrder();
- $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- $woD->wo = $w->wo;
- $woD->nature_work = $w->nature_work;
- $woD->sub_category = $w->sub_category;
- $woD->dateTimeStart = $w->dateTimeStart;
- $woD->dateTimeEnd = $w->dateTimeEnd;
- $woD->contractor_id = $w->contractor_id;
- $woD->installer_id = $w->installer_id;
- $woD->onu = $w->onu;
- $woD->router = $w->router;
- $woD->need_phone = $w->n_phone;
- $woD->no_phone = $w->no_phone;
- $woD->pppoe_username = $w->pppoe_username;
- $woD->pppoe_password = '';
- $woD->docket_id = $w->docket;
- $woD->remarks_custservice = $w->remarks;
- $woD->remarks_installer = $w->remarks_inst;
- $woD->status = $w->status;
- $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- $sl->workorder()->save($woD);
- }
- }
- }
-
- $sl->subscriber()->save($sdl);
- $sl->packagedetail()->save($packageD);
-
- $id++;
- }
- }
- }
-
- dd('Semua- '.$count. ' -D ' .$id .' -ND '.$i);
- }
-
- public function staffConvert(){
-
- $old_staff = StaffOld::where('_id','5c74a263ded8f67c660b8b94')->get();
- $company = CompanyLaravel::where('_id','5b42b935ee0dc2b707473b76')->first();
- $instList = array();
-
- foreach($old_staff as $inst){
- $sl = StaffLaravel::create([
- '_id' => new \MongoDB\BSON\ObjectId($inst->_id),
- 'email' => $inst->email,
- 'password' => $inst->password,
- 'roles_access' => $inst->position,
- 'company_id' => '5b42b935ee0dc2b707473b76',
- 'last_login_at' => '',
- 'last_login_ip'=> '',
- 'created_at' => new \MongoDB\BSON\UTCDateTime($inst->reg_time*1000)
- ]);
-
- $sdl = new StaffDetailLaravel();
- $sdl->_id = new \MongoDB\BSON\ObjectId($inst->_id);
- $sdl->name = $inst->name;
- $sdl->ic = $inst->ic;
- $sdl->email = $inst->email;
- $sdl->phone = $inst->phone;
- $sdl->company_id = '5b42b935ee0dc2b707473b76';
- $sdl->color = $inst->color;
- $sdl->position = $inst->position;
- $sdl->password = $inst->password;
- $sdl->user_pic = $inst->user_pic;
- $sdl->created_at = new \MongoDB\BSON\UTCDateTime($inst->reg_time*1000);
-
- $company->stafflaravel()->save($sl);
- $company->save();
- $sl->staffdetaillaravel()->save($sdl);
- }
-
- dd($old_staff);
- }
-
- public function dealerConvert(){
- $oldDealer = DealerDetail::get();
- $newStaff = StaffLaravel::all()->toArray();
-
- $a = array();
- foreach ( $oldDealer as $o ) {
- if(array_search($o->_id, array_column($newStaff, '_id')) !== False) {
-
- } else {
-
- $sl = StaffLaravel::create([
- '_id' => new \MongoDB\BSON\ObjectId($o->_id),
- 'email' => $o->email,
- 'password' => $o->password,
- 'roles_access' => $o->position,
- 'company_id' => $o->company_id,
- 'last_login_at' => '',
- 'last_login_ip'=> '',
- 'created_at' => $o->created_at,
- 'updated_at' => $o->updated_at
- ]);
-
- $sdl = new StaffDetailLaravel();
- $sdl->_id = new \MongoDB\BSON\ObjectId($o->_id);
- $sdl->name = $o->name;
- $sdl->ic = $o->ic;
- $sdl->email = $o->email;
- $sdl->phone = $o->phone;
- $sdl->company_id = $o->company_id;
- $sdl->color = $o->color;
- $sdl->position = $o->position;
- $sdl->password = $o->password;
- $sdl->user_pic = $o->user_pic;
- $sdl->created_at = $o->created_at;
-
- $company = CompanyLaravel::where('_id',$o->company_id)->first();
- $company->stafflaravel()->save($sl);
- $company->save();
- $sl->staffdetaillaravel()->save($sdl);
-
- $a[] = $o;
- }
- }
-
- dd($a);
- }
-
- public function test1()
- {
- // $sub = SubscribersLaravel::where('subscriber_id','CBB-DNC0KQB')->first();
- // echo $sub->
-
- // $destinationPathIcon = '/assets/document';
- // if(!File::exists(public_path().$destinationPathIcon))
- // {
- // echo "folder takde woi";
- // }
- // else
- // echo "folder ada";
-
- $sub = SubscribersLaravel::all();
- $i=0;
- $arr = array();
- foreach($sub as $s)
- {
- if(!empty($s->front_ic))
- {
- if(strpos($s->form24_49, '/document/business/'.$s->_id) !== false)
- {
- $sb = SubscribersLaravel::where('subscriber_id', $s->subscriber_id)->first();
- // $sb->front_ic = str_replace('/document/business/'.$sb->_id,"/document/".$s->subscriber_id,$sb->front_ic);
- // $sb->back_ic = str_replace('/document/business/'.$sb->_id,"/document/".$s->subscriber_id,$sb->back_ic);
- // $sb->signature = str_replace('/document/business/'.$sb->_id,"/document/".$s->subscriber_id,$sb->signature);
- $sb->form24_49 = str_replace('/document/business/'.$sb->_id,"/document/".$s->subscriber_id,$sb->form24_49);
- $sb->form9_44 = str_replace('/document/business/'.$sb->_id,"/document/".$s->subscriber_id,$sb->form9_44);
- // $sb->back = "/document/".$s->subscriber_id."/backic.jpeg";
- // $sb->save();
- $arr[] = $s;
- }
- }
- }
- dd($arr);
- }
-
- public function updateHistory()
- {
- $form = Form::all()->toArray();
- $oh = OrderHistory::all();
- $i = 0;
- if(!empty($oh)){
- foreach ($oh as $o){
- if(array_search($o->_id, array_column($form, '_id')) !== False) {
- $fm = Form::where('_id', $o->_id)->first();
- if(empty($fm)){}
- else
- {
- foreach($o->details as $d)
- {
- $stat = new FormStatus();
- $stat->form_id = $o->_id;
- $stat->status_id = $d['id'];
- $stat->date = new \MongoDB\BSON\UTCDateTime($d['date']*1000);
- $stat->status = $d['status'];
- $stat->desc = $d['desc'];
- $stat->created_at = new \MongoDB\BSON\UTCDateTime($d['date']*1000);
- $fm->formstatus()->save($stat);
- $i++;
- }
- }
- }
- }
- }
-
- dd($i);
- }
-
- public function updateWorkOrder(){
- $wo = WorkOrder::all()->toArray();
- $oldWork = OldWorkOrder::all();
-
- $i = 0;
- foreach($oldWork as $o) {
-
- $curr = WorkOrder::where('wo',$o->wo)->first();
- if(!empty($curr)){
- $curr->nature_work = $o->nature_work;
- $curr->sub_category = $o->sub_category;
- $curr->dateTimeStart = $o->dateTimeStart;
- $curr->dateTimeEnd = $o->dateTimeEnd;
- $curr->contractor_id = $o->contractor_id;
- $curr->installer_id = $o->installer_id;
- $curr->onu = $o->onu;
- $curr->router = $o->router;
- $curr->need_phone = $o->n_phone;
- $curr->no_phone = $o->no_phone;
- $curr->pppoe_username = $o->pppoe_username;
- $curr->pppoe_password = '';
- $curr->docket_id = $o->docket;
- $curr->remarks_custservice = $o->remarks;
- $curr->remarks_installer = $o->remarks_inst;
- $curr->status = $o->status;
- $curr->save();
-
- $i++;
- }
- }
-
- dd($i);
- }
-
- public function updateDocket(){
-
- $i = 0;
- $wo = WorkOrder::all();
- foreach ($wo as $key => $w) {
- if($w->status == 'Completed'){
-
- $latest = Docket::where('work_order_id',$w->wo)->first();
- if(empty($latest)){
- $doc = OldDocket::where('work_order_id',$w->wo)->first();
- if(!empty($doc)){
- $i++;
- $curr = WorkOrder::where('wo',$doc->work_order_id)->first();
- $docket = new Docket();
- $docket->work_order_id = $doc->work_order_id;
- $docket->docket_id = $doc->docket_id;
- $docket->nature_work = $doc->nature_work;
- $docket->installer_id = $doc->installer_id;
- $docket->end_job = $doc->end_job;
- $docket->router_serial_number = $doc->router_serial_number;
- $docket->mac_router = $doc->mac_router;
- $docket->cable_read = $doc->cable_read;
- $docket->condition = $doc->condition;
- $docket->Note = $doc->Note;
- $docket->Rating1 = $doc->Rating1;
- $docket->Rating2 = $doc->Rating2;
- $docket->Rating3 = $doc->Rating3;
- $docket->customer_signature = $doc->customer_signature;
- $curr->docket()->save($docket);
- }
- }
- }
- }
-
- dd($i);
- }
-
- public function checkResidential(){
- // $newCoverage = Form::all();
- // $oldCoverage = OldResidential::all()->toArray();
-
- // $i = 0; $j = 0; $empty = array();
- // foreach ($newCoverage as $key => $a) {
- // if(array_search($a->_id, array_column($oldCoverage, '_id')) !== False) {
- // }else {
- // $empty[] = $a;
- // }
- // }
-
- // foreach ($empty as $key => $a) {
- // dd($a['_id']);
- // }
-
-
- // if($c->dealer == ''){
-
- // $sl = Form::create([
- // '_id' => new \MongoDB\BSON\ObjectId($c->_id),
- // 'type_service' => $c->type_application,
- // 'type_application' => 'B',
- // 'status_payment' => $c->status,
- // 'status_email' => $c->status1,
- // 'remark_form' => $c->remarks,
- // 'dealer_id' => $c->dealer,
- // 'company_id' => $c->dealer_company,
- // 'created_at' => new \MongoDB\BSON\UTCDateTime($c->reg_time*1000)
- // ]);
-
- // $su_id = '';
- // do {
- // $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
- // } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- // $sdl = new Subscriber();
- // $sdl->subscriber_id = $su_id;
- // $sdl->company_name = $c->company_name;
- // $sdl->company_reg = $c->company_reg;
- // $sdl->company_num = $c->company_num;
- // $sdl->company_fax = $c->company_fax;
- // $sdl->name = $c->name;
- // $sdl->ic = $c->ic;
- // $sdl->designation = $c->designation;
- // $sdl->gender = $c->gender;
- // $sdl->race = $c->race;
- // $sdl->email = $c->email;
- // $sdl->phone1 = $c->phone1;
- // $sdl->phone2 = $c->phone2;
- // $sdl->unit_no = '';
- // $sdl->street = $c->address;
- // $sdl->postcode = $c->postcode;
- // $sdl->city = $c->city;
- // $sdl->state = $c->state;
- // $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- // $sdl->back_ic = str_replace("data","/document",$c->imageback);
- // $sdl->form24_49 = str_replace("data","/document",$c->formA_B);
- // $sdl->form9_44 = str_replace("data","/document",$c->formD);
- // $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // $packageD = new PackageDetail();
- // $packageD->contract = $c->contract;
- // $packageD->name = $c->package;
- // $packageD->montly_fee = '';
- // $packageD->voice_fee = $c->voice;
- // $packageD->deposit = '';
- // $packageD->upfront_payment = '';
- // $packageD->rfs = $c->rfs;
-
- // if($c->wo != ''){
- // $getWo = OldWorkOrder::all();
-
- // foreach($getWo as $w){
- // if($w->wo == $c->wo){
- // $woD = new WorkOrder();
- // $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- // $woD->wo = $w->wo;
- // $woD->nature_work = $w->nature_work;
- // $woD->sub_category = $w->sub_category;
- // $woD->dateTimeStart = $w->dateTimeStart;
- // $woD->dateTimeEnd = $w->dateTimeEnd;
- // $woD->contractor_id = $w->contractor_id;
- // $woD->installer_id = $w->installer_id;
- // $woD->onu = $w->onu;
- // $woD->router = $w->router;
- // $woD->need_phone = $w->n_phone;
- // $woD->no_phone = $w->no_phone;
- // $woD->pppoe_username = $w->pppoe_username;
- // $woD->pppoe_password = '';
- // $woD->docket_id = $w->docket;
- // $woD->remarks_custservice = $w->remarks;
- // $woD->remarks_installer = $w->remarks_inst;
- // $woD->status = $w->status;
- // $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- // $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- // $sl->workorder()->save($woD);
- // }
- // }
- // }
-
- // $sl->subscriber()->save($sdl);
- // $sl->packagedetail()->save($packageD);
-
- // $i++;
-
- // }else {
-
- // $sl = new Form();
- // $sl->_id = new \MongoDB\BSON\ObjectId($c->_id);
- // $sl->type_service = $c->type_application;
- // $sl->type_application = 'B';
- // $sl->status_payment = $c->status;
- // $sl->status_email = $c->status1;
- // $sl->remark_form = $c->remarks;
- // $sl->dealer_id = $c->dealer;
- // $sl->company_id = $c->dealer_company;
- // $sl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // // staff
- // $staff = Staff::where('_id',$c->dealer)->first();
- // // dd($c->dealer);
- // $staff->form()->save($sl);
-
- // $su_id = '';
- // do {
- // $su_id = strtoupper('CBB-'.$this->random_code(6).'B');
- // } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- // $sdl = new Subscriber();
- // $sdl->subscriber_id = $su_id;
- // $sdl->company_name = $c->company_name;
- // $sdl->company_reg = $c->company_reg;
- // $sdl->company_num = $c->company_num;
- // $sdl->company_fax = $c->company_fax;
- // $sdl->name = $c->name;
- // $sdl->ic = $c->ic;
- // $sdl->designation = $c->designation;
- // $sdl->gender = $c->gender;
- // $sdl->race = $c->race;
- // $sdl->email = $c->email;
- // $sdl->phone1 = $c->phone1;
- // $sdl->phone2 = $c->phone2;
- // $sdl->unit_no = '';
- // $sdl->street = $c->address;
- // $sdl->postcode = $c->postcode;
- // $sdl->city = $c->city;
- // $sdl->state = $c->state;
- // $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- // $sdl->back_ic = str_replace("data","/document",$c->imageback);
- // $sdl->form24_49 = str_replace("data","/document",$c->formA_B);
- // $sdl->form9_44 = str_replace("data","/document",$c->formD);
- // $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // $packageD = new PackageDetail();
- // $packageD->contract = $c->contract;
- // $packageD->name = $c->package;
- // $packageD->montly_fee = '';
- // $packageD->voice_fee = $c->voice;
- // $packageD->deposit = '';
- // $packageD->upfront_payment = '';
- // $packageD->rfs = $c->rfs;
-
- // if($c->wo != ''){
- // $getWo = OldWorkOrder::all();
-
- // foreach($getWo as $w){
- // if($w->wo == $c->wo){
- // $woD = new WorkOrder();
- // $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- // $woD->wo = $w->wo;
- // $woD->nature_work = $w->nature_work;
- // $woD->sub_category = $w->sub_category;
- // $woD->dateTimeStart = $w->dateTimeStart;
- // $woD->dateTimeEnd = $w->dateTimeEnd;
- // $woD->contractor_id = $w->contractor_id;
- // $woD->installer_id = $w->installer_id;
- // $woD->onu = $w->onu;
- // $woD->router = $w->router;
- // $woD->need_phone = $w->n_phone;
- // $woD->no_phone = $w->no_phone;
- // $woD->pppoe_username = $w->pppoe_username;
- // $woD->pppoe_password = '';
- // $woD->docket_id = $w->docket;
- // $woD->remarks_custservice = $w->remarks;
- // $woD->remarks_installer = $w->remarks_inst;
- // $woD->status = $w->status;
- // $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- // $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- // $sl->workorder()->save($woD);
- // }
- // }
- // }
-
- // $sl->subscriber()->save($sdl);
- // $sl->packagedetail()->save($packageD);
-
- // $id++;
- // }
-
- $data = array();
- $oldCoverage = OldResidential::all();
- foreach($oldCoverage as $c){
- $fm = Form::with('Subscriber')->where('_id',$c->_id)->first();
- if($fm === null){
- $data[] = $c;
-
- // if($c->dealer == ''){
-
- // $sl = Form::create([
- // '_id' => new \MongoDB\BSON\ObjectId($c->_id),
- // 'type_service' => $c->type_application,
- // 'type_application' => 'R',
- // 'status_payment' => $c->status,
- // 'status_email' => $c->status1,
- // 'remark_form' => $c->remarks,
- // 'dealer_id' => $c->dealer,
- // 'company_id' => $c->dealer_company,
- // 'created_at' => new \MongoDB\BSON\UTCDateTime($c->reg_time*1000)
- // ]);
-
- // $su_id = '';
- // do {
- // $su_id = strtoupper('CBB-'.$this->random_code(6).'R');
- // } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- // $sdl = new Subscriber();
- // $sdl->subscriber_id = $su_id;
- // $sdl->name = $c->name;
- // $sdl->ic = $c->ic;
- // $sdl->citizen = $c->citizen;
- // $sdl->gender = $c->gender;
- // $sdl->race = $c->race;
- // $sdl->email = $c->email;
- // $sdl->phone1 = $c->phone1;
- // $sdl->phone2 = $c->phone2;
- // $sdl->unit_no = $c->unit_no;
- // $sdl->building_name = $c->building;
- // $sdl->street = $c->street;
- // $sdl->postcode = $c->postcode;
- // $sdl->city = $c->city;
- // $sdl->state = $c->state;
- // $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- // $sdl->back_ic = str_replace("data","/document",$c->imageback);
- // $sdl->signature = str_replace("data","/document",$c->signature);
- // $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // $packageD = new PackageDetail();
- // $packageD->contract = $c->contract;
- // $packageD->name = $c->package;
- // $packageD->montly_fee = '';
- // $packageD->voice_fee = $c->voice;
- // $packageD->deposit = '';
- // $packageD->upfront_payment = '';
- // $packageD->rfs = $c->rfs;
-
- // if($c->wo != ''){
- // $getWo = OldWorkOrder::all();
-
- // foreach($getWo as $w){
- // if($w->wo == $c->wo){
- // $woD = new WorkOrder();
- // $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- // $woD->wo = $w->wo;
- // $woD->nature_work = $w->nature_work;
- // $woD->sub_category = $w->sub_category;
- // $woD->dateTimeStart = $w->dateTimeStart;
- // $woD->dateTimeEnd = $w->dateTimeEnd;
- // $woD->contractor_id = $w->contractor_id;
- // $woD->installer_id = $w->installer_id;
- // $woD->onu = $w->onu;
- // $woD->router = $w->router;
- // $woD->need_phone = $w->n_phone;
- // $woD->no_phone = $w->no_phone;
- // $woD->pppoe_username = $w->pppoe_username;
- // $woD->pppoe_password = '';
- // $woD->docket_id = $w->docket;
- // $woD->remarks_custservice = $w->remarks;
- // $woD->remarks_installer = $w->remarks_inst;
- // $woD->status = $w->status;
- // $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- // $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- // $sl->workorder()->save($woD);
- // }
- // }
- // }
-
- // $sl->subscriber()->save($sdl);
- // $sl->packagedetail()->save($packageD);
-
- // $i++;
-
- // }else {
-
- // $sl = new Form();
- // $sl->_id = new \MongoDB\BSON\ObjectId($c->_id);
- // $sl->type_service = $c->type_application;
- // $sl->type_application = 'R';
- // $sl->status_payment = $c->status;
- // $sl->status_email = $c->status1;
- // $sl->remark_form = $c->remarks;
- // $sl->dealer_id = $c->dealer;
- // $sl->company_id = $c->dealer_company;
- // $sl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // // staff
- // $staff = Staff::where('_id',$c->dealer)->first();
- // // dd($c->dealer);
- // $staff->form()->save($sl);
-
- // $su_id = '';
- // do {
- // $su_id = strtoupper('CBB-'.$this->random_code(6).'R');
- // } while (Subscriber::where("subscriber_id", "=", $su_id)->first() instanceof Subscriber);
-
- // $sdl = new Subscriber();
- // $sdl->subscriber_id = $su_id;
- // $sdl->name = $c->name;
- // $sdl->ic = $c->ic;
- // $sdl->citizen = $c->citizen;
- // $sdl->gender = $c->gender;
- // $sdl->race = $c->race;
- // $sdl->email = $c->email;
- // $sdl->phone1 = $c->phone1;
- // $sdl->phone2 = $c->phone2;
- // $sdl->unit_no = $c->unit_no;
- // $sdl->building_name = $c->building;
- // $sdl->street = $c->street;
- // $sdl->postcode = $c->postcode;
- // $sdl->city = $c->city;
- // $sdl->state = $c->state;
- // $sdl->front_ic = str_replace("data","/document",$c->imagefront);
- // $sdl->back_ic = str_replace("data","/document",$c->imageback);
- // $sdl->signature = str_replace("data","/document",$c->signature);
- // $sdl->created_at = new \MongoDB\BSON\UTCDateTime($c->reg_time*1000);
-
- // $packageD = new PackageDetail();
- // $packageD->contract = $c->contract;
- // $packageD->name = $c->package;
- // $packageD->montly_fee = '';
- // $packageD->voice_fee = $c->voice;
- // $packageD->deposit = '';
- // $packageD->upfront_payment = '';
- // $packageD->rfs = $c->rfs;
-
- // if($c->wo != ''){
- // $getWo = OldWorkOrder::all();
-
- // foreach($getWo as $w){
- // if($w->wo == $c->wo){
- // $woD = new WorkOrder();
- // $woD->img_url = '/assets/img/activation_icon_nRead1.png';
- // $woD->wo = $w->wo;
- // $woD->nature_work = $w->nature_work;
- // $woD->sub_category = $w->sub_category;
- // $woD->dateTimeStart = $w->dateTimeStart;
- // $woD->dateTimeEnd = $w->dateTimeEnd;
- // $woD->contractor_id = $w->contractor_id;
- // $woD->installer_id = $w->installer_id;
- // $woD->onu = $w->onu;
- // $woD->router = $w->router;
- // $woD->need_phone = $w->n_phone;
- // $woD->no_phone = $w->no_phone;
- // $woD->pppoe_username = $w->pppoe_username;
- // $woD->pppoe_password = '';
- // $woD->docket_id = $w->docket;
- // $woD->remarks_custservice = $w->remarks;
- // $woD->remarks_installer = $w->remarks_inst;
- // $woD->status = $w->status;
- // $woD->created_by = str_replace(array( 'ObjectId(', ')' ), '', $w->created_by);
- // $woD->created_at = new \MongoDB\BSON\UTCDateTime($w->reg_time*1000);
-
- // $sl->workorder()->save($woD);
- // }
- // }
- // }
-
- // $sl->subscriber()->save($sdl);
- // $sl->packagedetail()->save($packageD);
- // }
- }
- }
-
- dd($data);
- }
-
- public function subscriberID(){
-
- $final = array();
- $data = Form::with('PackageDetail','Subscriber')->where('type_service','!=','Rectification')->where('type_application','B')->withTrashed()->get();
- foreach ($data as $key => $d) {
- $created_at = $d->created_at->format('m/Y');
- // if(strpos($created_at,'03/2019') !== false){
- // if(($d->Subscriber->email != '<b>Package Development</b>' || $d->Subscriber->ic != '<b>Package Development</b>') && $d->PackageDetail->name == "10"){
- if($d->PackageDetail->name == '1' && $d->PackageDetail->contract == '12'){
- // if($d->Subscriber->citizen == 'Malaysian'){
- // $d->PackageDetail->montly_fee = '115.54';
- // $d->PackageDetail->deposit = '200';
- // $d->PackageDetail->upfront_payment = '0';
- // $d->PackageDetail->save();
- // }else {
- $d->PackageDetail->montly_fee = '3,708.94';
- $d->PackageDetail->deposit = '3,499';
- $d->PackageDetail->upfront_payment = '300';
- $d->PackageDetail->save();
- // }
- $final[] = $d->_id;
- }
-
- // if($d->PackageDetail->name == 'R'){
- // $final[] = $d->_id;
- // $d->type_service = 'Rectification';
- // $d->status_payment = 'paid';
- // $d->status_email = 'verified';
- // $d->save();
- // }
- // }
- // }
- // // if(($d->Subscriber->email == '<b>Package Development</b>' || $d->Subscriber->ic == '<b>Package Development</b>') && $d->PackageDetail->contract == ""){
- // // $d->PackageDetail->contract = "24";
- // // $d->PackageDetail->save();
-
- // // $final[] = $d->_id;
- // // }
- // }
-
- // if(!empty($d->PackageDetail->voice_fee)){
- // if($d->PackageDetail->voice_fee == 0){
- // $d->PackageDetail->voice_fee = 'No';
- // $d->PackageDetail->save();
- // $final[] = $d->_id;
- // }
- // }
- }
-
- dd($final);
- }
-
- public function convertStaffDb()
- {
- // $s = OldResidential::first();
- return $this->subscriberID();
- // return $this->checkResidential();
- // return $this->test2();
- // return $this->updateWorkOrder();
- // return $this->updateDocket();
- // return $this->updateHistory();
- // return $this->staffConvert();
- // return $this->convertFormAndRelation();
- // return $this->convertFormAndRelationBusiness();
- // return $this->dealerConvert();
-
- // return $this->addWotoExistingForm();
-
- // $a = array(); $count = 0;
- // $oldDocket = Docket::all();
- // $newWork = WorkOrderLaravel::where('status','Completed')->get()->toArray();
-
- // $i = 0;
- // foreach ( $oldDocket as $o ) {
- // if(array_search($o->work_order_id, array_column($newWork, 'wo')) !== False) {
-
- // // $a[] = $o->docket_id.' - '.$o->work_order_id;
- // $a[] = $o->docket_id;
-
- // $xNw = DocketLaravel::where('work_order_id',$o->work_order_id)->first();
-
- // if(empty($xNw)){
-
- // $testDate = $o->end_job;
- // $date = str_replace('/','-',$testDate);
- // $timestamp = strtotime($date);
- // //Convert timestamp to carbon format for created_at
- // $go = Carbon::createFromTimestamp($timestamp).".000Z";
- // $time = Carbon::createFromTimeString($go);
-
- // $wo = WorkOrderLaravel::where('wo',$o->work_order_id)->first();
-
- // $do = new DocketLaravel();
- // $do->work_order_id = $o->work_order_id;
- // $do->docket_id = $o->docket_id;
- // $do->nature_work = $o->nature_work;
- // $do->installer_id = $o->installer_id;
- // $do->end_job = $time->toDateTimeString();
- // $do->router_serial_number = $o->router_serial_number;
- // $do->mac_router = $o->mac_router;
- // $do->cable_read = $o->cable_read;
- // $do->condition = $o->condition;
- // $do->Note = $o->Note;
- // $do->Rating1 = $o->Rating1;
- // $do->Rating2 = $o->Rating2;
- // $do->Rating3 = $o->Rating3;
- // $do->customer_signature = $o->customer_signature;
- // $do->created_at= $time;
-
- // $wo->docketlaravel()->save($do);
-
- // $i++;
- // }
- // }
- // }
-
- // // $xNw1 = WorkOrderLaravel::with('FormLaravel')->get();
- // // $fm = FormLaravel::with('WorkOrderLaravel','SubscribersLaravel')->first();
- // // $docket = DocketLaravel::where('work_order_id',$fm->WorkOrderLaravel->wo)->first();
-
- // // $withoutDuplicates = array_unique($a);
- // // $duplicates = array_diff($a, $withoutDuplicates);
-
- // // dd(count($newWork) .'-'.$i);
-
- // $doc = DocketLaravel::all();
- // dd(count($doc));
-
- }
- }
|