-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03e4ce6
commit e7a2b6e
Showing
16 changed files
with
2,702 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
class Articles extends BaseController | ||
{ | ||
public function index() | ||
{ | ||
|
||
// $db = db_connect(); | ||
|
||
$data = [ | ||
["Title" => "One", "content" => "The first"], | ||
["Title" => "Two", "content" => "Some content"] | ||
]; | ||
|
||
return view("Articles/index", [ | ||
"articles" => $data | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
|
||
namespace App\Controllers; | ||
|
||
class Header extends BaseController | ||
{ | ||
public function index(){ | ||
return "Header/index"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
class Sitemap extends BaseController | ||
{ | ||
public function index() | ||
{ | ||
$db = db_connect(); | ||
|
||
$sqlQueries = array( | ||
"SELECT CONCAT('https://bestbizfinder.com/broker/', broker_id, '/', company, '/', address) AS url, 'monthly' AS changefreq, 0.8 AS priority FROM broker_details", | ||
); | ||
|
||
$xmlContent = '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL; | ||
$xmlContent .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL; | ||
|
||
foreach ($sqlQueries as $sqlQuery) { | ||
$result = $db->query($sqlQuery); | ||
|
||
if ($result->getResult()) { | ||
$rows = $result->getResultArray(); | ||
|
||
if (count($rows) > 0) { | ||
foreach ($rows as $row) { | ||
$xmlContent .= '<url>' . PHP_EOL; | ||
$xmlContent .= '<loc>' . htmlspecialchars($row['url']) . '</loc>' . PHP_EOL; | ||
$xmlContent .= '<changefreq>' . htmlspecialchars($row['changefreq']) . '</changefreq>' . PHP_EOL; | ||
$xmlContent .= '<priority>' . htmlspecialchars($row['priority']) . '</priority>' . PHP_EOL; | ||
$xmlContent .= '</url>' . PHP_EOL; | ||
} | ||
} | ||
} else { | ||
echo "No results found"; | ||
} | ||
} | ||
|
||
$xmlContent .= '</urlset>' . PHP_EOL; | ||
|
||
header('Content-Type: application/xml'); | ||
|
||
echo $xmlContent; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
use CodeIgniter\Controller; | ||
|
||
class WebService extends Controller { | ||
|
||
protected $config; | ||
public function __construct() { | ||
|
||
try { | ||
$this->config = config('Env'); | ||
} catch (Exception $e) { | ||
log_message('error', 'Failed to load environment variables: ' . $e->getMessage()); | ||
die('An error occurred while retrieving configuration.'); | ||
} | ||
} | ||
|
||
public function get_social_media_info() { | ||
|
||
$facebookUrl = env('FACEBOOK_PAGE_URL', ''); | ||
$twitterUrl = env('TWITTER_PAGE_URL', ''); | ||
|
||
if (empty($facebookUrl) || empty($twitterUrl)) { | ||
die('Social media URLs are not configured.'); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?= $this->extend("layouts/defaults") ?> | ||
<?= $this->section("title") ?>Article<?= $this->endSection() ?> | ||
|
||
<?= $this->section("content") ?> | ||
|
||
<h1>Articles</h1> | ||
|
||
<?php foreach ($articles as $article): ?> | ||
<article> | ||
<h2><?= $article["Title"] ?></h2> | ||
<p><?= $article["content"] ?></p> | ||
</article> | ||
<?php endforeach; ?> | ||
<?= $this->endSection() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?= $this->extend("layouts/defaults") ?> | ||
<?= $this->section("title") ?>Home<?= $this->endSection() ?> | ||
|
||
<?= $this->section("content") ?> | ||
<h1>Welcome</h1> | ||
|
||
<?= $this->endSection() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?= $this->extend("layouts/defaults") ?> | ||
<?= $this->section("title") ?>Sitemap<?= $this->endSection() ?> | ||
|
||
<?= $this->section("content") ?> | ||
<?= '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
<?php foreach ($urls as $url): ?> | ||
<url> | ||
<loc><?= htmlspecialchars($url['url']) ?></loc> | ||
<changefreq><?= htmlspecialchars($url['changefreq']) ?></changefreq> | ||
<priority><?= htmlspecialchars($url['priority']) ?></priority> | ||
</url> | ||
<?php endforeach; ?> | ||
</urlset> | ||
</pre> | ||
<?= $this->endSection() ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title><?= $title ?></title> | ||
</head> | ||
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title><?= $this->renderSection("title") ?></title> | ||
</head> | ||
<body> | ||
|
||
<?= $this->renderSection("content") ?> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.