$o->getFollowupform(); //use nitobi die; break; case "getfollowuptype": //return xml table to grid include_once "../simantz/class/EBAGetHandler.php"; header('Content-type: text/xml'); $lookupdelay = 1000; $pagesize =& $_GET["pagesize"]; $ordinalStart =& $_GET["startrecordindex"]; $sortcolumn =& $_GET["sortcolumn"]; $sortdirection =& $_GET["sortdirection"]; $getHandler = new EBAGetHandler(); $getHandler->ProcessRecords(); $getHandler->DefineField("followup_type"); $wherestring = " WHERE isactive!=0 "; $o->getSelectFollowuptype($wherestring); $getHandler->completeGet(); break; case "editfollowuplayer": $followup_id = $_POST['followup_id']; $o->showEditFollowUpLayer($followup_id); die; break; case "savefollowuplayer": $o->saveFollowUpLayer(); die; break; case "getbpartnerwindow": $bpid = $_POST['bpid'];
} // ******************************************************************* // This code block just sets up the database and tries to figure out what index number // our data starts at. This code has nothing to do with the grid itself so think of it as // business logic. // ******************************************************************* // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblFileSystem WHERE FolderAbsolute LIKE '%" . $searchSubString . "%' LIMIT " . $startingRecordIndex . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("FolderAbsolute"); $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("FolderAbsolute", $row["FolderAbsolute"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
case "district": $myQuery = "SELECT * FROM city WHERE District = '" . $nodeKey . "' AND CountryCode = '" . $nodeKey2 . "' ORDER BY Name;"; break; } $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. // We will let the grid deal with assigning unique IDs - there are many places where we // may have no globally unique key. // $getHandler->DefineField("id"); $getHandler->DefineField("label"); $getHandler->DefineField("nodetype"); $getHandler->DefineField("haschildren"); // A custom metadata attribute $getHandler->DefineField("type"); // And 2 more for multiple keys. $getHandler->DefineField("key"); $getHandler->DefineField("key2"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nodeKeyColumn = ""; $nodeKey2Column = ""; $nodeLabelColumn = ""; $nodeType = ""; switch ($type) {
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()"); }
// Make a MySQL Connection mysql_connect('localhost', 'root', 'moocow') or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblorders WHERE CustomerID=" . $customerID . " ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); $countQuery = "SELECT COUNT(*) AS totalRowCount FROM tblorders where CustomerID=" . $customerID; $totalRows = mysql_result(mysql_query($countQuery), 0); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("OrderDate"); $getHandler->DefineField("ShippedDate"); $getHandler->DefineForeignKey("CustomerID"); $getHandler->DefineForeignKeyValue($customerID); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["OrderID"]); $record->add("OrderID", $row["OrderID"]); $record->add("ProductName", $row["ProductName"]); $record->add("OrderDate", $row["OrderDate"]); $record->add("ShippedDate", $row["ShippedDate"]);
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()"); }
} //Set up the database connection and get the recordset // Make a MySQL Connection mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblproducts ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductCategoryName"); $getHandler->DefineField("ProductSku"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("ProductQuantityPerUnit"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $record = new EBARecord($row["ProductID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductCategoryName", $row["ProductCategoryName"]); $record->add("ProductSku", $row["ProductSku"]); $record->add("ProductPrice", $row["ProductPrice"]);
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()"); }
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()"); }
} //Set up the database connection and get the recordset // Make a MySQL Connection mysql_connect('localhost', 'root', 'root') or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblcontacts3k ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("JobTitle"); $getHandler->DefineField("CompanyName"); $getHandler->DefineField("PhoneNumber"); $getHandler->DefineField("Address"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactName", $row["ContactName"]); $record->add("ContactEmail", $row["ContactEmail"]); $record->add("JobTitle", $row["JobTitle"]);
$log = new Log(); $o = new SimbizLookup(); $action = $_GET['action']; $lookupdelay = 1000; $pagesize =& $_GET["pagesize"]; $ordinalStart =& $_GET["startrecordindex"]; $sortcolumn =& $_GET["sortcolumn"]; $sortdirection =& $_GET["sortdirection"]; $searchstring =& $_GET["SearchString"]; $uid = $xoopsUser->getVar('uid'); $getHandler = new EBAGetHandler(); $getHandler->ProcessRecords(); $showNull = $_GET['showNull']; switch ($action) { case "searchbpartnercombo": $getHandler->DefineField("bpartner_id"); $o->showBPartnerCombo(); break; case "searchbpartnergrid": $getHandler->DefineField("bpartner_id"); $o->showBPartnerGridLookup(); break; case "getaccountlistgrid": //return xml table to grid $getHandler->DefineField("accounts_cell"); $wherestring = " WHERE (accounts_id>0 and placeholder=0) or accounts_id=0 "; $o->getSelectAccountGridLookup($wherestring); break; case "gettaxlistgrid": //return xml table to grid $getHandler->DefineField("tax_cell");
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()"); }
} //Set up the database connection and get the recordset // Make a MySQL Connection $link = mysql_connect($server, $uid, $password) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblproducts ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductCategoryName"); $getHandler->DefineField("ProductSKU"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("ProductQuantityPerUnit"); $getHandler->DefineField("ProductLink"); // hyperlink url $getHandler->DefineField("LastUpdated"); // a date field $getHandler->DefineField("ProductIcon"); // the image for the icon on each row $getHandler->DefineField("BulkAction"); // for the checkbox $getHandler->DefineField("ProductPassword"); //for the password field $getHandler->DefineField("ButtonText");
mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblcontacts3k WHERE ContactName LIKE '%" . $searchSubString . "%' LIMIT " . $startingRecordIndex . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // For the purposes of this demo we have some random icons we're using in the image column. Here they are $CustomerIcons = array("scustomerimage.gif", "scustomerimage2.gif", "scustomerimage3.gif", "scustomerimage4.gif", "scustomerimage5.gif"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("JobTitle"); $getHandler->DefineField("CompanyName"); $getHandler->DefineField("ContactImage"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactName", $row["ContactName"]); $record->add("ContactEmail", $row["ContactEmail"]); $record->add("JobTitle", $row["JobTitle"]); $record->add("CompanyName", $row["CompanyName"]); $record->add("ContactImage", $CustomerIcons[$iconIndex++ % 4]);
// Make a MySQL Connection mysql_connect('localhost', 'root', 'moocow') or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblorders WHERE CustomerID=" . $customerID . " ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); $countQuery = "SELECT COUNT(*) FROM tblorders where CustomerID=" . $customerID; $totalRows = mysql_query($countQuery); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("ProductQuantity"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ProductID"]); $record->add("OrderID", $row["ProductID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("ProductQuantity", $row["ProductQuantity"]); $getHandler->add($record); }
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); header('Content-type: text/xml'); $log = new Log(); $o = new Lookup(); $action = $_GET['action']; $defaultorganization_id = $_SESSION['defaultorganization_id']; $lookupdelay = 1000; $pagesize =& $_GET["pagesize"]; $ordinalStart =& $_GET["startrecordindex"]; $sortcolumn =& $_GET["sortcolumn"]; $sortdirection =& $_GET["sortdirection"]; $getHandler = new EBAGetHandler(); $getHandler->ProcessRecords(); switch ($action) { case "country": $getHandler->DefineField("country_id"); $wherestring = " WHERE country_id>0 and isdeleted=0"; $o->showCountry(); break; case "module": $getHandler->DefineField("mid"); $wherestring = " WHERE mid>0"; $o->showModule(); break; case "window": $getHandler->DefineField("window_id"); $wherestring = " WHERE window_id>=0"; $o->showWindow(); break; case "libwindow": $getHandler->DefineField("window_id");
inner join sim_group_permission gp on gp.gperm_groupid=g.groupid inner join sim_modules m on gp.gperm_itemid=m.mid inner join sim_permission gsp on gsp.groupid=g.groupid inner join sim_window w on gsp.window_id=w.window_id where m.mid=$module_id and gp.gperm_name='module_read' and w.parentwindows_id=$parentwindows_id and u.uid=$uid and w.isactive=1 and w.window_id>0 and ( gsp.validuntil = '0000-00-00' OR gsp.validuntil >= '$currentdate') */ $currentdate = date("Y-m-d", time()); $myQuery = "SELECT distinct(w.window_id) as window_id,w.window_name, w.filename, m.name as modulename,m.dirname\n from sim_groups g\n\t\tinner join sim_groups_users_link gul on g.groupid=gul.groupid\n\t\tinner join sim_users u on gul.uid=u.uid\n\t\tinner join sim_group_permission gp on gp.gperm_groupid=g.groupid\n\t\tinner join sim_modules m on gp.gperm_itemid=m.mid\n\t\tinner join sim_permission gsp on gsp.groupid=g.groupid\n\t\tinner join sim_window w on gsp.window_id=w.window_id\n\t\twhere gp.gperm_name='module_read'\n and w.parentwindows_id={$nodeId} and u.uid={$userid} and\n w.isactive=1 and w.window_id>0\n and ( gsp.validuntil = '0000-00-00' OR gsp.validuntil >= '{$currentdate}')"; $log->showLog(2, "Show parent note with sql : {$myQuery}"); $result = $xoopsDB->query($myQuery) or die(mysql_error()); //system("echo $myQuery >>log.txt"); $getHandler = new EBAGetHandler(); $getHandler->DefineField("window_id"); $getHandler->DefineField("window_name"); $getHandler->DefineField("nodetype"); $getHandler->DefineField("haschildren"); while ($row = $xoopsDB->fetchArray($result)) { $record = new EBARecord($row["window_id"]); $record->add("id", $row["window_id"]); $record->add("label", $row["window_name"]); $myQuery = 'SELECT COUNT(1) AS NumChildren FROM sim_window WHERE parentwindows_id = ' . $row['window_id'] . ';'; $countChildren = $xoopsDB->fetchArray($xoopsDB->query($myQuery)) or die(mysql_error()); $numChildren = $countChildren["NumChildren"]; if ($numChildren > 0) { $record->add("nodetype", "node"); $record->add("haschildren", "true"); } else { $record->add("nodetype", "leaf");
} //Set up the database connection and get the recordset // Make a MySQL Connection mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblcustomers ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("CustomerID"); $getHandler->DefineField("CustomerName"); $getHandler->DefineField("ContactName"); $getHandler->DefineField("ContactEmail"); $getHandler->DefineField("ContactTitle"); $getHandler->DefineField("PhoneNumber"); $getHandler->DefineField("Address"); $getHandler->DefineField("Country"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["CustomerID"]); $record->add("CustomerID", $row["CustomerID"]);
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()"); }
// ******************************************************************* $codepage = 65001; // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT CountryId, Info FROM " . $table . " WHERE Info > '" . $lastString . "' " . $whereClause; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("CountryID"); $getHandler->DefineField("Info"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("CountryID", $row["CountryID"]); $record->add("Info", $row["Info"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
} //Set up the database connection and get the recordset // Make a MySQL Connection mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblorders " . $whereClause . " ORDER BY " . $sortColumn . " " . $sortDirection . " LIMIT " . $ordinalStart . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductName"); $getHandler->DefineField("ProductPrice"); $getHandler->DefineField("Quantity"); $getHandler->DefineField("OrderDate"); $getHandler->DefineField("ShippedDate"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $record = new EBARecord($row["OrderID"]); $record->add("ProductName", $row["ProductName"]); $record->add("ProductPrice", $row["ProductPrice"]); $record->add("Quantity", $row["Quantity"]); $record->add("OrderDate", $row["OrderDate"]);
$sortDirection = $_GET["SortDirection"]; } //Set up the database connection and get the recordset // Make a MySQL Connection $link = mysql_connect($server, $uid, $password) or die(mysql_error()); mysql_select_db($db) or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM tblproductcategories order by ProductCategoryName;"; $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("ProductCategoryName"); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($counter); $record->add("ProductCategoryName", $row["ProductCategoryName"]); $getHandler->add($record); } $getHandler->CompleteGet(); ?>
//Set up the database connection and get the recordset // Make a MySQL Connection $dbh = mysql_connect(BD_HOST, BD_USUARIO, BD_CLAVE) or die(mysql_error()); mysql_select_db($_SESSION['base_datos']->nombrebd) or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT * FROM alumnos AS a \r\n\r\n\tINNER JOIN notas AS n\r\n\r\n\tON n.rut = a.rut\r\n\r\n\tWHERE a.curso = '{$_GET['curso']}' \r\n\r\n\tAND n.ramo = '{$_GET['ramo']}' \r\n\r\n\tORDER BY a.lista\r\n\r\n\tLIMIT " . $ordinalStart . "," . $pageSize . ";"; //dpr($myQuery); $result = mysql_query($myQuery) or die(mysql_error()); //******************************************************************* //Lets set up the output //******************************************************************* $getHandler = new EBAGetHandler(); //First we define the columns we are sending in each record, and name each field. //We will do this by using the EBAGetHandler_DefineField function. We will name each //field of data after its column name in the database. $getHandler->DefineField("rut"); $getHandler->DefineField("nombreCompleto"); //$getHandler->DefineField("promedio"); # Controla el semestre //dpr($_GET); $offset = $_GET['periodo'] == '2S' ? 15 : 0; //dpr($_GET['periodo']); $class_colegio = new colegio(); $j = 1; for ($i = 1 + $offset; $i <= 15 + $offset; $i++) { $getHandler->DefineField("n" . $j++); } $class_notas = new notas(); $_SESSION['aux_ramo'] = $_GET['ramo']; $asignatura = $class_notas->promedioSemestreAsignatura($_GET['ramo'], $_GET['curso'], $_GET['periodo']); $label_prom = "promedio";
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()"); }
// This code block just sets up the database and tries to figure out what index number // our data starts at. This code has nothing to do with the grid itself so think of it as // business logic. // ******************************************************************* // Make a MySQL Connection $myDBConnection = mysql_connect() or die(mysql_error()); mysql_select_db("nitobi_testdb_v1") or die(mysql_error()); // Retrieve all the data from the "example" table $myQuery = "SELECT ContactID, CONCAT(ContactName, ' <', ContactEmail, '>') AS ContactInfo FROM tblcontacts3k WHERE ContactName LIKE '%" . $searchSubString . "%' OR ContactEmail LIKE '%" . $searchSubString . "%' LIMIT " . $startingRecordIndex . "," . $pageSize . ";"; $result = mysql_query($myQuery) or die(mysql_error()); // If you would like to know more about the querystrings you should use for each search mode and for different // databases, consult our knowledgebase article: http://www.nitobi.com/kb/?artid=94 // ******************************************************************* // Lets Set up the Output // ******************************************************************* $getHandler = new EBAGetHandler(); // ******************************************************************* // Lets loop through our data and send it to the grid // ******************************************************************* $getHandler->DefineField("ContactInfo"); // loop through icons $iconIndex = 0; $nrows = mysql_num_rows($result); for ($counter = 0; $counter < $nrows; $counter++) { $row = mysql_fetch_array($result); $record = new EBARecord($row["ContactID"]); $record->add("ContactInfo", $row["ContactInfo"]); $getHandler->add($record); } mysql_close($myDBConnection); $getHandler->CompleteGet();
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()"); }
include "../simantz/setting.php"; include "setting.php"; include "../simantz/class/EBAGetHandler.php"; error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); header('Content-type: text/xml'); $log = new Log(); $o = new BPartnerLookup(); $action = $_GET['action']; $lookupdelay = 1000; $pagesize =& $_GET["pagesize"]; $ordinalStart =& $_GET["startrecordindex"]; $sortcolumn =& $_GET["sortcolumn"]; $sortdirection =& $_GET["sortdirection"]; $searchstring =& $_GET["SearchString"]; $uid = $xoopsUser->getVar('uid'); $getHandler = new EBAGetHandler(); $getHandler->ProcessRecords(); $showNull = $_GET['showNull']; switch ($action) { case "searchbpartnercombo": $getHandler->DefineField("bpartner_id"); $o->showBPartnerCombo(); break; case "searchbpartnergrid": $getHandler->DefineField("bpartner_id"); $o->showBPartnerGridLookup(); break; default: break; } $getHandler->completeGet();