Пример #1
0
 public function saveBPartnerGroup()
 {
     $this->log->showLog(2, "Access saveBPartnerGroup()");
     // die;
     global $xoopsDB, $saveHandler, $createdby, $timestamp, $defaultorganization_id;
     $tablename = "sim_bpartnergroup";
     $pkey = "bpartnergroup_id";
     $keyword = "BPartnerGroup";
     $controlfieldname = "bpartnergroup_name";
     $insertCount = $saveHandler->ReturnInsertCount();
     $this->log->showLog(3, "Start Insert({$insertCount} records)");
     if ($insertCount > 0) {
         $arrfield = array($controlfieldname, "debtoraccounts_id", "creditoraccounts_id", "description", "isactive", "defaultlevel", "created", "createdby", "updated", "updatedby", "organization_id");
         $arrfieldtype = array('%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d');
         // Yes there are INSERTs to perform...
         for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, $controlfieldname), $saveHandler->ReturnInsertField($currentRecord, "debtoraccounts_id"), $saveHandler->ReturnInsertField($currentRecord, "creditoraccounts_id"), $saveHandler->ReturnInsertField($currentRecord, "description"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "defaultlevel"), $timestamp, $createdby, $timestamp, $createdby, $defaultorganization_id);
             $controlvalue = $saveHandler->ReturnInsertField($currentRecord, $controlfieldname);
             $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, $pkey);
             // Now we execute this query
         }
     }
     $updateCount = $saveHandler->ReturnUpdateCount();
     $this->log->showLog(3, "Start update({$updateCount} records)");
     if ($updateCount > 0) {
         $arrfield = array($controlfieldname, "debtoraccounts_id", "creditoraccounts_id", "description", "isactive", "defaultlevel", "updated", "updatedby", "isdeleted");
         $arrfieldtype = array('%s', '%d', '%d', '%s', '%d', '%d', '%s', '%d', '%d');
         // Yes there are UPDATEs to perform...
         for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) {
             $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, $controlfieldname), $saveHandler->ReturnUpdateField($currentRecord, "debtoraccounts_id"), $saveHandler->ReturnUpdateField($currentRecord, "creditoraccounts_id"), $saveHandler->ReturnUpdateField($currentRecord, "description"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "defaultlevel"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted"));
             $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, $controlfieldname);
             $this->UpdateRecord($tablename, $pkey, $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue);
         }
     }
     $ispurge = 0;
     $deleteCount = $saveHandler->ReturnDeleteCount();
     $this->log->showLog(3, "Start delete/purge({$deleteCount} records)");
     $classname = "class/{$keyword}.inc.php";
     include $classname;
     $this->log->showLog(3, "Include {$classname} successfully");
     $o = new BPartnerGroup();
     $this->log->showLog(3, "Inilialize {$keyword}()");
     if ($deleteCount > 0) {
         for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) {
             $record_id = $saveHandler->ReturnDeleteField($currentRecord);
             $o->fetchBPartnerGroup($record_id);
             $controlvalue = $o->bpartnergroup_name;
             $isdeleted = $o->isdeleted;
             if ($o->allowDelete($record_id)) {
                 $this->DeleteRecord($tablename, $pkey, $record_id, $controlvalue, $isdeleted);
             } else {
                 $this->failfeedback .= "Cannot delete {$keyword}: {$o->bpartnergroup_name} <br/>";
             }
         }
     }
     //$this->failfeedback.="asdasdpasd<br/>\n";
     //$this->failfeedback.="123 3443<br/>\n";
     //$this->failfeedback.="234 45656523 234<br/>\n";
     if ($this->failfeedback != "") {
         $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback;
     }
     $saveHandler->setErrorMessage($this->failfeedback);
     $saveHandler->CompleteSave();
 }
Пример #2
0
<?php

include "system.php";
include_once 'class/BPartnerGroup.php';
$o = new BPartnerGroup();
$s = new XoopsSecurity();
$action = $_REQUEST['action'];
$isadmin = $xoopsUser->isAdmin();
$uid = $xoopsUser->getVar('uid');
switch ($action) {
    case "search":
        //return xml table to grid
        $wherestring = " WHERE bpartnergroup_id>0";
        $o->showBPartnerGroup($wherestring);
        exit;
        //after return xml shall not run more code.
        break;
    case "save":
        //process submited xml data from grid
        $o->saveBPartnerGroup();
        break;
    default:
        //$issimbiz=false;
        //if(file_exists("../simbiz/class/AccountsAPI.php") ){
        //include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
        //$simbizctrl = new SimbizSelectCtrl();
        //$issimbiz = true;
        //}
        include "menu.php";
        $xoTheme->addStylesheet("{$url}/modules/simantz/include/popup.css");
        $xoTheme->addScript("{$url}/modules/simantz/include/popup.js");
Пример #3
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/BPartnerGroup.php';
include_once 'class/SelectCtrl.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new BPartnerGroup();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
$issimbiz = false;
if (file_exists("../simbiz/class/AccountsAPI.php")) {
    include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
    $simbizctrl = new SimbizSelectCtrl();
    $issimbiz = true;
}
$action = "";
echo <<<EOF
<script type="text/javascript">
function IsNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
Пример #4
0
<?php

//	include_once ('../../mainfile.php');
//	include_once (XOOPS_ROOT_PATH.'/header.php');
include "system.php";
include "menu.php";
include "class/nitobi.xml.php";
include "class/BPartnerGroup.inc.php";
$bpartnergroup = new BPartnerGroup();
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
$bpartnergroup->showSearchForm();
if ($havewriteperm == 1) {
    $permctrl = " rowinsertenabled=\"true\"      rowdeleteenabled=\"true\"      toolbarenabled=\"true\"      ";
} else {
    $permctrl = " rowinsertenabled=\"false\"   autosaveenabled=\"false\"   rowdeleteenabled=\"false\"      toolbarenabled=\"false\"      ";
}
echo <<<EOF
<link rel="stylesheet" href="{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css" type="text/css" />
<script type="text/javascript" src="{$url}/modules/simantz/include/nitobi/nitobi.toolkit.js"></script>
<script type="text/javascript" src="{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js"></script>
  <script language="javascript" type="text/javascript">
    jQuery(document).ready((function (){nitobi.loadComponent('DataboundGrid');}));

     function init(){}

     function search(){

        var grid = nitobi.getGrid("DataboundGrid");
        var searchbpartnergroup_name=document.getElementById("searchbpartnergroup_name").value;

        var searchisactive=document.getElementById("searchisactive").value;