[تم الحل] اريد عرض الشهر الهجري كاملا وليس الميلادي في هذا السكربت

  • بادئ الموضوع بادئ الموضوع الساعه
  • تاريخ البدء تاريخ البدء
آخر ظهور لمؤلف الموضوع قبل (6 ايام)
الحالة
مغلق و غير مفتوح للمزيد من الردود.

الساعه

عضو جديد
عضو كود نت
إنضم
27/04/2026
المشاركات
61
السلام عليكم
اريد من الاخوه الاكارم
تعديل السكربت تعديل بسيط بحيث يعرض الشهر الهجري كاملا بدل الميلادي
السكربت مرفق
 

المرفقات

السلام عليكم
اريد من الاخوه الاكارم
تعديل السكربت تعديل بسيط بحيث يعرض الشهر الهجري كاملا بدل الميلادي
السكربت مرفق
ان شاء الله ..
حاليًا انا غير موجودة فالبيت عند العودة
ساعمل على حل مشكلة عرض التواريخ بشكل مناسب .
 
مرحبًا صديقي ..
يوجد في المرفق ٣ ملفات .. ما الملف الذي تريد التعديل علية ؟
 
السلام عليكم
يبدوا ان الملف الذي بحاجة تعديل هو
sample5.php
 
السلام عليكم
يبدوا ان الملف الذي بحاجة تعديل هو
sample5.php
مرحبًا اخي ..

اليك تعديلات المُقترحة على الجزء الخاص بالحلقة (while) لتظهر النتيجه مرتبة ومنظمه .
كود:
<table border="1" style="direction:rtl; text-align:center; width:100%;">
    <tr>
        <th>اليوم</th>
        <th>التاريخ الهجري</th>
        <th>الفجر</th>
        <th>الشروق</th>
        <th>الظهر</th>
        <th>العصر</th>
        <th>المغرب</th>
        <th>العشاء</th>
    </tr>

<?php
// إعدادات البداية
$inputMonth = isset($_POST['months']) ? $_POST['months'] : date('m');
$year = isset($_POST['year']) ? $_POST['year'] : date('Y');
$mkt = mktime(0, 0, 0, $inputMonth, 1, $year);
$end_date = date('t', $mkt); // عدد أيام الشهر الميلادي

for ($d = 1; $d <= $end_date; $d++) {
    $current_timestamp = mktime(0, 0, 0, $inputMonth, $d, $year);
   
    // جلب أوقات الصلاة
    $times = $prayTime->getPrayerTimes($current_timestamp, $latitude, $longitude, $timeZone);
   
    // جلب التاريخ الهجري (اليوم والشهر)
    $hijri_day = hdate("_j", $current_timestamp);
    $hijri_month = hdate("_F", $current_timestamp); // اسم الشهر الهجري
    $hijri_year = hdate("_Y", $current_timestamp);
    $day_name = hdate("_D", $current_timestamp); // اسم اليوم

    // طباعة الصف
    echo "<tr>";
    echo "<td>$day_name</td>";
    echo "<td>$hijri_day $hijri_month $hijri_year</td>";
   
    // عرض الأوقات
    foreach ($times as $time) {
        echo "<td>$time</td>";
    }
    echo "</tr>";
}
?>
</table>

@الساعه
 
السلام عليكم
يعطيك العافيه
الكود غير مظبوط
لايعرض الشهر الهجري كاملا
 
السلام عليكم
يعطيك العافيه
الكود غير مظبوط
لايعرض الشهر الهجري كاملا
ايمكنك ارفاق صورة عن الشكل الذي يعرض الان ، وتوضيح كيفية عرض التاريخ الذي تريده ؟
 
السلام عليكم
يعطيك العافيه
هو يعرض الشهر الميلادي كامل عند فتح الملف
اريد يعرض الشهر الهجري كامل كما في الصوره
 

المرفقات

  • Screenshot_٢٠٢٦٠٤٢٨_١٧١٩٤٢.jpg
    Screenshot_٢٠٢٦٠٤٢٨_١٧١٩٤٢.jpg
    2.1 MB · المشاهدات: 2
السلام عليكم
يعطيك العافيه
هو يعرض الشهر الميلادي كامل عند فتح الملف
اريد يعرض الشهر الهجري كامل كما في الصوره
صديقي هوَ الان يعرض لك الشهر الهجري مع الشهر الميلادي بالتفصيل ؟ لا اعرف ماذا تريد بالضبط الان الكود قمت باصلاحه لك ، في منتدى هيلبرنت باحدث التقنيات واصلحت كُل المشاكل لاعرف المشاكل التي تريد تعديل عليها ..
  1. يعرض التاريخ الهجري كامل
  2. التاريخ الميلادي
  3. الايام - ما اسماء الايام
مالشيء الذي تريد تعديل عليه ... ازالة التاريخ الميلادي نهائيًا ؟ او ماذا !

تحياتي اخوك
مهدي حميد :)

@الساعه
 
السلام عليكم
ابو حميد
الرجاء تعديل شهر 12 هجري هذه السنة ليكون 29 يوم وليس 30 يوم
حاولت 100 مره ولم يظبط
 
السلام عليكم
ابو حميد
الرجاء تعديل شهر 12 هجري هذه السنة ليكون 29 يوم وليس 30 يوم
حاولت 100 مره ولم يظبط
مرحبًا بك ،
اخي العزيز اولاً ، عند فتح موضوع في منتدى كود نت ، يجب اكمال تفاصيل موضوعك هنا
ثانيًا : لاتتلقى اي تحسينات او تعديلات مني في المنتديات الاخرى اذا بقى الموضوع في كود نت غير كامل ...

تحياتي لك .
 
السلام عليكم الاخ مهدي
شكرا على الطرح
الموضوع واضح اريد طريقة تعديل التاريخ في السكربت مثلا شهر 12 في سنة 1447 هجري
مكتوب 30 يوم والصحيح 29 يوم في هذه السنة الهجرية كيف اقوم بتصحيح التاريخ
هذا ملف التاريخ الهجري
functions_hijridate.php
PHP:
<?php
//date_default_timezone_set("Asia/Riyadh");

function hgmstrftime($format = '_j _M _Y', $timestamp = 0)
{
    return hdate($format, $timestamp, 'gmstrftime');
}

function hstrftime($format = '_j _M _Y', $timestamp = 0)
{
    return hdate($format, $timestamp, 'strftime');
}

function hgmdate($format = '_j _M _Y', $timestamp = 0)
{
    return hdate($format, $timestamp, 'gmdate');
}

function hdate($format = '_j _M _Y', $timestamp = 0,$nextfunction='date')
    {
        if (strpos($format, "_") !== FALSE)
        {
            //global $vbulletin;
$gg="sar";   
        //    if ($gg !=='ar'){           
                $hmonths=array("محرم","صفر","ربيع اول","ربيع ثان","جمادالاول","جمادالاخر","رجب","شعبان","رمضان","شوال","ذوالقعدة","ذوالحجة");
                $hsmonths=array("محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الآخرة","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة");
    $days=array("الاثنين","الثلاثاء","الاربعاء","الخميس","الجمعه","السبت","الاحد");
        /*    }else{
                $hmonths = array("\M\u\h\a\\r\\r\a\m", "\S\a\f\a\\r", "\R\a\b\i \A\l \A\w\w\a\l", "\R\a\b\i \A\l \T\h\a\\n\i", "\J\u\m\a\d\a \A\l \O\u\l\a", "\J\u\m\a\d\a \A\l \A\k\h\i\\r\a", "\R\a\j\a\b", "\S\h\a\b\a\\n", "\R\a\m\a\d\a\\n", "\S\h\a\w\w\a\l", "\D\h\u\l \Q\i\d\a\h", "\D\h\u\l \H\i\j\j\a\h");
                $hsmonths = array("\M\u\h", "\S\a\f", "\R\b1", "\R\b2", "\J\m1", "\J\m2", "\R\a\j", "\S\h\a", "\R\a\m", "\S\h\w", "\Q\i\d", "\H\i\j");
            }*/
            if ($timestamp == 0 )
            {
                $timestamp = time();
            }
//add day or add -day
$add='1';
            list($w, $mn, $am) = explode(' ', gmdate("w n a", $timestamp));
            $j = intval($timestamp / 86400);
            $j = $j + 492150;
            $n = intval($j / 10631);
            $j = $j - ($n * 10631);
            $y = intval($j / 354.36667);
            $hy = ($n * 30) + $y + 1;
            $j = $j - round($y * 354.36667);
            $z = $j;
            $m = intval($j / 29.5);
            $hm = $m + 1;
            $j = $j - round($m * 29.5);
            $d = $j;
            $hd = intval($d);

            if ($hd == 0)
            {
                $hd = ($hm % 2 == 1)? (29): (30);
                $hm = $hm - 1;
            }
        if ($hm == 0 )
            {
                $hm = 12;
                $hy = $hy - 1;
                if (round(($hy % 30) * 0.36667) > round((($hy - 1) % 30) * 0.36667))
                {
                    $hd = 30;
                    $z = 355;
                }
                else
                {
                    $hd = 29;
                    $z = 354;
                }
            }
            $L = (round(($hy % 30) * 0.36667) > round((($hy - 1) % 30) * 0.36667))? (1): (0);
            $str = '';
            for ($n = 0; $n <= strlen($format); $n++)
            {
                $c = substr($format, $n, 1);
                switch ($c)
                {
                    case "_":
                        $n = $n + 1;
                        switch (substr($format, $n, 1))
                        {
                            case "j":
                                $str .= $hd;
                            break;

                            case "d":
                                $str .= str_pad($hd, 2, "0", STR_PAD_LEFT);
                            break;

                            case "z":
                                $str .= $z - 1;
                            break;

                            case "M":
                                $str .= $hsmonths[($hm - 1)];
                            break;

                            case "F":
                                $str .= $hmonths[($hm - 1)];
                            break;

                            case "t":
                                $t = ($hm % 2 == 1)? (30): (29);
                                if ($hm == 12 && $L == 1) $t =30;
                                $str .= $t;
                            break;

                            case "m":
                                $str .= str_pad($hm, 2, "0", STR_PAD_LEFT);
                            break;
                            
                            case "n":
                                $str .= $hm;
                            break;
                            
                            case "y":
                                $str .= substr($hy, 2);
                            break;
                            
                            case "Y":
                                $str .= $hy;
                            break;
                        //    switch ($c[$i])    {case 'l' :
                    case 'D' :
                        $str .= $days[$w];
break;
                            case "L":
                                $str .= $L;
                            break;
                            
                            default:
                                $str .= substr($format, $n, 1);
                            break;
                        }   
                    break;
                    
                    case '\\':
                        $str .= substr($format, $n, 2);
                        $n++;
                    break;

                    default:
                        $str .= $c;
                    break;
                }   
            }
            return $nextfunction($str, $timestamp);
        }
        else
        {
            return $nextfunction($format, $timestamp);
        }
    }
    ?>
وهذا ملف عرض التاريخ الشهري الميلادي والهجري واوقات الصلاة
sample5.php
لا ادري اي ملف اعدل عليه
PHP:
<head><style>
  pre {width:70%;
font-family: courier, serif, size: 10pt; margin: 0px 8px;}
.header { font-family: 'Open Sans', sans-serif; font-weight: 50; letter-spacing: .14em; line-height: 1em; color: #3333; font-style: normal; font-size: 50px; text-transform: uppercase; }
</style><head><style>
table , th , td{
  border:1px solid black;
  border-collapse: collapse;
width:80%;
algin:right;
}
</style></head>
<?php
@ini_set('display_errors',"0");
@header('Content-type: text/html;charset=windows-1256');
include('functions_hijridate.php');
$yearss= date('Y-m-d');
$w1="PM";
$w2="مساء";
$w3="AM";
$w4="صباحا";
$md=$_POST['md'];
$yearss = str_replace($w1, $w2, $yearss);
$yearss = str_replace($w3, $w4, $yearss);
//$string = "AM,PM";
//$str = array("AM" => "صباحا");
//$st2 = array("PM" => "مساء");
//$yearss = strtr($string, $str);
//require("functions_hijridate.php");
//ArDate.class.php
//hijri.class.php
    // Prayer Times Calculator, Sample Usage
    // By: Hamid Zarrabi-Zadeh
    // Inputs : $method, $year, $latitude, $longitude, $timeZone
    extract($_POST,EXTR_PREFIX_ALL,'p');
    //extract($_POST['method'];, EXTR_PREFIX_ALL,'p');
//import_request_variables("p");
    include('PrayTime2.php');
//extract($request);
extract($_POST);
extract(("p"),$post);
extract(('array'),$post);
extract(('array'),$method);
extract(('array'),$_POST);
extract(('p'),$method);
extract($method);
$soo = date('Y');
//$methodID=2;
   $prayTime->setCalcMethod($prayTime->Makkah);
if (!isset($method) || !isset($year))
 list($method, $year, $latitude, $longitude, $timeZone) = array(2,$soo, 24.633333, 46.716667,3);
?>
<head>
<title><?php if ($md==""){$md="الرياض";} echo "اوقات الصلاة في
$md"; ?></title>
</head>
<form name="form" method="post" action="<?php echo $PHP_SELF ?>">
<div style="padding:10px; background-color: #F8F7F4; border: 1px dashed #EAE9CD;">
    Latitude: <input type="text" value="<?php echo  $latitude; ?>" name="latitude" size="4">
    Longitude: <input type="text" value="<?php echo $longitude;?>" name="longitude" size="4">
    Time Zone: <input type="text" value="<?php echo $timeZone;?>" name="timeZone" size="2">
    Year: <input type="text" value="<?php echo  $year; ?>" name="year" size="4">
          sity : <input type="text" value="<?php echo  $md; ?>" placeholder="الرياض" name="md" size="10">
 Method:
    <select id="method" name="method" size="1" onchange="document.form.submit()">
        <option value="0">Shia Ithna-Ashari</option>
        <option value="1">University of Islamic Sciences, Karachi</option>
        <option value="2">Islamic Society of North America (ISNA)</option>
        <option value="3">Muslim World League (MWL)</option>
        <option value="4">Umm al-Qura, Makkah</option>
        <option value="5">Egyptian General Authority of Survey</option>
        <option value="7">Institute of Geophysics, University of Tehran</option>
 </select>
 <select id="method"  name="months">
 <?php $months= array("January" => "1",
            "February" => "2",
            "March" => "3",
            "April" => "4",
            "May" => "5",
            "June" => "6",
            "July" => "7",
            "August" => "8",
            "September" => "9",
            "October" => "10",
            "November" => "11",
            "December" => "12");
foreach ($months as $key => $value) { ?>
 <option value="<?php echo $value; ?>">
<?php echo $key; ?>
</option>
<?php } ?></select><input type="submit" value="Make Time">
</div>
</form><pre><table><td>
 الهــــــــجري
&nbsp;
 الفجر&nbsp;&nbsp;
 الشروق
 الظهر&nbsp;&nbsp;
 العصر&nbsp;
 الغروب
المغرب
&nbsp;
العشاء
ميــــلادي
</td></table></pre><?php
 $inputMonth = $_POST['months'];
 $year = $_POST['year'];
$sooo = date('m');
$soooo = date('Y');
if ($md==""){$md="الرياض";}
if ($inputMonth==""){$inputMonth="$sooo";}else{$inputMonth= $_POST['months'];}
if ($year==""){$year="$soooo";}else{$year= $_POST['year'];}
//$months = preg_replace('1','03',$months);
       // if (isset($_GET['month'])){     
//    $inputMonth=$_GET['month'];
            $mkt = mktime(0, 0, 0, $inputMonth, 1, $year);
            $date2 = date("$year-m-d", $mkt);
            $end2 = $year . "-" . $inputMonth . "-" . date('t', strtotime($date2));
    $datess = strtotime("'.$inputMonth.' d $year");
    ?>
  <?php
    $srrr=  hdate( "_t", strtotime('+1 month') );
// if (hdate( "_t", strtotime("+1 month"))); {(hdate( "_t", strtotime("+1 month")==29));}
              while (strtotime($date2) <= strtotime($end2)) {
    $times = $prayTime->getPrayerTimes($mkt, $latitude, $longitude, $timeZone);
$days=hdate("$inputMonth d _D _j _F _Y", $mkt);
   /*$days = hdate(''.$inputMonth.' d _D _j _F', $mkt);*/
//$class = '';
$datees1=date('d m Y');
$datees='<span class="header">'. $datees.'</span>';
$class = '';
 if ($datees1 == hdate("d m Y",$mkt)) {
$days='<font color="red">'. $days.'</font>';
        //    $class = "header";
        } elseif ($datees !== hdate("d m")) {
            $class = "current";
        }
   echo '<pre><table><td>';
   hdate("_t")=='29';
   if (hdate(_m)==12) {("(hdate(_t),12)"==29);}
    if ($hm == 12 && $L == 1) $t =29;
print $days. "\t". implode("\t",$times). "\n";
echo '</td></table></pre>';
    $mkt += 24*60*60;  // next day
$datees += 24*60*60;
   $sp=  hdate(_t,'11');
       $day_num = date('d', strtotime($date2));
                    $day_name = date('l', strtotime($date2));
                        $date2 = date("Y-m-d", strtotime("+1 day", strtotime($date2)));               
 //if (hdate("_Y")==1447){ (
 //if (hdate("_m")=='12') { (hdate(_t)==29);}
    $ee="9";
 echo "$day_numm $day_namme";
   }// end while
   echo  ", اوقات الصلاة في $md لشهر $inputMonth <br>";
  $dr=hdate("_m");
    $dtp=hdate('_d-_m-_Y');
$srr=  hdate( "_Y-_m-_d", strtotime('-1 day') );
   //echo "$srrr ,$dr<br>" ;
   $yearr=hdate('_Y');
   //echo hdate( "_Y-_m-_d", strtotime('+17 day') );
   echo "<br> $srr <br> $t <br> $z $hy $hm";
  echo (hdate(_t,strtotime(' -1 month ') ));
  echo hdate(_j);
 ?>
<script type="text/javascript">
 var method = <?php echo $method ?>;
 document.getElementById('method').selectedIndex = Math.min(method, 6);
</script>
</body>
</html>
 
functions_hijridate.php
عدل على هذا الملف ، لتغير ايام الشهر ، لكن لا اعتقد يوجد تخصيص لشهر واحد محدد للتعديل ؟
 
الحالة
مغلق و غير مفتوح للمزيد من الردود.
عودة
أعلى أسفل