amp api
parent
62662d08e8
commit
5d710e6800
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if (!defined('BASEPATH'))
|
||||||
|
exit('No direct script access allowed');
|
||||||
|
|
||||||
|
class Info_amp extends CI_Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
$this->permission->is_admin();
|
||||||
|
$this->load->model('InfoMetas_model');
|
||||||
|
//$this->output->enable_profiler(TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function save_amp()
|
||||||
|
{
|
||||||
|
$icid = $this->input->post('icid');
|
||||||
|
$json = $this->input->post('json');
|
||||||
|
$html = $this->input->post('html');
|
||||||
|
$status = $this->input->post('status');
|
||||||
|
if ($icid && $json && $html && $status) {
|
||||||
|
try {
|
||||||
|
$this->InfoMetas_model->add($ic_id, 'AMP', $html);
|
||||||
|
$this->InfoMetas_model->add($ic_id, 'AMP_JSON', $json);
|
||||||
|
$this->InfoMetas_model->add($ic_id, 'AMP_STATUS', $status);
|
||||||
|
echo json_encode(array(
|
||||||
|
"succ" => true
|
||||||
|
));
|
||||||
|
} catch(Exception $e) {
|
||||||
|
echo json_encode(array(
|
||||||
|
"succ" => false,
|
||||||
|
"message" => $e->getMessage()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo json_encode(array(
|
||||||
|
"succ" => false,
|
||||||
|
"message" => "Post para error."
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function load_amp()
|
||||||
|
{
|
||||||
|
$icid = $this->input->post('icid');
|
||||||
|
$html = $this->InfoMetas_model->get($ic_id, 'AMP');
|
||||||
|
$json = $this->InfoMetas_model->get($ic_id, 'AMP_JSON');
|
||||||
|
$status = $this->InfoMetas_model->get($ic_id, 'AMP_STATUS');
|
||||||
|
echo json_encode(array(
|
||||||
|
"icid" => $icid,
|
||||||
|
"json" => $json,
|
||||||
|
"html" => $html,
|
||||||
|
"status" => $status
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue