當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Data::GetRowCount方法代碼示例

本文整理匯總了PHP中Data::GetRowCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP Data::GetRowCount方法的具體用法?PHP Data::GetRowCount怎麽用?PHP Data::GetRowCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Data的用法示例。


在下文中一共展示了Data::GetRowCount方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

    <?php 
}
?>
  </select>

  <table>
    <tr>
      <th>Options</th>
      <th>#</th>
      <th>Fraction In.</th>
      <th>Decimal In.</th>
      <th>Millimeters</th>
    </tr>
<?php 
if (Data::GetRowCount('current_material') > 0) {
    for ($n = 0; $n < Data::GetRowCount('current_material'); $n++) {
        ?>
    <tr>
    <td style="text-align: center"><input title="Remove size from this material" type=button value="-" onclick="NotReady();"></td>
    <td><?php 
        echo $n + 1;
        ?>
</td>
    <td><?php 
        echo Data::Get('current_material', 'fraction_in', $n);
        ?>
</td>
    <td><?php 
        echo Data::Get('current_material', 'decimal_in', $n);
        ?>
</td>
開發者ID:donsmoore,項目名稱:ballcalc,代碼行數:31,代碼來源:view_sizes_materials.php

示例2:

  <br><strong>Materials</strong><br>
  <table>
    <tr>
      <th> Options </th>
      <th> # </th>
      <th> Material </th>
      <th> Lbs in3 </th>
      <th> Kg m3 </th>
      <th> balls_per_ounce </th>
      <th> balls_per_pound </th>
      <th> balls_per_kilo </th>
      <th> page_link </th>
      <th style="background-color: white;"></th>
    </tr>
<?php 
for ($n = 0; $n < Data::GetRowCount('all_materials'); $n++) {
    ?>
    <tr>
    <td>
      <input id="id_<?php 
    echo str_pad(Data::Get('all_materials', 'id', $n), 2, '0', STR_PAD_LEFT);
    ?>
_edit" type=button title="Edit material" value="Edit" onclick="EditMaterial('<?php 
    echo str_pad(Data::Get('all_materials', 'id', $n), 2, '0', STR_PAD_LEFT);
    ?>
');" style="display: inline">
    </td>
    <td><?php 
    echo $n + 1;
    ?>
</td>
開發者ID:donsmoore,項目名稱:ballcalc,代碼行數:31,代碼來源:view_materials.php

示例3: Setup

 public function Setup($o)
 {
     $this->o =& $o;
     Debug::Set('Page setup initiated');
     if ($this->o->GetQs('view') == 'sizes' && $this->o->GetQs('action') == 'save') {
         Sql::SetSql(" UPDATE ron_size_list ", 1);
         Sql::SetSql(" SET fraction_in = '" . $this->o->GetQs('fraction_in') . "' , ", 1);
         Sql::SetSql(" decimal_in = '" . $this->o->GetQs('decimal_in') . "' , ", 1);
         Sql::SetSql(" millimeters = '" . $this->o->GetQs('millimeters') . "' , ", 1);
         Sql::SetSql(" one_ball_weight_ounce = '" . $this->o->GetQs('one_ball_weight_ounce') . "' , ", 1);
         Sql::SetSql(" one_ball_weight_gram = '" . $this->o->GetQs('one_ball_weight_gram') . "' ", 1);
         Sql::SetSql(" WHERE id = " . $this->o->GetQs('size_id'), 1);
         Sql::SetSql(" ; ", 1);
         Sql::Execute();
         // hack, lol. Need SetSqlNum and SetSqlStr, then add NULL support
         Sql::SetSql(" UPDATE ron_size_list SET fraction_in = NULL            WHERE fraction_in = '' ; ", 1);
         Sql::SetSql(" UPDATE ron_size_list SET decimal_in = NULL             WHERE decimal_in = '' ; ", 1);
         Sql::SetSql(" UPDATE ron_size_list SET millimeters = NULL            WHERE millimeters = '' ; ", 1);
         Sql::SetSql(" UPDATE ron_size_list SET one_ball_weight_ounce = NULL  WHERE one_ball_weight_ounce = 0 ; ", 1);
         Sql::SetSql(" UPDATE ron_size_list SET one_ball_weight_gram = NULL   WHERE one_ball_weight_gram = 0 ; ", 1);
         Sql::Execute();
         header('location: ?index.php&page=Admin&view=sizes');
     }
     if ($this->o->GetQs('view') == 'sizes_materials' && $this->o->GetQs('action') == 'add' && $this->o->GetQs('material', 0) > 0 && $this->o->GetQs('size', 0) > 0) {
         Sql::SetQueryName('already_there');
         Sql::SetSql(' SELECT * ', 1);
         Sql::SetSql(' FROM ron_materials_by_size MBS ', 1);
         Sql::SetSql(' WHERE MBS.material_id = ' . $this->o->GetQs('material', 0), 1);
         Sql::SetSql(' AND MBS.size_id = ' . $this->o->GetQs('size', 0), 1);
         Sql::SetSql(' ORDER BY 1 ASC ', 1);
         Sql::SetSql(' ; ', 1);
         Sql::Execute();
         if (Data::GetRowCount('already_there') > 0) {
             header('location: ?index.php&page=Admin&view=sizes_materials&material=' . $this->o->GetQs('material', 0));
             // TODO: redirect ALREADY THERE...
         } else {
             Sql::SetSql(' INSERT INTO ron_materials_by_size ( material_id, size_id ) VALUES ( ' . $this->o->GetQs('material', 0) . ' , ' . $this->o->GetQs('size', 0) . ') ; ');
             Sql::Execute();
             header('location: ?index.php&page=Admin&view=sizes_materials&material=' . $this->o->GetQs('material', 0));
             // TODO: redirect ADDED RECORD
         }
     }
     Sql::SetQueryName('all_sizes');
     Sql::ExecuteSql(' SELECT * FROM ron_size_list ORDER BY millimeters ASC ; ');
     Sql::SetQueryName('all_materials');
     Sql::ExecuteSql(' SELECT * FROM ron_material_list ORDER BY id ASC ; ');
     if ($this->o->GetQs('view') == 'materials_sizes') {
         Sql::SetQueryName('current_size');
         Sql::SetSql(' SELECT M.material ', 1);
         Sql::SetSql(' FROM ron_materials_by_size S ', 1);
         Sql::SetSql(' LEFT JOIN ron_material_list M ON M.id = S.material_id ', 1);
         Sql::SetSql(' WHERE S.size_id = ' . $this->o->GetQs('size', 0), 1);
         Sql::SetSql(' ORDER BY M.material ASC ', 1);
         Sql::SetSql(' ; ', 1);
         Sql::Execute();
     }
     if ($this->o->GetQs('view') == 'sizes_materials') {
         Sql::SetQueryName('current_material');
         Sql::SetSql(' SELECT SL.fraction_in, SL.decimal_in, SL.millimeters ', 1);
         Sql::SetSql(' FROM ron_size_list SL  ', 1);
         Sql::SetSql(' LEFT JOIN ron_materials_by_size MBS ON SL.id = MBS.size_id ', 1);
         Sql::SetSql(' WHERE MBS.material_id = ' . $this->o->GetQs('material', 0), 1);
         Sql::SetSql(' ORDER BY SL.millimeters ASC ', 1);
         Sql::SetSql(' ; ', 1);
         Sql::Execute();
     }
 }
開發者ID:donsmoore,項目名稱:ballcalc,代碼行數:67,代碼來源:classes.php

示例4:

echo Data::GetData('all_sizes', 'millimeters', 'id', $this->GetQs('size'));
echo Data::GetData('all_sizes', 'millimeters', 'id', $this->GetQs('size')) ? ' mm' : '&nbsp;';
?>
    </div>

    <div style="border: 0px solid black; clear: both">
      <br>&nbsp;&nbsp;Materials Available for size: <?php 
echo Data::GetData('all_sizes', 'fraction_in', 'id', $this->GetQs('size'));
?>
&nbsp;<br><br>

      <?php 
if (Data::GetRowCount('current_size') > 0) {
    ?>
      <?php 
    for ($n = 0; $n < Data::GetRowCount('current_size'); $n++) {
        ?>
          &nbsp;&nbsp;<a href="<?php 
        echo Data::Get('current_size', 'page_link', $n);
        ?>
"><?php 
        echo Data::Get('current_size', 'material', $n);
        ?>
</a><br>
      <?php 
    }
    ?>
      <?php 
} else {
    ?>
        &nbsp;&nbsp;None found for size
開發者ID:donsmoore,項目名稱:ballcalc,代碼行數:31,代碼來源:view_default.php

示例5:

<!-- ============ START Sizes ============ -->
  <br><strong>Sizes</strong><br>
    <table>
    <tr>
      <th>Options</th>
      <th>#</th>
      <th>Fraction In.</th>
      <th>Decimal In.</th>
      <th>Millimeters</th>
      <th>one_ball_weight_ounce</th>
      <th>one_ball_weight_gram</th>
      <th style="background-color: white;"></th>
    </tr>
<?php 
for ($n = 0; $n < Data::GetRowCount('all_sizes'); $n++) {
    ?>
    <tr>
    <td>
      <input id="id_<?php 
    echo str_pad(Data::Get('all_sizes', 'id', $n), 2, '0', STR_PAD_LEFT);
    ?>
_edit" type=button title="Edit size" value="Edit" onclick="EditSize('<?php 
    echo str_pad(Data::Get('all_sizes', 'id', $n), 2, '0', STR_PAD_LEFT);
    ?>
');" style="display: inline">
    </td>
    <td><?php 
    echo $n + 1;
    ?>
</td>
開發者ID:donsmoore,項目名稱:ballcalc,代碼行數:30,代碼來源:view_sizes.php


注:本文中的Data::GetRowCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。