Example #1
0
function SearchJob()
{
    $where = " (1=1) AND PersonType <> 3 ";
    $whereParam = array();
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "" && $_REQUEST['JobH'] != 1) {
        switch ($field) {
            case "title":
                $where .= " AND title LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "job_id":
                $where .= " AND job_id = :qry ";
                $whereParam[":qry"] = $_GET["query"];
                break;
        }
    }
    if (isset($_REQUEST["query"]) && $_REQUEST["query"] != "" && $_REQUEST['JobH'] == 1) {
        $where .= " AND title LIKE :qry ";
        $whereParam = array(":qry" => "%" . $_REQUEST["query"] . "%");
    }
    $where .= dataReader::makeOrder();
    $temp = manage_Job::GetAll($where, $whereParam);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #2
0
function selectMiscDoc()
{
    $where = " PersonID = :PID ";
    $whereParam = array();
    $whereParam[":PID"] = $_GET["Q0"];
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "") {
        switch ($field) {
            case "title":
                $where .= " AND title LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "doc_no":
                $where .= " AND doc_no=:qry ";
                $whereParam[":qry"] = $_GET["query"];
                break;
            case "row_no":
                $where .= " AND row_no=:qry ";
                $whereParam[":qry"] = $_GET["query"];
                break;
        }
    }
    $no = manage_person_misc_doc::CountMiscDoc($where, $whereParam);
    $where .= dataReader::makeOrder();
    $where .= isset($_GET["start"]) ? " limit " . $_GET["start"] . "," . $_GET["limit"] : "";
    $temp = manage_person_misc_doc::GetAllMiscDoc($where, $whereParam);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #3
0
function selectTaxHistory()
{
    $personID = $_GET["PID"];
    $temp = manage_staff_tax::GetAllStaffTaxHistory($personID);
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
Example #4
0
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;
}
function selectIncludeHistory()
{
    $personid = $_REQUEST["PID"];
    $temp = manage_staff_include_history::GetAllStaffIncludeHistory($personid);
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
Example #6
0
function GetAllLoans()
{
    $where = "1=1";
    $whereParam = array();
    if (isset($_GET["IsCustomer"])) {
        $where .= " AND IsCustomer=true";
    }
    if (isset($_GET["IsPlan"])) {
        $where .= " AND IsPlan='YES'";
    }
    if (!empty($_GET["GroupID"])) {
        $where .= " AND GroupID=:g";
        $whereParam[":g"] = $_GET["GroupID"];
    }
    if (!empty($_REQUEST["LoanID"])) {
        $where .= " AND LoanID=:l";
        $whereParam[":l"] = $_REQUEST["LoanID"];
    }
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "") {
        $where .= " AND " . $field . " LIKE :qry ";
        $whereParam[":qry"] = "%" . $_GET["query"] . "%";
    }
    $temp = LON_loans::SelectAll($where, $whereParam);
    $no = $temp->rowCount();
    $temp = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #7
0
function selectAll()
{
    $temp = manage_salary_params::GetAll($_GET["person_type"], $_GET["param_type"], dataReader::makeOrder());
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #8
0
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;
}
function searchSITR()
{
    $where = dataReader::makeOrder();
    $temp = manage_salary_item_report::GetAll($where);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #10
0
function Searchbank()
{
    $where = dataReader::makeOrder();
    $temp = manage_bank::GetAll($where);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
function searchcostCenterItm()
{
    $where = dataReader::makeOrder();
    $temp = manage_cost_center_exception::GetAll($where);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #12
0
function selectAll()
{
    $where = " pe.staff_id = :staff_id ";
    $whereParam = array();
    $whereParam[":staff_id"] = $_POST["staff_id"];
    $where .= dataReader::makeOrder();
    $temp = manage_professor_exe_posts::GetAll($where, $whereParam);
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
Example #13
0
function selectbanchs()
{
    $where = " sfid =" . $_GET['sfid'];
    $where .= dataReader::makeOrder();
    $temp = manage_study_branch::GetAll($where);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
function selectAll()
{
    $where = 'where ( 1=1 )';
    $where .= dataReader::makeOrder();
    $temp = manage_tax_table_types::GetAll($where);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #15
0
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;
}
Example #16
0
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;
}
Example #17
0
function SearchHistoryJob()
{
    $where = " PersonID = :PID ";
    $whereParam = array();
    $whereParam[":PID"] = $_GET["Q0"];
    $no = manage_person_job::CountPersonJob($where, $whereParam);
    $where .= dataReader::makeOrder();
    $where .= isset($_GET["start"]) ? " limit " . $_GET["start"] . "," . $_GET["limit"] : "";
    $temp = manage_person_job::GetAllPersonJob($where, $whereParam);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #18
0
function selectDev()
{
    $where = " d.PersonID = :PID ";
    $whereParam = array();
    $whereParam[":PID"] = $_GET["Q0"];
    /*
    	$field = isset ( $_GET ["fields"] ) ? $_GET ["fields"] : "";
    	
    	if (isset ( $_GET ["query"] ) && $_GET ["query"] != "") {
    	switch ( $field) {
    		case "Title" :
    			$where .= " AND Title LIKE :qry " ;
    			$whereParam[":qry"] = "%" . $_GET["query"] . "%";
    	        
    		break;
    		case "enlisted" :	
    			$where .= " AND enlisted = :qry1 " ;
    			$whereParam[":qry1"] = "%" . $_GET["query"] . "%";
    	
    		break;
    		case "from_date" :
    			$where .= " AND from_date = :qry1 " ;
    			$whereParam[":qry1"] = $_GET["query"];
    			
    		break;
    		case "to_date" :
    			$where .= " AND to_date = :qry1 " ;
    			$whereParam[":qry1"] = $_GET["query"];
    			
    		break;
    		case "amount" :
    			$where .= " AND amount = :qry1 " ;
    			$whereParam[":qry1"] = $_GET["query"];
    		
    		break;
    		case "war_place" :
    			$where .= " AND war_place LIKE :qry ";
    			$whereParam[":qry"] = "%" . $_GET["query"] . "%";
    			
    		break;
    		
    		
    			}
    }
    */
    $no = manage_person_devotion::CountDevotion($where, $whereParam);
    $where .= dataReader::makeOrder();
    $where .= isset($_GET["start"]) ? " limit " . $_GET["start"] . "," . $_GET["limit"] : "";
    $temp = manage_person_devotion::GetAllDevotions($where, $whereParam);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #19
0
function selectAll()
{
    $where = " where (1=1)";
    if ($_GET["tax_table_type_id"] != "") {
        $where .= " AND tax_table_type_id=:ttid ";
        $whereParam[":ttid"] = $_GET["tax_table_type_id"];
    }
    $where .= dataReader::makeOrder();
    $temp = manage_Tax_Table::GetAll($_GET["tax_table_type_id"], $where, $whereParam);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #20
0
function selectEduc()
{
    $where = " pe.PersonID = :PID ";
    $whereParam = array();
    $whereParam[":PID"] = $_GET["Q0"];
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "") {
        switch ($field) {
            case "fname":
                $where .= " AND fname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "lname":
                $where .= " AND lname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "birth_date":
                $where .= " AND birth_date = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "idcard_no":
                $where .= " AND idcard_no = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "father_name":
                $where .= " AND Fname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "Title":
                $where .= " AND Title LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "insure_type":
                // شماره بیمه
                $where .= " AND insure_type LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
        }
    }
    $no = manage_person_education::CountEducation($where, $whereParam);
    $where .= dataReader::makeOrder();
    $where .= isset($_GET["start"]) ? " limit " . $_GET["start"] . "," . $_GET["limit"] : "";
    $temp = manage_person_education::GetAllEducations($where, $whereParam);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #21
0
function selectEmp()
{
    $where = " eh.PersonID = :PID ";
    $whereParam = array();
    $whereParam[":PID"] = $_GET["Q0"];
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "") {
        switch ($field) {
            case "organization":
                $where .= " AND organization LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "unit":
                $where .= " AND unit LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "from_date":
                $where .= " AND from_date = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "to_date":
                $where .= " AND to_date = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "org_title":
                $where .= " AND org_title = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "unempTitle":
                $where .= " AND unempTitle = :qry1 ";
                $whereParam[":qry1"] = $_GET["query"];
                break;
            case "title":
                $where .= " AND title LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
        }
    }
    $no = manage_person_employment::CountEmp($where, $whereParam);
    $where .= dataReader::makeOrder();
    $where .= isset($_GET["start"]) ? " limit " . $_GET["start"] . "," . $_GET["limit"] : "";
    $temp = manage_person_employment::GetAllEmp($where, $whereParam);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Example #22
0
function not_assigned_items()
{
    $query = '
		SELECT s.salary_item_type_id,s.full_title
		FROM salary_item_types s
				LEFT OUTER JOIN writ_salary_items wsi ON(wsi.salary_item_type_id = s.salary_item_type_id AND wsi.writ_id = :wid AND wsi.writ_ver = :wver)
				,writs w 
		WHERE
			w.writ_id = :wid AND w.writ_ver = :wver AND w.staff_id = :stid AND
			(s.person_type = w.person_type OR s.person_type = ' . PERSON_TYPE_ALL . ' OR s.person_type = if(w.person_type != 1, 101,0)) AND
			s.compute_place = ' . SALARY_ITEM_COMPUTE_PLACE_WRIT . ' AND
			(s.user_data_entry = ' . USER_DATA_ENTRY . ' OR s.editable_value = 1) AND
			(s.validity_start_date IS NULL OR s.validity_start_date <= w.execute_date) AND
			(s.validity_end_date IS NULL OR s.validity_end_date = "0000-00-00" OR s.validity_end_date >= w.execute_date) AND
			wsi.salary_item_type_id IS NULL';
    $temp = PdoDataAccess::runquery($query, array(":wid" => $_GET["writ_id"], ":wver" => $_GET["writ_ver"], ":stid" => $_GET["staff_id"]));
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
Example #23
0
function selectTemplateItems()
{
    $where = "";
    $params = array();
    if (!empty($_REQUEST["TemplateID"])) {
        $where .= " AND TemplateID in(0,:t)";
        $params[":t"] = $_REQUEST["TemplateID"];
    }
    if (!empty($_GET["query"])) {
        $field = empty($_GET["field"]) ? "" : $_GET["field"];
    }
    if (!empty($_REQUEST["NotGlobal"])) {
        $where .= " AND TemplateID >0";
    }
    $temp = CNT_TemplateItems::Get($where . " order by TemplateItemID", $params);
    if (!empty($_REQUEST["limit"])) {
        $res = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    } else {
        $res = $temp->fetchAll();
    }
    echo dataReader::getJsonData($res, $temp->rowCount(), $_GET["callback"]);
    die;
}
Example #24
0
function selectBases()
{
    $where = " (1=1) ";
    $whereParam = array();
    $field = isset($_GET["fields"]) ? $_GET["fields"] : "";
    if (isset($_GET["query"]) && $_GET["query"] != "") {
        switch ($field) {
            case "title":
                $where .= " AND title LIKE :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "BaseValue":
                $where .= " AND BaseValue = :qry ";
                $whereParam[":qry"] = $_GET["query"];
                break;
            case "typeName":
                $where .= " AND i.Title like :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "fullName":
                $where .= " AND concat(pfname,' ',plname) like :qry ";
                $whereParam[":qry"] = "%" . $_GET["query"] . "%";
                break;
            case "ExecuteDate":
                $where .= " AND ExecuteDate = :qry ";
                $whereParam[":qry"] = DateModules::shamsi_to_miladi($_GET["query"]);
                break;
        }
    }
    $where .= dataReader::makeOrder();
    $temp = manage_bases::GetAll($where, $whereParam);
    $no = count($temp);
    $temp = array_slice($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
<?php

include "class/Database.php";
include "class/dictionary_class.php";
// Init classes
$spellChecker = new dataReader();
$db = new Database();
// Get rates/regions
$employment_stats = $db->query("SELECT * FROM employment_rates");
$pointIndex = 0;
// Loop through regions
while ($stat = mysql_fetch_array($employment_stats)) {
    // Get twitter feed from region (within 50km of centre)
    $twitter = simplexml_load_file('http://search.twitter.com/search.atom?geocode=' . $stat['lat'] . '%2C' . $stat['long'] . '%2C50km');
    $regionTweets = "";
    $numTweets = 0;
    // Loop through each tweet from region
    foreach ($twitter->entry as $tweet) {
        $newTweet = $tweet->title;
        // Remove @ usernames
        $newTweet = preg_replace('/(^|\\s)@(\\w+)/', '', $newTweet);
        // Remove #tags
        $newTweet = preg_replace('/(^|\\s)#(\\w+)/', '', $newTweet);
        // Remove numbers
        $newTweet = preg_replace('/[0-9]*/', '', $newTweet);
        // Remove URLs
        $newTweet = preg_replace('((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\.&]*)', '', $newTweet);
        // Remove special characters
        $newTweet = preg_replace('/[^A-Za-z0-9_\\s]/', '', $newTweet);
        // Remove RT
        $newTweet = preg_replace('/RT./', '', $newTweet);
Example #26
0
function GetPlanEvents()
{
    $temp = PLN_PlanEvents::Get("AND PlanID=?", array($_REQUEST["PlanID"]));
    //print_r(ExceptionHandler::PopAllExceptions());
    $res = $temp->fetchAll();
    echo dataReader::getJsonData($res, $temp->rowCount(), $_GET["callback"]);
    die;
}
Example #27
0
function selectArrearTransferWrits()
{
    MakeAdvanceSearchWhere($where, $whereParam);
    $state;
    $state = isset($_REQUEST["return"]) ? "1" : "0";
    $stateWhere = "";
    $stateWhere = " w.arrear = " . $state . " AND ";
    $curYear = DateModules::GetYear(DateModules::miladi_to_shamsi(DateModules::Now()));
    $query = "select w.writ_id,\n                     w.writ_ver,\n                     w.staff_id,\n                     w.ouid,\n                     w.issue_date,\n                     w.history_only,\n                     w.corrective,\n                     w.execute_date,\n                     concat(wt.title,' - ', wst.title) as wt_title,\n                     bi_emp_state.title as emp_state_title,\n                     w.ref_letter_no,\n                     w.ref_letter_date,\n                     w.person_type,\n                     concat(p.pfname, ' ', p.plname) fullname,\n                     w.corrective_writ_id,\n                     w.correct_completed,\n\t\t\t\t\t w.view_flag\n\t\t\t\t\n\t\t\t\tfrom staff s\n                              \n        \t\t  LEFT OUTER JOIN writs w ON (w.staff_id = s.staff_id)\n                  LEFT OUTER JOIN writ_types wt ON ((w.writ_type_id = wt.writ_type_id) AND (w.person_type = wt.person_type))\n                  LEFT OUTER JOIN writ_subtypes wst ON (w.writ_subtype_id = wst.writ_subtype_id AND w.writ_type_id = wst.writ_type_id \n                  \t\t\t\t\t\t\t\t\t\t\tAND w.person_type = wst.person_type)\n                  LEFT OUTER JOIN persons p ON (s.PersonID = p.PersonID)\n                  LEFT OUTER JOIN org_new_units o ON (w.ouid = o.ouid)\n                  LEFT JOIN Basic_Info bi_emp_state on(bi_emp_state.TypeID=3 and w.emp_state=bi_emp_state.InfoID)\n                  LEFT JOIN payment_writs pw ON pw.writ_id = w.writ_id and pw.writ_ver = w.writ_ver and pw.staff_id = w.staff_id \n\t\t\t\t  \n\t\t\twhere w.execute_date >= '" . TRANSFER_WRIT_EXE_DATE . "' AND w.state = 3 AND  \n\t\t\t\t  w.execute_date < '" . str_replace("/", "-", DateModules::shamsi_to_miladi($curYear . "/01/01")) . "'  AND\t\t\t\t \n\t\t\t\t  substr(g2j(w.execute_date),1,4) < substr(g2j(writ_recieve_date),1,4) AND \n\t\t\t\t {$stateWhere}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n                s.person_type in (" . manage_access::getValidPersonTypes() . ") AND w.cost_center_id in (" . manage_access::getValidCostCenters() . ") AND\n\t\t\t\tw.emp_state <> 0 AND\n\t\t\t\t(w.history_only=0 OR w.history_only IS NULL) AND \n\t\t\t\t(w.dont_transfer = 0 OR w.dont_transfer IS NULL) AND\n                ( pw.writ_id is null ) AND\n\t\t\t\t(w.correct_completed!=" . WRIT_CORRECTING . ") AND " . $where . "\n\t\t\t\n\t\t\torder by p.plname,p.pfname,s.staff_id,w.execute_date,w.writ_id,w.writ_ver";
    $temp = PdoDataAccess::runquery($query, $whereParam);
    /*if($_SESSION['UserID'] == 'jafarkhani') {
    	echo PdoDataAccess::GetLatestQueryString(); 
    	die(); 
    }*/
    for ($i = 0; $i < count($temp); $i++) {
        $temp[$i]['full_unit_title'] = manage_units::get_full_title($temp[$i]['ouid']);
    }
    echo dataReader::getJsonData($temp, count($temp), $_GET["callback"]);
    die;
}
Example #28
0
function SelectDocTypes()
{
    $dt = PdoDataAccess::runquery("select * from BaseInfo where TypeID=9");
    echo dataReader::getJsonData($dt, count($dt), $_GET["callback"]);
    die;
}
Example #29
0
 static function SelectSendedLetters($where = "", $param = array())
 {
     $query = "select s.*,l.*, \n\t\t\t\tconcat_ws(' ',fname, lname,CompanyName) ToPersonName,\n\t\t\t\tif(count(DocumentID) > 0,'YES','NO') hasAttach,\n\t\t\t\tsubstr(s.SendDate,1,10) _SendDate\n\t\t\tfrom OFC_send s\n\t\t\t\tjoin OFC_letters l using(LetterID)\n\t\t\t\tjoin BSC_persons p on(s.ToPersonID=p.PersonID)\n\t\t\t\tleft join DMS_documents on(ObjectType='letterAttach' AND ObjectID=s.LetterID)\n\t\t\twhere FromPersonID=:fpid " . $where . "\n\t\t\tgroup by SendID\n\t\t";
     $param[":fpid"] = $_SESSION["USER"]["PersonID"];
     $query .= dataReader::makeOrder();
     return PdoDataAccess::runquery_fetchMode($query, $param);
 }
Example #30
0
function GetAllHolidays()
{
    $where = "";
    $whereParam = array();
    if (!empty($_REQUEST["Year"])) {
        $year = $_REQUEST["Year"];
        $StartDate = DateModules::shamsi_to_miladi($year . "-01-01", "-");
        $EndDate = DateModules::shamsi_to_miladi($year . "-12-" . DateModules::DaysOfMonth($year, 12), "-");
        $where .= " AND TheDate between ? AND ?";
        $whereParam[] = $StartDate;
        $whereParam[] = $EndDate;
    }
    $temp = ATN_holidays::Get($where . dataReader::makeOrder(), $whereParam);
    echo dataReader::getJsonData($temp->fetchAll(), $temp->rowCount(), $_GET["callback"]);
    die;
}