404 Error Page

404

Oops! Page not found.

We could not find the page you were looking for. Meanwhile, you may return to dashboard or try using the search form.

GENERATED CURD'; echo 'Create Code'; echo 'Listing Code'; echo 'Edit Form Code'; echo 'Controller Code'; } else echo "Table not defined as table=%tablename% in querystring"; } else echo "CURD option 'yes' is needed in querystring"; } ?>
\n
\n
\n
\n
\n

\n
\n
\n
    \n
  1. \">Dashboard
  2. \n
  3. \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n "; $commandText .= "db->query(\"select * from $tableName where status=1\")->result(); ?>\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $tableFileds = $ci->db->field_data($tableName); foreach ($tableFileds as $tableFiled) { $fieldnamelabel = ucwords(str_replace("_", " ", $tableFiled->name)); $commandText .= "\n"; } $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= ""; $commandText .= "\n"; foreach ($tableFileds as $tableFiled) { $commandText .= "\n"; } $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= "\n"; $commandText .= "
Action
" . $tableFiled->name . "; ?>uri->segment(1).\"/\".\$this->uri->segment(2).\"/edit/\$id\"); ?>\" class=\"btn btn-success btn-xs\">Edit );\" class=\"btn btn-success btn-xs\">Delete
\n"; $commandText .= ""; $commandText .= "
\n
\n
\n
\n
\n
\n\n"; return $commandText; } function createCODE($tableName) { $ci = &get_instance(); $commandText = "
\n
\n
\n
\n
\n

\n
\n
\n
    \n
  1. \">Dashboard
  2. \n
  3. \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n "; $commandText .= "
\n\t"; $tableFileds = $ci->db->field_data($tableName); unset($tableFileds[0]); foreach ($tableFileds as $tableFiled) { if ($tableFiled->name != "created_on" && $tableFiled->name != "created_by" && $tableFiled->name != "status") { $commandText .= "
\n\t\n\t
"; if (strpos($tableFiled->name, 'desc') !== false) { $commandText .= curd_createTextArea($tableFiled->name) . "\n\t"; } else if (strpos($tableFiled->name, 'alias') !== false) { //$commandText.=curd_createTextArea($tableFiled->name); } else if (strpos($tableFiled->name, 'remarks') !== false) { $commandText .= curd_createTextArea($tableFiled->name) . "\n\t"; } else { $commandText .= curd_createTextField($tableFiled->name) . "\n\t"; } $commandText .= "\n\t
\n\t\n\t
\n\t"; } } $commandText .= " "; $commandText .= "\n\t
"; $commandText .= "
\n
\n
\n
\n
\n
\n
\n"; return $commandText; } function createSaveCode($tableName) { $t = explode("_", $tableName); $t = $t[1]; $ci = &get_instance(); $commandText = "if(isset(\$_POST['submit'])){\n"; $commandText .= "\$TableData=array(\n"; $tableFileds = $ci->db->field_data($tableName); unset($tableFileds['name=>created_on']); unset($tableFileds['created_by']); unset($tableFileds['status']); unset($tableFileds[0]); $title = ''; $alias = ''; foreach ($tableFileds as $tableFiled) { if ($title == '') $title = (strpos($tableFiled->name, '_name') != 0) ? $tableFiled->name : ''; if ($alias == '') $alias = (strpos($tableFiled->name, '_alias') != 0) ? $tableFiled->name : ''; if ($tableFiled->name == 'created_by') $commandText .= "'" . $tableFiled->name . "'=>'admin',\n"; elseif ($tableFiled->name == 'created_on') $commandText .= "'" . $tableFiled->name . "'=>date('Y-m-d H:i:s'),\n"; elseif ($tableFiled->name == 'status') $commandText .= "'" . $tableFiled->name . "'=>1,\n"; elseif ($tableFiled->name == $alias) $commandText .= "'" . $tableFiled->name . "'=>getalias(\$_POST['$title'], '$tableFiled->name', '$tableName'),\n"; else $commandText .= "'" . $tableFiled->name . "'=>filter_var(\$_POST['$tableFiled->name']),\n"; } $commandText .= "); \n"; $commandText .= "\$this->db->insert('$tableName',\$TableData);\n"; $commandText .= "redirect(\"master/$t\");\n"; $commandText .= "}"; return $commandText; } function editCODE($tableName) { $ci = &get_instance(); $commandText = "
\n
\n
\n
\n
\n

\n
\n
\n
    \n
  1. \">Dashboard
  2. \n
  3. \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n "; $tableFileds = $ci->db->field_data($tableName); $firstField = $tableFileds[0]->name; $commandText .= "uri->segment(4); \$TableData=\$this->db->query(\"select * from $tableName where $firstField =\\\"\$id\\\" \")->row(); ?>\n"; $commandText .= "
\n\t"; unset($tableFileds[0]); foreach ($tableFileds as $tableFiled) { if ($tableFiled->name != "created_on" && $tableFiled->name != "created_by" && $tableFiled->name != "status") { $commandText .= "
\n\t\n\t
\n\t "; if (strpos($tableFiled->name, 'desc') !== false) { $commandText .= curd_createTextArea($tableFiled->name, "$tableFiled->name; ?>") . "\n\t"; } else if (strpos($tableFiled->name, 'alias') !== false) { //$commandText.=curd_createTextArea($tableFiled->name); } else if (strpos($tableFiled->name, 'remarks') !== false) { $commandText .= curd_createTextArea($tableFiled->name, "$tableFiled->name; ?>") . "\n\t"; } else { $commandText .= curd_createTextField($tableFiled->name, "$tableFiled->name; ?>") . "\n\t"; } $commandText .= "\n\t
\n\t\n\t
\n\t"; } } $commandText .= " "; $commandText .= "\n\t
"; $commandText .= "
\n
\n
\n
\n
\n
\n
\n"; return $commandText; } function editSaveCode($tableName) { $ci = &get_instance(); $t = explode("_", $tableName); $t = $t[1]; $commandText = "if(isset(\$_POST['submit'])){\n"; $commandText .= "\$id=\$this->uri->segment(4);\n"; $commandText .= "\$TableData=array(\n"; $tableFileds = $ci->db->field_data($tableName); $index_id = $tableFileds[0]->name; unset($tableFileds['name=>created_on']); unset($tableFileds['created_by']); unset($tableFileds['status']); unset($tableFileds[0]); $title = ''; $alias = ''; foreach ($tableFileds as $tableFiled) { if ($title == '') $title = (strpos($tableFiled->name, '_name') != 0) ? $tableFiled->name : ''; if ($alias == '') $alias = (strpos($tableFiled->name, '_alias') != 0) ? $tableFiled->name : ''; if ($tableFiled->name == 'created_by') $commandText .= "'" . $tableFiled->name . "'=>'admin',\n"; elseif ($tableFiled->name == 'created_on') $commandText .= "'" . $tableFiled->name . "'=>date('Y-m-d H:i:s'),\n"; elseif ($tableFiled->name == 'status') $commandText .= "'" . $tableFiled->name . "'=>1,\n"; elseif ($tableFiled->name == $alias) $commandText .= "'" . $tableFiled->name . "'=>getalias(\$_POST['$title'], '$tableFiled->name', '$tableName'),\n"; else $commandText .= "'" . $tableFiled->name . "'=>filter_var(\$_POST['$tableFiled->name']),\n"; } $commandText .= "); \n"; $commandText .= "\$this->db->where('$index_id',\$id);\n"; $commandText .= "\$this->db->update('$tableName',\$TableData);\n"; $commandText .= "redirect(\"master/$t\");\n"; $commandText .= "}"; return $commandText; } function deleteSaveCode($tableName) { $t = explode("_", $tableName); $t = $t[1]; $commandText = ""; $ci = &get_instance(); $tableFileds = $ci->db->field_data($tableName); $index_id = $tableFileds[0]->name; $commandText .= "\$id=\$this->uri->segment(4);\n"; $commandText .= "\$this->db->where('$index_id',\$id);\n"; $commandText .= "\$this->db->delete('$tableName');\n"; $commandText .= "redirect(\"master/$t\");\n"; return $commandText; } function curd_createTextField($fieldname, $defaultValue = "") { $fieldnamelabel = ucwords(str_replace("_", " ", $fieldname)); $t = "
"; if (strpos($fieldname, 'email') !== false) { $type = "email"; } else if (strpos($fieldname, 'phone') !== false) { $type = "tel"; } else if (strpos($fieldname, 'mobile') !== false) { $type = "tel"; } else { $type = "text"; } $t .= "
"; return $t; } function curd_createTextArea($fieldname, $defaultValue = "") { $fieldnamelabel = ucwords(str_replace("_", " ", $fieldname)); $t = "
\n\t \n\t"; $t .= "\n\t
"; return $t; } function controllerCode($tableName) { $t = explode("_", $tableName); $t = $t[1]; $ClassName = ucfirst($t); $commandText = "session;\n \$data['pageTitle']=\"$tableName - CHANGE THIS TO APPROPRIATE TITLE\";\n switch(\$alias) {\n"; $commandText .= "case 'add':\n"; $commandText .= createSaveCode($tableName); $commandText .= "\t\tloadView(\"$t/add\",\$data);\n"; $commandText .= "\t break;\n"; $commandText .= "case 'edit':\n"; $commandText .= editSaveCode($tableName); $commandText .= "\t\tloadView(\"$t/edit\",\$data);\n"; $commandText .= "\t break;\n"; $commandText .= "case 'delete':\n"; $commandText .= deleteSaveCode($tableName); $commandText .= "\t break;\n"; $commandText .= "default:\n"; $commandText .= "loadView(\"$t/list\",\$data);\n"; $commandText .= "}\n}\n}\n?>"; return $commandText; } ?>