Esempio n. 1
0
function gridSelect()
{
    $where = "1=1";
    $whereParam = array();
    //.................................
    if (!empty($_REQUEST["from_PersonID"])) {
        $where .= " AND p.PersonID>=:fpid";
        $whereParam[":fpid"] = $_REQUEST["from_PersonID"];
    }
    if (!empty($_REQUEST["to_PersonID"])) {
        $where .= " AND p.PersonID<=:tpid";
        $whereParam[":tpid"] = $_REQUEST["to_PersonID"];
    }
    if (!empty($_REQUEST["from_SID"])) {
        $where .= " AND s.staff_id >=:fsid";
        $whereParam[":fsid"] = $_REQUEST["from_SID"];
    }
    if (!empty($_REQUEST["to_SID"])) {
        $where .= " AND s.staff_id <=:tsid";
        $whereParam[":tsid"] = $_REQUEST["to_SID"];
    }
    if (!empty($_REQUEST["pfname"])) {
        $where .= " AND p.pfname like :pfname";
        $whereParam[":pfname"] = "%" . $_REQUEST["pfname"] . "%";
    }
    if (!empty($_REQUEST["plname"])) {
        $where .= " AND p.plname like :plname";
        $whereParam[":plname"] = "%" . $_REQUEST["plname"] . "%";
    }
    if (!empty($_REQUEST["ouid"])) {
        $where .= " AND ( u.ouid = :ouid OR u.parent_path LIKE '%,:ouid,%' OR  u.parent_path LIKE '%:ouid,%' OR u.parent_path LIKE '%,:ouid%' ) ";
        $whereParam[":ouid"] = $_REQUEST["ouid"];
    }
    if (isset($_REQUEST["emp_mod"]) && $_REQUEST["emp_mod"] != -1) {
        $where .= " AND w.emp_mode=:mod";
        $whereParam[":mod"] = $_REQUEST["emp_mod"];
    }
    if (!empty($_REQUEST["national_code"])) {
        $where .= " AND national_code = :national_code";
        $whereParam[":national_code"] = $_REQUEST["national_code"];
    }
    if (!empty($_REQUEST["staff_group"]) && $_REQUEST["staff_group"] != -1) {
        $where .= " AND staff_group = :staff_group";
        $whereParam[":staff_group"] = $_REQUEST["staff_group"];
    }
    //.................................
    $field = isset($_REQUEST["fields"]) ? $_REQUEST["fields"] : "";
    if (isset($_REQUEST["query"]) && $_REQUEST["query"] != "") {
        switch ($field) {
            case "fname":
                $where .= " AND fname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_REQUEST["query"] . "%";
                break;
            case "lname":
                $where .= " AND lname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_REQUEST["query"] . "%";
                break;
            case "birth_date":
                $where .= " AND birth_date = :qry1 ";
                $whereParam[":qry1"] = $_REQUEST["query"];
                break;
            case "idcard_no":
                $where .= " AND idcard_no = :qry1 ";
                $whereParam[":qry1"] = $_REQUEST["query"];
                break;
            case "father_name":
                $where .= " AND Fname LIKE :qry ";
                $whereParam[":qry"] = "%" . $_REQUEST["query"] . "%";
                break;
            case "dependency":
                $where .= " AND dependency LIKE :qry ";
                $whereParam[":qry"] = "%" . $_REQUEST["query"] . "%";
                break;
            case "insure_type":
                $where .= " AND insure_type LIKE :qry ";
                $whereParam[":qry"] = "%" . $_REQUEST["query"] . "%";
                break;
        }
    }
    $where .= dataReader::makeOrder();
    $temp = manage_person::GetAllPersons($where, $whereParam, true);
    $no = $temp->rowCount();
    $temp = PdoDataAccess::fetchAll($temp, $_GET["start"], $_GET["limit"]);
    echo dataReader::getJsonData($temp, $no, $_GET["callback"]);
    die;
}
Esempio n. 2
0
//---------------------------
// programmer:	Mahdipour
// create Date:	94.11
//---------------------------
require_once "../../../header.inc.php";
require_once "../data/person.data.php";
require_once '../../staff/class/staff.class.php';
//require_once '../../staff/class/staff_detasils.php';
//require_once ("../../../organization/org_units/unit.class.php");
require_once inc_dataGrid;
//-----------------------------------------------
$personID = !empty($_POST["Q0"]) ? $_POST["Q0"] : "";
$FacilID = isset($_POST["MenuID"]) ? $_POST["MenuID"] : "";
if (!empty($personID)) {
    $obj = manage_person::SearchPerson($personID);
    $SummeryInfo = manage_person::GetAllPersons("p.personid = :PID  ", array(":PID" => $personID));
    $staffInfo = new manage_staff("", "", $SummeryInfo[0]["staff_id"]);
} else {
    $SummeryInfo[0]['FacCode'] = NULL;
    $SummeryInfo[0]['EduGrpCode'] = NULL;
    $SummeryInfo[0]['ProCode'] = NULL;
    $obj = new manage_person();
    $staffInfo = new manage_staff();
}
//--------------------------------------------------------------------
$drp_issue_countries = manage_domains::DRP_Countries("country_id", "", $obj->country_id, "", "70");
$drp_nationality = manage_domains::DRP_Countries("nationality", "", $obj->nationality, "", "157");
$drp_banks = manage_domains::DRP_banks("bank_id", $staffInfo->bank_id, "width:150 px", "-");
$dg = new sadaf_datagrid("includeHistory", $js_prefix_address . "../../staff/data/staff_include_history.data.php?task=selectIncludeHistory&PID=" . $personID, "includeHistoryGRID");
$dg->addColumn("", "include_history_id", "", true);
$dg->addColumn("", "personid", "", true);
Esempio n. 3
0
        $FullWrt = NULL;
    }
}
//............................................
if ($objWrt->corrective && $objWrt->history_only != 0) {
    $is_new_corrective = true;
} else {
    $is_new_corrective = false;
}
//............................................
if (empty($_REQUEST["PID"])) {
    $objPerson = new manage_person("", $staff_id);
} else {
    $objPerson = new manage_person($_REQUEST["PID"]);
}
$fullInfo = manage_person::GetAllPersons("p.PersonID=:pid", array(":pid" => $objPerson->PersonID));
//............................................
if (isset($_REQUEST["ExeDate"])) {
    $exedate = $_REQUEST["ExeDate"];
} else {
    $exedate = $FullWrt[0]['execute_date'];
}
//............................................
$state = $FullWrt[0]["state"];
//............................................
$readOnly = false;
$state = manage_writ::get_writ_state($_REQUEST["WID"], $writver, $_REQUEST["STID"]);
$pay_calc = manage_writ::check_for_use_in_pay_calc($_REQUEST["WID"], $writver, $_REQUEST["STID"]);
if ($pay_calc == null) {
    if ($state == WRIT_PERSONAL && ($objWrt->check_corrective_state() == 'NOT_CORRECTING' || $objWrt->writ_has_new_version())) {
        ExceptionHandler::PushException('اين حکم در صدور حکم اصلاحي استفاده شده است و امکان تغيير آن وجود ندارد', ExceptionHandler::ExceptionType_warning);