نمایش نتایج: از شماره 1 تا 3 , از مجموع 3

موضوع: شمسی کردن یک قسمت

  1. #1
    عضو انجمن
    تاریخ عضویت
    Feb 2011
    نوشته ها
    483
    تشکر تشکر کرده 
    573
    تشکر تشکر شده 
    386
    تشکر شده در
    342 پست

    پیش فرض شمسی کردن یک قسمت

    سلام دوستان من یه اسکریپت دارم که فارسی و شمسی شده اما چند قیمت تاریخش شمسی نشده ممنون میشم راهنمایی کنید.

    نمونه قسمت شمسی شده:

    کد PHP:
    <table cellpadding="0" cellspacing="0" border="0" class="table table-bordered">
            <thead>
                <tr>
                    <th><?php echo get_phrase('select_date');?></th>
                    <th><?php echo get_phrase('select_month');?></th>
                    <th><?php echo get_phrase('select_year');?></th>
                    <th><?php echo get_phrase('select_class');?></th>
                    <th><?php echo get_phrase('select_date');?></th>
               </tr>
           </thead>
            <tbody>
                <form method="post" action="<?php echo base_url();?>index.php?teacher/attendance_selector" class="form">
                    <tr class="gradeA">
                        <td>
                            <select name="date" class="form-control">
                                <?php for($i=1;$i<=31;$i++):?>
                                    <option value="<?php echo $i;?>
                                        <?php if(isset($date) && $date==$i)echo 'selected="selected"';?>>
                                            <?php echo $i;?>
                                                </option>
                                <?php endfor;?>
                            </select>
                        </td>
                        <td>
                            <select name="month" class="form-control">
                                <?php 
                                
    for($i=1;$i<=12;$i++):
                                    if(
    $i==1)$m='january';
                                    else if(
    $i==2)$m='february';
                                    else if(
    $i==3)$m='march';
                                    else if(
    $i==4)$m='april';
                                    else if(
    $i==5)$m='may';
                                    else if(
    $i==6)$m='june';
                                    else if(
    $i==7)$m='july';
                                    else if(
    $i==8)$m='august';
                                    else if(
    $i==9)$m='september';
                                    else if(
    $i==10)$m='october';
                                    else if(
    $i==11)$m='november';
                                    else if(
    $i==12)$m='december';
                                
    ?>
                                    <option value="<?php echo $i;?>"
                                        <?php if($month==$i)echo 'selected="selected"';?>>
                                            <?php echo $m;?>
                                                </option>
                                <?php 
                                
    endfor;
                                
    ?>
                            </select>
                        </td>
                        <td>
                            <select name="year" class="form-control">
                                <?php for($i=2020;$i>=2010;$i--):?>
                                    <option value="<?php echo $i;?>"
                                        <?php if(isset($year) && $year==$i)echo 'selected="selected"';?>>
                                            <?php echo $i;?>
                                                </option>
                                <?php endfor;?>
                            </select>
                        </td>
                        <td>
                            <select name="class_id" class="form-control">
                                <?php 
                                $classes    
    =    $this->db->get('class')->result_array();
                                foreach(
    $classes as $row):?>
                                <option value="<?php echo $row['class_id'];?>"
                                    <?php if(isset($class_id) && $class_id==$row['class_id'])echo 'selected="selected"';?>>
                                        <?php echo $row['name'];?>
                                              </option>
                                <?php endforeach;?>
                            </select>

                        </td>
                        <td align="center"><input type="submit" value="<?php echo get_phrase('manage_attendance');?>" class="btn btn-info"/></td>
                    </tr>
                </form>
            </tbody>
        </table>

    <?php if($date!='' && $month!='' && $year!='' && $class_id!=''):?>

    <center>
        <div class="row">
            <div class="col-sm-offset-4 col-sm-4">
            
                <div class="tile-stats tile-white-gray">
                    <div class="icon"><i class="entypo-suitcase"></i></div>
                    <?php
                       $full_date    
    =    $year.'-'.$month.'-'.$date;
                        
    $timestamp strtotime($full_date);
                        
    $day strtolower(date('l'$timestamp));
                     
    ?>
                    <h2><?php echo ucwords($day);?></h2>
                    
                    <h3>Attendance of class <?php echo ($class_id);?></h3>
                    <p><?php echo $date.'-'.$month.'-'.$year;?></p>
                </div>
            </div>
        </div>
    </center>






    <div class="row">
    <div class="col-sm-offset-3 col-md-6">
        <table  class="table table-bordered">
            <thead>
                <tr class="gradeA">
                    <th><?php echo get_phrase('roll');?></th>
                    <th><?php echo get_phrase('name');?></th>
                    <th><?php echo get_phrase('status');?></th>
                </tr>
            </thead>
            <tbody>
                    
                <?php 
                
    //STUDENTS ATTENDANCE
                
    $students    =    $this->db->get_where('student' , array('class_id'=>$class_id))->result_array();
                    
                foreach(
    $students as $row)
                {
                    
    ?>
                    <tr class="gradeA">
                        <td><?php echo $row['roll'];?></td>
                        <td><?php echo $row['name'];?></td>
                        <td align="center">
                            <?php 
                            
    //inserting blank data for students attendance if unavailable
                            
    $verify_data    =    array(    'student_id' => $row['student_id'],
                                                        
    'date' => $full_date);
                            
    $query $this->db->get_where('attendance' $verify_data);
                            if(
    $query->num_rows() < 1)
                            
    $this->db->insert('attendance' $verify_data);
                            
                            
    //showing the attendance status editing option
                            
    $attendance $this->db->get_where('attendance' $verify_data)->row();
                            
    $status        $attendance->status;
                            
    ?>
                            
                            <form method="post" action="<?php echo base_url();?>index.php?teacher/manage_attendance/<?php echo $date.'/'.$month.'/'.$year.'/'.$class_id;?>">
                                <select name="status" class="form-control" style="width:100px; float:left;">
                                    <option value="0" <?php if($status == 0)echo 'selected="selected"';?>></option>
                                    <option value="1" <?php if($status == 1)echo 'selected="selected"';?>>Present</option>
                                    <option value="2" <?php if($status == 2)echo 'selected="selected"';?>>Absent</option>
                                </select>
                                <input type="hidden" name="student_id"             value="<?php echo $row['student_id'];?>" />
                                <input type="hidden" name="date"                     value="<?php echo $full_date;?>" />
                                <input type="submit" class="btn btn-default"     value="save" style="float:left; margin:0px 10px;">
                            </form>
                        </td>
                    </tr>
                    <?php 
                
    }
                
    ?>
        </table>
    </div>
    </div>
    <?php endif;?>

    نمونه قسمت شمسینشده (میخوام شمسی کنم این صفحه را)

    کد PHP:
    <head>
        <script src="jdate.js" type="text/javascript" charset="utf-8"></script>
        <script src="jdate.min.js" type="text/javascript" charset="utf-8"></script>
    </head>
    <hr />
    <?php echo form_open(base_url() . 'index.php?parents/attendance_report_selector/'.$student_id); ?>
    <div class="row">

        <div class="col-md-offset-3 col-md-2">
             <div class="form-group">
                <label class="control-label" style="margin-bottom: 5px;"><?php echo get_phrase('month'); ?></label>
                <select name="month" class="form-control selectboxit">
                    <?php
                    
    for ($i 1$i <= 12$i++):
                        if (
    $i == 1)
                            
    $m 'january';
                        else if (
    $i == 2)
                            
    $m 'february';
                        else if (
    $i == 3)
                            
    $m 'march';
                        else if (
    $i == 4)
                            
    $m 'april';
                        else if (
    $i == 5)
                            
    $m 'may';
                        else if (
    $i == 6)
                            
    $m 'june';
                        else if (
    $i == 7)
                            
    $m 'july';
                        else if (
    $i == 8)
                            
    $m 'august';
                        else if (
    $i == 9)
                            
    $m 'september';
                        else if (
    $i == 10)
                            
    $m 'october';
                        else if (
    $i == 11)
                            
    $m 'november';
                        else if (
    $i == 12)
                            
    $m 'december';
                        
    ?>
                        <option value="<?php echo $i?>"
                              <?php if($month == $i) echo 'selected'?>  >
                                    <?php echo get_phrase($m); ?>
                        </option>
                        <?php
                    
    endfor;
                    
    ?>
                </select>
             </div>
        </div>

        <div class="col-md-2">
            <div class="form-group">
                <label class="control-label" style="margin-bottom: 5px;"><?php echo get_phrase('sessional_year'); ?></label>
                <select class="form-control selectboxit" name="sessional_year" disabled>
                    <?php
                    $sessional_year_options 
    explode('-'$running_year); ?>
                    <option value="<?php echo $sessional_year_options[0]; ?>"><?php echo $sessional_year_options[0]; ?></option>
                    <option value="<?php echo $sessional_year_options[1]; ?>"><?php echo $sessional_year_options[1]; ?></option>
                </select>
            </div>
        </div>

        <input type="hidden" name="operation" value="selection">
        <input type="hidden" name="year" value="<?php echo $running_year;?>">

        <div class="col-md-2" style="margin-top: 20px;">
            <button type="submit" class="btn btn-info"><?php echo get_phrase('show_report');?></button>
        </div>
    </div>

    <?php echo form_close(); ?>


    <!-- Attendance Table starts from here -->
    <?php if ($class_id != '' && $section_id != '' && $month != '' && $sessional_year != '' && $student_id != ''): ?>

        <br>
        <div class="row">
            <div class="col-md-4"></div>
            <div class="col-md-4" style="text-align: center;">
                <div class="tile-stats tile-gray">
                    <div class="icon"><i class="entypo-docs"></i></div>
                    <h3 style="color: #696969;">
                        <?php
                        $section_name 
    $this->db->get_where('section', array('section_id' => $section_id))->row()->name;
                        
    $class_name $this->db->get_where('class', array('class_id' => $class_id))->row()->name;
                        if (
    $month == 1)
                            
    $m 'January';
                        else if (
    $month == 2)
                            
    $m 'February';
                        else if (
    $month == 3)
                            
    $m 'March';
                        else if (
    $month == 4)
                            
    $m 'April';
                        else if (
    $month == 5)
                            
    $m 'May';
                        else if (
    $month == 6)
                            
    $m 'June';
                        else if (
    $month == 7)
                            
    $m 'July';
                        else if (
    $month == 8)
                            
    $m 'August';
                        else if (
    $month == 9)
                            
    $m 'Sepetember';
                        else if (
    $month == 10)
                            
    $m 'October';
                        else if (
    $month == 11)
                            
    $m 'November';
                        else if (
    $month == 12)
                            
    $m 'December';
                        echo 
    get_phrase('attendance_sheet');
                        
    ?>
                    </h3>
                    <h4 style="color: #696969;">
        <?php echo get_phrase('class') . ' ' $class_name?> : <?php echo get_phrase('section');?> <?php echo $section_name?><br>
        <?php echo $m ', ' $sessional_year?>
                    </h4>
                </div>
            </div>
            <div class="col-md-4"></div>
        </div>


        <hr />

        <div class="row">
            <div class="col-md-12">
                <table class="table table-bordered" id="my_table">
                    <thead>
                        <tr>
                            <td style="text-align: center;">
        <?php echo get_phrase('students'); ?> <i class="entypo-down-thin"></i> | <?php echo get_phrase('date'); ?> <i class="entypo-right-thin"></i>
                            </td>
                            <?php 
                            
    //inserting blank data for students attendance if unavailable
                            
    $verify_data    =    array(    'student_id' => $row['student_id'],
                                                        
    'date' => $full_date);
                            
    $query $this->db->get_where('attendance' $verify_data);
                            if(
    $query->num_rows() < 1)
                            
    $this->db->insert('attendance' $verify_data);
                            
                            
    //showing the attendance status editing option
                            
    $attendance $this->db->get_where('attendance' $verify_data)->row();
                            
    $status        $attendance->status;
                            
    ?>
                                <td style="text-align: center;"><?php echo $i?></td>
                        <?php ?>

                        </tr>
                    </thead>

                    <tbody>
                                <?php
                                $jdata 
    = array();

                                
    $students $this->db->get_where('enroll', array('student_id' => $student_id,'class_id' => $class_id'year' => $running_year'section_id' => $section_id))->result_array();
                                if (
    sizeof($students) > 0):
                                foreach (
    $students as $row):
                                    
    ?>
                            <tr>
                                <td style="text-align: center;">
                                <?php echo $this->db->get_where('student', array('student_id' => $row['student_id']))->row()->name?>
                                </td>
                                <?php
                                $status 
    0;
                                for (
    $i 1$i <= $days$i++) {
                                    
    $timestamp strtotime($i '-' $month '-' $sessional_year);
                                    
    $this->db->group_by('timestamp');
                                    
    $attendance $this->db->get_where('attendance', array('section_id' => $section_id'class_id' => $class_id'year' => $running_year'timestamp' => $timestamp'student_id' => $row['student_id']))->result_array();


                                    foreach (
    $attendance as $row1):
                                        
    $month_dummy date('d'$row1['timestamp']);

                                        if (
    $i == $month_dummy)
                                        
    $status $row1['status'];


                                    endforeach;
                                    
    ?>
                                    <td style="text-align: center;">
                <?php if ($status == 1) { ?>
                                            <i class="entypo-record" style="color: #00a651;"></i>
                                <?php  } if($status == 2)  { ?>
                                            <i class="entypo-record" style="color: #ee4749;"></i>
                <?php  $status =0;?>


                                    </td>

            <?php ?>
        <?php endforeach; ?>
      <?php endif; ?>

                        </tr>

        <?php ?>

                    </tbody>
                </table>
                <center>
                    <a href="<?php echo base_url(); ?>index.php?parents/attendance_report_print_view/<?php echo $class_id?>/<?php echo $section_id?>/<?php echo $month?>/<?php echo $sessional_year?>/<?php echo $student_id?>"
                       class="btn btn-primary" target="_blank">
        <?php echo get_phrase('print_attendance_sheet'); ?>
                    </a>
                </center>
            </div>
        </div>
    <?php endif; ?>
    ممنون میشم راهنمایی کنید.
    amiroo.php@Gmail.com | Telegram: amirhosseinfallah

  2. # ADS




     

  3. #2
    عضو انجمن
    تاریخ عضویت
    Feb 2011
    نوشته ها
    483
    تشکر تشکر کرده 
    573
    تشکر تشکر شده 
    386
    تشکر شده در
    342 پست

    پیش فرض پاسخ : شمسی کردن یک قسمت

    دوستان کسی نیست کمک کنه؟
    amiroo.php@Gmail.com | Telegram: amirhosseinfallah

  4. #3
    عضو انجمن
    تاریخ عضویت
    Feb 2011
    نوشته ها
    483
    تشکر تشکر کرده 
    573
    تشکر تشکر شده 
    386
    تشکر شده در
    342 پست

    پیش فرض پاسخ : شمسی کردن یک قسمت

    بالا لاش..
    amiroo.php@Gmail.com | Telegram: amirhosseinfallah

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. پاسخ ها: 11
    آخرين نوشته: December 9th, 2015, 19:19
  2. پاسخ ها: 2
    آخرين نوشته: November 28th, 2013, 15:43
  3. پاسخ ها: 1
    آخرين نوشته: November 27th, 2013, 01:06
  4. پاسخ ها: 3
    آخرين نوشته: November 19th, 2013, 11:56

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •