Best Atoum code snippet using std.init
Node.php
Source:Node.php
...56 } else {57 return 0;58 }59 }60 public static function setParentCommision($id, $init = 0,$cupon_code=0)61 {62 $init++;63 if ($id == '') {64 return 1;65 }66 else {67 $res = DB::table('node')->select('id', 'distributor_id', 'sponser_name', 'p', 'p_id', 'name', 'coupon_code')->where('id', $id)->first();68 // echo "<br>" . $res->p_id . " : $res->p ,$init";69 if($res)70 {71 if($res->p >0)72 {73 $amount = 0;74 if ($init == 1) {75 $amount = 300;76 } elseif ($init == 2) {77 $amount = 200;78 } elseif ($init == 3) {79 $amount = 100;80 } elseif ($init == 4) {81 $amount = 50;82 } elseif ($init == 5) {83 $amount = 20;84 }85 if ($amount >= 20) {86 $data = [87 'node_id' => $res->p,88 'node_code' => $res->p_id,89 'node_name' => $res->sponser_name,90 'coupon' => $cupon_code,91 'amount' => $amount,92 'status' => 'credit'93 ];94 DB::table('transaction')->insert($data);95 }96 //print_r("test value <pre>".$res);97 self::setParentCommision($res->p, $init, $cupon_code);98 }99 }100 }101 }102 /*public static function setAutoParentCommision($id, $init = 0,$cupon_code=0)103 {104 $init++;105 if ($id == '') {106 return 1;107 }108 else {109 $res = DB::table('auto_node')->select('id', 'distributor_id', 'sponser_name', 'p', 'p_id', 'name', 'coupon_code')->where('id', $id)->first();110 // echo "<br>" . $res->p_id . " : $res->p ,$init";111 $amount = 0;112 if ($init == 1) {113 $amount = 0;114 } elseif ($init == 2) {115 $amount = 0;116 } elseif ($init == 3) {117 $amount = 0;118 } elseif ($init == 4) {119 $amount = 0;120 } elseif ($init == 5) {121 $amount = 0;122 }elseif ($init == 6) {123 $amount = 80;124 }125 if ($amount >= 80) {126 $data = [127 'node_id' => $res->p,128 'node_code' => $res->p_id,129 'node_name' => $res->sponser_name,130 'coupon' => $cupon_code,131 'amount' => $amount,132 'status' => 'credit'133 ];134 DB::table('autotransaction')->insert($data);135 }136 //print_r("test value <pre>".$res);137 self::setAutoParentCommision($res->p, $init, $cupon_code);138 }139 }*/140 public static function getParentList($id, $init = 0)141 {142 $init++;143 if ($id == '') {144 return 1;145 } else {146 $res = DB::table('node')->select('p', 'p_id','name','coupon_code')->where('id', $id)->first();147 echo "<br>" . $res->p_id . " : $res->p ,$init";148 self::getParentList($res->p, $init);149 }150 }151 public static function getTreeStructure($id)152 {153 $res = DB::table('node')->select('name','coupon_code','distributor_id','l','m','r')->where('id', $id)->first();154 $root=new \stdClass();155 $root->id=$id;156 $root->name=$res->name;157 $root->distributor_id=$res->distributor_id;158 $root->coupon_code=$res->coupon_code;159 $resl= DB::table('node')->select('name','coupon_code','distributor_id','l','m','r')->where('id', $res->l)->first();160 if ($resl) {161 $left = new \stdClass();162 $left->id = $res->l;163 $left->name = $resl->name;164 $left->distributor_id = $resl->distributor_id;165 $left->coupon_code = $resl->coupon_code;166 }else167 {168 $left = new \stdClass();169 $left->id = "#";170 $left->name = "Empty";171 $left->distributor_id ="";172 $left->coupon_code = "";173 }174 $resm = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $res->m)->first();175 if ($resm) {176 $middle = new \stdClass();177 $middle->id = $res->m;178 $middle->name = $resm->name;179 $middle->distributor_id = $resm->distributor_id;180 $middle->coupon_code = $resm->coupon_code;181 }else182 {183 $middle = new \stdClass();184 $middle->id = "#";185 $middle->name = "Empty";186 $middle->distributor_id ="";187 $middle->coupon_code = "";188 }189 $resr = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $res->r)->first();190 if ($resr) {191 $right = new \stdClass();192 $right->id = $res->r;193 $right->name = $resr->name;194 $right->distributor_id = $resr->distributor_id;195 $right->coupon_code = $resr->coupon_code;196 }else197 {198 $right = new \stdClass();199 $right->id = "#";200 $right->name = "Empty";201 $right->distributor_id ="";202 $right->coupon_code = "";203 }204 if ($resl)205 {206 $resll = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resl->l)->first();207 if ($resll) {208 $leftl = new \stdClass();209 $leftl->id = $resl->l;210 $leftl->name = $resll->name;211 $leftl->distributor_id = $resll->distributor_id;212 $leftl->coupon_code = $resll->coupon_code;213 } else {214 $leftl = new \stdClass();215 $leftl->id = "#";216 $leftl->name = "Empty";217 $leftl->distributor_id = "";218 $leftl->coupon_code = "";219 }220 $reslm = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resl->m)->first();221 if ($reslm) {222 $leftm = new \stdClass();223 $leftm->id = $resl->m;224 $leftm->name = $reslm->name;225 $leftm->distributor_id = $reslm->distributor_id;226 $leftm->coupon_code = $reslm->coupon_code;227 } else {228 $leftm = new \stdClass();229 $leftm->id = "#";230 $leftm->name = "Empty";231 $leftm->distributor_id = "";232 $leftm->coupon_code = "";233 }234 $reslr = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resl->r)->first();235 if ($reslr) {236 $leftr = new \stdClass();237 $leftr->id = $resl->r;238 $leftr->name = $reslr->name;239 $leftr->distributor_id = $reslr->distributor_id;240 $leftr->coupon_code = $reslr->coupon_code;241 } else {242 $leftr = new \stdClass();243 $leftr->id = "#";244 $leftr->name = "Empty";245 $leftr->distributor_id = "";246 $leftr->coupon_code = "";247 }248 }else249 {250 $leftl = new \stdClass();251 $leftl->id = "#";252 $leftl->name = "Empty";253 $leftl->distributor_id = "";254 $leftl->coupon_code = "";255 $leftm = new \stdClass();256 $leftm->id = "#";257 $leftm->name = "Empty";258 $leftm->distributor_id = "";259 $leftm->coupon_code = "";260 $leftr = new \stdClass();261 $leftr->id = "#";262 $leftr->name = "Empty";263 $leftr->distributor_id = "";264 $leftr->coupon_code = "";265 }266 if ($resm)267 {268 $resml = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resm->l)->first();269 if ($resml) {270 $middlel = new \stdClass();271 $middlel->id = $resm->l;272 $middlel->name = $resml->name;273 $middlel->distributor_id = $resml->distributor_id;274 $middlel->coupon_code = $resml->coupon_code;275 } else {276 $middlel = new \stdClass();277 $middlel->id = "#";278 $middlel->name = "Empty";279 $middlel->distributor_id = "";280 $middlel->coupon_code = "";281 }282 $resmm = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resm->m)->first();283 if ($resmm) {284 $middlem = new \stdClass();285 $middlem->id = $resm->m;286 $middlem->name = $resmm->name;287 $middlem->distributor_id = $resmm->distributor_id;288 $middlem->coupon_code = $resmm->coupon_code;289 } else {290 $middlem = new \stdClass();291 $middlem->id = "#";292 $middlem->name = "Empty";293 $middlem->distributor_id = "";294 $middlem->coupon_code = "";295 }296 $resmr = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resm->r)->first();297 if ($resmr) {298 $middler = new \stdClass();299 $middler->id = $resm->r;300 $middler->name = $resmr->name;301 $middler->distributor_id = $resmr->distributor_id;302 $middler->coupon_code = $resmr->coupon_code;303 } else {304 $middler = new \stdClass();305 $middler->id = "#";306 $middler->name = "Empty";307 $middler->distributor_id = "";308 $middler->coupon_code = "";309 }310 }else311 {312 $middlel = new \stdClass();313 $middlel->id = "#";314 $middlel->name = "Empty";315 $middlel->distributor_id = "";316 $middlel->coupon_code = "";317 $middlem = new \stdClass();318 $middlem->id = "#";319 $middlem->name = "Empty";320 $middlem->distributor_id = "";321 $middlem->coupon_code = "";322 $middler = new \stdClass();323 $middler->id = "#";324 $middler->name = "Empty";325 $middler->distributor_id = "";326 $middler->coupon_code = "";327 }328 if ($resr)329 {330 $resrl = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resr->l)->first();331 if ($resrl) {332 $rightl = new \stdClass();333 $rightl->id = $resr->l;334 $rightl->name = $resrl->name;335 $rightl->distributor_id = $resrl->distributor_id;336 $rightl->coupon_code = $resrl->coupon_code;337 } else {338 $rightl = new \stdClass();339 $rightl->id = "#";340 $rightl->name = "Empty";341 $rightl->distributor_id = "";342 $rightl->coupon_code = "";343 }344 $resrm = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resr->m)->first();345 if ($resrm) {346 $rightm = new \stdClass();347 $rightm->id = $resr->m;348 $rightm->name = $resrm->name;349 $rightm->distributor_id = $resrm->distributor_id;350 $rightm->coupon_code = $resrm->coupon_code;351 } else {352 $rightm = new \stdClass();353 $rightm->id = "#";354 $rightm->name = "Empty";355 $rightm->distributor_id = "";356 $rightm->coupon_code = "";357 }358 $resrr = DB::table('node')->select('name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $resr->r)->first();359 if ($resrr) {360 $rightr = new \stdClass();361 $rightr->id = $resr->r;362 $rightr->name = $resrr->name;363 $rightr->distributor_id = $resrr->distributor_id;364 $rightr->coupon_code = $resrr->coupon_code;365 } else {366 $rightr = new \stdClass();367 $rightr->id = "#";368 $rightr->name = "Empty";369 $rightr->distributor_id = "";370 $rightr->coupon_code = "";371 }372 }else373 {374 $rightl = new \stdClass();375 $rightl->id = "#";376 $rightl->name = "Empty";377 $rightl->distributor_id = "";378 $rightl->coupon_code = "";379 $rightm = new \stdClass();380 $rightm->id = "#";381 $rightm->name = "Empty";382 $rightm->distributor_id = "";383 $rightm->coupon_code = "";384 $rightr = new \stdClass();385 $rightr->id = "#";386 $rightr->name = "Empty";387 $rightr->distributor_id = "";388 $rightr->coupon_code = "";389 }390 $data=['root'=>$root,391 'left'=>$left,392 'middle'=>$middle,393 'right'=>$right,394 'leftl'=>$leftl,395 'leftm'=>$leftm,396 'leftr'=>$leftr,397 'middlel'=>$middlel,398 'middlem'=>$middlem,399 'middler'=>$middler,400 'rightl'=>$rightl,401 'rightm'=>$rightm,402 'rightr'=>$rightr403 ];404 return $data;405 }406 public static function getAutoTree($id)407 {408 $root_data=self::BuidAutoTree($id);409 $left_data=self::BuidAutoTree($root_data['left']->id);410 $middle_data=self::BuidAutoTree($root_data['middle']->id);411 $right_data=self::BuidAutoTree($root_data['right']->id);412 $data=['root'=>$root_data['root'],413 'left'=>$root_data['left'],414 'middle'=>$root_data['middle'],415 'right'=>$root_data['right'],416 'leftl'=>$left_data['left'],417 'leftm'=>$left_data['middle'],418 'leftr'=>$left_data['right'],419 'middlel'=>$middle_data['left'],420 'middlem'=>$middle_data['middle'],421 'middler'=>$middle_data['right'],422 'rightl'=>$right_data['left'],423 'rightm'=>$right_data['middle'],424 'rightr'=>$right_data['right']425 ];426 return $data;427 }428 public static function getSilverTree($id)429 {430 $root_data=self::BuidSilverTree($id);431 $left_data=self::BuidSilverTree($root_data['left']->id);432 $middle_data=self::BuidSilverTree($root_data['middle']->id);433 $right_data=self::BuidSilverTree($root_data['right']->id);434 $data=['root'=>$root_data['root'],435 'left'=>$root_data['left'],436 'middle'=>$root_data['middle'],437 'right'=>$root_data['right'],438 'leftl'=>$left_data['left'],439 'leftm'=>$left_data['middle'],440 'leftr'=>$left_data['right'],441 'middlel'=>$middle_data['left'],442 'middlem'=>$middle_data['middle'],443 'middler'=>$middle_data['right'],444 'rightl'=>$right_data['left'],445 'rightm'=>$right_data['middle'],446 'rightr'=>$right_data['right']447 ];448 return $data;449 }450 public static function getGoldTree($id)451 {452 $root_data=self::BuidGoldTree($id);453 $left_data=self::BuidGoldTree($root_data['left']->id);454 $middle_data=self::BuidGoldTree($root_data['middle']->id);455 $right_data=self::BuidGoldTree($root_data['right']->id);456 $data=['root'=>$root_data['root'],457 'left'=>$root_data['left'],458 'middle'=>$root_data['middle'],459 'right'=>$root_data['right'],460 'leftl'=>$left_data['left'],461 'leftm'=>$left_data['middle'],462 'leftr'=>$left_data['right'],463 'middlel'=>$middle_data['left'],464 'middlem'=>$middle_data['middle'],465 'middler'=>$middle_data['right'],466 'rightl'=>$right_data['left'],467 'rightm'=>$right_data['middle'],468 'rightr'=>$right_data['right']469 ];470 return $data;471 }472 public static function BuidAutoTree($id)473 {474 $res = DB::table('auto_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $id)->first();475 if ($res)476 {477 $root = new \stdClass();478 $root->id = $res->id;479 $root->name = $res->name;480 $root->distributor_id = $res->distributor_id;481 $root->coupon_code = $res->coupon_code;482 $resl = DB::table('auto_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) - 1))->first();483 if ($resl) {484 $left = new \stdClass();485 $left->id = $resl->id;486 $left->name = $resl->name;487 $left->distributor_id = $resl->distributor_id;488 $left->coupon_code = $resl->coupon_code;489 } else {490 $left = new \stdClass();491 $left->id = "#";492 $left->name = "Empty";493 $left->distributor_id = "";494 $left->coupon_code = "";495 }496 $resm = DB::table('auto_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3)))->first();497 if ($resm) {498 $middle = new \stdClass();499 $middle->id = $resm->id;500 $middle->name = $resm->name;501 $middle->distributor_id = $resm->distributor_id;502 $middle->coupon_code = $resm->coupon_code;503 } else {504 $middle = new \stdClass();505 $middle->id = "#";506 $middle->name = "Empty";507 $middle->distributor_id = "";508 $middle->coupon_code = "";509 }510 $resr = DB::table('auto_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) + 1))->first();511 if ($resr) {512 $right = new \stdClass();513 $right->id = $resr->id;514 $right->name = $resr->name;515 $right->distributor_id = $resr->distributor_id;516 $right->coupon_code = $resr->coupon_code;517 } else {518 $right = new \stdClass();519 $right->id = "#";520 $right->name = "Empty";521 $right->distributor_id = "";522 $right->coupon_code = "";523 }524 }525 else {526 $root = new \stdClass();527 $root->id = '#';528 $root->name = 'Empty';529 $root->distributor_id = '';530 $root->coupon_code = '';531 $left = new \stdClass();532 $left->id = "#";533 $left->name = "Empty";534 $left->distributor_id = "";535 $left->coupon_code = "";536 $middle = new \stdClass();537 $middle->id = "#";538 $middle->name = "Empty";539 $middle->distributor_id = "";540 $middle->coupon_code = "";541 $right = new \stdClass();542 $right->id = "#";543 $right->name = "Empty";544 $right->distributor_id = "";545 $right->coupon_code = "";546 }547 $data=[548 'root'=>$root,549 'left'=>$left,550 'middle'=>$middle,551 'right'=>$right552 ];553 return $data;554 }555 public static function BuidSilverTree($id)556 {557 $res = DB::table('silver_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $id)->first();558 if ($res)559 {560 $root = new \stdClass();561 $root->id = $res->id;562 $root->name = $res->name;563 $root->distributor_id = $res->distributor_id;564 $root->coupon_code = $res->coupon_code;565 $resl = DB::table('silver_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) - 1))->first();566 if ($resl) {567 $left = new \stdClass();568 $left->id = $resl->id;569 $left->name = $resl->name;570 $left->distributor_id = $resl->distributor_id;571 $left->coupon_code = $resl->coupon_code;572 } else {573 $left = new \stdClass();574 $left->id = "#";575 $left->name = "Empty";576 $left->distributor_id = "";577 $left->coupon_code = "";578 }579 $resm = DB::table('silver_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3)))->first();580 if ($resm) {581 $middle = new \stdClass();582 $middle->id = $resm->id;583 $middle->name = $resm->name;584 $middle->distributor_id = $resm->distributor_id;585 $middle->coupon_code = $resm->coupon_code;586 } else {587 $middle = new \stdClass();588 $middle->id = "#";589 $middle->name = "Empty";590 $middle->distributor_id = "";591 $middle->coupon_code = "";592 }593 $resr = DB::table('silver_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) + 1))->first();594 if ($resr) {595 $right = new \stdClass();596 $right->id = $resr->id;597 $right->name = $resr->name;598 $right->distributor_id = $resr->distributor_id;599 $right->coupon_code = $resr->coupon_code;600 } else {601 $right = new \stdClass();602 $right->id = "#";603 $right->name = "Empty";604 $right->distributor_id = "";605 $right->coupon_code = "";606 }607 }608 else {609 $root = new \stdClass();610 $root->id = '#';611 $root->name = 'Empty';612 $root->distributor_id = '';613 $root->coupon_code = '';614 $left = new \stdClass();615 $left->id = "#";616 $left->name = "Empty";617 $left->distributor_id = "";618 $left->coupon_code = "";619 $middle = new \stdClass();620 $middle->id = "#";621 $middle->name = "Empty";622 $middle->distributor_id = "";623 $middle->coupon_code = "";624 $right = new \stdClass();625 $right->id = "#";626 $right->name = "Empty";627 $right->distributor_id = "";628 $right->coupon_code = "";629 }630 $data=[631 'root'=>$root,632 'left'=>$left,633 'middle'=>$middle,634 'right'=>$right635 ];636 return $data;637 }638 public static function BuidGoldTree($id)639 {640 $res = DB::table('gold_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', $id)->first();641 if ($res)642 {643 $root = new \stdClass();644 $root->id = $res->id;645 $root->name = $res->name;646 $root->distributor_id = $res->distributor_id;647 $root->coupon_code = $res->coupon_code;648 $resl = DB::table('gold_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) - 1))->first();649 if ($resl) {650 $left = new \stdClass();651 $left->id = $resl->id;652 $left->name = $resl->name;653 $left->distributor_id = $resl->distributor_id;654 $left->coupon_code = $resl->coupon_code;655 } else {656 $left = new \stdClass();657 $left->id = "#";658 $left->name = "Empty";659 $left->distributor_id = "";660 $left->coupon_code = "";661 }662 $resm = DB::table('gold_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3)))->first();663 if ($resm) {664 $middle = new \stdClass();665 $middle->id = $resm->id;666 $middle->name = $resm->name;667 $middle->distributor_id = $resm->distributor_id;668 $middle->coupon_code = $resm->coupon_code;669 } else {670 $middle = new \stdClass();671 $middle->id = "#";672 $middle->name = "Empty";673 $middle->distributor_id = "";674 $middle->coupon_code = "";675 }676 $resr = DB::table('gold_node')->select('id', 'name', 'coupon_code', 'distributor_id', 'l', 'm', 'r')->where('id', (($id * 3) + 1))->first();677 if ($resr) {678 $right = new \stdClass();679 $right->id = $resr->id;680 $right->name = $resr->name;681 $right->distributor_id = $resr->distributor_id;682 $right->coupon_code = $resr->coupon_code;683 } else {684 $right = new \stdClass();685 $right->id = "#";686 $right->name = "Empty";687 $right->distributor_id = "";688 $right->coupon_code = "";689 }690 }691 else {692 $root = new \stdClass();693 $root->id = '#';694 $root->name = 'Empty';695 $root->distributor_id = '';696 $root->coupon_code = '';697 $left = new \stdClass();698 $left->id = "#";699 $left->name = "Empty";700 $left->distributor_id = "";701 $left->coupon_code = "";702 $middle = new \stdClass();703 $middle->id = "#";704 $middle->name = "Empty";705 $middle->distributor_id = "";706 $middle->coupon_code = "";707 $right = new \stdClass();708 $right->id = "#";709 $right->name = "Empty";710 $right->distributor_id = "";711 $right->coupon_code = "";712 }713 $data=[714 'root'=>$root,715 'left'=>$left,716 'middle'=>$middle,717 'right'=>$right718 ];719 return $data;720 }721 public static function AsignAutoNodeParrent($id)722 {723 $l=$id*3-1;724 $m=$id*3;725 $r=$id*3+1;726 $p=round($id/3);727 $data = [728 'p'=>$p,729 'l'=>$l,730 'm'=>$m,731 'r'=>$r732 ];733 $res = DB::table('auto_node')->where('id',$id )->update($data);734 if ($res == 1) {735 return 1;736 } else {737 return 0;738 }739 }740 public static function AsignSilverNodeParrent($id)741 {742 $l=$id*3-1;743 $m=$id*3;744 $r=$id*3+1;745 $p=round($id/3);746 $data = [747 'p'=>$p,748 'l'=>$l,749 'm'=>$m,750 'r'=>$r751 ];752 $res = DB::table('silver_node')->where('id',$id )->update($data);753 if ($res == 1) {754 return 1;755 } else {756 return 0;757 }758 }759 public static function AsignGoldNodeParrent($id)760 {761 $l=$id*3-1;762 $m=$id*3;763 $r=$id*3+1;764 $p=round($id/3);765 $data = [766 'p'=>$p,767 'l'=>$l,768 'm'=>$m,769 'r'=>$r770 ];771 $res = DB::table('gold_node')->where('id',$id )->update($data);772 if ($res == 1) {773 return 1;774 } else {775 return 0;776 }777 }778 /*public static function setAutoNodeParentCommision($id, $init = 0,$cupon_code=0)779 {780 $init++;781 if ($id == '') {782 return 1;783 }784 else785 {786 $res = DB::table('node')->select('id', 'distributor_id', 'sponser_name', 'p', 'p_id', 'name', 'coupon_code')->where('id', $id)->first();787 if ($res) {788 if ($res->p >= 1)789 {790 $amount = 0;791 if ($init == 1) {792 $amount = 300;793 } elseif ($init == 2) {794 $amount = 200;795 } elseif ($init == 3) {796 $amount = 100;797 } elseif ($init == 4) {798 $amount = 50;799 } elseif ($init == 5) {800 $amount = 20;801 }802 if ($amount >= 20) {803 $data = [804 'node_id' => $res->p,805 'node_code' => $res->p_id,806 'node_name' => $res->sponser_name,807 'coupon' => $cupon_code,808 'amount' => $amount,809 'status' => 'credit'810 ];811 // DB::table('transaction')->insert($data);812 echo "<pre>";813 echo "<br>" . $res->p_id . " : $res->p ,$init amount $amount";814 print_r($data);815 echo "<br>";816 }817 //print_r("test value <pre>".$res);818 self::setAutoNodeParentCommision($res->p, $init, $cupon_code);819 }820 }821 }822 }*/823 public function GetTreeCompleteNodeValue($parentNode,$mode,$height)824 {825 return $parentNode*(pow($mode,$height)) +((pow($mode,$height)-1)/($mode-1));826 }827 public function FillAutoNodeTreeTable($treeLevel)828 {829 for ($i = 1; $i <= $treeLevel; $i++) {830 echo $i . " : " . $this->GetTreeCompleteNodeValue($i, 3, 6) . "<br>";831 {832 $data = [...
options.php
Source:options.php
...14 // Return class instance15 return self::$instance;16 }17 private function __construct() {18 add_action('init', array(&$this, 'init_options'), 1);19 add_action('admin_init', array(&$this, 'register_options'));20 }21 public function init_options() {22 $this->options = array(23 'el_last_upgrade_version' => array('section' => 'system', 'std_val' => ''),24 'el_import_file' => array('section' => 'import', 'std_val' => ''),25 'el_import_date_format' => array('section' => 'import', 'std_val' => 'Y-m-d'),26 'el_no_event_text' => array('section' => 'general', 'std_val' => 'no event'),27 'el_multiday_filterrange' => array('section' => 'general', 'std_val' => '1'),28 'el_date_once_per_day' => array('section' => 'general', 'std_val' => ''),29 'el_html_tags_in_time' => array('section' => 'general', 'std_val' => ''),30 'el_html_tags_in_loc' => array('section' => 'general', 'std_val' => ''),31 'el_mo_lang_dir_first' => array('section' => 'general', 'std_val' => ''), // default value must be set also in load_textdomain function in Event-List class32 'el_permalink_slug' => array('section' => 'frontend', 'std_val' => __('events','event-list')),33 'el_content_show_text' => array('section' => 'frontend', 'std_val' => __('Show content','event-list')),34 'el_content_hide_text' => array('section' => 'frontend', 'std_val' => __('Hide content','event-list')),35 'el_disable_css_file' => array('section' => 'frontend', 'std_val' => ''),...
camera_admin.php
Source:camera_admin.php
1<?php2function camera_add_general() {3 global $options, $wpdb;4 camera_init();5 6 foreach ($options as $value) :7 if(!camera_get_option($value['id'])){8 camera_add_option($value['id'], $value['std']);9 }10 endforeach;11}12camera_add_general();13function camera_init()14{15 global $options;16 $post_types = get_post_types(array( 'public' => true ));17 $post_string = array();18 foreach ( $post_types as $post_type ) {19 array_push($post_string,$post_type);20 }21 $options = array (22 array( "id" => "camera_perm_panel",23 "std" => 'activate_plugins'),24 array( "id" => "camera_added_slideshows",25 "std" => array(0=>"My first slideshow")),26 array( "id" => "camera_timthumb",27 "std" => 'false'),28 array( "id" => "camera_timthumb_cache",29 "std" => 'false'),30 array( "id" => "camera_colorbox",31 "std" => 'true'),32 array( "id" => "camera_colorbox_skin",33 "std" => '3'),34 array( "id" => "camera_jquerymobile",35 "std" => 'true'),36 array( "id" => "camera_metabox",37 "std" => $post_string),38 array( "id" => "camera_scripts_footer",39 "std" => 'false'),40 array( "id" => "camera_caption_bg",41 "std" => '#000000'),42 array( "id" => "camera_caption_text",43 "std" => '#ffffff'),44 array( "id" => "camera_caption_alpha",45 "std" => '0.8'),46 array( "id" => "camera_commands_bg",47 "std" => '#d8d8d8'),48 array( "id" => "camera_commands_alpha",49 "std" => '0.85'),50 array( "id" => "camera_commands_active",51 "std" => '#434648'),52 array( "id" => "camera_commands_icon",53 "std" => 'camera_petroleum_skin'),54 array( "id" => "camera_commands_emboss",55 "std" => 'camera_commands_emboss'),56 array( "id" => "camera_thumb_border",57 "std" => '#e6e6e6'),58 array( "id" => "camera_styles",59 "std" => '/*Camera additional styles*/'),60 array( "id" => "camera_delete_table",61 "std" => 'false'),62 array( "id" => "camera_support_work",63 "std" => 'true')64 );65 66 if (function_exists('camera_general')){67 camera_general('camera_init');68 }69 if (function_exists('camera_documentation')){70 camera_documentation('camera_init');71 }72 if (function_exists('camera_settings')){73 camera_settings('camera_init');74 }75 if (function_exists('camera_addremove')){76 camera_addremove('camera_init');77 }78 if (function_exists('camera_manage')){79 camera_manage('camera_init');80 }81 if (function_exists('camera_dynamic')){82 camera_dynamic('camera_init');83 }84 if (function_exists('camera_tweets')){85 camera_tweets('camera_init');86 }87 return $options;88}89?>...
init
Using AI Code Generation
1class A {2 public $a;3 public $b;4 public $c;5 public $d;6 public $e;7 public $f;8 public $g;9 public $h;10 public $i;11 public $j;12 public $k;13 public $l;14 public $m;15 public $n;16 public $o;17 public $p;18 public $q;19 public $r;20 public $s;21 public $t;22 public $u;23 public $v;24 public $w;25 public $x;26 public $y;27 public $z;28 public $aa;29 public $bb;30 public $cc;31 public $dd;32 public $ee;33 public $ff;34 public $gg;35 public $hh;36 public $ii;37 public $jj;38 public $kk;39 public $ll;40 public $mm;41 public $nn;42 public $oo;43 public $pp;44 public $qq;45 public $rr;46 public $ss;47 public $tt;48 public $uu;49 public $vv;50 public $ww;51 public $xx;52 public $yy;53 public $zz;54 public $aaa;55 public $bbb;56 public $ccc;57 public $ddd;58 public $eee;59 public $fff;60 public $ggg;61 public $hhh;62 public $iii;63 public $jjj;64 public $kkk;65 public $lll;66 public $mmm;67 public $nnn;68 public $ooo;69 public $ppp;70 public $qqq;71 public $rrr;72 public $sss;73 public $ttt;74 public $uuu;75 public $vvv;76 public $www;77 public $xxx;78 public $yyy;79 public $zzz;80 public $aaaa;81 public $bbbb;82 public $cccc;83 public $dddd;84 public $eeee;85 public $ffff;86 public $gggg;87 public $hhhh;88 public $iiii;89 public $jjjj;90 public $kkkk;91 public $llll;92 public $mmmm;93 public $nnnn;94 public $oooo;95 public $pppp;
init
Using AI Code Generation
1$std = new stdClass();2$std->init();3$a = new A();4$a->init();5$b = new B();6$b->init();7$c = new C();8$c->init();9$d = new D();10$d->init();11$std = new stdClass();12$std->init();13$a = new A();14$a->init();15$b = new B();16$b->init();17$c = new C();18$c->init();19$d = new D();20$d->init();21$std = new stdClass();22$std->init();23$a = new A();24$a->init();25$b = new B();26$b->init();27$c = new C();28$c->init();29$d = new D();30$d->init();31$std = new stdClass();32$std->init();33$a = new A();34$a->init();35$b = new B();36$b->init();37$c = new C();38$c->init();39$d = new D();40$d->init();41$std = new stdClass();42$std->init();43$a = new A();44$a->init();45$b = new B();46$b->init();47$c = new C();48$c->init();
init
Using AI Code Generation
1class A{2 public function init(){3 echo "A init method";4 }5}6class B extends A{7 public function init(){8 echo "B init method";9 }10}11$obj = new B();12$obj->init();13class A{14 public function init(){15 echo "A init method";16 }17}18class B extends A{19 public function init(){20 echo "B init method";21 }22}23$obj = new B();24$obj->init();25class A{26 public function init(){27 echo "A init method";28 }29}30class B extends A{31 public function init(){32 echo "B init method";33 }34}35$obj = new B();36$obj->init();37class A{38 public function init(){39 echo "A init method";40 }41}42class B extends A{43 public function init(){44 echo "B init method";45 }46}47$obj = new B();48$obj->init();49class A{50 public function init(){51 echo "A init method";52 }53}54class B extends A{55 public function init(){56 echo "B init method";57 }58}59$obj = new B();60$obj->init();61class A{62 public function init(){63 echo "A init method";64 }65}66class B extends A{67 public function init(){68 echo "B init method";69 }70}71$obj = new B();72$obj->init();73class A{74 public function init(){75 echo "A init method";76 }77}78class B extends A{79 public function init(){80 echo "B init method";81 }82}83$obj = new B();84$obj->init();85class A{86 public function init(){87 echo "A init method";88 }89}90class B extends A{91 public function init(){92 echo "B init method";93 }94}95$obj = new B();96$obj->init();
init
Using AI Code Generation
1{2 public function init()3 {4 echo 'Foo init';5 }6}7$foo = new Foo;8$foo->init();9{10 public function init()11 {12 echo 'Bar init';13 }14}15$bar = new Bar;16$bar->init();17{18 public function init()19 {20 echo 'FooBar init';21 }22}23$foobar = new FooBar;24$foobar->init();25{26 public function init()27 {28 echo 'BarFoo init';29 }30}31$barfoo = new BarFoo;32$barfoo->init();
init
Using AI Code Generation
1{2 public function init()3 {4 echo "Base::init() called5";6 }7}8{9}10$obj = new Derived();11$obj->init();12{13 public function init()14 {15 echo "Base::init() called16";17 }18}19{20 public function init()21 {22 echo "Derived::init() called23";24 }25}26$obj = new Derived();27$obj->init();28{29 public function init()30 {31 echo "Base::init() called32";33 }34}35{36 public function init()37 {38 echo "Derived::init() called39";40 }41}42$obj = new Derived();43$obj->init();44{45 public function init()46 {47 echo "Base::init() called48";49 }50}51{52 public function init()53 {54 echo "Derived::init() called55";56 }57}58$obj = new Derived();59$obj->init();60{61 public function init()62 {63 echo "Base::init() called64";65 }66}67{68 public function init()69 {70 echo "Derived::init() called71";72 }73}74$obj = new Derived();75$obj->init();76{77 public function init()78 {79 echo "Base::init() called80";81 }82}83{84 public function init()85 {86 echo "Derived::init() called87";88 }89}90$obj = new Derived();91$obj->init();92{93 public function init()94 {95 echo "Base::init() called96";97 }98}99{100 public function init()101 {102 echo "Derived::init() called103";104 }105}106$obj = new Derived();107$obj->init();
init
Using AI Code Generation
1class A{2 public $var;3 public function __construct(){4 $this->var = new stdClass();5 $this->var->var = 1;6 }7}8$a = new A();9class A{10 public $var;11 public function __construct(){12 $this->var = new stdClass();13 $this->var->var = 1;14 }15}16$a = new A();17class A{18 public $var;19 public function __construct(){20 $this->var = new stdClass();21 $this->var->var = 1;22 }23}24$a = new A();25class A{26 public $var;27 public function __construct(){28 $this->var = new stdClass();29 $this->var->var = 1;30 }31}32$a = new A();33class A{34 public $var;35 public function __construct(){36 $this->var = new stdClass();37 $this->var->var = 1;38 }39}40$a = new A();41class A{42 public $var;43 public function __construct(){44 $this->var = new stdClass();45 $this->var->var = 1;46 }47}48$a = new A();49class A{50 public $var;51 public function __construct(){52 $this->var = new stdClass();53 $this->var->var = 1;54 }55}56$a = new A();
init
Using AI Code Generation
1$std = new stdClass();2$std->init();3$std = new stdClass();4$std->init();5PHP Fatal error: Call to undefined method stdClass::init() in /var/www/html/2.php on line 36class stdClass {7 public function init() {8 echo 'init';9 }10}11include '1.php';12$std = new stdClass();13$std->init();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with init on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!