Exemplo n.º 1
0
 function _default()
 {
     $this->__set('product_id', findEmptyKey('PRODUCT', 'product_id'));
     $this->__set('category_id', 0);
     $this->__set('name', 'TYPE PRODUCT NAME HERE');
     $this->__set('description', 'TYPE THE PRODUCT DESCRIPTION HERE');
     $this->setDosages('NEW');
 }
Exemplo n.º 2
0
 function _default($product_id)
 {
     //echo "<p>The new default function was called</p>";
     $this->dosage_id = findEmptyKey('DOSAGE', 'dosage_id');
     $this->product_id = htmlspecialchars(strip_tags(trim($product_id)));
     //FOR LATER, UPDATE TO ALLOW FOR COMPOUND SELECTION
     $this->setCompounds('NEW');
     //echo "<p>Value = ".$this->compounds[0]->value."</p>";
     $this->form = 'default';
     $this->quantity = 10;
     $this->image = 'uploads/Umbrella.jpg';
     $this->price = 20.0;
 }
Exemplo n.º 3
0
function addCategory()
{
    //adds that category to the database
    //grab the new list by using the getCategory('ADMIN') function
    //and then pass that information back to the javascript for display
    $db = connect(0, 0, 0);
    $result = $db->query("insert into CATEGORY values (" . findEmptyKey('CATEGORY', 'category_id') . ", \n\t\t'DEFAULT NAME', 'TYPE YOUR CATEGORY DESCRIPTION HERE')");
    $arr = array('selector' => '#addCategory');
    json_encode($arr);
    $db->close();
}
Exemplo n.º 4
0
if (isset($_POST['submit'])) {
    //echo "<p>New form posted!</p>";
    $u = new user();
    $u->getPOST();
    if ($u->__get('login') == "ERROR" || $u->__get('pass') == 'ERROR' || $u->__get('fn') == "ERROR" || $u->__get('ln') == "ERROR" || $u->__get('created') == "ERROR") {
        echo "<h2 style='color : red; '> There were some errors with your submission. Please make sure you entered everything correctly.</h2>";
    } else {
        $u->__set('user_id', findEmptyKey('USER', 'user_id'));
        $u->__set('address_id', 0);
        $u->__set('lvl', 'COMM');
        $u2 = $u;
        $u->__set('password', sha1($u2->__get('pass')));
        $u2 = null;
        $d = new demographic();
        $d->getPOST();
        $d->__set('demographic_id', findEmptyKey('DEMOGRAPHIC', 'demographic_id'));
        $d->__set('user_id', $u->__get('user_id'));
        if ($u->validate() && $d->validate()) {
            $u->write('STANDARD');
            $d->write();
            @session_start();
            @($_SESSION['username'] = $u->__get('login'));
            @$_SESSION['loginstatus'] == 'IN';
            @($_SESSION['privilege'] = "COMM");
        } else {
            echo "<h2 style='color : red; '> There were some errors with your submission. Please make sure you entered everything correctly.</h2>";
        }
    }
}
?>
<form id='newuserform' name = 'newuserform' class='nestedform'  action="<?php