当前位置: 首页>>代码示例>>PHP>>正文


PHP PdoDataAccess::runquery_fetchMode方法代码示例

本文整理汇总了PHP中PdoDataAccess::runquery_fetchMode方法的典型用法代码示例。如果您正苦于以下问题:PHP PdoDataAccess::runquery_fetchMode方法的具体用法?PHP PdoDataAccess::runquery_fetchMode怎么用?PHP PdoDataAccess::runquery_fetchMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PdoDataAccess的用法示例。


在下文中一共展示了PdoDataAccess::runquery_fetchMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: selectEqualizations

function selectEqualizations()
{
    $dt = PdoDataAccess::runquery_fetchMode("select EqualizationID,RegDate,BankID,BankDesc \r\n\t\tfrom ACC_equalizations left join ACC_banks using(BankID)");
    $temp = PdoDataAccess::fetchAll($dt, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $dt->rowCount(), $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:7,代码来源:operation.data.php

示例2: selectDeposites

function selectDeposites()
{
    $temp = PdoDataAccess::runquery_fetchMode("\r\n\t\tselect TafsiliID,CostID,concat_ws('-',b1.BlockDesc,b2.BlockDesc) CostDesc,\r\n\t\t\tsum(CreditorAmount-DebtorAmount) amount,TafsiliDesc\r\n\t\tfrom ACC_DocItems \r\n\t\t\tjoin ACC_docs using(DocID)\r\n\t\t\tjoin ACC_CostCodes cc using(CostID)\r\n\t\t\tleft join ACC_blocks b1 on(b1.BlockID=cc.level1)\r\n\t\t\tleft join ACC_blocks b2 on(b2.BlockID=cc.level2)\r\n\t\t\tjoin ACC_tafsilis using(TafsiliID)\r\n\t\t\r\n\t\twhere /*DocStatus != 'RAW'*/ 1=1\r\n\t\t\tAND CostID in(" . COSTID_ShortDeposite . "," . COSTID_LongDeposite . ")\r\n\t\t\tAND CycleID=" . $_SESSION["accounting"]["CycleID"] . "\r\n\t\t\tAND BranchID=" . $_SESSION["accounting"]["BranchID"] . "\r\n\t\tgroup by TafsiliID,CostID");
    $dt = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    //echo PdoDataAccess::GetLatestQueryString();
    echo dataReader::getJsonData($dt, $temp->rowCount(), $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:8,代码来源:deposite.data.php

示例3: GetSavingFlow

function GetSavingFlow()
{
    $query = "select d.*,di.*\n\t\tfrom ACC_DocItems di\n\t\t\tjoin ACC_docs d using(DocID)\n\t\t\tjoin ACC_tafsilis t on(di.TafsiliID=t.TafsiliID)\n\t\t\tjoin BSC_persons p on(t.ObjectID=p.PersonID)\n\t\twhere d.CycleID=:c AND d.BranchID=:b AND \n\t\t\tdi.CostID=:cost AND di.TafsiliType = :t AND p.PersonID=:p";
    $param = array(":c" => $_SESSION["accounting"]["CycleID"], ":b" => $_SESSION["accounting"]["BranchID"], ":cost" => COSTID_saving, ":t" => TAFTYPE_PERSONS, ":p" => $_REQUEST["PersonID"]);
    $temp = PdoDataAccess::runquery_fetchMode($query, $param);
    $no = $temp->rowCount();
    $temp = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:10,代码来源:saving.data.php

示例4: AccDocFlow

function AccDocFlow()
{
    $CostID = $_REQUEST["CostID"];
    $CurYear = substr(DateModules::shNow(), 0, 4);
    $temp = PdoDataAccess::runquery_fetchMode("\r\n\t\tselect d.DocDate,\r\n\t\t\td.description,\r\n\t\t\tdi.DebtorAmount,\r\n\t\t\tdi.CreditorAmount,\r\n\t\t\tdi.details\r\n\t\tfrom ACC_DocItems di join ACC_docs d using(DocID)\r\n\t\tleft join ACC_tafsilis t1 on(t1.TafsiliType=1 AND di.TafsiliID=t1.TafsiliID)\r\n\t\tleft join ACC_tafsilis t2 on(t2.TafsiliType=1 AND di.TafsiliID2=t2.TafsiliID)\r\n\t\twhere CycleID=:year AND CostID=:cid AND (t1.ObjectID=:pid or t2.ObjectID=:pid)\r\n\t\t\tAND DocStatus in('CONFIRM','ARCHIVE')\r\n\t\torder by DocDate\r\n\t", array(":year" => $CurYear, ":pid" => $_SESSION["USER"]["PersonID"], ":cid" => $CostID));
    //print_r(ExceptionHandler::PopAllExceptions());
    $count = $temp->rowCount();
    $temp = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $count, $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:11,代码来源:global.data.php

示例5: SelectAll

function SelectAll()
{
    $where = "1=1";
    if (!empty($_REQUEST["TaskStatus"])) {
        $where .= " AND TaskStatus in(" . ($_REQUEST["TaskStatus"] == "RAW" ? "'RAW'" : "'DONE','RESPONSE'") . ")";
    }
    $res = PdoDataAccess::runquery_fetchMode("\r\n\t\tselect\tt.* , \r\n\t\t\t\tSysName,\r\n\t\t\t\tconcat_ws(' ',fname,lname,CompanyName) RegPersonName\r\n\t\t\t\t\r\n\t\tfrom FRW_tasks t\r\n\t\tjoin BSC_persons on(RegPersonID = PersonID)\r\n\t\tjoin FRW_systems using(SystemID)\r\n\t\t\r\n\t\twhere {$where} order by FIELD(TaskStatus,'RAW') desc,ifnull(DoneDate,CreateDate) desc");
    $cnt = $res->rowCount();
    $res = PdoDataAccess::fetchAll($res, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($res, $cnt, $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:12,代码来源:ManageRequests.php

示例6: SelectBlocks

function SelectBlocks()
{
    if (!empty($_REQUEST["PreLevel"])) {
        $level = $_REQUEST['level'];
        $query = "select b{$level}.* from ACC_CostCodes \n\t\t\t join ACC_blocks b1 on(b1.BlockID=level1)\n\t\t\tleft join ACC_blocks b2 on(b2.BlockID=level2)\n\t\t\tleft join ACC_blocks b3 on(b3.BlockID=level3)\n\t\t\n\t\twhere b{$level}.BlockID is not null AND b" . ($level * 1 - 1) . ".BlockID=:b";
        $param = array(":b" => $_REQUEST["PreLevel"]);
        if (isset($_REQUEST['fields']) && isset($_REQUEST['query'])) {
            $field = $_REQUEST['fields'];
            $query .= ' and ' . $field . ' like :' . $field;
            $param[':' . $field] = '%' . $_REQUEST['query'] . '%';
        }
        $query .= " group by b{$level}.BlockID";
        $list = PdoDataAccess::runquery_fetchMode($query, $param);
        $count = $list->rowCount();
        if (isset($_GET["start"])) {
            $list = PdoDataAccess::fetchAll($list, $_GET["start"], $_GET["limit"]);
        } else {
            $list = $list->fetchAll();
        }
        echo dataReader::getJsonData($list, $count, $_GET['callback']);
        die;
    }
    $where = "IsActive='YES' AND LevelID=:LevelID";
    $param = array();
    $param[':LevelID'] = $_REQUEST['level'];
    if (isset($_REQUEST['fields']) && isset($_REQUEST['query'])) {
        $field = $_REQUEST['fields'];
        $where .= ' and ' . $field . ' like :' . $field;
        $param[':' . $field] = '%' . $_REQUEST['query'] . '%';
    }
    if (!isset($_REQUEST['fields']) && !empty($_REQUEST['query'])) {
        $where .= " AND ( BlockDesc like :qu or BlockCode like :qu)";
        $param[':qu'] = '%' . $_REQUEST['query'] . '%';
    }
    if (!empty($_REQUEST['BlockID'])) {
        $where .= " AND BlockID=:b";
        $param[':b'] = $_REQUEST['BlockID'];
    }
    $where .= " order by BlockCode*1";
    $list = ACC_blocks::GetAll($where, $param);
    $count = $list->rowCount();
    if (isset($_GET["start"]) && !isset($_GET["All"])) {
        $list = PdoDataAccess::fetchAll($list, $_GET["start"], $_GET["limit"]);
    } else {
        $list = $list->fetchAll();
    }
    echo dataReader::getJsonData($list, $count, $_GET['callback']);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:49,代码来源:baseinfo.data.php

示例7: selectIncomeCheques

function selectIncomeCheques()
{
    $where = "1=1";
    $param = array();
    MakeWhere($where, $param);
    $query = "\r\n\t\tselect i.*,\r\n\t\t\tcase when i.CostID is null then group_concat(t2.TafsiliDesc SEPARATOR '<br>')\r\n\t\t\t\telse t1.TafsiliDesc end fullname,\r\n\t\t\tcase when i.CostID is null then group_concat(concat_ws('-', bb1.blockDesc, bb2.blockDesc) SEPARATOR '<br>') \r\n\t\t\t\telse concat_ws('-', b1.blockDesc, b2.blockDesc, b3.blockDesc) end CostDesc,\r\n\t\t\tb.BankDesc, \r\n\t\t\tt3.TafsiliDesc ChequeStatusDesc,\r\n\t\t\tt.docs\r\n\t\t\t\r\n\t\tfrom ACC_IncomeCheques i\r\n\t\t\tleft join ACC_tafsilis t1 using(TafsiliID)\r\n\t\t\tleft join ACC_CostCodes cc using(CostID)\r\n\t\t\tleft join ACC_blocks b1 on(cc.level1=b1.BlockID)\r\n\t\t\tleft join ACC_blocks b2 on(cc.level2=b2.BlockID)\r\n\t\t\tleft join ACC_blocks b3 on(cc.level3=b3.BlockID)\r\n\t\t\t\r\n\t\t\tleft join LON_BackPays bp using(IncomeChequeID)\r\n\t\t\tleft join LON_requests using(RequestID)\r\n\t\t\tleft join LON_loans l using(LoanID)\r\n\t\t\tleft join ACC_CostCodes cc2 on(cc2.level1=" . BLOCKID_LOAN . " AND cc2.level2=l.blockID)\r\n\t\t\tleft join ACC_blocks bb1 on(cc2.level1=bb1.BlockID)\r\n\t\t\tleft join ACC_blocks bb2 on(cc2.level2=bb2.BlockID)\r\n\t\t\tleft join ACC_tafsilis t2 on(t2.TafsiliType=" . TAFTYPE_PERSONS . " AND t2.ObjectID=LoanPersonID)\r\n\t\t\r\n\t\tleft join ACC_banks b on(ChequeBank=BankID)\r\n\t\tleft join ACC_tafsilis t3 on(t3.TafsiliType=" . TAFTYPE_ChequeStatus . " AND t3.TafsiliID=ChequeStatus)\r\n\t\tleft join (\r\n\t\t\tselect SourceID, group_concat(distinct LocalNo) docs\r\n\t\t\tfrom ACC_DocItems join ACC_docs using(DocID)\r\n\t\t\twhere SourceType='" . DOCTYPE_INCOMERCHEQUE . "' \r\n\t\t\tgroup by SourceID\r\n\t\t)t on(i.IncomeChequeID=t.SourceID)\r\n\t\t\r\n\t\twhere " . $where . " \r\n\t\tgroup by i.IncomeChequeID";
    //.........................................................
    $query .= dataReader::makeOrder();
    $temp = PdoDataAccess::runquery_fetchMode($query, $param);
    print_r(ExceptionHandler::PopAllExceptions());
    //echo PdoDataAccess::GetLatestQueryString();
    $no = $temp->rowCount();
    $temp = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:16,代码来源:cheques.data.php

示例8: writ_print_list

function writ_print_list($transcript_no, $last_writ_flag)
{
    $staff_onclause = $last_writ_flag ? "s.staff_id=w.staff_id AND s.last_writ_id=w.writ_id AND s.last_writ_ver=w.writ_ver" : "s.staff_id=w.staff_id";
    $title = $transcript_no == "all" ? 'wts.title transcripts_title,wts.transcript_id , tbl1.mtid,' : "";
    $writ_transcripts_join = $transcript_no == "all" ? '
			LEFT OUTER JOIN HRM_writ_transcripts wts ON(w.person_type = wts.person_type AND w.emp_state = wts.emp_state)
			LEFT OUTER JOIN (select max(transcript_id) mtid ,person_type , emp_state
							 from HRM_writ_transcripts group by person_type , emp_state) tbl1
				ON(tbl1.person_type = w.person_type AND tbl1.emp_state = w.emp_state)' : "";
    $order = $transcript_no == "all" ? '    wts.transcript_id ASC' : "";
    $query = " select\n\t\t\t\ts.staff_id,\n\t\t\t\tw.writ_id,\n\t\t\t\tw.writ_ver,\n\t\t\t\tw.staff_id,\n\t\t\t\tw.person_type,\n\t\t\t\tw.onduty_year,\n\t\t\t\tw.onduty_month,\n\t\t\t\tw.onduty_day,\n\t\t\t\tw.writ_type_id,\n\t\t\t\tw.emp_state,\n\t\t\t\tw.emp_mode,\n\t\t\t\tw.ref_letter_date,\n\t\t\t\tw.ref_letter_no,\n\t\t\t\tw.send_letter_no,\n\t\t\t\tw.contract_start_date,\n\t\t\t\tw.contract_end_date,\n\t\t\t\tw.corrective,\n\t\t\t\tw.issue_date,\n\t\t\t\tw.execute_date ,\n\t\t\t\twst.time_limited,\n\t\t\t\tp.sex sex ,w.marital_status , \n\t\t\t\tw.notes,w.family_responsible , \n\t\t\t\tw.pay_date pay_date,\n                                w.MissionPlace , \n\t\t\t\tmsts.Title marital_status_title,\n\t\t\t\tedulv.Title education_level_title,\n\n\t\t\t\t(w.cur_group-jf.start_group)+1 old_grup,\n\t\t\t\t(w.cur_group - 4) new_grup,\n\t\t\t\tw.cur_group ,\n\t\t\t\tw.description description,\n\t\t\t\tw.included_children_count,\n\t\t\t\tw.children_count,\n\t\t\t\tmiltype.Title as military,miltype.InfoID as militaryID , \n\t\t\t\tw.job_id,\n\t\t\t\tsinclv.Title snc_level,\n\t\t\t\tw.base,\n\t\t\t\tw.ouid,\n\t\t\t\tempstt.Title emp_st,\n\t\t\t\tworktime.Title worktime,\n\t\t\t\tp.sex gnd,\n\t\t\t\tp.pfname ps_pfname,\n\t\t\t\tp.birth_place ps_birth_place,\n\t\t\t\tp.issue_place,\n\t\t\t\tp.plname ps_plname,\n\t\t\t\tp.idcard_no ps_idcard_no,\n\t\t\t\tp.father_name ps_father_name,\n\t\t\t\tp.birth_date ps_birth_date,\n\t\t\t\tp.national_code,\n\t\t\t\tp.military_from_date,\n\t\t\t\tp.military_to_date,\n\t\t\t\tp.military_type,\n\t\t\t\tp.military_duration_day, \n\t\t\t\tp.military_duration ,\n\t\t\t\to.ptitle o_ptitle,\n\t\t\t\to.ouid o_ouid,\n\t\t\t\tparentu.ouid ou_ouid ,\n\t\t\t\tparentu.ptitle ou_ptitle ,\n\t\t\t\to.org_unit_type org_sub_unit_type ,\n\t\t\t\to.ptitle os_ptitle ,\n\t\t\t\tpunit.ouid po_ouid,\n\t\t\t\tpunit.ptitle po_ptitle,\n\t\t\t\tpsubunit.ptitle pos_ptitle ,\n\t\t\t\tpsubunit.ouid pos_ouid ,\n\t\t\t\tj.title j_title,\n\t\t\t\tj.job_group,\n\t\t\t\tsf.ptitle sf_title,\n\t\t\t\tsbs.ptitle sbs_title,\n\t\t\t\twst.print_title wst_title,\n\t\t\t\tpo.title p_title,\n\t\t\t\tpo.post_no p_post_no,\n\t\t\t\tpo.post_id ,\n\t\t\t\tpo.ouid pouid ,\n\t\t\t\tposttype.Title post_type,\n\t\t\t\tcw.ptitle cw_ptitle,\n\t\t\t\tcb.ptitle cb_ptitle,\n\t\t\t\tci.ptitle ci_ptitle,\t\t\n\t\t\t\tsi.ptitle si_ptitle,\n\t\t\t\tsw.ptitle sw_ptitle,\n\t\t\t\tjf.title jf_title,\n\t\t\t\tjsc.title jsc_title,\n\t\t\t\tjc.title jc_title,\n\t\t\t\ts.personel_no,\n\t\t\t\ts.work_start_date,\n\t\t\t\tc.ptitle country_title,\n\t\t\t\tsbs.ptitle sbs_title,\n\t\t\t\tsf.ptitle sf_ptitle,\n\t\t\t\tsf.sfid , s.unitCode ,\n\t\t\t\tj.job_id ,\n\t\t\t\tj.title j_title,\n\t\t\t\twt.title writ_type,\n\t\t\t\t" . $title . "\n\t\t\t\tp.PersonID ,\n\t\t\t\tw.writ_signature_post_title,\n\t\t\t\tw.writ_signature_post_owner ,w.grade ,\n\t\t\t\thistory_only,\n\t\t\t\twst.req_staff_signature, \n\t\t\t\twsi.param8 E_base,                                 \n\t\t\t\twsi.param5 ComputeGrade, \n\t\t\t\tba.SBase S_base, \n\t\t\t\tba.IsarValue I_base ,\n\t\t\t\tba.TashvighiValue T_base ";
    $query .= " from staff s\n\t\t\t INNER JOIN HRM_writs w ON (" . $staff_onclause . ")\n\n\t\t\t LEFT OUTER JOIN HRM_writ_subtypes wst\n\t\t\t\t  ON ((w.person_type = wst.person_type) AND (w.writ_type_id = wst.writ_type_id) AND (w.writ_subtype_id=wst.writ_subtype_id))\n\t\t\t LEFT OUTER JOIN HRM_writ_types wt\n\t\t\t\t  ON ((w.person_type = wt.person_type) AND (w.writ_type_id = wt.writ_type_id))\n\t\t\t LEFT OUTER JOIN HRM_person_educations pe1\n\t\t\t\t  ON ((w.education_level = pe1.education_level) AND (w.sfid = pe1.sfid) AND (w.sbid = pe1.sbid) AND (pe1.PersonID = s.PersonID))\n\t\t\t LEFT OUTER JOIN HRM_countries c ON (pe1.country_id = c.country_id)\n\t\t\t LEFT OUTER JOIN HRM_universities u ON ((pe1.university_id = u.university_id) AND (pe1.country_id = u.country_id))\n\t\t\t LEFT OUTER JOIN HRM_study_fields sf ON ((w.sfid = sf.sfid))\n\t\t\t LEFT OUTER JOIN HRM_study_branchs sbs ON ((w.sfid = sbs.sfid)AND(w.sbid=sbs.sbid))\n\t\t\t LEFT OUTER JOIN HRM_persons p ON (s.PersonID = p.PersonID)\n\t\t\t LEFT OUTER JOIN HRM_cities cw ON ((w.work_city_id = cw.city_id) AND (w.work_state_id = cw.state_id))\n\t\t\t " . $writ_transcripts_join . "\n\t\t\t LEFT OUTER JOIN HRM_states sw ON (cw.state_id=sw.state_id)\n\t\t\t LEFT OUTER JOIN HRM_cities cb ON ((p.birth_city_id = cb.city_id) AND (p.birth_state_id = cb.state_id))\n\t\t\t LEFT OUTER JOIN HRM_cities ci ON ((p.issue_city_id=ci.city_id) AND (p.issue_state_id = ci.state_id))\n\t\t\t LEFT OUTER JOIN HRM_states si ON (ci.state_id=si.state_id)\n\t\t\t LEFT OUTER JOIN HRM_position po ON (w.post_id = po.post_id)\n\t\t\t LEFT OUTER JOIN HRM_org_new_units psubunit ON (psubunit.ouid = po.ouid)\n\t\t\t LEFT OUTER JOIN HRM_org_new_units punit ON (punit.ouid = psubunit.parent_ouid)\n\t\t\t LEFT OUTER JOIN HRM_job_fields jf ON (po.jfid = jf.jfid)\n\t\t\t LEFT OUTER JOIN HRM_job_subcategory jsc ON ((jf.jsid = jsc.jsid) AND (jf.jcid=jsc.jcid))\n\t\t\t LEFT OUTER JOIN HRM_job_category jc ON (jsc.jcid = jc.jcid)\n\t\t\t LEFT OUTER JOIN HRM_org_new_units o ON (w.ouid = o.ouid)\n\t\t\t LEFT OUTER JOIN HRM_org_new_units parentu ON (parentu.ouid = o.parent_ouid)\n\t\t\t LEFT OUTER JOIN HRM_jobs j ON (w.job_id = j.job_id) \n\t\t\t \n\t\t\t LEFT OUTER JOIN HRM_writ_salary_items wsi ON w.writ_id = wsi.writ_id AND \n\t\t\t\t\t\t\t\tw.writ_ver = wsi.writ_ver AND w.staff_id = wsi.staff_id AND wsi.salary_item_type_id = 10364 \n\t\t\t\t\t\t\t\t\n\t\t\t LEFT OUTER JOIN (select    PersonID , sum(if(ba.BaseType in (6,2,20,21,22,23,24,25,26,27) and ba.BaseStatus = 'NORMAL' ,ba.BaseValue,0))  TashvighiValue ,\n\t\t\t\t\t\t\t\t\t\tsum(if(ba.BaseType in (3,4,5,7) and ba.BaseStatus = 'NORMAL' ,ba.BaseValue,0))  IsarValue ,\n\t\t\t\t\t\t\t\t\t\tsum(if(ba.BaseType in (1 ) and ba.BaseStatus = 'NORMAL' ,ba.BaseValue,0)) SBase\n\n\t\t\t\t\t\t\t\t\tfrom bases ba\n\n\t\t\t\t\t\t\t  group by PersonID) ba \n\t\t\t\t\t\t\t  ON ba.PersonID = s.PersonID " . QueryHelper::makeBasicInfoJoin(15, "msts", "w.marital_status") . QueryHelper::makeBasicInfoJoin(6, "edulv", "w.education_level") . QueryHelper::makeBasicInfoJoin(10, "miltype", "p.military_type") . QueryHelper::makeBasicInfoJoin(8, "sinclv", "w.science_level") . QueryHelper::makeBasicInfoJoin(3, "empstt", "w.emp_state") . QueryHelper::makeBasicInfoJoin(14, "worktime", "w.worktime_type") . QueryHelper::makeBasicInfoJoin(27, "posttype", "po.post_type");
    $where = "1=1";
    $whereParam = array();
    require_once '../data/writ.data.php';
    echo "****";
    die;
    MakeAdvanceSearchWhere($where, $whereParam);
    if (!empty($_REQUEST["writ_id"]) && !empty($_REQUEST["writ_ver"]) && !empty($_REQUEST["staff_id"])) {
        $where .= " AND w.writ_id = :wid AND w.writ_ver=:wver AND w.staff_id=:stid";
        $whereParam[":wid"] = $_REQUEST["writ_id"];
        $whereParam[":wver"] = $_REQUEST["writ_ver"];
        $whereParam[":stid"] = $_REQUEST["staff_id"];
    } else {
        if ($last_writ_flag == 1) {
            $where .= " AND w.writ_id = s.last_writ_id AND w.writ_ver=s.last_writ_ver";
        }
    }
    if (!empty($_REQUEST["ouid"])) {
        $return = QueryHelper::MK_org_units($_REQUEST["ouid"]);
        $where .= " AND " . $return["where"];
        $whereParam = array_merge($whereParam, $return["param"]);
    }
    if ($transcript_no != 1 && $transcript_no != 2) {
        $transcript_no = 2;
    }
    //--------------------------------------------------------------------------
    if ($_REQUEST['transcript_no'] == "all") {
        $where .= " AND wts.transcript_id not in (117 , 123 , 127 , 44 , 9 , 114 ) ";
    }
    $query .= " where " . $where;
    $query .= " order by p.plname , p.pfname ";
    $dt = PdoDataAccess::runquery_fetchMode($query, $whereParam);
    echo PdoDataAccess::GetLatestQueryString();
    die;
    return $dt;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:47,代码来源:print_writ.php

示例9: in

	/**
	 * @param manage_writ $cur_writ
	 */
	function compute_automatic_writ_salary_items($cur_writ,$t="") {
		
		$query = "  select * from HRM_salary_item_types
					WHERE person_type in ( 3 ) AND  				     

						  compute_place = " . SALARY_ITEM_COMPUTE_PLACE_WRIT . " AND 
					      salary_compute_type = " . SALARY_COMPUTE_TYPE_FUNCTION . " AND 
					      user_data_entry = " . AUTOMATIC . " AND
					      validity_start_date <= '" . $cur_writ->execute_date . "' AND 
					     (validity_end_date >= '" . $cur_writ->execute_date . "' OR 
						  validity_end_date IS NULL OR validity_end_date ='0000-00-00' )
					ORDER BY ComputeOrder "; 
	
		$salary_items_DT = parent::runquery_fetchMode($query);	
	  				
		for ($i = 0; $i < $salary_items_DT->rowCount(); $i++) {
		    
			$salary_items_row = $salary_items_DT->fetch();

			$query = "SELECT    w.writ_id,
								w.writ_ver,
								w.execute_date,
								w.staff_id,
								s.personID,
								w.person_type,
								w.cur_group,
								w.education_level,
								w.onduty_year,
								w.onduty_month,
								w.onduty_day,
								w.family_responsible,
								w.included_children_count,
								w.post_id,
								w.emp_mode,
								w.emp_state,
								w.job_id,
								j.job_group,
								w.marital_status,
								p.PersonID,p.sex , p.military_duration_day,
								p.military_duration,
								s.last_retired_pay,
								sit.salary_item_type_id,
								wsi.param1,
								wsi.param2,
								wsi.param3,
								wsi.param4,
								wsi.param5,
								wsi.param6,
								wsi.param7,
								wsi.value,
								wsi.automatic,
								wsi.remember_date,
								wsi.remember_message,
								wsi.remembered,
								sit.salary_compute_type,
								sit.multiplicand,
								sit.function_name,
								sit.user_data_entry,
								sit.editable_value,
								s.work_start_date,
								bf.param1 master_education_level,
								sit.person_type as sp_person_type

                 FROM    HRM_writs as w 
                			inner join HRM_staff as s on(w.staff_id = s.staff_id)
							left join HRM_jobs j on(j.job_id=w.job_id)
                			inner join HRM_persons as p on(s.PersonID = p.PersonID)
							join BaseInfo bf on(bf.TypeID=56 AND bf.InfoID=w.education_level)
							join HRM_salary_item_types sit
				            left join HRM_writ_salary_items  wsi on(sit.salary_item_type_id=wsi.salary_item_type_id  AND
																	wsi.writ_id=w.writ_id AND wsi.writ_ver=w.writ_ver AND
																	wsi.staff_id=w.staff_id)
                        	
                WHERE   w.writ_id= " . $cur_writ->writ_id . " and 
                		w.writ_ver=" . $cur_writ->writ_ver . " and
                		w.staff_id =" . $cur_writ->staff_id . " and 
                		sit.salary_item_type_id = " . $salary_items_row["salary_item_type_id"];

			$dt = parent::runquery_fetchMode($query);		
						
			if ($dt->rowCount() > 0)
				$wsi_record = $dt->fetch();
		
			else
				continue;

			$this->writ_id = $cur_writ->writ_id;
			$this->writ_ver = $cur_writ->writ_ver;
			$this->staff_id = $cur_writ->staff_id;
			$this->salary_item_type_id = $salary_items_row["salary_item_type_id"];
			$this->automatic = 1;


			$this->remember_date = '0000-00-00';
			$this->remember_message = $salary_items_row['remember_message'];

			$function_name = $salary_items_row['function_name'];	
//.........这里部分代码省略.........
开发者ID:jafarkhani,项目名称:rtfund,代码行数:101,代码来源:writ_item.class.php

示例10: SelectReceivedForms

 static function SelectReceivedForms($where = "", $params = array())
 {
     $dt = PdoDataAccess::runquery("select FlowID,StepID \n\t\t\tfrom WFM_FlowSteps s \n\t\t\tleft join BSC_persons p using(PostID)\n\t\t\twhere s.IsActive='YES' AND if(s.PersonID>0,s.PersonID=:pid,p.PersonID=:pid)", array(":pid" => $_SESSION["USER"]["PersonID"]));
     if (count($dt) == 0) {
         return array();
     }
     $where .= " AND fr.IsEnded='NO' AND (";
     foreach ($dt as $row) {
         $preStep = $row["StepID"] * 1 - 1;
         $nextStep = $row["StepID"] * 1 + 1;
         $where .= "(fr.FlowID=" . $row["FlowID"] . " AND fs.StepID" . ($preStep == 0 ? " is null" : "=" . $preStep) . " AND ActionType='CONFIRM') OR (fr.FlowID=" . $row["FlowID"] . " AND fs.StepID=" . $nextStep . " AND ActionType='REJECT') OR";
     }
     $where = substr($where, 0, strlen($where) - 2) . ")";
     //--------------------------------------------------------
     $query = "select fr.*,f.FlowDesc, \n\t\t\t\t\t\tb.InfoDesc ObjectTypeDesc,\n\t\t\t\t\t\tifnull(fr.StepDesc,'شروع گردش') StepDesc,\n\t\t\t\t\t\tif(p.IsReal='YES',concat(p.fname, ' ',p.lname),p.CompanyName) fullname,\n\t\t\t\t\t\tb.param1 url,\n\t\t\t\t\t\tb.param2 parameter\n\t\t\t\t\tfrom WFM_FlowRows fr\n\t\t\t\t\tjoin ( select max(RowID) RowID,FlowID,ObjectID from WFM_FlowRows group by FlowID,ObjectID )t\n\t\t\t\t\t\tusing(RowID,FlowID,ObjectID)\n\t\t\t\t\tjoin WFM_flows f using(FlowID)\n\t\t\t\t\tjoin BaseInfo b on(b.TypeID=11 AND b.InfoID=f.ObjectType)\n\t\t\t\t\tleft join WFM_FlowSteps fs on(fr.StepRowID=fs.StepRowID)\n\t\t\t\t\tjoin BSC_persons p on(fr.PersonID=p.PersonID)\n\n\t\t\t\t\tleft join LON_ReqParts lp on(fr.ObjectID=PartID)\n\t\t\t\t\tleft join LON_requests lr on(lp.RequestID=lr.RequestID)\n\t\t\t\t\tleft join BSC_persons pp on(lr.LoanPersonID=pp.PersonID)\n\n\t\t\t\t\twhere 1=1 " . $where . dataReader::makeOrder();
     return PdoDataAccess::runquery_fetchMode($query, $params);
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:17,代码来源:wfm.class.php

示例11: AND

 function exe_service_insure_sql()
 {
     $this->monitor(6);
     /*if(!$this->backpay){
     		
     		//parent::runquery(" DROP TABLE IF EXISTS mpds ");
     		parent::runquery('TRUNCATE mpds');
     		parent::runquery("  /*CREATE  TABLE mpds  AS*/
     /*insert into mpds
     								SELECT pds.PersonID,
     									pds.master_row_no,
     									MAX(pds.from_date) from_date ,
     									SUBSTR(MAX(CONCAT(pds.from_date,pds.row_no)),11) row_no
     								FROM person_dependent_supports pds
     								WHERE pds.from_date <= '".$this->month_end."' AND(pds.to_date >= '".$this->month_start."' OR 
     									  pds.to_date IS NULL OR pds.to_date = '0000-00-00' ) AND 
     									 (pds.status = ".DELETE_IN_EMPLOYEES." OR pds.status = ".IN_SALARY.") 
     								GROUP BY pds.PersonID,pds.master_row_no;");
     			
     			$this->service_insure_rs = parent::runquery_fetchMode(" SELECT pds.PersonID ,
     																	s.staff_id,
     																	COUNT( CASE pds.insure_type
     																			WHEN ".NORMAL." THEN 1
     																			END) normal,
     																	COUNT( CASE pds.insure_type
     																			WHEN ".NORMAL." AND pd.dependency IN(".OWN.") THEN 1
     																			END) own_normal,          
     																	COUNT( CASE pds.insure_type
     																			WHEN ".NORMAL2." THEN 5
     																			END) normal2,
     																	COUNT( CASE pds.insure_type
     																			WHEN ".FIRST_SURPLUS." THEN 2
     																			END) extra1,
     																	COUNT( CASE pds.insure_type
     																			WHEN ".SECOND_SURPLUS." THEN 3
     																			END) extra2,
     																	COUNT( CASE
     																		WHEN pds.insure_type = ".NORMAL." AND pd.dependency IN(".OWN.",".FATHER.",".MOTHER.",".WIFE.",".BOY.",".DAUGHTER.") THEN 1
     																		END)ret_normal,
     																	COUNT( CASE
     																		WHEN pds.insure_type = ".NORMAL2." AND pd.dependency IN(".OWN.",".FATHER.",".MOTHER.",".WIFE.",".BOY.",".DAUGHTER.") THEN 5
     																		END)ret_normal2,
     																	COUNT( CASE
     																		WHEN pds.insure_type = ".FIRST_SURPLUS." AND pd.dependency IN(".OWN.",".FATHER.",".MOTHER.",".WIFE.",".BOY.",".DAUGHTER.") THEN 2
     																		END)ret_extra1,
     																	COUNT( CASE
     																		WHEN pds.insure_type = ".SECOND_SURPLUS." AND pd.dependency IN(".OWN.",".FATHER.",".MOTHER.",".WIFE.",".BOY.",".DAUGHTER.") THEN 3
     																		END)ret_extra2,	                                   
     																		sit.validity_start_date,
     																		sit.validity_end_date
     
     																FROM mpds mp
     																	INNER JOIN person_dependent_supports pds
     																		ON(mp.PersonID = pds.PersonID AND mp.master_row_no = pds.master_row_no AND mp.row_no = pds.row_no)
     																	INNER JOIN person_dependents pd
     																		ON(pd.PersonID = pds.PersonID AND pd.row_no = pds.master_row_no)
     															INNER JOIN staff s
     																ON(pds.PersonID = s.PersonID)
     															INNER JOIN limit_staff ls
     																	ON(s.staff_id = ls.staff_id)
     															INNER JOIN salary_item_types sit
     																ON((sit.salary_item_type_id = ".SIT_PROFESSOR_REMEDY_SERVICES_INSURE." AND s.person_type = ".HR_PROFESSOR.") OR
     																	(sit.salary_item_type_id = ".SIT_STAFF_REMEDY_SERVICES_INSURE." AND s.person_type = ".HR_EMPLOYEE."))
     
     																GROUP BY s.staff_id,
     																				pds.PersonID,	                                        
     																			sit.validity_start_date,
     																			sit.validity_end_date");
     			
     		}
     		else
     		{*/
     $this->service_insure_rs = parent::runquery_fetchMode(" SELECT \n                                                                        p.PersonID ,\n                                                                        s.staff_id,\n                                                                        IFNULL(pi.param1,0) normal,\n                                                                        IFNULL(pi.param8,0) normal2,\n                                                                        IFNULL(pi.param2,0) extra1,\n                                                                        IFNULL(pi.param3,0) extra2,\n                                                                        IFNULL(pi.param7,0) own_normal ,\n                                                                        IFNULL(pi2.param1,0) ret_normal,\n                                                                        IFNULL(pi2.param8,0) ret_normal2,\n                                                                        IFNULL(pi2.param2,0) ret_extra1,\n                                                                        IFNULL(pi2.param3,0) ret_extra2,\n                                                                        null validity_start_date,\n                                                                        null validity_end_date\n\n                                                                    FROM staff s\n                                                                        INNER JOIN persons p\n                                                                            ON(p.PersonID = s.PersonID)\n                                                                        INNER JOIN Arrear_limit_staff ls\n                                                                            ON(s.staff_id = ls.staff_id)\n                                                                        LEFT OUTER JOIN payment_items pi\n                                                                            ON\n                                                                                pi.staff_id = s.staff_id\n                                                                                AND pi.pay_year = " . $this->__YEAR . "\n                                                                                AND pi.pay_month = " . $this->__MONTH . "\n                                                                                AND (\n                                                                                    (pi.salary_item_type_id = " . SIT_PROFESSOR_REMEDY_SERVICES_INSURE . " AND s.person_type = " . HR_PROFESSOR . ") OR\n                                                                                    (pi.salary_item_type_id = " . SIT_STAFF_REMEDY_SERVICES_INSURE . " AND s.person_type = " . HR_EMPLOYEE . ")\n                                                                                )\n                                                                        LEFT OUTER JOIN payment_items pi2\n                                                                               ON\n                                                                                 pi2.staff_id = s.staff_id\n                                                                                 AND pi2.pay_year = " . $this->__YEAR . "\n                                                                                 AND pi2.pay_month = " . $this->__MONTH . "\n                                                                                 AND (pi2.salary_item_type_id = " . RETURN_FIRST_MONTH_MOGHARARY . ") ");
     /*} */
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:75,代码来源:arrear_pay_calculation.class.php

示例12: GetAccountFlow

function GetAccountFlow()
{
    $CostID = $_REQUEST["BaseCostID"];
    $TafsiliID = $_REQUEST["TafsiliID"];
    $query = "select d.*,di.*\n\t\tfrom ACC_DocItems di\n\t\t\tjoin ACC_docs d using(DocID)\n\t\twhere d.CycleID=:c AND d.BranchID=:b AND \n\t\t\tdi.CostID=:cost AND di.TafsiliType = :t AND di.TafsiliID=:tid " . dataReader::makeOrder();
    $param = array(":c" => $_SESSION["accounting"]["CycleID"], ":b" => $_SESSION["accounting"]["BranchID"], ":cost" => $CostID, ":t" => TAFTYPE_PERSONS, ":tid" => $TafsiliID);
    $temp = PdoDataAccess::runquery_fetchMode($query, $param);
    $no = $temp->rowCount();
    //------------------------------------------------
    $BlockedAmount = ACC_CostBlocks::GetBlockAmount($CostID, TAFTYPE_PERSONS, $TafsiliID);
    //------------------------------------------------
    echo dataReader::getJsonData($temp->fetchAll(), $no, $_GET["callback"], $BlockedAmount);
    die;
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:14,代码来源:doc.data.php

示例13: select

 public static function select($where = "")
 {
     $query = "SELECT * FROM FGR_forms";
     $query .= $where != "" ? " where " . $where : "";
     return PdoDataAccess::runquery_fetchMode($query);
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:6,代码来源:form.class.php

示例14: GetChangesExcel

function GetChangesExcel(){
	
	$param = array();
	$where = "";
	$param[":year"] = $_POST["pay_year"];
	$param[":month"] = $_POST["pay_month"];
	$param[":pt"] = $_POST["PayType"];
	
	$pre_year = $_POST["pay_year"] ;
	$pre_month = $_POST["pay_month"] - 1 ;
	if($pre_month == 0){
		$pre_year--;
		$pre_month = 12 ;
	}
	$param[":preyear"] = $pre_year;
	$param[":premonth"] = $pre_month;
	
	
	MakeWhere($where, $param);
	
	$dataTable = PdoDataAccess::runquery_fetchMode("
		select     
			'' date,
			concat(plname,' ',pfname) name,
			s.staff_id ,
			bi.Title emp_mode_desc,
			pit1.get_value val1,
			if( pit2.param1 - pit1.param1>0 , pit2.param1 - pit1.param1 , 0 ) normal_insure_inc, 
			if( pit2.param8 - pit1.param8>0 , pit2.param8 - pit1.param8 , 0 ) normal2_insure_inc, 
			if( pit2.param2 - pit1.param2>0 , pit2.param2 - pit1.param2 , 0 ) first_surplus_insure_inc,
			if( pit2.param3 - pit1.param3>0 , pit2.param3 - pit1.param3 , 0 ) second_surplus_insure_inc,
			if( pit2.param1 - pit1.param1>0 , pit2.param1 - pit1.param1 , 0 ) +
				if(pit2.param2 - pit1.param2>0 , pit2.param2 - pit1.param2 , 0 ) +
				if(pit2.param3 - pit1.param3>0 , pit2.param3 - pit1.param3 , 0 ) insure_inc_count,
			bi2.Title emp_mode_desc2,
			pit2.get_value val2,
			if( pit2.param1 - pit1.param1>0 , 0 , pit1.param1 - pit2.param1 ) normal_insure_dec,
			if( pit2.param8 - pit1.param8>0 , 0 , pit1.param8 - pit2.param8 ) normal2_insure_dec,
			if( pit2.param2 - pit1.param2>0 , 0 , pit1.param2 - pit2.param2 ) first_surplus_insure_dec,
			if( pit2.param3 - pit1.param3>0 , 0 , pit1.param3 - pit2.param3 ) second_surplus_insure_dec,
			if( pit2.param1 - pit1.param1>0 , 0 , pit1.param1 - pit2.param1 ) +
				if(	pit2.param2 - pit1.param2>0 , 0 , pit1.param2 - pit2.param2 ) +
				if( pit2.param3 - pit1.param3>0 , 0 , pit1.param3 - pit2.param3 ) insure_dec_count

		from staff s
			INNER JOIN persons per ON (per.personID = s.personID)
			LEFT OUTER JOIN payments p1
				ON p1.pay_year = :preyear AND p1.pay_month = :premonth AND p1.payment_type = :pt AND s.staff_id = p1.staff_id 
			LEFT OUTER JOIN payments p2
				ON p2.pay_year = :year AND p2.pay_month = :month AND p2.payment_type = :pt AND s.staff_id = p2.staff_id
			LEFT OUTER JOIN writs w1
				ON (w1.writ_id = p1.writ_id AND w1.writ_ver = p1.writ_ver AND w1.staff_id = p1.staff_id )
			LEFT OUTER JOIN writs w2
				ON (w2.writ_id = p2.writ_id AND w2.writ_ver = p2.writ_ver AND w2.staff_id = p2.staff_id )
			LEFT OUTER JOIN payment_items pit1
				ON ((p1.staff_id = pit1.staff_id) AND (p1.pay_year = pit1.pay_year) AND
					(p1.pay_month = pit1.pay_month) AND (p1.payment_type = pit1.payment_type))
					AND (pit1.salary_item_type_id IN (143,38) )
			LEFT OUTER JOIN payment_items pit2
				ON ((p2.staff_id = pit2.staff_id) AND (p2.pay_year = pit2.pay_year) AND
					(p2.pay_month = pit2.pay_month) AND (p2.payment_type = pit2.payment_type))
					AND (pit2.salary_item_type_id IN (143,38) )
			left join Basic_Info bi on(bi.TypeID=4 AND bi.InfoID=w1.emp_mode)
			left join Basic_Info bi2 on(bi2.TypeID=4 AND bi2.InfoID=w2.emp_mode)
		
		where (pit1.get_value > 0 OR pit2.get_value >0 ) AND
			(pit1.param1 != pit2.param1 OR
			 pit1.param8 != pit2.param8 OR
			 pit1.param2 != pit2.param2 OR
			 pit1.param3 != pit2.param3 OR
			 w1.emp_mode != w2.emp_mode ) $where ", $param);
	
	//echo PdoDataAccess::GetLatestQueryString();die();
	
	$rpt = new ReportGenerator();
	$rpt->mysql_resource = $dataTable;
	
	$rpt->addColumn("تاريخ", "date");
	$rpt->addColumn('نام و نام خانوادگي', "name");
	$rpt->addColumn("كد اصلي بيمه شده", "staff_id");
	$rpt->addColumn("وضعيت استخدامي قبل", "emp_mode_desc");
	$rpt->addColumn("مبلغ قبلي", "val1");
	$rpt->addColumn("افزايش تبعي1", "normal_insure_inc");
	$rpt->addColumn("افزايش تبعي 1 جديد", "normal2_insure_inc");	
	$rpt->addColumn("افزايش تبعي2", "first_surplus_insure_inc");
	$rpt->addColumn("افزايش تبعي3", "second_surplus_insure_inc");
	$rpt->addColumn("جمع افزايش", "insure_inc_count");
	$rpt->addColumn("وضعيت استخدامي جديد", "emp_mode_desc2");
	$rpt->addColumn("'مبلغ جديد", "val2");
	$rpt->addColumn("كاهش تبعي1", "normal_insure_dec");
	$rpt->addColumn("كاهش تبعي 1 جدید", "normal2_insure_dec");
	$rpt->addColumn("كاهش تبعي2", "first_surplus_insure_dec");
	$rpt->addColumn("كاهش تبعي3", "second_surplus_insure_dec");
	$rpt->addColumn("جمع كاهش", "insure_dec_count");
	
	$rpt->excel = true;
	$rpt->generateReport();
	
	die();
}
开发者ID:jafarkhani,项目名称:rtfund,代码行数:100,代码来源:staff_insure.php

示例15: SelectAccounts

 public static function SelectAccounts($where = '', $param = array())
 {
     $query = " select * from ACC_accounts acc ";
     if ($where != '') {
         $query .= ' where ' . $where;
     }
     $res = parent::runquery_fetchMode($query, $param);
     return $res;
 }
开发者ID:jafarkhani,项目名称:rtfund,代码行数:9,代码来源:baseinfo.class.php


注:本文中的PdoDataAccess::runquery_fetchMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。