51

(21 replies, posted in Report Bugs here)

And if you cant include this logic in u r FA newer version , then can you pls guide me how i can include the same in my FA folder code files..

As i need ... user which i am creating can be assign to multiple ACCESS LEVEL and he can have access to his assigned pages at a time .. means as in my office a stockmanager have access to many level .. hence i cant create his user 2-3 time ... as this is useless to login him 3 time with different user name ... if at user creation i assign him 3 access level at a time then he has right to view 3 pages or level at a time..

hope u have understand this .. and i think it should be integrated in FA also ..if any one want he can 1 access level to user or multiple level to user ..depending upon his ROLE in his office .

pls help me .. its bit urgent for me

52

(21 replies, posted in Report Bugs here)

yes i have already set debug = 1

also no error is log unerlog file.. just it get hang and then i have to restart my browser // else w8 for time .

But what about User Multiple Access Level.. PLS do this

53

(1 replies, posted in Setup)

You R right ,

same happen to me also many time .. its get hang or getting 500 error ...

but my pages are different all time sad

54

(21 replies, posted in Report Bugs here)

I taught i am alone for hanging Issues .. but when i search in form .. i have seen many similar issues ..

Admin / developer should look into the mater urgently

one is below  : this happen to me many time ... its get hang and then i get 500 error .. i have switch to many server ..

https://frontaccounting.com/punbb/viewtopic.php?id=4835

Yes i also getting many  500 Error. on my many pages... also website become too slow .. .. secondly thing i note that ... i get YELLOW EXCLAMATION MARK on top page which show error message .. but after refreshing page my entry is made in the system ... some twice

Hi,

I have a user " ABC "  who is handling both Production Manager and Stock Manager

So can we assign this user " ABC " to both above access level  at a time ?

As i have emp code in my user table .. which is unique for every user.

hence how i can manage this , as i don't want to create same user twice ( as i have unique Emp. code ) .. as he is handling both access level at a time.

In short i think user should be allowed to give multiple access level .

Also all links are working slow ... means when i click on any link it taking at-least 1min .. loading is too slow ..it was working fine ... i have changed 2-3 server.

57

(21 replies, posted in Report Bugs here)

Hi,

I have a user " ABC "  who is handling both Production Manager and Stock Manager

So can we assign this user " ABC " to both above access level  at a time ?

As i have emp code in my user table .. which is unique for every user.

hence how i can manage this , as i don't want to create same user twice ( as i have unique Emp. code ) .. as he is handling both access level at a time.

In short i think user should be allowed to give multiple access level .

Also all links are working slow ... means when i click on any link it taking atleast 1min .. loading is too slow ..it was working fine ... i have changed 2-3 server.

Thanks JOE, for your great support till end .. will try to update to latest version and check if its working or not ..else my bad luck smile


thanks

Hey Joe,

Can u guide me how i can download mysql error log file and from where.

Also before move on.. can you please take my above code and test from your end .. also in some page i have used JOIN Query.

No i am not using Latest version . I think its 2.3.16 or 2.3.17


It would be difficult for me to Upgrade to latest version .. as i have modify many includes / files .. and some core file to.

If particular sort - db_page  file can be replace then please let me know which which file i need to replace for update.

But working fine @ my localhost

Yes file and folder all are writable ..


and as said : SELECT VERSION()  , its showing me : " 5.5.36-cll "

please let me know

thanks

Hey Joe,

Thanks for reply.

Yes all folder are writable.

Also " no mysql runnung on the server ": if on my server there is no mysql running then how could i run all my statement till now.

still not able to sort

hey i show This system file to my server main .. and they did all green ..except :

MySQL version >=4.1    Required        Upgrade MySQL server to version at least 4.1

means all is " OK " + green .. ONLY

MySQL version >=4.1    Required        Upgrade MySQL server to version at least 4.1   --- RED

AND SORTING IS STILL NOT WORKING sad

Hi,

Thanks for reply .

Please find below link for system details : http://shashib.webege.com/system/

admin pls help me .. this custom  page is impt ..hence pls let me know ..what is missing plss

65

(1 replies, posted in Wish List)

Hi,

If i refresh my page by using arrow refresh button then my entry is added again ... hence can you please look into it ?.

Also after new entry and update or delete of entry .. the message remain there itself ..till we add or refresh page ..

i am using FA 2.18 hence no idea if u have updated this in new version

any one here ..pls help .. admin ..any one

Hey Barbarian,

Thanks for reply bro,

Below are my code :

test.php

<?php
/**********************************************************************
test.php
***********************************************************************/
$page_security = 'SA_TESTENTRY';
$path_to_root = "..";

include($path_to_root . "/includes/db_pager.inc");

include($path_to_root . "/includes/session.inc");

page(_($help_context = "Manage Test"),@$_REQUEST['popup']);

include_once($path_to_root . "/includes/ui.inc");

include_once($path_to_root . "/includes/date_functions.inc");

include_once($path_to_root . "/testsarea/test_db.inc");

simple_page_mode(true);

//-------------------------------------------------------------------------------------------------


function can_process()
{


     if (strlen($_POST['testname']) == 0)
    {
        $input_error = 1;
        display_error( _("Please   name cannot be empty."));
        set_focus('testname');
       return false;
        
    }

    return true;
}

function edit_link($row) {
       
       return button("Edit".$row["id"],_("Edit"), '', ICON_EDIT);
        }
}

function del_link($row) {
         
       return button("Delete".$row["id"],_("Delete"), '', ICON_DELETE);
        }      
}

function select_link($row) {
    return button("Select".$row["id"], $row["id"], '', ICON_ADD, 'selector');
}


               
//-------------------------------------------------------------------------------------------------


if ($Mode=='ADD_ITEM'){
   
    if (can_process()){
     
            add_namelist($_POST['testname']);
            display_notification_centered(_("The details has been added."));
            $Mode = 'RESET';
                       
                       
        }
       
}


//-------------------------------------------------------------------------------------------------
if ($Mode == 'RESET'){
   
    $selected_id = -1;
    $sav = get_post('show_inactive');
    unset($_POST);    // clean all input fields
    $_POST['show_inactive'] = $sav;
}



start_form();

start_outer_table(TABLESTYLE2, "width=80%");

table_section(1);
ref_cells(_("name:"), 'name_search', '',null, '', true);

table_section(2);
submit_cells('Search', _("Search"),'',_('Search Kapan'), 'default');

end_outer_table(); // outer table



$result = get_test(get_post('name_search'));

$cols = array(
        _("ID")=>array('align'=>'center','ord'=>''),
        _("Test name ")=>array('align'=>'center','name'=>'testname','ord'=>''),    // i tried even with name=>'fieldname'  -- local working , but on my server its not working
        _("Added Date")=>array('align'=>'center'),
        ' '=> array('insert'=>true, 'fun'=>'select_link'),
        array('insert'=>true, 'fun'=>'edit_link'),
        array('insert'=>true, 'fun'=>'del_link'));

    if (!@$_REQUEST['popup']) {
        $cols[' '] = 'skip';
    }
       
$table =& new_db_pager('test_table', $result, $cols);
$table->width = "95%";
display_db_pager($table);

echo '<br \ >';

//-------------------------------------------------------------------------------------------------
start_table(TABLESTYLE2);

if ($selected_id != -1)
{
      if ($Mode == 'Edit') {
        //editing an existing User
        $myrow = get_namelisting($selected_id);
        $_POST['id'] = $myrow["id"];
        $_POST['testname'] = $myrow["testname"];

    }
    hidden('selected_id', $selected_id);
    hidden('id');
    start_row();
    
}

textnumber_cells(_("Name: "), 'testname',NULL,'',4);

end_table(1);

submit_add_or_update_center($selected_id == -1, '', 'both');

end_form();

end_page(@$_REQUEST['popup']);

?>

//----




test_db.php





function add_namelist($name)
{
   
        $added_date = myowndate();
          $sql = "INSERT INTO ".TB_PREF."test_table (testname, datetime)
        VALUES (".db_escape($name).", ".db_escape($added_date).")";

        return db_query($sql, "could not add details for $name");
}


//===============


function get_test ($name = '') {
      $sql = "SELECT id,testname,datetime FROM ".TB_PREF."test_table WHERE 1=1 ";   
     
      if($name){
              $sql .= " AND testname LIKE ". db_escape("%$name%");
      }
      
      return $sql;
}


//-----


function get_namelisting($id)
{
        $sql = "SELECT * FROM ".TB_PREF."test_table WHERE id=".db_escape($id);

        $result = db_query($sql, "could not get details $id");
   
        return db_fetch($result);
}


//

pls have look on above code .. i dont have option to upload any file , hence puted all code here.. waiting

Hi,

I have my custom page where i am using db_pager functionality .. in this i have used asc /desc feature that's 'ord'=>'' , when i click my column name for asc / desc then i get sql error message .. and in that order by "" is blank ... where as same code is working well in my localhost pc..

//=======================

function get_test () {

   
       $sql = "SELECT id,name,datetime FROM ".TB_PREF."test_table ";   
       
       return $sql;
       
}

//=======================

$result = get_test();

$cols = array(
        _("ID")=>array('align'=>'center','ord'=>''),
        _("Test name ")=>array('align'=>'center','ord'=>''),
        _("Added Date")=>array('align'=>'center'),
        ' '=> array('insert'=>true, 'fun'=>'select_link'),
        array('insert'=>true, 'fun'=>'edit_link'),
        array('insert'=>true, 'fun'=>'del_link'));

    if (!@$_REQUEST['popup']) {
        $cols[' '] = 'skip';
    }
       
$table =& new_db_pager('test_table', $result, $cols);
$table->width = "95%";
display_db_pager($table);

//=================================================

when i click on "Test name" column for asc/desc  i am getting message

"//-----

DATABASE ERROR : Error browsing database: SELECT id,name,datetime FROM ".TB_PREF."test_table  ORDER BY LIMIT 0, 10
error code : 1064
error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 10' at line 1
sql that failed was : SELECT id,name,datetime FROM ".TB_PREF."test_table ORDER BY LIMIT 0, 10

---//"

Hence i got to know that ORDER BY " "  is blank .. why so can any one tell me... ? is missing .. i have included all file that's
include($path_to_root . "/includes/db_pager.inc");
include($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/date_functions.inc");

Note : as i said ...i am able to do "asc/desc"  in my local host ...but getting error message in my online server .. pls help me

69

(1 replies, posted in Wish List)

As we make entry for page. on top there is message show " Customer has been added" or "Customer has been update"

which remain as is  it  till we refresh the page of switch from one tab to another tab.

hence i wrote jquery which is working but , hence message is slowing hide , but after that some of FA features doesnt work well like get_post , alert , popup for confirmation etc etc..

below is jquery which i had puted in header.php :

  echo"<script>
              jQuery(function($){
                     $('.msgbox').delay(8000).fadeOut(('slow'), function(){
                       $('.msgbox').remove();
                  });  
             });

        </script>";

hence it would be nice if it would be taken in next process too. so that message get hide after some interval of time

70

(0 replies, posted in FA Modifications)

I have 3 Column  ( id , a, b ,c )

-------------------------------------------------------------------------------------
ID     |     A     |      B       |       C ( where C = Total A + Total B )         
-------------------------------------------------------------------------------------
1      |     4     |      3       |                                   19                             
2      |     6     |      2       |                                                                   
3      |     1     |      3       |                                                                   
--------------------------------------------------------------------------------------

How i can do this in FA ( display_db_pager ) using its default features of pagination .

Both A , B value are text Field , which are entry by user side and its stored in DB , but C value is addition of A+B (TOTAL) which get updated on each a.b update.

Pls let me know

71

(0 replies, posted in Wish List)

It would be great if date_picker ( thats : data_row ) come with h:m:s  too

as it would be easy to find records with Y-m-d h:i:s ....which is currently only with Y-m-d

72

(9 replies, posted in Wish List)

What say NOW :


function autocommitfalse(){
      global $db;
      /* switch autocommit status to FALSE. Actually, it starts transaction */
      return mysqli_autocommit($db, FALSE);
}

function autocommittrue(){
      global $db;
      return mysqli_autocommit($db, TRUE);
}


function commitquery(){
     global $db;
     return mysqli_commit($db);
}

function rollbackedquery(){
     global $db;
     return mysqli_rollback($db);
}


======

try {
    
     autocommitfalse();

    $SQLSELECT = "SELECT * FROM BC ";
    $result_as = db_query($SQLSELECT);

    if(!$result_as ){
            throw new Exception('Wrong SQL SELECT: ' . $SQLSELECT_a. ' Error: '.db_error_msg($db) . db_error_no());
     }
 

    $sqla ="INSERT INTO A () VALUES () ";
    $result_a = db_query($sqla);

    if(!$result_a){
            throw new Exception('Wrong SQL SELECT: ' . $result_a. ' Error: '.db_error_msg($db) . db_error_no());
     }
 
   
    $sqlb ="INSERT INTO B () VALUES () ";
    $result_b =db_query($sqlb);
   
    if(!$result_b){
            throw new Exception('Wrong SQL SELECT: ' . $result_a. ' Error: '.db_error_msg($db) . db_error_no());
     }
  
    $sqlCb ="UPDATE CB ()  SET ...   ";
    $result_Cb =db_query($sqlCb);

    if($result_Cb === false  &&  mysqli_affected_rows($db) == 0 ){
            throw new Exception('Wrong SQL SELECT: ' . $result_a. ' Error: '.db_error_msg($db) . db_error_no());
     }
     

    commitquery();
    echo 'Transaction completed successfully!';

} catch (Exception $e) {

        echo"<br \>";
        echo "<table align=center><tr><td>";
        echo $e->getMessage();
        echo "</td></tr></table>";
        echo"<br \>";

        echo display_error(_("Transaction failed: transaction rolled back"));
        rollbackedquery();
   }        

        autocommittrue();

If something wrong ..please let me know with change in it ( above code ) ..so that i am more clear ....

Ohh i think still not rollback... hmm admin please help me guys please

73

(9 replies, posted in Wish List)

@apmuthu

Can you modify above code and let me know what exact you mean to say , as i got to know that :

mysql_affected_rows() should be more useful to return true update and insert.

Please help me with above example in your way. so that i would be more clear what you want to say.

74

(9 replies, posted in Wish List)

Below is what i have tried , please let me know which one is SAFE as i have many query and if any of my condition fails i need rollback + ERROR message ...


try {
  /* switch autocommit status to FALSE. Actually, it starts transaction */
  global $db;
 
  mysqli_autocommit($db, FALSE);

    $sqla ="INSERT INTO A () VALUES () ";
    $result_a = db_query($sqla);
   
    if($result_a){
   
    $sqlb ="INSERT INTO B () VALUES () ";
    $result_b =db_query($sqlb);
   
    if($result_b){
    $sqlCb ="UPDATE CB ()  SET ...   ";
    $result_Cb =db_query($sqlCb);
    }else { echo "ERROR" ; }
   
    } else { echo "ERROR" ; }

  mysqli_commit($db);
  echo 'Transaction completed successfully!';

} catch (Exception $e) {

  echo 'Transaction failed: ' . $e->display_notification_centered(_("transaction rolled back"));
  mysqli_rollback($db);
}

/* switch back autocommit status */
  mysqli_autocommit($db, TRUE);




//--------------------------------OR---------------------------------


begin_transaction();

$sqla ="INSERT INTO A () VALUES () ";
$result_a = db_query($sqla);

$sqlb ="INSERT INTO B () VALUES () ";
$result_b =db_query($sqlb);

$sqlCb ="UPDATE CB ()  SET ...   ";
$result_Cb =db_query($sqlCb);

if ( $result_a && $result_b && $result_Cb ) {
    commit_transaction();
    echo display_notification_centered(_("Database transaction was successful."));
} else {       
    cancel_transaction();
    echo display_notification_centered(_("transaction rolled back"));
    exit;
}


//--------------------------------OR---------------------------------



db_query("BEGIN");

$sqla ="INSERT INTO A () VALUES () ";
$result_a = db_query($sqla);

$sqlb ="INSERT INTO B () VALUES () ";
$result_b =db_query($sqlb);

$sqlCb ="UPDATE CB ()  SET ...   ";
$result_Cb =db_query($sqlCb);

if ( $result_a && $result_b && $result_Cb ) {
    db_query("COMMIT");
    echo display_notification_centered(_("Database transaction was successful."));
} else {       
    db_query("ROLLBACK");
    echo display_notification_centered(_("transaction rolled back"));
    exit;
}

75

(5 replies, posted in Wish List)

Hey  barbarian,

Can you please share me your code+db with me to ? please.

Thanks