Ejemplo n.º 1
0
<?php

//setting forth of adding it into the database
session_start();
include 'index.php';
require_once 'class.Database.php';
//require_once 'CRUDe.php';
$check = strlen($_POST["name"]);
if ($check != 0) {
    $callClass = new Data_Class();
    //putting all the categories into an array to post
    $categoriesArray = array();
    array_push($categoriesArray, $_POST["art"]);
    $callClass->newBlog($_POST["name"], $_POST["comment"], $categoriesArray);
}
Ejemplo n.º 2
0
  		<?php 
}
?>
  	<input type = "submit" value = "Delete">

	</select>
	</label>	
	
	<label>
	<form action='form.php' method='POST'>
	<select name='update' id='update'>	<br>			
  	<option selected='selected'>--Change--</option><br>

  	<?php 
if (isset($_POST['updating'])) {
    $callUpdate = new Data_Class();
    $callUpdate->updateData($_POST["nameU"], $_POST["effectsU"], $_POST["ingredientsU"], $_POST["stockU"], $_POST["idU"]);
}
$names = $callClass->getNames();
for ($i = 0; $i < count($names); $i++) {
    ?>
 <option value="<?php 
    echo $names[$i]['name'];
    ?>
"><?php 
    echo $names[$i]['name'];
    ?>
</option>
  		<?php 
}
?>
Ejemplo n.º 3
0
"><?php 
    echo $names[$i]['name'];
    ?>
</option>
  		<?php 
}
?>
  	<input type = "submit" value = "Change">
	</select>
</label>


<?php 
// To Sort Entries
if (isset($_POST['updating'])) {
    $callUpdate = new Data_Class();
    $callUpdate->updateData($_POST["nameU"], $_POST["commentsU"], $_POST["idU"]);
}
?>
	<label>
		
	<form action='form.php' method='POST'>
	<select name='sort' id='sort'><br>	
  	<option selected='selected'>--Sort by Category--</option><br>
  	<option value="art">Art</option>
  	<option value="left_brain">Left Brain</option>
  	<option value="diversity">Diversity</option>
  	<option value="all">Get All Posts</option>
  	
  	<input type = "submit" value = "Sort">
Ejemplo n.º 4
0
session_start();
include 'index.php';
require_once 'class.Database.php';
require_once 'class.Potion.php';
require_once 'class.CRUDE.php';
//This makes it so it doesn't try and create a new entry everytime you refresh
$check = strlen($_POST["name"]);
if ($check != 0) {
    $callClass = new Data_Class();
    $callClass->createData($_POST["name"], $_POST["effects"], $_POST["ingredients"], $_POST["stock"]);
}
if (isset($_POST["delete"])) {
    $callClass->deleteData($_POST["delete"]);
}
if (isset($_POST["sort"])) {
    $criteria = $_POST["sort"];
    $callForm = new Data_Class();
    $callForm->displayData($criteria);
}
if (isset($_POST["search"])) {
    $search = $_POST["search"];
    $callForm = new Data_Class();
    $callForm->searchData($search);
}
if (isset($_POST["update"])) {
    $callForm = new Data_Class();
    $changeID = $callForm->getID($_POST["update"]);
}
?>

Ejemplo n.º 5
0
  					<option id = 'arrived'>Arrived</option>
  					
 				 </select>
	
		<br><input align = "center" type="submit" value = "Get Status">
		</form>
  	</label>
		</nav>




		<?php 
// To Sort Entries
if (isset($_POST['updating'])) {
    $callUpdate = new Data_Class();
    $callUpdate->updateData($_POST["nameU"], $_POST["addressU"], $_POST["itemU"], $_POST["idU"], $_POST["dueDateU"]);
}
include 'text.php';
?>
</section>
<footer>
	<h2><center>Database Information</center><h2>
		
</footer>
	
</body>

</html>

Ejemplo n.º 6
0
            $due_date = date('Y-m-d', strtotime("+300 days"));
    }
    $callClass->createData($_POST["name"], $_POST["address"], $_POST["item"], $due_date);
    $callOther = new Category_Class();
    $date = date('Y-m-d');
    $callOther->createDelivery($date);
}
if (isset($_POST["delete"])) {
    $callClass->deleteData($_POST["delete"]);
}
if (isset($_POST["update"]) && !empty($_POST["update"])) {
    $callForm = new Data_Class();
    $changeID = $callForm->getID($_POST["update"]);
}
if (isset($_POST["status"]) && $_POST["status"] != "--Get Status--") {
    $callClass = new Data_Class();
    switch ($_POST["status"]) {
        case "Still Assembling":
            $callClass->displayData(3);
            break;
        case "Being Prepared":
            $callClass->displayData(2);
            break;
        case "Shipped":
            $callClass->displayData(1);
            break;
        default:
            $callClass->displayData(0);
    }
}
?>