foreach ($rows as $key=> $value) {
$img = $value->logo_name;
}
*/
$grp_reslt2 = $wpdb->get_results(“SELECT group_id FROM wp_groups_user_group WHERE (user_id = ‘”. $id_test .”‘)”);
foreach ($grp_reslt2 as $key=> $value) {
$group_logo_id = $value->group_id;
}
$grp_reslt3 = $wpdb->get_results(“SELECT logo_name,group_name FROM groups WHERE (id = ‘”. $group_logo_id .”‘)”);
$chck=0;
foreach ($grp_reslt3 as $key=> $value) {
$img = $value->logo_name;
$name1 = $value->group_name;
$chck=1;
[/php]
[php]
}
if($chck!=1)
{
$grp_reslt4 = $wpdb->get_results(“SELECT user_login FROM wp_users WHERE (id = ‘”. $id_test .”‘)”);
foreach ($grp_reslt4 as $key=> $value) {
$user_name = $value->user_login;
}
$grp_reslt5 = $wpdb->get_results(“SELECT logo_name,group_name FROM groups WHERE (sub_admin_name = ‘$user_name’)”);
foreach ($grp_reslt5 as $key=> $value) {
$im = $value->logo_name;
$chck=2; $name=$value->group_name;
if($im!=”) { [/php]
[php] }
}
}
if($chck!=2){
$grp_reslt6 = $wpdb->get_results(“SELECT user_group_id FROM wp_users WHERE (id = ‘”. $id_test .”‘)”);
foreach ($grp_reslt6 as $key=> $value) {
$user_group_id = $value->user_group_id;
}
$grp_reslt7 = $wpdb->get_results(“SELECT logo_name,group_name FROM groups WHERE (id = ‘$user_group_id’)”);
foreach ($grp_reslt7 as $key=> $value) {
$im_user = $value->logo_name;
$name_group=$value->group_name;
if($im_user!=”) { [/php]
[php] }
}
}
[/php] ELSE {
$today = GETDATE(MKTIME(0,0,0,$monthToShow,1,$yearToShow));
}
// get first and last days of the month
$firstDay = GETDATE(MKTIME(0,0,0,$monthToShow,1,$yearToShow));
$lastDay = GETDATE(MKTIME(0,0,0,$monthToShow+1,0,$yearToShow)); //trick! day = 0
//echo date(“y-m-d”,strtotime($monthToShow.”-01″.$yearToShow));
//echo $yearToShow.”-“.str_pad($monthToShow,2,0, STR_PAD_LEFT).”-01″;
$previous = strtotime(“-1 month”,strtotime($yearToShow.”-“.str_pad($monthToShow,2,0, STR_PAD_LEFT).”-01″)) ;
$next = strtotime(“+1 month”,strtotime($yearToShow.”-“.str_pad($monthToShow,2,0, STR_PAD_LEFT).”-01″)) ;
// Create a table with the necessary header information
ECHO ‘
‘.date(“F”,$previous).’ | ‘.$today[‘month’].” “.$today[‘year’].’ | ‘.date(“F”,$next).’ | ||||
---|---|---|---|---|---|---|
‘.$dayText[$firstDayOfWeek + $i].’ | ||||||
‘.add_day($actday++,$monthToShow,$yearToShow).’
|
||||||
‘.add_day($actday++,$monthToShow,$yearToShow).’
|
||||||
‘.add_day($actday++,$monthToShow,$yearToShow).’
|
‘;
}
function add_day($actday = 0,$monthToShow,$yearToShow)
{
$for_date = $yearToShow.’-‘.str_pad($monthToShow,2,0,STR_PAD_LEFT).’-‘.str_pad($actday,2,0,STR_PAD_LEFT);
$return = “
“;
if(time()>= strtotime(str_pad($actday,2,0,STR_PAD_LEFT).’-‘.str_pad($monthToShow,2,0,STR_PAD_LEFT).’-‘.$yearToShow))
{
$imgs = get_bloginfo(‘stylesheet_directory’);
$return .= “
“;
$return .= “
“;
}
else
{
$return .= “
“;
$return .= “
“;
}
return $return;
}
if(isset($_REQUEST[‘date’]))
{
$thisDay = explode(‘-‘,$_REQUEST[‘date’]);
$startMonth = $thisDay[0];
$startYear = $thisDay[2];
}
else
{
$thisDay = GETDATE();
$startMonth = $thisDay[‘mon’];
$startYear = $thisDay[‘year’];
}
ECHO ‘
‘;
ECHO ‘
‘;
[/php]