Example #1
0
function childStart(&$daemon)
{
    $dummy = new dummy();
    $dummy->setuniq();
    echo "Starting new child with: {$dummy->uniqid}\n";
    $daemon->childObject = $dummy;
    return TRUE;
}
 public function testCheck()
 {
     $d = new dummy();
     $_SERVER["REQUEST_METHOD"] = "POST";
     $res = $d->check(array('101A', 'UTN', 45888, 4, 400, 2.3, 'NO', 'Alen', 4789658963));
     $this->assertEquals(array('101A', 'UTN', 45888, 4, 400, 2.3, 'NO', 'Alen', 4789658963), $res);
     //res:OK
     $res = $d->check(array('101A', 'UTN', 4588998, 4, 400, 2.3, 'NO', 'Alen', 4789658963));
     $this->assertEquals("Please fill out a valid zip code.", $res);
     // res: OK
     $res = $d->check(array('101A', 'UTN', 4588998, 4, 400, 2.3, 'NO', 'Alen', 4789658963));
     $this->assertEquals("Please fill out a valid id.", $res);
     // res: Failure
 }
						<table border="0" align="center" width = "100" style="font-family:georgia;font-size:15px;">
							<tr>
								<td align="right" width="300" style="padding-right:5px">House Number:</td>
								<td width="100" align="left">
									<input id="hno" style = "height:25px; padding-left:10px;border-radius:5px;" size = "25" type="text" name="f[]" placeholder="House Number" required = "true" /> 
								</td>
						    </tr>
							<tr>
								<td colspan = "2">&nbsp;</td>
							</tr>
					  </table>
						<input type="submit" name="submit" value = "Delete" style=" background:#000099;border:none; color:white; font-family:georgia; font-size:14px; height: 25px; width: 100px; border-radius:5px; position:relative; left: 200px; top: 10px;" />
	        </div>
			</form>';
}
display_form();
display_view();
if (isset($_POST['submit'])) {
    $formData = $_POST['f'];
    $fclass = new dummy();
    $fclass->check($formData);
    //	$fclass->result();
}
echo '</br> </br><a href="pm_home.php" style=" background:#000099; border:none; color:white; font-family:georgia; font-size:20px; height: 25px; width: 100px; border-radius:5px; left: 20px; top: 10px;">Return</a>';
?>
			</div>
		</div>
	</div> <!-- /#contents -->
	
</body>
</html>
Example #4
0
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<td align="right" width="104" style="padding-right:5px">Phone Number:</td>
\t\t\t\t\t\t\t\t<td align="left">
\t\t\t\t\t\t\t\t\t<input id="phone" style = "height:25px; padding-left:10px;border-radius:5px;" size = "25" type="text" name="f[]" placeholder="your Ten Digit Number" required = "true"/> 
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t\t\t<tr>
\t\t\t\t\t\t\t\t<td colspan = "2">&nbsp;</td>
\t\t\t\t\t\t\t</tr>
\t\t\t\t\t  </table>
\t\t\t\t\t\t<input type="submit" name="submit" value = "Sign Up!" style=" background:#000099;border:none; color:white; font-family:georgia; font-size:14px; height: 25px; width: 100px; border-radius:5px; position:relative; left: 200px; top: 10px;" />
\t        </div>
\t\t\t</form>
TABLE_BLOCK;
}
display();
if (isset($_POST['submit'])) {
    $formData = $_POST['f'];
    $fclass = new dummy();
    $fclass->check($formData);
    $fclass->result();
}
?>
</div>
</div> 
</body>
</html>
Example #5
0
 protected static function __build_field_search__()
 {
     if (!empty($_POST['ajax'])) return;
     $div = new dummy('osy-dataview-search');
     $div->att('class',"osy-dataview-search");
     $div->par('colspan','100',function($key,$val,$self){
          $self->man('onbuild','colspan',function($val,$self)
          {
              $cel = $self->closest('td,th');
              if (!is_object($cel)) return;
              $cel->att('colspan','100');
          });
     });
     self::$form->put($div,'','bar-search',2,1);
     $div->add("Cerca");
     $div->add(new text_box('search_value'))->att('size','30');
     $div->add(" in ");
     $select = $div->add(new combo_box('search_field'));
     //Tasto ricerca
     $div->add(new button('btn_search'))->att('label','Avvia ricerca');
    //Tasto pulisci filtro
     $div->add(new button('btn_search_reset'))->att('label','Elimina filtro');
     //Contenitore dei filtri attivi
     $div_flt_cnt = $div->add(tag::create("div"))->att('class','filter-active');
     
     if (key_exists('filter',$_POST) && is_array($_POST['filter']))
     {
         foreach($_POST['filter'] as $k => $v)
         {
           $div_flt = $div_flt_cnt->add(tag::create('div'))->att("class","filter");
           $div_flt->add(new hidden_box("filter[$k]"))->Att('value',$v);
           switch($k[0]){
             case '!':
             case '€':
             case '$':
             case '#':
                       $k = substr($k,1);
                       break;
             case '_':
                       list($a,$k) = explode(',',$k);
                       break;
           }
           $div_flt->add("$k : $v");
         }
         $div->add($div_flt_cnt);
     } else {
         $div->par('init-cell','hidden',function($key,$val,$self){
             $self->man('onbuild','init-cell',function($val,$self)
             {
              $cel = $self->closest('td,th');
              if (!is_object($cel)) return;
              $cel->att('class',$val)->att('colspan','100');
             });
         });
     }
     $div_flt_cnt->add(tag::create("div"))->att("style","clear: both");
 }