urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

Yes

urtrivedi 276 Nearly a Posting Virtuoso

is it php script?
is it single file script or multiple files?
can u post script code here?

urtrivedi 276 Nearly a Posting Virtuoso

add 3 lines before if and see what if gives in request array, copy and paste that output here.

echo "<pre>"
print_r($_REQUEST);
echo "</pre>";
if ( (!empty($_REQUEST['id']) && !empty($_REQUEST['mode'])) && $_REQUEST['mode'] == "delete")
{
.......
urtrivedi 276 Nearly a Posting Virtuoso

it is not going in the following if condition

if ( (!empty($_REQUEST['id']) && !empty($_REQUEST['mode'])) && $_REQUEST['mode'] == "delete")
urtrivedi 276 Nearly a Posting Virtuoso

no
it is cpanel demo
same way when you login to your cpanel account u find same databae section
on left side you can see "server"
then you have to create users for your mysql database, you have to give privilleages to your user to your database. (this username/pwd/database can be used to login to mysql database)

to allow remote access to mysql you need to give remote (your static ip address if you have)

urtrivedi 276 Nearly a Posting Virtuoso

change line 37 to following,

<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
urtrivedi 276 Nearly a Posting Virtuoso

http://x3demob.cpx3demo.com:2082/frontend/x3/index.html?post_login=67057016356023
Here you can see cpanel demo,
In database section click remote mysql

http://x3demob.cpx3demo.com:2082/frontend/x3/sql/managehost.html

Here you can see you can allow IP OF your server to access cpanel mysql db

urtrivedi 276 Nearly a Posting Virtuoso

1 )Your site is in joomla/wordpress/drupal or custom?
2) Are you owner or programmer?

urtrivedi 276 Nearly a Posting Virtuoso

when you buy any server space, they alwyas provide all 4 parameter like servername , database name, username and password for mysql.

so where is database server, ask them to provide the info. or if u can login to there system. you may find such information somewhere in ur account

urtrivedi 276 Nearly a Posting Virtuoso

THERE is differenct between parameter passing in mysql and mysqli. Link is passed later in mysql and passed as first parameter in mysqli.
so refer manual of mysql and replace parameter position where applicable

urtrivedi 276 Nearly a Posting Virtuoso

to access another server mysql data, you need to have permission to do so in mysql. If you know administrator you can ask him to allow access to the server.

urtrivedi 276 Nearly a Posting Virtuoso

submit full code

urtrivedi 276 Nearly a Posting Virtuoso

line 63 change it as following we make quantity 0 if use keep it blank

if(trim(=$_REQUEST["es_quantity"])=='') 
        $es_quantity="0";
else
    $es_quantity=$_REQUEST["es_quantity"];

112-116 comment 4 lines

/*
if ( !is_numeric($es_quantity) || ($es_quantity < 0) )
        {
            $errs[$errcnt]="$Quantity_must_be_non_zero_positive_integer";
            $errcnt++;
        }
*/

replace 709 to 715 by following code

       if(frm.es_quantity.value!='') 
       {
                if( isNaN(frm.es_quantity.value) || frm.es_quantity.value<0)
                {
                    alert('Please specify Quantity as a non-negative integer');
                    frm.es_quantity.focus();
                    frm.es_quantity.select();
                    return(false);
                }   
         }
urtrivedi 276 Nearly a Posting Virtuoso

If its just your computer or you are in network
You must know ip/domain name of SMTP server in your network

open php.ini file

[mail function]
SMTP = xxx.xxx.xxx.xxx (YOUR smtp ip like)
smtp_port = 25

now your php ini should look like this somewhere

restrat apache service

echo mail (......);

on success it will return 1 else nothing, if success you will receive mail within few seconds

urtrivedi 276 Nearly a Posting Virtuoso

I am adding hidden field for each icode next to check box

<?php

for (..)
{
<input name=prod[] type=checkbox value='$pr' onclick='javascript:setorder(this);'>
<input name='cd-$pr' id='cd-$pr' type=hidden value=''>
}
?>

now I am adding java script at the end of page

<script lang='javascript'>
var chkorder=1;
function setorder(chkbx)
{
   if(chkbx.checked)
   {
      document.getElementById('cd-'+chkbx.value).value=chkorder++;
   }
   else
   {
      document.getElementById('cd-'+chkbx.value).value='';
   }
}
</script>

Now in submit page you can get order of icode by following code

<?php
for ($i=0;$i<count($_POST[prod]);$i++)
{
    echo "icode={$_POST['prod'][$i]}  , chk order=$_POST['cd-'.{$_POST['prod'][$i]]}    ";
}
?>

SYNTAX IS NOT TESTED

urtrivedi 276 Nearly a Posting Virtuoso

Usually I have faced 2 issues with file upload.
1) web user may not having permission to write on the folder you chosed for update
2) if user file size is bigger then limit configured on the server then it will not upload

check admin setting and directory permission in your godady account

urtrivedi 276 Nearly a Posting Virtuoso

submit your code then we may able to help you.

urtrivedi 276 Nearly a Posting Virtuoso

You need to learn regular expressions
http://php.net/manual/en/function.preg-match.php

urtrivedi 276 Nearly a Posting Virtuoso

I dont know what problem you have, but your code is working here, you can try following code at your place

<?php

$dataTable= " 
{
'cols':[{'type':'string','label':'Analys'},
{'type':'number','label':'Test 1'},{'type':'number','label':'Test 2'}],
    'rows':[
{'c':[{'v':'Top'},{'v':78},{'v':71}]},
{'c':[{'v':'In'},{'v':88},{'v':91}]},
{'c':[{'v':'Pref'},{'v':60},{'v':72}]},
{'c':[{'v':'Int'},{'v':13},{'v':9}]}]}";

?>
<html>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable(<?php echo $dataTable; ?>);  

        var options = {
          title: 'Company Performance',
          hAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>

</head>
<body>
<div id='chart_div'></div>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

post code of both pages here

urtrivedi 276 Nearly a Posting Virtuoso

"Just only fetching once in select statment and you want to remove that from next select".
I feel this is strange requirement.

But anyway just after select you need to insert same 20 records in some another table, to keep track that this 20 records shown.

Then your select will also reference that second table (where u insert records after selection) for latest query.

urtrivedi 276 Nearly a Posting Virtuoso

You need to write javascript function, which will be called when item is selected in dropdown.
That function will add value/text to DIVs

urtrivedi 276 Nearly a Posting Virtuoso
{'type':'string','label':'Analys'},
{'type':'number','label':'Test 1'},
{'type':'number','label':'Test 2'}

I have changed type of 2 last rows to number from string

urtrivedi 276 Nearly a Posting Virtuoso

At a time how many record you want to fetch?

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about how asp.net uses cookies, But in php I used cookies to solve this kind of issues.
I had problem when user presses refresh button, it was inserting same record with new id. So I used cookies to track where record inserted or not.

urtrivedi 276 Nearly a Posting Virtuoso

I dont find any parse error in your code. What message you getting when you run this script.

ONe thing I see in line number 10, is its not $PHP_SELF rather its $_SERVER['PHP_SELF'];

urtrivedi 276 Nearly a Posting Virtuoso

You can use crontab as given in following link
I am assuming your server having linux

1) make php script ready for sending mail
2) configure job using crontab command crontab -e
3) add your script entry with time to execute.

00 01 * * 1 wget -q -O /dev/null http://www.domoinname.com/cronfolder/mailfile.php?para1=value1

Above command means your script (mailfile.php) will run at 1 am in morning on every monday

http://www.cs.sjsu.edu/faculty/froomin/Handouts/Crontab.html

urtrivedi 276 Nearly a Posting Virtuoso
select v.name as object, t.taggable_type as Type
FROM views v left outer join taggings t on (v.id = t.taggable_id
and t.taggable_type = 'View')
where t.taggable_id is null

IF you looking for
view_1, view
view_4, view

then my previous query is perfect. It must work, check again your data.

urtrivedi 276 Nearly a Posting Virtuoso

by sample I mean you sample values in "views" table and "taggings" table. then tell me what output you expect from that 2 tables. LIke give me as following
views
id , name
1, view_1
2, view_2
3, view_3
4, view_4

taggings
taggable_id, taggable_type
2, view
3, view

output required
1, view_1
4, view_4

Like about you give me sample data for both table, then give me what output u requrie from that 2 tables sample data. Is above given case is correct?

urtrivedi 276 Nearly a Posting Virtuoso

can you post sample data script and table structutre, I will try it here

urtrivedi 276 Nearly a Posting Virtuoso

so nothing is passed to your page

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

I hope inner join works in postgress, try following query

select v.name as object, t.taggable_type as Type
FROM views v left outer join taggings t on (v.id = t.taggable_id
and t.taggable_type = 'View')
where t.taggable_id is null
urtrivedi 276 Nearly a Posting Virtuoso

there are 2 ways,
1) conventional way,
on changing selection, you can submit page to server,
on server php source will fetch record by parameter passed
display record on page

2) jquery/ajax
You need to learn jquery/ajax
on changing selection, you can pass value to server without submitting whole page
then server will send response(you have to write request handler and u need to send response code)
you can display server response on the page

urtrivedi 276 Nearly a Posting Virtuoso

Have you echo what i sent you in previous post

<?php
//editimage.php
echo "<pre>";
print_r($_GET);
echo "</pre>";
.
.
.
other code
?>
urtrivedi 276 Nearly a Posting Virtuoso

because you are using "or" condition

urtrivedi 276 Nearly a Posting Virtuoso

you need to echo $image_id in link, otherwise you will not receive actually image id value.

<a href=\"editimage.php?img=<?php echo $image_id ?>\">Edit</a>

To check how value passed in your editimage.php, you can dump variables in the beginging

<?php
//editimage.php
echo "<pre>";
print_r($_GET);
echo "</pre>";
.
.
.
other code

?>
urtrivedi 276 Nearly a Posting Virtuoso

I have added on line ",avg(usage2) overall_avg"

Select 
    Partno
    ,SUM(Case When TransMOnth='January' Then Usage2 else 0 End) As Jan
    ,SUM(Case When TransMOnth='February' Then Usage2 else 0 End) As Feb
    ,SUM(Case When TransMOnth='March' Then Usage2 else 0 End) As Mar
    ,SUM(Case When TransMOnth='April' Then Usage2 else 0 End) As Apr
    ,SUM(Case When TransMOnth='May' Then Usage2 else 0 End) As May
    ,SUM(Case When TransMOnth='June' Then Usage2 else 0 End) As Jun
    ,SUM(Case When TransMOnth='July' Then Usage2 else 0 End) As Jul
    ,SUM(Case When TransMOnth='August' Then Usage2 else 0 End) As Aug
    ,SUM(Case When TransMOnth='September' Then Usage2 else 0 End) As Sep
    ,SUM(Case When TransMOnth='October' Then Usage2 else 0 End) As Oct
    ,SUM(Case When TransMOnth='November' Then Usage2 else 0 End) As Nov
    ,SUM(Case When TransMOnth='December' Then Usage2 else 0 End) As Dec
    ,avg(usage2) overall_avg
Into #Data2
From CTE2
Group by Partno
Having SUM(Case When TransMOnth='January' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='February' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='March' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='April' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='May' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='June' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='July' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='August' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='September' Then Usage2 else 0 End) > 0
    or SUM(Case When TransMOnth='October' Then Usage2 else 0 End) > 0
    or …
urtrivedi 276 Nearly a Posting Virtuoso

open link in your browser
http://servername/phpmyadmin/index.php

give root/pwd
I assume that phpmyadmin is installed on the web root folder

urtrivedi 276 Nearly a Posting Virtuoso

You can write following code in your process page

<?php
$wherecond="";
$sep="";
for ($i=0;$i<count($_POST['interests']);$i++)
{
   $wherecond .= $sep." colname like '%".$_POST['interests']."%' " 
   $sep=" or ";
}


$query="select * from tablename where ". $wherecond;


?>
urtrivedi 276 Nearly a Posting Virtuoso
SELECT  view_bom_total.mat_code1, 
Sum(view_bom_total.net_qty) net_qty, 
Sum(view_mrir_esd.acpt_qty) FROM view_bom_total 
inner join view_mrir_esd 
ON view_bom_total.mat_code1=view_mrir_esd.mat_code1 
GROUP BY view_bom_total.mat_code1
urtrivedi 276 Nearly a Posting Virtuoso

I think you are searching following link
http://www.apphp.com/php-datagrid/examples/sample_1_2_demo.php

This is demo of one existing datagrid tool. they give ver 4.2.8 as free (very basic). Rest versions are paid and advanced.

seslie commented: Spot on +2
urtrivedi 276 Nearly a Posting Virtuoso

ok

urtrivedi 276 Nearly a Posting Virtuoso

in the marksheet.php page you can access selected student by following line of code, in the begnining of the page

echo $_POST['st'];

or you dump post array to check what is posted like

echo "<pre>";
print_r($_POST);
echo "</pre>";
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

to smartscheff, but that may query unnessary fields. like if city is empty, but still it will search city with %.
So its better to check which columns are needed in search.

urtrivedi 276 Nearly a Posting Virtuoso

Yes you can change value of filedir as you wanted now in your class defiinition file

urtrivedi 276 Nearly a Posting Virtuoso

I have written line, 72 to 92 again , you should not if else structure.

        <?php
        if ($_REQUEST["city"]<>"") {
                $sqla = " AND (city LIKE '%".mysql_real_escape_string($_REQUEST["city"])."%')"; 
            }
            if ($_REQUEST["state"]<>"") {
                $sqlb = " AND state='".mysql_real_escape_string($_REQUEST['state'])."'";    
            }
            if ($_REQUEST["county"]<>"") {
                $sqlc = " AND (county LIKE '%".mysql_real_escape_string($_REQUEST["county"])."%')"; 
            }
            if ($_REQUEST["status"]<>"") {
                $sqld = " AND (status LIKE '%".mysql_real_escape_string($_REQUEST["status"])."%')"; 
            }
            if ($_REQUEST["pid"]<>"") {
                $sqle = " AND (asset_number LIKE '%".mysql_real_escape_string($_REQUEST["pid"])."%')";  
            }
            if ($_REQUEST["bank_officer"]<>"") {
                $sqlf = " AND bank_officer='".mysql_real_escape_string($_REQUEST["bank_officer"])."'";  
            }

            $sql = "SELECT * FROM property WHERE id>0".$sqla.$sqlb.$sqlc.$sqld.$sqle.$sqlf;
    ?>
urtrivedi 276 Nearly a Posting Virtuoso

If you open your class files, some where you will find class member filedir (see line 32 and 35 in your code).
So there you can change upload path and save that class file.

kjeu_kach commented: "filedir" change name? to insert url part in web. Thanks bro. +0