Hello, Please help! I would like use different Mysql db with one instalation !? so far my project is simple cash flow for different shops, it is ready installed on server, works fine for one shop only! but I have 22 shops, I don't want 22 installations, they should use different db, as they don't need to see each other... so I have 22 same structure data bases and one installation... So i have made drop down menu in index file just before log in, in order to change db name in config.php : define("DB_NAME", "cashflow_1"); result is Notice: Constant DB_NAME already defined in ... so I have that problem as once constant is defined we can't change it !
So I have that fight for few days, I have try so far to change hole config.php, it makes some other issues, I have try undefine, I have no full control of that server, so that php plugin is not an option, I have try true and false statment for define... I have try delete from config.php and put in PDOdb.php my own variable... but I'm doing something wrong please advice? other ideas, that could solve that? or Where to put my variable $db_name to make it work?
Hello, Before a year I create small project with PHPrad 2.7.3, I needed only login Authentication and I was happy! Now I decided to make my project more open so I make some pages to be seen by guest ! In Authentication I marked pages that no require user Authentication(guest) ... it works by direct link!
the problem : I was expecting to see menu with those pages + login link and completely different home page! How to create a menu for that guest? Did I miss something? Is there an easy way or I should do menu/guest/home/etc pages my self ?
New version of phprad - is there a guest section? what to expect ? When is coming?
From few days I can't figure out the following: I want to call array in add.php!
code: // in page event before add: ...... if(isset($_POST['update'])){ $fields = array("doc" => $_POST['doc'], "test" => "11111111111111111111111" ); $this->set_flash_msg(get_lang('UPDATED! '), "success"); return $this->redirect("docs/add"); } ..... //in add.php I have try so much different options in controller and add.php as: $modeldata['test']; $data = $this->view_data; request, view_data, $data['test'], I even make my own view functions and etc... and No it didn't work... due to some reasons, it clear the array and display blank: and gives Notice: Trying to access array offset … or print_r gives blank array etc... I call the controller to display other arrays from DB as well, that seems to be the main issue... as that calls are bellow in page, and mayby that is what clears my $post['update'] data?
Please advice, how to call this array in add page? <?php // I want to call it this in add.php echo fields['doc']; echo fields['test'];
I decide to start General discussion on page EVENT! All of us are doing own projects but with similar stuff , so the idea of the post is to help each other, and after all to spent some time! So: My page event is related to table 'docs', event after ADD.php page in \app\views\partials\docs . In general: Page events code is saved in \app\Controllers\ in my case => DocsController.php In Page design > page select - Docs/Add > I made for DocAddForm page /include page - false Then I create my own customView and in customCode I just put this <?php include "add_inc_form.php"; ?>, add_inc_form.php - this is my custom made form that should include and update in 3 tables, I just keep form link and EXPORT part from original add.php So this is my after add event code
//$_POST['pcount'] gives number of cart items for ($i=0; $i<($_POST['pcount']); $i++){ $ci=$i+1; $scr = 0; if(isset($_POST['product_scrap_'.$ci])){ $scr = $_POST['product_scrap_'.$ci]; } //few calculations $value = ($_POST['product_price_'.$ci])*($_POST['product_qty_'.$ci]);
// clear all cookie $cc=get_cookie ('cart'); clear_cookie ("partner"); if (isset($cc)) { foreach ($cc as $name => $value) { clear_cookie ("cart[".$name."]"); } }
As I'm not a pro, I will appreciated any advices on my code above? If you have Page Events code that could be useful for other like me, please share... If you have problems on Page Evens please share
it is working perfect except for $modeldata['doc_id'] Notice: Undefined index: doc_id in C:\xampp\htdocs\stock_3\app\controllers\DocsController.php on line 231 I try everything I know so far, I can't get print_r($_POST) data as it go true the controller and redirect... What I know so far is that: 'doc_id' is the only column in 'sales' table that is not in 'docs' table What I think is happening phprad is cutting doc_id from POST data due to some reasons ? help please?
I have made some correction to baseController ! Some cookies functions and they should be in here as they are valid for all! There is no standard option to prevent publishing baseController! If I just open the project in phprad and baseController is overwritten..
I'm tired of copy/paste and in most cases I don't see phprad touching inside at all! And to stop phprad updating I make the BaseController [read only ] , but that is stupid so How to edit BaseController as my correction will stay?
how to add new button next to view|edit|delete ? 1. one way is open with editor the list.php and it is ready ... but problem in that case is if I change the project slightly phpRad simply overwrite ... 2. so what I do in [ Name Field Properties] [01 Display] I chose custom and put my button: <a class="btn btn-sm btn-success has-tooltip" href="?pid=<?php echo $rec_id; ?>&qty=1">ADD </a> but problem in that case is it go in the export or to printer ?
so how to do it to prevent both problems ? it should be a way to add buttons as [add][copy][compare][etc...] advice?
--- ps: I have try to upload screen shot but your server is giving this: There was a problem during the uploading of add.jpg. The upload directory is full. Please contact an administrator about this problem.
Hello All, First I have made a copy of add page for table 'docs', then by editor I make my custom Form, that is working and all parameters are passed true POST method, // action="<?php print_link("docs/add?csrf_token=$csrf_token") ?>" but it insert only in one table 'docs', so I need to INSERT some VALUES in two more tables 'partner' , 'sales' and to UPDATE "qty" in 'product' what/where is the right way to do it? then I need to redirect to custom view page LAST record?
So I'm confused from that in docsControler.php , function add(){ if($formdata){ $db = $this->GetModel(); $tablename = $this->tablename; .... I could make my own functions and do it my way, but I would like to understand the logic here and do it right way! So advice how to make that multi-insert ?