<?php | |||||
namespace App\Http\Controllers\Api; | |||||
use Illuminate\Http\Request; | |||||
use App\Http\Controllers\Api\BaseController; | |||||
use Illuminate\Support\Facades\Auth; | |||||
use App\Model\AppsVersion; | |||||
class AppVersionController extends BaseController | |||||
{ | |||||
public function compareVersion(Request $request){ | |||||
$apps = AppsVersion::all(); | |||||
return $this->sendResponse($apps, 'Get Data Successfully'); | |||||
} | |||||
} | |||||
namespace App\Http\Controllers; | namespace App\Http\Controllers; | ||||
use App\Model\Coverage; | |||||
use Illuminate\Foundation\Bus\DispatchesJobs; | use Illuminate\Foundation\Bus\DispatchesJobs; | ||||
use Illuminate\Routing\Controller as BaseController; | use Illuminate\Routing\Controller as BaseController; | ||||
use Illuminate\Foundation\Validation\ValidatesRequests; | use Illuminate\Foundation\Validation\ValidatesRequests; | ||||
class Controller extends BaseController | class Controller extends BaseController | ||||
{ | { | ||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | use AuthorizesRequests, DispatchesJobs, ValidatesRequests; | ||||
public function taggingCategory(){ | |||||
$response = json_decode(file_get_contents(public_path() . '/test.json')); | |||||
if ($response->success == true) { | |||||
foreach ($response->data as $key => $r) { | |||||
$coverage = Coverage::where(strtoupper('building_name'),strtoupper($r->building_name))->where(strtoupper('street'),strtoupper($r->street))->where('Type',$r->Type)->get(); | |||||
if(count($coverage)==0){ | |||||
$coveragedetails = [ | |||||
'Type' => $r->Type, | |||||
'building_name' => strtoupper($r->building_name), | |||||
'project_type' => $r->project_type, | |||||
'street' => strtoupper($r->street), | |||||
'city' => strtoupper($r->city), | |||||
'state' => strtoupper($r->state), | |||||
'postcode' => $r->postcode, | |||||
'installation_fee' => $r->installation_fee, | |||||
'status_building' => $r->status_building, | |||||
'jmb_email' => "", | |||||
]; | |||||
$coverageUpdate = Coverage::create($coveragedetails); | |||||
}else{ | |||||
} | |||||
} | |||||
return 'data inserted ' ; | |||||
} | |||||
} | |||||
} | } |
$product = Product::where('speed',$form->PackageDetail->name)->where('formT',$w->Form->type_application)->first(); | $product = Product::where('speed',$form->PackageDetail->name)->where('formT',$w->Form->type_application)->first(); | ||||
$company = Company::where('_id',$w->contractor_id)->first(); | $company = Company::where('_id',$w->contractor_id)->first(); | ||||
// info($w->installer_id); | |||||
if($w->installer_id != ''){ | if($w->installer_id != ''){ | ||||
$installer = Staff::with('StaffDetail')->where('_id',$w->installer_id)->first(); | $installer = Staff::with('StaffDetail')->where('_id',$w->installer_id)->first(); | ||||
$installer = $installer->StaffDetail->name; | $installer = $installer->StaffDetail->name; |
public function viewFormApplication(Request $request) { | public function viewFormApplication(Request $request) { | ||||
$data = array(); | $data = array(); | ||||
$coverage = Coverage::where('Type','B')->where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
$coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
array_push($data, array( | array_push($data, array( | ||||
'coverage' => $coverage[0]['_id'], | 'coverage' => $coverage[0]['_id'], | ||||
public function viewFormApplicationD(Request $request) { | public function viewFormApplicationD(Request $request) { | ||||
$data = array(); | $data = array(); | ||||
$coverage = Coverage::where('Type','B')->where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
$coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
array_push($data, array( | array_push($data, array( | ||||
'coverage' => $coverage[0]['_id'], | 'coverage' => $coverage[0]['_id'], |
public function viewFormApplication(Request $request) { | public function viewFormApplication(Request $request) { | ||||
$data = array(); | $data = array(); | ||||
$coverage = Coverage::where('Type','R')->where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
$coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
array_push($data, array( | array_push($data, array( | ||||
'coverage' => $coverage[0]['_id'], | 'coverage' => $coverage[0]['_id'], | ||||
public function viewFormApplicationD(Request $request) { | public function viewFormApplicationD(Request $request) { | ||||
$data = array(); | $data = array(); | ||||
$coverage = Coverage::where('Type','R')->where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
$coverage = Coverage::where('building_name', $request->coverage)->where('street',$request->street)->get(); | |||||
array_push($data, array( | array_push($data, array( | ||||
'coverage' => $coverage[0]['_id'], | 'coverage' => $coverage[0]['_id'], |
<?php | |||||
namespace App\Model; | |||||
use Jenssegers\Mongodb\Eloquent\Model as Eloquent; | |||||
use Jenssegers\Mongodb\Eloquent\SoftDeletes; | |||||
class AppsVersion extends Eloquent | |||||
{ | |||||
use SoftDeletes; | |||||
protected $connection = 'mongodb'; | |||||
protected $collection = 'app_version'; | |||||
protected $guarded = ['_id']; | |||||
} |
Route::get('/form/statistic','Api\FormController@getFormStatistic'); | Route::get('/form/statistic','Api\FormController@getFormStatistic'); | ||||
Route::get('/claim/12/12/2019','DS\MarketingController@manualDate'); | Route::get('/claim/12/12/2019','DS\MarketingController@manualDate'); | ||||
Route::get('/get-data','Api\FormController@get_data_form'); | Route::get('/get-data','Api\FormController@get_data_form'); | ||||
}); | |||||
}); | |||||
/* | |||||
|-------------------------------------------------------------------------- | |||||
| Check Version | |||||
|-------------------------------------------------------------------------- | |||||
*/ | |||||
Route::get('/mobile/apps_version', 'Api\AppVersionController@compareVersion'); | |||||
/* | /* | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
| Residential Form | | Residential Form | ||||
|-------------------------------------------------------------------------- | |-------------------------------------------------------------------------- | ||||
*/ | */ | ||||
Route::get('/get-coverage-detail/{building_name}/{street}', 'Api\Controller@getCoverageDetail'); | |||||
Route::get('/get-coverage-detail/{building_name}/{street}', 'Api\Controller@getCoverageDetail')->where('street', '.*'); | |||||
Route::get('/get-street/{building_name}', 'Api\Controller@getStreet'); | Route::get('/get-street/{building_name}', 'Api\Controller@getStreet'); | ||||
return view('index'); | return view('index'); | ||||
}); | }); | ||||
Route::get('/add-customer-category', ['uses' => 'Controller@taggingCategory']); | |||||
Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']); | Route::get('/convert-password/{action}/', ['uses' => 'Auth\AdminController@encryptPassword']); | ||||
Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']); | Route::get('/store-claim/pdf', ['uses' => 'DS\DealerController@exportDealerJson']); | ||||
Route::get('/convert-total-claim-float', ['uses' => 'DS\DealerController@update_total_claim']); | Route::get('/convert-total-claim-float', ['uses' => 'DS\DealerController@update_total_claim']); |