function updateAction() { $model = new Domain(); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); if (AF::isAjaxRequest() && isset($_POST['model']) && $_POST['model'] == 'Domain') { $model->fillFromArray($_POST, false); if ($model->save()) { Message::echoJsonSuccess(__('domain_updated')); } else { Message::echoJsonError(__('domain_not_updated')); } die; } $id = AF::get($this->params, 'id', FALSE); if (!$id) { throw new AFHttpException(0, 'no_id'); } if (!$model->cache()->findByPk($id)) { throw new AFHttpException(0, 'incorrect_id'); } Assets::js('jquery.form'); $this->addToPageTitle(__('update_domain')); $this->render('update', array('model' => $model)); }
?> </td> <td><?php echo $v; ?> </td> </tr> <?}?> </tbody> </table> </div> <?}?> </div> <?if(AF::isAjaxRequest()){?> <script> var report = eval('<?php echo json_encode($dataProvider['chart']); ?> '); var data = google.visualization.arrayToDataTable(report); var options = { title: "Chart", width: 600, height: 500, bar: {groupWidth: '50%'}, legend: { position: 'none' } }; var chart = new google.visualization.ColumnChart(document.getElementById('chart_div')); chart.draw(data, options);
public function redirect($path = NULL) { $redirectUrl = substr($_SERVER['SCRIPT_NAME'], 0, strlen($_SERVER['SCRIPT_NAME']) - 9); // force SSL if not present if ($_SERVER["HTTP_HOST"] == "pinnaclecrm.com" && $_SERVER["SERVER_PORT"] != "443") { $redirectUrl = "https://pinnaclecrm.com" . $redirectUrl; } if (is_array($path)) { $redirectUrl .= implode(DIRECTORY_SEPARATOR, $path); } elseif (is_string($path) && $path !== NULL) { $redirectUrl .= $this->controller . DIRECTORY_SEPARATOR . $path; } else { $redirectUrl = $_SERVER['HTTP_REFERER']; } if (AF::isAjaxRequest()) { echo '<script>window.location.replace("' . $redirectUrl . '")</script>'; die; } header('Location: ' . $redirectUrl); exit; }