コード例 #1
0
ファイル: loan.php プロジェクト: henkmahendra/emms-devel
 function getTemplateData($id)
 {
     global $_LABELS;
     global $_CONF;
     $loan = new LOAN($id);
     $loan->load_borrower($loan->data['client_id']);
     $data = $loan->data;
     $data['status_controls'] = $loan->status_controls();
     if ($loan->survey_check()) {
         $data['survey'] = $_LABELS['results'];
         $data['href_survey'] = sprintf('index.php?scr_name=SV.SCR.viewGraph&client_id=%s&survey_id=%s', $loan->data['client_id'], $_CONF['survey_id']);
     } else {
         $data['survey'] = $_LABELS['applySurvey'];
         $data['href_survey'] = sprintf('index.php?scr_name=SV.SCR.applySurveyStepB&loan_id=%s&client_id=%s&id=%s', $loan->data['id'], $loan->data['client_id'], $_CONF['survey_id']);
     }
     $c = 0;
     if (!$loan->isFrost()) {
         $data['buttondata'][$c]['id'] = "LN.SCR.addILoan";
         $data['buttondata'][$c]['href'] = "index.php?scr_name=LN.SCR.addILoan&ref=LN.SCR.requestILoan&id=" . $id;
         $data['buttondata'][$c]['alt'] = $_LABELS['edit'];
         $data['buttondata'][$c]['onClick'] = "";
         $data['buttondata'][$c]['ico'] = "edit";
         $c++;
     }
     $data['buttondata'][$c]['id'] = "LN.SCR.viewLoanMaster";
     $data['buttondata'][$c]['href'] = sprintf('index.php?scr_name=LN.SCR.viewLoanMaster&id=%s', $data['master_id']);
     $data['buttondata'][$c]['alt'] = $_LABELS['LN.SCR.viewLoanMaster'];
     $data['buttondata'][$c]['onClick'] = "";
     $data['buttondata'][$c]['ico'] = "view";
     $c++;
     if ($loan->data['status'] == 'G') {
         $data['buttondata'][$c]['id'] = "LN.SCR.addPayment";
         $data['buttondata'][$c]['href'] = 'javascript:openWin("index.popup.php?scr_name=LN.SCR.addPayment&ref=LN.SCR.viewILoan&id=' . $id . '","addPayment","menubar=no,scrollbars=yes,resizable=yes,width=700,height=320")';
         $data['buttondata'][$c]['alt'] = $_LABELS['LN.SCR.addPayment'];
         $data['buttondata'][$c]['onClick'] = "";
         $data['buttondata'][$c]['ico'] = "money_payment";
         $c++;
     }
     if ($loan->data['status'] == 'G') {
         $data['buttondata'][$c]['id'] = "LN.SCR.addPaymentFull";
         $data['buttondata'][$c]['href'] = 'javascript:openWin("index.popup.php?scr_name=LN.SCR.addPaymentFull&id=' . $id . '","addPayment","menubar=no,scrollbars=yes,resizable=yes,width=700,height=320")';
         $data['buttondata'][$c]['alt'] = $_LABELS['LN.SCR.addPaymentFull'];
         $data['buttondata'][$c]['onClick'] = "";
         $data['buttondata'][$c]['ico'] = "money_payment_full";
         $c++;
     }
     $data['buttondata'][$c]['id'] = "LN.SCR.pmtPlan";
     $data['buttondata'][$c]['href'] = 'javascript:openWin("index.popup.php?scr_name=LN.SCR.pmtPlan&ref=LN.SCR.viewILoan&id=' . $id . '","pmtPlan","menubar=no,scrollbars=yes,resizable=yes,width=700,height=320")';
     $data['buttondata'][$c]['alt'] = $_LABELS['LN.SCR.pmtPlan'];
     $data['buttondata'][$c]['onClick'] = "";
     $data['buttondata'][$c]['ico'] = "money_plan";
     $c++;
     $data['buttondata'][$c]['id'] = "LN.RPT.loanStatusHistory";
     $data['buttondata'][$c]['href'] = 'javascript:openWin("index.popup.php?scr_name=LN.RPT.loanStatusHistory&ref=LN.SCR.viewILoan&id=' . $id . '","ClientIOM","menubar=no,scrollbars=yes,resizable=yes,width=700,height=320")';
     $data['buttondata'][$c]['alt'] = $_LABELS['statusHistory'];
     $data['buttondata'][$c]['onClick'] = "";
     $data['buttondata'][$c]['ico'] = "money_history";
     $c++;
     return $data;
 }