-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathautogen_code.php
67 lines (39 loc) · 1.1 KB
/
autogen_code.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//si vous avez beaucoup de champ cette fonction facilite
//la generation des nom de champ
function autogen()
{
$mysql_query="show columns from users";
$query=$this->_custom_query($mysql_query);
/*
foreach ($query->result() as $row) {
$column_name= $row->Field;
if($column_name!="id") {
//echo $column_name."<br>";
echo'$data[\'item_title\'] = $this->input->post(\''.$column_name.'\',TRUE);<br>';
}
}
echo"<hr>";
foreach ($query->result() as $row) {
$column_name= $row->Field;
if($column_name!="id") {
//echo $column_name."<br>";
echo' $data[\''.$column_name.'\'] = $row->'.$column_name.';<br>';
}
}
echo"<hr>";
foreach ($query->result() as $row) {
$column_name= $row->Field;
if($column_name!="id") {
//echo $column_name."<br>";
$var = '<div class="control-group">
<label class="control-label" for="typeahead">'.ucfirst($column_name).'</label>
<div class="controls">
<input type="text" class="span6" name="'.$column_name.'" value="<?= $'.$column_name.'?>">
</div>
</div>';
echo htmlentities($var);
echo "<br><br>";
}
}
*/
}