Guest User

Untitled

a guest
Sep 14th, 2012
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1. <?
  2. if( isset( $_GET['act'] ) )
  3. {
  4.     $phone = $_GET['user_id'];
  5.     $sub = $_GET['sub_id'];
  6.    
  7.     $res = mysql_query( "SELECT * FROM web_landings WHERE mtsub_1 = $sub OR mtsub_2 = $sub" );
  8.     $row = mysql_fetch_assoc($res);
  9.     $source = $row['id'];
  10.     $operator = $row['mtsub_1'] == $sub ? "mts" : "beeline";
  11.  
  12.     # find partner
  13.     $res = mysql_query("SELECT * FROM mt_regs WHERE phone = '$phone' AND sub_id = $sub AND disabled = 0");
  14.     if( $row = mysql_fetch_assoc( $res ) )
  15.     {
  16.         $pid = $row['partner_id'];
  17.         $flow = $row['flow_id'];
  18.         $flows = $flow;
  19.         $tariff = $row['tariff'];
  20.     }
  21.     else
  22.     {
  23.         $pid = 1;
  24.         $flows = 0;
  25.         $tariff = 0;
  26.     }
  27.  
  28.     switch( $_GET['act'] )
  29.     {
  30.         case "cont":
  31.             $cost = $_GET['cost'];
  32.             $period = $_GET['period'];
  33.             $pay_status = $_GET['pay_status'];
  34.            
  35.             if( $pay_status == 'ok' )
  36.             {
  37.                 $res = mysql_query( "SELECT p.rate FROM partner_partners p JOIN subaccounts s ON s.partner_id = p.id_partner WHERE s.id = $pid" );
  38.                 $row = mysql_fetch_array($res);
  39.                 $partner_coef = $row[0];
  40.            
  41.                 $reward = $cost * $partner_coef;
  42.                 $comission = $cost - $reward;
  43.                    
  44.                 $time = date('Y-m-d H:i:s');
  45.                 $date = date('Y-m-d');
Advertisement
Add Comment
Please, Sign In to add comment