You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.7 KiB
PHTML
61 lines
1.7 KiB
PHTML
7 years ago
|
<?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
|
||
|
));
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|