예제 #1
0
     $data = json_decode($data, true);
     $prices = $dg->prices($data);
     echo json_encode($prices);
     exit;
     break;
 case 'svg':
     $data = $_POST;
     $svg = $dg->getSVG($data);
     echo json_encode($svg);
     exit;
     break;
 case 'addCart':
     header('Content-Type: text/html; charset=UTF-8');
     $data = file_get_contents('php://input');
     $data = json_decode($data, true);
     $content = $dg->addCart($data);
     echo json_encode($content);
     exit;
     break;
 case 'fonts':
     $file = ROOT . DS . 'data' . DS . 'fonts.json';
     $fonts = array('status' => 1, 'fonts' => array());
     if (file_exists($file)) {
         $str = @file_get_contents($file);
         $rows = json_decode($str, true);
         if (empty($rows['fonts'])) {
             $rows['fonts'] = array();
         }
         if (empty($rows['fonts']['categories'])) {
             $file = ROOT . DS . 'admin' . DS . 'data' . DS . 'font_categories.json';
             if (file_exists($file)) {