コード例 #1
0
ファイル: user.php プロジェクト: gauravsaxena21/simantz
     //after return xml shall not run more code.
     break;
 case "savesetting":
     //process submited xml data from grid
     $o->saveSetting();
 case "lookup":
     //return xml table to grid
     include_once "../simantz/class/EBAGetHandler.php";
     $defaultorganization_id = $_SESSION['defaultorganization_id'];
     $lookupdelay = 1000;
     $pagesize =& $_GET["pagesize"];
     $ordinalStart =& $_GET["startrecordindex"];
     $sortcolumn =& $_GET["sortcolumn"];
     $sortdirection =& $_GET["sortdirection"];
     $getHandler = new EBAGetHandler();
     $getHandler->ProcessRecords();
     $wherestring = " WHERE uid>0";
     $o->showLookupUser($wherestring);
     exit;
     //after return xml shall not run more code.
     break;
     break;
 default:
     include "menu.php";
     $xoTheme->addStylesheet("{$url}/modules/simantz/include/popup.css");
     $xoTheme->addScript("{$url}/modules/simantz/include/popup.js");
     $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
     $xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.toolkit.js");
     $xoTheme->addStylesheet("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css");
     $xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js");
     $xoTheme->addScript("{$url}/modules/simantz/include/firefox3_6fix.js");
コード例 #2
0
 public function showSearchGrid($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     $tablename = "sim_simbiz_payment";
     $this->log->showLog(2, "Access showSearchGrid({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     if (empty($sortcolumn)) {
         $sortcolumn = "concat(i.sppayment_prefix,i.document_no)";
     }
     if (empty($sortdirection)) {
         $sortdirection = "DESC";
     }
     ////$sql = "SELECT * FROM $tablename $wherestring ORDER BY " . $sortcolumn . " " . $sortdirection .";";
     $sql = "SELECT i.payment_id,  concat(i.sppayment_prefix,i.document_no) as payment_no, i.document_date, i.subtotal, i.iscomplete,  " . " bp.bpartner_id, bp.bpartner_no,bp.bpartner_name, c.currency_code, u.uname,o.organization_code " . " FROM sim_simbiz_payment i " . " left join sim_bpartner bp on i.bpartner_id=bp.bpartner_id " . " left join sim_currency c on c.currency_id=i.currency_id " . " left join sim_users u on u.uid=i.preparedbyuid " . " left join sim_organization o on o.organization_id=i.organization_id\n                  where issotrx={$this->issotrx}" . " {$wherestring} ORDER BY {$sortcolumn} {$sortdirection}";
     $this->log->showLog(4, "With SQL: {$sql} {$sortdirection}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("payment_id");
     $getHandler->DefineField("bpartner_id");
     $getHandler->DefineField("payment_no");
     $getHandler->DefineField("document_date");
     $getHandler->DefineField("subtotal");
     $getHandler->DefineField("iscomplete");
     $getHandler->DefineField("bpartner_no");
     $getHandler->DefineField("bpartner_name");
     $getHandler->DefineField("currency_code");
     $getHandler->DefineField("uname");
     $getHandler->DefineField("organization_code");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     while ($row = $xoopsDB->fetchArray($query)) {
         if ($rh == "odd") {
             $rh = "even";
         } else {
             $rh = "odd";
         }
         if ($row['iscomplete'] == 1) {
             $iscomplete = "Y";
             $edit = "view";
         } else {
             $edit = "edit";
             $iscomplete = "N";
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['payment_id']);
             $getHandler->DefineRecordFieldValue("payment_id", $row['payment_id']);
             $getHandler->DefineRecordFieldValue("bpartner_id", $row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("payment_no", $row['payment_no']);
             $getHandler->DefineRecordFieldValue("document_date", $row['document_date']);
             $getHandler->DefineRecordFieldValue("amt", $row['subtotal']);
             $getHandler->DefineRecordFieldValue("iscomplete", $iscomplete);
             $getHandler->DefineRecordFieldValue("bpartner_no", $row['bpartner_no']);
             $getHandler->DefineRecordFieldValue("bpartner_name", $row['bpartner_name']);
             $getHandler->DefineRecordFieldValue("currency_code", $row['currency_code']);
             $getHandler->DefineRecordFieldValue("organization_code", $row['organization_code']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->DefineRecordFieldValue("edit", "{$this->paymentfilename}?action={$edit}&payment_id=" . $row['payment_id']);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showPaymentline()");
 }
コード例 #3
0
 public function showApprovallistGrid($wherestring)
 {
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     include_once "../simantz/class/EBAGetHandler.php";
     $getHandler = new EBAGetHandler();
     //var_dump($_GET['StartRecord']) ;
     $this->log->showLog(3, "Load showApprovallistGrid with Query String=" . $_SERVER['QUERY_STRING']);
     $pageSize = 10;
     if (isset($_GET['PageSize'])) {
         $pageSize = $_GET['PageSize'];
         if (empty($pageSize)) {
             $pageSize = 10;
         }
     }
     $ordinalStart = 0;
     if (isset($_GET['StartRecord'])) {
         $ordinalStart = $_GET['StartRecord'];
         if (empty($ordinalStart)) {
             $ordinalStart = 0;
         }
     }
     $sortcolumn = $_GET["SortColumn"];
     //$sortdirection=$_GET["SortDirection"];
     $tablename = "sim_hr_leave";
     $searchemployee_no = $_GET['searchemployee_no'];
     $searchemployee_name = $_GET['searchemployee_name'];
     $searchleave_fromdate = $_GET['searchleave_fromdate'];
     $searchleave_todate = $_GET['searchleave_todate'];
     //$searchleave_no=$_GET['searchleave_no'];
     $searchiscomplete = $_GET['searchiscomplete'];
     $searchishistory = $_GET['searchishistory'];
     $this->log->showLog(2, "Access ShowApprovallisttype({$wherestring})");
     /*
             if(empty($sortcolumn)){
       $sortcolumn="wt.created";
             }
             if(empty($sortdirection)){
       $sortdirection="DESC";
             }
     
     
             $wherestring2 = " WHERE 1 ";
     
             if($searchiscomplete != "true"){
             $wherestring .= " AND lv.iscomplete = '0' ";
             }else{
             $wherestring .= " AND lv.iscomplete = '1' ";
             }
     
             if($searchemployee_no != ""){
             $wherestring .= " AND em.employee_no LIKE '$searchemployee_no' ";
             $whereArray[]=$searchemployee_no;
             }
             if($searchemployee_name != ""){
             $wherestring .= " AND em.employee_name LIKE '$searchemployee_name' ";
             $whereArray[]=$searchemployee_name;
             }
     
             if($searchleave_fromdate != "" && $searchleave_todate != ""){
             $wherestring2 .= " AND a.apply_date BETWEEN '$searchleave_fromdate' AND '$searchleave_todate' ";
             }
     
             if($searchleave_no != ""){
             $wherestring2 .= " AND a.doc_no LIKE '%$searchleave_no' ";
             }
     
             $wherestring .= " AND (wt.target_uid = $this->createdby OR $this->createdby IN (wt.targetparameter_name)
                    OR $this->createdby IN (SELECT uid FROM sim_groups_users_link WHERE groupid = wt.target_groupid)
                    ) ";
     *
     */
     if ($searchemployee_no != "") {
         $wherestrapp .= " AND employee_no LIKE '%{$searchemployee_no}%' ";
     }
     if ($searchemployee_name != "") {
         $wherestrapp .= " AND employee_name LIKE '%{$searchemployee_name}%' ";
     }
     if ($searchemployee_name != "" || $searchemployee_no != "") {
         $sql = "select employee_id from sim_hr_employee where employee_id>0 {$wherestrapp}";
         $this->log->showLog(4, "Fetchappraisal With SQL: {$sql}");
         $query = $xoopsDB->query($sql);
         $i = 0;
         $arremployee_id = "";
         while ($row = $xoopsDB->fetchArray($query)) {
             $i++;
             $employee_id = $row['employee_id'];
             $arremployee_id .= ",'{$employee_id}'";
         }
         $arremployee_id = substr($arremployee_id, 1);
         $wherestring .= " and emp.employee_id in ({$arremployee_id}) ";
     }
     if ($searchleave_fromdate != "" && $searchleave_todate != "") {
         $wherestring .= " AND wt.workflowtransaction_datetime BETWEEN '{$searchleave_fromdate}' AND '{$searchleave_todate}' ";
     }
     $wherestring .= " AND (wt.target_uid = {$this->createdby} OR wt.targetparameter_name LIKE concat('%[',{$this->createdby},']%') " . "  OR {$this->createdby} IN (SELECT uid FROM sim_groups_users_link WHERE groupid = wt.target_groupid)) ";
     //        $wherestring .= " AND wt.iscomplete = 0 ";
     if ($searchiscomplete != "true") {
         $wherestring .= " AND wt.iscomplete = '0' ";
     } else {
         $wherestring .= " AND wt.iscomplete = '1' ";
     }
     $sql = "SELECT wt.*, emp.employee_name, emp.employee_no, emp.employee_id," . " wf.workflow_name,ws.workflowstatus_name,wt.workflowtransaction_description " . " FROM sim_workflowtransaction wt " . " LEFT JOIN sim_hr_employee emp ON wt.person_id = emp.employee_id " . " INNER JOIN sim_workflow wf ON wt.workflow_id = wf.workflow_id " . " INNER JOIN sim_workflowstatus ws ON wt.workflowstatus_id = ws.workflowstatus_id " . " {$wherestring}  ORDER BY wt.created DESC";
     // GROUP BY wt.tablename, wt.primarykey_name, wt.primarykey_value
     //ORDER BY " . $sortcolumn . " " . $sortdirection ." ";
     $this->log->showLog(4, "showApprovallistGrid SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("seq_no");
     $getHandler->DefineField("workflow_name");
     $getHandler->DefineField("workflowstatus_name");
     $getHandler->DefineField("tablename");
     $getHandler->DefineField("primarykey_name");
     $getHandler->DefineField("primarykey_value");
     $getHandler->DefineField("window_workflow");
     $getHandler->DefineField("workflow_name");
     $getHandler->DefineField("employee_name");
     $getHandler->DefineField("apply_date");
     $getHandler->DefineField("doc_no");
     $getHandler->DefineField("person_id");
     $getHandler->DefineField("hyperlink");
     $getHandler->DefineField("workflowstatus_name");
     $getHandler->DefineField("workflowtransaction_description");
     //$getHandler->DefineField("completeleave");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $i = 0;
     while ($row = $xoopsDB->fetchArray($query)) {
         $issubmit = $row['issubmit'];
         if ($searchiscomplete == "true") {
             $issubmit = 1;
         }
         if ($issubmit == 1) {
             $currentRecord = $currentRecord + 1;
             if ($currentRecord > $ordinalStart) {
                 if ($rh == "even") {
                     $rh = "odd";
                 } else {
                     $rh = "even";
                 }
                 $i++;
                 $getHandler->CreateNewRecord($row['workflowtransaction_id']);
                 $getHandler->DefineRecordFieldValue("seq_no", $currentRecord);
                 $getHandler->DefineRecordFieldValue("workflow_name", $row['workflow_name']);
                 $getHandler->DefineRecordFieldValue("tablename", $row['tablename']);
                 $getHandler->DefineRecordFieldValue("primarykey_name", $row['primarykey_name']);
                 $getHandler->DefineRecordFieldValue("primarykey_value", $row['primarykey_value']);
                 $getHandler->DefineRecordFieldValue("window_workflow", $row['window_workflow']);
                 $getHandler->DefineRecordFieldValue("workflowstatus_name", $row['workflowstatus_name']);
                 //$this->getWorkflowTransactionStatus($row['workflowtransaction_id'])
                 $getHandler->DefineRecordFieldValue("employee_name", $row['employee_name'] . " - " . $row['employee_no']);
                 $getHandler->DefineRecordFieldValue("apply_date", $row['created']);
                 $getHandler->DefineRecordFieldValue("doc_no", $row['doc_no']);
                 $getHandler->DefineRecordFieldValue("person_id", $row['person_id']);
                 $getHandler->DefineRecordFieldValue("hyperlink", $row['hyperlink']);
                 $getHandler->DefineRecordFieldValue("workflowstatus_name", $row['workflowstatus_name']);
                 $getHandler->DefineRecordFieldValue("workflowtransaction_description", $row['workflowtransaction_description']);
                 //$getHandler->DefineRecordFieldValue("iscomplete",($row['completeleave'] == 1 ? "Yes" : "No"));
                 $getHandler->DefineRecordFieldValue("operation", "images/docicon.gif");
                 $getHandler->DefineRecordFieldValue("approval", "images/approval.gif");
                 $getHandler->DefineRecordFieldValue("workflowtransaction_id", $row['workflowtransaction_id']);
                 $getHandler->DefineRecordFieldValue("rh", $rh);
                 $getHandler->SaveRecord();
             }
         }
     }
     $getHandler->setErrorMessage($currentRecord);
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showApprovallist()");
 }
コード例 #4
0
 public function showRegion($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     $tablename = "sim_region";
     $country_id = $_GET['country_id'];
     $this->log->showLog(2, "Access ShowCountry({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "seqno, region_name";
     }
     if (empty($sortdirection)) {
         $sortdirection = "ASC";
     }
     $wherestring .= " AND country_id =" . $country_id;
     $sql = "SELECT * FROM {$tablename} {$wherestring} ORDER BY " . $sortcolumn . " " . $sortdirection . ";";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("region_name");
     $getHandler->DefineField("isactive");
     $getHandler->DefineField("seqno");
     $getHandler->DefineField("info");
     $getHandler->DefineField("country_id");
     $getHandler->DefineField("region_id");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     while ($row = $xoopsDB->fetchArray($query)) {
         if ($rh == "even") {
             $rh = "odd";
         } else {
             $rh = "even";
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['region_id']);
             $getHandler->DefineRecordFieldValue("region_name", $row['region_name']);
             $getHandler->DefineRecordFieldValue("isactive", $row['isactive']);
             $getHandler->DefineRecordFieldValue("seqno", $row['seqno']);
             $getHandler->DefineRecordFieldValue("info", "recordinfo.php?id=" . $row['region_id'] . "&tablename=sim_region&idname=region_id&title=Region");
             $getHandler->DefineRecordFieldValue("country_id", $row['country_id']);
             $getHandler->DefineRecordFieldValue("region_id", $row['region_id']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showRegion()");
 }
コード例 #5
0
 public function showBPartnerGroup($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin, $defaultorganization_id;
     $tablename = "sim_bpartnergroup";
     $searchbpartnergroup_name = $_GET['searchbpartnergroup_name'];
     $searchisactive = $_GET['searchisactive'];
     $this->log->showLog(2, "Access showBPartnerGroup({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "seqno,bpartnergroup_name ";
     }
     if (empty($sortdirection)) {
         $sortdirection = "ASC";
     }
     if ($searchisactive != "-" && $searchisactive != "") {
         $wherestring .= " AND isactive ={$searchisactive}";
     }
     if ($searchbpartnergroup_name != "") {
         $wherestring .= " AND bpartnergroup_name LIKE '%" . $searchbpartnergroup_name . "%'";
     }
     $wherestring .= " AND organization_id ={$defaultorganization_id}";
     $sql = "SELECT * FROM {$tablename} {$wherestring} ORDER BY " . $sortcolumn . " " . $sortdirection . ";";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("bpartnergroup_name");
     $getHandler->DefineField("description");
     $getHandler->DefineField("isactive");
     $getHandler->DefineField("seqno");
     $getHandler->DefineField("isdeleted");
     $getHandler->DefineField("info");
     $getHandler->DefineField("bpartnergroup_id");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     while ($row = $xoopsDB->fetchArray($query)) {
         if ($rh == "even") {
             $rh = "odd";
         } else {
             $rh = "even";
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['bpartnergroup_id']);
             $getHandler->DefineRecordFieldValue("bpartnergroup_name", $row['bpartnergroup_name']);
             $getHandler->DefineRecordFieldValue("isactive", $row['isactive']);
             $getHandler->DefineRecordFieldValue("seqno", $row['seqno']);
             $getHandler->DefineRecordFieldValue("isdeleted", $row['isdeleted']);
             $getHandler->DefineRecordFieldValue("info", "recordinfo.php?id=" . $row['bpartnergroup_id'] . "&tablename=sim_bpartnergroup&idname=bpartnergroup_id&title=Business Partner Group");
             $getHandler->DefineRecordFieldValue("description", $row['description']);
             $getHandler->DefineRecordFieldValue("bpartnergroup_id", $row['bpartnergroup_id']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showBPartnerGroup()");
 }
コード例 #6
0
 public function showBPartnerList($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     $tablename = "sim_bpartner";
     $searchchar = $_GET['searchchar'];
     $this->log->showLog(2, "Access showBPartner({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "seqno,bpartner_name ";
     }
     if (empty($sortdirection)) {
         $sortdirection = "ASC";
     }
     if ($searchchar != "") {
         $wherestring .= " AND bp.bpartner_name LIKE '" . $searchchar . "%'";
     }
     $sql = "SELECT bp.*, bpg.bpartnergroup_name, terms_name\r\n              FROM {$tablename} bp\r\n              inner join sim_bpartnergroup bpg on bpg.bpartnergroup_id = bp.bpartnergroup_id\r\n              left join sim_terms te on te.terms_id = bp.terms_id\r\n             {$wherestring} ORDER BY " . $sortcolumn . " " . $sortdirection . ";";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("no");
     $getHandler->DefineField("bpartner_no");
     $getHandler->DefineField("bpartner_name");
     $getHandler->DefineField("bpartnergroup_name");
     $getHandler->DefineField("terms_name");
     $getHandler->DefineField("shortremarks");
     $getHandler->DefineField("isactive");
     $getHandler->DefineField("edit");
     $getHandler->DefineField("bpartner_id");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     while ($row = $xoopsDB->fetchArray($query)) {
         if ($rh == "even") {
             $rh = "odd";
         } else {
             $rh = "even";
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("no", $currentRecord);
             $getHandler->DefineRecordFieldValue("bpartner_no", $row['bpartner_no']);
             $getHandler->DefineRecordFieldValue("bpartner_name", $row['bpartner_name']);
             $getHandler->DefineRecordFieldValue("bpartnergroup_name", $row['bpartnergroup_name']);
             $getHandler->DefineRecordFieldValue("terms_name", $row['terms_name']);
             $getHandler->DefineRecordFieldValue("shortremarks", $row['shortremarks']);
             $getHandler->DefineRecordFieldValue("isactive", $row['isactive'] == 1 ? "Yes" : "No");
             $getHandler->DefineRecordFieldValue("edit", "bpartner.php?action=tablist&mode=edit&bpartner_id=" . $row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("bpartner_id", $row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showBPartnerGroup()");
 }
コード例 #7
0
ファイル: Group.inc.php プロジェクト: gauravsaxena21/simantz
 public function showGroupline($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin, $uid;
     $tablename = "sim_groups_users_link";
     $groupid = $_GET['groupid'];
     $this->log->showLog(2, "Access ShowGroupline({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "u.uname";
     }
     if (empty($sortdirection)) {
         $sortdirection = "ASC";
     }
     if ($uid > 1) {
         $wherestring = " WHERE u.uid>1";
     } else {
         $wherestring = "";
     }
     $sql = "SELECT u.uname,u.name,u.email,u.uid, (select max(linkid) as linkid from {$tablename} gl where gl.uid=u.uid and gl.groupid={$groupid}) as linkid\n                from sim_users u {$wherestring} ORDER BY " . $sortcolumn . " " . $sortdirection . ";";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("name");
     $getHandler->DefineField("linkid");
     $getHandler->DefineField("uid");
     $getHandler->DefineField("groupid");
     $getHandler->DefineField("uname");
     $getHandler->DefineField("email");
     $getHandler->DefineField("selectrow");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     $i = 0;
     while ($row = $xoopsDB->fetchArray($query)) {
         $i++;
         if ($rh == "even") {
             $rh = "odd";
         } else {
             $rh = "even";
         }
         if ($row['linkid'] == "") {
             $selectrow = 0;
         } else {
             $selectrow = 1;
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($i);
             $getHandler->DefineRecordFieldValue("no", $i);
             $getHandler->DefineRecordFieldValue("linkid", $row['linkid']);
             $getHandler->DefineRecordFieldValue("uname", $row['uname']);
             $getHandler->DefineRecordFieldValue("name", $row['name']);
             $getHandler->DefineRecordFieldValue("uid", $row['uid']);
             $getHandler->DefineRecordFieldValue("groupid", $groupid);
             $getHandler->DefineRecordFieldValue("email", $row["email"]);
             $getHandler->DefineRecordFieldValue("selectrow", $selectrow);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showGroupline()");
 }
コード例 #8
0
ファイル: Batch.php プロジェクト: gauravsaxena21/simantz
 public function showBatchline($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     $tablename = "sim_simbiz_transaction";
     $this->log->showLog(2, "Access showBatchline({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "batchline_date";
     }
     if (empty($sortdirection)) {
         $sortdirection = "DESC";
     }
     $orderbystr = " temp_parent_id ASC, row_typeline ASC, seqno ASC, trans_id DESC ";
     ////$sql = "SELECT * FROM $tablename $wherestring ORDER BY " . $sortcolumn . " " . $sortdirection .";";
     $sql = "SELECT bt.*,tx.total_tax FROM {$tablename} bt\r\n        LEFT JOIN sim_simbiz_tax tx ON bt.tax_id = tx.tax_id\r\n        {$wherestring} ORDER BY {$orderbystr} ";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("trans_id");
     $getHandler->DefineField("accounts_cell");
     $getHandler->DefineField("bpartner_cell");
     $getHandler->DefineField("document_no2");
     $getHandler->DefineField("organization_cell");
     $getHandler->DefineField("track1_cell");
     $getHandler->DefineField("track2_cell");
     $getHandler->DefineField("track3_cell");
     $getHandler->DefineField("amt_debit");
     $getHandler->DefineField("amt_credit");
     $getHandler->DefineField("document_no");
     $getHandler->DefineField("rh");
     $getHandler->DefineField("row_typeline");
     $getHandler->DefineField("reference_id");
     $getHandler->DefineField("temp_parent_id");
     $getHandler->DefineField("linedesc");
     $getHandler->DefineField("imgadd");
     $getHandler->DefineField("seqno");
     $getHandler->DefineField("tax_cell");
     $getHandler->DefineField("total_tax");
     //        $getHandler->DefineField("currency_id");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     $temp_parent_id = 0;
     while ($row = $xoopsDB->fetchArray($query)) {
         $url_addimg = "images/add_line.gif";
         //            if($row['row_typeline'] == 1 ){
         //            $rh="journalParent";
         //            }else{
         //            $rh="journalChild";
         //            $url_addimg = "";
         //            }
         if ($row['reference_id'] == 0) {
             $rh = "journalParent";
             if ($row['row_typeline'] == 0) {
                 $row['row_typeline'] = 1;
             }
             if ($row['temp_parent_id'] == 0) {
                 $temp_parent_id++;
                 $row['temp_parent_id'] = $temp_parent_id;
             }
         } else {
             $rh = "journalChild";
             $url_addimg = "";
             if ($row['row_typeline'] == 0) {
                 $row['row_typeline'] = 2;
             }
             if ($row['temp_parent_id'] == 0) {
                 $row['temp_parent_id'] = $temp_parent_id;
             }
         }
         //$total_tax = getTotalTax($row['tax_id']);
         $amt_debit = "0.00";
         $amt_credit = "0.00";
         if ($row['amt'] > 0) {
             $amt_debit = $row['amt'];
         } else {
             if ($row['amt'] < 0) {
                 $amt_credit = -1 * $row['amt'];
             }
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['trans_id']);
             $getHandler->DefineRecordFieldValue("trans_id", $row['trans_id']);
             $getHandler->DefineRecordFieldValue("accounts_cell", $row['accounts_id']);
             $getHandler->DefineRecordFieldValue("bpartner_cell", $row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("document_no2", $row['document_no2']);
             $getHandler->DefineRecordFieldValue("organization_cell", $row['branch_id']);
             $getHandler->DefineRecordFieldValue("track1_cell", $row['track_id1']);
             $getHandler->DefineRecordFieldValue("track2_cell", $row['track_id2']);
             $getHandler->DefineRecordFieldValue("track3_cell", $row['track_id3']);
             $getHandler->DefineRecordFieldValue("amt_debit", $amt_debit);
             $getHandler->DefineRecordFieldValue("amt_credit", $amt_credit);
             $getHandler->DefineRecordFieldValue("document_no", $row['document_no']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->DefineRecordFieldValue("row_typeline", $row['row_typeline']);
             $getHandler->DefineRecordFieldValue("temp_parent_id", $row['temp_parent_id']);
             $getHandler->DefineRecordFieldValue("imgadd", $url_addimg);
             $getHandler->DefineRecordFieldValue("linedesc", $row['linedesc']);
             $getHandler->DefineRecordFieldValue("reference_id", $row['reference_id']);
             $getHandler->DefineRecordFieldValue("tax_cell", $row['tax_id']);
             $getHandler->DefineRecordFieldValue("total_tax", $row['total_tax']);
             $getHandler->DefineRecordFieldValue("seqno", $row['seqno']);
             //             $getHandler->DefineRecordFieldValue("currency_id",$row['currency_id']);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showBatchline()");
 }
コード例 #9
0
ファイル: BPartner.php プロジェクト: gauravsaxena21/simantz
 public function showFollowup($wherestring)
 {
     include "../simantz/class/nitobi.xml.php";
     $getHandler = new EBAGetHandler();
     $this->log->showLog(3, "Load Grid with Query String=" . $_SERVER['QUERY_STRING']);
     $pagesize = $_GET["PageSize"];
     $ordinalStart = $_GET["StartRecordIndex"];
     $sortcolumn = $_GET["SortColumn"];
     $sortdirection = $_GET["SortDirection"];
     global $xoopsDB, $wherestring, $xoopsUser, $isadmin;
     $tablename = "sim_followup";
     $this->log->showLog(2, "Access showFollowup({$wherestring})");
     if (empty($pagesize)) {
         $pagesize = $this->defaultpagesize;
     }
     if (empty($ordinalStart)) {
         $ordinalStart = 0;
     }
     if (empty($sortcolumn)) {
         $sortcolumn = "issuedate, nextfollowupdate";
     }
     if (empty($sortdirection)) {
         $sortdirection = "DESC";
     }
     if ($isadmin != 1) {
         $wherestring .= " AND isdeleted=0";
     }
     $sql = "SELECT * FROM {$tablename} {$wherestring} ORDER BY " . $sortcolumn . " " . $sortdirection . ";";
     $this->log->showLog(4, "With SQL: {$sql}");
     $query = $xoopsDB->query($sql);
     $getHandler->ProcessRecords();
     $getHandler->DefineField("issuedate");
     $getHandler->DefineField("followup_name");
     $getHandler->DefineField("followuptype_id");
     $getHandler->DefineField("bpartner_id");
     $getHandler->DefineField("isactive");
     $getHandler->DefineField("employee_name");
     $getHandler->DefineField("nextfollowupdate");
     $getHandler->DefineField("contactperson");
     $getHandler->DefineField("contactnumber");
     $getHandler->DefineField("description");
     $getHandler->DefineField("info");
     $getHandler->DefineField("followup_id");
     $getHandler->DefineField("rh");
     $currentRecord = 0;
     // This will assist us finding the ordinalStart position
     $rh = "odd";
     while ($row = $xoopsDB->fetchArray($query)) {
         if ($rh == "even") {
             $rh = "odd";
         } else {
             $rh = "even";
         }
         $currentRecord = $currentRecord + 1;
         if ($currentRecord > $ordinalStart) {
             $getHandler->CreateNewRecord($row['followup_id']);
             $getHandler->DefineRecordFieldValue("issuedate", $row['issuedate']);
             $getHandler->DefineRecordFieldValue("followup_name", $row['followup_name']);
             $getHandler->DefineRecordFieldValue("followuptype_id", $row['followuptype_id']);
             $getHandler->DefineRecordFieldValue("bpartner_id", $row['bpartner_id']);
             $getHandler->DefineRecordFieldValue("employee_name", $row['employee_name']);
             $getHandler->DefineRecordFieldValue("nextfollowupdate", $row['nextfollowupdate']);
             $getHandler->DefineRecordFieldValue("contactperson", $row['contactperson']);
             $getHandler->DefineRecordFieldValue("contactnumber", $row['contactnumber']);
             $getHandler->DefineRecordFieldValue("isactive", $row['isactive']);
             $getHandler->DefineRecordFieldValue("description", $row['description']);
             $getHandler->DefineRecordFieldValue("info", "../simantz/recordinfo.php?id=" . $row['followup_id'] . "&tablename=sim_followup&idname=followup_id&title=Follow Up");
             $getHandler->DefineRecordFieldValue("followup_id", $row['followup_id']);
             $getHandler->DefineRecordFieldValue("rh", $rh);
             $getHandler->SaveRecord();
         }
     }
     $getHandler->CompleteGet();
     $this->log->showLog(2, "complete function showFollowup()");
 }