
crazycoder
Members-
Posts
16 -
Joined
-
Last visited
Everything posted by crazycoder
-
EasyUI is not free for use.
-
I am using jQuery Combogrid http://combogrid.justmybit.com/ for autocomplete. Currently it supports only single selection. How can I make it to select multiple rows by adding a checkbox in the first column? Please help.
-
Did you try printing the $row_first values using print_r($row_first)
-
How to retain select box value after submit
crazycoder replied to samuel_lopez's topic in PHP Coding Help
You will have to return the selected value through GET parameter, and if it has value select it using conditional statement. -
Whether table field has value in it?
-
php file unlink and delete old records Mysql
crazycoder replied to cobusbo's topic in PHP Coding Help
Yes. You will require the loop to delete the images. -
php file unlink and delete old records Mysql
crazycoder replied to cobusbo's topic in PHP Coding Help
For deleting the file using unlink, absolute path of the file is required where as pprofilepic contains the relative path. -
Yii CGridView change column width for raw type cell
crazycoder replied to crazycoder's topic in PHP Coding Help
I added "style"=>"width:100%" in CHtml::textField htmlOptions and was able to change the width of column -
I am using Yii 1.1 CGridView with 'raw' cell type. The cell contains text field generated using CHtml::textField. Here I cannot change the width of the column using headerHtmlOptions or htmlOptions. Please help. $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'mbook-grid', 'itemsCssClass'=>'table table-bordered table-condensed table-hover table-striped dataTable', 'dataProvider'=>$model->search(), 'afterAjaxUpdate'=>'calcquantity', 'enablePagination' => true, 'pagerCssClass'=>'dataTables_paginate paging_bootstrap table-pagination', 'pager' => array('header'=>'','htmlOptions'=>array('class'=>'pagination')), 'columns' => array( array( 'class' => 'CCheckBoxColumn', 'id'=>'project_estimate_id', 'htmlOptions'=>array('style' => 'display:none'), 'headerHtmlOptions'=>array('style' => 'display:none'), 'selectableRows'=>2, 'value'=>'$data["project_estimate_id"]', 'checked'=>'true', ), array(name=>'description','value'=>'CHtml::textField("ProjectMBookGrid[description_".$data["project_estimate_id"]."]",$data["description"],array("class"=>"gridfield"))','type'=>'raw','header'=>'Description','headerHtmlOptions'=>array('style'=>'width: 5%;')), array(name=>'length','value'=>'CHtml::textField("ProjectMBookGrid[length_".$data["project_estimate_id"]."]",$data["length"],array("class"=>"gridfield","style"=>"text-align: right"))','type'=>'raw','header'=>'Length','headerHtmlOptions'=>array('style'=>'width:5%')), array(name=>'breadth','value'=>'CHtml::textField("ProjectMBookGrid[breadth_".$data["project_estimate_id"]."]",$data["breadth"],array("class"=>"gridfield","style"=>"text-align: right"))','type'=>'raw','header'=>'Breadth','htmlOptions'=>array('style'=>'text-align: right')), array(name=>'quantity','value'=>'CHtml::textField("ProjectMBookGrid[quantity_".$data["project_estimate_id"]."]",$data["quantity"],array("class"=>"gridfield","style"=>"text-align: right"))','type'=>'raw','header'=>'Quantity','htmlOptions'=>array('style'=>'text-align: right')), ), 'htmlOptions'=>array('class'=>'grid-view table-responsive hide-x-scroll'), ))
-
Take the backup of PostgreSQL database using php
crazycoder replied to crazycoder's topic in PHP Coding Help
Finally I wrote the command in php and executed the php file using windows task scheduler. $path = Yii::app()->basePath . '/data/backup/'; $file=$path."pentium.backup"; unlink($file); putenv("PGPASSWORD=postgres"); $dumpcmd = array("pg_dump", "-i", "-U", escapeshellarg("postgres"), "-F", "c", "-b", "-v", "-f", escapeshellarg($file), escapeshellarg("pentium")); exec( join(' ', $dumpcmd), $cmdout, $cmdresult ); putenv("PGPASSWORD"); -
I am using Yii 1.1 for development. In my site I am using accessControl for authentication and it is working fine. Now I want to password protect an action from the logged in users. An option is to create an page for entering the password and on submission store it in session. If the user tries to view the action then check the session and if it is not set redirect the user to the page for entering the password. How can I achieve this? Is it possible using accessControl as it is already used for login authentication?
-
Take the backup of PostgreSQL database using php
crazycoder replied to crazycoder's topic in PHP Coding Help
If I execute the PHP file through command line then it successfully executes and the back up file is generated. Problem is when I access through browser. -
Take the backup of PostgreSQL database using php
crazycoder replied to crazycoder's topic in PHP Coding Help
Is there any other way I can run the pg_dump command using php. I have tried with exec() but that also was not working. -
Take the backup of PostgreSQL database using php
crazycoder replied to crazycoder's topic in PHP Coding Help
Seems there is no error here because if I double click to run the cron.bat file then the backup file is generated. Now I have tried changing the path to forward slashes in system() function,but it is not working. -
Take the backup of PostgreSQL database using php
crazycoder replied to crazycoder's topic in PHP Coding Help
There is no error. If I use a retun variable the it is having a value of '1'; system("cmd /c D:\wamp\www\pentium\protected\data\backup\cron.bat",$return_var); echo $return_var; I have tried escaping the slashes, but was of no use. -
I am trying to take the backup of PostgreSQL database using php. I have written the below code to run a batch file which has the command to take the backup. I am using Wampserver for development and the below coed works perfectly. But the problem is that it is not working on the server which is Windows Server 2008 R2. Please help. putenv("PGPASSWORD=postgres"); system("cmd /c D:\wamp\www\pentium\protected\data\backup\cron.bat"); Below is the content of cron.bat pg_dump -i -U "postgres" -F c -b -v -f "D:\wamp\www\pentium\protected/data/backup/pentium.backup" "pentium"