PHP Script Novice Needing REAL Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nighttraindb
Forum Newbie
Posts: 9
Joined: Sun Mar 23, 2014 9:54 am

PHP Script Novice Needing REAL Help

Post by nighttraindb »

Hello everyone, whelp I attempted to post this earlier however it appears I did something wrong. So here it is again...

I have a struggling business, and am hoping to provide a -- potential -- opportunity. Long story short, I have a payment screen written
in PHP... and am looking to add a few items that we now offer.

And could use a little / alot of help being pointed in the right direction.

I also took the liberty of downloading the folder (ssh..) to my desktop below is a listing of the contents.

Volume in drive C has no label.
Volume Serial Number is 1436-784A

Directory of C:\Users\VFI\Desktop\vfipanel

03/23/2014 08:31 AM <DIR> .
03/23/2014 08:31 AM <DIR> ..
04/02/2013 01:19 PM 174 .buildpath
04/02/2013 01:19 PM 527 .project
03/23/2014 07:54 AM <DIR> .settings
04/09/2013 05:22 PM 1,843 1298521.pem
04/09/2013 05:22 PM 1,827 1909279223.pem
09/29/2013 10:36 PM 4,042 cc.php
04/14/2013 12:06 AM 2,511 cdrs.php
04/03/2013 06:27 PM 18 ck.html
04/13/2013 09:54 PM 1,184 ck.php
10/08/2013 07:06 PM 1,735 config.php
10/17/2012 12:00 PM 8,110 creditcard.js
03/23/2014 07:55 AM <DIR> css
04/11/2013 05:22 PM 1,853 custinfo.php
10/01/2013 02:41 PM 2,102 dids.php
04/15/2013 02:47 PM 621 foo.php
04/15/2013 02:49 PM 2,398 header.php
04/14/2013 07:12 PM 771 history.php
02/04/2013 08:56 PM 92,633 jquery-1.9.1.min.js
03/14/2013 04:48 PM 33,085 jquery-ui.css
03/14/2013 04:46 PM 451,109 jquery-ui.js
10/24/2013 05:01 AM 275,635 list.csv
10/24/2013 05:08 AM 244,675 list2.csv
04/09/2013 03:36 PM 1,849 loader.gif
04/02/2013 09:09 PM 1,224 login.js
04/02/2013 09:49 PM 2,930 login.php
04/02/2013 09:09 PM 814 logout.php
04/09/2013 05:22 PM 19,140 lphp.php
04/03/2013 02:31 PM 611 main.php
04/13/2013 09:58 PM 1,188 mg.php
04/03/2013 06:27 PM 25 mo.html
04/13/2013 09:58 PM 1,181 mo.php
04/13/2013 09:59 PM 1,183 mp.php
10/08/2013 01:42 PM 4,845 payments.php
10/01/2013 01:08 PM 646 pkginfo.php
04/14/2013 07:19 PM 1,367 session.php
10/08/2013 07:06 PM 233 testing.php
04/06/2013 11:20 PM 391 TODO.txt
03/23/2014 07:54 AM <DIR> upgradephp-18.1
03/23/2014 08:31 AM 0 vfipanel.txt
04/13/2013 09:59 PM 1,191 wt.php
04/13/2013 09:58 PM 1,179 wu.php
10/08/2013 12:52 PM 3,734 _cc.php
10/08/2013 12:52 PM 2,128 _ck.php
10/08/2013 12:52 PM 2,113 _mg.php
10/08/2013 12:52 PM 2,114 _mo.php
10/08/2013 12:52 PM 2,110 _mp.php
10/08/2013 12:52 PM 1,918 _searchcust.php
10/08/2013 12:52 PM 1,258 _searchdid.php
10/08/2013 12:52 PM 2,119 _wt.php
10/08/2013 12:52 PM 2,123 _wu.php
47 File(s) 1,186,467 bytes
5 Dir(s) 29,516,054,528 bytes free
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP Script Novice Needing REAL Help

Post by Christopher »

nighttraindb wrote:I have a payment screen written
in PHP... and am looking to add a few items that we now offer.

And could use a little / alot of help being pointed in the right direction.
The URL did not work and the directory listing is not much help. Could you describe more specifically what you want to do. And post the source of the page that you want to add "a few items" to.
(#10850)
nighttraindb
Forum Newbie
Posts: 9
Joined: Sun Mar 23, 2014 9:54 am

Re: PHP Script Novice Needing REAL Help

Post by nighttraindb »

Hello and thanks you for responding. I am looking to find a way to add items that we sale to this script.

Currently, the script only has our phone services however we have other programs that have expiration dates... view-source: http://74.82.168.254/vfipanel/

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>VFI Customer Control</title>
		<link rel="stylesheet" href="css/960.css" type="text/css" media="screen" charset="utf-8" />
		<!--<link rel="stylesheet" href="css/fluid.css" type="text/css" media="screen" charset="utf-8" />-->
		<link rel="stylesheet" href="css/template.css" type="text/css" media="screen" charset="utf-8" />
		<link rel="stylesheet" href="css/colour.css" type="text/css" media="screen" charset="utf-8" />
		<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="jquery-ui.js"></script>
		<link rel="stylesheet" type="text/css" media="screen" href="jquery-ui.css" charset="utf-8" />
   <style type="text/css">

</style>
<style type="text/css" media="screen">
	.suggest_link {
		background-color: #FFFFFF;
		padding: 2px 6px 2px 6px;
	}
	.suggest_link_over {
		background-color: #3366CC;
		padding: 2px 6px 2px 6px;
	}
	#search_suggest {
		position: absolute;
		margin-left:140px;
		background-color: #FFFFFF; 
		text-align: left; 
		border: 1px solid #000000;			
	}	
	
	#customer_info {
		width: 50%;
		margin: 2px;
    	border-spacing: 1px;
 
		}	
		
	
	#customer_info td {	
		padding: 2px 2px;
	}
	#customer_info td.left {	
		padding: 2px 2px;
		border-right: 1px;
	}
	
		#creditcard {
		width: 50%;
		margin: 2px;
		padding: 2px 2px;
    	border-spacing: 1px;
 
		}
	
		
	#customer_cdr {
    	margin: 2px;
    	border-spacing: 1px;
  	}
  	#customer_cdr td{
    background: none;
    padding: 1px;
    font-size: small;
     }
 	#payment_details {
 		border:1px solid;
 		}
 
 
</style>
	</head>
	<body>
<h1 id="head">VFI Customer Control</h1>		
		
		<ul id="navigation">
			<li><a href="main.php">Phone Customers</a></li>
			<li><a href="logout.php">Logout</a></li>
			<li>&nbsp</li>
			<li>&nbsp</li>
			<li><i>Logged in as: </i></li>
		</ul>



<script>
$(function() {
$( "#custsearch" ).autocomplete({
source: "_searchcust.php",
minLength: 3,
select: function( event, ui ) {
        $('#log').load('custinfo.php?cust_id='+ui.item.value);
    this.value = "";
    return false;
}
});
});



</script>


<div id ="content" class="container_16 clearfix">
<div class="container_16 clearfix">
<label for="custsearch">Search Customers: </label>
<input id="custsearch" width=30 size=30 /> (Enter name, card #, DID, or Destination #)
</div>
<div id="log"></div>




</div>
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Script Novice Needing REAL Help

Post by Celauran »

This still doesn't give us much to work with. Generally, when someone is asking to see the code, they don't mean view source, which we can do ourselves, but rather the contents of the PHP file in question. It looks like you've got jQuery UI autocomplete calling some back end script. Is this not working correctly? You mention adding new items to this script. Do you want these searchable from the same page? From the same form? Are they currently accessible elsewhere on the site? The more specific you can be, the better equipped we'll be to guide you toward a solution.
nighttraindb
Forum Newbie
Posts: 9
Joined: Sun Mar 23, 2014 9:54 am

Re: PHP Script Novice Needing REAL Help

Post by nighttraindb »

Ok, thanks sorry complete novice at this. Hopefully I can answer these in the order received here....

Generally, when someone is asking to see the code, they don't mean view source, which we can do ourselves, but rather the contents of the PHP file in question.
Answer: Sadly, I do not know which one of the php files in the list I first provided would be needed..

It looks like you've got jQuery UI autocomplete calling some back end script. Is this not working correctly?
Answer: The program works great, it is just my reps cant use the UI to receive payments for any of our other services other than phones minutes....

You mention adding new items to this script. Do you want these searchable from the same page?
Answer: Yes, I suppose what I mean is I would like to have it when a customer call they give their name or account number and we can pull up their info ... thus telling them when their account expires etc... Currently , a customer calls -- regarding our phone service-- we can ask for their name, phone number, account number and with any of this info we can pull up their account then receive payment based on the info...

Are they currently accessible elsewhere on the site?
Answer: No, they are not accessible anywhere else. My thinking is that we could use the same back end script.. Realizing it would be for new accounts only not accounts we already have.

To help spell it out some (a bit difficult to explain) if you goto the page and in the search box type 3109369500

It will provide a account from the query then if you hit payments then select a package THAT is what I want to change What comes up in that list.. I wish to add a few items.

I can provide any of the phps I listed earlier just due to it being so many was unsure which one would be of use to anyone assisting.

Thanks
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Script Novice Needing REAL Help

Post by Celauran »

Looking at the JS listeners in that tab, it looks like pkginfo.php is where you'd want to start looking. Whether or not that's the file that contains the data that initially populates those dropdown lists, I don't have enough information to say.
nighttraindb
Forum Newbie
Posts: 9
Joined: Sun Mar 23, 2014 9:54 am

Re: PHP Script Novice Needing REAL Help

Post by nighttraindb »

Thank You, this helps point me in the right direction... below is the script from what I see it is not the one that populates.. however I am sure one of the others ending in .php will be what I am looking for.

Code: Select all

<?php
include("config.php");
include("upgradephp-18.1/upgrade.php");
header("Content-Type: application/json");
if (substr($_GET["pkg"],0,1) == "L") {
	$latefee = 15;
	$pkg_id = substr($_GET["pkg"],1);
} else {
	$pkg_id = substr($_GET["pkg"],0);
}
$sql = "select * from payment_options where payment_id = $pkg_id";
error_log($sql);
$sth=$db->prepare($sql);
$sth->execute();
$payment_row = $sth->fetch();
$total = $payment_row["price"] + $latefee;
$months = intval(intval($payment_row["additional_days"])/30);
echo json_encode(array('total'=> $total,'months' =>$months  ));
error_log(json_encode(array('total'=> $total)));
?>
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Script Novice Needing REAL Help

Post by Celauran »

If you aren't sure which file it's in, since you know a dropdown list is being generated, you could grep for 'select' and work backwards from there.
nighttraindb
Forum Newbie
Posts: 9
Joined: Sun Mar 23, 2014 9:54 am

Re: PHP Script Novice Needing REAL Help

Post by nighttraindb »

much obliged thanks
Post Reply