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

$sqlretrive = "SELECT * FROM programs_ar WHERE ID = 1";
$executeSql = mysqli_query($connection,$sqlretrive);
$rowsJodcom = mysqli_fetch_row($executeSql);
$ourAbout = $rowsJodcom[2];
$ourAboutArr =  explode("@",$ourAbout);
$dataAbout = "";
foreach($ourAboutArr as $arrAbout)
{
    $dataAbout .="<p>$arrAbout</p>";
}
$NumberAch= $rowsJodcom[4];
$NumberArrach =  explode("@",$NumberAch);
$Number = $rowsJodcom[5];
$NumberArr =  explode("@",$Number);
$dataNumber = "";
for($i = 0 ; $i < 8 ; $i++)
{
    $dataNumber .= "<li>$NumberArr[$i] $NumberArrach[$i]</li>";
}

$sqlretriveEN = "SELECT * FROM programs_en WHERE ID = 1";
$executeSqlEN = mysqli_query($connection,$sqlretriveEN);
$rowsJodcomEN = mysqli_fetch_row($executeSqlEN);
$ourAboutEN = $rowsJodcomEN[2];
$ourAboutArrEN =  explode("@",$ourAboutEN);
$dataAboutEN = "";
foreach($ourAboutArrEN as $arrAboutEN)
{
    $dataAboutEN .="<p>$arrAboutEN</p>";
}
$NumberAchEN= $rowsJodcomEN[4];
$NumberArrachEN =  explode("@",$NumberAchEN);
$NumberEN = $rowsJodcomEN[5];
$NumberArrEN =  explode("@",$NumberEN);
$dataNumberEN = "";
for($i = 0 ; $i < 8 ; $i++)
{
    $dataNumberEN .= "<li>$NumberArr[$i] $NumberArrachEN[$i]</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'; ?>

  </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-program h3">
                <h3>برنامج جودكم</h3>
            </div>
            
        </div>
        <!-- End row -->
        <div class='col-md text-right' style='margin:0 10px 10px 0px;'>
                <a class='btn btn-pink' href='edit-joodcom.php'>تعديل المحتوى </a>
            </div>
            <!-- End col -->
        <div class='row justify-content-center text-right' style='margin-top:30px;'>
            <div class='col-md-11'>
                <h3><?php echo $rowsJodcom[1];?></h3>
                <hr>
                <?php echo $dataAbout; ?>
                <h3><?php echo $rowsJodcom[3];?></h3>
                <hr>
                <ul>
                    <?php echo $dataNumber;?>
                </ul>
            </div>
        </div>
        <!-- End row -->
        <br>
        <div class='row justify-content-center text-left' style='margin-top:30px;direction:ltr'>
            <div class='col-md-11'>
                <h3><?php echo $rowsJodcomEN[1];?></h3>
                <hr>
                <?php echo $dataAboutEN; ?>
                <h3><?php echo $rowsJodcomEN[3];?></h3>
                <hr>
                <ul>
                    <?php echo $dataNumberEN;?>
                </ul>
            </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["updateProgram"]) && $_SESSION["updateProgram"] == 1)
{ 
?>
Swal.fire(
  'تم تعديل المعلومات بنجاح',
  '',
  'success'
)
<?php
$_SESSION["updateProgram"] = 0;
}
?>

  </script>


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

