diff --git a/.htaccess b/.htaccess index 013cda8..5e16b4a 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1,3 @@ -Options +FollowSymlinks - RewriteEngine on RewriteBase / diff --git a/index.php b/index.php index f87b67c..965d32f 100644 --- a/index.php +++ b/index.php @@ -12,10 +12,10 @@ date_default_timezone_set( 'Europe/Paris' ); setlocale( LC_TIME, "fr_FR.UTF-8" ); error_reporting( E_ALL ); -require( 'src/lib/functions.php' ); -require( 'src/config.php' ); +require( "src/lib/functions.php" ); +require( "src/Config.php" ); -require 'src/Autoloader.php'; +require( "src/Autoloader.php" ); Autoloader::register(); new BDD(); diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..14267e9 --- /dev/null +++ b/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / \ No newline at end of file diff --git a/src/API/APIContact.php b/src/API/APIContact.php index 4722bbd..3c75014 100644 --- a/src/API/APIContact.php +++ b/src/API/APIContact.php @@ -172,7 +172,7 @@ class APIContact extends API { } public function search( array $data ) { - if ( count_chars( $data[ "query" ] ) >= 3 ) { + if ( count_chars( $data[ "query" ] ) >= 2 ) { $result = Contact::search( $data[ "query" ] ); if ( $result !== null ) { $this->returnJson( [ diff --git a/src/Config.php b/src/Config.php index a7137e7..6efd75c 100644 --- a/src/Config.php +++ b/src/Config.php @@ -3,8 +3,8 @@ namespace CAUProject3Contact; class Config { - const SITE_JS_VERSION = '0.01'; - const SITE_CSS_VERSION = '0.01'; + const SITE_JS_VERSION = '0.02'; + const SITE_CSS_VERSION = '0.02'; const TITLE_HEADER = 'Your contact'; const DESCRIPTION_HEADER = 'Manage your contact easly'; diff --git a/src/Controller/site/Index.php b/src/Controller/Site/Index.php similarity index 100% rename from src/Controller/site/Index.php rename to src/Controller/Site/Index.php diff --git a/src/Controller/site/SiteError.php b/src/Controller/Site/SiteError.php similarity index 100% rename from src/Controller/site/SiteError.php rename to src/Controller/Site/SiteError.php diff --git a/src/Controller/site/SiteRouter.php b/src/Controller/Site/SiteRouter.php similarity index 100% rename from src/Controller/site/SiteRouter.php rename to src/Controller/Site/SiteRouter.php diff --git a/src/Model/BDD.php b/src/Model/BDD.php index 27fa205..ec78ac8 100644 --- a/src/Model/BDD.php +++ b/src/Model/BDD.php @@ -8,16 +8,16 @@ use PDO; class BDD { // Server BDD -// const SQL_SERVER = 'sql.sanchez-mathieu.fr'; // BDD Server -// const SQL_LOGIN = 'why7n0_contact'; // BDD Login -// const SQL_PASSWORD = 'fC3c87Gy'; // BDD Password -// const SQL_DB = 'why7n0_contact'; // BDD Name + const SQL_SERVER = 'sql.sanchez-mathieu.fr'; // BDD Server + const SQL_LOGIN = 'why7n0_contact'; // BDD Login + const SQL_PASSWORD = 'fC3c87Gy'; // BDD Password + const SQL_DB = 'why7n0_contact'; // BDD Name // Local BDD - const SQL_SERVER = 'localhost'; // BDD Server - const SQL_LOGIN = 'root'; // BDD Login - const SQL_PASSWORD = ''; // BDD Password - const SQL_DB = 'contact'; // BDD Name +// const SQL_SERVER = 'localhost'; // BDD Server +// const SQL_LOGIN = 'root'; // BDD Login +// const SQL_PASSWORD = ''; // BDD Password +// const SQL_DB = 'contact'; // BDD Name private static $bdd; diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 3bffba0..22ee912 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -93,7 +93,7 @@ class Contact { $lastKey = endKey( $words ); foreach ( $words as $key => $word ) { $normal = self::getQuerySearch( $word, [ "first_name", "last_name", "surname" ] );; - $hard = self::getQuerySearch( $word, [ "email", "address", "phone_number" ] ); + $hard = self::getQuerySearch( $word, [ "email", "address", "phone_number", "birthday" ] ); $q1 .= $normal; $q2 .= $normal; $q3 .= $hard; diff --git a/src/View/Site/Index.php b/src/View/Site/Index.php index 891b5a4..7abeb8c 100644 --- a/src/View/Site/Index.php +++ b/src/View/Site/Index.php @@ -2,7 +2,7 @@
First Name | @@ -12,12 +12,13 @@Address | Phone Number | Birthday | +||||
---|---|---|---|---|---|---|---|
" . $contact->getFirstName() . " | "; echo "" . $contact->getLastName() . " | "; echo "" . ( $contact->getSurname() ? $contact->getSurname() : "" ) . " | "; @@ -25,6 +26,8 @@ echo "" . ( $contact->getAddress() ? $contact->getAddress() : "" ) . " | "; echo "" . ( $contact->getPhoneNumber() ? $contact->getPhoneNumber() : "" ) . " | "; echo "" . ( $contact->getBirthday() ? date( "Y-m-d", strtotime( $contact->getBirthday() ) ) : "" ) . " | "; + echo "create | "; + echo "delete | "; echo "