示例#1
0
 public static function main()
 {
     //odczytanie __CLASS__ nie moze byc w funkcji w klasie nadrzędnej
     if (basename($_SERVER["SCRIPT_NAME"]) == __CLASS__ . ".php") {
         customers::display(__CLASS__);
     }
 }
示例#2
0
<a href="products.php">products.php</a><br>
<a href="customers.php">customers.php</a><br>
<a href="transactions.php">transactions.php</a><br>
<a href="login.php">login.php</a><br>

<?php 
/* http://pl.php.net/manual/en/function.mysqli-connect.php
http://www.devshed.com/c/a/MySQL/Implementing-Additional-Methods-with-mysqli-and-PHP-5/1/
(013147149X_book.pdf) Andi Gutmans, Stig S??her Bakken
and Derick Rethans - PHP 5 Power Programming -> 6.2.6 Queries
*/
require_once 'functions.php';
products::display();
customers::display();
transactions::display();
login::display();
database::getConn()->close();
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     if (!$id) {
         return Redirect::route('customers.index')->with('error', 'Please provide customer id');
     }
     $customer = customers::find($id);
     if (empty($customer)) {
         return Redirect::route('customers.index')->with('error', 'Customer not found');
     }
     Customers::destroy($id);
     return Redirect::route('customers.index')->with('success', 'Customer deleted successfully');
 }