protected function action() { $msg = new SysMsg(); $plan = new Unilevel(); $plan->setLevel(mysql_real_escape_string($_POST['level'])); $plan->setDescription(mysql_real_escape_string($_POST['desc'])); $mycomm = floatval(preg_replace("/[^-0-9\\.]/", ".", mysql_real_escape_string($_POST['comm']))); $plan->setCommission($mycomm); $redirect = 'user/fancymessage'; if ($plan->getLevel() > 0 && $plan->getDescription() != '' && $plan->getCommission() > 0) { if ($plan->save()) { $redirect = 'user/addplanunilevel'; } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Inserimento piano Unilevel fallito.')->setType(SysMsg::MSG_CRITICAL)); } } else { Session::setObj(Session::SYSMSG, $msg->setMessage('Tutti i campi sono obbligatori. Inserimento piano Unilevel fallito.')->setType(SysMsg::MSG_CRITICAL)); } //*** $this->redirect = $redirect; }
<?php $ul = new Unilevel(); ?> <div class="boxcommonform"> <br/> <div class="boxtitle"> CREAZIONE PIANO UNILEVEL </div> <div class="formlogin"> <div class="boxtitle boxsponsor"> <img src="<?php echo UriDispatch::getFullUri('view/box/img/puzzle.png'); ?> " class="avatar img_100_100" /> </div> <form id="frmAddPlanUnilevel" name="frmAddPlanUnilevel" action="<?php echo UriDispatch::getFullUri("user/planunilevelsave"); ?> " method="POST"> <input type="hidden" name="idntwrkr" value="{SNIPPET::idntwrkr}" /> <table border="0"> <tr> <td width="8%"><p>Liv.</p></td> <td width="69%"><p>Descrizione</p></td> <td width="17%"><p>Provvigione</p></td> <td width="6%"></td> </tr> <tr> <td><p><?php