function MoveUnit() { $obj = new manage_units(); $obj->parent_ouid = $_POST["desc_ouid"]; $obj->parent_path = !isset($_POST["parent_path"]) || $_POST["parent_path"] == "" ? $obj->parent_ouid : $_POST["parent_path"] . "," . $obj->parent_ouid; $obj->ouid = $_POST["source_ouid"]; $obj->EditUnit(); echo "true"; die; }
static function GetAll($where) { $query = " select el.* , bi.title person_title\r\n from evaluation_lists el left join Basic_Info bi on el.person_type = bi.InfoID and bi.TypeID = 16\r\n " . $where; $tmp = parent::runquery($query); for ($i = 0; $i < count($tmp); $i++) { $tmp[$i]['unit_full_title'] = manage_units::get_full_title($tmp[$i]['ouid']); } return $tmp; }
function GetSalaryReceipt($personid = "") { $query = " select p.staff_id ,p.pay_year , p.pay_month ,p.payment_type , concat(bi.title,' ',p.pay_year ) pay_year_month ,\n\t\t\t\t\t\t SUM(pi.pay_value + pi.diff_pay_value) pay_sum,\n\t\t\t\t\t\t SUM(pi.get_value + pi.diff_get_value) get_sum,\n\t\t\t\t\t\t SUM(pi.pay_value + pi.diff_pay_value - pi.get_value - pi.diff_get_value) pure_pay , w.ouid\n\n\t\t\t\t\t\t\t\t\t\t\tfrom hrmstotal.payments p inner join staff s\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton p.staff_id = s.staff_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinner join persons per\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton per.personid = s.personid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinner join hrmstotal.payment_items pi\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t on p.staff_id = pi.staff_id and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t p.payment_type = pi.payment_type and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t p.pay_year = pi.pay_year and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t p.pay_month = pi.pay_month\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinner join hrmstotal.Basic_Info bi\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t on bi.typeid = 41 and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t p.pay_month = bi.infoid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft join writs w\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ton p.writ_id = w.writ_id and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.writ_ver = w.writ_ver and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.staff_id = w.staff_id\n\n\t\t\t\t\t\t\t\t\twhere per.personid =:pid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tgroup by p.pay_year ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.pay_month,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.staff_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tp.payment_type,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tper.PersonID\n\t\t\t\t\t\t\t\t\torder by p.pay_year DESC,p.pay_month DESC "; $whereParam[":pid"] = $personid; $tmp = PdoDataAccess::runquery($query, $whereParam); for ($i = 0; $i < count($tmp); $i++) { $tmp[$i]['full_unit_title'] = manage_units::get_full_title($tmp[$i]['ouid']); } return $tmp; }
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; }
<?php //--------------------------- // programmer: Mahdipour // create Date: 91.04 //--------------------------- require_once '../header.inc.php'; require_once inc_dataReader; require_once inc_manage_unit; $whereDate = ""; $whereW = ""; if (!empty($_REQUEST['FDATE']) && $_REQUEST['FDATE'] != '0000-00-00') { $whereDate = " AND tbl2.execute_date>='" . $_REQUEST['FDATE'] . "'"; $whereW = " AND w.execute_date >= '" . $_REQUEST['FDATE'] . "' "; } if (!empty($_REQUEST['TDATE']) && $_REQUEST['TDATE'] != '0000-00-00') { $whereDate .= " AND tbl2.execute_date<='" . $_REQUEST['TDATE'] . "'"; $whereW .= " AND w.execute_date <= '" . $_REQUEST['TDATE'] . "'"; } $qry = " select tbl1.staff_id , tbl0.pfname , tbl0.plname , tbl0.national_code , tbl2.ouid , bi1.Title educatin_title , bi2.Title emp_state , tbl0.birth_date , \r\n bi3.Title marital_title , tbl2.children_count , sf.ptitle field_title , tbl1.work_start_date , wt.title writ_type_title , wst.title sub_writ_title ,\r\n tbl2.writ_id , tbl2.writ_ver , bi4.Title emp_mode_title \r\n \r\n from persons as tbl0\r\n left join staff as tbl1 on(tbl0.PersonID=tbl1.PersonID )\r\n left join (SELECT staff_id,\r\n SUBSTRING_INDEX(SUBSTRING(max_execute_date,11),'.',1) writ_id,\r\n SUBSTRING_INDEX(max_execute_date,'.',-1) writ_ver\r\n FROM (SELECT w.staff_id,\r\n max( CONCAT(w.execute_date,w.writ_id,'.',w.writ_ver) ) max_execute_date\r\n FROM writs w\r\n INNER JOIN staff ls\r\n ON(w.staff_id = ls.staff_id)\r\n WHERE \r\n w.history_only = 0 and w.person_type = " . $_REQUEST['pt'] . " " . $whereW . " \r\n GROUP BY w.staff_id ) med) as mtbl2 on(tbl1.staff_id=mtbl2.staff_id)\r\n\r\n inner join writs as tbl2 on mtbl2.staff_id = tbl2.staff_id and\r\n mtbl2.writ_id = tbl2.writ_id and mtbl2.writ_ver = tbl2.writ_ver \r\n inner join Basic_Info bi1 on bi1.InfoID = tbl2.education_level and bi1.typeid = 6 \r\n inner join Basic_Info bi2 on bi2.InfoID = tbl2.emp_state and bi2.typeid = 3 \r\n inner join Basic_Info bi3 on bi3.InfoID = tbl2.marital_status and bi3.typeid = 15 \r\n inner join study_fields sf on sf.sfid = tbl2.sfid \r\n inner join writ_types wt on wt.writ_type_id = tbl2.writ_type_id and wt.person_type = tbl2.person_type\r\n inner join writ_subtypes wst on wst.person_type = tbl2.person_type and \r\n wst.writ_type_id = tbl2.writ_type_id and \r\n wst.writ_subtype_id = tbl2.writ_subtype_id \r\n inner join Basic_Info bi4 on bi4.InfoID = tbl2.emp_mode and bi4.typeid = 4\r\n \r\n\r\n\r\n \r\n\r\n where 1=1 AND tbl2.emp_mode = " . $_REQUEST['emp_mode'] . " \r\n AND tbl1.person_type = " . $_REQUEST['pt'] . " " . $whereDate . "\r\n \r\n \r\n \r\n"; $data = PdoDataAccess::runquery($qry); $record = ""; for ($i = 0; $i < count($data); $i++) { $record .= "<tr><td>" . $i . "</td><td>" . $data[$i]['staff_id'] . "</td><td>" . $data[$i]['pfname'] . "</td><td>" . $data[$i]['plname'] . "</td>\r\n <td>" . $data[$i]['national_code'] . "</td><td>" . manage_units::get_full_title($data[$i]['ouid']) . "</td><td>" . $data[$i]['educatin_title'] . "</td><td>" . $data[$i]['emp_state'] . "</td>\r\n <td>" . DateModules::miladi_to_shamsi($data[$i]['birth_date']) . "</td><td>" . $data[$i]['marital_title'] . "</td><td>" . $data[$i]['children_count'] . "</td><td>" . $data[$i]['field_title'] . "</td>\r\n <td>" . DateModules::miladi_to_shamsi($data[$i]['work_start_date']) . "</td><td>" . $data[$i]['writ_type_title'] . "</td><td>" . $data[$i]['sub_writ_title'] . "</td><td>" . $data[$i]['writ_id'] . "</td>\r\n <td>" . $data[$i]['writ_ver'] . "</td><td>" . $data[$i]['emp_mode_title'] . "</td>\r\n </tr>"; } $tags = array('<!--record-->' => $record, '<!--now-->' => DateModules::shNow()); $content = file_get_contents("FullInformation.htm"); $content = str_replace(array_keys($tags), array_values($tags), $content); echo $content;
ON (s.PersonID = ps.PersonID) LEFT JOIN org_new_units o ON (p.ouid = o.ouid) /* LEFT OUTER JOIN org_new_units o1 ON (o1.ouid = o.parent_ouid) */ ".$qry ; $query .= $where ; $query .=" order by s.staff_id " ; $res = PdoDataAccess::runquery($query) ; for($i=0 ; $i < count($res) ; $i++ ) { $res[$i]['full_unit_title'] = manage_units::get_full_title($res[$i]['ouid']); } ?> <html dir='rtl'> <head> <style> .reportGenerator {border-collapse: collapse;border: 1px solid black;font-family: tahoma;font-size: 8pt; text-align: center;width: 80%;padding: 2px;} .reportGenerator .header {color: white;font-weight: bold;background-color:#3F5F96} .reportGenerator td {border: 1px solid #555555;height: 20px;} </style> <title>گزارش افراد دارای سمت </title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<?php //--------------------------- // programmer: Sh.Jafarkhani // Date: 90.01 //--------------------------- require_once '../../../header.inc.php'; require_once inc_dataReader; require_once inc_manage_unit; $drp_units = manage_units::DRP_Units("org_units", "", "", "210", "(parent_ouid='' or parent_ouid is null)"); $drp_personTypes = manage_domains::DRP_PersonType("person_type", "", "width:90"); $drp_month = manage_domains::DRP_months("tax_normalized_month"); ?> <html> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <?php jsConfig::initialExt(); jsConfig::date(); ?> <script type="text/javascript" src="/HumanResources/global/LOV/LOV.js"></script> <script type="text/javascript"> Ext.onReady(function(){ this.field = new Ext.form.TriggerField({ triggerCls:'x-form-search-trigger', onTriggerClick : function(){ this.setValue(LOV_PersonID()); }, applyTo : "from_PersonID",
function selectAllPosts() { require_once inc_manage_post; $where = "1=1"; $whereParam = array(); //----------------------- if (!empty($_POST["post_no"])) { $where .= " AND p.post_no=:pno"; $whereParam[":pno"] = $_POST["post_no"]; } if (!empty($_POST["post_type"]) && $_POST["post_type"] != -1) { $where .= " AND p.post_type=:ptype"; $whereParam[":ptype"] = $_POST["post_type"]; } if (!empty($_POST["title"])) { $where .= " AND p.title like :title"; $whereParam[":title"] = "%" . $_POST["title"] . "%"; } if (!empty($_POST["ouid"]) && $_POST["ouid"] != -1) { $result = QueryHelper::MK_org_units($_POST["ouid"], isset($_POST["sub_units"]) ? true : false); $where .= " AND " . $result["where"]; $whereParam = array_merge($whereParam, $result["param"]); } $where .= dataReader::makeOrder(); $temp = manage_posts::GetAllPosts($where, $whereParam); $no = count($temp); $temp = array_slice($temp, $_GET["start"], $_GET["limit"]); for ($i = 0; $i < count($temp); $i++) { if ($temp[$i]["ouid"] != "") { $temp[$i]["full_unit_title"] = manage_units::get_full_title($temp[$i]["ouid"]); } else { $temp[$i]["full_unit_title"] = ""; } } echo dataReader::getJsonData($temp, $no, $_GET["callback"]); die; }
} else { ?> <tr class="header"> <td width="10%">شماره شناسایی</td> <td>نام</td> <td>نام خانوادگی</td> <td>عنوان کامل محل خدمت</td> <td>وضعیت استخدامی</td> <td>حالت استخدامی</td> <td>نوع فرد</td> </tr> <? for($i=0; $i< count($data) ; $i++) { echo "<tr> <td>".$data[$i]['staff_id']."</td><td>".$data[$i]['pfname']."</td><td>".$data[$i]['plname']."</td> <td>".manage_units::get_full_title($data[$i]['ouid'])."</td><td>".$data[$i]['emp_state_title']."</td> <td>".$data[$i]['emp_mode_title']."</td><td>".$data[$i]['person_type_title']."</td> </tr>"; } } ?> </table> </center> </body> </html>
function PrintWrit($writ_rec) { $sum = 0; $content = ""; $emp_sal_scores = $emp_sal_vals = ""; $salary_items = $corrective_detail = $professor_post_type = $org_sub_unit_type = $writ_title = $contact_title = $worker_salary_item1_title = $worker_salary_item1_value = $worker_salary_item2_title = $worker_salary_item2_value = $worker_other_salary_items = $worker_base_salary = $emp_sal_items = $template_file = $exe_date_title = ""; $post_title = ""; $os_ptitle = ""; $sit2_annual_inc_coef = ""; $indx = array("الف-", "ب-", "پ-", "ت-", "ث-", "ج-", "چ-", "ح-", "خ-", "د-", "ذ-", "ر-", "ز-", "س-", "ش-", "و-", "ه-", "ي-"); global $equal_payment_system_gdate; // مشخص كردن template مربوط به حكم جاري if ($writ_rec['person_type'] == HR_EMPLOYEE) { if ($writ_rec['emp_state'] == EMP_STATE_PROBATIONAL_CEREMONIOUS || $writ_rec['emp_state'] == EMP_STATE_APPROVED_CEREMONIOUS) { if (DateModules::CompareDate($writ_rec['execute_date'], $equal_payment_system_gdate) >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2013-03-21') >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2014-03-21') < 0) { if ($writ_rec['emp_mode'] == 14) { $template_file = 'employee_ceremonious_writ_print4.htm'; } else { $template_file = 'employee_ceremonious_writ_print2.htm'; } } else { if (DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2013-03-21') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2014-03-20') > 0) { $template_file = 'employee_ceremonious_writ_print3.htm'; } else { $template_file = 'employee_ceremonious_writ_print.htm'; } } } if ($writ_rec['emp_state'] == EMP_STATE_CONTRACTUAL) { if (DateModules::CompareDate($writ_rec['execute_date'], $equal_payment_system_gdate) >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2013-03-21') >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2014-03-20') < 0) { $template_file = 'employee_contractual_writ_print_report2.htm'; } else { if (DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2013-03-21') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2014-03-20') > 0) { $template_file = 'employee_contractual_writ_print_report3.htm'; } else { $template_file = 'employee_contractual_writ_print_report.htm'; } } $writ_title = "قرارداد کارمند پیمانی"; } } else { if ($writ_rec['person_type'] == HR_PROFESSOR) { if ($writ_rec['emp_state'] == EMP_STATE_PROBATIONAL_CEREMONIOUS || $writ_rec['emp_state'] == EMP_STATE_APPROVED_CEREMONIOUS) { $template_file = 'professor_ceremonious_writ_print.htm'; $writ_title = 'حکم استخدام رسمي اعضاي هيات علمي'; } else { if ($writ_rec['emp_state'] == EMP_STATE_SOLDIER_CONTRACTUAL || $writ_rec['emp_state'] == EMP_STATE_ONUS_SOLDIER_CONTRACTUAL || $writ_rec['emp_state'] == EMP_STATE_CONTRACTUAL || $writ_rec['emp_state'] == 11) { $template_file = 'professor_contractual_writ_print_report.htm'; if ($writ_rec['time_limited'] == 1) { $writ_title = 'قرارداد استخدام پيماني اعضاي هيات علمي'; } else { $writ_title = $writ_rec['wst_title'] . ' اعضاي هيات علمي پيماني'; } if ($writ_rec['emp_state'] == 11) { $writ_title = " قرارداد پیمانی (مشروط) اعضای هیئت علمی "; } } } if ($writ_rec['corrective']) { $template_file = 'professor_ceremonious_writ_print.htm'; } } else { if ($writ_rec['person_type'] == HR_WORKER) { $template_file = 'worker_writ_print.htm'; /*if( DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') < 0) $template_file = 'worker_writ_print.htm'; else $template_file = 'worker_writ_print2.htm';*/ if ($writ_rec['corrective']) { $writ_title = 'طرح طبقه بندي مشاغل <br>حكم اصلاحي كارگزيني'; } else { $writ_title = 'طرح طبقه بندي مشاغل <br>حکم کارگزيني'; } } else { if ($writ_rec['person_type'] == HR_CONTRACT) { if (DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2013-03-21') >= 0 && DateModules::CompareDate($writ_rec['execute_date'], '2014-03-20') < 0) { $template_file = 'contract_writ_print.htm'; $writ_title = "قرار داد انجام کار مشخص"; } else { $template_file = 'contract_writ_print3.htm'; $writ_title = "قرارداد کارکنان قراردادی"; } } } } } echo "<div style='display:none'>" . $template_file . "</div>"; // محل تحصيل و زمان اخذ مدرك $person_education_rec = manage_person_education::GetEducationLevelByDate($writ_rec['PersonID'], $writ_rec['execute_date']); $edu_c_ptitle = $person_education_rec['countryTitle']; $edu_u_ptitle = $person_education_rec['universityTitle']; $education_level_title = $writ_rec['education_level_title']; $edu_doc_date = ""; if ($writ_rec['sfid'] != PROFESSIONAL_WITHOUT_CERTIFY) { $edu_doc_date = DateModules::miladi_to_shamsi($person_education_rec['doc_date']); } else { $education_level_title = ""; } // سوابق خدمت $onduty = ""; if ($writ_rec['onduty_year'] > 0) { $onduty .= $writ_rec['onduty_year']; $onduty .= ' سال '; } if ($writ_rec['onduty_month'] > 0) { if ($writ_rec['onduty_year'] > 0) { $onduty .= ' و '; } $onduty .= $writ_rec['onduty_month']; $onduty .= ' ماه '; } if ($writ_rec['onduty_day'] > 0 || $writ_rec['onduty_year'] > 0) { if ($writ_rec['onduty_month'] > 0) { $onduty .= " " . ' و '; } $onduty .= $writ_rec['onduty_day']; $onduty .= ' روز'; } // وضعيت ايثارگري $devotion_recSet = manage_person_devotion::get_person_devotions($writ_rec['PersonID'], NULL, 'ALL'); $devotion_type = ""; if (is_array($devotion_recSet)) { foreach ($devotion_recSet as $devotion_rec) { $devotion_type .= " " . $devotion_rec['devotionTypeName'] . " "; } } // اقلام مربوط به نظام هماهنگ پرداخت if (!$writ_rec['corrective'] && $writ_rec['person_type'] == HR_EMPLOYEE && DateModules::CompareDate($writ_rec['execute_date'], $equal_payment_system_gdate) >= 0 && (DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') < 0 || DateModules::CompareDate($writ_rec['execute_date'], '2013-03-20') > 0 && DateModules::CompareDate($writ_rec['execute_date'], '2014-03-21') < 0)) { $item_recset = manage_writ_item::GetAllWritItems("writ_id=? AND writ_ver=? AND staff_id=?", array($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec["staff_id"])); $emp_sal_items = array(); $Sayer = 0; $Sayer_Score = 0; $score_sum = 0; foreach ($item_recset as $rec) { if ($writ_rec['emp_mode'] == 14) { $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '-->'] = CurrencyModulesclass::toCurrency($rec['value'], 'CURRENCY'); if ($rec['value']) { $emp_sal_vals[$rec['salary_item_type_id']] = $rec['value']; $sum += $rec['value']; } } else { if ($rec['salary_item_type_id'] != 57 && $rec['salary_item_type_id'] != 45) { $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '-->'] = CurrencyModulesclass::toCurrency($rec['value'], 'CURRENCY') . " " . ($rec['value'] < 0 ? '-' : ''); $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '_score-->'] = $rec['param1']; if ($rec['value']) { $emp_sal_vals[$rec['salary_item_type_id']] = $rec['value']; $sum += $rec['value']; } if ($rec['param1']) { $emp_sal_scores[$rec['salary_item_type_id']] = $rec['param1']; $score_sum += $rec['param1']; } } else { $rec['salary_item_type_id'] = 45; $Sayer += $rec['value']; $Sayer_Score += $rec['param1']; $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '-->'] = CurrencyModulesclass::toCurrency($Sayer); $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '_score-->'] = $Sayer_Score != 0 ? $Sayer_Score : ""; if ($rec['value']) { $emp_sal_vals[$rec['salary_item_type_id']] = $Sayer; $sum += $rec['value']; } if ($rec['param1'] > 0) { $emp_sal_scores[$rec['salary_item_type_id']] = $Sayer_Score; $score_sum += $rec['param1']; } } } } if ($emp_sal_scores != "") { $emp_sal_items['<!---fix_salary_score-->'] = CurrencyModulesclass::toCurrency((isset($emp_sal_scores[34]) ? $emp_sal_scores[34] : 0) + (isset($emp_sal_scores[35]) ? $emp_sal_scores[35] : 0) + (isset($emp_sal_scores[36]) ? $emp_sal_scores[36] : 0)); } if ($emp_sal_vals != "") { $emp_sal_items['<!---fix_salary_value-->'] = CurrencyModulesclass::toCurrency((isset($emp_sal_vals[34]) ? $emp_sal_vals[34] : 0) + (isset($emp_sal_vals[35]) ? $emp_sal_vals[35] : 0) + (isset($emp_sal_vals[36]) ? $emp_sal_vals[36] : 0)); } $emp_sal_items['<!---salary_score-->'] = CurrencyModulesclass::toCurrency($score_sum); $emp_sal_items['<!---salary_sum-->'] = CurrencyModulesclass::toCurrency($sum); } else { if (!$writ_rec['corrective'] && $writ_rec['person_type'] == HR_EMPLOYEE && (DateModules::CompareDate($writ_rec['execute_date'], '2013-02-19') >= 0 || DateModules::CompareDate($writ_rec['execute_date'], '2014-03-20') >= 0) || $writ_rec['person_type'] == HR_CONTRACT && ($writ_rec['execute_date'] >= '2013-02-19' || DateModules::CompareDate($writ_rec['execute_date'], '2014-03-21') >= 0)) { $item_recset = manage_writ_item::GetAllWritItems("writ_id=? AND writ_ver=? AND staff_id=?", array($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec["staff_id"])); $emp_sal_items = array(); $Sayer = 0; $Sayer_Score = 0; $score_sum = 0; foreach ($item_recset as $rec) { if ($rec['salary_item_type_id'] == 10364) { $rec['salary_item_type_id'] = 10264; } elseif ($rec['salary_item_type_id'] == 10367) { $rec['salary_item_type_id'] = 10267; } elseif ($rec['salary_item_type_id'] == 10366) { $rec['salary_item_type_id'] = 10266; } elseif ($rec['salary_item_type_id'] == 10365) { $rec['salary_item_type_id'] = 10265; } elseif ($rec['salary_item_type_id'] == 10373) { $rec['salary_item_type_id'] = 10332; } elseif ($rec['salary_item_type_id'] == 10374) { $rec['salary_item_type_id'] = 10333; } elseif ($rec['salary_item_type_id'] == 10328) { $rec['salary_item_type_id'] = 10369; } elseif ($rec['salary_item_type_id'] == 10372) { $rec['salary_item_type_id'] = 10331; } elseif ($rec['salary_item_type_id'] == 10371) { $rec['salary_item_type_id'] = 10330; } elseif ($rec['salary_item_type_id'] == 10370) { $rec['salary_item_type_id'] = 10329; } elseif ($rec['salary_item_type_id'] == 10368) { $rec['salary_item_type_id'] = 10327; } elseif ($rec['salary_item_type_id'] == 10335) { $rec['salary_item_type_id'] = 10376; } elseif ($rec['salary_item_type_id'] == 10334) { $rec['salary_item_type_id'] = 10375; } $emp_sal_items['<!---item_' . $rec['salary_item_type_id'] . '-->'] = CurrencyModulesclass::toCurrency($rec['value'], 'CURRENCY'); //$emp_sal_items['<!---item_'.$rec['salary_item_type_id'].'_score-->'] = $rec['param1']; if ($rec['value']) { $emp_sal_vals[$rec['salary_item_type_id']] = $rec['value']; $sum += $rec['value']; } /*if($rec['param1']) { $emp_sal_scores[$rec['salary_item_type_id']] = $rec['param1'] ; $score_sum += $rec['param1']; }*/ } //$emp_sal_items['<!---salary_score-->'] = CurrencyModulesclass::toCurrency($score_sum); $emp_sal_items['<!---salary_sum-->'] = CurrencyModulesclass::toCurrency($sum); } else { if (!$writ_rec['corrective'] && ($writ_rec['person_type'] == HR_EMPLOYEE || $writ_rec['person_type'] == HR_PROFESSOR)) { ob_start(); $item_recset = manage_writ_item::GetAllWritItems("writ_id=? AND writ_ver=? AND staff_id=?", array($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec["staff_id"])); $counter = 0; $sum = 0; foreach ($item_recset as $rec) { echo "<tr>\n\t\t\t\t<td class='list-beginnormal' width='50%' style='padding-top:2; padding-bottom:2'>\n\t\t\t\t\t<span class='report_data'>" . $indx[$counter] . $rec['print_title']; if ($rec['salary_item_type_id'] == SIT_PROFESSOR_FOR_BYLAW_15_3015) { $content .= ' (' . $rec['param1'] . ' پايه)'; } echo "</span>\n\t\t\t\t </td><td class='list-beginnormal' width='25%' style='padding-top:2; padding-bottom:2'>\n\t\t\t\t\t<span class='report_data'>" . CurrencyModulesclass::toCurrency($rec['value']) . "</span></td>\n\t\t\t\t\t\n\t\t\t\t<td class='list-beginnormal' width='25%' align='center' style='padding-top:2; padding-bottom:2'\n\t\t\t\t\t<span class='report_data'>ريال</span></td>\n\t\t\t</tr>"; $counter++; $sum = $sum + $rec['value']; } if (!$item_recset && $writ_rec['person_type'] == HR_PROFESSOR) { $salary_item_types_recSet = manage_writ_item::GetAllWritItems('person_type = ' . $writ_rec["person_type"] . ' 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 <= '" . $writ_rec['execute_date'] . "' AND (validity_end_date >= '" . $writ_rec['execute_date'] . "' OR validity_end_date IS NULL)" . ' ORDER BY print_order'); if ($salary_item_types_recSet) { foreach ($salary_item_types_recSet as $key => $salary_item_types_rec) { echo "<tr>\n\t\t\t\t\t\t\t<td class='list-beginnormal' colspan='2' style='padding-top:2; padding-bottom:2'>" . $indx[$counter] . $salary_item_types_rec['print_title']; if ($salary_item_types_rec['salary_item_type_id'] == SIT_PROFESSOR_FOR_BYLAW_15_3015) { $content .= ' (' . $salary_item_types_rec['param1'] . ' پايه)'; } echo "</td>\n\t\t\t\t\t\t<td class='list-beginnormal' style='padding-top:2; padding-bottom:2'> ----- </td>\n\t\t\t\t\t\t<td class='list-beginnormal' style='padding-top:2; padding-bottom:2'>ريال</td>\n\t\t\t\t\t</tr>"; $counter++; } } } for ($i = $counter; $i < 8; $i++) { echo "<tr>\n\t\t\t\t<td class='list-beginnormal' width='50%' style='padding-top:2; padding-bottom:2'> </td>\n\t\t\t\t<td class='list-beginnormal' width='25%' style='padding-top:2; padding-bottom:2'> </td>\n\t\t\t\t<td class='list-beginnormal' width='25%' align='center' style='padding-top:2; padding-bottom:2'> </td>\n\t\t\t\t</tr>"; } $salary_items = ob_get_contents(); ob_end_clean(); } } } // اقلام حقوقی کارکنان قراردادی if ($writ_rec["person_type"] == HR_CONTRACT && ($writ_rec["execute_date"] < '2013-02-19' || $writ_rec["execute_date"] >= '2013-03-21')) { $item_recset = manage_writ_item::GetAllWritItems("writ_id=? AND writ_ver=? AND staff_id=?", array($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec["staff_id"])); ob_start(); $sum = 0; for ($i = 0; $i < count($item_recset); $i++) { $sum += $item_recset[$i]['value']; if ($i % 2 == 0 && $item_recset[$i]['value'] > 0) { $val1 = $item_recset[$i]['value'] > 0 ? CurrencyModulesclass::toCurrency($item_recset[$i]['value']) . " ریال" : " "; $title1 = $item_recset[$i]['print_title']; $i++; if ($i < count($item_recset)) { $sum += $item_recset[$i]['value']; $val2 = $item_recset[$i]['value'] > 0 ? CurrencyModulesclass::toCurrency($item_recset[$i]['value']) . " ریال" : " "; $title2 = $item_recset[$i]['print_title']; } else { $val2 = " "; $title2 = " "; } echo "<tr>\n\t\t\t\t\t\t<td>" . $indx[$i - 1] . $title1 . "</td>\n\t\t\t\t\t\t<td align='left' class='money'>" . $val1 . "</td>\n\t\t\t\t\t\t<td> . " . $indx[$i] . $title2 . "</td>\n\t\t\t\t\t\t<td align='left' class='money'>" . $val2 . "</td></tr>"; } } $salary_items = ob_get_contents(); ob_end_clean(); } if (!$writ_rec['corrective'] && $writ_rec['person_type'] == HR_WORKER) { $item_recset = manage_writ_item::GetAllWritItems("writ_id=? AND writ_ver=? AND staff_id=?", array($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec['staff_id'])); if (count($item_recset) > 0) { $worker_salary_item1_title = $item_recset[0]['print_title']; $worker_salary_item1_value = CurrencyModulesclass::toCurrency($item_recset[0]['value']); $worker_salary_item2_title = $item_recset[1]['print_title']; $worker_salary_item2_value = CurrencyModulesclass::toCurrency($item_recset[1]['value']); $worker_base_salary = CurrencyModulesclass::toCurrency($sum); } ob_start(); for ($i = 0; $i <= 9; $i++) { echo "<tr>\n\t\t\t\t\t<td width='80px'>" . (isset($item_recset[$i]) ? $item_recset[$i]['print_title'] : "") . "</td>\n\t\t\t\t\t<td align='left' class='money'>"; $sum += isset($item_recset[$i]) ? $item_recset[$i]['value'] : 0; if (isset($item_recset[$i]) && $item_recset[$i]['value'] > 0) { echo CurrencyModulesclass::toCurrency($item_recset[$i]['value']); } else { echo " "; } echo "</td>\n\t\t\t\t<td style='padding-left:4px' align='left' width='40px'>" . (isset($item_recset[$i]['value']) ? 'ريال' : " ") . "</td></tr>"; if ($i == 1) { echo "<tr>\n\t\t\t\t\t\t<td><span>جمع مزد مبنا:</span></td>\n\t\t\t\t\t\t<td class='money' style='font-size:12px' align='left'>"; echo isset($item_recset[0]) && isset($item_recset[1]) ? CurrencyModulesclass::toCurrency($item_recset[1]['value'] + $item_recset[0]['value']) : ""; echo "</td>\n\t\t\t\t\t\t<td style='padding-left:4px' align='left' width='40px'>ريال</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td style='background-color:#bbbbbb;font-family:titr' colspan=3>20 - مزد مزايا : </td>\n\t\t\t\t\t</tr>"; } } $worker_other_salary_items = ob_get_contents(); ob_end_clean(); } // موارد مربوط به استخدام كشوري if ($writ_rec['person_type'] == HR_EMPLOYEE) { // وضعيت قرارداد استخدام كشوري $prev_writ_obj = manage_writ::get_last_writ_by_date($writ_rec['staff_id'], $writ_rec['execute_date']); $contact_title = $prev_writ_obj->writ_id == "" ? 'انعقاد قرارداد' : 'تمديد قرارداد'; // ضريب افزايش سنواتي استخدام كشوري $WritItemObj = new manage_writ_item($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec['staff_id'], SIT_STAFF_ANNUAL_INC); $sit2_annual_inc_coef = $WritItemObj->param2 * 100; // پست سازماني استخدام كشوري $specialExtraWritItemObj = new manage_writ_item($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec['staff_id'], SIT_EMPLOYEE_SPECIAL_EXTRA); if ($specialExtraWritItemObj->writ_id) { $post_title = $writ_rec['p_title']; if ($specialExtraWritItemObj->param1 >= 600 && $specialExtraWritItemObj->param1 < 1100) { $post_title .= ' (کارشناس ارشد)'; } else { if ($specialExtraWritItemObj->param1 >= 1100 && $specialExtraWritItemObj->param1 < 1600) { $post_title .= ' (کارشناس خبره)'; } else { if ($specialExtraWritItemObj->param1 >= 1600) { $post_title .= ' (کارشناس عالي)'; } } } } else { $post_title = $writ_rec['p_title']; } } if ($writ_rec["person_type"] == HR_CONTRACT) { $post_title = $writ_rec["p_title"] . " - " . $writ_rec["p_post_no"]; } // عنوان كامل واحد سازماني $org_unit_title = $full_title = manage_units::get_full_title($writ_rec['ouid']); $ArrayUnit = preg_split('/-/', $full_title); $cnt = count($ArrayUnit); if ($cnt == 1) { if ($writ_rec['emp_mode'] == 6) { $full_title .= "<b>مامور به </b>" . $writ_rec['MissionPlace']; } if ($writ_rec['emp_mode'] == 16) { $full_title .= "<b>مامور از </b>" . $writ_rec['MissionPlace']; } } if ($cnt > 1) { $full_title = ''; for ($i = 0; $i < $cnt; $i++) { if ($i == $cnt - 1 && $cnt > 1 && $writ_rec['emp_mode'] != 6 && $writ_rec['emp_mode'] != 16) { $full_title .= "<b>شاغل در </b>" . $ArrayUnit[$i]; } else { if ($i == $cnt - 1 && $cnt > 1 && ($writ_rec['emp_mode'] == 6 || $writ_rec['emp_mode'] == 16)) { if ($writ_rec['emp_mode'] == 6) { $full_title .= "<b>مامور به </b>" . $writ_rec['MissionPlace']; } if ($writ_rec['emp_mode'] == 16) { $full_title .= "<b>مامور از </b>" . $writ_rec['MissionPlace']; } } elseif ($i == $cnt - 2) { $full_title .= $ArrayUnit[$i] . " "; } else { $full_title .= $ArrayUnit[$i] . "-"; } } } } if ($writ_rec['emp_mode'] == EMP_MODE_ENGAGEMENT) { $full_title = manage_units::get_full_title($writ_rec['unitCode']); $full_title .= '(حالت اشتغال) '; } else { if ($writ_rec['o_ouid'] != $writ_rec['pos_ouid'] && $writ_rec['pos_ouid']) { $same_org_unit = $writ_rec['ou_ouid'] == $writ_rec['po_ouid']; $full_title = ''; if ($writ_rec['person_type'] == HR_PROFESSOR && ($writ_rec['emp_state'] == EMP_STATE_PROBATIONAL_CEREMONIOUS || $writ_rec['emp_state'] == EMP_STATE_APPROVED_CEREMONIOUS)) { $full_title = 'موقت از '; $full_title .= $writ_rec['pos_ptitle']; $full_title .= ' - شاغل در '; $full_title .= $writ_rec['o_ptitle']; $os_ptitle = $full_title; } else { $full_title = ''; if ($writ_rec['person_type'] == HR_PROFESSOR) { $full_title = 'موقت از '; } $full_title .= manage_units::get_full_title($writ_rec['pouid']); if ($writ_rec['person_type'] == HR_PROFESSOR || $writ_rec['emp_mode'] != 6 && $writ_rec['emp_mode'] != 16) { $full_title .= ' - شاغل در '; if (!$same_org_unit) { $full_title .= $ArrayUnit[0] . ' - '; } for ($i = 1; $i < $cnt; $i++) { if ($i != $cnt - 1) { $full_title .= $ArrayUnit[$i] . ' - '; } else { $full_title .= $ArrayUnit[$i]; } } } else { if ($writ_rec['person_type'] != HR_PROFESSOR && $writ_rec['emp_mode'] == 6) { $full_title .= ' مامور به ' . $writ_rec['MissionPlace']; } else { if ($writ_rec['person_type'] != HR_PROFESSOR && $writ_rec['emp_mode'] == 16) { $full_title .= ' مامور از ' . $writ_rec['MissionPlace']; } } } $os_ptitle = $full_title; } } } if ($writ_rec['emp_mode'] == 13) { $full_title = $ArrayUnit[0]; } //گروه آموزشي / پژوهشي هيات علمي // واحد سازماني فرعي // در صورتي كه پست فرد از يك واحدي غير از واحد سازماني فرد باشد شرح آن در واحد فرعي آمده if (!$os_ptitle) { $os_ptitle = $writ_rec['os_ptitle']; } // موارد مربوط به هيات علمي if ($writ_rec['person_type'] == HR_PROFESSOR) { // نوع پست هيات علمي if ($writ_rec['post_type'] == POST_PROFESSOR_RSC) { $professor_post_type = 'پژوهشي'; } // نوع گروه هيات علمي if ($writ_rec['org_sub_unit_type'] == EDUCATIONAL) { $org_sub_unit_type = ' گروه آموزشي '; } else { if ($writ_rec['org_sub_unit_type'] == RESEARCH) { $org_sub_unit_type = ' گروه پژوهشي '; } } // عنوان حكم if ($writ_rec['corrective']) { $writ_title = 'حکم اصلاحي اعضاي هيات علمي'; } } // موارد مربوط به حكم اصلاحي if ($writ_rec['corrective'] == 1) { // مبلغ درج شده در حكم اصلاحي // در صورتي که حکم اصلاحي جديد است if ($writ_rec['history_only']) { $dt = PdoDataAccess::runquery("SELECT writ_id , writ_ver, staff_id FROM writs\n\t\t\t\t\tWHERE corrective_writ_id = " . $writ_rec["writ_id"] . "\n\t\t\t\t\t\tAND corrective_writ_ver = " . $writ_rec["writ_ver"] . "\n\t\t\t\t\t\tAND staff_id = " . $writ_rec["staff_id"] . "\n\t\t\t\t\tORDER BY execute_date DESC , writ_id DESC , writ_ver DESC "); $corective_writ_rec = $dt[0]; $corective_writ_items_obj = new manage_writ_item($corective_writ_rec["writ_id"], $corective_writ_rec["writ_ver"], $corective_writ_rec["staff_id"], SIT_STAFF_ANNUAL_INC); $sit2_annual_inc_coef = $corective_writ_items_obj->param2 * 100; $sum = manage_writ_item::compute_writ_items_sum($corective_writ_rec["writ_id"], $corective_writ_rec["writ_ver"], $corective_writ_rec["staff_id"]); } else { $sum = manage_writ_item::compute_writ_items_sum($writ_rec['writ_id'], $writ_rec['writ_ver'], $writ_rec["staff_id"]); } } if ($writ_rec['corrective'] != 1) { $exe_date_title = ' <tr height=25> <td colspan=2> 21-تاریخ اجرای حکم : <span>' . DateModules::miladi_to_shamsi($writ_rec['execute_date']) . '</span> </td> </tr>'; } /*****************************************************/ $scores = array(1 => array(1 => 2400, 2 => 2650, 3 => 2650, 4 => 2650, 5 => 2650), 2 => array(1 => 2600, 2 => 2850, 3 => 2850, 4 => 2850, 5 => 2850), 3 => array(1 => 2800, 2 => 3050, 3 => 3050, 4 => 3050, 5 => 3050), 4 => array(1 => 3000, 2 => 3250, 3 => 3600, 4 => 4050, 5 => 4600), 5 => array(1 => 3200, 2 => 3450, 3 => 3800, 4 => 4250, 5 => 4800), 6 => array(1 => 3400, 2 => 3650, 3 => 4000, 4 => 4450, 5 => 5000), 7 => array(1 => 3600, 2 => 3850, 3 => 4200, 4 => 4650, 5 => 5200), 8 => array(1 => 3800, 2 => 4050, 3 => 4400, 4 => 4850, 5 => 5400), 9 => array(1 => 4000, 2 => 4250, 3 => 4600, 4 => 5050, 5 => 5600), 10 => array(1 => 4200, 2 => 4450, 3 => 4800, 4 => 5250, 5 => 5800), 11 => array(1 => 4400, 2 => 4650, 3 => 5000, 4 => 5450, 5 => 6000), 12 => array(1 => 4600, 2 => 4850, 3 => 5200, 4 => 5650, 5 => 6200), 13 => array(1 => 4800, 2 => 5050, 3 => 5400, 4 => 5850, 5 => 6400), 14 => array(1 => 5000, 2 => 5250, 3 => 5600, 4 => 6050, 5 => 6600), 15 => array(1 => 5200, 2 => 5450, 3 => 5800, 4 => 6250, 5 => 6800), 16 => array(1 => 5400, 2 => 5650, 3 => 6000, 4 => 6450, 5 => 7000)); $current_group = $writ_rec['cur_group']; $grup = ""; if ($writ_rec['person_type'] == HR_EMPLOYEE && DateModules::CompareDate($writ_rec['execute_date'], $equal_payment_system_gdate) >= 0) { $s = ""; $indx = $current_group - 4; if ($emp_sal_scores != "" && $emp_sal_scores[34]) { $s = $emp_sal_scores[34]; } else { $writ_obj = manage_writ::get_last_writ_by_date($writ_rec['staff_id'], $writ_rec['execute_date'], 34); if ($writ_obj->writ_id) { $item_obj = new manage_writ_item($writ_obj->writ_id, $writ_obj->writ_ver, $writ_obj->staff_id, 34); $s = $item_obj->param1; } } $grade = ""; if ($scores[$indx][1] == $s) { $grade = 'مقدماتی'; } else { if ($scores[$indx][2] == $s) { $grade = 'پایه'; } else { if ($scores[$indx][3] == $s) { $grade = 'ارشد'; } else { if ($scores[$indx][4] == $s) { $grade = 'خبره'; } else { if ($scores[$indx][5] == $s) { $grade = 'عالی'; } } } } } $current_group = $grade; $grup = $writ_rec['new_grup']; } else { $grup = $writ_rec['old_grup']; } $listPNO = ""; if ($writ_rec['personel_no'] != NULL && $writ_rec['person_type'] == 1) { $listPNO = preg_split('/-/', $writ_rec['personel_no']); } /*****************************************************/ $MilitaryD = ""; if ($writ_rec['militaryID'] != 17) { $MilitaryD = " <militaryDate> شروع : <span><!--military_from_date--></span>\n پایان: <span><!--military_to_date--></span></militaryDate>\n\t\t"; } if ($writ_rec['E_base'] == NULL && ($writ_rec['person_type'] == HR_EMPLOYEE || $writ_rec['person_type'] == HR_CONTRACT)) { $qry = " SELECT w.staff_id,\n\t\t\t\t\t\t\t SUBSTRING_INDEX(SUBSTRING(max(CONCAT(w.execute_date,w.writ_id,'.',w.writ_ver)),11),'.',1) writ_id,\n\t\t\t\t\t\t\t\t\t\tSUBSTRING_INDEX(max(CONCAT(w.execute_date,w.writ_id,'.',w.writ_ver)),'.',-1) writ_ver\n\n\t\t\t\t\t FROM writs w\n\t\t\t\t\t\t\tINNER JOIN staff ls\n\t\t\t\t\t\t\t\tON(w.staff_id = ls.staff_id)\n\t\t\t\t\t\t\tINNER JOIN writ_salary_items wsi\n\t\t\t\t\t\t\t\t\t\tON w.staff_id = wsi.staff_id AND w.writ_id = wsi.writ_id AND\n\t\t\t\t\t\t\t\t\t\t\tw.writ_ver = wsi.writ_ver AND salary_item_type_id = 10364\n\n\t\t\t\t\t WHERE w.staff_id = " . $writ_rec['staff_id']; $tmp2 = PdoDataAccess::runquery($qry); $qry = " select wsi.param8\n\t\t\t\t\t\tfrom writ_salary_items wsi\n\t\t\t\t\t\t\t\t\t\t \n where wsi.staff_id =" . $writ_rec['staff_id'] . " AND wsi.writ_id = " . $tmp2[0]['writ_id'] . " AND \n\t\t\t\t\t\t\t wsi.writ_ver =" . $tmp2[0]['writ_ver'] . " AND wsi.salary_item_type_id = 10364 "; $tmp = PdoDataAccess::runquery($qry); $writ_rec['E_base'] = !empty($tmp[0]['param8']) ? $tmp[0]['param8'] : 0; } if ($writ_rec['E_base'] == NULL || $writ_rec['E_base'] == 0) { if ($writ_rec["sex"] == 1 && $writ_rec["person_type"] == 2 && ($writ_rec["military_duration_day"] > 0 || $writ_rec["military_duration"] > 0)) { $totalDayWrt = DateModules::ymd_to_days($writ_rec["onduty_year"], $writ_rec["onduty_month"], $writ_rec["onduty_day"]); $totalDaySar = DateModules::ymd_to_days(0, $writ_rec["military_duration"], $writ_rec["military_duration_day"]); $resDay = $totalDayWrt - $totalDaySar; $Vyear = 0; $Vmonth = $Vday = 0; DateModules::day_to_ymd($resDay, $Vyear, $Vmonth, $Vday); $writ_rec['E_base'] = $Vyear; //echo $Vyear." ---- ".$baseRes[0]["IsarValue"]."--isa---".$otherPoint ; die() ; } else { $writ_rec['E_base'] = $writ_rec["onduty_year"]; } } if ($writ_rec['ComputeGrade'] == NULL && ($writ_rec['person_type'] == HR_EMPLOYEE || $writ_rec['person_type'] == HR_CONTRACT)) { $qry = " select wsi.param5 ComputeGrade\n\t\t\t\t\t\tfrom writs w inner join writ_salary_items wsi\n\t\t\t\t\t\t\t\t\t\t\ton w.staff_id = wsi.staff_id and\n\t\t\t\t\t\t\t\t\t\t\t\tw.writ_id = wsi.writ_id and\n\t\t\t\t\t\t\t\t\t\t\t\tw.writ_ver = wsi.writ_ver and wsi.salary_item_type_id = 10364\n\n\t\t\t\t\t\t\t\t\t\twhere w.staff_id = " . $writ_rec["staff_id"] . " and \n w.corrective_writ_id = " . $writ_rec["writ_id"] . " and\n\t\t\t\t\t\t\t\t\t\t\tw.corrective_writ_ver = " . $writ_rec["writ_ver"] . "\n\n\t\t\t\t\torder by w.writ_id , w.writ_id\n\n\t\t\t\t\tlimit 1"; $tmp2 = PdoDataAccess::runquery($qry); $writ_rec['ComputeGrade'] = !empty($tmp2[0]['ComputeGrade']) ? $tmp2[0]['ComputeGrade'] : 0; } $GradeTitle = ""; if ($writ_rec['ComputeGrade'] == 1) { $GradeTitle = "مقدماتی"; } elseif ($writ_rec['ComputeGrade'] == 2) { $GradeTitle = "مهارتی"; } elseif ($writ_rec['ComputeGrade'] == 3) { $GradeTitle = "3"; } elseif ($writ_rec['ComputeGrade'] == 4) { $GradeTitle = "2"; } elseif ($writ_rec['ComputeGrade'] == 5) { $GradeTitle = "1"; } if ($writ_rec['marital_status'] == 3) { $writ_rec['marital_status_title'] = 'مجرد'; } else { if ($writ_rec['marital_status'] == 4) { $writ_rec['marital_status_title'] = 'متاهل'; } } $tags = array('<!--personel_no-->' => !empty($listPNO) && count($listPNO) > 1 ? $listPNO[1] . "-" . $listPNO[0] : $writ_rec['personel_no'], '<!--national_code-->' => $writ_rec['national_code'], '<!--ps_pfname-->' => $writ_rec['ps_pfname'], '<!--ps_plname-->' => $writ_rec['ps_plname'], '<!--ps_father_name-->' => $writ_rec['ps_father_name'], '<!--ps_idcard_no-->' => $writ_rec['ps_idcard_no'], '<!--si_ptitle-->' => $writ_rec['si_ptitle'], '<!--ci_ptitle-->' => $writ_rec['ci_ptitle'], '<!--issue_place-->' => $writ_rec['issue_place'], '<!--cb_ptitle-->' => $writ_rec['cb_ptitle'], '<!--ps_birth_place-->' => $writ_rec['ps_birth_place'], '<!--ps_birth_date-->' => DateModules::miladi_to_shamsi($writ_rec['ps_birth_date']), '<!--education_level_title-->' => $education_level_title, '<!--sf_ptitle-->' => $writ_rec['sf_ptitle'], '<!--sbs_title-->' => $writ_rec['sbs_title'], '<!--p_post_no-->' => $writ_rec['p_post_no'], '<!--jc_title-->' => $writ_rec['jc_title'], '<!--jf_title-->' => $writ_rec['jf_title'], '<!--grup-->' => $grup, '<!--E_base-->' => $writ_rec['E_base'], '<!--S_base-->' => $writ_rec['S_base'], '<!--T_base-->' => $writ_rec['T_base'], '<!--I_base-->' => $writ_rec['I_base'], '<!--Total_base-->' => $writ_rec['E_base'] + $writ_rec['S_base'] + $writ_rec['T_base'] + $writ_rec['I_base'], '<!--grade-->' => $GradeTitle, '<!--cur_group-->' => $current_group, '<!--post_title-->' => $post_title, '<!--onduty-->' => $onduty, '<!--sw_ptitle-->' => $writ_rec['sw_ptitle'], '<!--cw_ptitle-->' => $writ_rec['cw_ptitle'], '<!--sit2_annual_inc_coef-->' => $sit2_annual_inc_coef, '<!--marital_status_title-->' => $writ_rec['marital_status'] == 3 ? 'مجرد' : $writ_rec['marital_status_title'], '<!--included_children_count-->' => $writ_rec['sex'] == 1 || $writ_rec['family_responsible'] == 1 ? $writ_rec['included_children_count'] : $writ_rec['children_count'], '<!--contract_start_date-->' => DateModules::miladi_to_shamsi($writ_rec['contract_start_date']), '<!--contract_end_date-->' => DateModules::miladi_to_shamsi($writ_rec['contract_end_date']), '<!--ref_letter_no-->' => $writ_rec['ref_letter_no'], '<!--ref_letter_date-->' => DateModules::miladi_to_shamsi($writ_rec['ref_letter_date']), '<!--writ_type-->' => $writ_rec['writ_type'], '<!--description-->' => nl2br($writ_rec['description']), '<!--sum-->' => CurrencyModulesclass::toCurrency($sum), '<!--sum_str-->' => CurrencyModulesclass::CurrencyToString($sum), '<!--writ_signature_post_owner-->' => $writ_rec['writ_signature_post_owner'], '<!--writ_signature_post_title-->' => $writ_rec['writ_signature_post_title'], '<!--execute_date-->' => DateModules::miladi_to_shamsi($writ_rec['execute_date']), '<!--send_letter_no-->' => $writ_rec['send_letter_no'], '<!--issue_date-->' => DateModules::miladi_to_shamsi($writ_rec['issue_date']), '<!--ref_letter_no-->' => $writ_rec['ref_letter_no'], '<!--ref_letter_date-->' => DateModules::miladi_to_shamsi($writ_rec['ref_letter_date']), '<!--SALARY_ITEMS-->' => $salary_items, '<!--org_unit_title-->' => $org_unit_title, '<!--devotion_type-->' => $devotion_type, '<!--o_ptitle-->' => $writ_rec['ou_ptitle'], '<!--military-->' => $writ_rec['military'], '<!--MilitaryD-->' => $MilitaryD, '<!--sf_title-->' => $writ_rec['sf_title'], '<!--sbs_title-->' => $writ_rec['sbs_title'], '<!--snc_level-->' => $writ_rec['snc_level'], '<!--edu_c_ptitle-->' => $edu_c_ptitle, '<!--edu_u_ptitle-->' => $edu_u_ptitle, '<!--edu_doc_date-->' => $edu_doc_date, '<!--base-->' => $writ_rec['base'], '<!--worktime-->' => $writ_rec['worktime'], '<!--emp_st-->' => $writ_rec['person_type'] == 2 && ($writ_rec['emp_st'] == 3 || $writ_rec['emp_st'] == 4) ? str_replace('رسمی قطعی', 'رسمي', $writ_rec['emp_st']) : $writ_rec['emp_st'], '<!--org_sub_unit_type-->' => $org_sub_unit_type, '<!--os_ptitle-->' => $os_ptitle, '<!--full_title-->' => $full_title, '<!--gnd-->' => $writ_rec['gnd'] == "1" ? "مرد" : "زن", '<!--professor_post_type-->' => $professor_post_type, '<!--writ_title-->' => $writ_title, '<!--wst_title-->' => $writ_rec['wst_title'], '<!--staff_id-->' => $writ_rec['staff_id'], '<!--work_start_date-->' => DateModules::miladi_to_shamsi($writ_rec['work_start_date']), '<!--job_id-->' => $writ_rec['job_id'], '<!--j_title-->' => $writ_rec['j_title'], '<!--job_group-->' => $writ_rec['job_group'], '<!--contact_title-->' => $contact_title, '<!--worker_salary_item1_title-->' => $worker_salary_item1_title, '<!--worker_salary_item1_value-->' => $worker_salary_item1_value, '<!--worker_salary_item2_title-->' => $worker_salary_item2_title, '<!--worker_salary_item2_value-->' => $worker_salary_item2_value, '<!--WORKER_OTHER_SALARY_ITEMS-->' => $worker_other_salary_items, '<--worker_base_salary-->' => $worker_base_salary, '<!--sisIMAGEPATH-->' => "", '<!--exe_date_title-->' => $exe_date_title, '<!--notes-->' => $writ_rec["notes"], '<!--military_from_date-->' => DateModules::miladi_to_shamsi($writ_rec["military_from_date"]), '<!--military_to_date-->' => DateModules::miladi_to_shamsi($writ_rec["military_to_date"]), '<cr>' => '', '</cr>' => '', '<ncr>' => '', '</ncr>' => '', '<tlm>' => '', '</tlm>' => '', '<ntlm>' => '', '</ntlm>' => '', '<sts>' => '', '</nsts>' => '', '<cnt>' => '', '</cnt>' => '', '<ncnt>' => '', '</ncnt>' => ''); if (is_array($emp_sal_items)) { $tags = array_merge($emp_sal_items, $tags); } // مشخص كردن فايل template مربوط به حكم $content .= file_get_contents("PrintWritTemplates/" . $template_file); //حذف قسمتهاي مربوط به حكم اصلاحي از حكم غير اصلاحي و برعكس $rgEx = ""; $sep = ""; if ($writ_rec['corrective']) { $rgEx .= $sep . "<ncr>|<\\/ncr>"; $sep = "|"; } else { $rgEx .= $sep . "<cr>|<\\/cr>"; $sep = "|"; } if (!$writ_rec['time_limited']) { $rgEx .= $sep . "<tlm>|<\\/tlm>"; $sep = "|"; } else { $rgEx .= $sep . "<ntlm>|<\\/ntlm>"; $sep = "|"; } if (!$writ_rec['req_staff_signature']) { $rgEx .= $sep . "<sts>|<\\/sts>"; $sep = "|"; } else { $rgEx .= $sep . "<nsts>|<\\/nsts>"; $sep = "|"; } if ($writ_rec["person_type"] == HR_CONTRACT) { /*if($writ_rec["sex"] == 2) { $rgEx .= $sep . "<children>|<\/children>"; $sep = "|"; }*/ if (in_array($writ_rec['military_type'], array(2, 11, 13, 15, 16))) { $rgEx .= $sep . "<militaryDate>|<\\/militaryDate>"; $sep = "|"; } } $parts = ""; if (preg_match("/(.{$rgEx}.)/", $content)) { $parts = preg_split('/(' . $rgEx . ')/', $content); } if ($parts) { $content = ""; for ($i = 0; $i < count($parts); $i++) { if ($i % 2 == 0) { $content .= $parts[$i]; } } } $content = str_replace(array_keys($tags), array_values($tags), $content); return $content; }
static function change_Retired_Pay() { $query = " select s.staff_id , p.pfname , p.plname , w.ouid , w.state\n\n\t\t\t\t\tfrom staff s inner join writs w\n\t\t\t\t\t\t\t\t\ton s.staff_id = w.staff_id and\n\t\t\t\t\t\t\t\t\t\ts.last_writ_id = w.writ_id and\n\t\t\t\t\t\t\t\t\t\ts.last_writ_ver = w.writ_ver\n\n\t\t\t\t\t\t\t\tleft join staff_include_history sih\n\t\t\t\t\t\t\t\t\ton sih.staff_id = s.staff_id and sih.service_include = 1 and\n\t\t\t\t\t\t\t\t\t\t( sih.end_date is null or sih.end_date = '0000-00-00')\n\n\t\t\t\t\t\t\t\tinner join persons p\n\t\t\t\t\t\t\t\t\ton s.personid = p.personid\n\n\t\t\t\t\twhere s.person_type = 1 and PayRet = 1 and sih.staff_id is null\n\t\t\t\t"; $temp = PdoDataAccess::runquery($query); for ($i = 0; $i < count($temp); $i++) { $temp[$i]['full_unit_title'] = manage_units::get_full_title($temp[$i]['ouid']); } return $temp; }
<?php //--------------------------- // programmer: Jafarkhani // create Date: 88.12 //--------------------------- require_once '../header.inc.php'; require_once 'unit.class.php'; require_once 'unit.data.php'; $ouid = !empty($_GET["ouid"]) ? $_GET["ouid"] : ""; $obj = new manage_units($ouid); $drp_org_unit_types = manage_units::DRP_org_unit_type("org_unit_type", $obj->org_unit_type, "", "200px"); $drp_unitTypes = manage_units::DRP_unitType("UnitType", $obj->UnitType, "", "200px"); $drp_LevelTypes = manage_units::DRP_LevelType("LevelType", $obj->LevelType, "", "200px"); DRP_State_City($state_id, $city_id, "state_id", "ctid", $obj->state_id, $obj->ctid); $drp_costCenters = manage_domains::DRP_CostCenters("ccid", $obj->ccid); ?> <form id="form_newUnit"> <input type="hidden" name="ouid" id="ouid" value="<?php echo isset($_GET["ouid"]) ? $_GET["ouid"] : ""; ?> "/> <input type="hidden" name="parent_ouid" id="parent_ouid" value="<?php echo $_GET["parent_ouid"]; ?> "/> <table width="100%"> <tr> <td width="35%">واحد سازماني رده بالاتر :</td> <td height="21px"><b><?php echo $_GET["parentText"];
function PrintSummary($PersonInfo) { $qry = " select th.post_title,\r\n th.from_date,\r\n th.to_date,\r\n th.d_year,\r\n th.d_month,\r\n th.d_day,\r\n th.accept_type,\r\n th.org_title,\r\n th.emp_state_title,\r\n th.writ_id,\r\n th.writ_date\r\n\r\n from temp_history th\r\n where th.PersonID = " . $PersonInfo["PersonID"]; $history_work = PdoDataAccess::runquery($qry); $history_work_items = " "; ob_start(); echo " <tr>\r\n <td>" . ($PersonInfo['person_type'] == HR_WORKER) ? 'عنوان شغل' : 'عنوان پست' . "</td>\r\n <td>از تاريخ</td>\r\n <td>تا تاريخ</td>\r\n <td>مدت (روز)</td>\r\n <td>مدت (ماه)</td>\r\n <td>مدت (سال)</td>\r\n <td>نوع پذيرش</td>\r\n <td>محل خدمت</td>\r\n <td>نوع خدمت</td>\r\n <td>شماره حکم</td>\r\n <td>تاريخ حکم</td>\r\n </tr>"; for ($j = 0; $j < count($history_work); $j++) { echo " <tr>\r\n <td>" . $history_work[$j]['post_title'] . "</td>\r\n <td>" . $history_work[$j]['from_date'] . "</td>\r\n <td>" . $history_work[$j]['to_date'] . "</td>\r\n <td>" . $history_work[$j]['d_year'] . "</td>\r\n <td>" . $history_work[$j]['d_month'] . "</td>\r\n <td>" . $history_work[$j]['d_day'] . "</td>\r\n <td>" . $history_work[$j]['accept_type'] . "</td>\r\n <td>" . $history_work[$j]['org_title'] . "</td>\r\n <td>" . $history_work[$j]['emp_state_title'] . "</td>\r\n <td>" . $history_work[$j]['writ_id'] . "</td>\r\n <td>" . $history_work[$j]['writ_date'] . "</td>\r\n </tr>\r\n "; } $history_work_items = ob_get_contents(); ob_end_clean(); $prof1 = ' <tr> <td>مرتبه :</td> <td>' . $PersonInfo["science_level"] . '</td> <td>پايه :</td> <td>' . $PersonInfo["base"] . '</td> </tr> '; $studyField = $PersonInfo['field_title'] . " - " . $PersonInfo['branch_title']; $studyPlace = $PersonInfo['country_title'] . " - " . $PersonInfo['university_title']; $unitTitle = manage_units::get_full_title($PersonInfo['ouid']); $prof2 = ' <tr> <td>سمت اجرايي :</td> <td>' . $PersonInfo['exe_post_title'] . '</td> <td>تاريخ سمت اجرايي :</td> <td>' . $PersonInfo['exe_post_from'] . '</td> </tr> '; $tags = array('<!--fname-->' => $PersonInfo['pfname'], '<!--plname-->' => $PersonInfo['plname'], '<!--father_name-->' => $PersonInfo['father_name'], '<!--staff_id-->' => $PersonInfo['staff_id'], '<!--birth_date-->' => $PersonInfo['birth_date'], '<!--birth_place-->' => $PersonInfo['birth_place'], '<!--idcard_no-->' => $PersonInfo['idcard_no'], '<!--national_code-->' => $PersonInfo['national_code'], '<!--prof1-->' => $prof1, '<!--worktime_type-->' => $PersonInfo['worktime_type'], '<!--military_type-->' => $PersonInfo['military_type'], '<!--education_level-->' => $PersonInfo['education_level'], '<!--field_title-->' => $studyField, '<!--doc_date-->' => $PersonInfo['doc_date'], '<!--studyPlace-->' => $studyPlace, '<!--razm-->' => $PersonInfo['razm'], '<!--janbaz-->' => $PersonInfo['janbaz'], '<!--ouid-->' => $unitTitle, '<!--emp_state-->' => $PersonInfo['emp_state'], '<!--post_no-->' => $PersonInfo['post_no'], '<!--last_post_title-->' => $PersonInfo['last_post_title'], '<!--prof2-->' => $prof2, '<!--histroy_work-->' => $history_work_items); // مشخص کردن فایل template مربوط به خلاصه پرونده $content .= file_get_contents("PrintWritTemplates/Summary_doc_report.htm"); $content = str_replace(array_keys($tags), array_values($tags), $content); return $content; }
<td>واحد محل خدمت :</td> <td class="blueText"><input type="text" id="ouid" name="ouid" value="<?php echo $objWrt->ouid; ?> "></td> <td>مرکز هزينه :</td> <td class="blueText"> <?php echo HRSystem == SalarySystem ? $drp_costCenters : $FullWrt[0]['c_title']; ?> </td> </tr> <tr> <td>عنوان کامل واحد محل خدمت :</td> <td colspan="3"><span class="blueText" id="unit_title"><?php echo $objWrt->ouid != "" ? manage_units::get_full_title($objWrt->ouid) : ""; ?> </span> </td> </tr> <?if($objWrt->person_type == HR_EMPLOYEE || $objWrt->person_type == HR_PROFESSOR || $objWrt->person_type == HR_CONTRACT){?> <tr> <td>پست سازمانی :</td> <td><input class="blueText" type="text" id="post_id" name="post_id" style="width:98%" value="<?php echo $objWrt->post_id; ?> "></td> <td colspan="2"> <span class="blueText" id="post_title"> <?php echo $objWrt->post_id != "" ? $FullWrt[0]['post_no'] . "-" . $FullWrt[0]['post_title'] : "";
<?php //--------------------------- // programmer: Jafarkhani // create Date: 88.12 //--------------------------- require_once '../header.inc.php'; require_once 'unit.data.php'; ini_set("display_errors", "On"); $drp_units = manage_units::DRP_Units("org_units", "", "", "210", ""); jsConfig::initialExt(); jsConfig::tree(); jsConfig::window(); require_once 'ManageUnits.js.php'; ?> <body dir="rtl"> <table width="750px"> <tr> <td width="40%"> <div id="tree-div" style="overflow:auto; width:250px;border:1px solid #c3daf9;"></div> </td> <td valign="top" style="padding-right: 5px"> <!-- -------------------------------------------- --> <div id="DIV_NewUnit" class="x-hide-display"> <div id="PNL_NewUnit"> </div> </div> <!-- -------------------------------------------- --> </td> </tr> </table>