Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
pirep edit form fix, debug enhancement?
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabeel Shahzad committed Feb 20, 2011
1 parent 4cbc1f5 commit 51de842
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 51 deletions.
2 changes: 1 addition & 1 deletion admin/templates/pirep_edit.tpl
Expand Up @@ -113,7 +113,7 @@ foreach($pirepfields as $field)
}

$value = trim($fvalue);
echo "<option value='{$fvalue}' {$sel}>{$fvalue}</option>';
echo "<option value='{$fvalue}' {$sel}>{$fvalue}</option>";
}
echo '</select>';
}
Expand Down
65 changes: 25 additions & 40 deletions core/classes/Debug.class.php
Expand Up @@ -121,17 +121,15 @@ public static function log($string, $filename = 'log') {
fwrite(self::$fp, $string);
}

public static function firebug()
{
public static function firebug() {
include_once CORE_PATH.DS.'lib'.DS.'firebug'.DS.'FirePHP.class.php';

$instance = FirePHP::getInstance(true);
$args = func_get_args();
return call_user_func_array(array($instance,'fb'),$args);
}

public static function showCritical($message, $title='')
{
public static function showCritical($message, $title='') {
if($title == '')
$title = 'An Error Was Encountered';

Expand All @@ -148,8 +146,7 @@ public static function showCritical($message, $title='')
* Show the CSS and JS code for the debug box
* Is set to only show once on the page
*/
public static function showHeader()
{
public static function showHeader() {
if(self::$heading_shown == true) return;

self::$heading_shown = true;
Expand Down Expand Up @@ -201,36 +198,31 @@ public static function Show()

$args = func_get_args();

foreach($args as $value)
{
foreach($args as $value) {
$id = mt_rand();

if(is_array($value) || is_object($value))
{ // this runs once, need to get the key and value
if(is_array($value) || is_object($value)) {

if(count($value)> 1)
self::printArrayObj($value, 'More than 1 value in '.gettype($value).' - ');
else
{ /*this will run once usually, unless its multiple arrays
else {

/*this will run once usually, unless its multiple arrays
but thats taken care of in the loop */
foreach($value as $key=>$val)
{
if(is_array($val))
{
foreach($value as $key=>$val) {

if(is_array($val)) {
self::printArrayObj($val, $key);
}
else
{
} else {
if(is_int($key)) $key = '';
else $key .= ' - ';

echo $key.$val.'<br />';
}
}
}
}
else
{
} else {
echo $value.'<br />';
}
}
Expand All @@ -247,8 +239,8 @@ public static function Show()
echo '</div>';
}

public static function printArrayObj($array, $title='')
{
public static function printArrayObj($array, $title='') {
if(count($array) == 0) return;

//if($title!='') $title_header = 'Variable name: '.$title;
Expand All @@ -263,45 +255,38 @@ public static function printArrayObj($array, $title='')
onClick="codon_debug_toggle(\'showdebug'.$id.'\');">'.$title.' (click to expand)</div>
<div class="codon_debug_text" id="showdebug'.$id.'" style="display: none;">';

foreach($array as $key => $value)
{
if(is_array($value) || is_object($value))
{
foreach($array as $key => $value) {
if(is_array($value) || is_object($value)) {
self::printArrayObj($value, '$'.$key);
}
else
{

} else {
echo '[<strong>'.$key.'</strong>] = "'.$value.'" <br />';
}
}

echo '</div>';
}

public static function showBacktrace()
{
public static function showBacktrace() {
$i = 1;

foreach(self::$bt as $section)
{
foreach(self::$bt as $section) {
echo '<strong>'. $i++ . '. '
.$section['class'].$section['type'].$section['function']
.'</strong>'
.' ('.str_replace(SITE_ROOT,'',$section['file']) . ')<br />';

$args = count($section['args']);

if($args > 0)
{
if($args > 0) {
self::printArrayObj($section['args'], $args.' arguments were passed to this function:');
echo '<br />';
}
}
}

public static function showOrigin()
{
public static function showOrigin() {
self::$bt = array_reverse(self::$bt, true);
$called = array_pop(self::$bt);

Expand Down
2 changes: 1 addition & 1 deletion core/version
@@ -1 +1 @@
951
952
6 changes: 3 additions & 3 deletions install/hashlist
Expand Up @@ -136,7 +136,7 @@ e72bc1ba04d51a5882b4d18e1b1f57e7 *./core/bootstrap.inc.php
c632a11265dcd1b4747112b12b89959f *./core/codon.config.php
3329577ddb4c1cdaba833209d75f7f70 *./core/classes/Lang.class.php
c1e6bb7c33856c0723f1139ccf20ad9f *./core/classes/CodonData.class.php
2ffa40e385f75f2020b6ec3b6ea7c0ae *./core/classes/Debug.class.php
fbe9cf582628a031e829b088b751a23a *./core/classes/Debug.class.php
5fc9915e310b99c58b2c389a942c3681 *./core/classes/Vars.class.php
957e4ee1ab6724dd1a768f207cd2b5d3 *./core/classes/CodonEvent.class.php
c8a22eae5b17b5d8b7deed4aae2e0e5a *./core/classes/CodonCache.class.php
Expand Down Expand Up @@ -178,7 +178,7 @@ c75e1f34d88a90272e8b4f665e62ea3d *./core/modules/Frontpage/Frontpage.php
6b946047c6c072b85d88792409097feb *./core/modules/ACARS/fspax.php
453759d7d7df9787757062bc85ce6589 *./core/modules/ACARS/ACARS.php
52d9eb7db618baf62c63b03a24e6ecad *./core/modules/ACARS/xacars.php
66bd67b4963e9d270986ba68768fd4d8 *./core/modules/FSFK/FSFK.php
205767947163b13e6062aa4ac9f9b8e6 *./core/modules/FSFK/FSFK.php
8882059eb244446de66944aa53df28d3 *./core/modules/FrontBids/FrontBids.php
a5e67fddae9c3f77e262cee30771db05 *./core/modules/Logout/Logout.php
510f2fb052b23549aa8b769831a6f846 *./core/modules/PIREPS/PIREPS.php
Expand Down Expand Up @@ -227,7 +227,7 @@ becefb73aa708db1993bb70e7c0c2027 *./admin/templates/sidebar_pending.tpl
83ec50eca4e7956a9ce75d8c5a1c7f4e *./admin/templates/logs_index.tpl
6a92e88ff594995e6e68836087b40e7e *./admin/templates/news_additem.tpl
8d713e47e580563de7940d8919d71b82 *./admin/templates/ops_aircraftlist.tpl
ddacd7f35fd18c6db3cf8a60694b629c *./admin/templates/pirep_edit.tpl
5b9533e9f499f30df8f8872aff34f799 *./admin/templates/pirep_edit.tpl
d074c0e9c23845e55f9a2b3dcb6063f2 *./admin/templates/settings_addcustomfield.tpl
9654ff17c3533ab43b5e6ab4bac582c0 *./admin/templates/ops_airportlist.tpl
713a3b7f8bc9f3976664dfa43aba820a *./admin/templates/sidebar_pirepfields.tpl
Expand Down
12 changes: 6 additions & 6 deletions install/structure.xml
Expand Up @@ -79,7 +79,7 @@
<field Field="chartlink" Type="text" Null="NO" Key="" Extra="" />
<key Table="phpvms_airports" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="id" Collation="A" Cardinality="85" Null="" Index_type="BTREE" Comment="" />
<key Table="phpvms_airports" Non_unique="0" Key_name="icao" Seq_in_index="1" Column_name="icao" Collation="A" Cardinality="85" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_airports" Engine="InnoDB" Version="10" Row_format="Compact" Rows="553" Avg_row_length="118" Data_length="65536" Max_data_length="0" Index_length="16384" Data_free="11534336" Auto_increment="1507" Create_time="2011-01-18 00:43:18" Collation="latin1_swedish_ci" Create_options="" Comment="" />
<options Name="phpvms_airports" Engine="InnoDB" Version="10" Row_format="Compact" Rows="85" Avg_row_length="771" Data_length="65536" Max_data_length="0" Index_length="16384" Data_free="11534336" Auto_increment="1507" Create_time="2011-01-18 00:43:18" Collation="latin1_swedish_ci" Create_options="" Comment="" />
</table_structure>
<table_structure name="phpvms_awards">
<field Field="awardid" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
Expand Down Expand Up @@ -310,8 +310,8 @@
<field Field="source" Type="varchar(25)" Null="NO" Key="" Extra="" />
<field Field="exported" Type="tinyint(4)" Null="NO" Key="" Extra="" />
<field Field="rawdata" Type="blob" Null="NO" Key="" Extra="" />
<key Table="phpvms_pireps" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="pirepid" Collation="A" Cardinality="176" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_pireps" Engine="InnoDB" Version="10" Row_format="Compact" Rows="121" Avg_row_length="1895" Data_length="229376" Max_data_length="0" Index_length="0" Data_free="11534336" Auto_increment="518" Create_time="2011-01-18 00:43:18" Collation="latin1_swedish_ci" Create_options="" Comment="" />
<key Table="phpvms_pireps" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="pirepid" Collation="A" Cardinality="189" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_pireps" Engine="InnoDB" Version="10" Row_format="Compact" Rows="197" Avg_row_length="1164" Data_length="229376" Max_data_length="0" Index_length="0" Data_free="11534336" Auto_increment="518" Create_time="2011-01-18 00:43:18" Collation="latin1_swedish_ci" Create_options="" Comment="" />
</table_structure>
<table_structure name="phpvms_pirepvalues">
<field Field="id" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
Expand Down Expand Up @@ -369,8 +369,8 @@
<field Field="pilotid" Type="int(11)" Null="NO" Key="" Extra="" />
<field Field="ipaddress" Type="varchar(25)" Null="NO" Key="" Extra="" />
<field Field="logintime" Type="datetime" Null="NO" Key="" Extra="" />
<key Table="phpvms_sessions" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="id" Collation="A" Cardinality="25" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_sessions" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="25" Avg_row_length="45" Data_length="42228" Max_data_length="281474976710655" Index_length="15360" Data_free="41100" Auto_increment="5552" Create_time="2009-10-31 20:05:09" Update_time="2011-02-16 14:54:50" Check_time="2010-04-20 19:10:29" Collation="latin1_swedish_ci" Create_options="" Comment="" />
<key Table="phpvms_sessions" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="id" Collation="A" Cardinality="44" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_sessions" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="44" Avg_row_length="44" Data_length="42228" Max_data_length="281474976710655" Index_length="15360" Data_free="40260" Auto_increment="5580" Create_time="2009-10-31 20:05:09" Update_time="2011-02-20 12:25:05" Check_time="2010-04-20 19:10:29" Collation="latin1_swedish_ci" Create_options="" Comment="" />
</table_structure>
<table_structure name="phpvms_settings">
<field Field="id" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" />
Expand All @@ -389,7 +389,7 @@
<field Field="lastupdate" Type="datetime" Null="NO" Key="" Extra="" />
<key Table="phpvms_updates" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="id" Collation="A" Cardinality="9" Null="" Index_type="BTREE" Comment="" />
<key Table="phpvms_updates" Non_unique="1" Key_name="name" Seq_in_index="1" Column_name="name" Collation="A" Cardinality="9" Null="" Index_type="BTREE" Comment="" />
<options Name="phpvms_updates" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="9" Avg_row_length="33" Data_length="300" Max_data_length="281474976710655" Index_length="3072" Data_free="0" Auto_increment="10" Create_time="2009-12-20 17:51:29" Update_time="2011-02-16 13:13:57" Check_time="2010-04-20 19:10:29" Collation="latin1_swedish_ci" Create_options="" Comment="" />
<options Name="phpvms_updates" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="9" Avg_row_length="33" Data_length="300" Max_data_length="281474976710655" Index_length="3072" Data_free="0" Auto_increment="10" Create_time="2009-12-20 17:51:29" Update_time="2011-02-20 12:24:03" Check_time="2010-04-20 19:10:29" Collation="latin1_swedish_ci" Create_options="" Comment="" />
</table_structure>
</database>
</mysqldump>

0 comments on commit 51de842

Please sign in to comment.