Example #1
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/Currency.php';
include_once "class/ConversionRate.php";
include_once 'class/SelectCtrl.php';
$log = new Log();
$o = new Currency();
$cvr = new ConversionRate();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
//$orgctrl="";
$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++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
     $o->paymentvoucherto_no = $_POST['paymentvoucherto_no'];
     $o->iscomplete = $_POST['iscomplete'];
     if ($o->currency_id == "") {
         $o->currency_id = 0;
     }
     $o->accountsfromctrl = $simbizctrl->getSelectAccounts($o->accountsfrom_id, 'Y', "", "accountsfrom_id", "");
     //$o->accountstoctrl=$ctrl->getSelectAccounts($o->accountsto_id,'Y',"","accountsto_id","");
     $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'Y');
     //$o->bpartnerctrl=$ctrl->getSelectBPartner($o->bpartner_id,'Y');
     $o->showSearchForm();
     $wherestr = $o->genWhereString();
     $o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id={$defaultorganization_id} {$wherestr}", "ORDER BY f.paymentvoucher_no");
     break;
 case "getaccountinfo":
     include "../simantz/class/SelectCtrl.inc.php";
     $ctrl = new SelectCtrl();
     include "../simbiz/class/SimbizSelectCtrl.inc.php";
     $simbizctrl = new SimbizSelectCtrl();
     $accounts_id = $_REQUEST['accounts_id'];
     echo $simbizctrl->getSelectBPartner(0, 'Y', "", "bpartner_id", " and (creditoraccounts_id ={$accounts_id} or debtoraccounts_id={$accounts_id})");
     die;
     break;
 case "checkisbank":
     include "../simbiz/class/Accounts.php";
     $acc = new Accounts();
     $acc->fetchAccounts($_REQUEST["accounts_id"]);
     if ($acc->account_type == 4) {
         echo 1;
     } else {
         echo 0;
     }
Example #3
0
<?php

include_once "system.php";
include_once "../simantz/class/SelectCtrl.inc.php";
//$xoTheme->addStylesheet("$url/modules/system/class/gui/oxygen/css/navbar.css");
//$xoTheme->addStylesheet("$url/modules/simantz/include/menu/menu.css");
$xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
//$xoTheme->addScript("$url/modules/simantz/include/menu/menu.js");
global $menuname;
$url = XOOPS_URL;
$ctrl = new SelectCtrl();
$browser = $_SERVER['HTTP_USER_AGENT'];
$deniedaccess = true;
$i = 0;
foreach ($allowbrowser as $ab) {
    $i++;
    if (strpos($browser, $ab) > 0) {
        $deniedaccess = false;
        break;
    } else {
        continue;
    }
}
if ($deniedaccess != "" && $i > 0) {
    //if user define will enforce checking
    redirect_header("{$url}", 300, "<b style='color:red'>Your browser {$browser} is not supported, please click <a href='{$supportbrowserurl}' target='_blank'>here</a> to get supported browser.</b>");
}
//if there is no module id submit from another include use simantz module as menu
if ($parentwindows_id == "") {
    $parentwindows_id = 0;
}
Example #4
0
            $pdf->Cell(35, 0, "", 1, 1, 'R');
        }
        //	$pdf->MultiCell(175,7,$isselectline,1,'C');
    }
    //display pdf
    $pdf->Output();
    exit(1);
} else {
    include_once "menu.php";
    include_once 'class/Log.php';
    include_once 'class/SelectCtrl.php';
    include_once "../../class/datepicker/class.datepicker.php";
    $dp = new datepicker("{$tableprefix}");
    $dp->dateFormat = 'Y-m-d';
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    $ctrl = new SelectCtrl();
    $accountsctrl = $ctrl->getSelectAccounts(0, 'N');
    $periodfrom = $ctrl->getSelectPeriod(0, 'Y', "", "period_from");
    $periodto = $ctrl->getSelectPeriod(0, 'Y', "", "period_to");
    $showDateFrom = $dp->show("datefrom");
    $showDateTo = $dp->show("dateto");
    $datefrom = getMonth(date("Ymd", time()), 0);
    $dateto = getMonth(date("Ymd", time()), 1);
    echo <<<EOF
<table border='1'>
<tbody>
<tr><TH colspan='4' style='text-align: center'>Criterial</TH></tr>
\t<FORM name='frmIncome' method='POST' atarget="_blank" action="viewincome.php">
\t<tr>
\t\t<Td class='head'>Account From</Td>
\t\t<Td  class='odd'><input name='accounts_codefrom' value="{$accounts_codefrom}"></Td>
Example #5
0
 case "edit":
     if ($o->fetchPayment($_GET['payment_id'])) {
         if ($o->iscomplete == 1) {
             redirect_header("{$o->paymentfilename}?action=view&payment_id={$o->payment_id}", "2", "This transaction'd been completed, redirect to view mode.");
         }
         echo $o->gridjs();
         echo $o->getInputForm("edit");
     } else {
         echo "cannot access database";
     }
     require XOOPS_ROOT_PATH . '/footer.php';
     die;
     break;
 case "getbpartnerinfo":
     include_once "../simantz/class/SelectCtrl.inc.php";
     $ctrl = new SelectCtrl();
     include "../bpartner/class/BPSelectCtrl.inc.php";
     $bpctrl = new BPSelectCtrl();
     include "../bpartner/class/BPartner.php";
     $bp = new BPartner();
     $bpartner_id = $_REQUEST['bpartner_id'];
     $bp->fetchBpartnerData($bpartner_id);
     $addressxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectAddress(0, "N", $bpartner_id)));
     $termsxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectTerms($bp->terms_id, "N")));
     $contactxml = str_replace(">", "}}}", str_replace("<", "{{{", $bpctrl->getSelectContacts(0, 'N', "", "", " and bpartner_id={$bpartner_id}")));
     $currencyxml = str_replace(">", "}}}", str_replace("<", "{{{", $ctrl->getSelectCurrency($bp->currency_id)));
     $salesagent = $bp->inchargeperson;
     echo "<result><address>{$addressxml}</address><terms>{$termsxml}</terms><contact>{$contactxml}</contact><currency>{$currencyxml}</currency><salesagent>{$salesagent}</salesagent><bpartneraccounts_id>{$bp->creditoraccounts_id}</bpartneraccounts_id><status>1</status></result>";
     die;
     break;
 case "checkaddresstext":
    $pdf->AddPage();
    //$pdf->MultiCell(0,5,$sql,0,'C');
    $pdf->BasicTable($data);
    //display pdf
    //$pdf->Output("doc.pdf","D");
    $pdf->Output("Accounts.pdf", "I");
    exit(1);
} else {
    include_once "menu.php";
    include_once 'class/Log.php';
    include_once 'class/SelectCtrl.php';
    include_once "../../class/datepicker/class.datepicker.php";
    $dp = new datepicker("{$tableprefix}");
    $dp->dateFormat = 'Y-m-d';
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    $ctrl = new SelectCtrl();
    $accountsctrlfrom = $ctrl->getSelectAccounts(0, 'Y', "", "accounts_codefrom");
    $accountsctrlto = $ctrl->getSelectAccounts(0, 'Y', "", "accounts_codeto");
    $periodctrl = $ctrl->getSelectPeriod(0, 'Y');
    $showDateFrom = $dp->show("datefrom");
    $showDateTo = $dp->show("dateto");
    $datefrom = getMonth(date("Ymd", time()), 0);
    $dateto = getMonth(date("Ymd", time()), 1);
    echo <<<EOF
<table border='1'>
<tbody>
<tr><TH colspan='4' style='text-align: center'>Criterial</TH></tr>
\t<FORM name='frmTrialBalance' method='POST' target="_blank" >
\t<tr>
\t\t<!--
\t\t<Td class='head'>Account From</Td>
Example #7
0
<?php

include "system.php";
include_once '../simantz/class/Log.inc.php';
include_once '../../simantz/class/SelectCtrl.inc.php';
include_once '../class/Window.php';
include_once '../class/Employee.php';
xoops_cp_header();
$log = new Log();
$o = new Window($xoopsDB, $tableprefix, $log);
$s = new XoopsSecurity($xoopsDB, $tableprefix, $log);
$e = new Employee($xoopsDB, $tableprefix, $log);
$ctrl = new SelectCtrl();
$orgctrl = "";
$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++)
      {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1)
         {
         IsNumber = false;
         }
Example #8
0
<?php

include "system.php";
include_once '../simantz/class/Period.inc.php';
include_once '../simantz/class/SelectCtrl.inc.php';
$o = new Period();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$action = $_REQUEST['action'];
$isadmin = $xoopsUser->isAdmin();
$uid = $xoopsUser->getVar('uid');
switch ($action) {
    case "search":
        //return xml table to grid
        $wherestring = " WHERE period_id>0";
        $o->showPeriod($wherestring);
        exit;
        //after return xml shall not run more code.
        break;
    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 period_id>0";
        $pdf->accounts_name = "";
    }
    $pdf->AddPage();
    $pdf->BasicTable($data);
    //$pdf->MultiCell(0,5,$sql,1,'C');
    //display pdf
    //$pdf->Output("doc.pdf","D");
    $pdf->Output("viewtransaction.pdf", "I");
    exit(1);
} else {
    include_once "menu.php";
    include_once "../simantz/class/datepicker/class.datepicker.php";
    $dp = new datepicker($url);
    $dp->dateFormat = 'Y-m-d';
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    $ctrl = new SelectCtrl();
    $uid = $xoopsUser->getVar('uid');
    $orgctrl = $ctrl->selectionOrg($uid, $defaultorganization_id, 'N', "", 'N');
    $track1ctrl = $ctrl->getSelectTracking(0, "Y", " AND trackheader_id = 1 ");
    $track2ctrl = $ctrl->getSelectTracking(0, "Y", " AND trackheader_id = 2 ");
    $track3ctrl = $ctrl->getSelectTracking(0, "Y", " AND trackheader_id = 3 ");
    if (isset($_GET["accounts_id"])) {
        $accounts_id = $_GET["accounts_id"];
    } else {
        $accounts_id = 0;
    }
    $accountsctrl = $simbizctrl->getSelectAccounts($accounts_id, 'Y');
    $periodctrl = $simbizctrl->getSelectPeriod(0, 'Y');
    $showDateFrom = $dp->show("datefrom");
    $showDateTo = $dp->show("dateto");
    $datefrom = getMonth(date("Ymd", time()), 0);
Example #10
0
<?php

include "system.php";
include_once "../simantz/class/SelectCtrl.inc.php";
//include_once 'class/Log.php';
include_once 'class/BPartner.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
include_once "../simantz/class/datepicker/class.datepicker.php";
//include_once "../system/class/Period.php";
$dp = new datepicker($url);
$dp->dateFormat = 'Y-m-d';
$log = new Log();
$o = new BPartner();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
if (file_exists("../simbiz/class/AccountsAPI.php")) {
    include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
    $simbizctrl = new SimbizSelectCtrl();
    $issimbiz = true;
}
if (file_exists("../sales/pricelist.php")) {
    include_once "../warehouse/class/SimERPSelectCtrl.inc.php";
    $simerpctrl = new SimERPSelectCtrl();
    $issales = true;
}
if (file_exists("../purchase/pricelist.php")) {
    include_once "../warehouse/class/SimERPSelectCtrl.inc.php";
    $simerpctrl = new SimERPSelectCtrl();
    $ispurchase = true;
}
Example #11
0
<?php

include "system.php";
include_once '../../simantz/class/SelectCtrl.inc.php';
//xoops_cp_header();
$ctrl = new SelectCtrl();
if (isset($_POST['savesetting'])) {
    $report_organizationname = $_POST['report_organizationname'];
    $report_organizationaddress = $_POST['report_organizationaddress'];
    $report_organizationcontacts = $_POST['report_organizationcontacts'];
    $smtpserver = $_POST['smtpserver'];
    $smtpuser = $_POST['smtpuser'];
    $smsurl = $_POST['smsurl'];
    $smsid = $_POST['smsid'];
    $smspassword = $_POST['smspassword'];
    $smssender_name = $_POST['smssender_name'];
    $urlchecksmsbalance = $_POST['urlchecksmsbalance'];
    $smtppassword = $_POST['smtppassword'];
    $senderuser = $_POST['senderuser'];
    $tokenlife = $_POST['tokenlife'];
    $pausetime = $_POST['pausetime'];
    $loglevel = $_POST['loglevel'];
    $logfile = $_POST['logfile'];
    $windowsettingautosave = $_POST['windowsettingautosave'];
    $nitobigridthemes = $_POST['nitobigridthemes'];
    $nitobicombothemes = $_POST['nitobicombothemes'];
    $selectspliter = $_POST['selectspliter'];
    $allowbrowser = $_POST['allowbrowser'];
    $sendsmsgroup = $_POST['sendsmsgroup'];
    $uploadpath = $_POST['uploadpath'];
    $supportbrowserurl = "http://www.simit.com.my/?q=supportbrowser";
Example #12
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/AccountGroup.php';
include_once 'class/SelectCtrl.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new AccountGroup();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
$action = "";
echo <<<EOF
<script type="text/javascript">
function autofocus(){
document.forms['frmAccountGroup'].accountgroup_name.focus();
}
function IsNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
Example #13
0
include "system.php";
//include_once "../simantz/class/Permission.php";
include_once 'class/Batch.php';
include_once "../simantz/class/datepicker/class.datepicker.php";
include_once "../simantz/class/WorkflowAPI.inc.php";
include_once "../simantz/class/SelectCtrl.inc.php";
include_once "../simantz/class/Save_Data.inc.php";
$save = new Save_Data();
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$dp = new datepicker("{$url}");
$dp->dateFormat = 'Y-m-d';
$isadmin = $xoopsUser->isAdmin();
//$log = new Log();
$o = new Batch();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$o->rcode = date("YmdHis", time());
$_SESSION['sql_txt_' . $o->rcode] = "";
$orgctrl = "";
$action = "";
if (isset($_POST['action'])) {
    $action = $_POST['action'];
} elseif (isset($_GET['action'])) {
    $action = $_GET['action'];
} else {
    $action = "";
}
$token = $_POST['token'];
$reuse = $_REQUEST["reuse"];
$o->tax_type = $_REQUEST["tax_type"];
$o->iscomplete = $_REQUEST["iscomplete"];
Example #14
0
<?php

include_once "system.php";
include_once '../class/Window.inc.php';
include "../class/nitobi.xml.php";
include "../class/SelectCtrl.inc.php";
if ($windowsettingautosave) {
    $autosaveenabledwords = "autosaveenabled=\"true\"";
    $promptjavascript = "";
} else {
    $autosaveenabledwords = "";
    $promptjavascript = "return confirm(\"Save record?\"))";
}
$window = new Window();
$ctrl = new SelectCtrl();
$xoTheme->addStylesheet("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css");
$xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.toolkit.js");
$xoTheme->addScript("{$url}/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js");
$xoTheme->addScript("{$url}/modules/simantz/include/firefox3_6fix.js");
//$xoopsTpl->assign('xoops_pagetitle', $menuname);
echo <<<EOF
  <script language="javascript" type="text/javascript">
    jQuery(document).ready((function (){
        nitobi.loadComponent('DataboundGrid');
    }));

     function init(){}

     function search(){

        var grid = nitobi.getGrid("DataboundGrid");
Example #15
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Batch.php';
include_once 'class/Transaction.php';
//include_once 'class/SelectCtrl.php';
include_once "../simantz/class/datepicker/class.datepicker.php";
//include_once "../system/class/Period.php";
$dp = new datepicker($url);
$dp->dateFormat = 'Y-m-d';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$trans = new Transaction();
$o = new Batch();
$orgctrl = "";
$action = "";
$trans->widthaccounts = " style='width: 160px' ";
$trans->widthbpartner = " style='width: 160px' ";
//marhan add here --> ajax
echo "<iframe src='batch.php' name='nameValidate' id='idValidate' style='display:none' width='100%'></iframe>";
echo "<div id='simit'><form name='frmValidate' target='nameValidate' method='POST'></form></div>";
////////////////////
echo <<<EOF
<script type="text/javascript">

\tfunction autofocus(){
\tdocument.forms['frmBatch'].batchdate.focus();
\tdocument.forms['frmBatch'].batchdate.select();
Example #16
0
<?php

//include_once "admin_header.php" ;
//xoops_cp_header();
include 'system.php';
include_once '../../simantz/class/SelectCtrl.inc.php';
include '../../simantz/class/Organization.inc.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$o = new Organization();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$action = "";
echo <<<EOF
<script type="text/javascript">
\tfunction validateOrganization(){
\t\tvar name=document.forms['frmOrganzation'].organization_name.value;
\t\tvar code=document.forms['frmOrganzation'].organization_code.value;
\t\tif(confirm("Save record?"))
\t\t\treturn true;
\t\telse
\t\t\treturn false;
\t}
\t
</script>

EOF;
if (isset($_POST['action'])) {
    $action = $_POST['action'];
    $o->organization_id = $_POST["organization_id"];
} elseif (isset($_GET['action'])) {
    $action = $_GET['action'];
Example #17
0
include_once '../../mainfile.php';
include_once 'class/Permission.php';
//	include_once '../system/class/Log.php';
//	include_once '../themes/default/style.css';
include_once "../simantz/class/datepicker/class.datepicker.php";
$url = XOOPS_URL . "/modules/simantz";
$module_id = $xoopsModule->getVar('mid');
$tableprefix = XOOPS_DB_PREFIX . "_";
$userid = $xoopsUser->getVar('uid');
$user = $xoopsUser->getVar('uname');
$log = new Log();
$o = new Permission($xoopsDB, $tableprefix, $log, $module_id);
$menulist = $o->generateMenu($userid, $module_id);
$menulist = str_replace(array("\r\n", "\n", "\r"), "", $menulist);
include_once '../simantz/class/SelectCtrl.inc.php';
$ctrl = new SelectCtrl();
$orgwhereaccess = $permission->orgWhereStr($userid);
$orgctrl = $ctrl->selectionOrg($userid, $defaultorganization_id, $showNull = 'N');
$curr_date = getDateSession($curr_date);
$sql = "SELECT employee_name FROM sim_simedu_employee WHERE uid={$userid}";
$query = $xoopsDB->query($sql);
if ($row = $xoopsDB->fetchArray($query)) {
    $user = $row['employee_name'];
}
echo "\n\t<div id='pagetitle'>Dear {$user}, you are now in the {$menuname}</div><br>";
echo <<<EOF
<script src="../simantz/include/sframe.js" type="text/javascript"></script>

<link rel="stylesheet" href="../simantz/include/stylemenu.css" type="text/css" />
<script type="text/javascript" src="../../modules/system/class/gui/oxygen/js/menu.js"></script>
Example #18
0
    public function viewsubtable()
    {
        global $havewriteperm, $defcurrencycode, $userid, $sbfe;
        include_once "../simantz/class/SelectCtrl.inc.php";
        include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
        $ctrl = new SelectCtrl();
        $bpctrl = new SimbizSelectCtrl();
        $form = "";
        $i = 0;
        //second table
        $sql = "SELECT il.*,o.organization_code\n                FROM sim_bpartner_quotationline il\n                LEFT JOIN sim_simbiz_accounts a ON a.accounts_id=il.accounts_id\n                left join sim_organization o on o.organization_id=il.branch_id\n                 WHERE il.quotation_id={$this->quotation_id} order by il.seqno ASC";
        $this->log->showLog(4, "getsubtalbe :" . $sql . "<br>");
        $query = $this->xoopsDB->query($sql);
        $form .= <<<EOF



<div align="center">


<table id="quotationline" class="" style="width:100%">

   <tr class="searchformheader" >
     <td colspan="8">
       <table><tr><td>
              <div style="float:left;cursor:pointer"><a onclick="addLine()">[Add Line]</a></div>
              <div style="float:center">Item(s)</div>
       </td></tr></table>
     </td>
   </tr>

   <tr class="searchformheader" >
          <td style="width:30px;vertical-align:top;">Seq</td>
          <td style="width:250px">Subject</td>
          <td style="width:50px">Unit Price</td>
          <td style="width:50px">Qty</td>
          <td style="width:70px">UOM</td>
          <td style="width:50px">Amount</td>
    </tr>

EOF;
        $g = 0;
        $totalgeneralamt = 0;
        global $sbfe;
        while ($row = $this->xoopsDB->fetchArray($query)) {
            if ($rowtype == "odd") {
                $rowtype = "even";
            } else {
                $rowtype = "odd";
            }
            $subject = htmlspecialchars($row['subject']);
            $description = htmlspecialchars($row['description']);
            if ($description == '') {
                $hidedesc = " style='display:none;width:350px' ";
            } else {
                $hidedesc = " style='width:350px' ";
            }
            $amt = $row['amt'];
            $localamt = $row['localamt'];
            $totalgeneralamt += $amt;
            $quotationline_id = $row['quotationline_id'];
            $accounts_id = $row['accounts_id'];
            $terms_id = $row['terms_id'];
            $terms_name = $row['terms_name'];
            $quotation_amt = $row['quotation_amt'];
            $unitprice = $row['unitprice'];
            $qty = $row['qty'];
            $uom = $row['uom'];
            $gstamt = $row['gstamt'];
            // $tax_name = $row['tax_name'];
            $organization_code = $row['organization_code'];
            $granttotalamt = $row['granttotalamt'];
            $localgranttotalamt = $row['localgranttotalamt'];
            $localamt = $row['localamt'];
            $accounts_name = $row['accountcode_full'] . " - " . $row['accounts_name'];
            //            $tax = $row['total_tax'] * 0.01;
            //name="lineaccount_id[$i]" id="account_id_$i"
            //<select name="lineaccount_id[$i]" id="account_id_$i" onfocus=getList(this.id,this.value) style='width:300px'>$acclist</select><img onclick='clearlist()' src='../simantz/images/reload.gif' title='reload'/>
            //			$acclist=$bpctrl->getSimpleSelectAccounts($accounts_id,'Y',"and accounts_id=$accounts_id");
            $orgctrl = $ctrl->selectionOrg($userid, $row['branch_id'], 'N');
            $seqno = $row['seqno'];
            $description = str_replace("\n", "<br/>", $description);
            $description = str_replace("  ", " &nbsp;", $description);
            $form .= <<<EOF
         <tr class="{$rowtype}" id='trline_{$i}'>
            <td class="{$rowtype}" style='vertical-align:top;'>{$seqno}</td>
            <td style="text-align:left;vertical-align:top;">
             {$subject}<br/>
            {$description}
            </td>

            <td style='text-align:right;vertical-align:top;'>{$unitprice}</td>
            <td style='text-align:right;vertical-align:top;'>{$qty}</td>
            <td style='text-align:center;vertical-align:top;'>{$uom}</td>
\t\t\t<td  style='vertical-align:top;text-align:right;'>
\t\t\t\t\t\t{$amt}
\t\t\t\t</td>

         </tr>

EOF;
            $i++;
            $g++;
        }
        $totalgeneralamt = number_format($totalgeneralamt, "2", ".", "");
        $form .= <<<EOF
<tfooter>
         <tr class="foot" id="trlinetotal">
\t\t\t<td ></td>
         
            <td >
                                 <input type="hidden" value="{$i}" name="totalline" id="totalline">
            </td>
            <td   colspan='3' style="width:60px;text-align:right">Sub Total {$this->currency_code}:</td>
            <td  style="width:60px;text-align:right" >{$this->subtotal}</td>
         </tr>
        
</tfooter>
                \t
\t\t\t\t         

EOF;
        $form .= <<<EOF
 </table>
</div>
EOF;
        return $form;
    }
Example #19
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/Tax.php';
include_once 'class/SelectCtrl.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new Tax();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
$action = "";
echo <<<EOF
<script type="text/javascript">
function autofocus(){
document.forms['frmTax'].tax_name.focus();
}
function IsNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
//include_once '../system/class/Log.php';
//include_once 'class/Accounts.php';
//include_once 'class/SelectCtrl.php';
//include_once "../../class/datepicker/class.datepicker.php";
include_once '../simantz/class/fpdf/fpdf.php';
include_once "../simantz/class/datepicker/class.datepicker.php";
$dp = new datepicker("{$url}");
$dp->dateFormat = 'Y-m-d';
$datefrom = getMonth(date("Ymd", time()), 0);
$dateto = getMonth(date("Ymd", time()), 1);
$showDateFrom = $dp->show('datefrom');
$showDateTo = $dp->show('dateto');
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$uid = $xoopsUser->getVar('uid');
$orgctrl = $ctrl->selectionOrg($uid, $defaultorganization_id, 'N', "", 'N');
echo <<<EOF
<script type='text/javascript'>

function autofocus(){
changereport();
}
function changereport(){
//alert(value);
value=document.frmtrialbalancereport.reporttype.value;

\tswitch(value){

\t\tcase "s":
<?php

include "system.php";
//include_once '../system/class/Log.php';
include_once '../class/Activitysummary.php';
//include_once '../class/Employee.php';
//include_once "../../system/class/SelectCtrl.php";
//include_once "../../../class/datepicker/class.datepicker.php";
//echo  $url;
$ctrl = new SelectCtrl();
xoops_cp_header();
$log = new Log();
$o = new Activitysummary($xoopsDB, $tableprefix, $log);
$s = new XoopsSecurity($xoopsDB, $tableprefix, $log);
//$e = new Employee($xoopsDB,$tableprefix,$log);
$dp = new datepicker("{$url}");
$dp->dateFormat = 'Y-m-d';
$orgctrl = "";
$action = "";
echo <<<EOF
<script type="text/javascript">

function deleteLog(){
if(document.forms['frmListSearch'].rowcount.value>0){
\tif(confirm('Confirm To Delete Log?')){
\tdocument.forms['frmListSearch'].action.value="deletelog";
\tdocument.forms['frmListSearch'].submit();
\t}else
\treturn false;
}else{
alert("No Log To Delete!!.");
Example #22
0
         $o->istransporter = 0;
     }
     $o->currency_id = $_POST["currency_id"];
     $o->defaultlevel = $_POST["defaultlevel"];
     $o->tooltips = $_POST["tooltips"];
     $o->bpartner_url = $_POST["bpartner_url"];
     $o->description = $_POST["description"];
     if ($o->updateBPartnerBasicInfo()) {
         echo "OK<br/>{$o->errormessage}";
     } else {
         echo "Error:<br/>{$o->errormessage}";
     }
     break;
 case "showForm":
     include_once "class/SelectCtrl.inc.php";
     $ctrl = new SelectCtrl();
     $bpartner_id = $_GET['bpartner_id'];
     // echo print_r($_GET);
     if ($bpartner_id > 0) {
         $o->fetchBPartner($bpartner_id);
         $o->getBasicInputForm("edit");
         // $o->getAccountingInputForm("edit");
     } else {
         echo "<b class=\"highlight\">Error! Retrieved invalid business partner id, please choose appropriate business partner.</b>";
     }
     break;
 default:
     include "menu.php";
     $o->searchbpartnergroupctrl = $ctrl->getSelectBPartnerGroup(2, "searchbpartnergroup_id", "", "", "classic");
     $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
     $arrayresult = $o->searchAToZ();
Example #23
0
        echo <<<EOF
\t\t<A href='index.php'>Back To This Module Administration Menu</A><br>
\t\teverything in this organization is purge!
EOF;
        $log->showLog(3, "\n\t\t{$sql1}<br>\n\t\t{$sql2}<br>\n\t\t{$sql3}<br>\n\t\t{$sql4}<br>\n\t\t{$sql5}<br>\n\t\t{$sql6}<br>\n\t\t{$sql7}<br>\n\t\t{$sql8}<br>\n\t\t{$sql9}<br>\n\t\t{$sql10}<br>\n\t\t{$sql11}<br>\n\t\t{$sql12}<br>\n\t\t{$sql13}<br>\n\t\t{$sql14}<br>\n\t\t{$sql15}<br>\n\t\t{$sql16}<br>\n\t\t{$sql17}<br>\n\t\t{$sql18}<br>\n\t\t{$sql19}<br>\n\t\t{$sql20}<br>\n\t\t{$sql21}<br>\n\t\t{$sql22}<br>\n\t\t");
    } else {
        echo <<<EOF
\t\t<A href='index.php'>Back To This Module Administration Menu</A><br>
\t\tNo organization is selected, click <a href="resetaccounts.php">[here]</a> to go back previous page.
EOF;
    }
} else {
    include_once "../class/SelectCtrl.inc.php";
    include_once "../class/Log.inc.php";
    $log = new Log();
    $ctrl = new SelectCtrl();
    $orgctrl = $ctrl->selectionOrg(0, 0, 'Y', '');
    echo <<<EOF
\t<A href='index.php'>Back To This Module Administration Menu</A><br>
Confirm to reset accounts in this organization? Please backup your data before proceed further.<br>

<FORM action="resetaccounts.php" method="POST" onsubmit="return confirm('Confirm to clear data?')">
Organization: {$orgctrl}<br>

  <INPUT type="submit" name="submit" value="Reset Account">
</FORM>

EOF;
}
xoops_cp_footer();
?>
Example #24
0
*/
include_once "system.php";
include_once "menu.php";
include_once '../system/class/Log.php';
//include_once 'class/Accounts.php';
//include_once 'class/SelectCtrl.php';
//include_once "../../class/datepicker/class.datepicker.php";
include_once '../../class/fpdf/fpdf.php';
//$dp=new datepicker("$url");
//$dp->dateFormat='Y-m-d';
//$showDateFrom=$dp->show('datefrom');
//$showDateTo=$dp->show('dateto');
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
//$acc= new Accounts();
$contacts_name = $_GET['contacts_name'];
$hpno = $_GET['hpno'];
$bpartner_id = $_GET['bpartner_id'];
$races_id = $_GET['races_id'];
$religion_id = $_GET['religion_id'];
$region_id = $_GET['region_id'];
if ($bpartner_id == "") {
    $bpartner_id = 0;
}
if ($races_id == "") {
    $races_id = 0;
}
if ($religion_id == "") {
    $religion_id = 0;
Example #25
0
     break;
 case "ajaxselectwindows":
     $window->mid = $_GET['mid'];
     $window->window_id = $_GET['window_id'];
     if ($window->window_id == "") {
         $window->window_id = 0;
     }
     echo $window->getSelectWindows($window->window_id, $window->mid, "Y");
     break;
 default:
     if (file_exists("../simantz/")) {
         include "menu.php";
         $window->modulectrl = $ctrl->getSelectModule($findmodule_id, "Y");
     } else {
         include "../class/SelectCtrl.inc.php";
         $ctrl = new SelectCtrl();
         $window->modulectrl = $ctrl->getSelectModule($findmodule_id, "Y");
     }
     $xoTheme->addStylesheet("{$url}/modules/simantz/include/window.css");
     $xoTheme->addStylesheet("{$url}/modules/simantz/include/popup.css");
     $xoTheme->addScript("{$url}/modules/simantz/include/popup.js");
     $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
     if ($_GET['findmodule_id'] >= 1) {
         $findmodule_id = $_GET['findmodule_id'];
     } else {
         $findmodule_id = 0;
     }
     $window->showSearchForm();
     $windowlist = $window->showParentWindowsTree($findmodule_id);
     $formname = $window->getInputForm($findmodule_id);
     echo <<<EOF
Example #26
0
<?php

include "system.php";
include "menu.php";
include_once 'class/Log.php';
include_once 'class/BPartner.php';
include_once 'class/SelectCtrl.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new BPartner();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$orgctrl = "";
$action = "";
//marhan add here --> ajax
echo "<iframe src='bpartner.php' name='nameValidate' id='idValidate' style='display:none' ></iframe>";
echo "<div id='simit'><form name='frmValidate' target='nameValidate' method='POST'></form></div>";
////////////////////
echo <<<EOF
<A href='bpartner.php' style='color: GRAY'> [ADD NEW BUSINESS PARTNER]</A>
<A href='bpartner.php?action=search' style='color: gray'> [SEARCH BUSINESS PARTNER]</A>
<br>
<script type="text/javascript">

function sortList(idSort){

\tvar str = document.getElementById(idSort).src;
\tvar lengthStr = str.length;
\tvar type = str.substring(lengthStr-6,lengthStr-4);
\tvar fldName = idSort.replace("ids_", "");
\tvar wherestr = document.forms['frmSearchForm'].wherestr.value;
Example #27
0
<?php

include_once "admin_header.php";
xoops_cp_header();
include 'system.php';
include_once '../class/Log.inc.php';
include_once '../class/SelectCtrl.inc.php';
include_once '../class/Organization.inc.php';
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$o = new Organization();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$action = "";
echo <<<EOF
<script type="text/javascript">
\tfunction validateOrganization(){
\t\tvar name=document.forms['frmOrganzation'].organization_name.value;
\t\tvar code=document.forms['frmOrganzation'].organization_code.value;
\t\tif(confirm("Save record?"))
\t\t\treturn true;
\t\telse
\t\t\treturn false;
\t}
\t
</script>

EOF;
if (isset($_POST['action'])) {
    $action = $_POST['action'];
    $o->organization_id = $_POST["organization_id"];
<?php

include "system.php";
include "menu.php";
include_once "../simantz/class/Permission.php";
include_once '../simantz/class/Activitysummary.php';
include_once "../simantz/class/SelectCtrl.inc.php";
include_once "../simantz/class/datepicker/class.datepicker.php";
$ctrl = new SelectCtrl();
$log = new Log();
$permission = new Permission();
$o = new Activitysummary($xoopsDB, $tableprefix, $log);
$s = new XoopsSecurity($xoopsDB, $tableprefix, $log);
$dp = new datepicker("{$url}");
$dp->dateFormat = 'Y-m-d';
$orgctrl = "";
$action = "";
echo <<<EOF
<script type="text/javascript">

function deleteLog(){
if(document.forms['frmListSearch'].rowcount.value>0){
\tif(confirm('Confirm To Delete Log?')){
\tdocument.forms['frmListSearch'].action.value="deletelog";
\tdocument.forms['frmListSearch'].submit();
\t}else
\treturn false;
}else{
alert("No Log To Delete!!.");
return false;
}
    public function getInputForm($action = "new")
    {
        global $userid, $simbizctrl, $ctrl, $defaultorganization_id;
        $this->log->showLog(3, "Access Payment getInputForm()");
        if ($o->track1_id == "") {
            $o->track1_id = 0;
        }
        if ($o->track2_id == "") {
            $o->track2_id = 0;
        }
        if ($o->track3_id == "") {
            $o->track3_id = 0;
        }
        $track1option = $simbizctrl->getSelectTrack($this->track1_id, "Y", " AND trackheader_id =1");
        $track2option = $simbizctrl->getSelectTrack($this->track2_id, "Y", " AND trackheader_id =2");
        $track3option = $simbizctrl->getSelectTrack($this->track3_id, "Y", " AND trackheader_id =3");
        if ($action == "new") {
            include "../simbiz/class/Track.inc.php";
            $track = new Trackclass();
            $track_array = $track->getTrackName();
            $this->track1_name = $track_array['track1_name'];
            $this->track2_name = $track_array['track2_name'];
            $this->track3_name = $track_array['track3_name'];
            $this->bpartneraccounts_id = 0;
            $tableheader = "New Payment";
            $attnoption = "<option value='0'>Null</option>";
            $uidoption = $ctrl->getSelectUsers($userid);
            $termsoption = "<option value='0'>Null</option>";
            $addressoption = "<option value='0'>Null</option>";
            $currencyoption = "<option value='0'>Null</option>";
            $branchctrl = $ctrl->selectionOrganization($userid, $defaultorganization_id);
            $this->payment_id = 0;
            $this->document_no = $this->getNextNo();
            $this->document_date = date("Y-m-d", time());
            $this->exchangerate = 1;
            $this->subtotal = 0;
            $this->localamt = 0;
        } else {
            $tableheader = "Edit Payment";
            include_once "../simantz/class/SelectCtrl.inc.php";
            $ctrl = new SelectCtrl();
            include "../bpartner/class/BPSelectCtrl.inc.php";
            $bpctrl = new BPSelectCtrl();
            include "../bpartner/class/BPartner.php";
            $bp = new BPartner();
            $bpartner_id = $_REQUEST['bpartner_id'];
            $bp->fetchBpartnerData($bpartner_id);
            $addressxml = $bpctrl->getSelectAddress($this->address_id, "N", $o->bpartner_id);
            $termsxml = $bpctrl->getSelectTerms($this->terms_id, "N");
            $contactxml = $bpctrl->getSelectContacts($this->contacts_id, 'N', "", "", " and bpartner_id={$this->bpartner_id}");
            $currencyxml = $ctrl->getSelectCurrency($this->currency_id);
            $branchctrl = $ctrl->selectionOrganization($userid, $this->organization_id);
            $attnoption = $contactxml;
            $uidoption = $ctrl->getSelectUsers($this->preparedbyuid);
            $termsoption = $termsxml;
            $addressoption = $addressxml;
            $currencyoption = $currencyxml;
            // $branchoption="<option value='1'>HQ</option>";
        }
        $grid = $this->getGrid($this->payment_id);
        $html = <<<HTML
    <br/>
    <div id='centercontainer'>
    <div align="center" >
    <table style="width:990px;text-align: left; " >
        <tr><td align="left">{$this->addnewctrl}</td><td align="right">{$this->searchctrl}</td></tr></table>
{$noperm}

   
    <br/>
    <div id='errormsg' class='red' style='display:none'></div>
<form onsubmit='return false' method='post' name='frmPayment' id='frmPayment'  action='{$this->paymentfilename}'  enctype="multipart/form-data">
   <table style="text-align: left; width: 990px;" border="0" cellpadding="0" cellspacing="1"  class="searchformblock">
    <tbody>
        <tr>
        <td colspan="4" rowspan="1" align="center" id="idHeaderText" class="searchformheader" >{$tableheader}</td>
        </tr>
        <tr>
          <td class="head">Payment No</td>
          <td class="even"><input name='sppayment_prefix' id='sppayment_prefix' value='{$this->sppayment_prefix}'size='3'>
                            <input name='document_no' id='document_no'  value='{$this->document_no}' size='10'>
                    Branch <select id='organization_id' name='organization_id'>&nbsp; {$branchctrl}</select></td>
          <td class="head">Business Partner</td>
          <td class="even">
              <ntb:Combo id="cmbbpartner_id" Mode="classic" theme="{$nitobicombothemes}" InitialSearch="{$this->bpartner_name}" onselectevent="chooseBPartner();">
             <ntb:ComboTextBox Width="250px" DataFieldIndex=1 ></ntb:ComboTextBox>
             <ntb:ComboList Width="300px" Height="200px" DatasourceUrl="../simbiz/simbizlookup.php?action=searchbpartnercombo&showNull=Y" PageSize="25" >
             <ntb:ComboColumnDefinition Width="130px" DataFieldIndex=1 ></ntb:ComboColumnDefinition>
             <ntb:ComboMenu icon="images/add.gif" OnClickEvent="window.open('../bpartner/bpartner.php')" text=" &nbsp;Add product...">
             </ntb:ComboList>
            </ntb:Combo>
          </td>
     </tr>
     <tr>
        <td class="head">Date (YYYY-MM-DD)</td>
          <td class="even">
            <input id='document_date' name='document_date'  size='10'  value='{$this->document_date}'>
            <input id='btnpaymentdate' type='button' class='btndate' onclick="{$this->showCalendar}" value="Date"></td>
          <td class="head">Attn To </td>
          <td class="even"><select id='contacts_id' name='contacts_id' >{$attnoption}</select></td>
     </tr>
     <tr>
   
      <td class="head">Ref. No</td>
      <td class="even"><input id='ref_no' size='10' name='ref_no' value='{$this->ref_no}'></td>
     </tr>
     <tr>
         <td class="head">Prepared By</td>
         <td class="even"><select id='preparedbyuid' name='preparedbyuid'>{$uidoption}</select></td>
        <td class="head">Sales Agent</td>
         <td class="even"><input id='salesagentname'  name='salesagentname' value='{$this->salesagentname}'></td>
</tr>
<tr>
       <td class="head">Address</td>
       <td class="even"><select id='address_id' name='address_id' onchange=updateAddressText()>{$addressoption}</select><br/>
        <textarea id='address_text' name='address_text' cols='30' rows='3'>{$this->address_text}</textarea>
        </td>
         <td class="head">Currency</td>
          <td class="even">
                    <select id='currency_id' name='currency_id' onchange=comparecurrency()>{$currencyoption}</select> Exchange rate: MYR<input size='8' id='exchangerate' onchange=updateCurrency() value="{$this->exchangerate}" name="exchangerate"><br/>
     </td>
  <tr>
                 <td class="head" colspan='4'>
        <input name='save' onclick='saverecord(0)' type='submit' id='submit' value='Save'>
        <input name='save' onclick='saverecord(1);' type='submit' id='submit' value='Complete'>
        <input name='save' onclick='deleterecord()' type='submit' id='delete' value='Delete'>
        <input name='action' name='action' value='ajaxsave'  type="hidden">
        <input type="button" value="Reload" onclick=javascript:reloadPayment()>
        <input type="button" value="Receive All" onclick=javascript:receiveAll()>
            <input type="button" value="Preview" onclick=javascript:previewPayment()>
        <input name="track1_name" id="track1_name" type="hidden" value="{$this->track1_name}">
         <input name="track2_name" id="track2_name" type="hidden" value="{$this->track2_name}">
            <input name="track3_name"  id="track3_name" type="hidden" value="{$this->track3_name}">
        <input name='payment_id' id='payment_id'  value='{$this->payment_id}'  title='payment_id' type='hidden'>
        <input name='iscomplete'  id='iscomplete' value='{$this->iscomplete}'  title='iscomplete' type='hidden'>
        <input name='bpartneraccounts_id' id='bpartneraccounts_id' value='{$this->bpartneraccounts_id}' title='bpartneraccounts_id' type='hidden'>
            </td>
</td></tr>
<tr><td colspan='4'>
    <div id='detaildiv'>
    {$grid}
              <small>* Update payment detail via edit column Account, Paid Amt and following column, leave Paid Amt = 0 to delete particular payment detail</small>

           <div style="width:476px;text-align:right" >
                        <b style="text-align:right; height:30px; border-top: 1px solid #000; border-bottom: 3px double #000; width:300px">
             Total: <label id='lblsubtotal'><input id='subtotal' style="text-align:right"  size="10" name='subtotal' readonly="readonly" value='{$this->subtotal}'></label></b><br/>
              Outstanding : <label id='lbltotalgst'><input id='outstandingamt' size="10" style="text-align:right"  name='outstandingamt' readonly="readonly" value='{$this->outstandingamt}'></label>
            </div>

</div>
</td></tr>
 <td class="head">Description</td>
<td class="even" colspan='2'><textarea cols='70' rows='3' id='description'  name='description'>{$this->description}</textarea></td>
            <td rowspan="2"><br/><b>Tracking information</b>
            <div class="searchformblock" id="trackblock">
            {$this->track1_name}: <select name="track1_id" id="track1_id">{$track1option}</select><br/>
            {$this->track2_name}: <select name="track2_id" id="track1_id">{$track2option}</select><br/>
            {$this->track3_name}: <select name="track3_id" id="track1_id">{$track3option}</select><br/>
            </div></td>
</tr><tr>
   <td class="head">Note</td>
<td class="even" colspan='2'><textarea cols='70' rows='3' id='note'  name='note'>{$this->note}</textarea></td>
</tr></table>
</form>


HTML;
        return $html;
    }
Example #30
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 = "";
$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++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }