Jump to content

jatl2014

New Members
  • Posts

    1
  • Joined

  • Last visited

jatl2014's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I need help to make this code a working functions on php. It doesnt need to be tested, I just need it in php code. It doesnt have to be perfect but a start.. CheckforNewRepLevel(rep id ) { get from table rep RepGQVolume , Directreps , Directclients, read qualifications that should be in a table Qualifications -Q- ( we will manage Ranks 1 through //image with con as well https://docs.google.com/document/d/14aeX9sKpu95cSf3wT7WXX4gLQVsEfNdWiF9KCh71ypc/edit?usp=sharing read table on an array Q so Q.rank1). value should be 1, Q.rank(2). value should be 2 / Q.rank(4). value is 3 for i= 1 to #8 if DirectReps < Q.DR(i) then reprank = I ; exit for if DirectClients < Q.DC(i) then reprank = I ; exit for if GQV < Q.GQV(i) Then reprank = I ; exit for read from table in an arraydirects() select all repid from rep table where directrep = repid repneeded = 1 k= 1 z = 0 //loop through all the directreps looking for the # of reps needed to qualify while k <= count how many rows in arraydirects() and repneeded <= Q.UR(i) { // numberof levels to look down is 8 – 1beacuse we just read direct rep that are level 1 RepstoUSeforadvancerank(z)= istherearepundertoqualify(arraydirects(k),I,7) if RepstoUSeforadvancerank(z) <> “” the repneeded = repneeded + 1 k = k + 1 z = z + 1 } if repneeded >= Q.UR(i) then { //get the repid to use for the qualification and update the field of rephelpedtoqualified Z = 0 for z to Q.UR(i) -1 update rephelpedtoqualified = repid from tablerep where repid = RepstoUSeforadvancerank(z) next z } next i update field reprank = I on table rep -- } //recursive function search reps under RepId that have Rank i and rephelpedtoqualified = “” istherearepundertoqualify (RepID,Ranksearched,levels) { select rank, rephelpedtoqualified from table rep where repid = repid if ranksearched = rank and rephelpedtoqualified = "" then return repid ; exit function read from table in an arraydirects() select all repid from rep table where directrep = repid I = 1 for i to levels{ istherearepundertoqualify(arraydirects(i),ranksearched,levels - 1) } return “” } A first draw will help as well. Logic might not make much of sense but I need to start somewhere. any comments appreciate. thanks again. I dont know php Im gonna have to pick a book this weekend and start learning.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.