jatl2014 Posted July 12, 2015 Share Posted July 12, 2015 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 wellhttps://docs.google.com/document/d/14aeX9sKpu95cSf3wT7WXX4gLQVsEfNdWiF9KCh71ypc/edit?usp=sharingread 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 #8if DirectReps < Q.DR(i) then reprank = I ; exit forif DirectClients < Q.DC(i) then reprank = I ; exit forif GQV < Q.GQV(i) Then reprank = I ; exit forread from table in an arraydirects() select all repid from rep table where directrep = repidrepneeded = 1k= 1z = 0//loop through all the directreps looking for the # of reps needed to qualifywhile 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 1RepstoUSeforadvancerank(z)= istherearepundertoqualify(arraydirects(k),I,7)if RepstoUSeforadvancerank(z) <> “” the repneeded = repneeded + 1k = k + 1z = z + 1}if repneeded >= Q.UR(i) then {//get the repid to use for the qualification and update the field of rephelpedtoqualified Z = 0for z to Q.UR(i) -1update rephelpedtoqualified = repid from tablerep where repid = RepstoUSeforadvancerank(z) next z}next iupdate 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 = repidif ranksearched = rank and rephelpedtoqualified = "" then return repid ; exit functionread from table in an arraydirects() select all repid from rep table where directrep = repidI = 1for 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. Quote Link to comment https://forums.phpfreaks.com/topic/297267-help-to-pass-this-function-to-php-thanks-in-advance/ Share on other sites More sharing options...
Ch0cu3r Posted July 12, 2015 Share Posted July 12, 2015 What you have posted makes no sense at all to me. If you are going to post code then wrap in tag or click the <> button in the editor. I dont know php Im gonna have to pick a book this weekend and start learning. If you are new to PHP then I would suggest you look the PHP documentation first. Start with the Language Reference chapter first, this will explain the PHP syntax. Quote Link to comment https://forums.phpfreaks.com/topic/297267-help-to-pass-this-function-to-php-thanks-in-advance/#findComment-1516154 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.