public function __construct($array = []) { Initialize::run(true); if (Compose::run()) { echo '<pre>'; print_r($array); echo '</pre>'; } }
public static function goToTable($table) { if (preg_match_all(sprintf(Initialize::$replace["goToTable"], $table, $table, $table), Compose::databaseFile2(), $codes)) { new Compile($codes); } else { echo "nej"; } }
public static function where($column, $value) { if (Compose::prepared()) { foreach (Compose::databaseTableRows()[Compose::table()] as $key => $values) { if (Compose::databaseTableRows()[Compose::table()][$key][$column] == $value) { $sorted[Compose::table()][$key] = $values; } } Initialize::where($sorted); echo '<br><br><br><br><br><br><br><br><br><br>'; new Compile(Compose::where()); echo '<br><br><br><br><br><br><br><br><br><br>'; } }
public static function databaseFile2() { return str_replace(PHP_EOL, "", file_get_contents(Compose::databasePath())); }
public function actionReply() { $model = new Reply(); // uncomment the following code to enable ajax-based validation /* if(isset($_POST['ajax']) && $_POST['ajax']==='reply-reply-form') { echo CActiveForm::validate($model); Yii::app()->end(); } */ $insert = new Compose(); if (isset($_POST['Reply'])) { $subject = Yii::app()->user->getState('subject'); $email = Yii::app()->user->getState('email'); $body = $_POST['Reply']['body']; $date = DATE('Y:M:D'); $insert->subject = $subject; $insert->email = $email; $insert->body = $_POST['Reply']['body']; $insert->date = DATE("Y-m-d H+6:i:s"); $insert->save(); mail($email, $subject, $date, $body); $this->render('mails'); $model->attributes = $_POST['Reply']; exit; if ($model->validate()) { // form inputs are valid, do something here return; } } $this->render('reply', array('model' => $model)); }
<thead> <th>Email</th> <th>Subject</th> <th>Body</th> <th>Date</th> </thead> <div class ="text-center"> hello you are in the your Mails </div> <div class="text-center"> <?php $model = new Compose(); $row = Compose::model()->findAll(); foreach ($row as $value) { echo "\n\t\t\n\t\t\t\n\n\t\t\t\t<tbody>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<td>{$value->email}</td>\n\t\t\t\t\t\t<td>{$value->subject}</td>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t<td>{$value->body}</td>\n\t\t\t\t\t<td>{$value->date}</td> \n </tbody>\n\t\t\t\t\t"; echo '<td>'; echo CHtml::link('<button class="btn btn-warning" type="submit">delete</button>', array('site/delet')); echo '</td>'; } ?> <table> </body> </html>