<?php 
include '../connection.php'; 
if(!isset($_SESSION)) session_start();
if(!isset($_SESSION["ID"])){header('Location: index.php');}

$aboutusSql = "SELECT ID, aboutus, ourvision, ourmessage, ourgoals, ourvalue FROM aboutus_ar where ID = 1";
$executeSql = mysqli_query($connection,$aboutusSql);
$retriveData = mysqli_fetch_row($executeSql);
$ourgoals = $retriveData[4];
$ourgoalsArr =  explode("@",$ourgoals);
$dataGoals = "";
foreach($ourgoalsArr as $arrGoals)
{
    $dataGoals .="<li>$arrGoals</li>";
}
$ourvalues = $retriveData[5];
$ourvaluesArr =  explode("@",$ourvalues);
$dataValues = "";
if(count($ourvaluesArr) == 1)
{
    $dataValues = "<li>$ourvalues</li>";
}
else
{
    foreach($ourvaluesArr as $arrValue)
    {
        $dataValues .="<li>$arrValue</li>";
    }
}

$aboutusSql = "SELECT ID, aboutus, ourvision, ourmessage, ourgoals, ourvalue FROM aboutus_en where ID = 1";
$executeSql = mysqli_query($connection,$aboutusSql);
$retriveDataEN = mysqli_fetch_row($executeSql);
$ourgoalsEN = $retriveDataEN[4];
$ourgoalsArrEN =  explode("@",$ourgoalsEN);
$dataGoalsEN = "";
foreach($ourgoalsArrEN as $arrGoalsEN)
{
    $dataGoalsEN .="<li>$arrGoalsEN</li>";
}
$ourvaluesEN = $retriveDataEN[5];
$ourvaluesArrEN =  explode("@",$ourvaluesEN);
$dataValuesEN = "";
if(count($ourvaluesArrEN) == 1)
{
    $dataValuesEN = "<li>$ourvaluesEN</li>";
}
else
{
    foreach($ourvaluesArrEN as $arrValueEN)
    {
        $dataValuesEN .="<li>$arrValueEN</li>";
    }
}
?>
<!doctype html>
<html lang="ar">
  <head>
    <title>خذ فرصة</title>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- assets / css -->
    <?php include 'cssFile.php'; ?>
<style>
    h5 
{
    line-height: initial;
}
</style>
  </head>
  <body  dir="rtl">

<?php include 'navbar.php'; ?>
<div class="content-body">
    <div class='container' style='margin-top:30px;'>
        <div class="row justify-content-center">
            <div class="col-md-3 text-center col-aboutus-takeachance">
                <h3>من نحن</h3>
            </div>
        </div>
        <div class='row justify-content-center'>
            <div class='col-md-10 text-right' style='margin:0 10px 10px 0px;padding-left:50px;'>
                <a href='edit-aboutus.php?ID=<?php echo $retriveData[0]?>' class='btn btn-yellow' style='font-weight:bold'>تعديل </a>
            </div>
            <!-- End col -->

        </div>
        <!-- End row -->
        <br>
            <div class="row justify-content-center" id="row-about">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#FC5272'>من نحن</h2>
            <hr>
        <h5 style='text-align:justify'>
            <?php echo $retriveData[1];?>
        </h5>
        </div>
    </div><br>
    <!-- End row -->
    <div class="row justify-content-center" id="row-about">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#FC5272'>ABOUT US</h2>
            <hr>
        <h5 style='text-align:justify;direction:ltr'>
            <?php echo $retriveDataEN[1];?>
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-Ourvision">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#0080BB'>رؤيتنا</h2>
            <hr>
        <h5 style='text-align:justify'>
            <?php echo $retriveData[2];?>
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-Ourvision">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#0080BB'>OUR VISION</h2>
            <hr>
        <h5 style='text-align:justify;direction:ltr'>
            <?php echo $retriveDataEN[2];?>
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-ourmessage">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#ECE813'>رسالتنا</h2>
            <hr>
        <h5 style='text-align:justify'>
        <?php echo $retriveData[3];?> 
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-ourmessage">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#ECE813'>OUR MESSAGE</h2>
            <hr>
        <h5 style='text-align:justify;direction:ltr'>
        <?php echo $retriveDataEN[3];?> 
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-goals">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#FC5272'>أهدافنا</h2>
            <hr>
        <h5 style='text-align:justify'>
            <ul>
            <?php echo $dataGoals;?>            
            </ul>
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-goals">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#FC5272'>OUR GOALS</h2>
            <hr>
        <h5 style='text-align:justify;direction:ltr'>
            <ul>
            <?php echo $dataGoalsEN;?>            
            </ul>
        </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-value">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#0080BB'>قيمنا</h2>
        <hr>
            <h5 style='text-align:justify'>
                <ul>
                <?php echo $dataValues;?>            
                </ul>
            </h5>
        </div>
    </div>
    <!-- End row -->
    <br>
    <div class="row justify-content-center" id="row-value">
        <div class="col-10 text-right">
            <h2 class='text-center' style='color:#0080BB'>OUR VALUES</h2>
        <hr>
            <h5 style='text-align:justify;direction:ltr;'>
                <ul>
                <?php echo $dataValuesEN;?>            
                </ul>
            </h5>
        </div>
    </div>
    <!-- End row -->
    </div>
    <!-- End container -->
</div>
<!-- End content body -->
<!-- assets / js -->
    <?php include 'jsFile.php'; ?>
    <script>

<?php
if(!isset($_SESSION))
  session_start();
if(isset($_SESSION["updatesuccess"]) && $_SESSION["updatesuccess"] == 1)
{ 
?>
Swal.fire(
  'تم تعديل المعلومات بنجاح',
  '',
  'success'
)
<?php
$_SESSION["updatesuccess"] = 0;
}
?>

  </script>
  </body>
</html>
<!-- onload="reloader()" -->

