示例#1
0
 function execute($params)
 {
     if ($params->check("value") && $params->check("key")) {
         $post = Vizualizer::request();
         $post->set($params->get("key"), $params->get("value"));
     }
 }
示例#2
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if ($post[$params->get("key")] != $post[$params->get("key2")]) {
         throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "の入力内容が一致しません。"));
     }
 }
示例#3
0
 protected function executeImpl($type, $name, $key)
 {
     $post = Vizualizer::request();
     if ($post["delete"]) {
         // サイトデータを取得する。
         $loader = new Vizualizer_Plugin($type);
         $model = $loader->loadModel($name);
         $model->findByPrimaryKey($post[$key]);
         // データが検索された場合のみ削除処理を実施
         if ($model->{$key} > 0) {
             // トランザクションデータベースの取得
             $connection = Vizualizer_Database_Factory::begin(strtolower($type));
             try {
                 $model->delete();
                 // エラーが無かった場合、処理をコミットする。
                 Vizualizer_Database_Factory::commit($connection);
                 // 画面をリロードする。
                 if (!$this->continue) {
                     // 登録に使ったキーを無効化
                     $this->removeInput("delete");
                     $this->removeInput($key);
                     $this->reload();
                 }
             } catch (Exception $e) {
                 Vizualizer_Database_Factory::rollback($connection);
                 throw new Vizualizer_Exception_Database($e);
             }
         }
     }
 }
示例#4
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if ((!isset($post[$params->get("key")]) || $post[$params->get("key")] == "") && empty($errors[$params->get("key")])) {
         throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "が未入力です。"));
     }
 }
示例#5
0
 function execute($params)
 {
     // 実行時間制限を解除
     ini_set("max_execution_time", 0);
     // リクエストを取得
     $post = Vizualizer::request();
     $images = array();
     if (is_array($_FILES) && is_array($_FILES['file'])) {
         if ($params->check("path")) {
             $saveDir = VIZUALIZER_SITE_ROOT . $params->get("path");
         } else {
             $saveDir = Vizualizer_Configure::get("upload_root") . "/images/" . sha1("site" . Vizualizer_Configure::get("site_id")) . "/file/";
         }
         $saveFile = uniqid("DZ-");
         $info = pathinfo($_FILES['file']['name']);
         $saveFile .= "." . $info["extension"];
         if (!file_exists($saveDir)) {
             mkdir($saveDir, 0777, true);
         }
         move_uploaded_file($_FILES['file']['tmp_name'], $saveDir . "/" . $saveFile);
         ob_end_clean();
         if ($params->get("type", "path") == "base") {
             echo $saveFile;
         } else {
             echo str_replace(VIZUALIZER_SITE_ROOT, VIZUALIZER_SUBDIR, $saveDir . "/" . $saveFile);
         }
         exit;
     }
 }
示例#6
0
 public function fetch($template, $cache_id = null, $compile_id = null, $parent = null, $display = false)
 {
     $attributes = Vizualizer::attr();
     // 標準で使用できるパラメータを登録
     $templateEngine = $attributes["template"];
     $templateEngine->assign("configure", Vizualizer_Configure::values());
     $templateEngine->assign("post", Vizualizer::request());
     $templateEngine->assign("attr", $attributes);
     $templateEngine->assign("session", Vizualizer_Session::values());
     $templateEngine->assign("sessionName", session_name());
     $templateEngine->assign("sessionId", session_id());
     // リソースの利用を判定
     $prefix = substr($template, 0, strpos($template, ":"));
     if (ctype_alpha($prefix) && $prefix != "file") {
         return $this->core->fetch($template, $cache_id, $compile_id, $parent, $display);
     } else {
         if (file_exists(Vizualizer_Configure::get("site_home") . $attributes["userTemplate"] . "/" . $template)) {
             return $this->core->fetch($template, $cache_id, $compile_id, $parent, $display);
         } elseif (file_exists(Vizualizer_Configure::get("site_home") . $attributes["userTemplate"] . "/err404.html")) {
             return $this->core->fetch("err404.html", $cache_id, $compile_id, $parent, $display);
         } else {
             header("HTTP/1.0 404 Not Found");
             echo "ファイルが存在しません。";
             exit;
         }
     }
 }
示例#7
0
 function execute($params)
 {
     if ($params->check("target") && $params->check("result")) {
         $post = Vizualizer::request();
         $post->set($params->get("result"), $post[$params->get("target")]);
     }
 }
示例#8
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if ($params->check("key") && is_array($post[$params->check("key")])) {
         $post->set($params->get("key"), implode($params->get("delimiter"), $post[$params->check("key")]));
     }
 }
示例#9
0
 function execute($params)
 {
     // 実行時間制限を解除
     ini_set("max_execution_time", 0);
     // リクエストを取得
     $post = Vizualizer::request();
     $images = array();
     if (is_array($_FILES)) {
         foreach ($_FILES as $key1 => $upload) {
             if ($_FILES[$key1]["error"] == 0) {
                 $this->debug(var_export($_FILES, true));
                 // 保存先のディレクトリを構築
                 $saveDir = Vizualizer_Configure::get("upload_root") . "/images/" . sha1("site" . Vizualizer_Configure::get("site_id")) . "/" . $key1 . "/";
                 if (!file_exists($saveDir)) {
                     mkdir($saveDir, 0777, true);
                 }
                 // 保存するファイル名を構築
                 $info = pathinfo($_FILES[$key1]["name"]);
                 $saveFile = sha1(uniqid($_FILES[$key1]["name"])) . (!empty($info["extension"]) ? "." . $info["extension"] : "");
                 // 保存するファイルを移動
                 move_uploaded_file($_FILES[$key1]["tmp_name"], $saveDir . $saveFile);
                 // 登録した内容をPOSTに設定
                 $post->set($key1 . "_name", $_FILES[$key1]["name"]);
                 $post->set($key1, str_replace(VIZUALIZER_SITE_ROOT, VIZUALIZER_SUBDIR, $saveDir . $saveFile));
             }
         }
         if ($params->check("reload")) {
             $this->reload($params->get("reload"));
         }
     }
 }
示例#10
0
 function execute($params)
 {
     // パラメータを調整
     $post = Vizualizer::request();
     $month = $post["ym"];
     if (empty($month) || preg_match("/[0-9]{4}-[0-9]{2}/", $month) == 0) {
         $month = date("Y-m");
     }
     // クエリを生成
     $loader = new Vizualizer_Plugin("stock");
     $orders = $loader->loadTable("Orders");
     $select = new Vizualizer_Query_Select($orders);
     $select->addColumn("SUBSTR(" . $orders->order_date . ", 1, 10)", "order_date");
     $select->addColumn("SUM(" . $orders->price . ")", "price");
     $select->where("order_date LIKE ?", array($month . "-%"));
     $select->group("SUBSTR(" . $orders->order_date . ", 1, 10)");
     // 生成したクエリに対して検索を実行し、結果をモデルとして取得
     $order = $loader->loadModel("Order");
     $orders = $order->queryAllBy($select);
     // 結果を属性に設定
     $attr = Vizualizer::attr();
     $attr["sales"] = $orders;
     $attr["thismonth"] = date("Y-m-01", strtotime($month . "-01"));
     $attr["nextmonth"] = date("Y-m", strtotime("+1 month", strtotime($month . "-01")));
     $attr["lastmonth"] = date("Y-m", strtotime("-1 month", strtotime($month . "-01")));
 }
示例#11
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if (!empty($post[$params->get("key")]) && !ctype_digit($post[$params->get("key")])) {
         throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "は半角数値で入力してください。"));
     }
 }
示例#12
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if (!empty($post[$params->get("key")])) {
         if (preg_match("/^[a-zA-Z0-9!\$&*.=^`|~#%'+\\/?_{}-]+@([a-zA-Z0-9_-]+\\.)+[a-zA-Z]{2,}\$/", $post[$params->get("key")]) == 0) {
             throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "は正しいメールアドレスではありません。"));
         }
     }
 }
示例#13
0
 function execute($params)
 {
     $post = Vizualizer::request();
     if (!empty($post[$params->get("key")])) {
         if (Vizualizer::now()->getTime() < strtotime($post[$params->get("key")])) {
             throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "は未来の日付です。"));
         }
     }
 }
示例#14
0
 function execute($params)
 {
     $post = Vizualizer::request();
     $extra = "";
     if ($params->get("space", "0") == "1") {
         $extra = "  ";
     }
     if (!empty($post[$params->get("key")]) && preg_match("/^[ァ-ヶー" . $extra . "]+\$/u", $post[$params->get("key")]) == 0) {
         throw new Vizualizer_Exception_Invalid($params->get("key"), $params->get("value") . $params->get("suffix", "はカタカナで入力してください。"));
     }
 }
/**
 * Smarty {end_session} function plugin
 *
 * Type: function<br>
 * Name: end_session<br>
 * Purpose: end session module.<br>
 *
 * @author Naohisa Minagawa <minagawa at web-life dot co dot jp>
 * @param array $params parameters
 * @param object $smarty Smarty object
 * @param object $template template object
 * @return string null
 */
function smarty_function_end_session($params, $template)
{
    // テンプレートに各種変数を割り当て
    $attr = Vizualizer::attr();
    $template = $attr["template"];
    $template->assign("configure", Vizualizer_Configure::values());
    $template->assign("post", Vizualizer::request());
    $template->assign("attr", $attr);
    $template->assign("sessionName", session_name());
    $template->assign("sessionId", session_id());
    Vizualizer_Logger::writeDebug("Page Session Ended.");
}
示例#16
0
 function execute($params)
 {
     // リクエストを取得
     $post = Vizualizer::request();
     if ($params->check("key") || $params->check("address")) {
         $address = $params->get("address", $post[$params->get("key")]);
         $geocoder = new Vizualizer_Geocoding_Google("ja");
         $data = $geocoder->getAddressData($address);
         $attr = Vizualizer::attr();
         $attr[$params->get("result", "geocodes")] = $data["results"];
     }
 }
示例#17
0
/**
 * Smarty {input} modifier plugin
 *
 * Type: modifier<br>
 * Name: input<br>
 * Purpose: modify value prefer input<br>
 *
 * @author Naohisa Minagawa <minagawa at web-life dot co dot jp>
 * @param array $params parameters
 * @param object $smarty Smarty object
 * @param object $template template object
 * @return string null
 */
function smarty_modifier_input($value, $key, $subkey = "")
{
    $post = Vizualizer::request();
    if ($value === null || $value === "" || isset($post[$key])) {
        if ($subkey != "" && is_array($post[$key])) {
            return $post[$key][$subkey];
        } else {
            return $post[$key];
        }
    }
    return $value;
}
示例#18
0
 function execute($params)
 {
     if ($params->check("key")) {
         $post = Vizualizer::request();
         if (!is_array($post[$params->get("key")])) {
             if ($params->check("delimiter") && !empty($post[$params->get("key")])) {
                 $post->set($params->get("key"), explode($params->get("delimiter"), $post[$params->get("key")]));
             } else {
                 $post->set($params->get("key"), array());
             }
         }
     }
 }
示例#19
0
 function execute($params)
 {
     $this->executeImpl("Stock", "Menu", "menu_id");
     $post = Vizualizer::request();
     $loader = new Vizualizer_Plugin("stock");
     $model = $loader->loadModel("Menu");
     $model->findByPrimaryKey($post["menu_id"]);
     if ($model->menu_id > 0 && $model->fixed_flg == "1") {
         $orderDetail = $loader->loadModel("OrderDetail");
         $orderDetails = $orderDetail->findAllBy(array("set_id" => $model->set_id, "choice_id" => $model->choice_id, "ne:provision_flg" => "1"));
         foreach ($orderDetails as $orderDetail) {
             $orderDetail->provision();
         }
     }
 }
示例#20
0
 function execute($params)
 {
     $post = Vizualizer::request();
     $attr = Vizualizer::attr();
     $errors = $attr[Vizualizer::ERROR_KEY];
     if (!empty($errors) && ($params->check("url") || $params->check("urlkey"))) {
         VizualizerSession::set("LAST_ERRORS", array(Vizualizer::ERROR_KEY => $errors, Vizualizer::INPUT_KEY => $post));
         if ($params->check("url")) {
             header("Location: " . $params->get("url"));
             exit;
         } else {
             header("Location: " . $post[$params->get("urlkey")]);
             exit;
         }
     }
 }
示例#21
0
 protected function executeImpl($type, $name, $primary_key)
 {
     $post = Vizualizer::request();
     if ($post["add"] || $post["save"]) {
         // サイトデータを取得する。
         $loader = new Vizualizer_Plugin($type);
         $model = $loader->loadModel($name);
         if (!empty($post[$this->key_prefix . $primary_key])) {
             $model->findByPrimaryKey($post[$this->key_prefix . $primary_key]);
             if (!($model->{$primary_key} > 0)) {
                 $model = $loader->loadModel($name, array($primary_key => $post[$this->key_prefix . $primary_key]));
             }
         }
         foreach ($post as $key => $value) {
             if (!empty($this->key_prefix)) {
                 if (substr($key, 0, strlen($this->key_prefix)) == $this->key_prefix) {
                     $key = preg_replace("/^" . $this->key_prefix . "/", "", $key);
                     $model->{$key} = $value;
                 }
             } else {
                 $model->{$key} = $value;
             }
         }
         // トランザクションの開始
         $connection = Vizualizer_Database_Factory::begin(strtolower($type));
         try {
             $model->save();
             if (!empty($this->key_prefix)) {
                 $post->set($this->key_prefix . $primary_key, $model->{$primary_key});
             } else {
                 $post->set($primary_key, $model->{$primary_key});
             }
             // エラーが無かった場合、処理をコミットする。
             Vizualizer_Database_Factory::commit($connection);
             // 画面をリロードする。
             if (!$this->continue) {
                 // 登録に使用したキーを無効化
                 $this->removeInput("add");
                 $this->removeInput("save");
                 $this->reload();
             }
         } catch (Exception $e) {
             Vizualizer_Database_Factory::rollback($connection);
             throw new Vizualizer_Exception_Database($e);
         }
     }
 }
/**
 * Smarty {start_session} function plugin
 *
 * Type: function<br>
 * Name: start_session<br>
 * Purpose: start session module.<br>
 *
 * @author Naohisa Minagawa <minagawa at web-life dot co dot jp>
 * @param array $params parameters
 * @param object $smarty Smarty object
 * @param object $template template object
 * @return string null
 */
function smarty_function_start_session($params, $template)
{
    // POSTにINPUT=NEWが渡った場合は、入力をクリアする。
    $post = Vizualizer::request();
    /*
     * $inputData = Vizualizer_Session::get(Vizualizer::INPUT_KEY); if
     * (is_array($inputData)) { if (array_key_exists(TEMPLATE_DIRECTORY,
     * $inputData)) { if (isset($post["INPUT"]) && $post["INPUT"] == "NEW") {
     * unset($inputData[TEMPLATE_DIRECTORY]); } //
     * INPUT_DATAのセッションの内容をPOSTに戻す。(POST優先) if
     * (is_array($inputData[TEMPLATE_DIRECTORY])) { foreach
     * ($inputData[TEMPLATE_DIRECTORY] as $key => $value) { if
     * (!isset($post[$key])) { $post[$key] = $value; } } } }
     * Vizualizer_Session::set(Vizualizer::INPUT_KEY, $inputData); }
     */
    Vizualizer_Logger::writeDebug("Page Session Started.");
}
示例#23
0
 function execute($params)
 {
     if ($params->check("result")) {
         $post = Vizualizer::request();
         if ($params->check("parent")) {
             $parent = $post[$params->get("parent")];
             if (empty($parent[$params->get("result")])) {
                 $parent[$params->get("result")] = Vizualizer::now()->date($params->get("format", "Y-m-d"));
                 $post->set($params->get("parent"), $parent);
             }
         } else {
             if (empty($post[$params->get("result")])) {
                 $post->set($params->get("result"), Vizualizer::now()->date($params->get("format", "Y-m-d")));
             }
         }
     }
 }
示例#24
0
 function execute($params)
 {
     $post = Vizualizer::request();
     $attr = Vizualizer::attr();
     if ($params->check("daily")) {
         $search = $post["search"];
         if (empty($search["pre:order_date"])) {
             $search["pre:order_date"] = date("Y-m-d");
             $post->set("search", $search);
         }
         $attr["thisday"] = date("Y-m-d", strtotime($search["pre:order_date"]));
         $attr["lastday"] = date("Y-m-d", strtotime("-1 day", strtotime($attr["thisday"])));
         $attr["nextday"] = date("Y-m-d", strtotime("+1 day", strtotime($attr["thisday"])));
     }
     $loader = new Vizualizer_Plugin("stock");
     $model = $loader->loadModel("Order");
     $attr["total"] = $model->summeryBy("price", $post["search"]);
     $this->executeImpl($params, "Stock", "Order", $params->get("result", "orders"));
 }
示例#25
0
 function execute($params)
 {
     $post = Vizualizer::request();
     $errors = array();
     $result = "";
     if ($params->check("year") && isset($post[$params->get("year")]) && is_numeric($post[$params->get("year")]) && $params->check("month") && isset($post[$params->get("month")]) && is_numeric($post[$params->get("month")]) && $params->check("day") && isset($post[$params->get("day")]) && is_numeric($post[$params->get("day")])) {
         $result .= sprintf("%04d", $post[$params->get("year")]);
         $result .= "-";
         $result .= sprintf("%02d", $post[$params->get("month")]);
         $result .= "-";
         $result .= sprintf("%02d", $post[$params->get("day")]);
         if (Vizualizer::now()->strToTime($result)->date("Y-m-d") != $result) {
             throw new Vizualizer_Exception_Invalid($params->get("result"), $params->get("result_name") . $params->get("suffix", "は日付の指定が正しくありません。"));
         }
         if ($params->check("hour") && isset($post[$params->get("hour")]) && is_numeric($post[$params->get("hour")]) && $params->check("minute") && isset($post[$params->get("minute")]) && is_numeric($post[$params->get("minute")])) {
             if (!empty($post[$params->get("result")])) {
                 $post[$params->get("result")] .= " ";
             }
             $result .= sprintf("%02d", $post[$params->get("hour")]);
             $result .= ":";
             $result .= sprintf("%02d", $post[$params->get("minute")]);
             if (Vizualizer::now()->strToTime($result)->date("Y-m-d H:i") != $result) {
                 throw new Vizualizer_Exception_Invalid($params->get("result"), $params->get("result_name") . $params->get("suffix", "は日付の指定が正しくありません。"));
             }
             if ($params->check("second") && isset($post[$params->get("second")]) && is_numeric($post[$params->get("second")])) {
                 $result .= ":";
                 $result .= sprintf("%02d", $post[$params->get("second")]);
                 if (Vizualizer::now()->strToTime($result)->date("Y-m-d H:i:s") != $result) {
                     throw new Vizualizer_Exception_Invalid($params->get("result"), $params->get("result_name") . $params->get("suffix", "は日付の指定が正しくありません。"));
                 }
             }
         } elseif ($params->check("hourminute") && isset($post[$params->get("hourminute")])) {
             if (!empty($result)) {
                 $result .= " ";
             }
             $result .= $post[$params->get("hourminute")];
             if (Vizualizer::now()->strToTime($result)->date("Y-m-d H:i") != $result) {
                 throw new Vizualizer_Exception_Invalid($params->get("result"), $params->get("result_name") . $params->get("suffix", "は日付の指定が正しくありません。"));
             }
         }
         $post->set($params->get("result"), $result);
     }
 }
示例#26
0
 function execute($params)
 {
     $post = Vizualizer::request();
     $keys = explode(",", $params->get("except", ""));
     // searchとpageIDは常にリセット対象外とする。
     $keys[] = "search";
     $keys[] = "pageID";
     $values = array();
     foreach ($keys as $key) {
         if (isset($post[$key])) {
             $values[$key] = $post[$key];
         }
     }
     $post->clear();
     foreach ($keys as $key) {
         if (array_key_exists($key, $values)) {
             $post->set($key, $values[$key]);
         }
     }
 }
示例#27
0
 function execute($params)
 {
     if ($params->check("result")) {
         // リクエストパラメータを取得
         $post = Vizualizer::request();
         // ユニークコードを取得
         $code = Vizualizer_Data_UniqueCode::get($params->get("prefix", ""));
         // ユニークコードをパラメータに設定
         if ($params->check("parent")) {
             $parent = $post[$params->get("parent")];
             if (empty($parent[$params->get("result")])) {
                 $parent[$params->get("result")] = $code;
                 $post->set($params->get("parent"), $parent);
             }
         } else {
             if (empty($post[$params->get("result")])) {
                 $post->set($params->get("result"), $code);
             }
         }
     }
 }
示例#28
0
 function execute($params)
 {
     if ($params->check("target") && $params->check("result")) {
         $columns = explode(",", $params->get("target"));
         $value = "";
         $post = Vizualizer::request();
         foreach ($columns as $i => $column) {
             if ($i > 0) {
                 $value .= $params->get("delimiter");
             }
             if (is_array($post[$column])) {
                 foreach ($post[$column] as $j => $data) {
                     if ($i > 0 || $j > 0) {
                         $data .= $params->get("delimiter");
                     }
                     $value .= $data;
                 }
             } else {
                 $value .= $post[$column];
             }
         }
         $post->set($params->get("result"), $value);
     }
 }
示例#29
0
 function execute($params)
 {
     $post = Vizualizer::request();
     print_r($post);
 }
示例#30
0
 protected function executeImpl($params, $type, $name, $defaultSortKey = "create_time")
 {
     $post = Vizualizer::request();
     if (!$params->check("search") || isset($post[$params->get("search")])) {
         $loader = new Vizualizer_Plugin($type);
         // カテゴリが選択された場合、カテゴリの商品IDのリストを使う
         $conditions = array();
         if (is_array($post["search"])) {
             foreach ($post["search"] as $key => $value) {
                 if (!$this->isEmpty($value)) {
                     $conditions[$key] = $value;
                 }
             }
         }
         // 並べ替え順序が指定されている場合に適用
         $sortOrder = "";
         $sortReverse = false;
         if ($params->check("sort_key")) {
             $sortOrder = $post[$params->get("sort_key")];
             if ($this->isEmpty($sortOrder)) {
                 $sortOrder = $defaultSortKey;
                 $sortReverse = true;
             } elseif (strpos($sortOrder, "rev@") === 0) {
                 list($dummy, $sortOrder) = explode("@", $sortOrder);
                 $sortReverse = true;
             }
         }
         $model = $loader->LoadModel($name);
         // 顧客データを検索する。
         if ($this->groupBy) {
             $model->setGroupBy($this->groupBy);
         }
         $result = $model->getAllBy($conditions, $sortOrder, $sortReverse);
         $titles = explode(",", $params->get("titles"));
         $columns = explode(",", $params->get("columns"));
         $basename = uniqid($type . "_" . $name . "_") . ".csv";
         $filename = CLAY_ROOT . DIRECTORY_SEPARATOR . "_uploads" . DIRECTORY_SEPARATOR . $basename;
         if (($fp = fopen($filename, "w+")) !== FALSE) {
             // CSVヘッダを出力
             fwrite($fp, mb_convert_encoding("\"" . implode("\",\"", $titles) . "\"\r\n", "Shift_JIS", "UTF-8"));
             while ($data = $result->next()) {
                 // データが0件以上の場合は繰り返し
                 foreach ($columns as $index => $column) {
                     if ($index > 0) {
                         fwrite($fp, ",");
                     }
                     fwrite($fp, "\"" . mb_convert_encoding($data[$column], "Shift_JIS", "UTF-8") . "\"");
                 }
                 fwrite($fp, "\r\n");
             }
             fclose($fp);
             // 作成したファイルを転送
             $info = parse_url($params->get("url", ""));
             $info["chost"] = $info["host"];
             if ($info["scheme"] == "https") {
                 $info["chost"] = "ssl://" . $info["host"];
                 if (empty($info["port"])) {
                     $info["port"] = "443";
                 }
             } elseif ($info["scheme"] == "http") {
                 if (empty($info["port"])) {
                     $info["port"] = "80";
                 }
             }
             $protocol = $info["scheme"];
             $chost = $info["chost"];
             $host = $info["host"];
             $port = $info["port"];
             if (($fp = fsockopen($chost, $port)) !== FALSE) {
                 $postdata = "";
                 $postdata .= "POST " . $info["path"] . " HTTP/1.0\r\n";
                 $postdata .= "Host: " . $host . "\r\n";
                 $postdata .= "User-Agent: VIZUALIZER-TRANSFER-CALLER\r\n";
                 $data = $params->get("data", "");
                 $data = str_replace("[[filename]]", urlencode($basename), $data);
                 $data = str_replace("[[filepath]]", urlencode($filename), $data);
                 $filesize = filesize($filename);
                 $filecontents = chunk_split(base64_encode(file_get_contents($filename)));
                 $boundary = "TRANSFER-" . sha1(uniqid());
                 $postdata .= "Content-Type: multipart/form-data; boundary=" . $boundary . "\r\n";
                 $postdata2 = "--" . $boundary . "\r\n";
                 $postdata2 .= "Content-Disposition: form-data; name=\"" . $params->get("file_key", "FILE") . "_input\"\r\n";
                 $postdata2 .= "Content-Length: " . strlen($data) . "\r\n";
                 $postdata2 .= "\r\n";
                 $postdata2 .= $data . "\r\n";
                 $postdata2 .= "\r\n--" . $boundary . "\r\n";
                 $postdata2 .= "Content-Type: text/csv\r\n";
                 $postdata2 .= "Content-Disposition: form-data; name=\"" . $params->get("file_key", "FILE") . "\"; filename=\"" . $basename . "\"\r\n";
                 $postdata2 .= "Content-Length: " . strlen($filecontents) . "\r\n";
                 $postdata2 .= "Content-Transfer-Encoding: base64\r\n";
                 $postdata2 .= "\r\n";
                 $postdata2 .= $filecontents;
                 $postdata2 .= "\r\n--" . $boundary . "--";
                 $postdata .= "Content-Length: " . strlen($postdata2) . "\r\n";
                 $postdata .= "\r\n" . $postdata2;
                 echo $postdata;
                 fputs($fp, $postdata);
                 $response = "";
                 while (!feof($fp)) {
                     $response .= fgets($fp, 4096);
                 }
                 fclose($fp);
                 $result = explode("\r\n\r\n", $response, 2);
                 $attr = Vizualizer::attr();
                 $attr["TransferResult"] = $result[1];
             }
         }
     }
 }