Пример #1
0
<?php

echo debug::vars($header, $doc);
Пример #2
0
<?debug::vars($current_game) ?>
<table>
<form action="" method="POST">
	<tr>
		<th align="center" style="font-size:24px;"><?php 
echo team_link_from_id($current_game['team1']);
?>
</th>
		<th align="center" style="font-size:24px;"><?php 
echo team_link_from_id($current_game['team2']);
?>
</th>
	</tr>
	<tr>
		<td align="center"><input type="text" name="score1" size="1" style="height:50px;font-size:38px;text-align:center;"></td>
		<td align="center"><input type="text" name="score2" size="1" style="height:50px;font-size:38px;text-align:center;"></td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" value="Report Results" style="height:50px;font-size:18px;">
		</td>
	</tr>
</form>
</table>
Пример #3
0
 public function action_checkout()
 {
     $this->template->content = View::factory('site/orders/checkout');
     if (isset($_POST['checkout']) && $_POST['total_price'] != "") {
         $order = ORM::factory('order');
         //$order->user_id=$_SESSION['auth_user_munch']->id; //NEED TO HANDLE USER ID IN SESSION
         $order->totalprice = $_POST['total_price'];
         echo debug::vars($order);
         $order->save();
         foreach ($_SESSION['cart_array'] as $key => $dish) {
             $ordersdish = ORM::factory('ordersdish');
             $ordersdish->order_id = $order->id;
             $ordersdish->dish_id = $dish['dish_id'];
             $ordersdish->restaurant_id = $dish['rest_id'];
             $ordersdish->quantity = $dish['quantity'];
             $ordersdish->price = $dish['price'];
             $ordersdish->price = $dish['comments'];
             $ordersdish->save();
             if (isset($dish['ingredients']) && $dish['ingredients'] != NULL) {
                 foreach ($dish['ingredients'] as $key => $ingredient) {
                     $ordersdishesingredient = orm::factory('ordersdishesingredient');
                     $ordersdishesingredient->orders_dishes_id = $ordersdish->id;
                     $ordersdishesingredient->ingredient_id = $ingredient['ingredient_id'];
                     $ordersdishesingredient->price = $ingredient['price'];
                     $ordersdishesingredient->save();
                 }
             }
             if (isset($dish['subs']) && $dish['subs'] != NULL) {
                 foreach ($dish['subs'] as $key => $sub) {
                     $ordersdishesgroupssub = orm::factory('ordersdishesgroupssub');
                     $ordersdishesgroupssub->orders_dishes_id = $ordersdish->id;
                     $ordersdishesgroupssub->group_id = $sub['group_id'];
                     $ordersdishesgroupssub->sub_id = $sub['sub_id'];
                     $ordersdishesgroupssub->price = $sub['price'];
                     $ordersdishesgroupssub->save();
                 }
             }
         }
         session_unset();
     }
 }
Пример #4
0
<?php

if (!empty($header)) {
    ?>
<h3><?php 
    echo $header;
    ?>
</h3>
<?php 
}
?>

<?php 
echo debug::vars($params);
Пример #5
0
 public function after()
 {
     if ($this->param('debug') !== NULL) {
         $this->response->body(debug::vars($this->json));
         return;
     }
     if (is_array($this->json)) {
         $this->request->headers('Content-type', 'application/json');
         if (!isset($this->json['response'])) {
             $this->json['response'] = NULL;
         }
         $this->json = json_encode($this->json);
     }
     $this->response->body($this->json);
 }
Пример #6
0
 /**
  * 
  * @return \API_Response
  */
 public function debug()
 {
     echo debug::vars($this->body());
     return $this;
 }
Пример #7
0
 protected function _dpx_files_content($response)
 {
     if (!$response) {
         return FALSE;
     }
     //Each file and folder
     foreach ($response->contents as $file) {
         // Update folder otherwise update file
         if ($file->is_dir) {
             $dir_path = $this->_content_path . $file->path;
             if (isset($file->is_deleted)) {
                 echo debug::vars("Remove folder : {$dir_path}");
                 $this->_rrmdir($dir_path);
             } else {
                 if (!is_dir($dir_path)) {
                     echo debug::vars("Create folder : {$dir_path}");
                     mkdir($dir_path);
                 }
             }
             // echo debug::vars($file);
             // New iteration
             $this->_dpx_files_content($this->_dpx_files_metadata($file->path));
         } else {
             $file_content = Request::factory('https://content.dropboxapi.com/1/files/auto/')->headers('Authorization', 'Bearer ' . $this->_access_token)->headers('Content-Type', 'application/json')->query('path', $file->path)->execute()->body();
             $file_path = $this->_content_path . $file->path;
             // revision hash based on path + revision
             $dpx_hash_file = $this->_content_path . '/_dpx_changes/' . md5($file->path . $file->revision);
             if (file_exists($dpx_hash_file)) {
                 echo debug::vars("No change for : {$file_path}");
                 continue;
             }
             echo debug::vars("Create / update file : {$file_path}");
             // echo debug::vars($file);
             touch($dpx_hash_file);
             if (isset($file->is_deleted)) {
                 if (is_file($file_path)) {
                     unlink($file_path);
                 }
             } else {
                 file_put_contents($file_path, $file_content, LOCK_EX);
             }
         }
     }
 }