Beispiel #1
0
     $data["button"]["fck"] = '1';
     break;
 case "we_product":
     $data["one"]["detail"] = explode('|__|', $data["one"]["detail"]);
     $data["one"]["name"] = explode('|__|', $data["one"]["name"]);
     $data["uploadfilemax"] = 4 - $data_pic_count;
     //圖檔上傳上限
     $data["button"]["name"] = '名稱';
     $data["button"]["change_detail"] = '子項說明';
     break;
 case "product":
     $data["button"]["file"] = 1;
     //$data["button"]["size"]["name"] = 'size_name';
     //$data["button"]["size"]["value"] = 'size_value';
     $data["pic_size_title"] = '330*330';
     $detail = explode('|__|', deQuotes(@$data["one"]["detail"], -1));
     $data["uploadfilemax"] = 1 - $data_pic_count;
     //圖檔上傳上限
     if ($data["one"]["title_pic"] != NULL || $data["one"]["title_pic"] != "") {
         $data["order_html"] .= '<tr><td align="right">列表圖片<br>建議220*165大小:</td><td><img id="title_pic" src="' . $cpos["file_url"] . $data["one"]["title_pic"] . '"> <a href="javascript:$(\'#title_pic\').parent().append(\'<input type=file name=title_pic>\');$(\'#title_pic\').parent().find(\'img,a\').remove();">[刪除圖片]</a></td></tr>';
     } else {
         $data["order_html"] .= '<tr><td align="right">列表圖片<br>建議220*165大小:</td><td><input type="file" name="title_pic"></td></tr>';
     }
     $data["order_html"] .= '<tr><td align="right">產品分類:</td><td>' . create_select("class", $aa, $data["one"]["class"], $product_class, "根目錄") . '</td></tr>';
     $data["order_html"] .= '<tr><td align="right">上版說明:</td><td>' . Fck("detail[0]", '90%', '450', '../fckeditor/', $detail[0]) . '</td></tr>';
     $data["order_html"] .= '<tr><td align="right">產品說明:</td><td>' . Fck("detail[1]", '90%', '450', '../fckeditor/', $detail[1]) . '</td></tr>';
     break;
 case "news":
     $data["close"]["pic"] = '1';
     $data["button"]["detail"] = '1';
     $data["button"]["fck"] = '1';
Beispiel #2
0
 function order_mail_send($pay_bill, $callback = NULL)
 {
     global $mail;
     //-smtp
     global $smtp_set;
     //-smtp資料設定
     global $web_set;
     global $tpl;
     //-樣板
     global $lang;
     //-語系
     //網站設定 $web_set
     $sql = " select * from " . PREFIX . "setting WHERE lang = '" . quotes($lang) . "' order by id";
     $tmp = $this->conn->GetArray($sql);
     $web_set["title"] = deQuotes($tmp["0"]["detail"], -1);
     $web_set["keyword"] = deQuotes($tmp["1"]["detail"], -1);
     $web_set["receive_email"] = $tmp["2"]["detail"];
     $web_set["send_email"] = $tmp["4"]["detail"];
     $web_set["favorite_url"] = "http://" . $_SERVER["HTTP_HOST"];
     //--前段網址取得
     $temp = explode('/', substr($_SERVER['PHP_SELF'], 1));
     $temp_url = explode('/', $_SERVER['SERVER_PROTOCOL']);
     $temp_url = $temp_url[0] . '://' . $_SERVER["HTTP_HOST"] . '/';
     if (count($temp) > 1) {
         for ($i = 0; $i < count($temp) - 1; $i++) {
             $temp_url .= $temp[$i] . '/';
         }
     }
     //--資料載入
     $data["order"] = $pay_bill;
     $data["pro_title"] = array('購物編號', '商品名稱', '數量', '單價');
     $data["pro"] = $this->car_list($pay_bill["id"]);
     if ($data["pro"]) {
         foreach ($data["pro"] as $k => $v) {
             $data["pro"][$k]["img_html"] = '<img src="' . $temp_url . 'upload/products/' . $v["pic"][0] . '" url="' . $temp_url . 'upload/products/' . $v["pic"][0] . '" width="100" height="75" />';
         }
     }
     //--郵件上下版訊息
     if ($this->order_mail_msg_top != NULL) {
         $data["msg"]["top_msg"] = $this->order_mail_msg_top[$pay_bill["paycardmode"]];
         $data["msg"]["top_msg"] = $this->data_mail_insert($pay_bill, $data["msg"]["top_msg"]);
     }
     if ($this->order_mail_msg_foot != NULL) {
         $data["msg"]["foot_msg"] = $this->order_mail_msg_foot[$pay_bill["paycardmode"]];
         $data["msg"]["foot_msg"] = $this->data_mail_insert($pay_bill, $data["msg"]["foot_msg"]);
     }
     if ($this->order_mail_title != NULL) {
         $subject = $this->order_mail_title[$pay_bill["paycardmode"]];
         $subject = $this->data_mail_insert($pay_bill, $subject);
     } else {
         $subject = $web_set["title"] . ' 訂單確認信件';
     }
     ob_start();
     //打開快取
     $tpl->assign("data", $data);
     $tpl->display($this->order_template);
     $cache_string = ob_get_contents();
     //接收快取頁面
     ob_end_clean();
     //關閉快取
     //--寫入發送次數
     $this->conn->Execute("UPDATE " . $this->table . " SET ismailsend=ismailsend+1 where id='" . $pay_bill["id"] . "'");
     //---關閉錯誤訊息
     $mail->SMTPDebug = false;
     $mail->do_debug = 0;
     $mail->From = $web_set["send_email"];
     // 設定寄件者信箱
     $mail->AddAddress($pay_bill["recive_email"]);
     $mail->FromName = $web_set["title"];
     // 設定寄件者姓名
     $mail->Subject = ($pay_bill['ismailsend'] * 1 > 0 ? "(補發)" : "") . $subject;
     // 設定郵件標題
     $mail->Body = $cache_string;
     $mail->Send();
     //--分開寄送給管理者
     $mail->ClearAddresses();
     $temp_mail = explode(',', $web_set["receive_email"]);
     foreach ($temp_mail as $k => $v) {
         $mail->AddAddress($v);
     }
     if ($mail->Send()) {
         //已寄送訂單內容至郵件中
         if ($callback) {
             echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . "<script>alert('" . $this->tags('ORDER_PAYBILL_MAIL_MESG') . "!!');window.location.href='" . $callback . "';</script>";
         }
     } else {
         print_r($smtp_set["detail"]);
         exit;
     }
 }
Beispiel #3
0
function Ckedit($name, $value, $style = 'normal', $bodyclass = '')
{
    $tmp = '<textarea id="' . $name . '" name="' . $name . '" editor="' . $style . '" cols="1" rows="1" bodyclass="' . $bodyclass . '">' . deQuotes($value, -1) . '</textarea>';
    $tmp .= "\n\t<script>\n\tCKEDITOR.replace( '" . $name . "',\n\t{\n\t\tfilebrowserBrowseUrl : '../ckfinder/ckfinder.html',\n\t\tfilebrowserImageBrowseUrl : '../ckfinder/ckfinder.html?type=Images',\n\t\tfilebrowserFlashBrowseUrl : '../ckfinder/ckfinder.html?type=Flash',\n\t\tfilebrowserUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',\n\t\tfilebrowserImageUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',\n\t\tfilebrowserFlashUploadUrl : '../ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash'\n\t});\n\t</script>";
    return $tmp;
}
Beispiel #4
0
    $conn->Execute("UPDATE " . $cpos["table"] . " SET cargo_date='" . date('Y-m-d H:i:s') . "' WHERE id ='" . $befo_data["id"] . "'");
    /*出貨信件內容*/
    $mail_data = $conn->GetRow("select * from " . PREFIX . "data_list where type='cargomail' and status=1 and new_type='" . $befo_data["paycardmode"] . "'");
    if ($mail_data) {
        $mailbody = dequotes($mail_data["detail"], -1);
        $mailbody = data_mail_insert($befo_data, $mailbody);
        $subject = data_mail_insert($befo_data, $mail_data["name"]);
    } else {
        $mailbody = $befo_data['recive_name'] . ' 您好,訂單編號[' . $befo_data['order_no'] . '] 已被管理者異動為已出貨,特此通知';
        $subject = $web_set["title"] . ' 訂單狀態異動信件';
    }
    //網站設定 $web_set
    $sql = " select * from " . PREFIX . "setting WHERE lang = '" . quotes($lang) . "' order by id";
    $tmp = $conn->GetArray($sql);
    $web_set["title"] = deQuotes($tmp["0"]["detail"], -1);
    $web_set["keyword"] = deQuotes($tmp["1"]["detail"], -1);
    $web_set["receive_email"] = $tmp["2"]["detail"];
    $web_set["default_email_title"] = $tmp["3"]["detail"];
    $web_set["send_email"] = $tmp["4"]["detail"];
    $web_set["favorite_url"] = "http://" . $_SERVER["HTTP_HOST"];
    $mail->From = $web_set["send_email"];
    // 設定寄件者信箱
    $mail->AddAddress($befo_data["recive_email"]);
    $mail->FromName = $web_set["title"];
    // 設定寄件者姓名
    $mail->Subject = $subject;
    // 設定郵件標題
    $mail->Body = $mailbody;
    $mail->Send();
}
//--刪除時一併移除訂單商品資料
Beispiel #5
0
        }
    }
    //--webini寫入
    if ($_SESSION["web_ini_time"]) {
        $_SESSION["web_ini_time"] -= 600;
    }
    write_php_ini($ini_webset, APP_PATH . "includes/config/web_set.ini");
    //寫入大小現
    alert("修改完成", Page_get_url(''));
    exit;
}
$sql .= " 1=1 ";
$data["list"] = $conn->GetArray($sql);
foreach ($data["list"] as $k => $v) {
    foreach ($v as $k2 => $v2) {
        $data["list"][$k][$k2] = deQuotes($v2, -1);
        $data["list"][$k]["no"] = $k + 1;
    }
}
//------------資料庫備份與還原
$file_url = $conn->GetRow("select * from " . PREFIX . "setting WHERE lang='" . quotes($record["lang"]) . "' and type='backup'");
$data["file_url"] = $file_url["detail"];
//---目錄檔案讀取
if (is_dir($data["file_url"])) {
    //檢查是否是目錄
    if ($dh = opendir($data["file_url"])) {
        //打開目錄
        while (($file = readdir($dh)) !== false) {
            //$file = 檔名+副檔名
            //第一個跟第二個檔名是 .. 及 .
            if ($file != '..' && $file != '.') {
Beispiel #6
0
// 建立新物件
$mail->IsHTML(true);
// 設定郵件內容為HTML
$mail->CharSet = "utf-8";
// 設定郵件編碼
$mail->Encoding = "base64";
$mail->WordWrap = 50;
// 每50個字元自動斷行
$smtp_set = $conn->GetRow("select * from " . PREFIX . "data_list where type='smtp_mail' and status=1");
//--啟用 SMTP模式
if ($smtp_set) {
    //--網站設定
    $sql = " select * from " . PREFIX . "setting WHERE lang = '" . quotes($lang) . "' order by id";
    $tmp = $conn->GetArray($sql);
    $web_set["all"] = $tmp;
    $web_set["title"] = deQuotes($tmp["0"]["detail"], -1);
    $web_set["send_email"] = $tmp["4"]["detail"];
    $smtp_set["detail"] = explode('|__|', $smtp_set["detail"]);
    $mail->IsSMTP();
    // 設定使用SMTP方式寄信
    $mail->SMTPAuth = true;
    // 設定SMTP需要驗證
    if ($smtp_set["detail"][0]) {
        $mail->SMTPSecure = $smtp_set["detail"][0];
    }
    // Gmail的SMTP主機需要使用SSL連線
    $mail->Host = $smtp_set["detail"][1];
    // Gmail的SMTP主機
    $mail->Port = $smtp_set["detail"][2] * 1;
    // Gmail的SMTP主機的port為465
    $mail->Username = $smtp_set["detail"][3];
Beispiel #7
0
function display_tree($root, $db, $table, $start = 0, $count = 0, $where_sql = "", $total_data = "")
{
    //初始化
    if ($count == 0) {
        $limit_sql = "";
    } else {
        $limit_sql = "limit {$start},{$count}";
    }
    //若沒有條件式,則抓傳進來的id為根目錄
    if ($where_sql == "") {
        $where_sql = " and  root_id='" . $root . "' ";
    }
    //參數設定
    $data = array();
    //回傳資料
    //尋找根節點的左、右兩測值
    $sql = "SELECT lft, rgt, depth FROM " . $table . " WHERE id='" . $root . "'";
    $rs = $db->Execute($sql);
    if (!$rs) {
        Error($db);
    }
    $row = $rs->FetchRow();
    //抓取總數
    $sql = "SELECT count(*) as total_count FROM " . $table . "  \n         WHERE lft BETWEEN " . $row['lft'] . " AND " . $row['rgt'] . " AND root_id='" . $root . "' AND id <> " . $root . " " . $where_sql . " ORDER BY lft ASC,sort ASC ";
    $all_total = $db->GetRow($sql);
    //開始走訪相關節點
    $sql = "SELECT * FROM " . $table . "  \n         WHERE lft BETWEEN " . $row['lft'] . " AND " . $row['rgt'] . " AND root_id='" . $root . "' AND id <> " . $root . " " . $where_sql . " ORDER BY lft ASC,sort ASC " . $limit_sql;
    $rs = $db->Execute($sql);
    //if(!$rs)Error($db);
    //開始抓資料
    $i = 0;
    if ($rs) {
        while ($row = $rs->FetchRow()) {
            //不抓根資料
            if ($row["id"] != $root) {
                //啟動總數配對
                if ($total_data != "") {
                    for ($j = 0; $j < count($total_data); $j++) {
                        //找到配對將總數丟出
                        if ($total_data[$j]["parent_id"] == $row["parent_id"]) {
                            $row["total"] = $total_data[$j]["total"];
                            break;
                        }
                    }
                }
                $row["all_total"] = $all_total["total_count"];
                $row["show_text"] = str_repeat('&nbsp;', ($row["depth"] - 1) * 6) . deQuotes($row['name']);
                //顯示用title(縮排)
                $row["space"] = str_repeat('&nbsp;', ($row["depth"] - 1) * 6);
                //顯示空白
                $data[$i] = $row;
                //將所有資料紀錄傳出
                $i++;
            }
        }
    }
    //print_r($data);
    return $data;
}