Initial import from local backup (Documents-Playground/pakerpale)
This commit is contained in:
100
application/controllers/crawls/Place.php
Normal file
100
application/controllers/crawls/Place.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Place extends MY_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('placeModel');
|
||||
}
|
||||
|
||||
public function category() {
|
||||
$this->podbbangModel->updateCategory($this->input->post('id'), $this->input->post('category'));
|
||||
echo $this->db->affected_rows();
|
||||
}
|
||||
|
||||
public function church()
|
||||
{
|
||||
$this->data = ['page' => $this->getPage(__FUNCTION__), 'categories' => []];
|
||||
$this->load->view('page', $this->data);
|
||||
}
|
||||
|
||||
public function church_table()
|
||||
{
|
||||
$data = $this->placeModel->getTable(json_decode($this->input->raw_input_stream, true));
|
||||
// echo $this->db->last_query();
|
||||
$naverPlaceIds = array();
|
||||
foreach($data['rows'] as $d) {
|
||||
array_push($naverPlaceIds, $d->NId);
|
||||
}
|
||||
$churchs = $this->db->where_in('NId', $naverPlaceIds)->get('cm_place_church')->result();
|
||||
|
||||
$churchIds = array();
|
||||
foreach($churchs as $c) {
|
||||
array_push($churchIds, $c->Id);
|
||||
}
|
||||
|
||||
$churchServices = count($churchIds) > 0 ? $this->db->where_in('ChurchId', $churchIds)->get('cm_church_service')->result() : array();
|
||||
|
||||
foreach($data['rows'] as $k => $v) {
|
||||
$data['rows'][$k]->Services = array();
|
||||
foreach($churchs as $c) {
|
||||
if($c->NId == $v->NId) {
|
||||
foreach($c as $j => $a) {
|
||||
$data['rows'][$k]->{$j} = $a;
|
||||
}
|
||||
foreach($churchServices as $cs) {
|
||||
if($cs->ChurchId == $c->Id) {
|
||||
array_push($data['rows'][$k]->Services, $cs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['rows'][$k]->Address = $v->RoadAddress ? $v->RoadAddress : $v->Address;
|
||||
}
|
||||
|
||||
$this->response($data);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$data = $this->restClient->deleteDeveloper(['developers' => array_column($this->input->post('selection'), 'id')]);
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
foreach ($this->input->post('selection') as $developer) {
|
||||
$this->restClient->updateDeveloper([
|
||||
'name' => $developer['name'],
|
||||
'description' => $developer['description'],
|
||||
'id' => $developer['id']
|
||||
]);
|
||||
}
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function church_save()
|
||||
{
|
||||
if ($this->placeModel->saveChurch($this->input->post())) {
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
} else {
|
||||
$this->response(array(
|
||||
'code' => 500,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
73
application/controllers/crawls/Podbbang.php
Normal file
73
application/controllers/crawls/Podbbang.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Podbbang extends MY_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('podbbangModel');
|
||||
}
|
||||
|
||||
public function category() {
|
||||
$this->podbbangModel->updateCategory($this->input->post('id'), $this->input->post('category'));
|
||||
echo $this->db->affected_rows();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->data = ['page' => $this->getPage(__FUNCTION__), 'categories' => []];
|
||||
$this->load->view('page', $this->data);
|
||||
}
|
||||
|
||||
public function table()
|
||||
{
|
||||
$data = $this->podbbangModel->getTable(json_decode($this->input->raw_input_stream, true));
|
||||
// echo $this->db->last_query();
|
||||
$this->response($data);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$data = $this->restClient->deleteDeveloper(['developers' => array_column($this->input->post('selection'), 'id')]);
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
foreach ($this->input->post('selection') as $developer) {
|
||||
$this->restClient->updateDeveloper([
|
||||
'name' => $developer['name'],
|
||||
'description' => $developer['description'],
|
||||
'id' => $developer['id']
|
||||
]);
|
||||
}
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
if ($this->restClient->saveDeveloper([
|
||||
'name' => $this->input->post('name'),
|
||||
'description' => $this->input->post('description')
|
||||
])) {
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
} else {
|
||||
$this->response(array(
|
||||
'code' => 500,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
73
application/controllers/crawls/Youtube.php
Normal file
73
application/controllers/crawls/Youtube.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Youtube extends MY_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('youtubeModel');
|
||||
}
|
||||
|
||||
public function category() {
|
||||
$this->youtubeModel->updateCategory($this->input->post('id'), $this->input->post('category'));
|
||||
echo $this->db->affected_rows();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->data = ['page' => $this->getPage(__FUNCTION__), 'categories' => []];
|
||||
$this->load->view('page', $this->data);
|
||||
}
|
||||
|
||||
public function table()
|
||||
{
|
||||
$data = $this->youtubeModel->getTable(json_decode($this->input->raw_input_stream, true));
|
||||
// echo $this->db->last_query();
|
||||
$this->response($data);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$data = $this->restClient->deleteDeveloper(['developers' => array_column($this->input->post('selection'), 'id')]);
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
foreach ($this->input->post('selection') as $developer) {
|
||||
$this->restClient->updateDeveloper([
|
||||
'name' => $developer['name'],
|
||||
'description' => $developer['description'],
|
||||
'id' => $developer['id']
|
||||
]);
|
||||
}
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
if ($this->restClient->saveDeveloper([
|
||||
'name' => $this->input->post('name'),
|
||||
'description' => $this->input->post('description')
|
||||
])) {
|
||||
$this->response(array(
|
||||
'code' => 200,
|
||||
'data' => []
|
||||
));
|
||||
} else {
|
||||
$this->response(array(
|
||||
'code' => 500,
|
||||
'data' => []
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user