Exemplo n.º 1
0
 public function run()
 {
     $htmlOptions = array('class' => 'callBtn');
     if (!Yii::app()->cdr->app_id) {
         $htmlOptions['disabled'] = 'disabled';
     }
     echo CHtml::ajaxButton('', ['/call/call'], ['type' => 'POST', 'data' => 'to=' . $this->fixNumber($this->to), 'success' => 'function(msg){alert(msg);}'], $htmlOptions);
 }
    private function ajaxRefresh($server, $type)
    {
        $all = $type === 'all';
        if (!is_array($type)) {
            $type = array($type);
        }
        $ret = array();
        $status = False;
        if ($all || in_array('players', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get players')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get players', $players)) {
                    $error = McBridge::get()->lastError();
                }
            }
            $i = 0;
            if (is_array($players) && count($players)) {
                $kick = Yii::app()->user->can($server->id, 'kick');
                foreach ($players as $player) {
                    ?>
                    <tr class="<?php 
                    if (!($i % 2)) {
                        echo 'even';
                    } else {
                        echo 'odd';
                    }
                    ?>
">
                        <td>
                            <?php 
                    $nick = '<span' . ($this->ip == @$player['ip'] ? ' style="font-weight: bold; color: blue"' : '') . '>' . CHtml::encode(@$player['name']) . '</span>';
                    if (@$player['id']) {
                        echo CHtml::link($nick, array('player/view', 'id' => $player['id']));
                    } else {
                        echo $nick;
                    }
                    ?>
                            <?php 
                    if ($kick) {
                        ?>
                                <div style="float: right">
                                    <?php 
                        echo CHtml::link('Kick', 'javascript:kickPlayer(\'' . addslashes(@$player['name']) . '\')');
                        ?>
                                </div>
                            <?php 
                    }
                    ?>
                        </td>
                    </tr>
            <?php 
                    $i++;
                }
            } else {
                ?>
                <tr>
                    <td class="odd" style="text-align: center">
                    <?php 
                if (strlen($error)) {
                    echo Yii::t('mc', 'Error getting player list: ') . $this->errStr($error);
                } else {
                    echo Yii::t('mc', 'No players online');
                }
                ?>
                    </td>
                </tr>
            <?php 
            }
            $ret['players'] = ob_get_clean();
        }
        if ($all || in_array('chat', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get chat')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get chat', $chat)) {
                    $error = McBridge::get()->lastError();
                }
            }
            if (strlen($error)) {
                echo Yii::t('mc', 'Couldn\'t get chat: ') . $this->errStr($error);
            } else {
                for ($i = count($chat) - 1; $i >= 0; $i--) {
                    echo @strftime('%H:%M:%S', $chat[$i]['time']) . ' ' . str_pad('<' . $chat[$i]['name'] . '>', 25) . $chat[$i]['text'] . "\n";
                }
                echo "\n";
            }
            $ret['chat'] = ob_get_clean();
        }
        if ($all || in_array('status', $type) || in_array('statusdetail', $type) || in_array('statusicon', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get status')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get status', $status)) {
                    $ret['status'] = McBridge::get()->lastError();
                }
            }
            if (strlen($error)) {
                echo Yii::t('mc', 'Error getting server status: ') . $this->errStr($error);
            } else {
                $ret['statusdetail'] = Yii::t('mc', 'Offline');
                $st = @$status[0];
                switch (@$st['status']) {
                    case 'running':
                        echo Yii::t('mc', 'The server is online!');
                        $ret['statusdetail'] = Yii::t('mc', 'Online') . ', ' . @$st['players'] . '/' . @$st['maxPlayers'] . ' ' . Yii::t('mc', 'players');
                        $ret['statusicon'] = Theme::img('online.png');
                        break;
                    case 'stopped':
                        echo Yii::t('mc', 'The server is offline.');
                        $ret['statusicon'] = Theme::img('offline.png');
                        break;
                    default:
                        echo Yii::t('mc', 'The server status is currently changing.');
                        $ret['statusicon'] = Theme::img('changing.png');
                }
                if (@$st['pid'] && Yii::app()->user->isSuperuser()) {
                    $ret['statusdetail'] .= ' (' . Yii::t('mc', 'PID') . ': ' . @$st['pid'] . ')';
                }
            }
            $ret['status'] = ob_get_clean();
        }
        if ($all || in_array('resources', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get log')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get resources', $res)) {
                    $error = McBridge::get()->lastError();
                }
            }
            if (!strlen($error)) {
                $st = @$res[0];
                $this->renderPartial('resources', array('cpu' => @$st['cpu'], 'memory' => @$st['memory']));
            }
            $ret['resources'] = ob_get_clean();
        }
        if ($all || in_array('log', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get log')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'get log', $log)) {
                    $error = McBridge::get()->lastError();
                }
            }
            if (strlen($error)) {
                echo Yii::t('mc', 'Couldn\'t get log: ') . $this->errStr($error);
            } else {
                for ($i = count($log) - 1; $i >= 0; $i--) {
                    echo @$log[$i]['line'] . "\n";
                }
            }
            $ret['log'] = ob_get_clean();
        }
        if ($all || in_array('buttons', $type)) {
            $error = false;
            ob_start();
            if (!$status) {
                if (!Yii::app()->user->can($server->id, 'get status')) {
                    $error = Yii::t('mc', 'Permission denied.');
                } else {
                    if (!McBridge::get()->serverCmd($server->id, 'get status', $status)) {
                        $error = McBridge::get()->lastError();
                    }
                }
            }
            $off = '1';
            $on = '0';
            $b1 = $b2 = $b3 = $off;
            if (Yii::app()->user->can($server->id, 'start')) {
                $b1 = $on;
            }
            if (Yii::app()->user->can($server->id, 'stop')) {
                $b2 = $on;
            }
            if (Yii::app()->user->can($server->id, 'restart')) {
                $b3 = $on;
            }
            switch (@$status[0]['status']) {
                case 'running':
                    $b1 = $off;
                    break;
                case 'stopped':
                    $b2 = $off;
                    break;
                default:
                    $b1 = $b3 = $off;
            }
            echo $b1 . $b2 . $b3;
            $ret['buttons'] = ob_get_clean();
        }
        if (in_array('backup', $type)) {
            $error = false;
            ob_start();
            if (!Yii::app()->user->can($server->id, 'get backup')) {
                $error = Yii::t('mc', 'Permission denied.');
            } else {
                if (!McBridge::get()->serverCmd($server->id, 'backup status', $backup)) {
                    $error = McBridge::get()->lastError();
                }
            }
            $dis = array('disabled' => 'disbled');
            $start = $download = false;
            $cls = 'flash-success';
            switch ($backup[0]['status']) {
                case 'none':
                    $content = Yii::t('mc', 'No backup in progress');
                    $start = true;
                    break;
                case 'done':
                    $content = Yii::t('mc', 'Backup done, ready for download. (Created: {date})', array('{date}' => @date('Y-m-d H:i', $backup[0]['time'])));
                    $start = $download = true;
                    break;
                case 'running':
                    $content = Yii::t('mc', 'Backup in progress, please wait');
                    break;
                case 'error':
                default:
                    if (!$error) {
                        $error = $backup[0]['message'];
                    }
                    $content = $error ? $error : Yii::t('mc', 'Error during backup, please check the daemon log');
                    $cls = 'flash-error';
                    $start = true;
                    break;
            }
            echo '<div class="' . $cls . '">' . CHtml::encode($content) . '</div>';
            if (Yii::app()->user->can($server->id, 'start backup')) {
                echo CHtml::ajaxButton(Yii::t('mc', 'Start'), '', array('type' => 'POST', 'data' => array('ajax' => 'start', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => 'backup_response'), $start ? array() : $dis);
            }
            if (@is_readable($backup[0]['file'])) {
                $opt = $download ? array() : $dis;
                $opt['onClick'] = 'backup_download()';
                echo CHtml::button(Yii::t('mc', 'Download'), $opt);
            } else {
                if (@$backup[0]['ftp']) {
                    echo '<br/>';
                    echo '<br/>';
                    if (@Yii::app()->params['ftp_client_disabled'] !== true) {
                        echo Yii::t('mc', 'You can use the {link} to access your backup. For all other FTP clients, please use the information below.', array('{link}' => CHtml::link('Multicraft FTP client', array('/ftpClient', 'id' => $server->id))));
                        echo '<br/>';
                        echo '<br/>';
                    }
                    echo Yii::t('mc', 'The backup is available as "<b>{file}</b>" on the following FTP server:', array('{file}' => CHtml::encode(basename($backup[0]['file'])))) . '<br/>';
                    $ftp = explode(':', $backup[0]['ftp']);
                    $ip = @$ftp[0];
                    $port = @$ftp[1];
                    $dmn = Daemon::model()->findByPk($server->daemon_id);
                    if ($dmn && isset($dmn->ftp_ip) && isset($dmn->ftp_port)) {
                        $ip = $dmn->ftp_ip;
                        $port = $dmn->ftp_port;
                    }
                    $attr = array();
                    $attr[] = array('label' => Yii::t('mc', 'Host'), 'value' => $ip);
                    $attr[] = array('label' => Yii::t('mc', 'Port'), 'value' => $port);
                    $attr[] = array('label' => Yii::t('mc', 'User'), 'value' => Yii::app()->user->name . '.' . $server->id);
                    $attr[] = array('label' => Yii::t('mc', 'Password'), 'value' => Yii::t('mc', 'Your Multicraft login password'));
                    $this->widget('zii.widgets.CDetailView', array('data' => array(), 'attributes' => $attr));
                } else {
                    if ($download) {
                        echo Yii::t('mc', 'Your backup is available as "<b>{file}</b>" in your servers base directory.', array('{file}' => CHtml::encode(basename($backup[0]['file']))));
                    }
                }
            }
            $ret['backup'] = ob_get_clean();
        }
        if ($all || in_array('movestatus', $type)) {
            $error = false;
            ob_start();
            try {
                $sql = 'select `src_dmn`, `dst_dmn`, `status`, `message` from `move_status` where `server_id`=?';
                $cmd = Yii::app()->bridgeDb->createCommand($sql);
                $cmd->bindValue(1, $server->id);
                $row = $cmd->queryRow(false);
            } catch (Exception $e) {
                $row = array(0, 0, 'error', 'Failed to load status from database.');
            }
            if ($row && Yii::app()->user->isSuperuser()) {
                $flash = 'success';
                if ($row[2] == 'error') {
                    $flash = 'error';
                }
                $msg = array('started' => Yii::t('mc', 'Server move started'), 'packing' => Yii::t('mc', 'Packing server files on source daemon'), 'uploading' => Yii::t('mc', 'Uploading server files to new daemon'), 'notifying' => Yii::t('mc', 'Notifying new daemon of completed transfer'), 'transferred' => Yii::t('mc', 'Transfer complete, starting unpack'), 'unpacking' => Yii::t('mc', 'Unpacking server files on destination daemon'), 'unsuspending' => Yii::t('mc', 'Unsuspending server'), 'done' => Yii::t('mc', 'Servermove completed.'), 'error' => Yii::t('mc', 'Server move failed, please check the server console and multicraft.log. Last error:'));
                $msg = @$msg[$row[2]];
                if (!$msg) {
                    $msg = $row[2];
                }
                ?>
            <div class="flash-<?php 
                echo $flash;
                ?>
">
                <span style="float: right">
                    <?php 
                echo CHtml::link(Yii::t('mc', 'Dismiss'), array('dismiss', 'id' => $server->id));
                ?>
                </span>
                <?php 
                echo Yii::t('mc', 'Server move status from daemon {a} to daemon {b}:', array('{a}' => $row[0], '{b}' => $row[1]));
                ?>
                <br/>
                <?php 
                echo $msg;
                ?>
<br/>
                <?php 
                echo $row[3];
                ?>
            </div>
            <?php 
            }
            $ret['movestatus'] = ob_get_clean();
        }
        return $ret;
    }
Exemplo n.º 3
0
<?php

$this->Widget('zii.widgets.jui.CJuiDialog', array('id' => 'modal', 'options' => array('title' => 'Edit Countries', 'autoOpen' => false, 'modal' => 'true', 'width' => '800', 'height' => '353', 'scrolling' => 'no', 'resizable' => false, 'position' => 'center', 'draggable' => true)));
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'add-modal', 'options' => array('title' => 'Create New Country', 'autoOpen' => false, 'modal' => 'true', 'width' => '520', 'height' => '365', 'scrolling' => 'no', 'resizable' => false, 'position' => 'center', 'draggable' => true)));
$this->renderPartial('_newcountry', array('model' => new Country()));
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>
<div class="span9">

    <div class="pull-right">
	<?php 
echo CHtml::ajaxButton(Yii::t('admin', 'Create New Country'), '#', array('type' => "POST", 'dataType' => 'json', 'onClick' => 'js:jQuery($("#add-modal")).dialog("open")'), array('id' => 'btnModalLogin', 'name' => 'btnModalLogin', 'class' => 'btn btn-primary'));
?>
	</div>
    <h3>Edit Countries</h3>
    <div class="editinstructions">
	    <div class="span8">
		<?php 
echo Yii::t('admin', 'Note, the Zip Validation field uses RegEx expressions, or can be left blank to allow any postal code format. Please check our online guide for help with this field. To delete an entry, edit the Country name and wipe out the text.');
?>
        </div>
	    <div class="clearfix search">
		    <div class="pull-right">
		    <?php 
echo CHtml::beginForm($this->createUrl('shipping/countries'), 'get');
?>
		    <?php 
echo CHtml::textField('q', Yii::app()->getRequest()->getQuery('q'), array('id' => 'xlsSearch', 'placeholder' => 'SEARCH...', 'submit' => ''));
?>
		    <?php 
echo CHtml::endForm();
            <tr>
                <th><?php 
    echo $sms->getAttributeLabel('updated');
    ?>
</th>
                <td><?php 
    echo $sms->updated;
    ?>
</td>
            </tr>
            <tr>
                <th><?php 
    echo $sms->getAttributeLabel('created');
    ?>
</th>
                <td><?php 
    echo $sms->created;
    ?>
</td>
            </tr>
        </table>
    </div>
    <?php 
    if (!isset($_GET['sms_command_id'])) {
        ?>
        <?php 
        echo CHtml::ajaxButton('Update', $this->createUrl('admin/sendsmscommand', ['sms_command_id' => $sms->sms_command_id]), ['success' => 'js:function(string){ $("#sms_status").html(string); }']);
        ?>
    <?php 
    }
}
Exemplo n.º 5
0
<h1>Crear Relaci&oacute;n de Bienes Faltantes</h1>
<h2>Paso 2: Especificar Bienes Muebles Faltantes</h2>
<?php 
echo $this->renderPartial('_search_bm', array('bien' => $bien, 'fbmid' => $_GET['id']));
?>

<div style="background-color:#CDE; padding: 5px; text-align:right;">
	<div id="data" style="min-height:100px;">
	   <?php 
$this->renderPartial('_content');
?>
	</div>
 
	<?php 
$options = array('update' => '#data2', 'type' => 'post', 'data' => array('fbmid' => $_GET['id']));
echo CHtml::ajaxButton('Agregar', CController::createUrl('fbm3/AgregarAjax'), $options, array('class' => 'button blue'));
?>
</div>
<div style="margin:10px 0">
	<div class="table-grey" style="min-height:150px">
		<h2>Bienes Muebles Adscritos</h2>
			<div id="data2">
				<?php 
$this->renderPartial('_content2');
?>
			</div>
	</div>
	<script>
	function prueba() {
		<?php 
echo CHtml::ajax(array('type' => 'POST', 'url' => array("fbm3/ActualizarAjax"), 'update' => '#data2', 'data' => array('fbmid' => $_GET['id'])));
Exemplo n.º 6
0
<div class="form">
<p class="note"><span class="required">*</span> หมายเหตุ : คลิกค้างที่รายชื่อและลากเพื่อย้ายตำแหน่ง</p>
<div style="cursor: move">
<?php 
// Organize the dataProvider data into a Zii-friendly array
$items = CHtml::listData($dataProvider->getData(), 'link_id', 'name_th');
// Implement the JUI Sortable plugin
$this->widget('zii.widgets.jui.CJuiSortable', array('id' => 'orderList', 'items' => $items));
// Add a Submit button to send data to the controller
?>
</div><br/>
<div class="row buttons">
<?php 
echo CHtml::ajaxButton('บันทึกการเปลี่ยนแปลง', '', array('type' => 'POST', 'htmlOptions' => array('style' => 'cursor: pointer'), 'data' => array('Order' => 'js:$("ul#orderList").sortable("toArray").toString()'), 'success' => 'function(){
            alert("บันทึกข้อมูลเรียบร้อยแล้ว");           
            var win=window.open(baseUrl,"_self");
                    with(win.document)
                    {
                        close();
                    }
            }
        '));
?>
&nbsp;&nbsp;
<?php 
echo CHtml::Button('ยกเลิก', array('onClick' => 'window.location="' . Yii::app()->createUrl('link') . '"'));
?>
</div>
</div>

Exemplo n.º 7
0
            <?php 
//echo $form->labelEx($model, 'message');
?>
            <?php 
echo $form->textArea($model, 'message', array('rows' => '8', 'class' => 'form-control', 'id' => 'request-message'));
?>
            <?php 
echo $form->error($model, 'message');
?>


        </div>
        <div class="modal-footer">
            <hr/>
            <?php 
echo CHtml::ajaxButton(Yii::t('SpaceModule.views_space_requestMembership', 'Send'), array('//space/space/requestMembershipForm', 'sguid' => $space->guid), array('type' => 'POST', 'beforeSend' => 'function(){ jQuery("#send-loader").removeClass("hidden"); }', 'success' => 'function(html){ $("#globalModal").html(html); }'), array('class' => 'btn btn-primary'));
?>


            <button type="button" class="btn btn-primary"
                    data-dismiss="modal"><?php 
echo Yii::t('SpaceModule.views_space_requestMembership', 'Close');
?>
</button>

            <div class="col-md-1 modal-loader">
                <div id="send-loader" class="loader loader-small hidden"></div>
            </div>
        </div>

        <?php 
Exemplo n.º 8
0
echo $form->label($bien, 'codigo');
echo $form->textField($bien, 'codigo', array('size' => 10, 'maxlength' => 6)) . ' &nbsp;';
$options = array('update' => '#data', 'type' => 'post', 'data' => array('codigo' => 'js:function() { return $("#Bienmueble_codigo").val(); }'));
echo CHtml::ajaxButton('Buscar', CController::createUrl('traspaso/SearchAjax'), $options, array('class' => 'button grey'));
?>
		</div>

		<div id="data" style="min-height:100px">
		   <?php 
$this->renderPartial('_ajaxContent');
?>
		</div>
		
		<?php 
$options2 = array('update' => '#data2', 'type' => 'post', 'data' => array());
echo CHtml::ajaxButton('Agregar', CController::createUrl('traspaso/adscribirAjax'), $options2, array('class' => 'button grey'));
?>
		<div style="margin:10px 0">
		<div class="table-grey" style="min-height:150px">
			<h2>Bienes Muebles Adscritos</h2>
			<table class="items">
				<thead>
				<tr><th colspan="3" style="text-align:center;">Clasificacion</th>
					<th rowspan="2" style="text-align:center;">Placa</th>
					<th rowspan="2" style="text-align:center;">Descripcion</th>
					<th rowspan="2" style="text-align:center;">Cantidad</th>
					<th rowspan="2" style="text-align:center;">Valor Unitario</th>
					<th rowspan="2"></th>
				</tr>
				<tr><th style="text-align:center;">Grupo</th>
					<th style="text-align:center;">SubGrupo</th>
echo CHtml::textArea("email", "", array("placeholder" => "", "class" => "textbox1", "style" => "height:10px"));
?>
                        </div>
                    </div>        
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12 top30">
                <?php 
// echo CHtml::submitButton('Submit', array('class' => 'button1'));
?>
                <?php 
echo CHtml::ajaxButton($text = 'Submit', $url = createUrl('customer/feedback', array('id' => getCurCusId())), $ajaxOptions = array('type' => 'POST', 'dataType' => 'json', 'success' => 'formSaved()', 'data' => 'js:{
                    email:document.getElementById("email").value,
//                    calldate:document.getElementById("Customer_call_date").value,
//                    opportunity_given:document.getElementById("opportunity_given").value,
                    yt0:1,
                    }'), array('class' => 'btn btn-primary pull-right bts'));
?>

                <?php 
echo CHtml::endForm();
?>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function setOppr(fld)
    {
        $("input:hidden[name=opportunity_given]").val(fld);
Exemplo n.º 10
0
echo GxHtml::encode($model->getRelationLabel('photos'));
?>
</label>
        <?php 
$this->widget('CMultiFileUpload', array('name' => 'photos', 'accept' => 'jpg|png|jpeg', 'max' => 3, 'remove' => Yii::t('ui', 'Remove'), 'htmlOptions' => array('size' => 25)));
if ($model->teacherPhotos) {
    echo "<fieldset><legend>Photos</legend><ul>";
    foreach ($model->teacherPhotos as $img) {
        $thumbImage = new Image(Yii::getPathOfAlias('webroot') . '/' . $img->photo);
        $img_url = $thumbImage->createThumb(110, 70);
        /*$thumbImage->resize(110, 70,Image::AUTO);
          $arr = explode("/",$img->photo);
          $file_name = $arr[count($arr)-1];
          $thumb = Yii::getPathOfAlias('webroot') .  '/resources/images/110x70/' . $file_name;
          $thumbImage->save($thumb);*/
        echo "<li id='img_" . $img->id . "'><img src='" . $img_url . "' />" . CHtml::ajaxButton('Xóa', $this->createUrl('delphoto', array('id' => $img->id)), array('success' => 'js:function(){$("#img_' . $img->id . '").remove()}')) . "</li>";
    }
    echo "</ul></fieldset>";
}
?>
    </div>
    <!-- row -->
    <label><?php 
//echo GxHtml::encode($model->getRelationLabel('videos'));
?>
</label>
    <?php 
//echo $form->checkBoxList($model, 'videos', GxHtml::encodeEx(GxHtml::listDataEx(Video::model()->findAllAttributes(null, true)), false, true));
?>
    <div class="row">
        <?php 
Exemplo n.º 11
0
echo '</td></tr></table></div>';
echo '<div class="sd_form_row" style="background:#F7F7F7;">
	<table width="98%" border="0" cellspacing="0" cellpadding="0">
                             <tr>
                                    <td width="10%">        
';
echo 'Course:</td><td>';
echo CHtml::dropDownList('cid', '', $data, array('prompt' => 'Select', 'style' => 'width:190px;', 'ajax' => array('type' => 'POST', 'url' => CController::createUrl('students/students/batch'), 'update' => '#batch_id', 'data' => 'js:$(this).serialize()')));
echo '</td>';
echo '<td>Batch:</td><td>';
$data1 = CHtml::listData(Batches::model()->findAll(array('order' => 'name DESC')), 'id', 'name');
echo CHtml::activeDropDownList($model, 'batch_id', $data1, array('prompt' => 'Select', 'id' => 'batch_id'));
?>
</td><td>
<?php 
echo CHtml::ajaxButton("Apply", CController::createUrl('/site/manage'), array('data' => 'js:$("#search-form").serialize()', 'update' => '#student_panel_handler', 'type' => 'GET'), array('id' => 'student-batch-but'));
?>

<?php 
$this->endWidget();
?>
</td>
</tr>
</table>
</div>
</div>
                        
                       <div id="filter_action">
                     <div class="filter_con">
                     <div class="filterbxcntnt_inner_bot" >
    <div class="filterbxcntnt_left" style="left:0px;"><strong>Active Filters:</strong></div>
Exemplo n.º 12
0
if (isset($volumenes) && count($volumenes) > 0) {
    ?>
	<table id="table" class="table table-bordered table-striped table-hover">
		<thead>
			<tr>
				<th>Nombre del Volumen</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<?php 
    if (count($volumenes) > 0) {
        foreach ($volumenes as $volumen) {
            if ($volumen->tieneExpediente_did == 1) {
                echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center">' . CHtml::ajaxButton("Ver Expedientes con Oliver", CController::createUrl('coleccion/verexp', array("id" => $volumen->id)), array('update' => '#exp'), array('class' => 'btn btn-warning', 'id' => $volumen->id)) . '</td></tr>';
            } else {
                $idArchivo = ArchivoHistorico::model()->find("coleccion_did = :c and volumen_did = :v", array(":c" => $volumen->coleccion_did, ":v" => $volumen->id));
                if (isset($idArchivo) && !empty($idArchivo)) {
                    echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center">' . CHtml::link("Ver Imágenes", array('coleccion/verimagenes', 'id' => $idArchivo->id), array('target' => '_blank', 'class' => 'btn btn-warning')) . '</td></tr>';
                } else {
                    echo '<tr><td>' . $volumen->nombre . '</td><td class="text-center"></td></tr>';
                }
            }
        }
    }
    ?>
			
		</tbody>
	</table>
<?php 
Exemplo n.º 13
0
		<?php 
echo $form->error($model, 'email');
?>
	</div>


	<div class="row">
		<?php 
echo $form->labelEx($model, 'password');
?>
		<?php 
echo $form->passwordField($model, 'password', array('size' => 30, 'maxlength' => 512));
?>
            
                <?php 
echo CHtml::ajaxButton('Auto Gen', $this->createUrl('registration/genkey'), array('success' => 'js:function(result){ ' . '$(".password-helper").html("New Password:  "******""); ' . '$("#' . CHtml::activeId($model, 'password') . '").val(result); ' . '}'));
?>
    
                <span class="password-helper"></span>
                <p class="hint password-hint">
                <?php 
echo UserModule::t("Minimal password length 6 symbols.");
?>
                </p>    
		<?php 
echo $form->error($model, 'password');
?>
	</div>        

	<div class="row">
		<?php 
Exemplo n.º 14
0
<div class="wide form">

<?php 
$form = $this->beginWidget('CActiveForm', array('action' => Yii::app()->createUrl($this->route), 'method' => 'post'));
?>

	<div class="row">
		<?php 
echo $form->label($bien, 'codigo');
echo $form->textField($bien, 'codigo', array('size' => 6, 'maxlength' => 7));
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::ajaxButton('Buscar', CController::createUrl('updateAjax'), array('update' => '#data', 'type' => 'post', 'data' => array('codigo' => 'js:function() { return $("#Bienmueble_codigo").val(); }', 'fbmid' => $fbmid)), array('class' => 'button blue'));
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- search-form -->
Exemplo n.º 15
0
<div class="translation_user">
<aside>
    <p>Сутності</p>
    <?php 
echo CHtml::ajaxButton('Локейшени', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('table' => 'location'), 'success' => "function(data) {\n                                \$('#content').html(data);\n                            }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-location'));
echo CHtml::ajaxButton('Типи', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('table' => 'type'), 'success' => "function(data) {\n                                \$('#content').html(data);\n                            }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-type'));
?>
</aside>
<article>
    <div class="language_buttons">
            <?php 
echo CHtml::ajaxlink('EN', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '2', 'table' => $table), 'success' => "function(data) {\n                                \$('#content').html(data);\n                            }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_en'));
echo CHtml::ajaxlink('UA', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '1', 'table' => $table), 'success' => "function(data) {\n                                \$('#content').html(data);\n                            }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_ua'));
echo CHtml::ajaxlink('PL', CController::createUrl('/translation/viewtranslate'), array('dataType' => 'json', 'type' => 'post', 'data' => array('lan_id' => '3', 'table' => $table), 'success' => "function(data) {\n                                \$('#content').html(data);\n                            }"), array('style' => 'height: 30px; width:250px; left:0px;', 'id' => 'translate-language_pl'));
?>
    
        <div class="lan">
          <ul id="nav">  
              <li><a href=""title="ua"><img src="../../../images/ua.jpg" /></a>  
                <ul>  
                    <li class="uz"><a href=""title="pl"><img src="../../../images/pl.jpg" /></a> </li>  
                    <li class="uz"><a href=""title="en"><img src="../../../images/en.jpg" /></a> </li>  
                </ul>
          </ul>
        </div>
        <div class="navigator-search">
            <form class="form-search" method="post" action="index.php?r=site/search">
                <input type="search" name="search" placeholder="пошук" value=""/>
                <input id="link" type="hidden" name ="id" value="google" />
                <input type="submit" value=""/>
            </form>
Exemplo n.º 16
0
<img data-toggle="modal" data-target="#myModal" src="<?php 
echo getThemeUrl() . '/images/notice.png';
?>
">

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" style="padding: 0;">
                <?php 
$ajaxUrl = createUrl('site/saveNotes');
echo CHtml::ajaxButton($text = 'Save', $url = $ajaxUrl, $ajaxOptions = array('type' => 'POST', 'beforeSend' => "\n                        function(request){\n                            var notes = \$('#notes').val();\n                        }  \n                        ", 'data' => 'js:{' . '"notes" : $("#notes").val(),' . '"model" :"' . 'model' . '"' . '}', 'dataType' => 'json', 'success' => 'function(html){ jQuery("#your_id").html(html); }'), $htmlOptions = array('class' => 'btn btn-primary notebtn pull-right', 'style' => 'margin: -7px 3px !important;', 'data-dismiss' => 'modal'));
?>

                <h4  class="text-center">Add Notes</h4>
            </div>
            <div class="modal-body" style="padding: 0;">
                <?php 
echo CHtml::activeTextArea($model, 'notes', array('class' => 'form-control', 'rows' => '9', 'cols' => '50', 'style' => "border:0px;", 'id' => 'notes'));
?>
            </div>
        </div>
    </div>
</div>





Exemplo n.º 17
0
			</div>

			<div id="tabs-8">
				<div class="row">
					<?php 
    echo $form->labelEx($model, 'is_allow_api');
    ?>
					<?php 
    echo $form->checkbox($model, 'is_allow_api');
    ?>
				<?php 
    echo $form->error($model, 'is_allow_api');
    ?>
				</div>
				<?php 
    echo CHtml::ajaxButton('generate token', array('customer/createToken', 'cust_id' => $model->id), array('type' => 'get', 'dataType' => 'html', 'replace' => '#cust-token', 'data' => ''));
    ?>
				<?php 
    $this->renderPartial('_tokens', array('customer_tokens' => $customer_tokens));
    ?>
				<div class="link_btn">
					<br/>
	<?php 
    echo CHtml::link('Add Api Access', Yii::app()->createUrl('/apiAccesslist/admin', array('customer_id' => $model->id)));
    ?>
				</div>
			</div>
			<div id="tabs-9">
				<div class="row">
					<?php 
    echo $form->labelEx($model, 'username');
Exemplo n.º 18
0
<br>
<?php 
if ($count > count($duplicates)) {
    echo "<div style='margin-bottom:10px;margin-left:15px;'>";
    echo "<h2 style='color:red;display:inline;'>" . Yii::t('app', '{dupes} records shown out of {count} records found.', array('{dupes}' => count($duplicates), '{count}' => $count)) . "</h2>";
    echo CHtml::link(Yii::t('app', 'Show All'), "?showAll=true", array('class' => 'x2-button', 'confirm' => Yii::t('app', 'WARNING: loading too many records on this page may tie up the server significantly. Are you sure you want to continue?')));
    echo "</div>";
}
foreach ($duplicates as $duplicate) {
    echo '<div id="' . str_replace(' ', '-', $duplicate->name) . '-' . $duplicate->id . '">';
    echo '<div class="page-title rounded-top"><h2><span class="no-bold">', Yii::t('app', 'Possible Match:'), '</span> ';
    echo $duplicate->name, '</h2></div>';
    $this->widget('DetailView', array('model' => $duplicate, 'modelName' => $moduleName));
    //$this->renderPartial('application.components.views.@DETAILVIEW', array('model' => $duplicate, 'modelName' => $moduleName));
    echo "<div style='margin-bottom:10px;'>";
    if (Yii::app()->user->checkAccess(ucfirst($moduleName) . 'Update', $authParams)) {
        echo "<span style='float:left'>";
        echo CHtml::ajaxButton(Yii::t('app', "Hide This"), $this->createUrl('/site/resolveDuplicates'), array('type' => 'POST', 'data' => array('ref' => $ref, 'action' => null, 'data' => json_encode($duplicate->attributes), 'modifier' => 'hideThis', 'modelName' => $modelName), 'success' => 'function(data){
                $("#' . str_replace(' ', '-', $duplicate->name) . '-' . $duplicate->id . '").hide();
            }'), array('class' => 'x2-button highlight', 'confirm' => Yii::t('app', 'Are you sure you want to hide this record?')));
        echo "</span>";
    }
    if (Yii::app()->user->checkAccess(ucfirst($moduleName) . 'Delete', $authParams)) {
        echo "<span style='float:left'>";
        echo CHtml::ajaxButton(Yii::t('app', "Delete This"), $this->createUrl('/site/resolveDuplicates'), array('type' => 'POST', 'data' => array('ref' => $ref, 'action' => null, 'data' => json_encode($duplicate->attributes), 'modifier' => 'deleteThis', 'modelName' => $modelName), 'success' => 'function(data){
                $("#' . str_replace(' ', '-', $duplicate->name) . '-' . $duplicate->id . '").hide();
            }'), array('class' => 'x2-button highlight', 'confirm' => Yii::t('app', 'Are you sure you want to delete this record?')));
        echo "</span></div>";
    }
    echo "</div><br><br>";
}
Exemplo n.º 19
0
function getList($f_list, $c, $b_color)
{
    // echo sizeof($f_list[$c])." ".sizeof($names[$c])."<br>";
    for ($k = 0; $k < count($f_list[$c]); $k++) {
        if ($f_list[$c][$k]['chosen'] != 0) {
            echo "<div style='border:1px solid #B5B0B1; margin:3px; margin-bottom:24px; border-radius:6px; padding:5px; height:80px;'>";
            echo "<div style='float:left; margin:5px; width:100px'><a href='https://facebook.com/" . $f_list[$c][$k]['fbid'] . "'><img width=70px src='https://graph.facebook.com/" . $f_list[$c][$k]['fbid'] . "/picture'></a></div>";
            echo "<div class='nspace' style='margin:5px;'>" . $f_list[$c][$k]['name'] . "&nbsp;&nbsp;</div>";
            echo "<div>";
            // echo "<button class='bspace btn btn-danger'><i class='icon-star-empty'></i></button>";
            //echo "<button class='bspace btn btn-info'><i class='icon-star-empty'></i><i class='icon-star-empty'></i></button>";
            //echo "<button class='bspace btn btn-success'><i class='icon-star-empty'></i><i class='icon-star-empty'></i><i class='icon-star-empty'></i></button>";
            echo CHtml::ajaxButton('', array('User/updateList', 'fid' => $f_list[$c][$k]['id'], 'value' => '0'), array(), array('class' => 'bspace btn ' . $b_color[0], 'style' => 'border-color: #F06141;', 'col' => '0'));
            echo CHtml::ajaxButton('', array('User/updateList', 'fid' => $f_list[$c][$k]['id'], 'value' => '1'), array(), array('class' => 'bspace btn ' . $b_color[1], 'style' => 'border-color: #45C3ED; ', 'col' => '1'));
            echo CHtml::ajaxButton('', array('User/updateList', 'fid' => $f_list[$c][$k]['id'], 'value' => '2'), array(), array('class' => 'bspace btn ' . $b_color[2], 'style' => 'border-color: #63BF63;', 'col' => '2'));
            echo "</div>";
            //    echo "<div><select width='50' style='width: 100px'><option value='empty'></option><option value='low'>Low</option><option value='medium'>Medium</option><option value='high'>High</option></select></div>";
            echo "</div>";
        }
    }
}
Exemplo n.º 20
0
Arquivo: view.php Projeto: ranvirp/rdp
<?php 
$this->breadcrumbs = array('Issues' => array('index'), $model->id);
$this->menu = array(array('label' => 'List Issues ', 'url' => array('index')), array('label' => 'Create Issue', 'url' => array('create')), array('label' => 'Update Issue', 'url' => array('update', 'id' => $model->id)), array('label' => 'Delete Issue', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Do you want to delete this entry?')), array('label' => 'Issue Management', 'url' => array('admin')));
?>

<h1>Issue # <?php 
echo $model->id;
?>
</h1>

<?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('label' => 'Scheme', 'type' => 'html', 'value' => $model->scheme->name), array('label' => 'From:', 'value' => $model->froms->designation_type->name . "," . Designation::model()->getLevelObj($model->froms->designation_type->level, $model->froms->level_id)), array('label' => 'Referenced to:', 'value' => $model->tos->designation_type->name . "," . Designation::model()->getLevelObj($model->tos->designation_type->level, $model->tos->level_id)), array('name' => 'description', 'label' => 'Details '), array('label' => 'Attachments :', 'type' => 'html', 'value' => Files::model()->showAttachments($model)))));
echo $this->renderPartial('_replies', array('replies' => $model->replies), true);
echo CHtml::ajaxButton('Mark replies', Ccontroller::createUrl('/replies/create', array('content_type' => 'issues', 'content_type_id' => $model->id)), array('dataType' => 'json', 'success' => "function(data){\n\t\$('#commentdiv').html(data.html);\n\t}"));
?>
<div id="commentdiv"></div>
Exemplo n.º 21
0
?>
    </div>



 	<div class="col-sm-2 col-xs-6" >
	<?php 
echo CHtml::tag('div', array('id' => 'shoppingcartcontinue', 'class' => 'col-sm-4 checkoutlink', 'onclick' => 'window.location.href=\'' . $this->CreateUrl("cart/checkout") . '\''), Yii::t('cart', 'Checkout'));
?>
	</div>


    <div class="col-sm-2 col-xs-6" >
		<?php 
echo CHtml::ajaxButton(Yii::t('cart', 'Update Cart'), array('cart/updatecart'), array('data' => 'js:$("#ShoppingCart").serialize()', 'type' => 'POST', 'dataType' => 'json', 'success' => 'js:function(data){
	                    if (data.action=="alert") {
	                      alert(data.errormsg);
						} else if (data.action=="success") {
							 location.reload();
						}}'));
?>
    </div>

</div>

<?php 
$this->endWidget();
/* This is our sharing box, which remains hidden until used */
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'CartShare', 'options' => array('title' => Yii::t('wishlist', 'Share my Cart'), 'autoOpen' => false, 'modal' => 'true', 'width' => '380', 'height' => Yii::app()->user->isGuest ? '580' : '430', 'scrolling' => 'yes', 'resizable' => false, 'position' => 'center', 'draggable' => false)));
$this->renderPartial('/cart/_sharecart', array('model' => $CartShare));
$this->endWidget('zii.widgets.jui.CJuiDialog');
Exemplo n.º 22
0
        <?php 
echo CHtml::ajaxButton('Add', Yii::app()->createUrl('ProductList/GetProduct'), array('type' => 'POST', 'data' => 'js:{"product_id": $("#product_id_list").val()}', 'dataType' => 'json', 'success' => 'js:function(string){
                /*If any error messages are returned donot execute addition of elements and display and error message*/
                if(string.message){alert(string.message);}else{

                /*If any product exists with the same id donot append that element.*/
                if($("[data-rowid="+string.product_id+"]").exists()){

                }else{
                    var productIds = $("#ProductList_product_ids").val();
                    //If previous products are listed
                    if(productIds.length!=0){
                        var prevIds = $("#ProductList_product_ids").val();
                        var prevIdsArr = $.map(JSON.parse(prevIds), function(value, index) {
                            return [value];
                        });
                        //console.log(prevIdsArr);
                        prevIdsArr.push(string.product_id);
                        $("#ProductList_product_ids").val(JSON.stringify(prevIdsArr));
                    }else{
                    //If no previous products are listed
                    var newArr = [string.product_id];
                     $("#ProductList_product_ids").val(JSON.stringify(newArr));
                    }
                 $("#noProducts").hide();//Hide message saying no products in the list
                 $("#result_div").append(string.data);

                 }
                 }
                 }'), array('class' => 'someCssClass'));
?>
Exemplo n.º 23
0
    ?>
<br>
		<?php 
    echo CHtml::activePasswordField($form, 'db_pass', array('placeholder' => 'Пароль'));
    ?>
<br>
		<?php 
    echo CHtml::activeTextField($form, 'db_db', array('placeholder' => 'База данных'));
    ?>
<br>
		<?php 
    echo CHtml::activeTextField($form, 'db_prefix', array('placeholder' => 'Префикс таблиц (необязательное)'));
    ?>
<br>
		<?php 
    echo CHtml::ajaxButton('Проверить подключение', '', array('type' => 'post', 'update' => '#db-status'), array('class' => 'btn btn-small'));
    ?>
<br><br>
		<span id="db-status"></span>
	</fieldset>
	<br>
	<fieldset>
		<legend>Данные администратора</legend>
		<?php 
    echo CHtml::activeTextField($form, 'login', array('placeholder' => 'Логин'));
    ?>
<br>
		<?php 
    echo CHtml::activePasswordField($form, 'password', array('placeholder' => 'Пароль'));
    ?>
<br>
Exemplo n.º 24
0
?>
            
	</div>          
     
     <input type="hidden" id="str_var" name="str_var" value="<?php 
print base64_encode(serialize($affectedTables));
?>
"/>   
     
            <?php 
echo CHtml::ajaxButton('Truncate', array('config/truncate'), array('type' => 'POST', 'data' => 'js:$("#str_var").serialize()', 'dataType' => 'json', 'success' => 'function(data){
									$.fn.yiiGridView.update("ulimslab-grid");
									$.fn.yiiGridView.update("ulimscashiering-grid");
									$.fn.yiiGridView.update("ulimsaccounting-grid");
									show_message(data.status);
								}', 'beforeSend' => 'js:
                                function(){
                                   var r = confirm("Are you sure you want to truncate data on affected tables?");
                           		   if(!r){return false;} 
                                }
                               '), array('class' => 'btn btn-warning'));
?>
       		
            <span id="truncate_msg" style="color:#F00;font-weight:bold; width:300px;"></span>
</div>
<script type="text/javascript">

	function show_message(msg){
		$('#truncate_msg').show();
		$('#truncate_msg').html(msg);
		$('#truncate_msg').fadeOut(5000);
Exemplo n.º 25
0
 private function ajaxDialog($label, $url, $title = null, $type = 'link', $ajaxOptions = array())
 {
     $id = self::ID . '-dialog';
     $ajaxOptions = array_merge(array('update' => '#' . $id, 'type' => 'post', 'complete' => "function(){ \$('#{$id}').dialog('option', 'position', 'center').dialog('open');}"), $ajaxOptions);
     $url = Yii::app()->getController()->createUrl($url);
     if ($type === 'button') {
         $content = CHtml::ajaxButton($label, $url, $ajaxOptions);
     } else {
         $content = CHtml::ajaxLink($label, $url, $ajaxOptions);
     }
     $content .= Yii::app()->getController()->widget('zii.widgets.jui.CJuiDialog', array('options' => array_merge($this->dialogOptions, array('title' => $title)), 'id' => $id), true);
     return $content;
 }
Exemplo n.º 26
0
    }
    ?>
        </select>
        <?php 
    echo CHtml::ajaxButton(Yii::t('mc', 'Give'), '', array('type' => 'POST', 'data' => array('ajax' => 'give', 'item' => "js:\$('#give-item').val()", Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken, 'amount' => "js:\$('#give-amount').val()"), 'success' => 'function(e) {if (e) alert(e);}'));
    ?>
        </div>

<?php 
    $attribs[] = array('label' => Yii::t('mc', 'Give'), 'type' => 'raw', 'value' => ob_get_clean());
}
if (@$tp && $model->status == 'online') {
    $attribs[] = array('label' => Yii::t('mc', 'Teleport to'), 'type' => 'raw', 'value' => CHtml::tag('select', array('id' => 'tp-ajax'), $data['tp']) . ' ' . CHtml::ajaxButton(Yii::t('mc', 'Teleport'), '', array('type' => 'POST', 'data' => array('ajax' => 'tp', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken, 'player' => "js:\$('#tp-ajax').val()"), 'success' => 'function(e) {if (e) alert(e);}')));
}
if (@$summon && $model->status == 'online') {
    $attribs[] = array('label' => Yii::t('mc', 'Summon'), 'type' => 'raw', 'value' => CHtml::tag('select', array('id' => 'summon-ajax'), $data['summon']) . ' ' . CHtml::ajaxButton(Yii::t('mc', 'Summon'), '', array('type' => 'POST', 'data' => array('ajax' => 'summon', Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken, 'player' => "js:\$('#summon-ajax').val()"))));
}
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attribs));
if ($edit) {
    $this->endWidget();
}
?>

<?php 
if (Yii::app()->user->hasFlash('player')) {
    ?>
<div class="flash-success">
    <?php 
    echo Yii::app()->user->getFlash('player');
    ?>
</div>
Exemplo n.º 27
0
    echo "<h2 style='color:red;display:inline;'>" . Yii::t('contacts', '{dupes} records shown out of {count} records found.', array('{dupes}' => count($duplicates), '{count}' => $count)) . "</h2>";
    echo CHtml::link(Yii::t('app', 'Show All'), "?showAll=true", array('class' => 'x2-button', 'confirm' => Yii::t('contacts', 'WARNING: loading too many records on this page may tie up the server significantly. Are you sure you want to continue?')));
    echo "</div>";
}
foreach ($duplicates as $duplicate) {
    echo '<div id="' . $duplicate->firstName . '-' . $duplicate->lastName . '-' . $duplicate->id . '">';
    echo '<div class="page-title rounded-top"><h2><span class="no-bold">', Yii::t('app', 'Possible Match:'), '</span> ';
    echo $duplicate->name, '</h2></div>';
    $this->widget('DetailView', array('model' => $duplicate));
    // $this->renderPartial('application.components.views.@DETAILVIEW', array('model' => $duplicate, 'modelName' => 'contacts'));
    echo "<div style='margin-bottom:10px;'><span style='float:left'>";
    echo CHtml::ajaxButton(Yii::t('contacts', "Keep This Record"), $this->createUrl('/contacts/contacts/discardNew'), array('type' => 'POST', 'data' => array('ref' => $ref, 'action' => null, 'id' => $duplicate->id, 'newId' => $newRecord->id), 'success' => 'function(data){
            window.location="' . $this->createUrl('/contacts/contacts/view') . '?id=' . $duplicate->id . '";
        }'), array('class' => 'x2-button highlight'));
    echo "</span>";
    if (Yii::app()->user->checkAccess('ContactsUpdate', $authParams)) {
        echo "<span style='float:left'>";
        echo CHtml::ajaxButton(Yii::t('contacts', "Hide This Record"), $this->createUrl('/contacts/contacts/discardNew'), array('type' => 'POST', 'data' => array('ref' => $ref, 'action' => 'hideThis', 'id' => $duplicate->id, 'newId' => $newRecord->id), 'success' => 'function(data){
                $("#' . $duplicate->firstName . "-" . $duplicate->lastName . '-' . $duplicate->id . '").hide();
            }'), array('class' => 'x2-button highlight', 'confirm' => Yii::t('contacts', 'Are you sure you want to hide this record?')));
        echo "</span>";
    }
    if (Yii::app()->user->checkAccess('ContactsDelete', $authParams)) {
        echo "<span style='float:left'>";
        echo CHtml::ajaxButton(Yii::t('contacts', "Delete This Record"), $this->createUrl('/contacts/contacts/discardNew'), array('type' => 'POST', 'data' => array('ref' => $ref, 'action' => 'deleteThis', 'id' => $duplicate->id, 'newId' => $newRecord->id), 'success' => 'function(data){
                $("#' . $duplicate->firstName . "-" . $duplicate->lastName . '-' . $duplicate->id . '").hide();
            }'), array('class' => 'x2-button highlight', 'confirm' => Yii::t('contacts', 'Are you sure you want to delete this record?')));
        echo "</span></div>";
    }
    echo "</div><br><br>";
}
Exemplo n.º 28
0
        <?php 
//echo $form->textField($model, 'file_path', array('maxlength' => 255));
echo $form->fileField($model, 'image');
?>
        <?php 
echo $form->error($model, 'image');
?>
        <div id="image_box">
            <?php 
$imagPath = Yii::getPathOfAlias('webroot') . '/' . $model->image;
//var_dump($imagPath);die;
if (file_exists($imagPath) && is_file($imagPath)) {
    $thumbImage = new Image($imagPath);
    $img_url = $thumbImage->createThumb(110, 70);
    echo CHtml::image($img_url, $model->title, array('id' => 'image'));
    echo CHtml::ajaxButton('Xóa', $this->createUrl('delImage', array('id' => $model->id)), array('success' => 'js:function(){$("#image_box").remove()}'));
}
?>
        </div>
    </div>
    <!-- row -->
    <div class="row">
        <?php 
echo $form->labelEx($model, 'body');
?>
        <?php 
//echo $form->textArea($model, 'body');
/*$this->widget('application.extensions.cleditor.ECLEditor', array(
      'model' => $model,
      'attribute' => 'body', //Model attribute name. Nome do atributo do modelo.
      'options' => array(
Exemplo n.º 29
0
}
?>
                    </div>
                </div>
            </div>

            <div class="col-lg-12">

            </div> 
            <div class="col-lg-12 top20">
                <div class="col-lg-2 pull-left">
                    <button class='btn btn-primary bts btn-left' onclick = "goBack();" >Back</button>
                </div>
                <div class="col-lg-2 pull-right ">
                    <?php 
echo CHtml::ajaxButton("Submit", array('customer/CustomerReply'), array('type' => 'POST', 'dataType' => 'json', 'data' => array('customer' => array("ajax" => '1', 'provisional_date' => "js:\$('#Customer_provisional_date').val()", 'call_date' => "js:\$('#Customer_call_date').val()")), 'beforeSend' => "js:function(){\n                                 var cus_call_date = document.getElementById('Customer_call_date'),\n                                cus_pro_date = document.getElementById('Customer_provisional_date'),\n                                time = cus_call_date.value.substring(11,19),\n                                time1 = cus_pro_date.value.substring(11,19),                                \n                                arr = time.split(':'),\n                                arr1 = time1.split(':'),\n                                hour = arr[0],\n                                hour1 = arr1[0],\n                                minutes = arr[1],\n                                minutes1 = arr1[1],\n                                allow = 0\n                                ;\n                                if(!cus_call_date.value)    {\n                                    alert('Confirmation Call Date Is Mandatory');\n                                    return false;\n                                }\n                                if(!cus_pro_date.value)    {\n                                    alert('Provisional Date to Meet Is Mandatory');\n                                    return false;\n                                }\n                               }", 'success' => "function asd(){\n                    location.href='" . createUrl('customer/SaveSelProd') . "';\n                        }"), array('class' => 'btn btn-primary right5 bts pull-right', 'value' => 'Next'));
?>
  
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
                        $(function() {
                            $('#datetimepicker1').datetimepicker({
                                format: 'DD/MM/YYYY HH:mm',
                            });

                            $('#datetimepicker2').datetimepicker({
								format: 'DD/MM/YYYY HH:mm',
							});
Exemplo n.º 30
0
if (isset($data->message)) {
    echo "<div class='fbbox fbspacer'>" . $data->message . "</div>";
} else {
    if (isset($data->description)) {
        echo "<div class='fbbox fbspacer'>" . $data->description . "</div>";
    }
}
?>
        <?php 
if (isset($data->picture)) {
    $picture = str_replace("_s.jpg", "_n.jpg", $data->picture);
    echo "<img width='300px' src='" . $picture . "'></img>";
}
?>

        <?php 
if (isset($data->created_time)) {
    // echo $data->created_time.'<br>';
    //echo date("l jS of F g:i A.", $data->created_time);
    echo '<br>' . date("l jS F g:i A.", strtotime($data->created_time));
}
?>
        <div class="btn-toolbar" style="float:right; margin:5px;">
            <div class="btn-group toggleMe">
                <?php 
echo CHtml::ajaxButton('', array('User/updatePosts', 'pid' => $data->id, 'value' => '1'), array(), array('class' => 'btn toggleOK', 'encode' => false));
?>
            </div>
        </div>
    </div>
</div>