Skip to content

Instantly share code, notes, and snippets.

@davidjmorin
Created April 21, 2020 17:20
Show Gist options
  • Save davidjmorin/0f6db2050312ffebd8790fa59ac8f3ab to your computer and use it in GitHub Desktop.
Save davidjmorin/0f6db2050312ffebd8790fa59ac8f3ab to your computer and use it in GitHub Desktop.
$admin = 'SELECT A.Tran_Year,
A.Tran_Period,
A.Original_Mobile_ID,
A.Mobile_ID,
A.Device_ID,
A.Account_Number,
A.Customer_Name,
A.Activation_Date,
A.Contract_Term,
A.Model,
A.VZW_Provided_Equip,
A.Previously_Activated_Equip,
A.Installment_Contract,
A.Purchased_Receivable,
A.Agent_SS,
A.Account_Create_Date,
A.Original_Account_Number,
A.Kicker_Type,
A.DPA_Service_Fee2,
A.Commission_Amount2,
A.ACD2,
A.SPIFF_Amount2,
A.Kicker_Amount2,
l.City,
l.Owner,
l.Outlet_ID,
l.Region,
l.district
FROM allActivations A
INNER JOIN locations l ON A.Agent_ID = l.Outlet_ID
LEFT JOIN rq_received_orders R
ON FIND_IN_SET(SUBSTRING(A.Device_ID,1, 13), SUBSTRING(R.Tracking_, 1,13))
WHERE LEFT(R.Tracking_, 13) IS NULL
AND A.Tran_Year = "'. $_SESSION['year'] .'"
AND A.Tran_Period = "'. $_SESSION['month'] . '"
';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment