// ******************************************************************* // admin/insert_category.php // ******************************************************************* include("../include/config.php"); include("../include/functions.php"); include("../include/common.php"); $language = $gl["Language"]; include("../include/lang/$language.php"); include("../include/session.php"); session_start(); ?>
|
if(isset($PID)){
$num_rows = count($Category);
for($i = 0;$i < $num_rows;++$i){
if(strlen($Category[$i]) > 0){
if(strlen($AllowSites[$i]) < 1){
$AllowSites[$i] = "N";
}
if(strlen($ShowSiteCount[$i]) < 1){
$ShowSiteCount[$i] = "N";
}
$insert = sql_query("
insert into $tb_categories (
ID,
Category,
PID,
Children,
TopChildren,
AllowSites,
ShowSiteCount,
Description
) values (
'',
'$Category[$i]',
'$PID[$i]',
'$Children[$i]',
'$TopChildren[$i]',
'$AllowSites[$i]',
'$ShowSiteCount[$i]',
'$Description[$i]'
)
");
echo "Category " . $Category[$i];
echo " has been added. \n"; } } } else { $num_rows = count($Category); for($i = 0;$i < $num_rows;++$i){ if(strlen($Category[$i]) > 0){ if(strlen($AllowSites[$i]) < 1){ $AllowSites[$i] = "N"; } if(strlen($ShowSiteCount[$i]) < 1){ $ShowSiteCount[$i] = "N"; } $insert = sql_query(" insert into $tb_categories ( ID, Category, PID, Children, TopChildren, AllowSites, ShowSiteCount, Description ) values ( '', '$Category[$i]', '0', '$Children[$i]', '$TopChildren[$i]', '$AllowSites[$i]', '$ShowSiteCount[$i]', '$Description[$i]' ) "); echo "Category ".$Category[$i]." has been added. \n"; } } } ?> |
||
|
||