Example #1
0
    $insertQuery = "INSERT INTO Friendship(user_ID, friend_ID) \n                                                values ('{$user_ID}', '{$friend_ID}')";
    $result = mysqli_query($connection, $insertQuery);
    echo "Result of creating Friendship is {$result} <br>";
    $count = mysqli_insert_id($connection);
    echo "Creating record #{$count} <br>";
}
createUser('Billy', 'Bob', '*****@*****.**', '4645748', 'bbob87', 'password123', 'My name is Billy and I like to run', $connection);
createUser('Walter', 'White', '*****@*****.**', '9428413', 'heisenburg', 'holly123', 'Apply yourself!', $connection);
createData('1', '2015-11-03', '2541', '23', '758', '12', $connection);
createData('1', '2015-11-02', '1727', '18', '649', '7', $connection);
createData('1', '2015-11-01', '2216', '20', '730', '9', $connection);
createData('1', '2015-10-31', '1031', '20', '730', '9', $connection);
createData('1', '2015-10-30', '1030', '20', '730', '9', $connection);
createData('1', '2015-10-29', '1029', '20', '730', '9', $connection);
createData('1', '2015-10-28', '1028', '20', '730', '9', $connection);
createData('1', '2015-10-27', '1007', '20', '730', '9', $connection);
createData('2', '2015-11-03', '2412', '22', '795', '11', $connection);
createData('2', '2015-11-02', '2894', '26', '924', '14', $connection);
createData('2', '2015-11-01', '1479', '15', '623', '7', $connection);
createData('2', '2015-10-10', '2412', '22', '795', '11', $connection);
createTarget('1', '2015-11-01', '3500', '10', '15', $connection);
createFriendship('1', '2', $connection);
$error = mysqli_error($connection);
echo "{$error}";
?>
            
            
            
        </div>
	</body>
</html>
Example #2
0
/**
 * exportXls function
 * this funciton is to call all the denpendancy function to generate data, excel reports, save it or download at the browser
 * @todo report type implementation
 * @param report - type of repoert need to generated, not done,
 * @param attachment - if true force to download the excel file at browser else save it in rwFiles direcory
 * @param user_id - generated the report for a particular user
 * @return sting - path of file stored
 * @author Ankit Balyan - sf.ankit@gmail.com
 **/
function exportXls($report = NULL, $attachment = FALSE, $user_id = NULL)
{
    $data = createData($report, $user_id);
    return genxls($data, $attachment);
}
Example #3
0
createUser('bbob87', 'Billy', 'Bob', '*****@*****.**', '4645748', 'password123', 'My name is Billy and I like to run', $connection);
createUser('holly123', 'Walter', 'White', '*****@*****.**', '9428413', 'heisenburg', 'Apply yourself!', $connection);
createData('bbob87', '2015-03-05', '3456', '24', '980', '14', $connection);
createData('holly123', '2015-03-05', '2541', '23', '758', '12', $connection);
createData('bbob87', '2015-11-03', '2541', '23', '758', '12', $connection);
createData('bbob87', '2015-11-02', '1727', '18', '649', '7', $connection);
createData('bbob87', '2015-11-01', '2216', '20', '730', '9', $connection);
createData('bbob87', '2015-10-31', '1031', '20', '730', '9', $connection);
createData('bbob87', '2015-10-30', '1030', '20', '730', '9', $connection);
createData('bbob87', '2015-10-29', '1029', '20', '730', '9', $connection);
createData('bbob87', '2015-10-28', '1028', '20', '730', '9', $connection);
createData('bbob87', '2015-10-27', '1007', '20', '730', '9', $connection);
createData('holly123', '2015-11-03', '2412', '22', '795', '11', $connection);
createData('holly123', '2015-11-02', '2894', '26', '924', '14', $connection);
createData('holly123', '2015-11-01', '1479', '15', '623', '7', $connection);
createData('holly123', '2015-10-10', '2412', '22', '795', '11', $connection);
createData('holly123', '2015-11-10', '2412', '22', '795', '11', $connection);
createData('holly123', '2015-11-12', '1412', '22', '795', '11', $connection);
createData('holly123', '2015-11-13', '2412', '22', '795', '11', $connection);
createData('holly123', '2015-11-14', '1412', '32', '795', '11', $connection);
createData('holly123', '2015-11-15', '2612', '22', '725', '11', $connection);
createTarget('holly123', '2015-11-19', '3500', '10', '15', $connection);
$error = mysqli_error($connection);
echo "{$error}";
?>
            
            
            
        </div>
	</body>
</html>
function sendData($state, $data, $message = 'n/a', $code = 'n/a')
{
    echo createData($state, $data, $message, $code);
}
Example #5
0
<?php

ini_set("memory_limit", "30M");
require_once 'config.php';
require_once 'common.php';
require_once 'functions.php';
dashboardInit();
#2012-12-05 add---
$arrData = createData();
writeSmokeCasesToFile($arrData, '');
#-----
if ($_GET[from] == "") {
    $from = 6;
} else {
    $from = $_GET[from];
}
if ($_GET[to] == "") {
    $to = -1;
} else {
    $to = $_GET[to];
}
// login user if required
$arr = loginUser($_POST);
$arr = logoutUser($_POST, $arr);
if (isset($_POST['Save'])) {
    foreach ($_POST as $name => $smoke) {
        if ($smoke == "Save") {
            continue;
        }
        ereg("([a-z]+)-([0-9]+)-([0-9a-zA-Z\\_-]+)", $name, $regs);
        $type = $regs[1];