Exemplo n.º 1
0
    $error = $_FILES["image"]["error"];
    if ($error > 0) {
        die("Error uploading file! Code {$error}.");
    } else {
        if ($size > 10000000) {
            die("Format is not allowed or file size is too big!");
        } else {
            move_uploaded_file($_FILES["image"]["tmp_name"], "upload/" . $_FILES["image"]["name"]);
            $location = "upload/" . $_FILES["image"]["name"];
            $product_name = $_POST['product_name'];
            $product_brand = $_POST['product_brand'];
            $product_description = $_POST['product_description'];
            $supplier = $_POST['supplier'];
            $product_price = $_POST['product_price'];
            $product_status = $_POST['product_status'];
            mySQL_query("INSERT INTO products (product_name,product_brand,product_description,product_price,supplier,product_status,date_added,location) \n\t\t\t\t\t\t\t\t\tVALUES ('{$product_name}','{$product_brand}','{$product_description}','{$product_price}','{$supplier}','{$product_status}',NOW(),'{$location}')") or die(mysql_error());
        }
        header('location:products.php');
    }
}
?>
		
	
</form>

<!---
<div class="modal-footer">
<button name="Submit" class="btn btn-inverse" data-dismiss="modal" aria-hidden="true" style="text-decoration:none; text-align:center;">ADD</button>
<a href="products.php" class="btn btn-danger" style="text-decoration:none; text-align:center;">Cancel</a>
</div>
-->
Exemplo n.º 2
0
include 'includes/db.php';
if (!isset($_FILES['image']['tmp_name'])) {
    echo "";
} else {
    $file = $_FILES['image']['tmp_name'];
    $image = $_FILES["image"]["name"];
    $image_name = addslashes($_FILES['image']['name']);
    $size = $_FILES["image"]["size"];
    $error = $_FILES["image"]["error"];
    if ($error > 0) {
        die("Error uploading file! Code {$error}.");
    } else {
        if ($size > 10000000) {
            die("Format is not allowed or file size is too big!");
        } else {
            move_uploaded_file($_FILES["image"]["tmp_name"], "upload/" . $_FILES["image"]["name"]);
            $profile_pic = "upload/" . $_FILES["image"]["name"];
            $firstname = $_POST['firstname'];
            $lastname = $_POST['lastname'];
            $username = $_POST['username'];
            $password = $_POST['password'];
            $contact = $_POST['contact'];
            mySQL_query("INSERT INTO admin (firstname,lastname,username,password,contact,date_added,profile_pic) \n\t\t\t\t\t\t\t\t\tVALUES ('{$firstname}','{$lastname}','{$username}','{$password}','{$contact}',NOW(),'{$profile_pic}')") or die(mysql_error());
            echo "<script>alert('Supplier has been added'); window.location='personnel.php'</script>";
        }
        header('location:personnel.php');
    }
}
?>
	
Exemplo n.º 3
0
            <p><span>Email Address</span><input class="contact" type="email" name="feedback_email" placeholder="Your email..." /></p>
			<br />
            <p><span>Phone Number</span><input class="contact" type="number" maxlength="10" name="feedback_number" placeholder="Your number..." /></p>
			<br />
            <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="feedback_message" placeholder="Your message/feedback..."></textarea></p>
            <p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="submit" value="Send" /></p>
			
<?php 
include 'admin/includes/db.php';
if (isset($_POST['submit'])) {
    $feedback_firstname = $_POST['feedback_firstname'];
    $feedback_lastname = $_POST['feedback_lastname'];
    $feedback_email = $_POST['feedback_email'];
    $feedback_number = $_POST['feedback_number'];
    $feedback_message = $_POST['feedback_message'];
    mySQL_query("INSERT INTO feedback (feedback_firstname,feedback_lastname,feedback_email,feedback_number,feedback_message,date_published) \nVALUES ('{$feedback_firstname}','{$feedback_lastname}','{$feedback_email}','{$feedback_number}','{$feedback_message}',NOW())") or die(mysql_error());
    echo "<script>alert('Your message has been send!'); window.location='contact.php'</script>";
}
?>
			
	</form>
          </div>
<br />		  
<hr />
<br />		  
			
    <div id="content_footer"></div>
   <div id="footer">
      <p><a href="index.php">Home</a> | <a href="about_us.php">About Us</a> |<a href="branches.php">Branches</a> |
       <a href="contact.php">Feedback</a>| <a href="news_event.php">News and Event</a></p>
      <p>Copyright &copy; INNO TECH</p>
Exemplo n.º 4
0
 function eb_Kalenderwoche($Tag = 0, $Monat = 0, $Jahr = 0)
 {
     if ($Jahr == 0) {
         $dag = getdate();
         $Jahr = $dag['year'];
         if ($Monat == 0) {
             $Monat = $dag['mon'];
             if ($Tag == 0) {
                 $Tag = $dag['mday'];
             }
         }
         unset($dag);
     }
     $r = mySQL_query('SELECT WEEK(\'' . $Jahr . '-' . $Monat . '-' . $Tag . '\',1)');
     return mysql_result($r, 0);
 }
Exemplo n.º 5
0
$reg = new Creg();
//create phpweather objects
$weather = new phpweather();
$language = "en";
$text_type = 'pw_text_' . $language;
//get users which have subscribed this service
$q = "select username from " . $config->table_event . " where uri='" . $config->metar_event_uri . "'";
$res = mySQL_query($q);
if (!$res) {
    echo "error in SQL query, line: " . __LINE__ . "\n";
    exit(1);
}
while ($row = MySQL_Fetch_Object($res)) {
    //for each user get contacts
    $q = "select contact from " . $config->table_location . " where username='******'";
    $res2 = mySQL_query($q);
    if (!$res2) {
        echo "error in SQL query, line: " . __LINE__ . "\n";
        continue;
    }
    $send_na = true;
    unset($user_icao_cache);
    $user_icao_cache = array();
    //for each contact get meter data and send it
    while ($row2 = MySQL_Fetch_Object($res2)) {
        $domain = $reg->get_domainname($row2->contact);
        //get icao for domain
        $q = "select icao from " . $config->table_netgeo_cache . " where domainname='{$domain}'";
        $res3 = MySQL_query($q);
        if (!$res3) {
            echo "error in SQL query, line: " . __LINE__ . "\n";
Exemplo n.º 6
0
<?php

include 'includes/db.php';
if (!isset($_FILES['image']['tmp_name'])) {
    echo "";
} else {
    $file = $_FILES['image']['tmp_name'];
    $image = $_FILES["image"]["name"];
    $image_name = addslashes($_FILES['image']['name']);
    $size = $_FILES["image"]["size"];
    $error = $_FILES["image"]["error"];
    if ($error > 0) {
        die("Error uploading file! Code {$error}.");
    } else {
        if ($size > 10000000) {
            die("Format is not allowed or file size is too big!");
        } else {
            move_uploaded_file($_FILES["image"]["tmp_name"], "upload/" . $_FILES["image"]["name"]);
            $location = "upload/" . $_FILES["image"]["name"];
            $supplier_company_name = $_POST['supplier_company_name'];
            $supplier_address = $_POST['supplier_address'];
            $supplier_contact = $_POST['supplier_contact'];
            $firstname = $_POST['firstname'];
            $lastname = $_POST['lastname'];
            mySQL_query("INSERT INTO suppliers (supplier_company_name,supplier_address,supplier_contact,firstname,lastname,date_added,location) \n\t\t\t\t\t\t\t\t\tVALUES ('{$supplier_company_name}','{$supplier_address}','{$supplier_contact}','{$firstname}','{$lastname}',NOW(),'{$location}')") or die(mysql_error());
            echo "<script>alert('Supplier has been added'); window.location='suppliers.php'</script>";
        }
    }
}
?>