当前位置: 首页>>代码示例>>PHP>>正文


PHP Color::find_all方法代码示例

本文整理汇总了PHP中Color::find_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Color::find_all方法的具体用法?PHP Color::find_all怎么用?PHP Color::find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Color的用法示例。


在下文中一共展示了Color::find_all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CONCAT

$sql = "SELECT `b`.`breed_wk`, `b`.`pet_type_wk`, CONCAT(`p`.`name`,' - ',`b`.`name`) AS `name`, ";
$sql .= "`b`.`create_dt` FROM `breed` AS `b` INNER JOIN `pet_type` AS `p` ON `p`.`pet_type_wk` = `b`.`pet_type_wk` ";
$sql .= "WHERE `b`.`breed_wk` > 0 ORDER BY `p`.`name` ASC, `b`.`name` ASC";
$to_display = Breed::find_by_sql($sql);
//loop through all items
foreach ($to_display as $value) {
    echo "<option value=\"" . $value->breed_wk . "\"";
    echo ">" . $value->name . "</option>";
}
?>
			   </select></div>
		Color:  <br><div class="form-group"><select name="color" class="form-control">
					<option value="0">Undefined</option>
				  <?php 
//we need to display all available records
$to_display = Color::find_all();
//loop through all items
foreach ($to_display as $value) {
    echo "<option value=\"" . $value->color_wk . "\"";
    echo ">" . $value->name . "</option>";
}
?>
			   </select></div>
		Status:  <br><div class="form-group"><select name="status" class="form-control">
					<option value="0" >Undefined</option>
				  <?php 
//we need to display all available records
$to_display = Status::find_all();
//loop through all items
foreach ($to_display as $value) {
    echo "<option value=\"" . $value->status_wk . "\"";
开发者ID:onielmartinjr,项目名称:cen4010,代码行数:31,代码来源:add_pet.php

示例2: redirect_head

            }
        }
    }
    // redirect for colors(s) were updated but no new color added
    redirect_head(ROOT_URL . "admin/manage_colors.php");
}
//header template
require_once "../requires/template/header.php";
?>
	
	<section id="registration" class="container"><form class="center" role="form" action="<?php 
echo file_name_with_get();
?>
" method="post" ><fieldset class="registration-form">
		<?php 
$colors_array = Color::find_all();
$count = count($colors_array);
for ($i = 0; $i < $count; $i++) {
    echo "<div class=\"form-group\"><input type=\"text\" class=\"form-control\" name=\"" . $i . "\" value=\"" . $colors_array[$i]->name . "\">";
    echo "<a href=\"manage_colors.php?delete_color_wk=" . $colors_array[$i]->color_wk . "\">Delete</a> </div>";
}
?>
		<br>
		Add new color:<input type="text" name="new_color" class="form-control" value=""><br />
		<div class="form-group"><button type="submit" value="submit" name="submit" class="btn btn-success btn-md btn-block">Submit</button></div>
	</fieldset></form></section>
	
	
<?php 
//this is a special instance, remove the message, if it's set since we set the messages in this form
$session->unset_variable('message');
开发者ID:onielmartinjr,项目名称:cen4010,代码行数:31,代码来源:manage_colors.php


注:本文中的Color::find_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。