public function SARReportAction() { //session_start(); $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- if (empty($_SESSION)) { $pagePath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\index\\login_page.html"; $pageContent = $VTs->GetHtmlContent($pagePath); } else { $mpath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\sar\\report_index.html"; $html = $VTs->GetHtmlContent($mpath); $reportPath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\sar\\report.html"; $report = $VTs->GetHtmlContent($reportPath); $dataArr = ["userName" => $_SESSION["userName"], "report" => $report]; $html = $VTs->ContentReplace($dataArr, $html); $pageContent = $html; } //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("SARController", "SARReportAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function indexAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- if (empty($_SESSION)) { $pagePath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\index\\login_page.html"; $pageContent = $VTs->GetHtmlContent($pagePath); } else { $pagePath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\receipt\\index.html"; $pageContent = $VTs->GetHtmlContent($pagePath); $companyTitlePath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\receipt\\companyTitle.html"; $companyTitle = $VTs->GetHtmlContent($companyTitlePath); $supplyInfoPath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\receipt\\supplyInfo.html"; $supplyInfo = $VTs->GetHtmlContent($supplyInfoPath); $paymentDetialPath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\receipt\\paymentDetial.html"; $paymentDetial = $VTs->GetHtmlContent($paymentDetialPath); $detialListPath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\receipt\\detialList.html"; $detialList = $VTs->GetHtmlContent($detialListPath); //一個索引與內容等同一個 >> str_replace("@@userName@@",$_SESSION["userName"],$pageContent); $dataArr = ["userName" => $_SESSION["userName"], "companyTitle" => $companyTitle, "supplyInfo" => $supplyInfo, "paymentDetial" => $paymentDetial, "detialList" => $detialList]; //內容取代 $pageContent = $VTs->ContentReplace($dataArr, $pageContent); } //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("ReceiptController", "indexAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function indexAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); try { //-----------BI開始------------ //執行查詢 $strSQL = "select * from account"; $data = $VTs->QueryData($strSQL); //debug,印出資料用 $VTs->debug($data); //日期轉換 $date = date("Y-m-d"); $changeDate = $VTs->DateTime("ADyyyyMMdd_RCyyyMMdd", $date); $this->viewContnet['pageContent'] = $changeDate; //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; return new ViewModel($this->viewContnet); }
public function getDBdataAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); try { //-----------BI開始------------ //echo "Receipt getData."; $arr = array(); $arr["status"] = false; if (!empty($_GET)) { //確認所需資料來源 $type = isset($_GET["type"]) ? $_GET["type"] : ""; switch ($type) { case "sulist": $strSQL = "SELECT * FROM `su_supply`"; $data = $VTs->QueryData($strSQL); break; default: $arr["msg"] = "Search type is wrong.\n"; break; } //回傳 if (!empty($data)) { $arr["status"] = true; $arr["data"] = $data; // $arr["msg"] = $strSQL; } else { $arr["msg"] = "Query no data."; // $arr["msg"] = $strSQL; } } else { $arr["msg"] = "Have no parameter to query data."; } $pageContent = $VTs->Data2Json($arr); //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("ReceiptController", "getDataAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function indexAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- //$HeadTitle = $this->getServiceLocator()->get('ViewHelperManager')->get('HeadTitle'); //$VTs->debug($_SESSION); $isLogin = $VTs->CheckLogin(); //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function indexAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- $pathString = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting"; if (empty($_SESSION)) { $pagePath = $pathString . "\\index\\login_page.html"; $pageContent = $VTs->GetHtmlContent($pagePath); } else { $indexPath = $pathString . "\\engineeringManage\\index.html"; $index = $VTs->GetHtmlContent($indexPath); //登入者 $dataArr = ["userName" => $_SESSION["userName"]]; $index = $VTs->ContentReplace($dataArr, $index); //畫面 $engIndexAreaPath = $pathString . "\\engineeringManage\\engIndexArea.html"; $engIndexArea = $VTs->GetHtmlContent($engIndexAreaPath); $engEditAreaPath = $pathString . "\\engineeringManage\\engEditArea.html"; $engEditArea = $VTs->GetHtmlContent($engEditAreaPath); $spaceIndexAreaPath = $pathString . "\\engineeringManage\\spaceIndexArea.html"; $spaceIndexArea = $VTs->GetHtmlContent($spaceIndexAreaPath); $spaceEditAreaPath = $pathString . "\\engineeringManage\\spaceEditArea.html"; $spaceEditArea = $VTs->GetHtmlContent($spaceEditAreaPath); $dataArr = ["eng_index_area" => $engIndexArea, "eng_edit_area" => $engEditArea, "space_index_area" => $spaceIndexArea, "space_edit_area" => $spaceEditArea]; $index = $VTs->ContentReplace($dataArr, $index); $pageContent = $index; } //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("EngineeringmanageController", "indexAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function getInfoHtmlAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- //取得html $mpath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\supply\\info.html"; $html = $VTs->GetHtmlContent($mpath); // $html=''; $pageContent = $html; //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("SupplyController", "getinfohtmlAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function photocountAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- $action = []; $action["status"] = false; if (isset($_GET["datel"])) { $datel = $_GET['datel']; if ($datel == 0) { $datel = date("Y-m-d"); } $strSQL = "\n\t \tSELECT count(t1.uid) AS count\n\t \tFROM qc_checklist AS t1\n\t\t\t\t\tLEFT JOIN el_petition AS t2 ON t2.uid=t1.dataid\n\t\t\t\t\tLEFT JOIN prj_materiel AS t3 ON t2.prj_mid=t3.uid \n\t\t\t\t\tLEFT JOIN prj_materiel_items AS t4 ON t3.uid=t4.prj_mid\n\t\t\t\t\tLEFT JOIN el_materiel AS t5 ON t4.materielid=t5.uid\n\t\t\t\t\tLEFT JOIN img_picture AS t6 ON t1.imgid = t6.uid\n\t\t\t\t\twhere t1.imgid is not null AND t1.typeid=1\n\t\t\t\t\tAND to_days(t1.datec)=to_days('" . $datel . "')\n\t\t\t\t\torder by t1.uid desc;\n\t\t\t\t"; $arr = $VTs->QueryData($strSQL); if ($arr[0]["count"]) { $action["count"] = $arr[0]["count"]; } else { $action["count"] = 0; } $action["status"] = ture; } else { $action["msg"] = "尚未設定日期"; } //-----BI結束----- $pageContent = $VTs->Data2Json($action); } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function editPageAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- $pathString = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting"; if (empty($_SESSION)) { $pagePath = $pathString . "\\index\\login_page.html"; $pageContent = $VTs->GetHtmlContent($pagePath); } else { if (!empty($_POST)) { $apurl = "http://211.21.170.18:99"; //$apurl = "http://127.0.0.1:99"; $action = $_POST["action"]; // echo $action; $editPagePath = $pathString . "\\employeemanage\\newPage.html"; $editPage = $VTs->GetHtmlContent($editPagePath); switch ($action) { case "insertData": $basicInfoPagePath = $pathString . "\\employeemanage\\basicInfo.html"; break; case "updateData": $basicInfoPagePath = $pathString . "\\employeemanage\\basicInfo_edit.html"; break; default: } $basicInfoPage = $VTs->GetHtmlContent($basicInfoPagePath); $addressPagePath = $pathString . "\\employeemanage\\address.html"; $addressPage = $VTs->GetHtmlContent($addressPagePath); $communicationPagePath = $pathString . "\\employeemanage\\communication.html"; $communicationPage = $VTs->GetHtmlContent($communicationPagePath); $dataArr = ["userName" => $_SESSION["userName"], "basicInfo" => $basicInfoPage, "address" => $addressPage, "communication" => $communicationPage]; $editPage = $VTs->ContentReplace($dataArr, $editPage); switch ($action) { case "insertData": $optionData = $VTs->json2data($VTs->UrlDAtaGet($apurl . "/employeemanage/getdata?type=relationOption")); // $VTs->debug($option); $selectElement = "<select id='relation'><option value='0'>-請選擇-</option>"; if (!empty($optionData)) { foreach ($optionData->dataList as $data) { $optionElement = "<option value='" . $data->uid . "'>" . $data->relation . "</option>"; $selectElement .= $optionElement; } } else { // echo "AP Action getdata has problem."; } $selectElement .= "</select>"; //basicInfo $dataArr = ["name" => "", "sid" => "", "birthday" => ""]; $editPage = $VTs->ContentReplace($dataArr, $editPage); //address $dataArr = ["zip" => "", "city" => "", "area" => "", "vil" => "", "verge" => "", "road" => "", "addr" => ""]; $editPage = $VTs->ContentReplace($dataArr, $editPage); //communication $dataArr = ["belong" => "", "relation" => $selectElement, "relation1" => "", "mobile" => "", "tel_h" => "", "tel_o" => "", "tel_ext" => "", "email" => ""]; $editPage = $VTs->ContentReplace($dataArr, $editPage); //function arg $dataArr = ["action" => $action, "uid" => ""]; $editPage = $VTs->ContentReplace($dataArr, $editPage); $pageContent = $editPage; break; case "updateData": $uid = $_POST["uid"]; // echo "uid: ".$uid; $arr = $VTs->json2data($VTs->UrlDataGet($apurl . "/employeemanage/getdata?uid=" . $uid . "")); if ($arr->status) { // $VTs->debug($arr); $optionData = $VTs->json2data($VTs->UrlDAtaGet($apurl . "/employeemanage/getdata?type=relationOption")); $selectElement = "<select id='relation'><option value='0'>-請選擇-</option>"; foreach ($optionData->dataList as $data) { if ($arr->dataList[0]->relation == $data->relation) { $optionElement = "<option value='" . $data->uid . "' selected>" . $data->relation . "</option>"; } else { $optionElement = "<option value='" . $data->uid . "'>" . $data->relation . "</option>"; } $selectElement .= $optionElement; } $selectElement .= "</select>"; //basicInfo $basicDataArr = ["name" => $arr->dataList[0]->name, "sid" => $arr->dataList[0]->sid, "sex" => $arr->dataList[0]->sex, "birthday" => $arr->dataList[0]->birthday]; $editPage = $VTs->ContentReplace($basicDataArr, $editPage); //address $addressDataArr = ["zip" => $arr->dataList[0]->zip, "city" => $arr->dataList[0]->city, "area" => $arr->dataList[0]->area, "vil" => $arr->dataList[0]->vil, "verge" => $arr->dataList[0]->verge, "road" => $arr->dataList[0]->road, "addr" => $arr->dataList[0]->addr]; $editPage = $VTs->ContentReplace($addressDataArr, $editPage); //commonication $communicatonDataArr = ["belong" => $arr->dataList[0]->belong, "relation" => $selectElement, "relation1" => $arr->dataList[0]->relation1, "mobile" => $arr->dataList[0]->mobile, "tel_h" => $arr->dataList[0]->tel_h, "tel_o" => $arr->dataList[0]->tel_o, "tel_ext" => $arr->dataList[0]->tel_ext, "email" => $arr->dataList[0]->email]; $editPage = $VTs->ContentReplace($communicatonDataArr, $editPage); //function arg $dataArr = ["action" => $action, "uid" => ", '" . $uid . "'"]; $editPage = $VTs->ContentReplace($dataArr, $editPage); $pageContent = $editPage; } else { $pageContent = "Query has error!"; } break; default: $pageContent = "EditPage action has error!"; } } } //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("EmployeemanageController", "editPageAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function getpurchaseimgAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- $action = []; $action["status"] = false; if ($_GET["uid"]) { //先取出照片檔名 $strSQL = "select b.imgfile from el_petition as a "; $strSQL .= "left join el_purchase_img as b on a.purchase = b.uid "; $strSQL .= "where a.uid = '" . $_GET["uid"] . "'"; $imgFileData = $VTs->QueryData($strSQL); $imgFileData = $imgFileData[0]["imgfile"]; //CreateDirectory $filePath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\purchase_img\\"; if (file_exists($filePath)) { $filePath .= $imgFileData; $imgArr = $VTs->GetINIInfo($filePath, "", "", "", true); $action["imgs"] = $imgArr; } else { $filePath = str_replace("\\", "/", $filePath); if (file_exists($filePath)) { $filePath .= $imgFileData; $imgArr = $VTs->GetINIInfo($filePath, "", "", "", true); $action["imgs"] = $imgArr; } else { $action["msg"] = 'Can not find img files'; //$action["test"] = $filePath; } } //再取出對應說明 $strSQL = "select uid,img_number,purchase_number,purchase_count from el_purchase where petition_id = '" . $_GET["uid"] . "'"; $imgMemo = $VTs->QueryData($strSQL); $tmpImgMemo = []; foreach ($imgMemo as $content) { $tmpImgMemo[$content["img_number"]] = ["uid" => $content["uid"], "purchase_number" => $content["purchase_number"], "purchase_count" => $content["purchase_count"]]; } $action["imgMemo"] = (object) $tmpImgMemo; //$action["test"] = $strSQL; $action["status"] = true; } else { $action["msg"] = "id or value is empty"; } $pageContent = $VTs->Data2Json($action); //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function exitotherselectitemAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); //-----------BI開始------------ try { $action = []; $action["status"] = false; $petitionlist_id = ""; $strSQL = "select * from el_exit_type where uid not in (3,5) order by uid asc"; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $action["list"] = $data; $action["status"] = true; } else { $action["msg"] = "select item is empty"; } } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } $pageContent = $VTs->Data2Json($action); //-----------BI結束------------ //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function updateDataAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); try { //-----------BI開始------------ $arr = array(); $arr["status"] = false; if (!empty($_POST)) { $table = isset($_POST["table"]) ? $_POST["table"] : ""; switch ($table) { case "eng_type_a": case "eng_type_b": case "eng_type_c": case "eng_type_d": $ori_name = isset($_POST["ori_name"]) ? $_POST["ori_name"] : ""; $code = isset($_POST["code"]) ? $_POST["code"] : ""; $name = isset($_POST["name"]) ? $_POST["name"] : ""; $unit = isset($_POST["unit"]) ? $_POST["unit"] : ""; if ($table != "eng_type_d") { $strSQL = "UPDATE " . $table . "\n\t\t\t\t\t\t\t\t SET name = '" . $name . "'\n\t\t\t\t\t\t\t\t WHERE name = '" . $ori_name . "' AND code = '" . $code . "'"; } else { $strSQL = "UPDATE " . $table . "\n\t\t\t\t\t\t\t\t SET name = '" . $name . "', typeid_u = '" . $unit . "'\n\t\t\t\t\t\t\t\t WHERE name = '" . $ori_name . "' AND code = '" . $code . "'"; } $VTs->ExecuteNonQuery($strSQL); $strSQL = "SELECT * FROM " . $table . " WHERE name = '" . $name . "' AND code = '" . $code . "'"; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $arr["status"] = true; $arr["data"] = $data; } else { $arr["msg"] = "update error."; } break; case "eng_str_b": case "eng_str_e": $ori_code = isset($_POST["ori_code"]) ? $_POST["ori_code"] : ""; $ori_name = isset($_POST["ori_name"]) ? $_POST["ori_name"] : ""; $code = isset($_POST["code"]) ? $_POST["code"] : ""; $name = isset($_POST["name"]) ? $_POST["name"] : ""; $ismodel = isset($_POST["ismodel"]) ? $_POST["ismodel"] : ""; $strSQL = "UPDATE " . $table . " "; if ($table == "eng_str_b") { $strSQL .= "SET code = '" . $code . "', name = '" . $name . "', ismodel = '" . $ismodel . "'"; } else { $strSQL .= "SET code = '" . $code . "', name = '" . $name . "'"; } $strSQL .= "WHERE name = '" . $ori_name . "' AND code = '" . $ori_code . "'"; $VTs->ExecuteNonQuery($strSQL); $arr["updateSQL"] = $strSQL; $strSQL = "SELECT * FROM " . $table . " WHERE code = '" . $code . "' AND name = '" . $name . "'"; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $arr["status"] = true; $arr["msg"] = "修改成功"; } else { $arr["msg"] = "修改失敗"; } break; default: } } $pageContent = $VTs->Data2Json($arr); $this->viewContnet['pageContent'] = $pageContent; //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("EngineeringmanageController", "updateDataAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; return new ViewModel($this->viewContnet); }
public function reportAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(''); try { //-----------BI開始------------ $arr = array(); $arr["status"] = false; // $nowDate = $VTs->DateTime("CTime"); $nowDate = isset($_POST["date"]) ? $_POST["date"] : $VTs->DateTime("CTime"); // $nowDate = "2015-12-02"; $strSQL = "SELECT COUNT(DISTINCT a.suworkid) w_count, b.suid, b.worksid, c.name supply_name, d.name work_type \n\t\t\t\t\t\t\tFROM su_checktime AS a \n\t\t\t\t\t\t\t\tJOIN su_worker AS b ON a.suworkid=b.uid\n\t\t\t\t\t\t\t\tJOIN su_supply AS c ON b.suid=c.uid\n\t\t\t\t\t\t\t\tJOIN su_type_works AS d ON b.worksid=d.uid\n\t\t\t\t\t\t\tWHERE iotime LIKE '" . $nowDate . "%' \n\t\t\t\t\t\t\tGROUP BY b.suid, b.worksid\n\t\t\t\t\t\t\tORDER BY b.worksid"; // echo $strSQL; // exit; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $arr["status"] = true; $arr["data"] = $data; } $pageContent = $VTs->Data2Json($arr); // $pageContent = '[{"w_count":"10","suid":"1","worksid":"2","supply_name":"\u4e1e\u90b5\u71df\u5efa\u5de5\u7a0b\u516c\u53f8","work_type":"\u92fc\u7b4b"}, // {"w_count":"8","suid":"2","worksid":"2","supply_name":"\u6b63\u4e2d\u71df\u5efa\u5de5\u7a0b\u516c\u53f8","work_type":"\u92fc\u7b4b"}, // {"w_count":"5","suid":"2","worksid":"3","supply_name":"\u6b63\u4e2d\u71df\u5efa\u5de5\u7a0b\u516c\u53f8","work_type":"\u6df7\u6ce5\u571f"}, // {"w_count":"20","suid":"1","worksid":"3","supply_name":"\u4e1e\u90b5\u71df\u5efa\u5de5\u7a0b\u516c\u53f8","work_type":"\u6df7\u6ce5\u571f"}]'; //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("SARController", "reportAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function getcphotolisthtmlAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- index QC審查首頁 //取得html // $mpath=dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\qc\\photolist.html"; $trpath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\qc\\cphototr.html"; // $html=$VTs->GetHtmlContent($mpath); $trhtml = $VTs->GetHtmlContent($trpath); //取得qc列表 $data = $_POST["data"]; $arr_list = $data["checklist"]; $apurl = $_POST["apurl"]; //解析列表 $htmlstr = ""; $i = 0; if (!empty($arr_list)) { foreach ($arr_list as $list) { if (!empty($list['imgs'])) { $trs = $trhtml; $trs = str_replace('@@chkdate@@', $list['datec'], $trs); $trs = str_replace('@@d64@@', $list['imgs']['img0'], $trs); $trs = str_replace('@@remark@@', $list['remark'], $trs); $trs = str_replace('@@uid@@', $list['uid'], $trs); $trs = str_replace('@@fl@@', $list['fl'], $trs); $trs = str_replace('@@typec@@', $list['typec'], $trs); $trs = str_replace('@@model@@', $list['model'], $trs); $trs = str_replace('@@area@@', $list['area'], $trs); $trs = str_replace('@@typed@@', $list['typed'], $trs); $htmlstr .= $trs; } } } if ($htmlstr == '') { $htmlstr = '無資料'; } $pageContent = $htmlstr; //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function sendemailAction() { //session_start(); $VTs = new clsSystem(); $VTs->initialization(); try { $data = $_POST['data']; $str = "廠商資訊" . "\n"; $str = "訂單編號:" . 'AA0000' . $data['uid'] . "\n"; $str .= "公司名稱:" . $data['cpname'] . "\n"; $str .= "品項:" . $data['mname'] . "\n"; $str .= "數量:" . $data['count'] . "\n"; $str .= "聯絡人:" . $data['keyman'] . "\n"; $str .= "電話:" . $data['mobile'] . "\n"; $str .= "===========================\n"; $str .= "申請人資訊\n"; $str .= "申請人:" . $data['aname'] . "\n"; $str .= "電話:" . $data['amobile'] . "\n"; $str .= "放置地點:" . $data['place'] . "\n"; $str .= "施作部位:" . $data['place_work'] . "\n"; $str .= "預計進場時間:" . $data['date'] . "\n"; $VTs->Tomail("veracity.core.gmail.com", "*****@*****.**", "訂貨", $str); $html = 'sendEmail'; //印出html $pageContent = $html; //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function getlogoAction() { $VTs = new clsSystem(); $VTs->initialization(); try { //-----BI開始----- $action = array(); $action["status"] = false; if (!empty($_SESSION["uuid"]) and !empty($_SESSION["userName"])) { $logoPath = dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\styles\\logo\\logoContent.html"; $logoStyle = $VTs->GetHtmlContent($logoPath); $action["logoString"] = $logoStyle; $action["status"] = true; } else { $action["msg"] = 'Please Login Again!'; } $pageContent = $VTs->Data2Json($action); //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("PageactionController", "acinfoAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function ListAction() { $VTs = new clsSystem(); $VTs->initialization('oldhouseDB'); try { //-----BI開始----- $strSQL = "SELECT t2.`hname`, t2.`htel`, t2.`hmobil`,\n t2.`ZipCode`, t2.`City`, t2.`Area`, t2.`Vil`, t2.`Verge`, t2.`Road`, t2.`addr`,\n t3.desc 'strType', t4.desc 'scale', t5.desc 'type', t1.date, t8.name 'ename', t7.`licenseid` 'license'\n FROM qc_info AS t1\n LEFT JOIN qc_house AS t2 ON t2.uid = t1.`huid`\n LEFT JOIN house_type AS t3 ON t3.`uid` = t1.htid\n LEFT JOIN house_type_model AS T4 ON t4.uid = t1.`htmid1`\n LEFT JOIN house_type_structure AS t5 ON t5.uid = t1.htsid\n LEFT JOIN `eng_engineer_city` AS t6 ON t6.uid = t2.`ecid`\n LEFT JOIN `eng_engineer` AS t7 ON t7.uid = t6.`eid`\n LEFT JOIN `ass_common` AS t8 ON t8.uid = t7.`cmid`"; $data = $VTs->QueryData($strSQL); //$VTs->Debug($data); //$Path = "D:\\php_dev\\AP-Service\\public\\old_house_pdf\\"; $Path = "..\\old_house_pdf\\"; $link_html = ""; if (!empty($data)) { foreach ($data as $key => $value) { $mainFile = $Path . $value["hname"] . "-" . $value["htel"] . ".pdf"; $imgsFile = $Path . $value["hname"] . "-" . $value["htel"] . "-imgs.pdf"; //$link = $value["hname"]."-".$value["htel"]."<a href = '".$filePath."'>下載PDF</a><br>"; $link = $value["ZipCode"] . $value["City"] . $value["Area"] . $value["Vil"] . $value["Verge"] . $value["Road"] . $value["addr"] . "<a href = '" . $mainFile . "'>下載PDF</a>_<a href = '" . $imgsFile . "'>下載PDF</a><br>"; $link_html .= $link; } } //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $link_html; return new ViewModel($this->viewContnet); }
public function insertDataAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); try { //-----------BI開始------------ //echo "Receipt insertData."; $arr = array(); $arr["status"] = false; if (!empty($_POST)) { $dates = isset($_POST["dates"]) ? $_POST["dates"] : ""; $datee = isset($_POST["datee"]) ? $_POST["datee"] : ""; $amount = isset($_POST["amount"]) ? $_POST["amount"] : ""; $prjid_su = isset($_POST["prjid_su"]) ? $_POST["prjid_su"] : ""; $suid = isset($_POST["suid"]) ? $_POST["suid"] : ""; $date_pay = isset($_POST["date_pay"]) ? $_POST["date_pay"] : ""; //取得目前單號 $date = date("Ym"); $date = substr($date, 1); $strSQL = "SELECT voucher FROM acc_payment WHERE voucher like '%" . $date . "%' ORDER BY uid desc LIMIT 1"; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $voucher = getVoucher($data[0]["voucher"]); } else { $voucher = "A" . $date . "0001"; } //新增資料 $strSQL = "INSERT INTO acc_payment (voucher, dates, datee, amount, prjid_su, suid, date_pay)\n\t\t\t\t\t VALUES ('" . $voucher . "', '" . $dates . "', '" . $datee . "', '" . $amount . "', '" . $prjid_su . "', '" . $suid . "', '" . $date_pay . "')"; $VTs->ExecuteNonQuery($strSQL); //確認是否新增成功 $strSQL = "SELECT * FROM acc_payment WHERE voucher = '" . $voucher . "'"; $data = $VTs->QueryData($strSQL); if (!empty($data)) { $strSQL = "UPDATE acc_schedule\n\t\t\t\t\t\t SET payid = '" . $data[0]["uid"] . " '\n\t\t\t\t\t\t WHERE prjid_su = '" . $data[0]["prjid_su"] . "'"; $VTs->ExecuteNonQuery($strSQL); $arr["status"] = true; } else { $arr["msg"] = "Data does not insert into table."; } } else { $arr["msg"] = "No insert data."; } $pageContent = $VTs->Data2Json($arr); //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("ReceiptController", "insertDataAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function modifytmpuserdataAction() { $VTs = new clsSystem(); $VTs->initialization("tmpCardDB"); try { //-----BI開始----- $action = array(); $action["status"] = false; if ($_POST["uid"]) { $strSQL = "update tc_user_info set user_id = '" . $_POST["user_id"] . "', name = '" . $_POST["name"] . "', company='" . $_POST["company"] . "', phone='" . $_POST["phone"] . "',admin_edit_date='" . $VTs->DateTime("CTime_Now") . "' where uid =" . $_POST["uid"]; $VTs->ExecuteNonQuery($strSQL); $action["status"] = true; } else { $action["msg"] = "id or value is empty"; } $pageContent = $VTs->Data2Json($action); //----BI結束---- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("IndexController", "indexAction", $error->getMessage()); } $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function laborsafetyAction() { //session_start(); $SysClass = new clsSystem(); $SysClass->initialization(); //-----BI開始----- try { // $html_path=dirname(__DIR__) . "\\..\\..\\..\\..\\public\\include\\pageSetting\\logbook\\laborsafety.html"; // $html=$SysClass->GetHtmlContent($html_path); $laborsafety = $_POST['data']; if (empty($laborsafety['dates'])) { if (empty($laborsafety['fifth']) && empty($laborsafety['seventh'])) { $arrdata = ["isnew" => 1, "fifth" => '', "seventh" => '']; } else { $arrdata['isnew'] = 0; if (!empty($laborsafety['fifth'])) { $arrdata['fifth'] = $laborsafety['fifth']['contents']; } else { $arrdata['fifth'] = ''; } if (!empty($laborsafety['seventh'])) { $arrdata['seventh'] = $laborsafety['seventh']['contents']; } else { $arrdata['seventh'] = ''; } } // $html=$SysClass->ContentReplace($arrdata,$html); } else { $html = "主任已確認,資料無法再進行修改"; } // $pageContent = $ // foreach($arr_data as $data) { // $trs=$tr; // $trs=str_replace('@@no@@',$data['no'],$trs); // $trs=str_replace('@@date@@',$data['date'],$trs); // $trs=str_replace('@@uid@@',$data['uid'],$trs); // $trstr.=$trs; // } // $html=str_replace('@@tr@@',$trstr,$html); $pageContent = $html; //-----BI結束----- } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $SysClass->WriteLog("IndexController", "indexAction", $error->getMessage()); } //關閉資料庫連線 $SysClass->DBClose(); //釋放 $SysClass = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }
public function updateDataAction() { $VTs = new clsSystem(); //先初始化 $VTs->initialization(); try { //-----------BI開始------------ $arr = $_POST; $uid = $_GET["uid"]; if (!empty($arr)) { //update basicInfo $strSQL = "UPDATE emp_common \n\t\t\t\t\t\t\tSET name = '" . $arr["name"] . "', sid = '" . $arr["sid"] . "', sex = '" . $arr["sex"] . "', birthday = '" . $arr["birthday"] . "'\n\t\t\t\t\t\t\tWHERE uid = '" . $uid . "'"; $VTs->ExecuteNonQuery($strSQL); //update address $strSQL = "UPDATE emp_common_address\n\t\t\t\t\t\t\tSET zip = '" . $arr["zip"] . "', city = '" . $arr["city"] . "', area = '" . $arr["area"] . "', vil = '" . $arr["vil"] . "', verge = '" . $arr["verge"] . "', road = '" . $arr["road"] . "', addr = '" . $arr["addr"] . "'\n\t\t\t\t\t\t\tWHERE memid = '" . $uid . "'"; $VTs->ExecuteNonQuery($strSQL); //get belong id $strSQL = "SELECT uid FROM emp_common WHERE name = '" . $arr["belong"] . "'"; $belongUid = $VTs->QueryData($strSQL); //update communication if (!empty($belongUid)) { $strSQL = "UPDATE emp_common_communication\n\t\t\t\t\t\t\t\tSET belong = '" . $belongUid[0]["uid"] . "', relationid = '" . $arr["relation"] . "', mobile = '" . $arr["mobile"] . "', tel_h = '" . $arr["tel_h"] . "', tel_o = '" . $arr["tel_o"] . "', tel_ext = '" . $arr["tel_ext"] . "', email = '" . $arr["email"] . "'\n\t\t\t\t\t\t\t\tWHERE memid = '" . $uid . "'"; $VTs->ExecuteNonQuery($strSQL); } else { $strSQL = "UPDATE emp_common_communication\n\t\t\t\t\t\t\t\tSET relationid = '" . $arr["relation"] . "', mobile = '" . $arr["mobile"] . "', tel_h = '" . $arr["tel_h"] . "', tel_o = '" . $arr["tel_o"] . "', tel_ext = '" . $arr["tel_ext"] . "', email = '" . $arr["email"] . "'\n\t\t\t\t\t\t\t\tWHERE memid = '" . $uid . "'"; $VTs->ExecuteNonQuery($strSQL); } $pageContent = $VTs->Data2Json($arr); } else { $pageContent = "Error"; } //-----------BI結束------------ } catch (Exception $error) { //依據Controller, Action補上對應位置, $error->getMessage()為固定部份 $VTs->WriteLog("EmployeemanageController", "updateDataAction", $error->getMessage()); } //關閉資料庫連線 $VTs->DBClose(); //釋放 $VTs = null; $this->viewContnet['pageContent'] = $pageContent; return new ViewModel($this->viewContnet); }