admin管理员组文章数量:1410682
[insert_php]
global $wpdb;
$current_user = wp_get_current_user();
$emailAddress = $current_user->user_email;
/*$emailAddress = "[email protected]";*/
[YADDA YADDA YADDA CODE]
";
/* onclick=\"filterTable()\" */
echo "
";
echo "
";$HoursRemaining = 0;
$results = $wpdb->get_results("SELECT form_value, form_date FROM `wp_db7_forms` WHERE (form_post_id = '13993' OR form_post_id = '13987' OR form_post_id = '13988' OR form_post_id = '13989' OR form_post_id = '13990' OR form_post_id = '13991' OR form_post_id = '13992' OR form_post_id = '13994') AND (form_date BETWEEN '$startDate' AND '$endDate') ORDER BY form_date ASC");
if(!empty($results)){
foreach($results as $rows){
$string = $rows->form_value;
$form_date = explode(" ", $rows->form_date);
$array = explode("\"", $string);
$indexName = array_search("clientName",$array);
$indexStatus = array_search("creditStatus", $array);
$indexAmount = array_search("creditAmount", $array);
$indexHour = array_search("creditHour", $array);
$indexDescription = array_search("description", $array);
/* if Credit paid by customers */
if ($array[$indexName+2] == $emailAddress && $array[$indexStatus+2] == "1"){
if($array[$indexDescription+2] == "CREDIT"){
$priceRate = $array[$indexAmount+2] / $array[$indexHour+2];
}
$HoursRemaining += $array[$indexHour+2];
echo "";
}
/* if Tasks made */
if ($array[$indexName+2] == $emailAddress && $array[$indexStatus+2] == "2"){
$HoursRemaining -= ($array[$indexHour+2] / 60);
echo "";
}
}
}
echo "
Date Description Hours Amount Hours Remaining
" . $form_date[0] . " " . $array[$indexDescription+2] . " + " . number_format(round($array[$indexHour+2], 2), 2) . " h +$ " . number_format(round($array[$indexAmount+2], 2), 2) . " " . number_format(round($HoursRemaining, 2), 2) . " h
" . $form_date[0] . " " . $array[$indexDescription+2] . " - " . number_format(round($array[$indexHour+2] / 60, 2), 2) . " h -$ " . number_format(round(($array[$indexHour+2] / 60 * $priceRate), 2), 2) . " " . number_format(round($HoursRemaining, 2), 2) . " h
[/insert_php]
本文标签:
版权声明:本文标题:mysql - How do I get create a custom table showing the hours remaining for all customers in one page from this transactions page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744945640a2633759.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论