public function AddCard(Request $request)
 {
     $card = new BankCard();
     $card = fill($request->all());
     $card->save();
     $user = Users::findOrFail($request->user_id);
     dd($request->name);
 }
Example #2
0
 public function AllData()
 {
     $data = new FetchAllData();
     $finalData = array();
     foreach ($data as $key => $record) {
         $EL = new Demo_EL();
         $EL = fill($record);
         $finalData[$key] = $EL;
     }
     return $finalData;
 }
Example #3
0
function fill($input, $remaining, $containerNumber)
{
    global $count;
    while (count($input)) {
        $next = array_shift($input);
        if ($next == $remaining) {
            $count[$containerNumber]++;
        } else {
            if ($next < $remaining) {
                fill($input, $remaining - $next, $containerNumber + 1);
            }
        }
    }
}
Example #4
0
function fill($amount, $jars, $count = 0)
{
    if ($amount === 0) {
        global $score, $counts;
        $counts[$count]++;
        $score++;
        return;
    }
    for ($i = 0; $i < count($jars); $i++) {
        $rest = array_slice($jars, $i + 1);
        if ($amount >= $jars[$i]) {
            fill($amount - $jars[$i], $rest, $count + 1);
        }
    }
}
Example #5
0
function recurse($draw, $note = false)
{
    global $summr;
    global $steps;
    $fill = fill($draw, $note);
    if (in_array($fill, $steps)) {
        //        echo "fail";
        return false;
    }
    recordStep($fill);
    if (getSumm($fill) == $summr) {
        //        echo "done";
        return $fill;
    }
    $note = getLowestNote($fill);
    $fill = deriveOneNote($fill, $note);
    return recurse($fill, $note, 3);
}
Example #6
0
function solution($limit)
{
    $h = fill($limit);
    $x2 = 2;
    $x3 = 3;
    $x5 = 5;
    $i = $j = $k = 0;
    for ($n = 1; $n < $limit; $n++) {
        $h[$n] = min($x2, $x3, $x5);
        if ($x2 == $h[$n]) {
            $i++;
            $x2 = 2 * $h[$i];
        }
        if ($x3 == $h[$n]) {
            $j++;
            $x3 = 3 * $h[$j];
        }
        if ($x5 == $h[$n]) {
            $k++;
            $x5 = 5 * $h[$k];
        }
    }
    return end($h);
}
Example #7
0
                    $off -= 10;
                }
            }
        }
        if (isset($_POST['more'])) {
            if (!empty($_POST['off']) or $_POST['off'] == 0) {
                $off = $_POST['off'];
                $result = $db->query("SELECT COUNT(*) as totalEventos FROM Eventos ");
                $totalEventos = mysqli_fetch_assoc($result);
                if ($off <= $totalEventos['totalEventos'] - 11) {
                    $off += 10;
                }
            }
        }
    }
    fill($off);
    ?>
			<span class="limits">
				<form method="POST" action="Eventos.php" name="limits" class="limits" >
					<input name="off" value="<?php 
    echo $off;
    ?>
" type="hidden"></input>
					<button id="less" name="less" type="submit"><</button>
					<span id="lim"><?php 
    echo $off + 10;
    ?>
</span>
					<button id="more "name="more"type="submit"> ></button>
				</form>
			</span>
Example #8
0
$testlists = array();
$res = Sql_Query("select id from {$tables['list']} where name like \"%test%\"");
while ($row = Sql_Fetch_Row($res)) {
    array_push($testlists, $row[0]);
}
if (!ini_get('safe_mode')) {
    if (!count($testlists)) {
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Error: cannot find any test lists to use";</script>' . "\n";
    } elseif (!isset($eraseall)) {
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Filling ";</script>' . "\n";
        for ($i = 0; $i <= 100; ++$i) {
            set_time_limit(60);
            flush();
            reset($testlists);
            while (list($key, $val) = each($testlists)) {
                if (!fill(getmypid() . $i, $val)) {
                    return;
                }
            }
        }
    } else {
        $req = Sql_Query("select id from {$tables['user']} where email like \"testuser%\"");
        $i = 1;
        set_time_limit(60);
        print '<script language="Javascript" type="text/javascript"> document.forms[0].output.value="Erasing ";</script>' . "\n";
        flush();
        while ($row = Sql_Fetch_row($req)) {
            Sql_Query("delete quick from {$tables['user_attribute']} where userid = {$row['0']}");
            Sql_Query("delete quick from {$tables['listuser']} where userid = {$row['0']}");
            Sql_Query("delete quick from {$tables['usermessage']} where userid = {$row['0']}");
            Sql_Query("delete quick from {$tables['user']} where id = {$row['0']}");
Example #9
0
 function render(ITemplateContentProvider $content_provider, $data)
 {
     $template_content = $content_provider->getContent();
     return fill($template_content, $data);
 }
                $e = "fill";
                break;
            case 2:
                $e = "empty";
                break;
            case 3:
                $e = "pour";
                break;
        }
        switch ($f) {
            case 1:
                $f = "A";
                break;
            case 2:
                $f = "B";
                break;
            case 3:
                $f = "C";
                break;
        }
        if ($markRedundant && $e != "pour") {
            $f = "({$f})";
            $g = "({$g})";
        }
        echo "|\t{$a}\t|\t{$b}\t|\t{$c}\t|\t{$d}\t|\t{$e}\t|\t{$f}\t|\t{$g}\t|\n";
    }
}
$content = file_get_contents($argv[1]);
$content = explode("\n", $content);
tabelize(fill(organize(clean($content))), $argv[2]);
include_once 'ressources/class.templates.inc';
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.mysql.inc';
include_once 'ressources/class.dansguardian.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.ActiveDirectory.inc';
$usersmenus = new usersMenus();
if (!$usersmenus->AsDansGuardianAdministrator) {
    $tpl = new templates();
    $alert = $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
    echo "alert('{$alert}');";
    die;
}
if (isset($_GET["fill"])) {
    fill();
    exit;
}
if (isset($_GET["dump"])) {
    dump();
    exit;
}
if (isset($_GET["display"])) {
    display();
    exit;
}
js();
function js()
{
    header("content-type: application/javascript");
    $page = CurrentPageName();
    ?>
			 		<div class="alert alert-danger" type="hidden"><span class="glyphicon glyphicon-exclamation-sign"><?php 
    echo $errors->first('email');
    ?>
 </div></span>
				<?php 
}
?>
		
		</div>		
	</div>
	
	<span class="glyphicon glyphicon-pencil"></span>
	<label for="comment">More about you:</label>
	<textarea class="form-control" rows="5" id="more" name="yo" value=""><?php 
echo e(fill($yo, old('yo')));
?>
</textarea>
	<br>
	<div class="row">
		<div class="col-sm-6 form-group">
			<button type="submit" name="submit" id="submit" class="btn btn-info" value="submit">Submit</button>				
		</div>
		<input type="hidden" name="_token" value="<?php 
echo csrf_token();
?>
">
	</div>
</form>
</div>
Example #13
0
$txt0 = tr('Nouvelle lune');
$txt1 = tr('Premier quartier');
$txt2 = tr('Pleine lune');
$txt3 = tr('Dernier quartier');
$txt0 = tr('Nouvelle lune');
$date0 = date("d/m/Y H:i", $moonphase->new_moon());
$date1 = date("d/m/Y H:i", $moonphase->first_quarter());
$date2 = date("d/m/Y H:i", $moonphase->full_moon());
$date3 = date("d/m/Y H:i", $moonphase->last_quarter());
$date4 = date("d/m/Y H:i", $moonphase->next_new_moon());
echo "\n\t<tr><td class='hl'> </td>\n\t    <td class='tooltip' >\n\t\t<a href='#' class='tooltip'>\n  \t\t{$tinfo}:\t\t\n        <div >\n        <table class='info'>\n        <tr><td style='width:90px;'>{$txt0}</td><td style='text-align:center;'>{$date0}</td></tr>\n        <tr><td style='width:90px;'>{$txt1}</td><td style='text-align:center;'>{$date1}</td></tr>\n        <tr><td style='width:90px;'>{$txt2}</td><td style='text-align:center;'>{$date2}</td></tr>\n        <tr><td style='width:90px;'>{$txt3}</td><td style='text-align:center;'>{$date3}</td></tr>\n        <tr><td style='width:90px;'>{$txt0}</td><td style='text-align:center;'>{$date4}</td></tr>\n        </table>\n        </div></a>\n</td></tr></table>\n";
echo "</td>\n";
// Tracé des icones
for ($i = 0; $i < $numStations; $i++) {
    echo "<td>";
    fill($i, $devicelist["devices"][$i], $mydevices[$i], $dashboard[$i]);
    echo "</td>";
}
echo "</tr></table>";
?>

<!-- trace des menus et de la Google map -->

<table class='container'>

<tr>
    <td class='container'>
        <?php 
drawMenuModules('292px');
drawMenuStation('292px');
?>
Example #14
0
function forcedMove(&$numbers, &$backup, $type)
{
    foreach ($numbers as $pos => $item) {
        if (!is_array($item)) {
            continue;
        }
        $options = [avail($item)];
        $posList = $type($pos);
        foreach ($posList as $pos2) {
            if ($pos2 == $pos) {
                continue;
            }
            if (!is_array($numbers[$pos2])) {
                continue;
            }
            $options[] = avail($numbers[$pos2]);
        }
        if (count($options) < 2) {
            $numbers = $backup;
            $backup = null;
            return true;
        }
        $mustBeHere = call_user_func_array('array_diff', $options);
        if (count($mustBeHere) == 1) {
            fill($pos, reset($mustBeHere));
            return true;
        }
    }
    return false;
}
}
echo "| " . fill(number_format($wk16c, 0, ".", ","), 9) . " blocks found in last 16 wks";
echo "   blocks/hr avg: " . $wk16c / 2688 . "\n";
if (isset($wk32blocks)) {
    $wk32c = $blockcount - $wk32blocks - 1;
} else {
    $wk32c = 0;
}
echo "| " . fill(number_format($wk32c, 0, ".", ","), 9) . " blocks found in last 32 wks";
echo "   blocks/hr avg: " . $wk32c / 5376 . "\n";
if (isset($yr1blocks)) {
    $yr1c = $blockcount - $yr1blocks - 1;
} else {
    $yr1c = 0;
}
echo "| " . fill(number_format($yr1c, 0, ".", ","), 9) . " blocks found in last year";
echo "     blocks/hr avg: " . $yr1c / 8760 . "\n";
echo "\\----------------------------------------";
//echo microtime()."\n";
if (!isset($_GET["showallblocks"])) {
    echo "\\\n   <a href=\"" . $_SERVER["PHP_SELF"] . "?showallblocks\">Timestamp data for all " . number_format($blockcount) . " blocks</a>  |\n";
    echo "                 ~" . number_format((3065 + 36 * $blockcount) / 1024 / 1024, 2) . "Mb                 |\n";
    echo "-----------------------------------------/";
} else {
    echo "\n\n";
    $block = array_reverse($block, true);
    foreach ($block as $key => $num) {
        $secsn = $block[$key] - (isset($block[$key - 1]) ? $block[$key - 1] : 0);
        $secs = $secsn == 1 ? "{$secsn} second " : "{$secsn} seconds";
        $secs = str_repeat(" ", 15 - strlen($secs)) . $secs;
        if (isset($block[$key - 1])) {