| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278 |
- <?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->modem_sn = $doc->modem_sn;
- $docket->type_testing = $doc->type_testing;
- $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));
-
- }
- }
|