It is currently Sat Sep 04, 2010 6:26 pm

All times are UTC




 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: trying to add free option
PostPosted: Wed Aug 29, 2007 12:45 am 
Executive Fr33lancer

Joined: Thu May 26, 2005 2:45 am
Posts: 132
Trying to add free option.

I have free files from the classifieds site but I guess they are different to this site.

I know it is the more.php, payments.php and MoreTemplate files that need to be edited.

I have it setup at afterhoursnightparty.com and I have the free listing set as 0.00

Here is the original code for payments.php



Code:
<?
require_once("conn.php");
require_once("includes.php");

if(empty($_GET[SelectedPackage]))
{
   header("location:$_SERVER[HTTP_REFERER]?e=1&PaymentGateway=$_GET[PaymentGateway]");
}
elseif(empty($_GET[PaymentGateway]))
{
   header("location:$_SERVER[HTTP_REFERER]?e=2&SelectedPackage=$_GET[SelectedPackage]");
}
else
{
   if(!empty($_SESSION[AgentID]))
   {
      $MyID = $_SESSION[AgentID];
   }

   if(!empty($_SESSION[MemberID]))
   {
      $MyID = $_SESSION[MemberID];
   }

   //get the agent details
   $q1 = "select * from personal_members where MemberID = '$MyID' ";
   $r1 = mysql_query($q1) or die(mysql_error());
   $a1 = mysql_fetch_array($r1);

   //get the price details
   $q2 = "select * from personal_prices where PriceID = '$_GET[SelectedPackage]' ";
   $r2 = mysql_query($q2) or die(mysql_error());
   $a2 = mysql_fetch_array($r2);

   /*

   flags:

   r -> renew

   n -> new

   m -> more

   */

   if(ereg("renew.php", $_SERVER[HTTP_REFERER]))
   {
      $flag = "r";
      $action = "Renewal";
   }
   elseif(ereg("more.php", $_SERVER[HTTP_REFERER]))
   {
      $flag = "m";
      $action = "Upgrade";
   }
   else
   {
      $flag = "n";
      $action = "Activation";
   }

   if($_GET[PaymentGateway] == "paypal")
   {
      header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=$a2[ads] ads for $a2[days] days&first_name=$a1[FirstName]&last_name=$a1[LastName]&email=$a1[email]&item_number=1&custom=$MyID|$_GET[SelectedPackage]|$flag&amount=$a2[price]&notify_url=http://$_SERVER[HTTP_HOST]$dir/notify.php&return=http://$_SERVER[HTTP_HOST]$dir/login.php");

      
}
   else
   {
      //manual

      //send an email to the admin
      $to = $aset[ContactEmail];
      $subject = "Manual Service $action Request";
      $message = "A client has selected Manual Service $action\nHere are the details:\n\n";
      $message .= "Username: $a1[username]\nNames: $a1[FirstName] $a1[LastName]\nSelected Package: $a2[ads] ";

      if($a2[PriorityLevel] == '1')
      {
         $message .= "Featured ";
      }

      $message .= "ads for $a2[days] days\nPrice: $$a2[price]\n";


      $headers = "MIME-Version: 1.0\n";
      $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
      $headers .= "Content-Transfer-Encoding: 8bit\n";
      $headers .= "From: WebSites <$aset[ContactEmail]>\n";
      $headers .= "X-Priority: 1\n";
      $headers .= "X-MSMail-Priority: High\n";
      $headers .= "X-Mailer: PHP/" . phpversion()."\n";

      mail($to, $subject, $message, $headers);      

      //send an email to the client

      $to = $a1[email];
      $subject = "Your registration at $_SERVER[HTTP_HOST]";
      $message = "Hello $a1[FirstName] $a1[LastName],\nhere is your login information for $_SERVER[HTTP_HOST]\n\nUsername: $a1[username]\nPassword: $a1[password]\n\nWe will send you another email message, when your account is activated.\n\nThank you for your registration!";   

      $headers = "MIME-Version: 1.0\n";
      $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
      $headers .= "Content-Transfer-Encoding: 8bit\n";
      $headers .= "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>\n";
      $headers .= "X-Priority: 1\n";
      $headers .= "X-MSMail-Priority: High\n";
      $headers .= "X-Mailer: PHP/" . phpversion()."\n";

      mail($to, $subject, $message, $headers);

      //get the templates
      require_once("templates/HeaderTemplate.php");
      require_once("templates/ManualTemplate.php");
      require_once("templates/FooterTemplate.php");
   }

}

?>


Thanks


Offline
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 2:13 pm 
Grand Master Fr33lancer
User avatar

Joined: Thu May 19, 2005 2:45 pm
Posts: 590
Hi,
You can duplicate the manual process, but add a free on more.php to the dropdown.
Have the price check the value for the plan selected is 0.00 in value.
And payment option is free.
If all is ok, add credits.
If not, throw error message.



_________________
Thanks
Paul
1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
phpBB skin developed by: John Olson
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group