public function consultarPeriodoOficialJSONAction()
 {
     $periodoOficialDao = new PeriodoOficialDao($this->getDoctrine());
     $periodoOficial = new PeriodoOficial();
     $periodoOficial = $periodoOficialDao->getPeriodoOficial();
     $numfilas = count($periodoOficial);
     $aux = new PeriodoOficial();
     $i = 0;
     foreach ($periodoOficial as $aux) {
         $rows[$i]['id'] = $aux->getIdPerOfi();
         $rows[$i]['cell'] = array($aux->getIdPerOfi(), $aux->gettipPerioPerOfi()->getNomTipPer(), DATE_FORMAT($aux->getFechIniPerOfi(), 'd/m/Y'), DATE_FORMAT($aux->getFechFinPerOfi(), 'd/m/Y'), $aux->getActivoPerOfi());
         if ($aux->getActivoPerOfi()) {
             $rows[$i]['cell'][4] = 'SI';
         } else {
             $rows[$i]['cell'][4] = 'NO';
         }
         $i++;
     }
     $datos = json_encode($rows);
     $jsonresponse = '{
            "page":"1",
            "total":"1",
            "records":"' . $numfilas . '", 
            "rows":' . $datos . '}';
     $response = new Response($jsonresponse);
     return $response;
 }
Example #2
0
                                <ul class="list-inline">
                                    <?php 
    $teacher = Teacher::model()->findByAttributes(array('id' => $lesson->teacher_id));
    ?>

                                    <li>主讲人:<?php 
    echo $teacher->name;
    ?>
</li>

                                    <li>
                                        时间:<?php 
    echo DATE_FORMAT(DATE_CREATE($lesson->start_date_time), 'Y.m.d');
    ?>
                                        至 <?php 
    echo DATE_FORMAT(DATE_CREATE($lesson->end_date_time), 'Y.m.d');
    ?>
                                    </li>
                                </ul>

                            </div>
                            <div class="col-xs-3">
                                <?php 
    $lessonWord = '了解更多';
    ?>
                                <a href="<?php 
    echo Yii::app()->createUrl('lesson/view', array('id' => $lesson->id));
    ?>
" class="btn btn-red btn-sm btn-sm-padding pull-right" role="button">
                                    <?php 
    echo $lessonWord;
Example #3
0
 public static function calcularSemanaAnterior($var = null)
 {
     $fecha = new DateTime();
     $fecha->modify("-1 week");
     $dia = DATE_FORMAT($fecha, 'D');
     if ($var == '0') {
         if ($dia == 'Mon') {
             $fecha->modify('monday');
         } else {
             $fecha->modify(' last monday');
         }
     } else {
         $fecha->modify('sunday');
     }
     return date_format($fecha, 'Y-m-d');
 }
Example #4
0
">
                            <?php 
    echo $lesson->name;
    ?>
                        </a>
                        <br/>
                        <a href="<?php 
    echo Yii::app()->createUrl('master/default/lessonStudent', array('id' => $lesson->id));
    ?>
" class="center-block color-red dropdown-toggle">
                            查看学员<i class="fa fa-angle-double-right"></i>
                        </a>
                    </td>

                    <td width="140"><?php 
    echo DATE_FORMAT(DATE_CREATE($lesson->start_date_time), 'Y.m.d') . '<br/> 至 <br/>' . DATE_FORMAT(DATE_CREATE($lesson->end_date_time), 'Y.m.d');
    ?>
</td>
                    <td width="120">已报名 <span class="color-red"><?php 
    echo $lesson->actual_students;
    ?>
</span> / 限<?php 
    echo $lesson->max_students;
    ?>
                    </td>
                    <td width="140">
                        <!--放图片就行-->
                        <!--务必给图片加 class="img-responsive"-->
                        <i class="fa fa-qrcode fa-5x"></i>
                    </td>
                </tr>
Example #5
0
 public static function myStrToTime($value)
 {
     return is_object($value) ? strtotime(DATE_FORMAT($value, DATE_ATOM)) : intval(strtotime((string) $value));
 }
Example #6
0
function ganti_format_tanggal_lagi($tanggal)
{
    DATE_FORMAT($tanggal, '%d-%m-%Y');
}
$sql.= "WHERE id = '1'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result, MYSQL_NUM);

$date1 = $row[0];
$year1 = DATE_FORMAT($date1,'%Y');
$month1 = DATE_FORMAT($date1,'%m');
$day1 = DATE_FORMAT($date1,'%d');
$_POST['price1'] = $row[1];
$_POST['price2'] = $row[2];
$_POST['price3'] = $row[3];
$_POST['price4'] = $row[4];
$date2 = $row[5];
$year2 = DATE_FORMAT($date2,'%Y');
$month2 = DATE_FORMAT($date2,'%m');
$day2 = DATE_FORMAT($date2,'%d');
$_POST['price5'] = $row[6];
$_POST['price6'] = $row[7];
$_POST['price7'] = $row[8];
$_POST['price8'] = $row[9];

}
?>


<form method="post" action="">
<table border="1" cellpadding="1" cellspacing="1">
		<tr>
			<th rowspan="2" style="text-align: center">&nbsp;</th>
			<th colspan="2" style="text-align: center">参加費</th>
			<th colspan="2" style="text-align: center">懇親会費</th>
Example #8
0
                                                <th>Role</th>
                                               <!-- <th>Bill Start</th>
                                                <th>Bill End</th>-->
                                                <th>Amount</th>
												<!--<th>Bill No</th>-->
                                            </tr>
                                        </thead>
                                        <tbody>
										<?php 
$grand_total = 0;
foreach ($unbill as $bill) {
    $today = date("Y-m-d");
    $report_data = $bill->date;
    $today_dt = new DateTime($today);
    $expire_dt = new DateTime($report_data);
    if (DATE_FORMAT($expire_dt, 'M') == DATE_FORMAT($today_dt, 'M')) {
        $grand_total += $bill->billing_amount;
        //print_r(DATE_FORMAT($expire_dt, 'M'));die;
        ?>
			                               <tr>
                                                <td><?php 
        echo $bill->user_name;
        ?>
</td>
                                                <td><?php 
        echo $bill->user_role;
        ?>
</td>
                                               <!-- <td>10.00 am</td>-->
                                                <td><?php 
        echo $bill->billing_amount;
Example #9
0
 /**
  * Convert Polls
  *
  * @access	private
  * @return void
  **/
 private function convert_polls()
 {
     //---------------------------
     // Set up
     //---------------------------
     $main = array('select' => 'p.*', 'from' => array('polls' => 'p'), 'add_join' => array(array('select' => 't.*', 'from' => array('threads' => 't'), 'where' => 'p.tid = t.tid', 'type' => 'left')), 'order' => 'p.tid ASC');
     $loop = $this->lib->load('polls', $main, array('voters'));
     //---------------------------
     // Loop
     //---------------------------
     while ($row = ipsRegistry::DB('hb')->fetch($this->lib->queryRes)) {
         //-----------------------------------------
         // Convert votes
         //-----------------------------------------
         $votes = array();
         ipsRegistry::DB('hb')->build(array('select' => '*', 'from' => 'PollVote', 'where' => "Poll_ID='" . intval($row['Poll_ID']) . "'"));
         $voterRes = ipsRegistry::DB('hb')->execute();
         while ($voter = ipsRegistry::DB('hb')->fetch($voterRes)) {
             // Do we already have this user's votes
             if (in_array($voter['Author_ID'], $votes)) {
                 continue;
             }
             $vsave = array('vote_date' => time(), 'tid' => $row['Topic_ID'], 'member_id' => $voter['Author_ID'], 'forum_id' => $row['Forum_ID'], 'member_choices' => serialize(array()));
             $this->lib->convertPollVoter($voter['Poll_ID'] . '-' . $voter['Author_ID'], $vsave);
         }
         //-----------------------------------------
         // Options are stored in one place...
         //-----------------------------------------
         $choices = array();
         $votes = array();
         $totalVotes = 0;
         ipsRegistry::DB('hb')->build(array('select' => '*', 'from' => 'PollChoice', 'where' => "Poll_ID='" . intval($row['Poll_ID']) . "'"));
         $choiceRes = ipsRegistry::DB('hb')->execute();
         while ($choice = ipsRegistry::DB('hb')->fetch($choiceRes)) {
             $choices[$choice['Choice_ID']] = $choice['Choice'];
             $votes[$choice['Choice_ID']] = $choice['Votes'];
             $totalVotes = $choice['Votes'];
         }
         //-----------------------------------------
         // Then we can do the actual poll
         //-----------------------------------------
         $poll_array = array(1 => array('question' => $row['Poll_question'], 'choice' => $choices, 'votes' => $votes));
         $save = array('tid' => $row['Topic_ID'], 'start_date' => is_object($row['Message_date']) ? strtotime(DATE_FORMAT($row['Message_date'], DATE_ATOM)) : intval(strtotime($row['Message_date'])), 'choices' => addslashes(serialize($poll_array)), 'starter_id' => $row['Author_ID'], 'votes' => $totalVotes, 'forum_id' => $row['Forum_ID'], 'poll_question' => $row['Poll_question']);
         $this->lib->convertPoll($row['Poll_ID'], $save);
     }
     $this->lib->next();
 }
Example #10
0
								<figcaption class="media-body">
									<span class="center-block"><?php 
echo $lesson->name;
?>
</span>
									<span class="center-block"><?php 
echo '<a href="#tab2" aria-controls="tab2" role="tab" data-toggle="tab" aria-expanded="false">' . $place->address . '</a>';
?>
</span>
									<span class="center-block clearfix">
									<span class="pull-left">价格:¥<?php 
echo $lesson->price == 0 ? '公益' : $lesson->price;
?>
</span>
									<span class="pull-left">开课时间:<?php 
echo DATE_FORMAT(DATE_CREATE($lesson->start_date_time), 'Y/m/d H:m');
?>
</span>
									</span>
									<span class="center-block clearfix">
										<?php 
$teacher = Teacher::model()->findByPk($lesson->teacher_id);
?>
										<span class="pull-left">预订人:<?php 
echo $teacher->name;
?>
</span>
									</span>
								</figcaption>

							</figure>
Example #11
0
?>
" style="max-width: 305px;">
                </div>

                <figcaption class="media-body">
                    <h3 class="media-heading"><?php 
echo $lesson->name;
?>
</h3>

                    <span class="center-block date">
                        开课时间:<?php 
echo DATE_FORMAT(DATE_CREATE($lesson->start_date_time), 'Y年m月d日H:i');
?>
 -<?php 
echo DATE_FORMAT(DATE_CREATE($lesson->end_date_time), 'm月d日 H:i');
?>
                    </span>


                    <ul class="list-inline master">
                        <li>
                            主讲导师:<a href="<?php 
echo Yii::app()->createUrl('teacher/view', array('id' => $teacher->id));
?>
"><?php 
echo $teacher->name;
?>
</a>
                        </li>
                        <li>
Example #12
0
 private function _fixTime($value)
 {
     return is_object($value) ? strtotime(DATE_FORMAT($value, DATE_ATOM)) : intval(strtotime($value));
 }
Example #13
0
 /**
  * Convert Attachments
  *
  * @access	private
  * @return void
  **/
 private function convert_attachments()
 {
     //-----------------------------------------
     // Were we given more info?
     //-----------------------------------------
     $this->lib->saveMoreInfo('attachments', array('attach_path'));
     //---------------------------
     // Set up
     //---------------------------
     $main = array('select' => '*', 'from' => 'Thread', 'where' => "File_uploads != ''", 'order' => 'Thread_ID ASC');
     $loop = $this->lib->load('attachments', $main);
     //-----------------------------------------
     // We need to know the path
     //-----------------------------------------
     $this->lib->getMoreInfo('attachments', $loop, array('attach_path' => array('type' => 'text', 'label' => 'The path to the folder where attachments are saved (no trailing slash - usually path_to_board/uploads):')), 'path');
     $get = unserialize($this->settings['conv_extra']);
     $us = $get[$this->lib->app['name']];
     //-----------------------------------------
     // Check all is well
     //-----------------------------------------
     if (!is_writable($this->settings['upload_dir'])) {
         $this->lib->error('Your IP.Board upload path is not writeable. ' . $this->settings['upload_dir']);
     }
     if (!is_readable($us['attach_path'])) {
         $this->lib->error('Your remote upload path is not readable.');
     }
     //---------------------------
     // Loop
     //---------------------------
     while ($row = ipsRegistry::DB('hb')->fetch($this->lib->queryRes)) {
         $attachments = explode(',', $row['File_uploads']);
         foreach ($attachments as $id => $data) {
             if ($data == '') {
                 continue;
             }
             // What's the extension?
             $ext = explode('.', $data);
             $extension = array_pop($e);
             // Is this an image?
             $image = false;
             if (in_array($extension, array('png', 'jpg', 'jpeg', 'gif'))) {
                 $image = true;
             }
             // Sort out data
             $save = array('attach_rel_id' => $row['Thread_ID'], 'attach_ext' => $extension, 'attach_file' => $data, 'attach_location' => $data, 'attach_is_image' => $image, 'attach_rel_module' => 'post', 'attach_member_id' => $row['Author_ID'], 'attach_hits' => $row['downloads'], 'attach_date' => is_object($row['Message_date']) ? strtotime(DATE_FORMAT($row['Message_date'], DATE_ATOM)) : intval(strtotime((string) $this->fixFrenchDate($row['Message_date']))));
             // Send em on
             $this->lib->convertAttachment($row['Thread_ID'] . '-' . $id, $save, $us['attach_path']);
         }
     }
     $this->lib->next();
 }
Example #14
0
                                </div>

                                <figcaption class="media-body">
                                    <div class="row">
                                        <div class="col-xs-9">
                                            <h3 class="media-heading"><?php 
        echo $result->name;
        ?>
</h3>
                                            <ul class="list-inline">
                                                <li>
                                                    时间:<?php 
        echo DATE_FORMAT(DATE_CREATE($result->start_date_time), 'Y.m.d');
        ?>
                                                    至 <?php 
        echo DATE_FORMAT(DATE_CREATE($result->end_date_time), 'Y.m.d');
        ?>
                                                </li>
                                            </ul>

                                        </div>
                                        <div class="col-xs-3">
                                            <a href="<?php 
        echo Yii::app()->createUrl('lesson/view', array('id' => $result->id));
        ?>
" class="btn btn-red btn-sm btn-sm-padding pull-right" title="了解更多" role="button">了解更多</a>
                                        </div>

                                    </div>

                                    <p class="text-justify"><?php