$myArray = array();
                 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
                     $tempArray = $row;
                     // some strings contain f****d up characters
                     //$tempArray["tweet"] = stripslashes($tempArray["tweet"]);
                     //$tempArray["user_name"] = stripslashes($tempArray["user_name"]);
                     array_push($myArray, $tempArray);
                 }
                 echo json_encode($myArray);
             }
             mysqli_close($mysqli);
         }
     }
 } else {
     // try single query mode (which surely works..)
     $query = rawUrlDecode($_POST["query"]);
     // echo "<p>";
     // echo "Query: " . $query;
     // echo "</p>";
     // using single query mode
     $result = mysqli_query($mysqli, $query);
     if ($result === FALSE) {
         echo "Query did not work. \n";
         echo mysqli_error($mysqli);
     } else {
         if ($result === 0) {
             echo "No results returned";
         } else {
             $i = 0;
             $numRows = mysqli_num_rows($result);
             ///////////$response = "";
Example #2
0
<?php

$url = rawUrlDecode($_POST['url']);
print file_get_contents($url);
<?php

require 'api_rb.php';
require 'api_db.php';
$user_name = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';
$dc_name = isset($_REQUEST['dc']) ? $_REQUEST['dc'] : '';
$days = isset($_REQUEST['days']) ? $_REQUEST['days'] : '';
$requirement = isset($_REQUEST['req']) ? $_REQUEST['req'] : '';
$requirement = rawUrlDecode($requirement);
// Log
_log(json_encode(['user_name' => $user_name, 'dc_name' => $dc_name, 'days' => $days, 'requirement' => $requirement]));
// Check
if (empty($user_name) || empty($dc_name) || empty($days)) {
    header('Content-type:text/json;charset=utf-8');
    echo json_encode(['result' => 'failed', 'error' => 'missing argument']);
    die;
}
$day_array = json_decode($days);
if ($day_array === FALSE || $day_array == NULL || empty($day_array)) {
    header('Content-type:text/json;charset=utf-8');
    echo json_encode(['result' => 'failed', 'error' => 'invalid argument days']);
    die;
}
// Get user info
R::addDatabase('kayako', $GLOBALS['db_kayako_url'], $GLOBALS['db_kayako_user'], $GLOBALS['db_kayako_pass']);
R::selectDatabase('kayako');
if (!R::testConnection()) {
    exit('DB failed' . PHP_EOL);
}
R::freeze(true);
try {
Example #4
0
 public function start()
 {
     $urlPrefix = $this->config->get('web')->url;
     $url = $_SERVER['REQUEST_URI'];
     if (false !== strPos($url, '?')) {
         $url = subStr($url, 0, strPos($url, '?'));
     }
     if ($urlPrefix && 0 === strPos($url, $urlPrefix)) {
         $url = subStr($url, strLen($urlPrefix));
     }
     if ($this->config->get('web')->index) {
         $url = preg_replace('/' . preg_quote($this->config->get('web')->index) . '$/', '', $url);
     }
     $url = trim(rawUrlDecode($url), '/');
     $this->dispatcher->dispatch($this->config->routes(), $url);
 }
Example #5
0
 function getPrintedItem()
 {
     if (!empty($_REQUEST['data'])) {
         $item_array = json_decode(rawUrlDecode($_REQUEST['data']), true);
         die(pbGetContentBuilderItem($item_array));
     }
     die('<div class="error">Empty Reqeist</div>');
 }
Example #6
0
 function addPriceUa($title, $description, $price, $image, $category)
 {
     header("Content-type: text/html; charset=utf-8");
     //Прием данных
     $description = $this->security->xss_clean(rawUrlDecode($description));
     $title = $this->security->xss_clean(rawUrlDecode($title));
     $price = $this->security->xss_clean(rawUrlDecode($price));
     //Убираем не числовые значения
     $price = preg_replace('/[^0-9.]/', '', $price);
     //Замена галочек на слеши,сделано для передачи url в url
     echo $image = mb_ereg_replace('✓', '/', rawUrlDecode($image));
     //Загрузка изображения
     $upload = file_get_contents($image);
     $imageType = exif_imagetype($image);
     //Проверка типа файла
     if ($imageType === 1 or $imageType === 2 or $imageType === 3) {
         switch ($imageType) {
             case 1:
                 $type = ".gif";
                 break;
             case 2:
                 $type = ".jpeg";
                 break;
             case 3:
                 $type = ".png";
                 break;
         }
         //Запись файла
         $hashName = md5(microtime()) . $type;
         $folder = $_SERVER['DOCUMENT_ROOT'] . "/images/product-preview/" . $hashName;
         $folder2 = $_SERVER['DOCUMENT_ROOT'] . "/images/product-images/" . $hashName;
         file_put_contents($folder, $upload);
         file_put_contents($folder2, $upload);
         //Запись товара в базу данных
         $this->load->model('admin_model');
         $this->admin_model->newProduct($title, $price, $description, intval($category), $hashName);
     }
 }
 function shortcode_jw_item_title($atts, $content)
 {
     $output = '<div class="jw-title-container"><h2 class="jw-title">' . rawUrlDecode($atts['title']) . '</h2></div>';
     return $output;
 }
 function pbGetContentBuilder()
 {
     global $post, $jw_startPrinted, $jw_pbItems;
     $endPrint = false;
     ob_start();
     $_pb_row_array = json_decode(rawUrlDecode(get_post_meta($post->ID, '_pb_content', true)), true);
     if (empty($_pb_row_array)) {
         return false;
     } else {
         $layoutsEcho = '';
         $prllx = false;
         foreach ($_pb_row_array as $_pb_row) {
             $rowContrast = isset($_pb_row['row_width']) ? ' ' . $_pb_row['row_width'] : '';
             $rowwidth = $_pb_row['row_width'] == 'inside' ? ' ' . $_pb_row['row_width'] : '100%';
             $containerTitle = isset($_pb_row['row_container_title']) ? ' ' . $_pb_row['row_container_title'] : '';
             $containerDesc = isset($_pb_row['row_container_desc']) ? ' ' . $_pb_row['row_container_desc'] : '';
             if (!empty($_pb_row['row_container_title'])) {
                 $ContainerTitleDivider = '<div class="bottomdivider clearfix"></div>';
                 $containerTitle = '<div class="container_title"><h1>' . $containerTitle . '</h1>' . $ContainerTitleDivider . '<p>' . $containerDesc . '</p></div>';
             } else {
                 $containerTitle = '';
             }
             $rowParallax = isset($_pb_row['background_prllx']) ? $_pb_row['background_prllx'] == 'true' ? ' bg-parallax' : '' : '';
             $rowCustomClass = !empty($_pb_row['row_custom_class']) ? $_pb_row['row_custom_class'] : '';
             $bgAttachment = !empty($rowParallax) ? 'fixed' : (isset($_pb_row['background_attachment']) ? $_pb_row['background_attachment'] : 'scroll');
             if (!$prllx) {
                 $prllx = !empty($rowParallax) ? true : false;
             }
             $class = $rowContrast . $rowParallax . ' ' . $rowCustomClass;
             $_pb_row['background_color'] = isset($_pb_row['background_color']) ? str_replace(' ', '', $_pb_row['background_color']) : '';
             $style = 'background-attachment:' . $bgAttachment . ';';
             $style .= empty($_pb_row['background_color']) ? '' : 'background-color:' . $_pb_row['background_color'] . ';';
             $style .= empty($_pb_row['background_image']) ? '' : 'background-image:url(' . $_pb_row['background_image'] . ');';
             $style .= empty($_pb_row['background_repeat']) ? '' : 'background-repeat:' . $_pb_row['background_repeat'] . ';';
             $style .= empty($_pb_row['background_position']) ? '' : 'background-position:' . $_pb_row['background_position'] . ';';
             $layoutsEcho .= '<div class="row-container' . $class . '" ' . (!empty($rowCustomClass) ? ' id="' . $rowCustomClass . '"' : '') . ' style="' . $style . '"><div class="container" style="width:' . $rowwidth . '">' . $containerTitle . '<div class="row">';
             foreach ($_pb_row['layouts'] as $_pb_layout) {
                 if ($_pb_layout['size'] !== 'size-0-0') {
                     global $jw_layoutSize;
                     $jw_layoutSize = $_pb_layout['size'];
                     $layoutsEcho .= '[jw_layout size="' . pbTextToFoundation($_pb_layout['size']) . '" layout_custom_class="' . (isset($_pb_layout['layout_custom_class']) ? $_pb_layout['layout_custom_class'] : '') . '"]';
                     $jw_startPrinted = false;
                     $colCounter = 0;
                     $start = 'true';
                     foreach ($_pb_layout['items'] as $item_array) {
                         list($colCounter, $start) = rowStart($colCounter, pbTextToFoundation($_pb_layout['size']) === 'span3' ? 12 : pbTextToInt($item_array['size']));
                         $endPrint = true;
                         $rowClass = $item_array['row-type'] = !empty($jw_pbItems[$item_array['slug']]['row-type']) ? $jw_pbItems[$item_array['slug']]['row-type'] : 'row-fluid';
                         if ($start === "true") {
                             if ($jw_startPrinted) {
                                 $layoutsEcho .= '</div>';
                             }
                             $jw_startPrinted = true;
                             $layoutsEcho .= '<div class="' . $rowClass . '">';
                         }
                         $layoutsEcho .= pbGetContentBuilderItem($item_array);
                     }
                     if ($jw_startPrinted) {
                         $layoutsEcho .= '</div>';
                     }
                     $layoutsEcho .= '[/jw_layout]';
                 }
             }
             $layoutsEcho .= '</div></div></div>';
         }
         if ($prllx) {
             add_action('wp_footer', 'jw_parallax_script');
         }
         if ($endPrint) {
             echo $layoutsEcho;
         } else {
             return false;
         }
     }
     $output = ob_get_clean();
     return $output;
 }
Example #9
0
 function pbTemplateGet()
 {
     if (isset($_REQUEST['template_name'])) {
         $response = '';
         $templates_array = get_option('jw_pb_' . strtolower(THEMENAME) . '_templates', array());
         $currTemplate = get_option('jw_pb_' . strtolower(THEMENAME) . '_templates_' . $_REQUEST['template_name'], false);
         if (isset($templates_array[$_REQUEST['template_name']]) && $currTemplate !== false) {
             $response .= '<div class="data">';
             $response .= '<div class="content">' . rawUrlDecode($currTemplate) . '</div>';
             $response .= '</div>';
         } else {
             $response .= '<div class="error">' . __('Template name not exsist', 'ewebcraft') . '</div>';
         }
         die('<div class="response">' . $response . '</div>');
     }
 }